mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-04 22:49:13 +02:00
intel/compiler: mark some variables as per-primitive in FS if they come from MS
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15303>
This commit is contained in:
parent
8c16ce53a9
commit
81df66bfff
1 changed files with 19 additions and 0 deletions
|
|
@ -912,6 +912,25 @@ void
|
|||
brw_nir_link_shaders(const struct brw_compiler *compiler,
|
||||
nir_shader *producer, nir_shader *consumer)
|
||||
{
|
||||
if (producer->info.stage == MESA_SHADER_MESH &&
|
||||
consumer->info.stage == MESA_SHADER_FRAGMENT) {
|
||||
/* gl_MeshPerPrimitiveNV[].gl_ViewportIndex, gl_PrimitiveID and gl_Layer
|
||||
* are per primitive, but fragment shader does not have them marked as
|
||||
* such. Add the annotation here.
|
||||
*/
|
||||
nir_foreach_shader_in_variable(var, consumer) {
|
||||
switch (var->data.location) {
|
||||
case VARYING_SLOT_LAYER:
|
||||
case VARYING_SLOT_PRIMITIVE_ID:
|
||||
case VARYING_SLOT_VIEWPORT:
|
||||
var->data.per_primitive = 1;
|
||||
break;
|
||||
default:
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
nir_lower_io_arrays_to_elements(producer, consumer);
|
||||
nir_validate_shader(producer, "after nir_lower_io_arrays_to_elements");
|
||||
nir_validate_shader(consumer, "after nir_lower_io_arrays_to_elements");
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue