mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-05 06:50:10 +01:00
GLSL has gl_VertexID which is supposed to be non-zero-based.
SPIR-V has both VertexIndex and VertexId builtins whose meanings are
defined by the APIs.
Vulkan defines VertexIndex as being non-zero-based. In Vulkan VertexId
and InstanceId have no meaning and are pretty much just reserved for
OpenGL at this point.
GL_ARB_spirv removes VertexIndex and defines VertexId to be the same
as gl_VertexId (which is also non-zero-based).
Previously in Mesa it was treating VertexIndex as non-zero-based and
VertexId as zero-based, so it was breaking for GL. This behaviour was
apparently based on Khronos bug 14255. However that bug doesn’t seem
to have made a final decision for VertexId.
Assuming there really is no other definition for VertexId for Vulkan
it seems better to just make them both have the same value.
v2: update comment and commit descriptions, based on Jason Ekstrand
explanation of the meaning/rationale behind all those builtins
(Jason)
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
|
||
|---|---|---|
| .. | ||
| .gitignore | ||
| gl_spirv.c | ||
| GLSL.ext.AMD.h | ||
| GLSL.std.450.h | ||
| meson.build | ||
| nir_spirv.h | ||
| OpenCL.std.h | ||
| spirv.core.grammar.json | ||
| spirv.h | ||
| spirv2nir.c | ||
| spirv_info.h | ||
| spirv_info_c.py | ||
| spirv_to_nir.c | ||
| vtn_alu.c | ||
| vtn_amd.c | ||
| vtn_cfg.c | ||
| vtn_gather_types_c.py | ||
| vtn_glsl450.c | ||
| vtn_private.h | ||
| vtn_subgroup.c | ||
| vtn_variables.c | ||