radv: add a new dirty bit for the sample locations state

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36901>
This commit is contained in:
Samuel Pitoiset 2025-08-21 10:35:10 +02:00 committed by Marge Bot
parent dc3371332e
commit 54b79d0f50
2 changed files with 11 additions and 5 deletions

View file

@ -1181,7 +1181,7 @@ radv_compute_centroid_priority(struct radv_cmd_buffer *cmd_buffer, VkOffset2D *s
* Emit the sample locations that are specified with VK_EXT_sample_locations.
*/
static void
radv_emit_sample_locations(struct radv_cmd_buffer *cmd_buffer)
radv_emit_sample_locations_state(struct radv_cmd_buffer *cmd_buffer)
{
const struct radv_device *device = radv_cmd_buffer_device(cmd_buffer);
const struct radv_physical_device *pdev = radv_device_physical(device);
@ -1192,6 +1192,8 @@ radv_emit_sample_locations(struct radv_cmd_buffer *cmd_buffer)
VkOffset2D sample_locs[4][8]; /* 8 is the max. sample count supported */
uint64_t centroid_priority;
cmd_buffer->state.dirty &= ~RADV_CMD_DIRTY_SAMPLE_LOCATIONS_STATE;
if (!d->sample_location.count || !d->vk.ms.sample_locations_enable)
return;
@ -5388,9 +5390,6 @@ radv_cmd_buffer_flush_dynamic_state(struct radv_cmd_buffer *cmd_buffer, const ui
if (states & (RADV_DYNAMIC_SCISSOR | RADV_DYNAMIC_VIEWPORT) && !pdev->info.has_gfx9_scissor_bug)
radv_emit_scissor(cmd_buffer);
if (states & (RADV_DYNAMIC_SAMPLE_LOCATIONS | RADV_DYNAMIC_SAMPLE_LOCATIONS_ENABLE))
radv_emit_sample_locations(cmd_buffer);
if ((states & RADV_DYNAMIC_PRIMITIVE_TOPOLOGY) ||
(pdev->info.gfx_level >= GFX12 && states & RADV_DYNAMIC_PATCH_CONTROL_POINTS))
radv_emit_primitive_topology(cmd_buffer);
@ -11466,6 +11465,9 @@ radv_validate_dynamic_states(struct radv_cmd_buffer *cmd_buffer, uint64_t dynami
if (dynamic_states & RADV_DYNAMIC_BLEND_CONSTANTS)
cmd_buffer->state.dirty |= RADV_CMD_DIRTY_BLEND_CONSTANTS_STATE;
if (dynamic_states & (RADV_DYNAMIC_SAMPLE_LOCATIONS | RADV_DYNAMIC_SAMPLE_LOCATIONS_ENABLE))
cmd_buffer->state.dirty |= RADV_CMD_DIRTY_SAMPLE_LOCATIONS_STATE;
}
static void
@ -11585,6 +11587,9 @@ radv_emit_all_graphics_states(struct radv_cmd_buffer *cmd_buffer, const struct r
if (cmd_buffer->state.dirty & RADV_CMD_DIRTY_CB_RENDER_STATE)
radv_emit_cb_render_state(cmd_buffer);
if (cmd_buffer->state.dirty & RADV_CMD_DIRTY_SAMPLE_LOCATIONS_STATE)
radv_emit_sample_locations_state(cmd_buffer);
if (cmd_buffer->state.dirty & RADV_CMD_DIRTY_MSAA_STATE)
radv_emit_msaa_state(cmd_buffer);

View file

@ -113,7 +113,8 @@ enum radv_cmd_dirty_bits {
RADV_CMD_DIRTY_DEPTH_BIAS_STATE = 1ull << 27,
RADV_CMD_DIRTY_VS_PROLOG_STATE = 1ull << 28,
RADV_CMD_DIRTY_BLEND_CONSTANTS_STATE = 1ull << 29,
RADV_CMD_DIRTY_ALL = (1ull << 30) - 1,
RADV_CMD_DIRTY_SAMPLE_LOCATIONS_STATE = 1ull << 30,
RADV_CMD_DIRTY_ALL = (1ull << 31) - 1,
RADV_CMD_DIRTY_SHADER_QUERY = RADV_CMD_DIRTY_NGG_STATE | RADV_CMD_DIRTY_TASK_STATE,
};