radv: Note when a mesh shader writes the primitive shading rate.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com> Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14193>
This commit is contained in:
parent
94f465856c
commit
c6becb9574
|
@ -198,6 +198,7 @@ struct radv_vs_output_info {
|
|||
bool writes_viewport_index;
|
||||
bool writes_viewport_index_per_primitive;
|
||||
bool writes_primitive_shading_rate;
|
||||
bool writes_primitive_shading_rate_per_primitive;
|
||||
bool export_prim_id;
|
||||
bool export_prim_id_per_primitive;
|
||||
bool export_clip_dists;
|
||||
|
|
|
@ -552,6 +552,9 @@ gather_info_output_decl(const nir_shader *nir, const nir_variable *var,
|
|||
vs_info->writes_layer = true;
|
||||
break;
|
||||
case VARYING_SLOT_PRIMITIVE_SHADING_RATE:
|
||||
if (var->data.per_primitive)
|
||||
vs_info->writes_primitive_shading_rate_per_primitive = true;
|
||||
else
|
||||
vs_info->writes_primitive_shading_rate = true;
|
||||
break;
|
||||
default:
|
||||
|
@ -675,8 +678,11 @@ radv_nir_shader_info_pass(struct radv_device *device, const struct nir_shader *n
|
|||
outinfo->writes_layer = true;
|
||||
}
|
||||
|
||||
/* VS/TES/GS: shading rate is per-vertex, MS: it's per-primitive. */
|
||||
bool force_vrs_per_vertex =
|
||||
device->force_vrs != RADV_FORCE_VRS_NONE && nir->info.stage != MESA_SHADER_MESH;
|
||||
bool writes_primitive_shading_rate =
|
||||
outinfo->writes_primitive_shading_rate || device->force_vrs != RADV_FORCE_VRS_NONE;
|
||||
outinfo->writes_primitive_shading_rate || force_vrs_per_vertex;
|
||||
int pos_written = 0x1;
|
||||
|
||||
if (outinfo->writes_pointsize || outinfo->writes_viewport_index || outinfo->writes_layer ||
|
||||
|
|
Loading…
Reference in New Issue