mirror of
https://github.com/skyline-emu/skyline.git
synced 2025-02-15 01:38:45 +03:00
Emulate the 'None' mipfilter by adjusting LOD
Borrowed this technique from yuzu since Vulkan has no direct equivalent
This commit is contained in:
parent
9d50b6d0f7
commit
856818c8eb
@ -1,5 +1,6 @@
|
|||||||
// SPDX-License-Identifier: MPL-2.0
|
// SPDX-License-Identifier: MPL-2.0
|
||||||
// Copyright © 2021 Skyline Team and Contributors (https://github.com/skyline-emu/)
|
// Copyright © 2021 Skyline Team and Contributors (https://github.com/skyline-emu/)
|
||||||
|
// Copyright © 2022 yuzu Emulator Project (https://github.com/yuzu-emu/)
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
@ -2404,7 +2405,8 @@ namespace skyline::gpu::interconnect {
|
|||||||
switch (filter) {
|
switch (filter) {
|
||||||
// @fmt:off
|
// @fmt:off
|
||||||
|
|
||||||
case TscFilter::None: return VkMode{};
|
// See https://github.com/yuzu-emu/yuzu/blob/5af06d14337a61d9ed1093079d13f68cbb1f5451/src/video_core/renderer_vulkan/maxwell_to_vk.cpp#L35
|
||||||
|
case TscFilter::None: return VkMode::eNearest;
|
||||||
case TscFilter::Nearest: return VkMode::eNearest;
|
case TscFilter::Nearest: return VkMode::eNearest;
|
||||||
case TscFilter::Linear: return VkMode::eLinear;
|
case TscFilter::Linear: return VkMode::eLinear;
|
||||||
|
|
||||||
@ -2534,8 +2536,8 @@ namespace skyline::gpu::interconnect {
|
|||||||
.maxAnisotropy = maxAnisotropy,
|
.maxAnisotropy = maxAnisotropy,
|
||||||
.compareEnable = samplerControl.depthCompareEnable,
|
.compareEnable = samplerControl.depthCompareEnable,
|
||||||
.compareOp = ConvertSamplerCompareOp(samplerControl.depthCompareOp),
|
.compareOp = ConvertSamplerCompareOp(samplerControl.depthCompareOp),
|
||||||
.minLod = samplerControl.MinLodClamp(),
|
.minLod = samplerControl.mipFilter == TextureSamplerControl::MipFilter::None ? 0.0f : samplerControl.MinLodClamp(),
|
||||||
.maxLod = samplerControl.MaxLodClamp(),
|
.maxLod = samplerControl.mipFilter == TextureSamplerControl::MipFilter::None ? 0.25f : samplerControl.MaxLodClamp(),
|
||||||
.unnormalizedCoordinates = false,
|
.unnormalizedCoordinates = false,
|
||||||
}, vk::SamplerReductionModeCreateInfoEXT{
|
}, vk::SamplerReductionModeCreateInfoEXT{
|
||||||
.reductionMode = ConvertSamplerReductionFilter(samplerControl.reductionFilter),
|
.reductionMode = ConvertSamplerReductionFilter(samplerControl.reductionFilter),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user