[Mesa-dev] [PATCH 21/29] radv/ac: handle case of swizzle with single components in get_alu_src.

Dave Airlie airlied at gmail.com
Mon Jan 30 06:02:55 UTC 2017


From: Dave Airlie <airlied at redhat.com>

This gets hit with some geom shaders.

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 6f7d8a0..4139b0a 100644
--- a/src/amd/common/ac_nir_to_llvm.c
+++ b/src/amd/common/ac_nir_to_llvm.c
@@ -852,7 +852,10 @@ static LLVMValueRef get_alu_src(struct nir_to_llvm_context *ctx,
 		    LLVMConstInt(ctx->i32, src.swizzle[2], false),
 		    LLVMConstInt(ctx->i32, src.swizzle[3], false)};
 
-		if (src_components > 1 && num_components == 1) {
+		if (src_components == 1 && num_components == 1) {
+			value = LLVMBuildExtractElement(ctx->builder, value,
+			                                masks[0], "");
+		} else if (src_components > 1 && num_components == 1) {
 			value = LLVMBuildExtractElement(ctx->builder, value,
 			                                masks[0], "");
 		} else if (src_components == 1 && num_components > 1) {
-- 
2.9.3



More information about the mesa-dev mailing list