CompilationResult.cs 757 B

12345678910111213141516171819202122232425
  1. using System;
  2. using System.Runtime.InteropServices;
  3. namespace Veldrid.SPIRV
  4. {
  5. [StructLayout(LayoutKind.Sequential)]
  6. internal unsafe struct CompilationResult
  7. {
  8. public Bool32 Succeeded;
  9. public InteropArray DataBuffers;
  10. public ReflectionInfo ReflectionInfo;
  11. public uint GetLength(uint index)
  12. {
  13. if (index >= DataBuffers.Count) { throw new ArgumentOutOfRangeException(nameof(index)); }
  14. return DataBuffers.Ref<InteropArray>(index).Count;
  15. }
  16. public void* GetData(uint index)
  17. {
  18. if (index >= DataBuffers.Count) { throw new ArgumentOutOfRangeException(nameof(index)); }
  19. return DataBuffers.Ref<InteropArray>(index).Data;
  20. }
  21. }
  22. }