Also, we should probably consider converting it over to a system value one
of these days.  That would make more sense from a theoretical model
perspective.  Not sure if it makes sense in any drivers though.

On Mon, Jan 9, 2017 at 8:03 AM, Jason Ekstrand <[email protected]> wrote:

> On Mon, Jan 9, 2017 at 4:50 AM, Iago Toral Quiroga <[email protected]>
> wrote:
>
>> Geometry and Tessellation stages do handle this as a system value instead.
>>
>> Fixes:
>> dEQP-VK.geometry.basic.primitive_id
>> ---
>>  src/compiler/spirv/vtn_variables.c | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/src/compiler/spirv/vtn_variables.c
>> b/src/compiler/spirv/vtn_variables.c
>> index 9b84c97..cf47e5d 100644
>> --- a/src/compiler/spirv/vtn_variables.c
>> +++ b/src/compiler/spirv/vtn_variables.c
>> @@ -908,7 +908,8 @@ vtn_get_builtin_location(struct vtn_builder *b,
>>        set_mode_system_value(mode);
>>        break;
>>     case SpvBuiltInPrimitiveId:
>> -      if (*mode == nir_var_shader_out) {
>> +      if (*mode == nir_var_shader_out ||
>> +          b->shader->stage == MESA_SHADER_FRAGMENT) {
>>
>
> Can we do this instead:
>
> if (b->shader->stage == MESA_SHADER_FRAGMENT) {
>    assert(*mode == nir_var_shader_in);
>    *location = VARYING_SLOT_PRIMITIVE_ID;
> } else if (*mode == nir_var_shader_out) {
>    ...
>
>
>>           *location = VARYING_SLOT_PRIMITIVE_ID;
>>        } else {
>>           *location = SYSTEM_VALUE_PRIMITIVE_ID;
>> --
>> 2.7.4
>>
>> _______________________________________________
>> mesa-dev mailing list
>> [email protected]
>> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>>
>
>
_______________________________________________
mesa-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to