zink: flag swapchain resources as swapchains
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Tue, 19 Apr 2022 20:44:02 +0000 (16:44 -0400)
committerMarge Bot <emma+marge@anholt.net>
Wed, 27 Apr 2022 21:50:16 +0000 (21:50 +0000)
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16038>

src/gallium/drivers/zink/zink_resource.c
src/gallium/drivers/zink/zink_resource.h

index 90ae923..8474f84 100644 (file)
@@ -977,6 +977,7 @@ resource_create(struct pipe_screen *pscreen,
       res->obj->vkusage = cdt->swapchain->scci.imageUsage;
       res->base.b.bind |= PIPE_BIND_DISPLAY_TARGET;
       res->optimal_tiling = true;
+      res->swapchain = true;
    }
    if (res->obj->is_buffer) {
       res->base.buffer_id_unique = util_idalloc_mt_alloc(&screen->buffer_ids);
index fd04c95..3381463 100644 (file)
@@ -152,6 +152,7 @@ struct zink_resource {
       };
    };
 
+   bool swapchain;
    bool dmabuf_acquire;
    unsigned dt_stride;
 
@@ -218,7 +219,7 @@ zink_resource_has_binds(const struct zink_resource *res)
 static inline bool
 zink_is_swapchain(const struct zink_resource *res)
 {
-   return (res->base.b.bind & PIPE_BIND_DISPLAY_TARGET) > 0;
+   return res->swapchain;
 }
 
 #ifndef __cplusplus