Mesa (master): radv: spir-v allows texture size query with and without lod.

Dave Airlie airlied at kemper.freedesktop.org
Sun Nov 20 23:07:04 UTC 2016


Module: Mesa
Branch: master
Commit: b1340fd708bb873617b8a529ac45cbc9507bd6c4
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=b1340fd708bb873617b8a529ac45cbc9507bd6c4

Author: Dave Airlie <airlied at redhat.com>
Date:   Fri Nov 18 03:58:30 2016 +0000

radv: spir-v allows texture size query with and without lod.

The translation to llvm was failing here due to required lod.

This fixes some new  SteamVR shaders.

Cc: "13.0" <mesa-stable at lists.freedesktop.org>
Reviewed-by: Edward O'Callaghan <funfunctor at folklore1984.net>
Signed-off-by: Dave Airlie <airlied at redhat.com>

---

 src/amd/common/ac_nir_to_llvm.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c
index 5de1491..1d71795 100644
--- a/src/amd/common/ac_nir_to_llvm.c
+++ b/src/amd/common/ac_nir_to_llvm.c
@@ -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++) {




More information about the mesa-commit mailing list