[PR #2575] [CLOSED] video_core: support for multi-layered outputs #2830

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

📋 Pull Request Information

Original PR: https://github.com/shadps4-emu/shadPS4/pull/2575
Author: @polybiusproxy
Created: 3/1/2025
Status: Closed

Base: mainHead: video_core/layers


📄 Description

Games can choose what slice of the render target to write to from within a shader—this is commonly used for drawing cubemaps in a single pass. This can be done from geometry, vertex, or tesselation eval shaders.
This works by outputting the selected slice to the Z component of the pos1 target:

s_load_dwordx16 s[40:55], s[6:7], 0x0
/*snip*/
v_mov_b32       v15, s40
/*snip*/
exp             pos1, off, off, v15, off done

Can also be seen used on the AMD compilers:

This PR also fixes a bug where depth targets weren't refreshed - fixes a bug where a depth buffer cleared from a compute shader won't clear the depth image.


🔄 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/2575 **Author:** [@polybiusproxy](https://github.com/polybiusproxy) **Created:** 3/1/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `video_core/layers` --- ### 📄 Description Games can choose what slice of the render target to write to from within a shader—this is commonly used for drawing cubemaps in a single pass. This can be done from geometry, vertex, or tesselation eval shaders. This works by outputting the selected slice to the Z component of the pos1 target: ``` s_load_dwordx16 s[40:55], s[6:7], 0x0 /*snip*/ v_mov_b32 v15, s40 /*snip*/ exp pos1, off, off, v15, off done ``` Can also be seen used on the AMD compilers: - https://godbolt.org/z/xT9nfGdcs <- Example of compiler using pos1 exports to output RT slice target. - https://github.com/GPUOpen-Drivers/llpc/blob/6222f1ff6ba7f00b085003c1a05fdbdc31356235/lgc/lowering/LowerInOut.cpp#L1526 This PR also fixes a bug where depth targets weren't refreshed - fixes a bug where a depth buffer cleared from a compute shader won't clear the depth image. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 22:01:24 +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#2830
No description provided.