Skip to content

Commit

Permalink
[Metal] Adjust conditional compilation directives to make sure some M…
Browse files Browse the repository at this point in the history
…TLRenderCommandEncoder API is available on the correct platforms. (#17307)
  • Loading branch information
rolfbjarne committed Jan 24, 2023
1 parent 8514c71 commit 608765e
Showing 1 changed file with 34 additions and 30 deletions.
64 changes: 34 additions & 30 deletions src/Metal/MTLRenderCommandEncoder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,79 +15,83 @@ namespace Metal {
[SupportedOSPlatform ("tvos")]
#endif
public static class IMTLRenderCommandEncoder_Extensions {
#if MONOMAC
#if !WATCH
#if NET
[SupportedOSPlatform ("macos")]
[SupportedOSPlatform ("maccatalyst")]
[UnsupportedOSPlatform ("ios")]
[UnsupportedOSPlatform ("tvos")]
[SupportedOSPlatform ("ios12.0")]
[SupportedOSPlatform ("tvos14.5")]
#else
[Mac (10,13)]
[NoiOS]
[NoTV]
[Mac (10, 13)]
[iOS (12, 0)]
[TV (14, 5)]
[NoWatch]
#endif
public unsafe static void SetViewports (this IMTLRenderCommandEncoder This, MTLViewport [] viewports)
{
fixed (void* handle = viewports)
This.SetViewports ((IntPtr)handle, (nuint)(viewports?.Length ?? 0));
This.SetViewports ((IntPtr) handle, (nuint) (viewports?.Length ?? 0));
}
#endif // !WATCH

#if !WATCH
#if NET
[SupportedOSPlatform ("macos")]
[SupportedOSPlatform ("maccatalyst")]
[UnsupportedOSPlatform ("ios")]
[UnsupportedOSPlatform ("tvos")]
[SupportedOSPlatform ("ios12.0")]
[SupportedOSPlatform ("tvos14.5")]
#else
[Mac (10,13)]
[NoiOS]
[NoTV]
[Mac (10, 13)]
[iOS (12, 0)]
[TV (14, 5)]
[NoWatch]
#endif
public unsafe static void SetScissorRects (this IMTLRenderCommandEncoder This, MTLScissorRect [] scissorRects)
{
fixed (void* handle = scissorRects)
This.SetScissorRects ((IntPtr)handle, (nuint)(scissorRects?.Length ?? 0));
This.SetScissorRects ((IntPtr) handle, (nuint) (scissorRects?.Length ?? 0));
}
#endif
#endif // !WATCH

#if IOS
#if !WATCH
#if NET
[SupportedOSPlatform ("ios11.0")]
[SupportedOSPlatform ("maccatalyst")]
[UnsupportedOSPlatform ("tvos")]
[UnsupportedOSPlatform ("macos")]
[SupportedOSPlatform ("tvos14.5")]
[SupportedOSPlatform ("macos11.0")]
#else
[iOS (11,0)]
[NoTV]
[NoMac]
[iOS (11, 0)]
[TV (14, 5)]
[Mac (11, 0)]
[NoWatch]
#endif
public unsafe static void SetTileBuffers (this IMTLRenderCommandEncoder This, IMTLBuffer[] buffers, nuint[] offsets, NSRange range)
public unsafe static void SetTileBuffers (this IMTLRenderCommandEncoder This, IMTLBuffer [] buffers, nuint [] offsets, NSRange range)
{
fixed (void* handle = offsets)
This.SetTileBuffers (buffers, (IntPtr)handle, range);
This.SetTileBuffers (buffers, (IntPtr) handle, range);
}
#endif // !WATCH

#if !WATCH
#if NET
[SupportedOSPlatform ("ios11.0")]
[SupportedOSPlatform ("maccatalyst")]
[UnsupportedOSPlatform ("tvos")]
[UnsupportedOSPlatform ("macos")]
[SupportedOSPlatform ("tvos14.5")]
[SupportedOSPlatform ("macos11.0")]
#else
[iOS (11,0)]
[NoTV]
[NoMac]
[iOS (11, 0)]
[TV (14, 5)]
[Mac (11, 0)]
[NoWatch]
#endif
public unsafe static void SetTileSamplerStates (this IMTLRenderCommandEncoder This, IMTLSamplerState[] samplers, float[] lodMinClamps, float[] lodMaxClamps, NSRange range)
public unsafe static void SetTileSamplerStates (this IMTLRenderCommandEncoder This, IMTLSamplerState [] samplers, float [] lodMinClamps, float [] lodMaxClamps, NSRange range)
{
fixed (void* minHandle = lodMinClamps) {
fixed (void* maxHandle = lodMaxClamps) {
This.SetTileSamplerStates (samplers, (IntPtr)minHandle, (IntPtr)maxHandle, range);
This.SetTileSamplerStates (samplers, (IntPtr) minHandle, (IntPtr) maxHandle, range);
}
}
}
#endif
#endif // !WATCH
}
}

4 comments on commit 608765e

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

Please sign in to comment.