[Mesa-dev] [PATCH 1/3] gallium: add TGSI_SEMANTIC_VERTEXID_ZEROBASE and TGSI_SEMANTIC_BASEVERTEX

Marek Olšák maraeo at gmail.com
Thu Dec 11 14:51:57 PST 2014


What radeonsi does is:

basevertex = info->indexed ? info->index_bias : info->start;

This is also what the hardware does for indirect draws and we cannot
change it. The basevertex shader system value must contain start,
because it's used to fetch vertices in vertex shaders.

Marek

On Thu, Dec 11, 2014 at 7:50 PM, Roland Scheidegger <sroland at vmware.com> wrote:
> Am 11.12.2014 um 17:49 schrieb Ilia Mirkin:
>> On Thu, Dec 11, 2014 at 11:39 AM, Jose Fonseca <jfonseca at vmware.com> wrote:
>>> Overall I think this is a great cleanup.
>>>
>>> Just a remark about the chosen names.
>>>
>>> On 10/12/14 21:22, sroland at vmware.com wrote:
>>>>
>>>> From: Roland Scheidegger <sroland at vmware.com>
>>>
>>>
>>>
>>>
>>>> Plus a new PIPE_CAP_VERTEXID_NOOFFSET query.
>>>
>>>
>>> "Vertex offset" and "base vertex" are difference concepts, so I'd rather not
>>> mix them up.
>>>
>>> AFAICT, this is about base vertex, not offsets in vertex buffers, hence
>>> NOOFFSET seems to be a misnomer.  Please pick "NOBASE" or "ZEROBASE" suffix
>>> and stick with it.
>>>
>>> Personally, I prefer "NOBASE".  As "ZEROBASE" sounds like that base vertex
>>> must some how be zero, which is not the case.
>>>
>>
>> Is all this really just about the base vertex? The situation on, e.g.,
>> a3xx is that the vertex id does not include any offset, even the
>> 'start' from glDrawArrays (which makes sense, since they use the same
>> general logic).
>>
>>   -ilia
>>
>
> Well this is actually kind of unresolved. I thought that gl_BaseVertex
> would include "first" parameter and similar of DrawArrays, so that
> really gl_VertexID = gl_BaseVertex + "vertex id without basevertex
> included as known from d3d10". Always. And not just for DrawElements
> calls (which would be a pain - the ARB_shader_draw_parameters extension
> sort of implies it could be used to translate between different APIs,
> but it's mostly useless if it doesn't work for all kind of draw calls)!
>
> The discussion about this was here:
> http://lists.freedesktop.org/archives/mesa-dev/2014-August/065172.html
>
> So, I have no idea if this is right. And you are right "BaseVertex" is
> sort of ambigous there, I guess if it doesn't include drawArrays "first"
> parameter the whole point of lowering is kinda lost. I've written this
> under the assumption that gl_Basevertex does include "first" from
> DrawArrays, so the ambigous name wasn't chosen by me in that case then :-).
>
> Roland
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list