Mesa (main): lavapipe: cleanup image create function.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Sep 28 22:10:39 UTC 2021


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

Author: Dave Airlie <airlied at redhat.com>
Date:   Wed Sep 29 07:44:07 2021 +1000

lavapipe: cleanup image create function.

drop the wrapper as it's unused and make things static.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13091>

---

 src/gallium/frontends/lavapipe/lvp_image.c   | 24 ++++++------------------
 src/gallium/frontends/lavapipe/lvp_private.h | 12 ------------
 2 files changed, 6 insertions(+), 30 deletions(-)

diff --git a/src/gallium/frontends/lavapipe/lvp_image.c b/src/gallium/frontends/lavapipe/lvp_image.c
index e0daea4767f..161d242258e 100644
--- a/src/gallium/frontends/lavapipe/lvp_image.c
+++ b/src/gallium/frontends/lavapipe/lvp_image.c
@@ -26,14 +26,13 @@
 #include "util/u_inlines.h"
 #include "pipe/p_state.h"
 
-VkResult
+static VkResult
 lvp_image_create(VkDevice _device,
-                 const struct lvp_image_create_info *create_info,
+                 const VkImageCreateInfo *pCreateInfo,
                  const VkAllocationCallbacks* alloc,
                  VkImage *pImage)
 {
    LVP_FROM_HANDLE(lvp_device, device, _device);
-   const VkImageCreateInfo *pCreateInfo = create_info->vk_info;
    struct lvp_image *image;
 
    assert(pCreateInfo->sType == VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO);
@@ -85,8 +84,6 @@ lvp_image_create(VkDevice _device,
       template.last_level = pCreateInfo->mipLevels - 1;
       template.nr_samples = pCreateInfo->samples;
       template.nr_storage_samples = pCreateInfo->samples;
-      if (create_info->bind_flags)
-         template.bind = create_info->bind_flags;
       image->bo = device->pscreen->resource_create_unbacked(device->pscreen,
                                                             &template,
                                                             &image->size);
@@ -138,12 +135,8 @@ lvp_image_from_swapchain(VkDevice device,
    local_create_info.usage |= VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT;
 
    assert(!(local_create_info.usage & VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT));
-   return lvp_image_create(device,
-      &(struct lvp_image_create_info) {
-         .vk_info = &local_create_info,
-      },
-      pAllocator,
-      pImage);
+   return lvp_image_create(device, &local_create_info, pAllocator,
+                           pImage);
 }
 
 VKAPI_ATTR VkResult VKAPI_CALL
@@ -157,13 +150,8 @@ lvp_CreateImage(VkDevice device,
    if (swapchain_info && swapchain_info->swapchain != VK_NULL_HANDLE)
       return lvp_image_from_swapchain(device, pCreateInfo, swapchain_info,
                                       pAllocator, pImage);
-   return lvp_image_create(device,
-      &(struct lvp_image_create_info) {
-         .vk_info = pCreateInfo,
-         .bind_flags = 0,
-      },
-      pAllocator,
-      pImage);
+   return lvp_image_create(device, pCreateInfo, pAllocator,
+                           pImage);
 }
 
 VKAPI_ATTR void VKAPI_CALL
diff --git a/src/gallium/frontends/lavapipe/lvp_private.h b/src/gallium/frontends/lavapipe/lvp_private.h
index 711ae1c576f..fcb2f6d445f 100644
--- a/src/gallium/frontends/lavapipe/lvp_private.h
+++ b/src/gallium/frontends/lavapipe/lvp_private.h
@@ -250,18 +250,6 @@ lvp_get_levelCount(const struct lvp_image *image,
       (image->bo->last_level + 1) - range->baseMipLevel : range->levelCount;
 }
 
-struct lvp_image_create_info {
-   const VkImageCreateInfo *vk_info;
-   uint32_t bind_flags;
-   uint32_t stride;
-};
-
-VkResult
-lvp_image_create(VkDevice _device,
-                 const struct lvp_image_create_info *create_info,
-                 const VkAllocationCallbacks* alloc,
-                 VkImage *pImage);
-
 struct lvp_image_view {
    struct vk_object_base base;
    const struct lvp_image *image; /**< VkImageViewCreateInfo::image */



More information about the mesa-commit mailing list