summaryrefslogtreecommitdiffstats
path: root/src/compiler
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2017-05-10 15:41:25 +0200
committerSamuel Pitoiset <[email protected]>2017-06-14 10:04:36 +0200
commite3c6fba5d69a6695d7bc431440fa1f9276e82b10 (patch)
treecaebf339061d685a6d3fc4019a752c1ba223881a /src/compiler
parent3a087dd7a4bd5d7e69ea2b79ca0e2004badb073d (diff)
glsl: pass the ir_variable object to set_opaque_binding()
In order to set the explicit binding value for bindless samplers/images. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/glsl/link_uniform_initializers.cpp7
1 files 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();