You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So the only ways I can see of determing the size of a SpvReflectInterfaceVariable seems to be either:
Combining the numeric, array and members members manually which sounds pretty hard to get right and definitely cumbersome.
Using the format member and mapping it to a size manually, although I assume that'd disregard the possibility of the variable being an array or possessing members of its own.
This makes it very hard to determine the offset of vertex properties.
I could totally be missing something though, in which case I'm sorry!
The text was updated successfully, but these errors were encountered:
No you're not missing any information. Figuring out the size of interface variables is a bit cumbersome. In most cases, SPIRV-Reflect can only understand simple case for this, i.e. variables are aways 4 components and 32-bits. There's some historical reason for this but I'm not able to recall precisely what it was.
Do you have an example of the shader code that I can use to examine the behavior?
Hmm, in that case I assume it might be a good idea to provide some sort of utility function utilizing one of the methods I described above?
I'm sorry but I don't exactly understand what you mean by an example shader? I can't seem to find any way to get the total size of a SpvReflectInterfaceVariable in any way directly, be it as simple as can be.
If you just need any concrete example, here's a shader and the code we use to read the size of the vertex input variables.
If you could be a bit more concrete I'd happily provide some more concrete examples or isolate the issue further.
So the only ways I can see of determing the size of a SpvReflectInterfaceVariable seems to be either:
numeric
,array
andmembers
members manually which sounds pretty hard to get right and definitely cumbersome.format
member and mapping it to a size manually, although I assume that'd disregard the possibility of the variable being an array or possessing members of its own.This makes it very hard to determine the offset of vertex properties.
I could totally be missing something though, in which case I'm sorry!
The text was updated successfully, but these errors were encountered: