anv: add check that in renderpass barriers apply to attachments

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23523>
This commit is contained in:
Lionel Landwerlin
2024-01-26 12:15:24 +02:00
committed by Marge Bot
parent eed788213b
commit 16391645ef
2 changed files with 20 additions and 0 deletions
+18
View File
@@ -5329,6 +5329,24 @@ void anv_image_fill_surface_state(struct anv_device *device,
enum anv_image_view_state_flags flags,
struct anv_surface_state *state_inout);
static inline bool
anv_cmd_graphics_state_has_image_as_attachment(const struct anv_cmd_graphics_state *state,
const struct anv_image *image)
{
for (unsigned a = 0; a < state->color_att_count; a++) {
if (state->color_att[a].iview &&
state->color_att[a].iview->image == image)
return true;
}
if (state->depth_att.iview && state->depth_att.iview->image == image)
return true;
if (state->stencil_att.iview && state->stencil_att.iview->image == image)
return true;
return false;
}
struct anv_image_create_info {
const VkImageCreateInfo *vk_info;
+2
View File
@@ -3541,6 +3541,8 @@ cmd_buffer_barrier(struct anv_cmd_buffer *cmd_buffer,
*/
if (!cmd_buffer->vk.runtime_rp_barrier &&
cmd_buffer->vk.render_pass != NULL) {
assert(anv_cmd_graphics_state_has_image_as_attachment(&cmd_buffer->state.gfx,
image));
VkImageLayout subpass_att_layout, subpass_stencil_att_layout;
vk_command_buffer_get_attachment_layout(