summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Ekstrand <jason.ekstrand@intel.com>2016-04-18 17:55:21 -0700
committerJason Ekstrand <jason.ekstrand@intel.com>2016-04-20 09:14:58 -0700
commitf63a95080f240bed9cea3619f4ab43e8dc87292c (patch)
tree9b67d18216f2ec1a8ecb312dcffba33483cabf7d
parent35b758c378900b2c611050e782ca8100fbcc671d (diff)
downloadmesa-f63a95080f240bed9cea3619f4ab43e8dc87292c.tar.gz
mesa-f63a95080f240bed9cea3619f4ab43e8dc87292c.tar.xz
anv/apply_dynamic_offsets: Provide a range on the load_uniform
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94998 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=95001
-rw-r--r--src/intel/vulkan/anv_nir_apply_dynamic_offsets.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/intel/vulkan/anv_nir_apply_dynamic_offsets.c b/src/intel/vulkan/anv_nir_apply_dynamic_offsets.c
index 234855c..06fe8aa 100644
--- a/src/intel/vulkan/anv_nir_apply_dynamic_offsets.c
+++ b/src/intel/vulkan/anv_nir_apply_dynamic_offsets.c
@@ -77,11 +77,13 @@ apply_dynamic_offsets_block(nir_block *block, void *void_state)
/* First, we need to generate the uniform load for the buffer offset */
uint32_t index = state->layout->set[set].dynamic_offset_start +
set_layout->binding[binding].dynamic_offset_index;
+ uint32_t array_size = set_layout->binding[binding].array_size;
nir_intrinsic_instr *offset_load =
nir_intrinsic_instr_create(state->shader, nir_intrinsic_load_uniform);
offset_load->num_components = 2;
- offset_load->const_index[0] = state->indices_start + index * 8;
+ nir_intrinsic_set_base(offset_load, state->indices_start + index * 8);
+ nir_intrinsic_set_range(offset_load, array_size * 8);
offset_load->src[0] = nir_src_for_ssa(nir_imul(b, res_intrin->src[0].ssa,
nir_imm_int(b, 8)));