radv: remove radv_graphics_state_key::dynamic_patch_control_points

When the state isn't dynamic, the patch control points value must
greater than 0. Having a separate field isn't necessary.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27396>
This commit is contained in:
Samuel Pitoiset 2024-01-31 18:44:10 +01:00 committed by Marge Bot
parent 3bc6f95e3d
commit c6ca7fcc25
4 changed files with 3 additions and 8 deletions

View file

@ -1919,8 +1919,6 @@ radv_generate_graphics_state_key(const struct radv_device *device, const struct
key.ps.has_epilog && (!state->ms || (pipeline->dynamic_states & RADV_DYNAMIC_ALPHA_TO_COVERAGE_ENABLE));
}
key.dynamic_patch_control_points = !!(pipeline->dynamic_states & RADV_DYNAMIC_PATCH_CONTROL_POINTS);
key.dynamic_rasterization_samples = !!(pipeline->dynamic_states & RADV_DYNAMIC_RASTERIZATION_SAMPLES) ||
(!!(pipeline->active_stages & VK_SHADER_STAGE_FRAGMENT_BIT) && !state->ms);

View file

@ -130,7 +130,6 @@ struct radv_graphics_state_key {
uint32_t has_multiview_view_index : 1;
uint32_t adjust_frag_coord_z : 1;
uint32_t dynamic_patch_control_points : 1;
uint32_t dynamic_rasterization_samples : 1;
uint32_t dynamic_provoking_vtx_mode : 1;
uint32_t dynamic_line_rast_mode : 1;

View file

@ -473,7 +473,7 @@ gather_shader_info_tcs(struct radv_device *device, const nir_shader *nir,
info->tcs.num_linked_patch_outputs = util_last_bit64(nir->info.patch_outputs_written);
}
if (!(gfx_state->dynamic_patch_control_points)) {
if (gfx_state->ts.patch_control_points) {
/* Number of tessellation patches per workgroup processed by the current pipeline. */
info->num_tess_patches =
get_tcs_num_patches(gfx_state->ts.patch_control_points, nir->info.tess.tcs_vertices_out,
@ -1621,7 +1621,7 @@ radv_link_shaders_info(struct radv_device *device, struct radv_shader_stage *pro
struct radv_shader_stage *vs_stage = producer;
struct radv_shader_stage *tcs_stage = consumer;
if (gfx_state->dynamic_patch_control_points) {
if (gfx_state->ts.patch_control_points == 0) {
/* Set the workgroup size to the maximum possible value to ensure that compilers don't
* optimize barriers.
*/
@ -1670,7 +1670,7 @@ radv_link_shaders_info(struct radv_device *device, struct radv_shader_stage *pro
tcs_stage->info.tcs.tes_inputs_read = tes_stage->nir->info.inputs_read;
tcs_stage->info.tcs.tes_patch_inputs_read = tes_stage->nir->info.patch_inputs_read;
if (!gfx_state->dynamic_patch_control_points)
if (gfx_state->ts.patch_control_points)
tes_stage->info.num_tess_patches = tcs_stage->info.num_tess_patches;
}
}

View file

@ -129,7 +129,6 @@ radv_shader_object_init_graphics(struct radv_shader_object *shader_obj, struct r
gfx_state.unknown_rast_prim = true;
gfx_state.dynamic_provoking_vtx_mode = true;
gfx_state.dynamic_line_rast_mode = true;
gfx_state.dynamic_patch_control_points = true;
if (device->physical_device->rad_info.gfx_level >= GFX11)
gfx_state.ms.alpha_to_coverage_via_mrtz = true;
@ -405,7 +404,6 @@ radv_shader_object_create_linked(VkDevice _device, uint32_t createInfoCount, con
gfx_state.unknown_rast_prim = true;
gfx_state.dynamic_provoking_vtx_mode = true;
gfx_state.dynamic_line_rast_mode = true;
gfx_state.dynamic_patch_control_points = true;
if (device->physical_device->rad_info.gfx_level >= GFX11)
gfx_state.ms.alpha_to_coverage_via_mrtz = true;