Skip to content

Remove Redundant buffer memory barriers + Improvements #407

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Pikachuxxxx opened this issue Apr 8, 2025 · 0 comments · May be fixed by #396
Open

Remove Redundant buffer memory barriers + Improvements #407

Pikachuxxxx opened this issue Apr 8, 2025 · 0 comments · May be fixed by #396
Labels
C++ C++ Implementation related FrameGraph Issues related to frame graph

Comments

@Pikachuxxxx
Copy link
Owner

Pikachuxxxx commented Apr 8, 2025

This is needs proper initResourceViewHints to RZBufferDesc to be set on all buffers to work properly, then we can refine the logic tracking in RZFrameGraphBuffer struct.

Prolem:
Current buffer barriers is more prone to inserting redundant memory barriers, for ex. think of a CBV it can either have a CPU->GPU barrier or a ShaderReadOnly barrier, since the viewHints has these 2 bit sets set, it's hard to deduce for a given preRead function what kind of barrier to use on the CBV, we will add unnecessary memory barriers. Need a better solution to this.

Solving CBV barrier issues:

  • In preRead/preWrite the default for a CBV is always it's ShaderReadOnly (added new buffer barrier type)
  • If the buffer is dirty (tracked internally if we mapped it) we change the BufferBarrierType to CPUToGPU
  • in preWrite if it's a CBV we insert a ShaderReadOnlyBarrier --> if it was last dirty (need to track this again)
@Pikachuxxxx Pikachuxxxx added Architecture Issues related to API/ Engine design and architecture. C++ C++ Implementation related FrameGraph Issues related to frame graph and removed Architecture Issues related to API/ Engine design and architecture. labels Apr 8, 2025
@Pikachuxxxx Pikachuxxxx changed the title Remove Redundant buffer memory barriers Remove Redundant buffer memory barriers + Improvements Apr 11, 2025
Pikachuxxxx added a commit that referenced this issue Apr 11, 2025
…buffer barier type

- All tests pass! + pref is same
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C++ C++ Implementation related FrameGraph Issues related to frame graph
Projects
None yet
1 participant