mesa/src/compiler/spirv
Neil Roberts be6f472b23 spirv: Make VertexIndex and VertexId both non-zero-based
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>
2018-08-13 16:23:36 +02:00
..
.gitignore .gitignore: Ignore new generated files 2018-01-08 21:11:11 -08:00
gl_spirv.c nir/spirv: add gl_spirv_validation method 2018-03-30 09:14:56 +02:00
GLSL.ext.AMD.h spirv: import AMD extensions header from glslang 2018-03-07 23:09:58 +01:00
GLSL.std.450.h spirv: bump headers to SPIRV 1.1 2017-01-25 17:22:23 +00:00
meson.build meson: Build with Python 3 2018-08-10 15:15:09 -07:00
nir_spirv.h nir/spirv: add gl_spirv_validation method 2018-03-30 09:14:56 +02:00
OpenCL.std.h nir/spirv: import OpenCL.std.h 2018-07-24 20:40:05 +02:00
spirv.core.grammar.json spirv: Include headers and grammar for SPV_KHR_8bit_storage 2018-07-10 00:14:50 +02:00
spirv.h spirv: Include headers and grammar for SPV_KHR_8bit_storage 2018-07-10 00:14:50 +02:00
spirv2nir.c spirv: Rework logging 2017-12-04 09:21:09 -08:00
spirv_info.h spirv/info: Add spirv_op_to_string 2018-01-08 14:57:44 -08:00
spirv_info_c.py spirv/info: Add spirv_op_to_string 2018-01-08 14:57:44 -08:00
spirv_to_nir.c spirv: fill info.gs.input_primitive too 2018-08-13 12:56:51 +02:00
vtn_alu.c nir/spirv: print id for unsupported alu opcode 2018-07-17 13:24:09 +02:00
vtn_amd.c nir/spirv: s/uint32_t/SpvOp/ in various functions 2018-03-30 14:33:33 -06:00
vtn_cfg.c nir,spirv: Rework function calls 2018-06-22 20:15:58 -07:00
vtn_gather_types_c.py spirv: Add a prepass to set types on vtn_values 2017-12-11 22:28:34 -08:00
vtn_glsl450.c nir: add builtin builder 2018-07-24 20:40:05 +02:00
vtn_private.h spirv/nir: add offset at vtn_variable 2018-07-03 12:37:32 +02:00
vtn_subgroup.c nir/spirv: Fix warning and add missing breaks. 2018-04-14 00:52:22 +02:00
vtn_variables.c spirv: Make VertexIndex and VertexId both non-zero-based 2018-08-13 16:23:36 +02:00