mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 07:08:04 +02:00
radv: fix multiview fast clears
this was only clearing layer0 because it was ignoring the viewmask
cc: mesa-stable
(cherry picked from commit b8ee6f3d30)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40359>
This commit is contained in:
parent
195fbfb2f1
commit
020b960d03
2 changed files with 7 additions and 5 deletions
|
|
@ -4884,7 +4884,7 @@
|
|||
"description": "radv: fix multiview fast clears",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": null,
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -1475,7 +1475,8 @@ radv_can_fast_clear_color(struct radv_cmd_buffer *cmd_buffer, const struct radv_
|
|||
static void
|
||||
radv_fast_clear_color(struct radv_cmd_buffer *cmd_buffer, const struct radv_image_view *iview,
|
||||
const VkClearAttachment *clear_att, const VkClearRect *clear_rect,
|
||||
enum radv_cmd_flush_bits *pre_flush, enum radv_cmd_flush_bits *post_flush)
|
||||
enum radv_cmd_flush_bits *pre_flush, enum radv_cmd_flush_bits *post_flush,
|
||||
uint32_t view_mask)
|
||||
{
|
||||
struct radv_device *device = radv_cmd_buffer_device(cmd_buffer);
|
||||
const struct radv_physical_device *pdev = radv_device_physical(device);
|
||||
|
|
@ -1488,7 +1489,8 @@ radv_fast_clear_color(struct radv_cmd_buffer *cmd_buffer, const struct radv_imag
|
|||
.baseMipLevel = iview->vk.base_mip_level,
|
||||
.levelCount = iview->vk.level_count,
|
||||
.baseArrayLayer = iview->vk.base_array_layer + clear_rect->baseArrayLayer,
|
||||
.layerCount = clear_rect->layerCount,
|
||||
/* radv_can_fast_clear_color blocks multiview fast clears unless the viewmask contains all layers */
|
||||
.layerCount = view_mask ? iview->vk.layer_count : clear_rect->layerCount,
|
||||
};
|
||||
|
||||
if (pre_flush) {
|
||||
|
|
@ -1575,7 +1577,7 @@ emit_clear(struct radv_cmd_buffer *cmd_buffer, const VkClearAttachment *clear_at
|
|||
|
||||
if (radv_can_fast_clear_color(cmd_buffer, color_att->iview, color_att->layout, clear_rect, clear_value,
|
||||
view_mask)) {
|
||||
radv_fast_clear_color(cmd_buffer, color_att->iview, clear_att, clear_rect, pre_flush, post_flush);
|
||||
radv_fast_clear_color(cmd_buffer, color_att->iview, clear_att, clear_rect, pre_flush, post_flush, view_mask);
|
||||
} else {
|
||||
emit_color_clear(cmd_buffer, clear_att, clear_rect, view_mask);
|
||||
}
|
||||
|
|
@ -1877,7 +1879,7 @@ radv_fast_clear_range(struct radv_cmd_buffer *cmd_buffer, struct radv_image *ima
|
|||
|
||||
if (vk_format_is_color(format)) {
|
||||
if (radv_can_fast_clear_color(cmd_buffer, &iview, image_layout, &clear_rect, clear_att.clearValue.color, 0)) {
|
||||
radv_fast_clear_color(cmd_buffer, &iview, &clear_att, &clear_rect, NULL, NULL);
|
||||
radv_fast_clear_color(cmd_buffer, &iview, &clear_att, &clear_rect, NULL, NULL, 0);
|
||||
fast_cleared = true;
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue