Browse Source

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 <nicolai.haehnle@amd.com>
tags/18.0-branchpoint
Timothy Arceri 7 years ago
parent
commit
5b9362c248
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      src/amd/common/ac_llvm_build.c

+ 1
- 1
src/amd/common/ac_llvm_build.c View File

@@ -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, "");

Loading…
Cancel
Save