panvk: Move VkImageView logic to its own source files

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Rebecca Mckeever <rebecca.mckeever@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28170>
This commit is contained in:
Boris Brezillon
2023-12-19 15:31:51 +01:00
committed by Marge Bot
parent 86a4978071
commit adab7d3fcc
8 changed files with 57 additions and 57 deletions
+1 -1
View File
@@ -65,7 +65,7 @@ foreach arch : ['6', '7']
'panvk_vX_cs.c',
'panvk_vX_descriptor_set.c',
'panvk_vX_device.c',
'panvk_vX_image.c',
'panvk_vX_image_view.c',
'panvk_vX_meta.c',
'panvk_vX_meta_blit.c',
'panvk_vX_meta_copy.c',
-14
View File
@@ -259,20 +259,6 @@ panvk_GetImageSubresourceLayout(VkDevice _device, VkImage _image,
pLayout->depthPitch = slice_layout->surface_stride;
}
VKAPI_ATTR void VKAPI_CALL
panvk_DestroyImageView(VkDevice _device, VkImageView _view,
const VkAllocationCallbacks *pAllocator)
{
VK_FROM_HANDLE(panvk_device, device, _device);
VK_FROM_HANDLE(panvk_image_view, view, _view);
if (!view)
return;
panvk_priv_bo_destroy(view->bo, NULL);
vk_image_view_destroy(&device->vk, pAllocator, &view->vk);
}
VKAPI_ATTR void VKAPI_CALL
panvk_GetImageMemoryRequirements2(VkDevice device,
const VkImageMemoryRequirementsInfo2 *pInfo,
+35
View File
@@ -0,0 +1,35 @@
/*
* Copyright © 2021 Collabora Ltd.
* SPDX-License-Identifier: MIT
*/
#ifndef PANVK_IMAGE_VIEW_H
#define PANVK_IMAGE_VIEW_H
#include <stdint.h>
#include "vk_image.h"
#include "pan_texture.h"
struct panvk_priv_bo;
#define TEXTURE_DESC_WORDS 8
#define ATTRIB_BUF_DESC_WORDS 4
struct panvk_image_view {
struct vk_image_view vk;
struct pan_image_view pview;
struct panvk_priv_bo *bo;
struct {
uint32_t tex[TEXTURE_DESC_WORDS];
uint32_t img_attrib_buf[ATTRIB_BUF_DESC_WORDS * 2];
} descs;
};
VK_DEFINE_NONDISP_HANDLE_CASTS(panvk_image_view, vk.base, VkImageView,
VK_OBJECT_TYPE_IMAGE_VIEW);
#endif
-17
View File
@@ -754,21 +754,6 @@ panvk_shader_create(struct panvk_device *dev, gl_shader_stage stage,
void panvk_shader_destroy(struct panvk_device *dev, struct panvk_shader *shader,
const VkAllocationCallbacks *alloc);
#define TEXTURE_DESC_WORDS 8
#define ATTRIB_BUF_DESC_WORDS 4
struct panvk_image_view {
struct vk_image_view vk;
struct pan_image_view pview;
struct panvk_priv_bo *bo;
struct {
uint32_t tex[TEXTURE_DESC_WORDS];
uint32_t img_attrib_buf[ATTRIB_BUF_DESC_WORDS * 2];
} descs;
};
VK_DEFINE_HANDLE_CASTS(panvk_cmd_buffer, vk.base, VkCommandBuffer,
VK_OBJECT_TYPE_COMMAND_BUFFER)
VK_DEFINE_HANDLE_CASTS(panvk_device, vk.base, VkDevice, VK_OBJECT_TYPE_DEVICE)
@@ -788,8 +773,6 @@ VK_DEFINE_NONDISP_HANDLE_CASTS(panvk_descriptor_set_layout, vk.base,
VkDescriptorSetLayout,
VK_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT)
VK_DEFINE_NONDISP_HANDLE_CASTS(panvk_event, base, VkEvent, VK_OBJECT_TYPE_EVENT)
VK_DEFINE_NONDISP_HANDLE_CASTS(panvk_image_view, vk.base, VkImageView,
VK_OBJECT_TYPE_IMAGE_VIEW);
VK_DEFINE_NONDISP_HANDLE_CASTS(panvk_pipeline_layout, vk.base, VkPipelineLayout,
VK_OBJECT_TYPE_PIPELINE_LAYOUT)
@@ -31,6 +31,7 @@
#include "panvk_buffer.h"
#include "panvk_cs.h"
#include "panvk_image.h"
#include "panvk_image_view.h"
#include "panvk_pipeline.h"
#include "panvk_private.h"
@@ -29,6 +29,7 @@
#include "panvk_buffer_view.h"
#include "panvk_image.h"
#include "panvk_image_view.h"
#include "panvk_private.h"
#include <assert.h>
+1
View File
@@ -32,6 +32,7 @@
#include "panvk_cs.h"
#include "panvk_image.h"
#include "panvk_image_view.h"
#include "panvk_private.h"
#include "vk_drm_syncobj.h"
@@ -6,37 +6,16 @@
* Copyright © 2016 Bas Nieuwenhuizen
* Copyright © 2015 Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
* SPDX-License-Identifier: MIT
*/
#include "genxml/gen_macros.h"
#include "vk_format.h"
#include "panvk_image.h"
#include "panvk_image_view.h"
#include "panvk_private.h"
#include "drm-uapi/drm_fourcc.h"
#include "util/u_atomic.h"
#include "util/u_debug.h"
#include "vk_format.h"
#include "vk_object.h"
#include "vk_util.h"
#include "genxml/gen_macros.h"
static enum mali_texture_dimension
panvk_view_type_to_mali_tex_dim(VkImageViewType type)
@@ -172,3 +151,17 @@ panvk_per_arch(CreateImageView)(VkDevice _device,
*pView = panvk_image_view_to_handle(view);
return VK_SUCCESS;
}
VKAPI_ATTR void VKAPI_CALL
panvk_per_arch(DestroyImageView)(VkDevice _device, VkImageView _view,
const VkAllocationCallbacks *pAllocator)
{
VK_FROM_HANDLE(panvk_device, device, _device);
VK_FROM_HANDLE(panvk_image_view, view, _view);
if (!view)
return;
panvk_priv_bo_destroy(view->bo, NULL);
vk_image_view_destroy(&device->vk, pAllocator, &view->vk);
}