mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-01 12:28:07 +02:00
spirv: Builtin Layer is an input for fragment shaders
This change makes it so we emit a load_input intrinsic when Layer is read in a fragment shader. Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
This commit is contained in:
parent
a7b510f656
commit
66e7effc85
1 changed files with 6 additions and 1 deletions
|
|
@ -819,7 +819,12 @@ vtn_get_builtin_location(struct vtn_builder *b,
|
|||
break;
|
||||
case SpvBuiltInLayer:
|
||||
*location = VARYING_SLOT_LAYER;
|
||||
*mode = nir_var_shader_out;
|
||||
if (b->shader->stage == MESA_SHADER_FRAGMENT)
|
||||
*mode = nir_var_shader_in;
|
||||
else if (b->shader->stage == MESA_SHADER_GEOMETRY)
|
||||
*mode = nir_var_shader_out;
|
||||
else
|
||||
unreachable("invalid stage for SpvBuiltInLayer");
|
||||
break;
|
||||
case SpvBuiltInViewportIndex:
|
||||
*location = VARYING_SLOT_VIEWPORT;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue