heyx3 / Bplus.jl

A modern OpenGL 4.6 rendering framework, written in Julia.
Other
69 stars 3 forks source link

A way to change padding at the end of a `@std140` or `@std430` struct to align for a dynamic array #99

Open heyx3 opened 10 months ago

heyx3 commented 10 months ago

SSBO's can end with a dynamically-sized array of elements. The generated struct has to be padded to accommodate this, but without actually containing the dynamic array.

There are all sorts of ways we could introduce this syntactically. For example:

I currently prefer the former option because it's more obvious that it's not just another field.

heyx3 commented 1 month ago

After the rewriting of these block layout structs, there is now only one obvious way we should do this: make a sibling type of StaticBlockArray{N, T}, named DynamicBlockArray{T}.