ac/nir: Fix nir_texop_lod on GFX for 1D arrays.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Sun, 22 Oct 2017 16:32:14 +0000 (18:32 +0200)
committerBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Sun, 22 Oct 2017 22:27:44 +0000 (00:27 +0200)
Fixes: 1bcb953e166 'radv: handle GFX9 1D textures'
Reviewed-by: Dave Airlie <airlied@redhat.com>
src/amd/common/ac_nir_to_llvm.c

index 360ca81ca897f6941796e21b6704bbf7cacb6f68..5e5a46a21f473f88a4ed15969315096b43593365 100644 (file)
@@ -4747,7 +4747,9 @@ static void visit_tex(struct ac_nir_context *ctx, nir_tex_instr *instr)
                                filler = LLVMConstReal(ctx->ac.f32, 0.5);
 
                        if (instr->sampler_dim == GLSL_SAMPLER_DIM_1D) {
-                               if (instr->is_array) {
+                               /* No nir_texop_lod, because it does not take a slice
+                                * even with array textures. */
+                               if (instr->is_array && instr->op != nir_texop_lod ) {
                                        address[count] = address[count - 1];
                                        address[count - 1] = filler;
                                        count++;