[PR #1097] [MERGED] shader_recompiler: Define fragment output type based on number format. #1927

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

📋 Pull Request Information

Original PR: https://github.com/shadps4-emu/shadPS4/pull/1097
Author: @squidbus
Created: 9/27/2024
Status: Merged
Merged: 10/1/2024
Merged by: @raphaelthegreat

Base: mainHead: frag-out-type


📝 Commits (3)

  • d43ded0 shader_recompiler: Define fragment output type based on number format.
  • 10af2e8 shader_recompiler: Fix GetAttribute SPIR-V output type.
  • e7ffdae shader_recompiler: Don't bitcast on SetAttribute unless integer target.

📊 Changes

7 files changed (+97 additions, -38 deletions)

View changed files

📝 src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp (+52 -12)
📝 src/shader_recompiler/backend/spirv/spirv_emit_context.cpp (+23 -16)
📝 src/shader_recompiler/backend/spirv/spirv_emit_context.h (+4 -3)
📝 src/shader_recompiler/frontend/translate/export.cpp (+1 -1)
📝 src/shader_recompiler/runtime_info.h (+8 -2)
📝 src/video_core/renderer_vulkan/vk_graphics_pipeline.h (+1 -0)
📝 src/video_core/renderer_vulkan/vk_pipeline_cache.cpp (+8 -4)

📄 Description

  • Expand fragment shader runtime info for render targets to include the number format.
  • Declare fragment shader render target outputs with the correct number type.
  • Cast to the correct output number type in EmitSetAttribute.
  • Fix a misplaced brace, a wrong exception message, and the param pointer type in OutputAttrPointer (currently always the same as what was hardcoded, but use the right field in case it isn't in the future).

This fixes at least two shaders in CUSA16429 which were trying to output to R32Uint targets with float type, causing SPIR-V errors.


🔄 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/1097 **Author:** [@squidbus](https://github.com/squidbus) **Created:** 9/27/2024 **Status:** ✅ Merged **Merged:** 10/1/2024 **Merged by:** [@raphaelthegreat](https://github.com/raphaelthegreat) **Base:** `main` ← **Head:** `frag-out-type` --- ### 📝 Commits (3) - [`d43ded0`](https://github.com/shadps4-emu/shadPS4/commit/d43ded07acab2ca0b32a6e7ade3d2a25e1562cf8) shader_recompiler: Define fragment output type based on number format. - [`10af2e8`](https://github.com/shadps4-emu/shadPS4/commit/10af2e8937c178c88ebfd8097fce5512538a7132) shader_recompiler: Fix GetAttribute SPIR-V output type. - [`e7ffdae`](https://github.com/shadps4-emu/shadPS4/commit/e7ffdaec2ba95dff25423de162f8741a2e9adde8) shader_recompiler: Don't bitcast on SetAttribute unless integer target. ### 📊 Changes **7 files changed** (+97 additions, -38 deletions) <details> <summary>View changed files</summary> 📝 `src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp` (+52 -12) 📝 `src/shader_recompiler/backend/spirv/spirv_emit_context.cpp` (+23 -16) 📝 `src/shader_recompiler/backend/spirv/spirv_emit_context.h` (+4 -3) 📝 `src/shader_recompiler/frontend/translate/export.cpp` (+1 -1) 📝 `src/shader_recompiler/runtime_info.h` (+8 -2) 📝 `src/video_core/renderer_vulkan/vk_graphics_pipeline.h` (+1 -0) 📝 `src/video_core/renderer_vulkan/vk_pipeline_cache.cpp` (+8 -4) </details> ### 📄 Description * Expand fragment shader runtime info for render targets to include the number format. * Declare fragment shader render target outputs with the correct number type. * Cast to the correct output number type in `EmitSetAttribute`. * Fix a misplaced brace, a wrong exception message, and the param pointer type in `OutputAttrPointer` (currently always the same as what was hardcoded, but use the right field in case it isn't in the future). This fixes at least two shaders in CUSA16429 which were trying to output to R32Uint targets with float type, causing SPIR-V errors. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 21:14:30 +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#1927
No description provided.