cbaggers / varjo

Lisp to GLSL Language Translator
BSD 2-Clause "Simplified" License
223 stars 23 forks source link

SSBOs: are they structs or arrays? #232

Closed stacksmith closed 5 years ago

stacksmith commented 5 years ago

So, uniforms annotated as :SSBO have to be structs. However, there is no obvious way to make an SSBO that's a struct - the functions to make SSBOs look like they really want arrays. I couldn't figure out how to make a struct. Could you show an example?

When I defstruct-g and make an instance, it is not an SSBO. If I make-ssbo on it, it says "can only populate a struct of type BLAH with a list or an array". However, if I try to send it the same list I initialized the struct with (with no problems), it complains that it's a list, not an array. If I make an array (in my case, an array of :vec4) and try to make-ssbo with it, it only takes the first vec4. Bah.

For instance, I have an array of say 100 vertices. How can I make them visible to the shaders? In fact, I broke my brain and scanned through all the videos on youtube, and could not find a single example where an array is being passed as a uniform.... What gives?

stacksmith commented 5 years ago

OK, I see what's happening here. I found the 'raining features' page....