From 3c9d08717cd129c1576ea91e5bd4b7b8e0af9885 Mon Sep 17 00:00:00 2001 From: omniscient <17525998+omnisci3nce@users.noreply.github.com> Date: Sun, 16 Jun 2024 22:37:15 +1000 Subject: fix one silly issue --- src/renderer/backends/opengl/backend_opengl.c | 11 +++-------- src/renderer/backends/opengl/backend_opengl.h | 5 ++++- 2 files changed, 7 insertions(+), 9 deletions(-) (limited to 'src/renderer') diff --git a/src/renderer/backends/opengl/backend_opengl.c b/src/renderer/backends/opengl/backend_opengl.c index 18e7d2a..9ae77b4 100644 --- a/src/renderer/backends/opengl/backend_opengl.c +++ b/src/renderer/backends/opengl/backend_opengl.c @@ -199,20 +199,15 @@ void encode_bind_shader_data(gpu_cmd_encoder* encoder, u32 group, shader_data* d if (blockIndex < 0) { WARN("Couldn't retrieve block index for uniform block '%s'", binding.label); } else { - // DEBUG("Retrived block index %d for %s", blockIndex, binding.label); + DEBUG("Retrived block index %d for %s", blockIndex, binding.label); } glBindBuffer(GL_UNIFORM_BUFFER, ubo_buf->id.ubo); glBindBufferBase(GL_UNIFORM_BUFFER, i, ubo_buf->id.ubo); if (i == 2) { - pbr_params_light_uniforms* u = binding.data.bytes.data; - vec4* v = &u->viewPos; - (*v).x = 0.0; - (*v).y = 0.0; - (*v).z = 1.0; - // print_vec3(*v); + // pbr_params_light_uniforms* u = binding.data.bytes.data; + // vec4* v = &u->viewPos; } - // glBindBufferBase(GL_UNIFORM_BUFFER, i, ubo_buf->id.ubo); glBufferSubData(GL_UNIFORM_BUFFER, 0, ubo_buf->size, binding.data.bytes.data); } else if (binding.type == SHADER_BINDING_TEXTURE) { diff --git a/src/renderer/backends/opengl/backend_opengl.h b/src/renderer/backends/opengl/backend_opengl.h index cde52a3..f52bd79 100644 --- a/src/renderer/backends/opengl/backend_opengl.h +++ b/src/renderer/backends/opengl/backend_opengl.h @@ -38,7 +38,10 @@ typedef struct gpu_buffer { u32 ibo; u32 ubo; } id; - u32 vao; // Optional + union { + u32 vao; + u32 ubo_binding_point + }; // Optional u64 size; } gpu_buffer; typedef struct gpu_texture { -- cgit v1.2.3-70-g09d2