[Mesa-dev] [PATCH 5/8] anv/apply_dynamic_offsets: Only use one channel for computed offsets
Jason Ekstrand
jason at jlekstrand.net
Sat Mar 4 01:12:29 UTC 2017
The offset source of the UBO and SSBO intrinsics is only one channel.
---
src/intel/vulkan/anv_nir_apply_dynamic_offsets.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/intel/vulkan/anv_nir_apply_dynamic_offsets.c b/src/intel/vulkan/anv_nir_apply_dynamic_offsets.c
index 80ef8ee..f0f33ec 100644
--- a/src/intel/vulkan/anv_nir_apply_dynamic_offsets.c
+++ b/src/intel/vulkan/anv_nir_apply_dynamic_offsets.c
@@ -83,7 +83,8 @@ apply_dynamic_offsets_block(nir_block *block, nir_builder *b,
nir_src *offset_src = nir_get_io_offset_src(intrin);
nir_ssa_def *old_offset = nir_ssa_for_src(b, *offset_src, 1);
- nir_ssa_def *new_offset = nir_iadd(b, old_offset, &offset_load->dest.ssa);
+ nir_ssa_def *new_offset =
+ nir_iadd(b, old_offset, nir_channel(b, &offset_load->dest.ssa, 0));
nir_instr_rewrite_src(&intrin->instr, offset_src,
nir_src_for_ssa(new_offset));
--
2.5.0.400.gff86faf
More information about the mesa-dev
mailing list