[Mesa-dev] [PATCH] radv: trim buffer load result (fixes dota2)
Samuel Pitoiset
samuel.pitoiset at gmail.com
Thu Jan 11 09:58:54 UTC 2018
On 01/11/2018 10:20 AM, Samuel Pitoiset wrote:
> How can this be reproduced? I have just launched the benchmark and dota2
> doesn't hit any LLVM assert.
dota2: /home/hakzsam/programming/llvm/lib/IR/Instructions.cpp:2565:
static llvm::CastInst*
llvm::CastInst::Create(llvm::Instruction::CastOps, llvm::Value*,
llvm::Type*, const llvm::Twine&, llvm::Instruction*): Assertion
`castIsValid(op, S, Ty) && "Invalid cast!"' failed.
It's better when LLVM assertions are enabled..
Reviewed-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
>
> On 01/11/2018 03:11 AM, Dave Airlie wrote:
>> From: Dave Airlie <airlied at redhat.com>
>>
>> Running dota2 since the below commit crashes with an llvm assert.
>>
>> Trim the vector like the other user. This possible could also be
>> avoided by not padding inside the load vec3->vec4.
>>
>> Fixes: 41c36c4549 (amd/common: use ac_build_buffer_load() for emitting
>> UBO loads)
>> Signed-off-by: Dave Airlie <airlied at redhat.com>
>> ---
>> src/amd/common/ac_nir_to_llvm.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/src/amd/common/ac_nir_to_llvm.c
>> b/src/amd/common/ac_nir_to_llvm.c
>> index 5885c70ef89..49147aef51f 100644
>> --- a/src/amd/common/ac_nir_to_llvm.c
>> +++ b/src/amd/common/ac_nir_to_llvm.c
>> @@ -2593,7 +2593,7 @@ static LLVMValueRef visit_load_ubo_buffer(struct
>> ac_nir_context *ctx,
>> ret = ac_build_buffer_load(&ctx->ac, rsrc, num_components, NULL,
>> offset,
>> NULL, 0, false, false, true, true);
>> -
>> + ret = trim_vector(&ctx->ac, ret, num_components);
>> return LLVMBuildBitCast(ctx->ac.builder, ret,
>> get_def_type(ctx, &instr->dest.ssa), "");
>> }
>>
More information about the mesa-dev
mailing list