From 3de1deb1560101312e585ce045d929c8c6a9b2e7 Mon Sep 17 00:00:00 2001 From: Unknown <0.tamas.marton@gmail.com> Date: Fri, 10 Apr 2020 14:24:52 +0100 Subject: [PATCH] disable auto lod is now handled by minlod --- driver/copy.c | 7 ++----- driver/sampler.c | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/driver/copy.c b/driver/copy.c index 06f18ff..872cdc7 100644 --- a/driver/copy.c +++ b/driver/copy.c @@ -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; diff --git a/driver/sampler.c b/driver/sampler.c index 3772742..49d99ef 100644 --- a/driver/sampler.c +++ b/driver/sampler.c @@ -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;