[Mesa-dev] [PATCH] ac: do not force enable IDXEN for 16-bit SSBO loads

Samuel Pitoiset samuel.pitoiset at gmail.com
Wed Mar 13 09:55:34 UTC 2019


The struct version enables IDXEN, while the raw one disables it.
When vindex is unused, the raw version is enough.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
---
 src/amd/common/ac_llvm_build.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/amd/common/ac_llvm_build.c b/src/amd/common/ac_llvm_build.c
index bc64f0bb7e3..8960b5ad4ff 100644
--- a/src/amd/common/ac_llvm_build.c
+++ b/src/amd/common/ac_llvm_build.c
@@ -1383,11 +1383,13 @@ ac_build_tbuffer_load_short(struct ac_llvm_context *ctx,
 	LLVMValueRef res;
 
 	if (HAVE_LLVM >= 0x0800) {
+		bool structurized = vindex && vindex != ctx->i32_0;
+
 		voffset = LLVMBuildAdd(ctx->builder, voffset, immoffset, "");
 
 		res = ac_build_llvm8_tbuffer_load(ctx, rsrc, vindex, voffset,
 						  soffset, 1, dfmt, nfmt, glc,
-						  false, true, true);
+						  false, true, structurized);
 	} else {
 		const char *name = "llvm.amdgcn.tbuffer.load.i32";
 		LLVMTypeRef type = ctx->i32;
-- 
2.21.0



More information about the mesa-dev mailing list