Skip to content

perf(libSceAgcDriver): order in-place vertex inputs behind pending GPU writes with a barrier - #5338

Closed
ErenYeager1836 wants to merge 1 commit into
boykopovar:mainfrom
ErenYeager1836:carry/agc-inplace-vertex-barrier
Closed

ErenYeager1836 wants to merge 1 commit into
boykopovar:mainfrom
ErenYeager1836:carry/agc-inplace-vertex-barrier

Conversation

@ErenYeager1836

Copy link
Copy Markdown
Contributor

What

An in-place draw input previously flushed pending GPU writes over its range on the CPU before binding, causing a CPU submit-and-wait stall of the open batch whenever a compute dispatch wrote the buffer. Since the CPU never reads a vertex buffer's bytes directly, vertex inputs under pending writes can instead be bound in place behind an execution barrier from shader/transfer writes to vertex attribute reads recorded before the draw's rendering begins.

  • Orders vertex input buffers behind GPU execution barriers instead of CPU pipeline flushes.
  • Retains CPU flushes for index inputs where indices must be read by CPU code.
  • Adds test cases in core/libs/prx/libSceAgcDriver/tests/Recorder.cpp.

Carried from @Mouad-Scriptz-0 with author attribution preserved.

Tested

agc_recorder_tests in AgcDriver tests suite. Passes conventions check.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Unblocks: none
  • AI-assisted: yes

…U writes with a barrier

An in-place draw input flushed pending GPU writes over its range on the
CPU before the bind, a submit-and-wait of the open batch when a dispatch
in it wrote the buffer. The CPU never reads a vertex buffer's bytes, so a
vertex input under a pending write is bound in place behind a barrier from
shader and transfer writes to vertex attribute reads, recorded before the
draw's rendering begins; index inputs keep the flush, since the highest
index is read on the CPU. Minecraft generates a vertex buffer with a
compute dispatch every frame and drew from it one CPU wait later.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@ErenYeager1836

Copy link
Copy Markdown
Contributor Author

Closing in favor of earlier open PR #4649 by @Mouad-Scriptz-0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants