mirror of
https://git.h3cjp.net/H3cJP/yuzu.git
synced 2024-11-16 04:53:03 +00:00
maxwell_to_vk: Reorder filter cases and correct mipmap_filter=None
maxwell_to_vk: Reorder filtering modes to start with None, then Nearest, then Linear. maxwell_to_vk: Logs filter modes under UNREACHABLE_MSG instead of UNIMPLEMENTED_MSG, since any unknown filter modes are invalid and not unimplemented. maxwell_to_vk: Return VK_SAMPLER_MIPMAP_MODE_NEAREST instead of VK_SAMPLER_MIPMAP_MODE_LINEAR when mipmap_filter is None with the description from the VkSamplerCreateInfo(3) man page.
This commit is contained in:
parent
8868fb745f
commit
be660e7749
|
@ -21,29 +21,29 @@ namespace Sampler {
|
||||||
|
|
||||||
VkFilter Filter(Tegra::Texture::TextureFilter filter) {
|
VkFilter Filter(Tegra::Texture::TextureFilter filter) {
|
||||||
switch (filter) {
|
switch (filter) {
|
||||||
case Tegra::Texture::TextureFilter::Linear:
|
|
||||||
return VK_FILTER_LINEAR;
|
|
||||||
case Tegra::Texture::TextureFilter::Nearest:
|
case Tegra::Texture::TextureFilter::Nearest:
|
||||||
return VK_FILTER_NEAREST;
|
return VK_FILTER_NEAREST;
|
||||||
|
case Tegra::Texture::TextureFilter::Linear:
|
||||||
|
return VK_FILTER_LINEAR;
|
||||||
}
|
}
|
||||||
UNIMPLEMENTED_MSG("Unimplemented sampler filter={}", static_cast<u32>(filter));
|
UNREACHABLE_MSG("Invalid sampler filter={}", static_cast<u32>(filter));
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
VkSamplerMipmapMode MipmapMode(Tegra::Texture::TextureMipmapFilter mipmap_filter) {
|
VkSamplerMipmapMode MipmapMode(Tegra::Texture::TextureMipmapFilter mipmap_filter) {
|
||||||
switch (mipmap_filter) {
|
switch (mipmap_filter) {
|
||||||
case Tegra::Texture::TextureMipmapFilter::None:
|
case Tegra::Texture::TextureMipmapFilter::None:
|
||||||
// TODO(Rodrigo): None seems to be mapped to OpenGL's mag and min filters without mipmapping
|
// There are no Vulkan filter modes that directly correspond to OpenGL minification filters
|
||||||
// (e.g. GL_NEAREST and GL_LINEAR). Vulkan doesn't have such a thing, find out if we have to
|
// of GL_LINEAR or GL_NEAREST, but they can be emulated using
|
||||||
// use an image view with a single mipmap level to emulate this.
|
// VK_SAMPLER_MIPMAP_MODE_NEAREST, minLod = 0, and maxLod = 0.25, and using minFilter =
|
||||||
return VK_SAMPLER_MIPMAP_MODE_LINEAR;
|
// VK_FILTER_LINEAR or minFilter = VK_FILTER_NEAREST, respectively.
|
||||||
;
|
return VK_SAMPLER_MIPMAP_MODE_NEAREST;
|
||||||
case Tegra::Texture::TextureMipmapFilter::Linear:
|
|
||||||
return VK_SAMPLER_MIPMAP_MODE_LINEAR;
|
|
||||||
case Tegra::Texture::TextureMipmapFilter::Nearest:
|
case Tegra::Texture::TextureMipmapFilter::Nearest:
|
||||||
return VK_SAMPLER_MIPMAP_MODE_NEAREST;
|
return VK_SAMPLER_MIPMAP_MODE_NEAREST;
|
||||||
|
case Tegra::Texture::TextureMipmapFilter::Linear:
|
||||||
|
return VK_SAMPLER_MIPMAP_MODE_LINEAR;
|
||||||
}
|
}
|
||||||
UNIMPLEMENTED_MSG("Unimplemented sampler mipmap mode={}", static_cast<u32>(mipmap_filter));
|
UNREACHABLE_MSG("Invalid sampler mipmap mode={}", static_cast<u32>(mipmap_filter));
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -78,11 +78,10 @@ VkSamplerAddressMode WrapMode(const VKDevice& device, Tegra::Texture::WrapMode w
|
||||||
case Tegra::Texture::WrapMode::MirrorOnceBorder:
|
case Tegra::Texture::WrapMode::MirrorOnceBorder:
|
||||||
UNIMPLEMENTED();
|
UNIMPLEMENTED();
|
||||||
return VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE;
|
return VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE;
|
||||||
default:
|
}
|
||||||
UNIMPLEMENTED_MSG("Unimplemented wrap mode={}", static_cast<u32>(wrap_mode));
|
UNIMPLEMENTED_MSG("Unimplemented wrap mode={}", static_cast<u32>(wrap_mode));
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
VkCompareOp DepthCompareFunction(Tegra::Texture::DepthCompareFunc depth_compare_func) {
|
VkCompareOp DepthCompareFunction(Tegra::Texture::DepthCompareFunc depth_compare_func) {
|
||||||
switch (depth_compare_func) {
|
switch (depth_compare_func) {
|
||||||
|
@ -288,11 +287,10 @@ VkPrimitiveTopology PrimitiveTopology([[maybe_unused]] const VKDevice& device,
|
||||||
return VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST;
|
return VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST;
|
||||||
case Maxwell::PrimitiveTopology::Patches:
|
case Maxwell::PrimitiveTopology::Patches:
|
||||||
return VK_PRIMITIVE_TOPOLOGY_PATCH_LIST;
|
return VK_PRIMITIVE_TOPOLOGY_PATCH_LIST;
|
||||||
default:
|
}
|
||||||
UNIMPLEMENTED_MSG("Unimplemented topology={}", static_cast<u32>(topology));
|
UNIMPLEMENTED_MSG("Unimplemented topology={}", static_cast<u32>(topology));
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
VkFormat VertexFormat(Maxwell::VertexAttribute::Type type, Maxwell::VertexAttribute::Size size) {
|
VkFormat VertexFormat(Maxwell::VertexAttribute::Type type, Maxwell::VertexAttribute::Size size) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
|
|
Loading…
Reference in a new issue