diff options
Diffstat (limited to 'src/compiler/spirv')
-rw-r--r-- | src/compiler/spirv/vtn_variables.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/compiler/spirv/vtn_variables.c b/src/compiler/spirv/vtn_variables.c index d4e3cac5db3..843801cae5a 100644 --- a/src/compiler/spirv/vtn_variables.c +++ b/src/compiler/spirv/vtn_variables.c @@ -1411,9 +1411,12 @@ vtn_get_builtin_location(struct vtn_builder *b, break; case SpvBuiltInBaseVertex: /* OpenGL gl_BaseVertex (SYSTEM_VALUE_BASE_VERTEX) is not the same - * semantic as SPIR-V BaseVertex (SYSTEM_VALUE_FIRST_VERTEX). + * semantic as Vulkan BaseVertex (SYSTEM_VALUE_FIRST_VERTEX). */ - *location = SYSTEM_VALUE_FIRST_VERTEX; + if (b->options->environment == NIR_SPIRV_OPENGL) + *location = SYSTEM_VALUE_BASE_VERTEX; + else + *location = SYSTEM_VALUE_FIRST_VERTEX; set_mode_system_value(b, mode); break; case SpvBuiltInBaseInstance: |