diff options
Diffstat (limited to 'src/renderer/backends/opengl')
-rw-r--r-- | src/renderer/backends/opengl/backend_opengl.c | 10 | ||||
-rw-r--r-- | src/renderer/backends/opengl/backend_opengl.h | 1 |
2 files changed, 10 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); } diff --git a/src/renderer/backends/opengl/backend_opengl.h b/src/renderer/backends/opengl/backend_opengl.h index f3b4eb7..ccdb446 100644 --- a/src/renderer/backends/opengl/backend_opengl.h +++ b/src/renderer/backends/opengl/backend_opengl.h @@ -20,6 +20,7 @@ typedef struct gpu_pipeline { u32 shader_id; vertex_description vertex_desc; buffer_handle uniform_bindings[MAX_PIPELINE_UNIFORM_BUFFERS]; + bool wireframe; } gpu_pipeline; typedef struct gpu_renderpass { void *pad |