summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/gallium/drivers/zink/zink_context.c4
-rw-r--r--src/gallium/drivers/zink/zink_resource.h1
2 files changed, 4 insertions, 1 deletions
diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c
index 0c694038799..d45f749cf71 100644
--- a/src/gallium/drivers/zink/zink_context.c
+++ b/src/gallium/drivers/zink/zink_context.c
@@ -1789,7 +1789,7 @@ copy_scanout(struct zink_context *ctx, struct zink_resource *res)
NULL,
0,
VK_ACCESS_TRANSFER_WRITE_BIT,
- VK_IMAGE_LAYOUT_PRESENT_SRC_KHR,
+ res->scanout_obj_init ? VK_IMAGE_LAYOUT_PRESENT_SRC_KHR : VK_IMAGE_LAYOUT_UNDEFINED,
VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,
VK_QUEUE_FAMILY_IGNORED,
VK_QUEUE_FAMILY_IGNORED,
@@ -1822,6 +1822,8 @@ copy_scanout(struct zink_context *ctx, struct zink_resource *res)
0, NULL,
1, &imb
);
+ /* separate flag to avoid annoying validation errors for new scanout objs */
+ res->scanout_obj_init = true;
}
static void
diff --git a/src/gallium/drivers/zink/zink_resource.h b/src/gallium/drivers/zink/zink_resource.h
index 1bf959916ef..c298c8fe3d2 100644
--- a/src/gallium/drivers/zink/zink_resource.h
+++ b/src/gallium/drivers/zink/zink_resource.h
@@ -89,6 +89,7 @@ struct zink_resource {
struct zink_resource_object *obj;
struct zink_resource_object *scanout_obj; //TODO: remove for wsi
+ bool scanout_obj_init;
union {
struct util_range valid_buffer_range;
struct {