struct brw_stage_prog_data *stage_prog_data,
bool is_scalar)
{
- if (var->type->without_array()->is_sampler())
+ if (var->type->without_array()->is_sampler() ||
+ var->type->without_array()->is_image())
return;
- if (var->type->without_array()->is_image()) {
- brw_setup_image_uniform_values(var, stage_prog_data);
- return;
- }
-
/* The data for our (non-builtin) uniforms is stored in a series of
* gl_uniform_storage structs for each subcomponent that
* glGetUniformLocation() could name. We know it's been set up in the same
stage_prog_data, is_scalar);
}
}
+
+ nir_foreach_image_variable(var, shader)
+ brw_setup_image_uniform_values(var, stage_prog_data);
}
void
const struct gl_program *prog)
{
/* We put image uniforms at the end */
- nir_foreach_uniform_variable(var, shader) {
- if (!var->type->contains_image())
- continue;
-
- /* GL Only allows arrays of arrays of images */
- assert(var->type->without_array()->is_image());
+ nir_foreach_image_variable(var, shader) {
const unsigned num_images = MAX2(1, var->type->arrays_of_arrays_size());
var->data.driver_location = shader->num_uniforms;