Move to use the GPU API instead OpenGL #23

Merged
Bogdan Nagirniak merged 9 commits from BLEN-371 into hydra-render 2023-04-07 13:28:49 +02:00
2 changed files with 17 additions and 1 deletions
Showing only changes of commit ba5b42e4a7 - Show all commits

View File

@ -5,6 +5,8 @@
#include "BKE_lib_id.h"
#include "DEG_depsgraph_query.h"
#include "GPU_texture.h"
#include "GPU_framebuffer.h"
#include "camera.h"
#include "final_engine.h"
@ -195,6 +197,20 @@ void FinalEngineGL::render(Depsgraph *depsgraph)
{"Combined", std::vector<float>(res[0] * res[1] * 4)}}; // 4 - number of channels
std::vector<float> &pixels = render_images["Combined"];
//GPUFrameBuffer *framebuffer = GPU_framebuffer_create("fbHydraRenderFinal");
//GPUTexture *texture = GPU_texture_create_2d("texHydraRenderViewport",
// res[0],
// res[1],
// 1,
// GPU_RGBA32F,
// GPU_TEXTURE_USAGE_GENERAL,
// nullptr);
//GPU_texture_filter_mode(texture, true);
//GPU_texture_wrap_mode(texture, true, true);
//GPU_framebuffer_texture_attach(framebuffer, texture, 0, 0);
//GPU_framebuffer_bind(framebuffer);
GLuint framebuffer_name = 0;
glGenFramebuffers(1, &framebuffer_name);
glBindFramebuffer(GL_FRAMEBUFFER, framebuffer_name);

View File

@ -180,7 +180,7 @@ void DrawTexture::create(pxr::HdRenderBuffer *buffer)
channels = pxr::HdGetComponentCount(buffer->GetFormat());
void *data = buffer->Map();
texture = GPU_texture_create_2d("HydraRendeViewport",
texture = GPU_texture_create_2d("texHydraRenderViewport",
width,
height,
1,