Closed helmutbressler closed 6 years ago
Thats correct as the are basically union, even in C/C++:
typedef struct D3D11_BUFFER_SRV {
union {
UINT FirstElement;
UINT ElementOffset;
};
union {
UINT NumElements;
UINT ElementWidth;
};
} D3D11_BUFFER_SRV;
[StructLayout(LayoutKind.Explicit)]
public struct BufferResource
{
[FieldOffset(0)]
public int FirstElement;
[FieldOffset(0)]
public int ElementOffset;
[FieldOffset(4)]
public int ElementCount;
[FieldOffset(4)]
public int ElementWidth;
}
That makes totally sense to me now. I should have checked the d3d11 documentation before posting. Apologies for bothering you with that (, but at least I know now that I did the SRV setup in my code incorrect). Thank you very much!
No problem :) Glad to help out.
Setting one member changes also the other. At least in the NuGet packet version 4.1
Sorry, I'm quite new to SharpDX, I couldn't manage to build it from source on my own. Ohterwise I would have checked where this behaviour is coming from.