/**
* Set the clear color values to the image's metadata.
*/
-void
+static void
radv_set_color_clear_metadata(struct radv_cmd_buffer *cmd_buffer,
struct radv_image *image,
- int cb_idx,
uint32_t color_values[2])
{
struct radeon_cmdbuf *cs = cmd_buffer->cs;
radeon_emit(cs, va >> 32);
radeon_emit(cs, color_values[0]);
radeon_emit(cs, color_values[1]);
+}
+
+/**
+ * Update the clear color values for this image.
+ */
+void
+radv_update_color_clear_metadata(struct radv_cmd_buffer *cmd_buffer,
+ struct radv_image *image,
+ int cb_idx,
+ uint32_t color_values[2])
+{
+ assert(radv_image_has_cmask(image) || radv_image_has_dcc(image));
+
+ radv_set_color_clear_metadata(cmd_buffer, image, color_values);
radv_update_bound_fast_clear_color(cmd_buffer, image, cb_idx,
color_values);
radv_set_dcc_need_cmask_elim_pred(cmd_buffer, image, false);
}
+
+ if (radv_image_has_cmask(image) || radv_image_has_dcc(image)) {
+ uint32_t color_values[2] = {};
+ radv_set_color_clear_metadata(cmd_buffer, image, color_values);
+ }
}
/**
cmd_buffer->state.flush_bits |= flush_bits;
}
- radv_set_color_clear_metadata(cmd_buffer, iview->image, subpass_att,
- clear_color);
+ radv_update_color_clear_metadata(cmd_buffer, iview->image, subpass_att,
+ clear_color);
return true;
fail:
VkClearDepthStencilValue ds_clear_value,
VkImageAspectFlags aspects);
-void radv_set_color_clear_metadata(struct radv_cmd_buffer *cmd_buffer,
- struct radv_image *image,
- int cb_idx,
- uint32_t color_values[2]);
+void radv_update_color_clear_metadata(struct radv_cmd_buffer *cmd_buffer,
+ struct radv_image *image,
+ int cb_idx,
+ uint32_t color_values[2]);
void radv_set_dcc_need_cmask_elim_pred(struct radv_cmd_buffer *cmd_buffer,
struct radv_image *image,