Mesa (main): venus: refactor private descriptor_set helpers to be private

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Oct 27 18:45:13 UTC 2021


Module: Mesa
Branch: main
Commit: 9fa702f28ca030950cd8d79c2cf071eb63003741
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=9fa702f28ca030950cd8d79c2cf071eb63003741

Author: Yiwei Zhang <zzyiwei at chromium.org>
Date:   Mon Oct 25 22:34:04 2021 +0000

venus: refactor private descriptor_set helpers to be private

Signed-off-by: Yiwei Zhang <zzyiwei at chromium.org>
Reviewed-by: Ryan Neph <ryanneph at google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13522>

---

 src/virtio/vulkan/vn_descriptor_set.c | 18 +++++++++++++++++-
 src/virtio/vulkan/vn_descriptor_set.h | 20 --------------------
 2 files changed, 17 insertions(+), 21 deletions(-)

diff --git a/src/virtio/vulkan/vn_descriptor_set.c b/src/virtio/vulkan/vn_descriptor_set.c
index 464b191cbb3..a2a692ae1a7 100644
--- a/src/virtio/vulkan/vn_descriptor_set.c
+++ b/src/virtio/vulkan/vn_descriptor_set.c
@@ -17,7 +17,7 @@
 
 #include "vn_device.h"
 
-void
+static void
 vn_descriptor_set_layout_destroy(struct vn_device *dev,
                                  struct vn_descriptor_set_layout *layout)
 {
@@ -33,6 +33,22 @@ vn_descriptor_set_layout_destroy(struct vn_device *dev,
    vk_free(alloc, layout);
 }
 
+static inline struct vn_descriptor_set_layout *
+vn_descriptor_set_layout_ref(struct vn_device *dev,
+                             struct vn_descriptor_set_layout *layout)
+{
+   vn_refcount_inc(&layout->refcount);
+   return layout;
+}
+
+static inline void
+vn_descriptor_set_layout_unref(struct vn_device *dev,
+                               struct vn_descriptor_set_layout *layout)
+{
+   if (vn_refcount_dec(&layout->refcount))
+      vn_descriptor_set_layout_destroy(dev, layout);
+}
+
 static void
 vn_descriptor_set_destroy(struct vn_device *dev,
                           struct vn_descriptor_set *set,
diff --git a/src/virtio/vulkan/vn_descriptor_set.h b/src/virtio/vulkan/vn_descriptor_set.h
index 72da33ee61a..240a52d48dd 100644
--- a/src/virtio/vulkan/vn_descriptor_set.h
+++ b/src/virtio/vulkan/vn_descriptor_set.h
@@ -100,24 +100,4 @@ VK_DEFINE_NONDISP_HANDLE_CASTS(vn_descriptor_update_template,
                                VkDescriptorUpdateTemplate,
                                VK_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE)
 
-void
-vn_descriptor_set_layout_destroy(struct vn_device *dev,
-                                 struct vn_descriptor_set_layout *layout);
-
-static inline struct vn_descriptor_set_layout *
-vn_descriptor_set_layout_ref(struct vn_device *dev,
-                             struct vn_descriptor_set_layout *layout)
-{
-   vn_refcount_inc(&layout->refcount);
-   return layout;
-}
-
-static inline void
-vn_descriptor_set_layout_unref(struct vn_device *dev,
-                               struct vn_descriptor_set_layout *layout)
-{
-   if (vn_refcount_dec(&layout->refcount))
-      vn_descriptor_set_layout_destroy(dev, layout);
-}
-
 #endif /* VN_DESCRIPTOR_SET_H */



More information about the mesa-commit mailing list