Skip to content

Commit

Permalink
image_view: Correct view format for D16Unorm images as well. (shadps4…
Browse files Browse the repository at this point in the history
  • Loading branch information
squidbus authored Dec 8, 2024
1 parent f938829 commit f347d3d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/video_core/texture_cache/image_view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,12 @@ ImageView::ImageView(const Vulkan::Instance& instance, const ImageViewInfo& info
if (!info.is_storage) {
usage_ci.usage &= ~vk::ImageUsageFlagBits::eStorage;
}
// When sampling D32 texture from shader, the T# specifies R32 Float format so adjust it.
// When sampling D32/D16 texture from shader, the T# specifies R32/R16 format so adjust it.
vk::Format format = info.format;
vk::ImageAspectFlags aspect = image.aspect_mask;
if (image.aspect_mask & vk::ImageAspectFlagBits::eDepth &&
(format == vk::Format::eR32Sfloat || format == vk::Format::eD32Sfloat)) {
(format == vk::Format::eR32Sfloat || format == vk::Format::eD32Sfloat ||
format == vk::Format::eR16Unorm || format == vk::Format::eD16Unorm)) {
format = image.info.pixel_format;
aspect = vk::ImageAspectFlagBits::eDepth;
}
Expand Down

0 comments on commit f347d3d

Please sign in to comment.