[Mesa-dev] [PATCH] amd/common: fix loading InstanceID for tess on < GFX9

Bas Nieuwenhuizen bas at basnieuwenhuizen.nl
Fri Jan 12 15:38:51 UTC 2018


On Thu, Jan 11, 2018 at 2:58 PM, Samuel Pitoiset
<samuel.pitoiset at gmail.com> wrote:
>
>
> On 01/11/2018 02:56 PM, Samuel Pitoiset wrote:
>>
>> InstanceID is in VGPR2, not 1.
>>
>> One more failure that CTS didn't catch up...
>>
>> Reported-by: Alex Smith <asmith at feralinteractive.com>
>> Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
>> ---
>>   src/amd/common/ac_nir_to_llvm.c | 5 +++--
>>   1 file changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/src/amd/common/ac_nir_to_llvm.c
>> b/src/amd/common/ac_nir_to_llvm.c
>> index 7153c9708d..d1247a7a60 100644
>> --- a/src/amd/common/ac_nir_to_llvm.c
>> +++ b/src/amd/common/ac_nir_to_llvm.c
>> @@ -6714,8 +6714,9 @@ LLVMModuleRef
>> ac_translate_nir_to_llvm(LLVMTargetMachineRef tm,
>>                         ctx.abi.load_patch_vertices_in =
>> load_patch_vertices_in;
>>                 } else if (shaders[i]->info.stage == MESA_SHADER_VERTEX) {
>>                         if (shader_info->info.vs.needs_instance_id) {
>> -                               if (ctx.ac.chip_class == GFX9 &&
>> -                                   shaders[shader_count - 1]->info.stage
>> == MESA_SHADER_TESS_CTRL) {
>> +                               if (ctx.options->key.vs.as_ls ||
>> +                                   (ctx.ac.chip_class == GFX9 &&
>> +                                    shaders[shader_count - 1]->info.stage
>> == MESA_SHADER_TESS_CTRL)) {
>
>
> This could actually be simplified to "if (ctx->options->key.vs.as_ls) { ...
> }"

With that,

Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>

>
>>                                         ctx.shader_info->vs.vgpr_comp_cnt
>> =
>>                                                 MAX2(2,
>> ctx.shader_info->vs.vgpr_comp_cnt);
>>                                 } else {
>>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list