[Mesa-dev] [PATCH 3/3] glsl: pass the ir_variable object to set_opaque_binding()
Samuel Pitoiset
samuel.pitoiset at gmail.com
Thu May 11 10:31:28 UTC 2017
Useful when it's needed to rely on variable data. Will be used
for bindless samplers/images in a future patches series.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
---
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 a7af75586e..bc3dcab7c3 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.12.2
More information about the mesa-dev
mailing list