Closed CLOWREAD closed 3 years ago
[StructLayout(LayoutKind.Explicit)]
public partial struct VkAccelerationStructureSRTMotionInstanceNV
{
[FieldOffset(0)]
public VkSRTDataNV transformT0;
[FieldOffset(64)]
public VkSRTDataNV transformT1;
[FieldOffset(128)]
public uint instanceCustomIndex;
[FieldOffset(131)]
public uint mask;
[FieldOffset(132)]
public uint instanceShaderBindingTableRecordOffset;
[FieldOffset(135)]
public VkGeometryInstanceFlagsKHR flags;
[FieldOffset(136)]
public ulong accelerationStructureReference;
}
[StructLayout(LayoutKind.Explicit)]
public partial struct VkAccelerationStructureMatrixMotionInstanceNV
{
[FieldOffset(0)]
public VkTransformMatrixKHR transformT0;
[FieldOffset(48)]
public VkTransformMatrixKHR transformT1;
[FieldOffset(96)]
public uint instanceCustomIndex;
[FieldOffset(99)]
public uint mask;
[FieldOffset(100)]
public uint instanceShaderBindingTableRecordOffset;
[FieldOffset(103)]
public VkGeometryInstanceFlagsKHR flags;
[FieldOffset(104)]
public ulong accelerationStructureReference;
}
Thanks for bringing this issue, commit https://github.com/amerkoleci/Vortice.Vulkan/commit/69b5d41ffcde791f4a1cbd8304ed95a23f706bc7 fixes this and version 1.4.2 will contain the fix.
auto size_cpp = sizeof(VkAccelerationStructureMatrixMotionInstanceNV); size_cpp == 112
var vortice_s = sizeof(Vortice.Vulkan.VkAccelerationStructureMatrixMotionInstanceNV); vortice_s == 120
The struct might be handled manually
The struct "VkAccelerationStructureSRTMotionInstanceNV" has similar problem;