radv: gather primitive ID in the shader info pass

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
This commit is contained in:
Samuel Pitoiset
2019-09-03 18:12:33 +02:00
parent 1877e87f1e
commit 3e8bda66ae
2 changed files with 17 additions and 3 deletions

View File

@@ -687,6 +687,23 @@ radv_nir_shader_info_pass(const struct nir_shader *nir,
}
}
/* 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;