[Mesa-dev] [PATCH 04/15] mesa/glspirv: Set last_vert_prog

Alejandro Piñeiro apinheiro at igalia.com
Tue Jul 31 11:14:04 UTC 2018


On 30/07/18 11:23, Neil Roberts wrote:
> Timothy Arceri <tarceri at itsqueeze.com> writes:
>
>>> +
>>> +   int last_vert_stage =
>>> +      util_last_bit(prog->data->linked_stages &
>>> +                    (((1 << (MESA_SHADER_GEOMETRY + 1)) - 1) ^
>>> +                     ((1 << MESA_SHADER_VERTEX) - 1)));
>> Isn't this the same as:
>>
>>     int last_vert_stage =
>>        util_last_bit(prog->data->linked_stages &
>>                      ((1 << (MESA_SHADER_GEOMETRY + 1)) - 1));
>>
>> As ((1 << MESA_SHADER_VERTEX) - 1)) == 0
>>
>> If you use the above simplification this patch is:
>>
>> Reviewed-by: Timothy Arceri <tarceri at itsqueeze.com>
> This is based on code in link_varyings_and_uniforms which has a loop
> over all of the stages from geometry down to vertex to try and find the
> last vertex stage. I was trying to mimic this behaviour which is
> presumably saying vertex->geometry are the vertex stages and not just
> “anything up to and including geometry”.
>
> I don’t really mind either way whether we include the MESA_SHADER_VERTEX
> part or not. I guess the cleanest way could be to add a define for the
> mask in shader_enums.h to make it most likely not to break if any more
> stages are added. But seeing as there is precedent for having this range
> be open-coded in the code I guess we can just leave that to another
> patch.

Yes, I think that for now is more pragmatic to just go ahead with
Timothy's suggestion. I already made the change locally.

BR

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 163 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180731/f59bd496/attachment.sig>


More information about the mesa-dev mailing list