struct GENX(SF_OUTPUT_ATTRIBUTE_DETAIL) *attr =
&attr_overrides[input_index];
+ int slot = vue_map->varying_to_slot[fs_attr];
/* Viewport and Layer are stored in the VUE header. We need to override
* them to zero if earlier stages didn't write them, as GL requires that
continue;
case VARYING_SLOT_PRIMITIVE_ID:
- attr->ComponentOverrideX = true;
- attr->ComponentOverrideY = true;
- attr->ComponentOverrideZ = true;
- attr->ComponentOverrideW = true;
- attr->ConstantSource = PRIM_ID;
- continue;
+ /* Override if the previous shader stage didn't write gl_PrimitiveID. */
+ if (slot == -1) {
+ attr->ComponentOverrideX = true;
+ attr->ComponentOverrideY = true;
+ attr->ComponentOverrideZ = true;
+ attr->ComponentOverrideW = true;
+ attr->ConstantSource = PRIM_ID;
+ continue;
+ }
default:
break;
if (sprite_coord_enables & (1 << input_index))
continue;
- int slot = vue_map->varying_to_slot[fs_attr];
-
/* If there was only a back color written but not front, use back
* as the color instead of undefined.
*/