mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2026-04-25 15:56:00 +03:00
[PR #3238] [MERGED] shader_recompiler: Replace buffer pulling with attribute divisor for instance step rates #3327
Labels
No labels
Bloodborne
bug
contributor wanted
documentation
enhancement
frontend
good first issue
help wanted
linux
pull-request
question
release
verification progress
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/shadPS4#3327
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/shadps4-emu/shadPS4/pull/3238
Author: @raphaelthegreat
Created: 7/13/2025
Status: ✅ Merged
Merged: 7/13/2025
Merged by: @georgemoralis
Base:
main← Head:step-rate-clean📝 Commits (9)
c0878dbshader_recompiler: Replace buffer pulling with attribute divisor for instance step rates7994ee8flatten_extended_userdata: Remove special step rate buffer handling3d9d274Review comments94da278spirv_emit_context: Name all instance rate attribs properlyec462bbspirv: Merge ReadConstBuffer againde90601attribute: Add missing attributesfc3454ctranslate: Reimplement step rate instance idb16b9a1Resolve validation warningsdde954ashader_recompiler: Separate vertex inputs from LS stage, cleanup tess📊 Changes
22 files changed (+208 additions, -274 deletions)
View changed files
📝
src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp(+48 -80)📝
src/shader_recompiler/backend/spirv/emit_spirv_instructions.h(+1 -1)📝
src/shader_recompiler/backend/spirv/spirv_emit_context.cpp(+24 -50)📝
src/shader_recompiler/backend/spirv/spirv_emit_context.h(+0 -1)📝
src/shader_recompiler/frontend/fetch_shader.h(+0 -12)📝
src/shader_recompiler/frontend/translate/translate.cpp(+37 -26)📝
src/shader_recompiler/info.h(+5 -9)📝
src/shader_recompiler/ir/attribute.cpp(+18 -4)📝
src/shader_recompiler/ir/attribute.h(+0 -2)📝
src/shader_recompiler/ir/ir_emitter.cpp(+2 -2)📝
src/shader_recompiler/ir/ir_emitter.h(+1 -2)📝
src/shader_recompiler/ir/passes/flatten_extended_userdata_pass.cpp(+1 -23)📝
src/shader_recompiler/ir/passes/ring_access_elimination.cpp(+4 -7)📝
src/shader_recompiler/ir/passes/srt.h(+1 -12)📝
src/shader_recompiler/runtime_info.h(+4 -2)📝
src/shader_recompiler/specialization.h(+13 -7)📝
src/video_core/buffer_cache/buffer_cache.cpp(+4 -1)📝
src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp(+31 -15)📝
src/video_core/renderer_vulkan/vk_graphics_pipeline.h(+3 -1)📝
src/video_core/renderer_vulkan/vk_instance.cpp(+4 -0)...and 2 more files
📄 Description
This is first part of trying to cleanup the attribute code in recompiler before I can implement what I want, as it has suffered from a bit of scope creep.
In this PR the code for manually pulling buffers for emulating instance step rates is removed in favor of using VK_EXT_vertex_attribute_divisor. That extension is quite old and ubiquitously supported on all platforms so the benefit of code simplification is worth it. Also added divisor into specialization for checking both input rate and step rate, on main the former wasn't checked (is it even possible for an attribute to go from vertex to instance rate with same shader?) and removed code in backend for handling InstanceId0-1 as it seemed wrong; if those vgprs are used for as index for buffer loads shouldn't they be InstanceId / step_rate_0-1 instead of just step rate? Can be checked now when their assertion hits
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.