zink: add a util function for finding swapchain resource
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Tue, 19 Apr 2022 20:35:12 +0000 (16:35 -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.h

index 2b6de9a..fd04c95 100644 (file)
@@ -215,6 +215,12 @@ zink_resource_has_binds(const struct zink_resource *res)
    return res->all_binds > 0;
 }
 
+static inline bool
+zink_is_swapchain(const struct zink_resource *res)
+{
+   return (res->base.b.bind & PIPE_BIND_DISPLAY_TARGET) > 0;
+}
+
 #ifndef __cplusplus
 #include "zink_bo.h"