/* Export PrimitiveID. */
if (export_prim_id) {
- outinfo->export_prim_id = true;
-
outputs[noutput].slot_name = VARYING_SLOT_PRIMITIVE_ID;
outputs[noutput].slot_index = 0;
outputs[noutput].usage_mask = 0x1;
radv_export_param(ctx, param_count, values, 0x1);
outinfo->vs_output_param_offset[VARYING_SLOT_PRIMITIVE_ID] = param_count++;
- outinfo->export_prim_id = true;
outinfo->param_exports = param_count;
}
}
}
}
+ /* Make sure to export the PrimitiveID if the fragment shader needs it. */
+ if (options->key.vs_common_out.export_prim_id) {
+ switch (nir->info.stage) {
+ case MESA_SHADER_VERTEX:
+ info->vs.outinfo.export_prim_id = true;
+ break;
+ case MESA_SHADER_TESS_EVAL:
+ info->tes.outinfo.export_prim_id = true;
+ break;
+ case MESA_SHADER_GEOMETRY:
+ info->vs.outinfo.export_prim_id = true;
+ break;
+ default:
+ break;
+ }
+ }
+
if (nir->info.stage == MESA_SHADER_FRAGMENT)
info->ps.num_interp = nir->num_inputs;