radv/ac: fix texture derivative ordering
authorDave Airlie <airlied@redhat.com>
Sun, 19 Mar 2017 03:39:29 +0000 (13:39 +1000)
committerDave Airlie <airlied@redhat.com>
Mon, 3 Apr 2017 19:39:10 +0000 (05:39 +1000)
The ordering NIR gives us is correct for the hw, this fixes:
dEQP-VK.glsl.texture_functions.texturegrad.* (mainly trigged
on isampler/usampler 3d textures.).

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Dave Airlie <airlied@redhat.com>
src/amd/common/ac_nir_to_llvm.c

index 7ac9a1a3167f0d74d004b2ff03a482df002abba9..c8ea0da7740cf4652d0496c052dad641687530a1 100644 (file)
@@ -4230,8 +4230,8 @@ static void visit_tex(struct nir_to_llvm_context *ctx, nir_tex_instr *instr)
                }
 
                for (unsigned i = 0; i < num_deriv_comp; i++) {
-                       derivs[i * 2] = to_float(ctx, llvm_extract_elem(ctx, ddx, i));
-                       derivs[i * 2 + 1] = to_float(ctx, llvm_extract_elem(ctx, ddy, i));
+                       derivs[i] = to_float(ctx, llvm_extract_elem(ctx, ddx, i));
+                       derivs[num_deriv_comp + i] = to_float(ctx, llvm_extract_elem(ctx, ddy, i));
                }
        }