nvpro-samples / gl_vk_meshlet_cadscene

This OpenGL/Vulkan sample illustrates the use of "mesh shaders" for rendering CAD models.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Multiple variables bound to same descriptor

seanbaxter opened this issue · comments

The packbasic path binds uint[] and uvec2[] arrays to GEOMETRY_SSBO_PRIM, and uses them both. I didn't know this kind of aliasing was legal. What is the reason? The vertex and primitive loops are the heart of the mesh shader but are undocumented, and I can't piece together why these loops, that are seemingly doing different things, are loading from the same aliased data.

the aliasing was done to allow 64-bit and 32-bit loads from the same buffer.

I didn't know this was allowed. Do you think this is an option for effecting a reinterpret_cast on an SSBO? Seems exploitable in a good way.

yes that is how it was used.