[Mesa-dev] LAYER_PROVOKING_VERTEX and VIEWPORT_INDEX_PROVOKING_VERTEX queries

Brian Paul brianp at vmware.com
Tue Dec 1 09:47:21 PST 2015


On 12/01/2015 10:43 AM, Roland Scheidegger wrote:
> Trying to fix some draw bugs with layer/vp outputs (and clipping), I was
> wondering if GL actually guarantees sane results if the layer/vp index
> isn't the same on all vertices. And sure it seems it does, albeit it's
> implementation-dependent. Specifically (from gl 4.4 core, page 388)
>
> "viewport index is implementation-dependent and thus portable
> applications will assign the same layer and viewport index for all
> vertices in a primitive. The vertex conventions followed for gl_Layer
> and gl_ViewportIndex may be determined by calling GetIntegerv with the
> symbolic constants LAYER_PROVOKING_VERTEX and
> VIEWPORT_INDEX_PROVOKING_VERTEX, respectively. For either query, if the
> value returned is PROVOKING_VERTEX, then vertex selection follows the
> convention specified by ProvokingVertex (see section 13.4). If the value
> returned is FIRST_VERTEX_CONVENTION, selection is always taken from the
> first vertex of a primitive. If the value returned is
> LAST_VERTEX_CONVENTION, the selection is always taken from the last
> vertex of a primitive. If the value returned is UNDEFINED_VERTEX, the
> selection is not guaranteed to be taken from any specific vertex in the
> primitive."
>
> However, what mesa does is just return Light.ProvokingVertex. This means
> that if you switch the provoking vertex, the result will be different,
> which seems quite inappropriate for this implementation-dependent query.
> Albeit I'm not sure what the result really should be, that is if all
> drivers will do the same - I guess though UNDEFINED_VERTEX would always
> be correct.

That would seem to be safest, and simplest.

-Brian




More information about the mesa-dev mailing list