[PR #2092] [MERGED] amdgpu: Handle 8-bit float format case for stencil. #2486

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

📋 Pull Request Information

Original PR: https://github.com/shadps4-emu/shadPS4/pull/2092
Author: @squidbus
Created: 1/8/2025
Status: Merged
Merged: 1/10/2025
Merged by: @georgemoralis

Base: mainHead: 8float


📝 Commits (1)

  • d29c78e amdgpu: Handle 8-bit float format case for stencil.

📊 Changes

3 files changed (+13 additions, -4 deletions)

View changed files

📝 src/video_core/amdgpu/liverpool.h (+2 -1)
📝 src/video_core/amdgpu/resource.h (+2 -2)
📝 src/video_core/amdgpu/types.h (+9 -1)

📄 Description

8-bit float format is sometimes used for stencil views of a depth-stencil image. It's possible that because float formats don't do conversion this just happens to work on a real GPU even though 8-bit floats aren't supported; the shaders I've seen just read it as uint anyway. Handle this case by changing 8-bit float format to 8-bit unsigned integer automatically, to match stencil format.

Unfortunately we can't really know if this will end up being used for a stencil view of an existing depth-stencil image as we need the format change to happen earlier than that point, e.g. to use the right types in the shader resources and resolve the Vulkan format for the ImageViewInfo. Therefore, this just applies the conversion to all 8-bit float resources. If we do hit any non-stencil cases this should still work as it would on real hardware due to the lack of bit conversion for float formats.


🔄 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/2092 **Author:** [@squidbus](https://github.com/squidbus) **Created:** 1/8/2025 **Status:** ✅ Merged **Merged:** 1/10/2025 **Merged by:** [@georgemoralis](https://github.com/georgemoralis) **Base:** `main` ← **Head:** `8float` --- ### 📝 Commits (1) - [`d29c78e`](https://github.com/shadps4-emu/shadPS4/commit/d29c78e571465624e5b8733f5b912cbccb9a6826) amdgpu: Handle 8-bit float format case for stencil. ### 📊 Changes **3 files changed** (+13 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `src/video_core/amdgpu/liverpool.h` (+2 -1) 📝 `src/video_core/amdgpu/resource.h` (+2 -2) 📝 `src/video_core/amdgpu/types.h` (+9 -1) </details> ### 📄 Description 8-bit float format is sometimes used for stencil views of a depth-stencil image. It's possible that because float formats don't do conversion this just happens to work on a real GPU even though 8-bit floats aren't supported; the shaders I've seen just read it as uint anyway. Handle this case by changing 8-bit float format to 8-bit unsigned integer automatically, to match stencil format. Unfortunately we can't really know if this will end up being used for a stencil view of an existing depth-stencil image as we need the format change to happen earlier than that point, e.g. to use the right types in the shader resources and resolve the Vulkan format for the `ImageViewInfo`. Therefore, this just applies the conversion to all 8-bit float resources. If we do hit any non-stencil cases this *should* still work as it would on real hardware due to the lack of bit conversion for float formats. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 22:00:05 +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#2486
No description provided.