Flip S8D24 red and green channels, pass float border color rather than int

This commit is contained in:
Kelebek1 2023-03-02 23:03:07 +00:00
parent 97f7a560f3
commit 0fa046e157
3 changed files with 8 additions and 2 deletions

View file

@ -1064,7 +1064,7 @@ void RasterizerVulkan::UpdateDepthBoundsTestEnable(Tegra::Engines::Maxwell3D::Re
LOG_WARNING(Render_Vulkan, "Depth bounds is enabled but not supported");
enabled = false;
}
scheduler.Record([enable = regs.depth_bounds_enable](vk::CommandBuffer cmdbuf) {
scheduler.Record([enable = enabled](vk::CommandBuffer cmdbuf) {
cmdbuf.SetDepthBoundsTestEnableEXT(enable);
});
}

View file

@ -1763,7 +1763,7 @@ Sampler::Sampler(TextureCacheRuntime& runtime, const Tegra::Texture::TSCEntry& t
.minLod = tsc.mipmap_filter == TextureMipmapFilter::None ? 0.0f : tsc.MinLod(),
.maxLod = tsc.mipmap_filter == TextureMipmapFilter::None ? 0.25f : tsc.MaxLod(),
.borderColor =
arbitrary_borders ? VK_BORDER_COLOR_INT_CUSTOM_EXT : ConvertBorderColor(color),
arbitrary_borders ? VK_BORDER_COLOR_FLOAT_CUSTOM_EXT : ConvertBorderColor(color),
.unnormalizedCoordinates = VK_FALSE,
});
}

View file

@ -74,6 +74,12 @@ ImageViewInfo::ImageViewInfo(const TICEntry& config, s32 base_layer) noexcept
ASSERT_MSG(false, "Invalid texture_type={}", static_cast<int>(config.texture_type.Value()));
break;
}
// S8_UINT_D24_UNORM is not supported directly, and we use D24S8 instead.
// To make sure shaders grab the right channels, swap R and G.
if (format == PixelFormat::S8_UINT_D24_UNORM) {
y_source = std::exchange(x_source, y_source);
}
}
ImageViewInfo::ImageViewInfo(ImageViewType type_, PixelFormat format_,