1
0
mirror of https://github.com/Yours3lf/rpi-vk-driver.git synced 2025-01-30 22:52:14 +01:00

disable auto lod is now handled by minlod

This commit is contained in:
Unknown 2020-04-10 14:24:52 +01:00
parent 34cf9df0df
commit 3de1deb156
2 changed files with 3 additions and 6 deletions

View File

@ -135,18 +135,16 @@ void createSampler(VkDevice device, VkSampler* nearestTextureSampler, VkSampler*
sampler.addressModeW = VK_SAMPLER_ADDRESS_MODE_REPEAT;
sampler.mipLodBias = 0.0f;
sampler.compareOp = VK_COMPARE_OP_NEVER;
sampler.minLod = 0.0f;
sampler.minLod = 1.0f; //disable auto LOD
sampler.maxLod = 0.0f;
sampler.borderColor = VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK;
rpi_vkCreateSampler(device, &sampler, 0, nearestTextureSampler);
_sampler* s = nearestTextureSampler;
s->disableAutoLod = 1;
sampler.magFilter = VK_FILTER_LINEAR;
sampler.minFilter = VK_FILTER_LINEAR;
rpi_vkCreateSampler(device, &sampler, 0, linearTextureSampler);
s = linearTextureSampler;
s->disableAutoLod = 1;
}
void createRendertarget(VkDevice device, uint32_t baseMip, uint32_t width, uint32_t height, VkImage textureImage, VkImageView* textureView, VkRenderPass* offscreenRenderPass, VkFramebuffer* offscreenFramebuffer)
@ -1030,12 +1028,11 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdBlitImage(
samplerCI.addressModeW = VK_SAMPLER_ADDRESS_MODE_REPEAT;
samplerCI.mipLodBias = srcMipLevel;
samplerCI.compareOp = VK_COMPARE_OP_NEVER;
samplerCI.minLod = 0.0f;
samplerCI.minLod = 1.0f; //disable auto LOD
samplerCI.maxLod = 999.0f;
samplerCI.borderColor = VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK;
rpi_vkCreateSampler(device, &samplerCI, 0, &mipSampler);
_sampler* s = mipSampler;
s->disableAutoLod = 1;
VkImageViewCreateInfo view = {};
view.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO;

View File

@ -32,7 +32,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateSampler(
s->maxLod = pCreateInfo->maxLod;
s->borderColor = pCreateInfo->borderColor;
s->unnormalizedCoordinates = pCreateInfo->unnormalizedCoordinates;
s->disableAutoLod = 0;
s->disableAutoLod = s->minLod > 0.0f;
*pSampler = s;