mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-18 00:48:07 +02:00
Create a hashing key on all samplers so we can just copy that anywhere we need it. That key already contains the needed parameters for embedded samplers, so the sha1 stuff can go away. Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Ivan Briano <ivan.briano@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35955>
50 lines
1.4 KiB
C
50 lines
1.4 KiB
C
/* Copyright © 2024 Intel Corporation
|
|
* SPDX-License-Identifier: MIT
|
|
*/
|
|
|
|
#include "anv_private.h"
|
|
|
|
VkResult anv_GetSamplerOpaqueCaptureDescriptorDataEXT(
|
|
VkDevice _device,
|
|
const VkSamplerCaptureDescriptorDataInfoEXT* pInfo,
|
|
void* pData)
|
|
{
|
|
ANV_FROM_HANDLE(anv_device, device, _device);
|
|
ANV_FROM_HANDLE(anv_sampler, sampler, pInfo->sampler);
|
|
|
|
if (sampler->custom_border_color_state.alloc_size != 0) {
|
|
*((uint32_t *)pData) =
|
|
anv_state_reserved_array_pool_state_index(
|
|
&device->custom_border_colors,
|
|
sampler->custom_border_color_state);
|
|
} else {
|
|
*((uint32_t *)pData) = 0;
|
|
}
|
|
|
|
return VK_SUCCESS;
|
|
}
|
|
|
|
void anv_DestroySampler(
|
|
VkDevice _device,
|
|
VkSampler _sampler,
|
|
const VkAllocationCallbacks* pAllocator)
|
|
{
|
|
ANV_FROM_HANDLE(anv_device, device, _device);
|
|
ANV_FROM_HANDLE(anv_sampler, sampler, _sampler);
|
|
|
|
if (!sampler)
|
|
return;
|
|
|
|
if (sampler->bindless_state.map) {
|
|
anv_state_pool_free(&device->dynamic_state_pool,
|
|
sampler->bindless_state);
|
|
}
|
|
|
|
if (sampler->custom_border_color_state.map) {
|
|
anv_state_reserved_array_pool_free(
|
|
&device->custom_border_colors,
|
|
sampler->custom_border_color_state);
|
|
}
|
|
|
|
vk_sampler_destroy(&device->vk, pAllocator, &sampler->vk);
|
|
}
|