DisposableSampler.cs 442 B

12345678910111213141516171819202122
  1. using SharpMetal.Metal;
  2. using System;
  3. using System.Runtime.Versioning;
  4. namespace Ryujinx.Graphics.Metal
  5. {
  6. [SupportedOSPlatform("macos")]
  7. readonly struct DisposableSampler : IDisposable
  8. {
  9. public MTLSamplerState Value { get; }
  10. public DisposableSampler(MTLSamplerState sampler)
  11. {
  12. Value = sampler;
  13. }
  14. public void Dispose()
  15. {
  16. Value.Dispose();
  17. }
  18. }
  19. }