spirv: gl_PrimitiveID in the fragment shader is handled as an input
Geometry and Tessellation stages do handle this as a system value instead. Fixes: dEQP-VK.geometry.basic.primitive_id Reviewed-by: Dave Airlie <ailried@redhat.com>
This commit is contained in:
parent
99e9dca149
commit
a9f497c678
1 changed files with 4 additions and 1 deletions
|
|
@ -908,7 +908,10 @@ vtn_get_builtin_location(struct vtn_builder *b,
|
|||
set_mode_system_value(mode);
|
||||
break;
|
||||
case SpvBuiltInPrimitiveId:
|
||||
if (*mode == nir_var_shader_out) {
|
||||
if (b->shader->stage == MESA_SHADER_FRAGMENT) {
|
||||
assert(*mode == nir_var_shader_in);
|
||||
*location = VARYING_SLOT_PRIMITIVE_ID;
|
||||
} else if (*mode == nir_var_shader_out) {
|
||||
*location = VARYING_SLOT_PRIMITIVE_ID;
|
||||
} else {
|
||||
*location = SYSTEM_VALUE_PRIMITIVE_ID;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue