1
0
mirror of https://github.com/Yours3lf/rpi-vk-driver.git synced 2024-11-28 10:24:15 +01:00
rpi-vk-driver/driver/sampler.c

87 lines
2.5 KiB
C
Raw Normal View History

2019-04-22 15:58:27 +02:00
#include "common.h"
#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)
{
PROFILESTART(RPIFUNC(vkCreateSampler));
assert(device);
assert(pCreateInfo);
assert(pSampler);
_sampler* s = ALLOCATE(sizeof(_sampler), 1, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if(!s)
{
PROFILEEND(RPIFUNC(vkCreateSampler));
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;
*pSampler = s;
PROFILEEND(RPIFUNC(vkCreateSampler));
2019-04-22 15:58:27 +02:00
return VK_SUCCESS;
}
VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkDestroySampler)(
2019-04-22 15:58:27 +02:00
VkDevice device,
VkSampler sampler,
const VkAllocationCallbacks* pAllocator)
{
PROFILESTART(RPIFUNC(vkDestroySampler));
assert(device);
2019-04-22 15:58:27 +02:00
FREE(sampler);
PROFILEEND(RPIFUNC(vkDestroySampler));
2019-04-22 15:58:27 +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)
{
PROFILESTART(RPIFUNC(vkCreateSamplerYcbcrConversion));
//TODO
PROFILEEND(RPIFUNC(vkCreateSamplerYcbcrConversion));
2019-04-22 15:58:27 +02:00
return VK_SUCCESS;
}
VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkDestroySamplerYcbcrConversion)(
2019-04-22 15:58:27 +02:00
VkDevice device,
VkSamplerYcbcrConversion ycbcrConversion,
const VkAllocationCallbacks* pAllocator)
{
PROFILESTART(RPIFUNC(vkDestroySamplerYcbcrConversion));
//TODO
PROFILEEND(RPIFUNC(vkDestroySamplerYcbcrConversion));
2019-04-22 15:58:27 +02:00
}