mirror of
https://github.com/starr-dusT/yuzu-mainline
synced 2024-03-05 21:12:25 -08:00
vk_sampler_cache: Emulate GL_LINEAR/NEAREST minification filters
Emulate GL_LINEAR/NEAREST minification filters using minLod = 0 and maxLod = 0.25 during sampler creation
This commit is contained in:
parent
be660e7749
commit
2f420618ea
@ -9,6 +9,8 @@
|
|||||||
#include "video_core/renderer_vulkan/wrapper.h"
|
#include "video_core/renderer_vulkan/wrapper.h"
|
||||||
#include "video_core/textures/texture.h"
|
#include "video_core/textures/texture.h"
|
||||||
|
|
||||||
|
using Tegra::Texture::TextureMipmapFilter;
|
||||||
|
|
||||||
namespace Vulkan {
|
namespace Vulkan {
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
@ -63,8 +65,8 @@ vk::Sampler VKSamplerCache::CreateSampler(const Tegra::Texture::TSCEntry& tsc) c
|
|||||||
ci.maxAnisotropy = tsc.GetMaxAnisotropy();
|
ci.maxAnisotropy = tsc.GetMaxAnisotropy();
|
||||||
ci.compareEnable = tsc.depth_compare_enabled;
|
ci.compareEnable = tsc.depth_compare_enabled;
|
||||||
ci.compareOp = MaxwellToVK::Sampler::DepthCompareFunction(tsc.depth_compare_func);
|
ci.compareOp = MaxwellToVK::Sampler::DepthCompareFunction(tsc.depth_compare_func);
|
||||||
ci.minLod = tsc.GetMinLod();
|
ci.minLod = tsc.mipmap_filter == TextureMipmapFilter::None ? 0.0f : tsc.GetMinLod();
|
||||||
ci.maxLod = tsc.GetMaxLod();
|
ci.maxLod = tsc.mipmap_filter == TextureMipmapFilter::None ? 0.25f : tsc.GetMaxLod();
|
||||||
ci.borderColor = arbitrary_borders ? VK_BORDER_COLOR_INT_CUSTOM_EXT : ConvertBorderColor(color);
|
ci.borderColor = arbitrary_borders ? VK_BORDER_COLOR_INT_CUSTOM_EXT : ConvertBorderColor(color);
|
||||||
ci.unnormalizedCoordinates = VK_FALSE;
|
ci.unnormalizedCoordinates = VK_FALSE;
|
||||||
return device.GetLogical().CreateSampler(ci);
|
return device.GetLogical().CreateSampler(ci);
|
||||||
|
Loading…
Reference in New Issue
Block a user