From e3c6fba5d69a6695d7bc431440fa1f9276e82b10 Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Wed, 10 May 2017 15:41:25 +0200 Subject: [PATCH] glsl: pass the ir_variable object to set_opaque_binding() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit In order to set the explicit binding value for bindless samplers/images. Signed-off-by: Samuel Pitoiset Reviewed-by: Nicolai Hähnle --- src/compiler/glsl/link_uniform_initializers.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/compiler/glsl/link_uniform_initializers.cpp b/src/compiler/glsl/link_uniform_initializers.cpp index a7af75586e7..bc3dcab7c35 100644 --- a/src/compiler/glsl/link_uniform_initializers.cpp +++ b/src/compiler/glsl/link_uniform_initializers.cpp @@ -97,7 +97,8 @@ copy_constant_to_storage(union gl_constant_value *storage, */ void set_opaque_binding(void *mem_ctx, gl_shader_program *prog, - const glsl_type *type, const char *name, int *binding) + const ir_variable *var, const glsl_type *type, + const char *name, int *binding) { if (type->is_array() && type->fields.array->is_array()) { @@ -106,7 +107,7 @@ set_opaque_binding(void *mem_ctx, gl_shader_program *prog, for (unsigned int i = 0; i < type->length; i++) { const char *element_name = ralloc_asprintf(mem_ctx, "%s[%d]", name, i); - set_opaque_binding(mem_ctx, prog, element_type, + set_opaque_binding(mem_ctx, prog, var, element_type, element_name, binding); } } else { @@ -281,7 +282,7 @@ link_set_uniform_initializers(struct gl_shader_program *prog, if (type->without_array()->is_sampler() || type->without_array()->is_image()) { int binding = var->data.binding; - linker::set_opaque_binding(mem_ctx, prog, var->type, + linker::set_opaque_binding(mem_ctx, prog, var, var->type, var->name, &binding); } else if (var->is_in_buffer_block()) { const glsl_type *const iface_type = var->get_interface_type(); -- 2.30.2