-
Notifications
You must be signed in to change notification settings - Fork 373
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
[re_renderer] Uniform buffer utility using CpuWriteGpuReadBelt
#1400
[re_renderer] Uniform buffer utility using CpuWriteGpuReadBelt
#1400
Conversation
/// But this leads to more unsafe code, harder to avoid holes in write combined memory access | ||
/// and potentially undefined values in the padding bytes on GPU. | ||
const CHECK: () = assert!( | ||
std::mem::align_of::<T>() >= 256, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd expect an ==
here?
std::mem::align_of::<T>() >= 256, | |
std::mem::align_of::<T>() == 256, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Higher alignment is unlikely but absolutely allowed. If something is aligned to 512 we're okay with that as well (but I really hope nothing is!)
* utility function for uniform buffer from struct * Uniform buffers are now compile time forced to be 256 bytes aligned * CpuWriteGpuReadBelt no longer takes mutable buffer pool * Renderers and frame_global_command_encoder are now behind locks --------- Co-authored-by: Clement Rey <[email protected]>
Used for all uniform buffers except meshes - need some more plumbing there, will be done in a follow-up Pr!
This PR introduces a new utility for easy uniform buffer creation & filling. It enforces correct padding - see long comment for details :)
Removes quite a few landmines and makes code in
Renderer
s shorter!Solves a sizeable chunk of #1398, figured out some
RenderContext
share issues along the wayChecklist
CHANGELOG.md
(if this is a big enough change to warrant it)