Repository navigation
gpuav: Move to typed device memory allocations - #13843
arno-lunarg wants to merge 1 commit into
Conversation
|
So it turned out big since BufferRange is used everywhere. Half of the diff is spirv Main new things are the updates to vko::BufferRange in Then the rest is actual usage of those, and new header file declarations with the corresponding shader and C++ changes |
| // Track all decorations and add after when have full id_swap_map | ||
| InstructionList decorations; | ||
|
|
||
| // Types with an explicit layout are never merged, the existing type can have another layout (std140) or none (Private). |
There was a problem hiding this comment.
So @spencer-lunarg if you have one thing to look at it is this: LLM decided to do those changes because of new struct usage in the shaders (cannot say which one precisely at this point...), I had SPIR-V validation issues and was like "???"
|
this is going to be REALLY hard to review, sure no way to break this up into a something smaller... going to be a while until I get to this review, mainly because this is not solving an issue and just a 6000 quality of life line change |
Improves how GPU-AV reads and writes to buffers in both C++ and shaders, by moving to shared typed declarations between C++ and shader code. When I originally made vko::BufferRange, I was scared of doing this shared types thing because of differences between how memory is read and written to on the host side and on the device side. Right now, we use a weird mix of "just in time" casting on the C++ side to C++ only types, or offsets in u32 arrays, and I have shot myself in the foot many times by forgetting to update the C++ definition or the shader definition of what is essentially the same struct. And chasing those subtle memory bugs can be hard, especially on the GPU side. So now, *all* (thus the size of the change) vko::BufferRange are typed. Types are typically declared in a header filer shared between C++ and GLSL/Slang using my... custom syntax. Macro based, not too bad for now I feel. It brings many benefits: more expressive code, easier to follow the host <-> device code path, easier to visualize data in the debugger because of types, possibly could bound check GPU arrays accesses on the C++ side because of the dedicated Array type, etc...
d504830 to
d4cfa36
Compare
Part of #13769
Improves how GPU-AV reads and writes to buffers in both C++ and shaders, by moving to shared typed declarations between C++ and shader code.
When I originally made vko::BufferRange, I was scared of doing this shared types thing because of differences between how memory is read and written to on the host side and on the device side. Right now, we use a weird mix of "just in time" casting on the C++ side to C++ only types, or offsets in u32 arrays, and I have shot myself in the foot many times by forgetting to update the C++ definition or the shader definition of what is essentially the same struct. And chasing those subtle memory bugs can be hard, especially on the GPU side.
So now, all (thus the size of the change) vko::BufferRange are typed. Types are typically declared in a header filer shared between C++ and GLSL/Slang using my... custom syntax. Macro based, not too bad for now I feel.
It brings many benefits: more expressive code, easier to follow the host <-> device code path, easier to visualize data in the debugger because of types, possibly could bound check GPU arrays accesses on the C++ side because of the dedicated Array type, etc...