[Mesa-dev] [PATCH 21/18] ac: skip type for tcs input on RADV

Timothy Arceri tarceri at itsqueeze.com
Mon Dec 11 21:16:34 UTC 2017


On 12/12/17 05:44, Dieter Nützel wrote:
> Tim,
> 
> I'm somewhat baffled...
> V1 do not have 20,21
> V2 do not have 19,21
> V3 do not have 19,20
> 
> Which one is right?

These are follow-on patches for the tess nir support for radeonsi (v1). 
The other two patches are standalone but this patch should probably be 
squashed with patch 3 before pushing if people agree its the right thing 
to do. I tried adding struct support to nir2llvmtype() but unfortunately 
the Vulkan vars had NULL in their names so I couldn't lookup the struct 
members index, not sure if this is a Vulkan bug but this and the 
previous patch work around it for now.

> 
> Thanks,
> Dieter
> 
> Am 11.12.2017 10:56, schrieb Timothy Arceri:
>> The type can be a struct on RADV and causes an assert() to be
>> thrown, for radeonsi all structs should have been lowered away.
>> ---
>>  src/amd/common/ac_nir_to_llvm.c | 6 ++++--
>>  1 file changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/src/amd/common/ac_nir_to_llvm.c 
>> b/src/amd/common/ac_nir_to_llvm.c
>> index 38a840bf813..1466c7f875f 100644
>> --- a/src/amd/common/ac_nir_to_llvm.c
>> +++ b/src/amd/common/ac_nir_to_llvm.c
>> @@ -2972,23 +2972,25 @@ static LLVMValueRef visit_load_var(struct
>> ac_nir_context *ctx,
>>              unsigned const_index = 0;
>>              unsigned location = instr->variables[0]->var->data.location;
>>              unsigned driver_location = 
>> instr->variables[0]->var->data.driver_location;
>>              const bool is_patch =  instr->variables[0]->var->data.patch;
>>              const bool is_compact = 
>> instr->variables[0]->var->data.compact;
>>
>>              get_deref_offset(ctx, instr->variables[0],
>>                       false, NULL, is_patch ? NULL : &vertex_index,
>>                       &const_index, &indir_index);
>>
>> +            LLVMTypeRef type = ctx->nctx ? NULL :
>> +                nir2llvmtype(ctx, instr->variables[0]->var->type);
>> +
>>              result = ctx->abi->load_tess_inputs(ctx->abi, 
>> vertex_index, indir_index,
>> -                                const_index, location, driver_location,
>> -                                nir2llvmtype(ctx, 
>> instr->variables[0]->var->type),
>> +                                const_index, location, 
>> driver_location, type,
>>                                  
>> instr->variables[0]->var->data.location_frac,
>>                                  instr->num_components,
>>                                  is_patch, is_compact);
>>              return ctx->nctx ?
>>                  LLVMBuildBitCast(ctx->nctx->builder, result, 
>> get_def_type(ctx,
>> &instr->dest.ssa), "") :
>>                  result;
>>          }
>>
>>          if (ctx->stage == MESA_SHADER_GEOMETRY) {
>>                  LLVMValueRef indir_index;


More information about the mesa-dev mailing list