So i have a ByteAdressBuffer in a #define and I would like to read a struct from it passed in the define parameters, therefore i can't manually read each variable and assign it.
Therefore my question is, is there any way to read the struct from the buffer or alternatively read the correct amount of bytes and cast it to a struct?
I think in newer hlsl versions they introduces Load<T> but i dont think that its availible in unity.
If i didn't explain it well i would like to do something like this
MyStruct struct = (MyStruct) buffer.Load(offset, sizeof(struct));
which is not valid hlsl