anv,hasvk: Always use BLORP_BATCH_NO_UPDATE_CLEAR_COLOR

Store the clear color from within the drivers, rather than from BLORP.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30824>
This commit is contained in:
Nanley Chery 2024-08-15 17:52:25 -04:00 committed by Marge Bot
parent 5fd42500cf
commit 721d0c3e77
4 changed files with 11 additions and 4 deletions

View file

@ -2387,7 +2387,7 @@ anv_image_mcs_op(struct anv_cmd_buffer *cmd_buffer,
struct blorp_batch batch; struct blorp_batch batch;
anv_blorp_batch_init(cmd_buffer, &batch, anv_blorp_batch_init(cmd_buffer, &batch,
BLORP_BATCH_PREDICATE_ENABLE * predicate + BLORP_BATCH_PREDICATE_ENABLE * predicate +
BLORP_BATCH_NO_UPDATE_CLEAR_COLOR * !clear_value); BLORP_BATCH_NO_UPDATE_CLEAR_COLOR);
assert((batch.flags & BLORP_BATCH_USE_COMPUTE) == 0); assert((batch.flags & BLORP_BATCH_USE_COMPUTE) == 0);
exec_mcs_op(cmd_buffer, &batch, image, format, swizzle, aspect, exec_mcs_op(cmd_buffer, &batch, image, format, swizzle, aspect,
@ -2408,7 +2408,7 @@ anv_image_ccs_op(struct anv_cmd_buffer *cmd_buffer,
struct blorp_batch batch; struct blorp_batch batch;
anv_blorp_batch_init(cmd_buffer, &batch, anv_blorp_batch_init(cmd_buffer, &batch,
BLORP_BATCH_PREDICATE_ENABLE * predicate + BLORP_BATCH_PREDICATE_ENABLE * predicate +
BLORP_BATCH_NO_UPDATE_CLEAR_COLOR * !clear_value); BLORP_BATCH_NO_UPDATE_CLEAR_COLOR);
assert((batch.flags & BLORP_BATCH_USE_COMPUTE) == 0); assert((batch.flags & BLORP_BATCH_USE_COMPUTE) == 0);
exec_ccs_op(cmd_buffer, &batch, image, format, swizzle, aspect, level, exec_ccs_op(cmd_buffer, &batch, image, format, swizzle, aspect, level,

View file

@ -960,6 +960,10 @@ genX(set_fast_clear_state)(struct anv_cmd_buffer *cmd_buffer,
const enum isl_format format, const enum isl_format format,
union isl_color_value clear_color) union isl_color_value clear_color)
{ {
uint32_t pixel[4];
isl_color_value_pack(&clear_color, format, pixel);
set_image_clear_color(cmd_buffer, image, VK_IMAGE_ASPECT_COLOR_BIT, pixel);
if (isl_color_value_is_zero(clear_color, format)) { if (isl_color_value_is_zero(clear_color, format)) {
/* This image has the auxiliary buffer enabled. We can mark the /* This image has the auxiliary buffer enabled. We can mark the
* subresource as not needing a resolve because the clear color * subresource as not needing a resolve because the clear color

View file

@ -1787,7 +1787,7 @@ anv_image_mcs_op(struct anv_cmd_buffer *cmd_buffer,
struct blorp_batch batch; struct blorp_batch batch;
anv_blorp_batch_init(cmd_buffer, &batch, anv_blorp_batch_init(cmd_buffer, &batch,
BLORP_BATCH_PREDICATE_ENABLE * predicate + BLORP_BATCH_PREDICATE_ENABLE * predicate +
BLORP_BATCH_NO_UPDATE_CLEAR_COLOR * !clear_value); BLORP_BATCH_NO_UPDATE_CLEAR_COLOR);
assert((batch.flags & BLORP_BATCH_USE_COMPUTE) == 0); assert((batch.flags & BLORP_BATCH_USE_COMPUTE) == 0);
struct blorp_surf surf; struct blorp_surf surf;
@ -1877,7 +1877,7 @@ anv_image_ccs_op(struct anv_cmd_buffer *cmd_buffer,
struct blorp_batch batch; struct blorp_batch batch;
anv_blorp_batch_init(cmd_buffer, &batch, anv_blorp_batch_init(cmd_buffer, &batch,
BLORP_BATCH_PREDICATE_ENABLE * predicate + BLORP_BATCH_PREDICATE_ENABLE * predicate +
BLORP_BATCH_NO_UPDATE_CLEAR_COLOR * !clear_value); BLORP_BATCH_NO_UPDATE_CLEAR_COLOR);
assert((batch.flags & BLORP_BATCH_USE_COMPUTE) == 0); assert((batch.flags & BLORP_BATCH_USE_COMPUTE) == 0);
struct blorp_surf surf; struct blorp_surf surf;

View file

@ -5196,6 +5196,9 @@ void genX(CmdBeginRendering)(
base_clear_layer++; base_clear_layer++;
clear_layer_count--; clear_layer_count--;
set_image_clear_color(cmd_buffer, iview->image,
VK_IMAGE_ASPECT_COLOR_BIT, clear_color);
if (isl_color_value_is_zero(clear_color, if (isl_color_value_is_zero(clear_color,
iview->planes[0].isl.format)) { iview->planes[0].isl.format)) {
/* This image has the auxiliary buffer enabled. We can mark the /* This image has the auxiliary buffer enabled. We can mark the