[spirv] improved spir-v shader opt #239

Merged
Shinmegumi merged 2 commits from spirv-opt into master 2025-08-15 21:40:41 +02:00
Owner

increases speed ~tenfold for Spir-V output optimization

Co-authored-by: wildcard nubieluv@gmail.com
Signed-off-by: crueter crueter@eden-emu.dev

increases speed ~tenfold for Spir-V output optimization Co-authored-by: wildcard <nubieluv@gmail.com> Signed-off-by: crueter <crueter@eden-emu.dev>
Lizzie reviewed 2025-08-13 10:08:11 +02:00
@ -487,3 +505,4 @@
std::vector<u32> EmitSPIRV(const Profile& profile, const RuntimeInfo& runtime_info,
IR::Program& program, Bindings& bindings, bool optimize) {
EmitContext ctx{profile, runtime_info, program, bindings};
// Reserve capacity for interfaces to reduce allocations
Member

Do not reserve such a low amount of memory, reserve a whole page ATLEAST (4096 / sizeof(T))

https://www.youtube.com/watch?v=algDLvbl1YY

Do not reserve such a low amount of memory, reserve a whole page ATLEAST (4096 / sizeof(T)) https://www.youtube.com/watch?v=algDLvbl1YY
Member

Yes right I forgot to add the comment //guess, increase or decrease accordingly😆

Yes right I forgot to add the comment //guess, increase or decrease accordingly😆
Shinmegumi added this to the 0.0.3 Release Candidate PRs project 2025-08-13 15:43:12 +02:00
Shinmegumi force-pushed spirv-opt from d3e3467b86 to 458c09e553 2025-08-13 16:08:31 +02:00 Compare
Shinmegumi force-pushed spirv-opt from 458c09e553 to eabcaa2f3e 2025-08-15 20:15:21 +02:00 Compare
Owner

@wildcard, do you want to make the change noted by Lizzie or merge this as is?

@wildcard, do you want to make the change noted by Lizzie or merge this as is?
Member

just remove the reserve completely for now same as the original

just remove the reserve completely for now same as the original
Owner

@wildcard wrote in #239 (comment):

just remove the reserve completely for now same as the original

Do you want to make the change so I can merge?

@wildcard wrote in https://git.eden-emu.dev/eden-emu/eden/pulls/239#issuecomment-1916: > just remove the reserve completely for now same as the original Do you want to make the change so I can merge?
wildcard added 1 commit 2025-08-15 21:26:53 +02:00
Update src/shader_recompiler/backend/spirv/emit_spirv.cpp
All checks were successful
eden-license / license-header (pull_request) Successful in 20s
97c0339619
Member

done, removed the reserve

done, removed the reserve
Shinmegumi approved these changes 2025-08-15 21:39:54 +02:00
Shinmegumi left a comment
Owner

Approved for merge.

Approved for merge.
Shinmegumi merged commit 09a8fab2a2 into master 2025-08-15 21:40:41 +02:00
Shinmegumi deleted branch spirv-opt 2025-08-15 21:40:42 +02:00
Sign in to join this conversation.
No description provided.