radv: fix btoi for R32G32B32 when the dest offset is not 0
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 22 Oct 2018 13:42:31 +0000 (15:42 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Tue, 23 Oct 2018 12:29:26 +0000 (14:29 +0200)
Fixes: 593996bc02 ("radv: implement buffer to image operations for R32G32B32")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/vulkan/radv_meta_bufimage.c

index 73a50342220d9731a2c74356d48af19cb1087e28..ec449c5bca5b75eb9060faa6ce16c9b9fc390e6e 100644 (file)
@@ -556,8 +556,8 @@ build_nir_btoi_r32g32b32_compute_shader(struct radv_device *dev)
 
        nir_ssa_def *global_pos =
                nir_iadd(&b,
-                        nir_imul(&b, pos_y, &pitch->dest.ssa),
-                        nir_imul(&b, pos_x, nir_imm_int(&b, 3)));
+                        nir_imul(&b, nir_channel(&b, img_coord, 1), &pitch->dest.ssa),
+                        nir_imul(&b, nir_channel(&b, img_coord, 0), nir_imm_int(&b, 3)));
 
        nir_ssa_def *input_img_deref = &nir_build_deref_var(&b, input_img)->dest.ssa;