mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-01-14 10:55:14 +00:00
image_view: Correct view format for D16Unorm images as well. (#1708)
Some checks are pending
Build and Release / reuse (push) Waiting to run
Build and Release / clang-format (push) Waiting to run
Build and Release / get-info (push) Waiting to run
Build and Release / windows-sdl (push) Blocked by required conditions
Build and Release / windows-qt (push) Blocked by required conditions
Build and Release / macos-sdl (push) Blocked by required conditions
Build and Release / macos-qt (push) Blocked by required conditions
Build and Release / linux-sdl (push) Blocked by required conditions
Build and Release / linux-qt (push) Blocked by required conditions
Build and Release / pre-release (push) Blocked by required conditions
Some checks are pending
Build and Release / reuse (push) Waiting to run
Build and Release / clang-format (push) Waiting to run
Build and Release / get-info (push) Waiting to run
Build and Release / windows-sdl (push) Blocked by required conditions
Build and Release / windows-qt (push) Blocked by required conditions
Build and Release / macos-sdl (push) Blocked by required conditions
Build and Release / macos-qt (push) Blocked by required conditions
Build and Release / linux-sdl (push) Blocked by required conditions
Build and Release / linux-qt (push) Blocked by required conditions
Build and Release / pre-release (push) Blocked by required conditions
This commit is contained in:
parent
f938829f12
commit
f347d3df18
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue