radv: spir-v allows texture size query with and without lod.
authorDave Airlie <airlied@redhat.com>
Fri, 18 Nov 2016 03:58:30 +0000 (03:58 +0000)
committerDave Airlie <airlied@redhat.com>
Sun, 20 Nov 2016 23:00:22 +0000 (09:00 +1000)
The translation to llvm was failing here due to required lod.

This fixes some new  SteamVR shaders.

Cc: "13.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
src/amd/common/ac_nir_to_llvm.c

index 5de1491123e771d4701e593f93d5857a54679024..1d71795426c9dd39fbbc371a80023c034cce9355 100644 (file)
@@ -3492,7 +3492,10 @@ static void visit_tex(struct nir_to_llvm_context *ctx, nir_tex_instr *instr)
                address[count++] = sample_index;
        } else if(instr->op == nir_texop_txs) {
                count = 0;
-               address[count++] = lod;
+               if (lod)
+                       address[count++] = lod;
+               else
+                       address[count++] = ctx->i32zero;
        }
 
        for (chan = 0; chan < count; chan++) {