[Mesa-dev] [PATCH] ac: fix ac_build_varying_gather_values() for packed layouts
Nicolai Hähnle
nhaehnle at gmail.com
Mon Jan 22 13:20:00 UTC 2018
On 19.01.2018 06:50, Timothy Arceri wrote:
> This fixes a segfault for varyings not starting at component 0.
Reviewed-by: Nicolai Hähnle <nicolai.haehnle at amd.com>
> ---
> src/amd/common/ac_llvm_build.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/amd/common/ac_llvm_build.c b/src/amd/common/ac_llvm_build.c
> index 3467bba693..6615a269f8 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, "");
>
--
Lerne, wie die Welt wirklich ist,
Aber vergiss niemals, wie sie sein sollte.
More information about the mesa-dev
mailing list