mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 06:30:10 +01:00
radv: add export_clip_dists for VS and TES to radv_shader_info
To be able to remove radv_vs_out_key entirely. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Timur Kristóf <timur.kristof@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13028>
This commit is contained in:
parent
b653164973
commit
fa833f9ee5
2 changed files with 18 additions and 0 deletions
|
|
@ -214,6 +214,7 @@ struct radv_vs_output_info {
|
|||
bool writes_viewport_index;
|
||||
bool writes_primitive_shading_rate;
|
||||
bool export_prim_id;
|
||||
bool export_clip_dists;
|
||||
unsigned pos_exports;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -654,6 +654,23 @@ radv_nir_shader_info_pass(struct radv_device *device, const struct nir_shader *n
|
|||
}
|
||||
}
|
||||
|
||||
/* Make sure to export the clip/cull distances if the fragment shader needs it. */
|
||||
if (key->vs_common_out.export_clip_dists) {
|
||||
switch (nir->info.stage) {
|
||||
case MESA_SHADER_VERTEX:
|
||||
info->vs.outinfo.export_clip_dists = true;
|
||||
break;
|
||||
case MESA_SHADER_TESS_EVAL:
|
||||
info->tes.outinfo.export_clip_dists = true;
|
||||
break;
|
||||
case MESA_SHADER_GEOMETRY:
|
||||
info->vs.outinfo.export_clip_dists = true;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (nir->info.stage == MESA_SHADER_FRAGMENT)
|
||||
info->ps.num_interp = nir->num_inputs;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue