diff options
author | Omniscient <omniscient.oce@gmail.com> | 2024-06-10 15:12:28 +1000 |
---|---|---|
committer | Omniscient <omniscient.oce@gmail.com> | 2024-06-10 15:12:28 +1000 |
commit | ae214fc4c9a1cac1969f64b2316d8ec431b33693 (patch) | |
tree | 35968674ad0f7dd9b0f655ccab44a96a62343d6a /src/renderer/backends/opengl/backend_opengl.c | |
parent | 99f2476d7bb8479d543f080c209324c77c775737 (diff) |
default renderer pipeline
Diffstat (limited to 'src/renderer/backends/opengl/backend_opengl.c')
-rw-r--r-- | src/renderer/backends/opengl/backend_opengl.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/renderer/backends/opengl/backend_opengl.c b/src/renderer/backends/opengl/backend_opengl.c index de6b71a..5a11f39 100644 --- a/src/renderer/backends/opengl/backend_opengl.c +++ b/src/renderer/backends/opengl/backend_opengl.c @@ -103,7 +103,6 @@ gpu_pipeline* gpu_graphics_pipeline_create(struct graphics_pipeline_desc descrip glBindBuffer(GL_UNIFORM_BUFFER, ubo_buf->id.ubo); glBindBufferBase(GL_UNIFORM_BUFFER, binding_j, ubo_buf->id.ubo); if (blockIndex != GL_INVALID_INDEX) { - printf("Here\n"); glUniformBlockBinding(pipeline->shader_id, blockIndex, 0); } @@ -112,6 +111,8 @@ gpu_pipeline* gpu_graphics_pipeline_create(struct graphics_pipeline_desc descrip } } + pipeline->wireframe = description.wireframe; + return pipeline; } void gpu_pipeline_destroy(gpu_pipeline* pipeline) {} @@ -164,6 +165,13 @@ void copy_buffer_to_image_oneshot(buffer_handle src, texture_handle dst) {} // --- Render commands void encode_bind_pipeline(gpu_cmd_encoder* encoder, pipeline_kind kind, gpu_pipeline* pipeline) { encoder->pipeline = pipeline; + + if (pipeline->wireframe) { + glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); + } else { + glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); + } + // In OpenGL binding a pipeline is more or less equivalent to just setting the shader glUseProgram(pipeline->shader_id); } |