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

69 lines
2.0 KiB
C
Raw Normal View History

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)
{
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;
s->disableAutoLod = s->minLod > 0.0f;
*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)
{
assert(device);
2019-04-22 15:58:27 +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)
{
//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)
{
//TODO
2019-04-22 15:58:27 +02:00
}