MVKConfiguration.cs 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. using System;
  2. using System.Runtime.InteropServices;
  3. namespace Ryujinx.Graphics.Vulkan.MoltenVK
  4. {
  5. enum MVKConfigLogLevel : int
  6. {
  7. None = 0,
  8. Error = 1,
  9. Warning = 2,
  10. Info = 3,
  11. Debug = 4
  12. }
  13. enum MVKConfigTraceVulkanCalls : int
  14. {
  15. None = 0,
  16. Enter = 1,
  17. EnterExit = 2,
  18. Duration = 3
  19. }
  20. enum MVKConfigAutoGPUCaptureScope : int
  21. {
  22. None = 0,
  23. Device = 1,
  24. Frame = 2
  25. }
  26. [Flags]
  27. enum MVKConfigAdvertiseExtensions : int
  28. {
  29. All = 0x00000001,
  30. MoltenVK = 0x00000002,
  31. WSI = 0x00000004,
  32. Portability = 0x00000008
  33. }
  34. enum MVKVkSemaphoreSupportStyle : int
  35. {
  36. MVK_CONFIG_VK_SEMAPHORE_SUPPORT_STYLE_SINGLE_QUEUE = 0,
  37. MVK_CONFIG_VK_SEMAPHORE_SUPPORT_STYLE_METAL_EVENTS_WHERE_SAFE = 1,
  38. MVK_CONFIG_VK_SEMAPHORE_SUPPORT_STYLE_METAL_EVENTS = 2,
  39. MVK_CONFIG_VK_SEMAPHORE_SUPPORT_STYLE_CALLBACK = 3,
  40. MVK_CONFIG_VK_SEMAPHORE_SUPPORT_STYLE_MAX_ENUM = 0x7FFFFFFF
  41. }
  42. readonly struct Bool32
  43. {
  44. uint Value { get; }
  45. public Bool32(uint value)
  46. {
  47. Value = value;
  48. }
  49. public Bool32(bool value)
  50. {
  51. Value = value ? 1u : 0u;
  52. }
  53. public static implicit operator bool(Bool32 val) => val.Value == 1;
  54. public static implicit operator Bool32(bool val) => new Bool32(val);
  55. }
  56. [StructLayout(LayoutKind.Sequential)]
  57. struct MVKConfiguration
  58. {
  59. public Bool32 DebugMode;
  60. public Bool32 ShaderConversionFlipVertexY;
  61. public Bool32 SynchronousQueueSubmits;
  62. public Bool32 PrefillMetalCommandBuffers;
  63. public uint MaxActiveMetalCommandBuffersPerQueue;
  64. public Bool32 SupportLargeQueryPools;
  65. public Bool32 PresentWithCommandBuffer;
  66. public Bool32 SwapchainMagFilterUseNearest;
  67. public ulong MetalCompileTimeout;
  68. public Bool32 PerformanceTracking;
  69. public uint PerformanceLoggingFrameCount;
  70. public Bool32 DisplayWatermark;
  71. public Bool32 SpecializedQueueFamilies;
  72. public Bool32 SwitchSystemGPU;
  73. public Bool32 FullImageViewSwizzle;
  74. public uint DefaultGPUCaptureScopeQueueFamilyIndex;
  75. public uint DefaultGPUCaptureScopeQueueIndex;
  76. public Bool32 FastMathEnabled;
  77. public MVKConfigLogLevel LogLevel;
  78. public MVKConfigTraceVulkanCalls TraceVulkanCalls;
  79. public Bool32 ForceLowPowerGPU;
  80. public Bool32 SemaphoreUseMTLFence;
  81. public MVKVkSemaphoreSupportStyle SemaphoreSupportStyle;
  82. public MVKConfigAutoGPUCaptureScope AutoGPUCaptureScope;
  83. public IntPtr AutoGPUCaptureOutputFilepath;
  84. public Bool32 Texture1DAs2D;
  85. public Bool32 PreallocateDescriptors;
  86. public Bool32 UseCommandPooling;
  87. public Bool32 UseMTLHeap;
  88. public Bool32 LogActivityPerformanceInline;
  89. public uint ApiVersionToAdvertise;
  90. public MVKConfigAdvertiseExtensions AdvertiseExtensions;
  91. public Bool32 ResumeLostDevice;
  92. public Bool32 UseMetalArgumentBuffers;
  93. }
  94. }