[PR #3106] [MERGED] Fix shared memory definition when only one type is used #3227

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

📋 Pull Request Information

Original PR: https://github.com/shadps4-emu/shadPS4/pull/3106
Author: @mikusp
Created: 6/16/2025
Status: Merged
Merged: 6/17/2025
Merged by: @squidbus

Base: mainHead: fix_shared_mem_definition


📝 Commits (1)

  • 824b9eb Fix shared memory definition when only one type is used

📊 Changes

2 files changed (+36 additions, -17 deletions)

View changed files

📝 src/shader_recompiler/backend/spirv/emit_spirv_shared_memory.cpp (+24 -12)
📝 src/shader_recompiler/backend/spirv/spirv_emit_context.cpp (+12 -5)

📄 Description

Fixes the validation error

[Render.Vulkan] <Error> vk_platform.cpp:56 DebugUtilsCallback: VUID-StandaloneSpirv-None-10684: vkCreateShaderModule(): pCreateInfo->pCode (spirv-val produced an error):
Invalid explicit layout decorations on type for operand '55[%55]'
  %shared_mem_u64 = OpVariable %_ptr_Workgroup__struct_54 Workgroup
The Vulkan spec states: All variables must have valid explicit layout decorations as described in Shader Interfaces (https://docs.vulkan.org/spec/latest/appendices/spirvenv.html#VUID-StandaloneSpirv-None-10684)

by removing the struct indirection in shared memory definition if only one shared memory type is used. If explicit memory layout is not declared in the shader, Workgroup cannot be used on structs


🔄 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/3106 **Author:** [@mikusp](https://github.com/mikusp) **Created:** 6/16/2025 **Status:** ✅ Merged **Merged:** 6/17/2025 **Merged by:** [@squidbus](https://github.com/squidbus) **Base:** `main` ← **Head:** `fix_shared_mem_definition` --- ### 📝 Commits (1) - [`824b9eb`](https://github.com/shadps4-emu/shadPS4/commit/824b9eb608dde0a86c2246e126a07e5b0e6d56ff) Fix shared memory definition when only one type is used ### 📊 Changes **2 files changed** (+36 additions, -17 deletions) <details> <summary>View changed files</summary> 📝 `src/shader_recompiler/backend/spirv/emit_spirv_shared_memory.cpp` (+24 -12) 📝 `src/shader_recompiler/backend/spirv/spirv_emit_context.cpp` (+12 -5) </details> ### 📄 Description Fixes the validation error ``` [Render.Vulkan] <Error> vk_platform.cpp:56 DebugUtilsCallback: VUID-StandaloneSpirv-None-10684: vkCreateShaderModule(): pCreateInfo->pCode (spirv-val produced an error): Invalid explicit layout decorations on type for operand '55[%55]' %shared_mem_u64 = OpVariable %_ptr_Workgroup__struct_54 Workgroup The Vulkan spec states: All variables must have valid explicit layout decorations as described in Shader Interfaces (https://docs.vulkan.org/spec/latest/appendices/spirvenv.html#VUID-StandaloneSpirv-None-10684) ``` by removing the struct indirection in shared memory definition if only one shared memory type is used. If explicit memory layout is not declared in the shader, Workgroup cannot be used on structs --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 22:02:55 +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#3227
No description provided.