2019-04-22 15:58:27 +02:00
|
|
|
#include "common.h"
|
|
|
|
|
2020-05-18 23:38:57 +02:00
|
|
|
#include "declarations.h"
|
|
|
|
|
|
|
|
VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkCreateSampler)(
|
2019-04-22 15:58:27 +02:00
|
|
|
VkDevice device,
|
|
|
|
const VkSamplerCreateInfo* pCreateInfo,
|
|
|
|
const VkAllocationCallbacks* pAllocator,
|
|
|
|
VkSampler* pSampler)
|
|
|
|
{
|
2020-05-18 23:38:57 +02:00
|
|
|
PROFILESTART(RPIFUNC(vkCreateSampler));
|
2020-05-18 20:39:33 +02:00
|
|
|
|
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 23:38:57 +02:00
|
|
|
PROFILEEND(RPIFUNC(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 23:38:57 +02:00
|
|
|
PROFILEEND(RPIFUNC(vkCreateSampler));
|
2019-04-22 15:58:27 +02:00
|
|
|
return VK_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2020-05-18 23:38:57 +02:00
|
|
|
VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkDestroySampler)(
|
2019-04-22 15:58:27 +02:00
|
|
|
VkDevice device,
|
|
|
|
VkSampler sampler,
|
|
|
|
const VkAllocationCallbacks* pAllocator)
|
|
|
|
{
|
2020-05-18 23:38:57 +02:00
|
|
|
PROFILESTART(RPIFUNC(vkDestroySampler));
|
2020-05-18 20:39:33 +02:00
|
|
|
|
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
|
|
|
|
2020-05-18 23:38:57 +02:00
|
|
|
PROFILEEND(RPIFUNC(vkDestroySampler));
|
2019-04-22 15:58:27 +02:00
|
|
|
}
|
|
|
|
|
2020-05-18 23:38:57 +02:00
|
|
|
VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkCreateSamplerYcbcrConversion)(
|
2019-04-22 15:58:27 +02:00
|
|
|
VkDevice device,
|
|
|
|
const VkSamplerYcbcrConversionCreateInfo* pCreateInfo,
|
|
|
|
const VkAllocationCallbacks* pAllocator,
|
|
|
|
VkSamplerYcbcrConversion* pYcbcrConversion)
|
|
|
|
{
|
2020-05-18 23:38:57 +02:00
|
|
|
PROFILESTART(RPIFUNC(vkCreateSamplerYcbcrConversion));
|
2020-05-18 20:39:33 +02:00
|
|
|
|
2019-08-19 23:12:51 +02:00
|
|
|
//TODO
|
2020-05-18 20:39:33 +02:00
|
|
|
|
2020-05-18 23:38:57 +02:00
|
|
|
PROFILEEND(RPIFUNC(vkCreateSamplerYcbcrConversion));
|
2019-04-22 15:58:27 +02:00
|
|
|
return VK_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2020-05-18 23:38:57 +02:00
|
|
|
VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkDestroySamplerYcbcrConversion)(
|
2019-04-22 15:58:27 +02:00
|
|
|
VkDevice device,
|
|
|
|
VkSamplerYcbcrConversion ycbcrConversion,
|
|
|
|
const VkAllocationCallbacks* pAllocator)
|
|
|
|
{
|
2020-05-18 23:38:57 +02:00
|
|
|
PROFILESTART(RPIFUNC(vkDestroySamplerYcbcrConversion));
|
2020-05-18 20:39:33 +02:00
|
|
|
|
2019-08-19 23:12:51 +02:00
|
|
|
//TODO
|
2020-05-18 20:39:33 +02:00
|
|
|
|
2020-05-18 23:38:57 +02:00
|
|
|
PROFILEEND(RPIFUNC(vkDestroySamplerYcbcrConversion));
|
2019-04-22 15:58:27 +02:00
|
|
|
}
|