perf(shader): share immutable binding access metadata #1318
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1318"
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?
Imported from boykopovar/AnyPS5. Originally posted by TibixDev on 2026-10-07T23:29:29Z.
Status after review
Blocked on binding-plan benefit and metadata redesign.
Audited today's types:
CompiledShaderArtifactalready holds compiled/static shader data, whileShaderInvocationholds specialization, live descriptor bindings, push constants and vertex attributes. The remaining candidate is immutable descriptor-access vectors; live values still have to be materialized per invocation. This is narrower than treating the old complete binding object as shareable.The serialized cache is now
FormatVersion = 27; replaying this branch's old version edit would be incorrect. A replacement needs a new version chosen against its landing base and round-trip/invalidation checks. #1315 still has no demonstrated title benefit, and this stacked head has no isolated modern comparison. No code push or claim that the prior 448 → 160-byte layout result establishes runtime benefit on the new structures.What
Prepare descriptor access metadata once per compiled shader variant. Share it across draw results. Materialize current descriptors, sampler coordinates, and push data on each use. Save the prepared metadata in versioned shader-cache entries.
Tested
Earlier branch-specific tests and measurements remain in the discussion. They have not been rerun on a redesigned current-main version of this PR. The review audit and shared NGS-assisted title exploration do not establish that this head is merge-ready. No full Linux/Windows platform CI was dispatched in this pass.
Checklist
Imported from boykopovar/AnyPS5. Originally posted by TibixDev on 2026-10-08T07:35:48Z.
Rebased on
da402739. Preserved current upstream and the #1315 prerequisite. Fixed the Linux CI failure: sampler validation now runs before SPIR-V emission, while immutable binding metadata remains shared. Reproduced the failure with SPIRV-Tools enabled; shader-memory, disk-cache and binding-materialization tests now pass three repetitions in that configuration. All tests below use SPIRV-Tools enabled.Fedora 44 Release:
agc_binding_materialization_tests,agc_shader_disk_cache_tests,agc_shader_memory_tests,agc_driver_tests,agc_driver_graphics_tests,agc_driver_recorder_testsbuild; the targeted tests and contribution checks pass. Windows CI is pending.RADV and lavapipe:
--binding-plan-onlypass with core and synchronization validation; no validation errors.Shader-memory, disk-cache and binding-materialization also pass with SPIRV-Tools disabled.
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T11:39:21Z.
Review: CHANGES_REQUESTED
Thanks for the work here. Not mergeable as it stands:
mainand has an open question from @oneandonlydean (no measurable gain in the fixture or in a profiled run, 19 ms vs 21-22 ms per 6,000 builds). This PR needs that answered first.mainit conflicts in 13 files (ShaderResources.{hpp,cpp},DescriptorBindingBuilder.{hpp,cpp},Recompiler.{hpp,cpp},ShaderDiskCache.{hpp,cpp},libSceAgcDriver/CMakeLists.txtand the Graphics/Recorder/ShaderDiskCache/ShaderMemory tests). #639 rewrotebuildPrepare/buildCompletewith compact bindings and runtime image metadata, so this is a redesign on the new structures rather than a mechanical rebase. The description says the change doesn't replace #639's ABI work; please show what is still left to share after it.FormatVersionbump, which also collides with other open PRs touching it.Once #1315 is settled and this is rebased with numbers, happy to look again.
Imported from boykopovar/AnyPS5. Originally posted by TibixDev on 2026-10-12T04:52:02Z.
Review-pass update:
Audited today's types:
CompiledShaderArtifactalready holds compiled/static shader data, whileShaderInvocationholds specialization, live descriptor bindings, push constants and vertex attributes. The remaining candidate is immutable descriptor-access vectors; live values still have to be materialized per invocation. This is narrower than treating the old complete binding object as shareable.The serialized cache is now
FormatVersion = 27; replaying this branch's old version edit would be incorrect. A replacement needs a new version chosen against its landing base and round-trip/invalidation checks. #1315 still has no demonstrated title benefit, and this stacked head has no isolated modern comparison. No code push or claim that the prior 448 → 160-byte layout result establishes runtime benefit on the new structures.I have updated the PR description to match this status. The PR remains open; the outstanding review requirements are not being marked resolved. AI-assisted audit.
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-14T05:09:13Z.
Closing for now: the author marked it blocked pending a redesign after #639. With the queue this large we're closing stalled perf PRs that don't show a gain in a title; reopen it with before/after numbers from a title scene (the summary lines from the performance report form) if you pick it up again.
Pull request closed