summaryrefslogtreecommitdiffstats
path: root/src/amd
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2018-01-19 16:48:43 +1100
committerTimothy Arceri <[email protected]>2018-01-23 10:00:52 +1100
commit5b9362c2482393888366db38cba04aaf042ba7a8 (patch)
tree75f5dcf0c64ee9ff70e9d0a6188b69e12d227ec2 /src/amd
parent209b14c2cb99aae13f5c547fb2be5ed6607feef8 (diff)
ac: fix ac_build_varying_gather_values() for packed layouts
This fixes a segfault for varyings not starting at component 0. Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/amd')
-rw-r--r--src/amd/common/ac_llvm_build.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/amd/common/ac_llvm_build.c b/src/amd/common/ac_llvm_build.c
index 3467bba693e..6615a269f83 100644
--- a/src/amd/common/ac_llvm_build.c
+++ b/src/amd/common/ac_llvm_build.c
@@ -413,7 +413,7 @@ ac_build_varying_gather_values(struct ac_llvm_context *ctx, LLVMValueRef *values
for (unsigned i = component; i < value_count + component; i++) {
LLVMValueRef value = values[i];
- if (!i)
+ if (i == component)
vec = LLVMGetUndef( LLVMVectorType(LLVMTypeOf(value), value_count));
LLVMValueRef index = LLVMConstInt(ctx->i32, i - component, false);
vec = LLVMBuildInsertElement(ctx->builder, vec, value, index, "");