[PR #1556] [MERGED] image_view: Use array view for color/depth buffers with multiple layers. #2169

Closed
opened 2026-02-27 21:15:27 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/shadps4-emu/shadPS4/pull/1556
Author: @squidbus
Created: 11/20/2024
Status: Merged
Merged: 11/20/2024
Merged by: @georgemoralis

Base: mainHead: buf-layers


📝 Commits (1)

  • 6af3c70 image_view: Use array view for color/depth buffers with multiple layers.

📊 Changes

1 file changed (+2 additions, -0 deletions)

View changed files

📝 src/video_core/texture_cache/image_view.cpp (+2 -0)

📄 Description

Currently when an image view is created for a color or depth buffer, range.extent.layers may be set to greater than 1, but type is always defaulted to vk::ImageViewType::e2D. This causes the following validation error, which can crash certain drivers:

[Render.Vulkan] <Error> vk_platform.cpp:DebugUtilsCallback:70: VUID-VkImageViewCreateInfo-imageViewType-04973: Validation Error: [ VUID-VkImageViewCreateInfo-imageViewType-04973 ] Object 0: handle = 0x2894590000000072, name = Image 1920x1080x1 0xaeae0000:0x1200000, type = VK_OBJECT_TYPE_IMAGE; | MessageID = 0x8ab1932c | vkCreateImageView(): pCreateInfo->subresourceRange.layerCount (2) must be 1 when using viewType VK_IMAGE_VIEW_TYPE_2D (try looking into VK_IMAGE_VIEW_TYPE_*_ARRAY).
The Vulkan spec states: If viewType is VK_IMAGE_VIEW_TYPE_1D, VK_IMAGE_VIEW_TYPE_2D, or VK_IMAGE_VIEW_TYPE_3D; and subresourceRange.layerCount is not VK_REMAINING_ARRAY_LAYERS, then subresourceRange.layerCount must be 1 (https://vulkan.lunarg.com/doc/view/1.3.296.0/mac/1.3-extensions/vkspec.html#VUID-VkImageViewCreateInfo-imageViewType-04973)

Instead, use vk::ImageViewType::e2DArray when the number of layers is greater than 1.

Fixes booting CUSA04518 on macOS.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/shadps4-emu/shadPS4/pull/1556 **Author:** [@squidbus](https://github.com/squidbus) **Created:** 11/20/2024 **Status:** ✅ Merged **Merged:** 11/20/2024 **Merged by:** [@georgemoralis](https://github.com/georgemoralis) **Base:** `main` ← **Head:** `buf-layers` --- ### 📝 Commits (1) - [`6af3c70`](https://github.com/shadps4-emu/shadPS4/commit/6af3c7063beafc1ece119c8de7a3b6bb2d33ebbd) image_view: Use array view for color/depth buffers with multiple layers. ### 📊 Changes **1 file changed** (+2 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `src/video_core/texture_cache/image_view.cpp` (+2 -0) </details> ### 📄 Description Currently when an image view is created for a color or depth buffer, `range.extent.layers` may be set to greater than 1, but type is always defaulted to `vk::ImageViewType::e2D`. This causes the following validation error, which can crash certain drivers: ``` [Render.Vulkan] <Error> vk_platform.cpp:DebugUtilsCallback:70: VUID-VkImageViewCreateInfo-imageViewType-04973: Validation Error: [ VUID-VkImageViewCreateInfo-imageViewType-04973 ] Object 0: handle = 0x2894590000000072, name = Image 1920x1080x1 0xaeae0000:0x1200000, type = VK_OBJECT_TYPE_IMAGE; | MessageID = 0x8ab1932c | vkCreateImageView(): pCreateInfo->subresourceRange.layerCount (2) must be 1 when using viewType VK_IMAGE_VIEW_TYPE_2D (try looking into VK_IMAGE_VIEW_TYPE_*_ARRAY). The Vulkan spec states: If viewType is VK_IMAGE_VIEW_TYPE_1D, VK_IMAGE_VIEW_TYPE_2D, or VK_IMAGE_VIEW_TYPE_3D; and subresourceRange.layerCount is not VK_REMAINING_ARRAY_LAYERS, then subresourceRange.layerCount must be 1 (https://vulkan.lunarg.com/doc/view/1.3.296.0/mac/1.3-extensions/vkspec.html#VUID-VkImageViewCreateInfo-imageViewType-04973) ``` Instead, use `vk::ImageViewType::e2DArray` when the number of layers is greater than 1. Fixes booting CUSA04518 on macOS. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 21:15:27 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/shadPS4#2169
No description provided.