nir/spirv: Fix gl_BaseVertex for non-indexed draws for OpenGL
Lowers BaseVertex to the correct system value for OpenGL. v2: use options->environment rather than adding a new flag to spirv_to_nir_options Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
This commit is contained in:
parent
382f92a814
commit
954224b714
|
@ -1411,8 +1411,11 @@ 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).
|
||||
*/
|
||||
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;
|
||||
|
|
Loading…
Reference in New Issue