MTLStencilDescriptor.cs 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. using System;
  2. using static Veldrid.MetalBindings.ObjectiveCRuntime;
  3. namespace Veldrid.MetalBindings
  4. {
  5. public struct MTLStencilDescriptor
  6. {
  7. public readonly IntPtr NativePtr;
  8. public MTLStencilOperation stencilFailureOperation
  9. {
  10. get => (MTLStencilOperation)uint_objc_msgSend(NativePtr, sel_stencilFailureOperation);
  11. set => objc_msgSend(NativePtr, sel_setStencilFailureOperation, (uint)value);
  12. }
  13. public MTLStencilOperation depthFailureOperation
  14. {
  15. get => (MTLStencilOperation)uint_objc_msgSend(NativePtr, sel_depthFailureOperation);
  16. set => objc_msgSend(NativePtr, sel_setDepthFailureOperation, (uint)value);
  17. }
  18. public MTLStencilOperation depthStencilPassOperation
  19. {
  20. get => (MTLStencilOperation)uint_objc_msgSend(NativePtr, sel_depthStencilPassOperation);
  21. set => objc_msgSend(NativePtr, sel_setDepthStencilPassOperation, (uint)value);
  22. }
  23. public MTLCompareFunction stencilCompareFunction
  24. {
  25. get => (MTLCompareFunction)uint_objc_msgSend(NativePtr, sel_stencilCompareFunction);
  26. set => objc_msgSend(NativePtr, sel_setStencilCompareFunction, (uint)value);
  27. }
  28. public uint readMask
  29. {
  30. get => uint_objc_msgSend(NativePtr, sel_readMask);
  31. set => objc_msgSend(NativePtr, sel_setReadMask, value);
  32. }
  33. public uint writeMask
  34. {
  35. get => uint_objc_msgSend(NativePtr, sel_writeMask);
  36. set => objc_msgSend(NativePtr, sel_setWriteMask, value);
  37. }
  38. private static readonly Selector sel_depthFailureOperation = "depthFailureOperation";
  39. private static readonly Selector sel_stencilFailureOperation = "stencilFailureOperation";
  40. private static readonly Selector sel_setStencilFailureOperation = "setStencilFailureOperation:";
  41. private static readonly Selector sel_setDepthFailureOperation = "setDepthFailureOperation:";
  42. private static readonly Selector sel_depthStencilPassOperation = "depthStencilPassOperation";
  43. private static readonly Selector sel_setDepthStencilPassOperation = "setDepthStencilPassOperation:";
  44. private static readonly Selector sel_stencilCompareFunction = "stencilCompareFunction";
  45. private static readonly Selector sel_setStencilCompareFunction = "setStencilCompareFunction:";
  46. private static readonly Selector sel_readMask = "readMask";
  47. private static readonly Selector sel_setReadMask = "setReadMask:";
  48. private static readonly Selector sel_writeMask = "writeMask";
  49. private static readonly Selector sel_setWriteMask = "setWriteMask:";
  50. }
  51. }