summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker
diff options
context:
space:
mode:
authorRob Clark <[email protected]>2017-11-03 12:47:51 -0400
committerRob Clark <[email protected]>2017-11-12 12:28:59 -0500
commit0006b860ce83769e3d030ab1fec45a4de04dcadc (patch)
treea03f8386bc3580d747e961bd3f1cc3efc30e4805 /src/mesa/state_tracker
parentecbe1e976f279a3519aaf9ab365ebe28b60f1ace (diff)
mesa/st/nir: assign driver_location for images
Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r--src/mesa/state_tracker/st_glsl_to_nir.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/mesa/state_tracker/st_glsl_to_nir.cpp b/src/mesa/state_tracker/st_glsl_to_nir.cpp
index 1912da2404a..dd4b05d7b97 100644
--- a/src/mesa/state_tracker/st_glsl_to_nir.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_nir.cpp
@@ -176,6 +176,7 @@ st_nir_assign_uniform_locations(struct gl_program *prog,
{
int max = 0;
int shaderidx = 0;
+ int imageidx = 0;
nir_foreach_variable(uniform, uniform_list) {
int loc;
@@ -188,10 +189,13 @@ st_nir_assign_uniform_locations(struct gl_program *prog,
uniform->interface_type != NULL)
continue;
- if (uniform->type->is_sampler()) {
+ if (uniform->type->is_sampler() || uniform->type->is_image()) {
unsigned val = 0;
bool found = shader_program->UniformHash->get(val, uniform->name);
- loc = shaderidx++;
+ if (uniform->type->is_sampler())
+ loc = shaderidx++;
+ else
+ loc = imageidx++;
assert(found);
(void) found; /* silence unused var warning */
/* this ensure that nir_lower_samplers looks at the correct