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

Roland Scheidegger sroland at vmware.com
Thu Dec 11 18:27:42 PST 2014


Am 11.12.2014 um 23:51 schrieb Marek Olšák:
> 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.

Ok then I'll stick with that I was hoping this would be the case. It
would be GREAT if the GL spec could clarify that somewhere (probably in
ARB_shader_draw_parameters unless it already does so somewhere else...).


Roland

> 
> 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:
>> https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.freedesktop.org_archives_mesa-2Ddev_2014-2DAugust_065172.html&d=AAIBaQ&c=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEs&r=Vjtt0vs_iqoI31UfJxBl7yv9I2FeiaeAYgMTLKRBc_I&m=yvAzSgghgk7I0SyY4IpQp17eF3KbGdo6vAUDzUp0WcA&s=DCH0a8trKArcjz7_D68a9m9ew5Bq-Bzlzv0y5Er9dGM&e= 
>>
>> 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
>> https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.freedesktop.org_mailman_listinfo_mesa-2Ddev&d=AAIBaQ&c=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEs&r=Vjtt0vs_iqoI31UfJxBl7yv9I2FeiaeAYgMTLKRBc_I&m=yvAzSgghgk7I0SyY4IpQp17eF3KbGdo6vAUDzUp0WcA&s=tXRzMLhFIZCBb261uxvBO-GgsAU8kYr5ncU-s7aEDQM&e= 



More information about the mesa-dev mailing list