2019-04-22 15:58:27 +02:00
|
|
|
#include "common.h"
|
|
|
|
|
2019-09-30 00:52:21 +02:00
|
|
|
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateSampler(
|
2019-04-22 15:58:27 +02:00
|
|
|
VkDevice device,
|
|
|
|
const VkSamplerCreateInfo* pCreateInfo,
|
|
|
|
const VkAllocationCallbacks* pAllocator,
|
|
|
|
VkSampler* pSampler)
|
|
|
|
{
|
2020-05-18 20:39:33 +02:00
|
|
|
PROFILESTART(rpi_vkCreateSampler);
|
|
|
|
|
2019-08-19 23:12:51 +02:00
|
|
|
assert(device);
|
|
|
|
assert(pCreateInfo);
|
|
|
|
assert(pSampler);
|
|
|
|
|
|
|
|
_sampler* s = ALLOCATE(sizeof(_sampler), 1, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
|
|
|
|
|
|
|
|
if(!s)
|
|
|
|
{
|
2020-05-18 20:39:33 +02:00
|
|
|
PROFILEEND(rpi_vkCreateSampler);
|
2019-08-19 23:12:51 +02:00
|
|
|
return VK_ERROR_OUT_OF_HOST_MEMORY;
|
|
|
|
}
|
|
|
|
|
|
|
|
s->minFilter = pCreateInfo->minFilter;
|
|
|
|
s->magFilter = pCreateInfo->magFilter;
|
|
|
|
s->mipmapMode = pCreateInfo->mipmapMode;
|
|
|
|
s->addressModeU = pCreateInfo->addressModeU;
|
|
|
|
s->addressModeV = pCreateInfo->addressModeV;
|
|
|
|
s->addressModeW = pCreateInfo->addressModeW;
|
|
|
|
s->mipLodBias = pCreateInfo->mipLodBias;
|
|
|
|
s->anisotropyEnable = pCreateInfo->anisotropyEnable;
|
|
|
|
s->maxAnisotropy = pCreateInfo->maxAnisotropy;
|
|
|
|
s->compareEnable = pCreateInfo->compareEnable;
|
|
|
|
s->compareOp = pCreateInfo->compareOp;
|
|
|
|
s->minLod = pCreateInfo->minLod;
|
|
|
|
s->maxLod = pCreateInfo->maxLod;
|
|
|
|
s->borderColor = pCreateInfo->borderColor;
|
|
|
|
s->unnormalizedCoordinates = pCreateInfo->unnormalizedCoordinates;
|
2020-04-10 16:04:09 +02:00
|
|
|
s->disableAutoLod = s->mipLodBias > 0.0f;
|
2019-08-19 23:12:51 +02:00
|
|
|
|
|
|
|
*pSampler = s;
|
|
|
|
|
2020-05-18 20:39:33 +02:00
|
|
|
PROFILEEND(rpi_vkCreateSampler);
|
2019-04-22 15:58:27 +02:00
|
|
|
return VK_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2019-09-30 00:52:21 +02:00
|
|
|
VKAPI_ATTR void VKAPI_CALL rpi_vkDestroySampler(
|
2019-04-22 15:58:27 +02:00
|
|
|
VkDevice device,
|
|
|
|
VkSampler sampler,
|
|
|
|
const VkAllocationCallbacks* pAllocator)
|
|
|
|
{
|
2020-05-18 20:39:33 +02:00
|
|
|
PROFILESTART(rpi_vkDestroySampler);
|
|
|
|
|
2019-08-19 23:12:51 +02:00
|
|
|
assert(device);
|
2019-04-22 15:58:27 +02:00
|
|
|
|
2019-08-19 23:12:51 +02:00
|
|
|
FREE(sampler);
|
2020-05-18 20:39:33 +02:00
|
|
|
|
|
|
|
PROFILEEND(rpi_vkDestroySampler);
|
2019-04-22 15:58:27 +02:00
|
|
|
}
|
|
|
|
|
2019-09-30 00:52:21 +02:00
|
|
|
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateSamplerYcbcrConversion(
|
2019-04-22 15:58:27 +02:00
|
|
|
VkDevice device,
|
|
|
|
const VkSamplerYcbcrConversionCreateInfo* pCreateInfo,
|
|
|
|
const VkAllocationCallbacks* pAllocator,
|
|
|
|
VkSamplerYcbcrConversion* pYcbcrConversion)
|
|
|
|
{
|
2020-05-18 20:39:33 +02:00
|
|
|
PROFILESTART(rpi_vkCreateSamplerYcbcrConversion);
|
|
|
|
|
2019-08-19 23:12:51 +02:00
|
|
|
//TODO
|
2020-05-18 20:39:33 +02:00
|
|
|
|
|
|
|
PROFILEEND(rpi_vkCreateSamplerYcbcrConversion);
|
2019-04-22 15:58:27 +02:00
|
|
|
return VK_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2019-09-30 00:52:21 +02:00
|
|
|
VKAPI_ATTR void VKAPI_CALL rpi_vkDestroySamplerYcbcrConversion(
|
2019-04-22 15:58:27 +02:00
|
|
|
VkDevice device,
|
|
|
|
VkSamplerYcbcrConversion ycbcrConversion,
|
|
|
|
const VkAllocationCallbacks* pAllocator)
|
|
|
|
{
|
2020-05-18 20:39:33 +02:00
|
|
|
PROFILESTART(rpi_vkDestroySamplerYcbcrConversion);
|
|
|
|
|
2019-08-19 23:12:51 +02:00
|
|
|
//TODO
|
2020-05-18 20:39:33 +02:00
|
|
|
|
|
|
|
PROFILEEND(rpi_vkDestroySamplerYcbcrConversion);
|
2019-04-22 15:58:27 +02:00
|
|
|
}
|