diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/renderer/backends/opengl/backend_opengl.c | 2 | ||||
-rw-r--r-- | src/renderer/builtin_materials.h | 8 | ||||
-rw-r--r-- | src/renderer/ral.h | 4 |
3 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 18cd7ee..18d1617 100644 --- a/src/renderer/backends/opengl/backend_opengl.c +++ b/src/renderer/backends/opengl/backend_opengl.c @@ -211,6 +211,8 @@ void encode_bind_shader_data(gpu_cmd_encoder* encoder, u32 group, shader_data* d } else if (binding.type == SHADER_BINDING_TEXTURE) { gpu_texture* tex = TEXTURE_GET(binding.data.texture.handle); + GLuint tex_slot = glGetUniformLocation(encoder->pipeline->shader_id, binding.label); + glUniform1i(tex_slot, i); glActiveTexture(GL_TEXTURE0 + i); glBindTexture(GL_TEXTURE_2D, tex->id); } diff --git a/src/renderer/builtin_materials.h b/src/renderer/builtin_materials.h index f0e7d2f..f2db5f4 100644 --- a/src/renderer/builtin_materials.h +++ b/src/renderer/builtin_materials.h @@ -127,16 +127,16 @@ static shader_data_layout pbr_textured_shader_layout(void* data) { .stores_data = has_data, .data = { .bytes = { .size = sizeof(pbr_params_light_uniforms) } } }; - shader_binding b3 = {.label = "Albedo", + shader_binding b3 = {.label = "albedoMap", .type = SHADER_BINDING_TEXTURE, .stores_data = has_data }; - shader_binding b4 = {.label = "Metallic Roughness", + shader_binding b4 = {.label = "metallicRoughnessMap", .type = SHADER_BINDING_TEXTURE, .stores_data = has_data }; - shader_binding b5 = {.label = "Ambient Occlusion", + shader_binding b5 = {.label = "aoMap", .type = SHADER_BINDING_TEXTURE, .stores_data = has_data }; - shader_binding b6 = {.label = "Normal Vectors", + shader_binding b6 = {.label = "normalMap", .type = SHADER_BINDING_TEXTURE, .stores_data = has_data }; diff --git a/src/renderer/ral.h b/src/renderer/ral.h index 067847b..cd3f19f 100644 --- a/src/renderer/ral.h +++ b/src/renderer/ral.h @@ -96,7 +96,9 @@ struct graphics_pipeline_desc { bool depth_test; }; -typedef struct gpu_renderpass_desc { /* TODO */ +typedef struct gpu_renderpass_desc { + texture_handle color_target; // for now only support one + texture_handle depth_stencil; } gpu_renderpass_desc; // --- Lifecycle functions |