[PR #3226] [CLOSED] video_core: support for RT layer outputs #3319

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

📋 Pull Request Information

Original PR: https://github.com/shadps4-emu/shadPS4/pull/3226
Author: @polybiusproxy
Created: 7/10/2025
Status: Closed

Base: mainHead: video_core/layers2


📝 Commits (2)

  • 7a20a8e video_core: support for RT layer outputs
  • 026e29f Extra logging

📊 Changes

16 files changed (+180 additions, -138 deletions)

View changed files

📝 src/shader_recompiler/backend/spirv/emit_spirv.cpp (+3 -0)
📝 src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp (+17 -53)
📝 src/shader_recompiler/backend/spirv/spirv_emit_context.cpp (+18 -27)
📝 src/shader_recompiler/backend/spirv/spirv_emit_context.h (+2 -0)
📝 src/shader_recompiler/frontend/translate/export.cpp (+5 -2)
📝 src/shader_recompiler/frontend/translate/translate.h (+1 -0)
📝 src/shader_recompiler/info.h (+1 -0)
📝 src/shader_recompiler/ir/passes/ring_access_elimination.cpp (+7 -5)
📝 src/shader_recompiler/ir/passes/shader_info_collection_pass.cpp (+4 -0)
src/shader_recompiler/ir/position.h (+53 -0)
📝 src/shader_recompiler/runtime_info.h (+5 -3)
📝 src/video_core/renderer_vulkan/vk_instance.cpp (+1 -0)
📝 src/video_core/renderer_vulkan/vk_pipeline_cache.cpp (+52 -45)
📝 src/video_core/renderer_vulkan/vk_rasterizer.cpp (+6 -0)
📝 src/video_core/renderer_vulkan/vk_scheduler.cpp (+4 -3)
📝 src/video_core/renderer_vulkan/vk_scheduler.h (+1 -0)

📄 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 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/3226 **Author:** [@polybiusproxy](https://github.com/polybiusproxy) **Created:** 7/10/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `video_core/layers2` --- ### 📝 Commits (2) - [`7a20a8e`](https://github.com/shadps4-emu/shadPS4/commit/7a20a8e86afd4b5d87066816e5ad64e8a371edeb) video_core: support for RT layer outputs - [`026e29f`](https://github.com/shadps4-emu/shadPS4/commit/026e29f7e681b8b47c42888897f464362817ec07) Extra logging ### 📊 Changes **16 files changed** (+180 additions, -138 deletions) <details> <summary>View changed files</summary> 📝 `src/shader_recompiler/backend/spirv/emit_spirv.cpp` (+3 -0) 📝 `src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp` (+17 -53) 📝 `src/shader_recompiler/backend/spirv/spirv_emit_context.cpp` (+18 -27) 📝 `src/shader_recompiler/backend/spirv/spirv_emit_context.h` (+2 -0) 📝 `src/shader_recompiler/frontend/translate/export.cpp` (+5 -2) 📝 `src/shader_recompiler/frontend/translate/translate.h` (+1 -0) 📝 `src/shader_recompiler/info.h` (+1 -0) 📝 `src/shader_recompiler/ir/passes/ring_access_elimination.cpp` (+7 -5) 📝 `src/shader_recompiler/ir/passes/shader_info_collection_pass.cpp` (+4 -0) ➕ `src/shader_recompiler/ir/position.h` (+53 -0) 📝 `src/shader_recompiler/runtime_info.h` (+5 -3) 📝 `src/video_core/renderer_vulkan/vk_instance.cpp` (+1 -0) 📝 `src/video_core/renderer_vulkan/vk_pipeline_cache.cpp` (+52 -45) 📝 `src/video_core/renderer_vulkan/vk_rasterizer.cpp` (+6 -0) 📝 `src/video_core/renderer_vulkan/vk_scheduler.cpp` (+4 -3) 📝 `src/video_core/renderer_vulkan/vk_scheduler.h` (+1 -0) </details> ### 📄 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 - https://github.com/GPUOpen-Drivers/llpc/blob/6222f1ff6ba7f00b085003c1a05fdbdc31356235/lgc/lowering/LowerInOut.cpp#L1526 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 22:03:15 +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#3319
No description provided.