panvk: Make panvk_sampler inherit from vk_sampler

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28104>
This commit is contained in:
Boris Brezillon 2023-12-15 14:25:25 +01:00
parent 203f1a35a7
commit 783172add3
3 changed files with 6 additions and 5 deletions

View file

@ -1728,7 +1728,7 @@ panvk_DestroySampler(VkDevice _device, VkSampler _sampler,
if (!sampler)
return;
vk_object_free(&device->vk, pAllocator, sampler);
vk_sampler_destroy(&device->vk, pAllocator, &sampler->vk);
}
VKAPI_ATTR VkResult VKAPI_CALL

View file

@ -63,6 +63,7 @@
#include "vk_physical_device.h"
#include "vk_pipeline_layout.h"
#include "vk_queue.h"
#include "vk_sampler.h"
#include "vk_sync.h"
#include "wsi_common.h"
@ -971,7 +972,7 @@ struct panvk_image_view {
#define SAMPLER_DESC_WORDS 8
struct panvk_sampler {
struct vk_object_base base;
struct vk_sampler vk;
uint32_t desc[SAMPLER_DESC_WORDS];
};
@ -1076,7 +1077,7 @@ VK_DEFINE_NONDISP_HANDLE_CASTS(panvk_pipeline_layout, vk.base, VkPipelineLayout,
VK_OBJECT_TYPE_PIPELINE_LAYOUT)
VK_DEFINE_NONDISP_HANDLE_CASTS(panvk_render_pass, base, VkRenderPass,
VK_OBJECT_TYPE_RENDER_PASS)
VK_DEFINE_NONDISP_HANDLE_CASTS(panvk_sampler, base, VkSampler,
VK_DEFINE_NONDISP_HANDLE_CASTS(panvk_sampler, vk.base, VkSampler,
VK_OBJECT_TYPE_SAMPLER)
#define panvk_arch_name(name, version) panvk_##version##_##name

View file

@ -316,8 +316,8 @@ panvk_per_arch(CreateSampler)(VkDevice _device,
assert(pCreateInfo->sType == VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO);
sampler = vk_object_alloc(&device->vk, pAllocator, sizeof(*sampler),
VK_OBJECT_TYPE_SAMPLER);
sampler =
vk_sampler_create(&device->vk, pCreateInfo, pAllocator, sizeof(*sampler));
if (!sampler)
return vk_error(device, VK_ERROR_OUT_OF_HOST_MEMORY);