From 849eb0a77634d3ce8f5532ba47946a37fde8c20e Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Mon, 13 Apr 2020 11:50:06 +0200 Subject: [PATCH] radv: use RMW packets for updating the maximum sample distance Signed-off-by: Samuel Pitoiset Reviewed-by: Bas Nieuwenhuizen Part-of: --- src/amd/vulkan/radv_cmd_buffer.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c index 5cab9c829dc..abc1cfbbd04 100644 --- a/src/amd/vulkan/radv_cmd_buffer.c +++ b/src/amd/vulkan/radv_cmd_buffer.c @@ -778,8 +778,6 @@ radv_compute_centroid_priority(struct radv_cmd_buffer *cmd_buffer, static void radv_emit_sample_locations(struct radv_cmd_buffer *cmd_buffer) { - struct radv_pipeline *pipeline = cmd_buffer->state.pipeline; - struct radv_multisample_state *ms = &pipeline->graphics.ms; struct radv_sample_locations_state *sample_location = &cmd_buffer->state.dynamic.sample_location; uint32_t num_samples = (uint32_t)sample_location->per_pixel; @@ -842,13 +840,9 @@ radv_emit_sample_locations(struct radv_cmd_buffer *cmd_buffer) } /* Emit the maximum sample distance and the centroid priority. */ - uint32_t pa_sc_aa_config = ms->pa_sc_aa_config; - - pa_sc_aa_config &= C_028BE0_MAX_SAMPLE_DIST; - pa_sc_aa_config |= S_028BE0_MAX_SAMPLE_DIST(max_sample_dist); - - radeon_set_context_reg_seq(cs, R_028BE0_PA_SC_AA_CONFIG, 1); - radeon_emit(cs, pa_sc_aa_config); + radeon_set_context_reg_rmw(cs, R_028BE0_PA_SC_AA_CONFIG, + S_028BE0_MAX_SAMPLE_DIST(max_sample_dist), + ~C_028BE0_MAX_SAMPLE_DIST); radeon_set_context_reg_seq(cs, R_028BD4_PA_SC_CENTROID_PRIORITY_0, 2); radeon_emit(cs, centroid_priority); -- 2.30.2