diff options
author | Omniscient <omniscient.oce@gmail.com> | 2024-06-15 16:38:05 +1000 |
---|---|---|
committer | Omniscient <omniscient.oce@gmail.com> | 2024-06-15 16:38:05 +1000 |
commit | c5808488875484aca814bfc8e526f37f3f447166 (patch) | |
tree | e560bc86302fad0c8520140511e1994c2b4800d7 /src/renderer/backends | |
parent | 59f67f04d7238453da766218a37b3c78607fb122 (diff) |
shinchoku
Diffstat (limited to 'src/renderer/backends')
-rw-r--r-- | src/renderer/backends/opengl/backend_opengl.c | 13 | ||||
-rw-r--r-- | src/renderer/backends/opengl/backend_opengl.h | 1 |
2 files changed, 9 insertions, 5 deletions
diff --git a/src/renderer/backends/opengl/backend_opengl.c b/src/renderer/backends/opengl/backend_opengl.c index 5a11f39..478ba0c 100644 --- a/src/renderer/backends/opengl/backend_opengl.c +++ b/src/renderer/backends/opengl/backend_opengl.c @@ -55,7 +55,7 @@ bool gpu_backend_init(const char* window_name, struct GLFWwindow* window) { } glEnable(GL_DEPTH_TEST); - // glFrontFace(GL_CW); + glEnable(GL_CULL_FACE); return true; } @@ -93,8 +93,13 @@ gpu_pipeline* gpu_graphics_pipeline_create(struct graphics_pipeline_desc descrip pipeline->uniform_bindings[binding_id] = ubo_handle; gpu_buffer* ubo_buf = BUFFER_GET(ubo_handle); - u32 blockIndex = glGetUniformBlockIndex(pipeline->shader_id, "Matrices"); - printf("Block index for Matrices: %d", blockIndex); + i32 blockIndex = glGetUniformBlockIndex(pipeline->shader_id, binding.label); + /* printf("Block index for Matrices: %d", blockIndex); */ + 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); + } u32 blocksize; glGetActiveUniformBlockiv(pipeline->shader_id, blockIndex, GL_UNIFORM_BLOCK_DATA_SIZE, &blocksize); @@ -259,7 +264,7 @@ buffer_handle gpu_buffer_create(u64 size, gpu_buffer_type buf_type, gpu_buffer_f TRACE("Upload data (%d bytes) as part of buffer creation", size); glBufferData(gl_buf_type, buffer->size, data, gl_buf_usage); } else { - TRACE("Allocating the correct size anyway"); + TRACE("Allocating but not uploading (%d bytes)", size); glBufferData(gl_buf_type, buffer->size, NULL, gl_buf_usage); } diff --git a/src/renderer/backends/opengl/backend_opengl.h b/src/renderer/backends/opengl/backend_opengl.h index ccdb446..cde52a3 100644 --- a/src/renderer/backends/opengl/backend_opengl.h +++ b/src/renderer/backends/opengl/backend_opengl.h @@ -47,7 +47,6 @@ typedef struct gpu_texture { } gpu_texture; typedef struct opengl_support { - } opengl_support; u32 shader_create_separate(const char *vert_shader, const char *frag_shader); |