mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 07:08:04 +02:00
nir/spirv: Fix handling of gl_PrimitiveId
Before, we were always treating it as an output which bogus. The only
stage in which this it can be an output is the geometry stage. In all
other stages, it's an input which, in the back-end, we actually want to be
a system value.
Cc: "13.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 9557147592)
This commit is contained in:
parent
4c21d20dcf
commit
90bf0cb313
1 changed files with 6 additions and 2 deletions
|
|
@ -805,8 +805,12 @@ vtn_get_builtin_location(struct vtn_builder *b,
|
|||
set_mode_system_value(mode);
|
||||
break;
|
||||
case SpvBuiltInPrimitiveId:
|
||||
*location = VARYING_SLOT_PRIMITIVE_ID;
|
||||
*mode = nir_var_shader_out;
|
||||
if (*mode == nir_var_shader_out) {
|
||||
*location = VARYING_SLOT_PRIMITIVE_ID;
|
||||
} else {
|
||||
*location = SYSTEM_VALUE_PRIMITIVE_ID;
|
||||
set_mode_system_value(mode);
|
||||
}
|
||||
break;
|
||||
case SpvBuiltInInvocationId:
|
||||
*location = SYSTEM_VALUE_INVOCATION_ID;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue