aboutsummaryrefslogtreecommitdiffstats
path: root/src/glsl
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2014-11-14 09:46:48 -0800
committerJason Ekstrand <[email protected]>2015-01-15 07:19:01 -0800
commit895eee505cf9d4145d901accc2767c373e12c05e (patch)
treef1160c8a762835da364b9e29e5983a99deb2d1db /src/glsl
parentcd01de08125202a7d77a337a85b38a492473500d (diff)
nir/lower_samplers: Use the nir_instr_rewrite_src function
Reviewed-by: Connor Abbott <[email protected]>
Diffstat (limited to 'src/glsl')
-rw-r--r--src/glsl/nir/nir_lower_samplers.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/glsl/nir/nir_lower_samplers.cpp b/src/glsl/nir/nir_lower_samplers.cpp
index e10456db230..347c84adc9b 100644
--- a/src/glsl/nir/nir_lower_samplers.cpp
+++ b/src/glsl/nir/nir_lower_samplers.cpp
@@ -124,7 +124,16 @@ lower_sampler(nir_tex_instr *instr, struct gl_shader_program *shader_program,
{
if (instr->sampler) {
instr->sampler_index = get_sampler_index(instr->sampler, shader_program,
- prog);
+ prog);
+ nir_src empty_src;
+ memset(&empty_src, 0, sizeof empty_src);
+ for (nir_deref *deref = &instr->sampler->deref; deref; deref = deref->child) {
+ if (deref->deref_type == nir_deref_type_array) {
+ nir_deref_array *arr = nir_deref_as_array(deref);
+ nir_instr_rewrite_src(&instr->instr, &arr->indirect, empty_src);
+ }
+ }
+
instr->sampler = NULL;
}
}