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)
|
|
|
|
{
|
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)
|
|
|
|
{
|
|
|
|
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 15:24:52 +02:00
|
|
|
s->disableAutoLod = s->minLod > 0.0f;
|
2019-08-19 23:12:51 +02:00
|
|
|
|
|
|
|
*pSampler = s;
|
|
|
|
|
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)
|
|
|
|
{
|
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);
|
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)
|
|
|
|
{
|
2019-08-19 23:12:51 +02:00
|
|
|
//TODO
|
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)
|
|
|
|
{
|
2019-08-19 23:12:51 +02:00
|
|
|
//TODO
|
2019-04-22 15:58:27 +02:00
|
|
|
}
|