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 authored Jan 24, 2023
1 parent 1fc0167 commit 8f6eb02
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 8f6eb02

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ API diff for current PR / commit

Legacy Xamarin (No breaking changes)
.NET (No breaking changes)

✅ API diff vs stable

Legacy Xamarin (No breaking changes)
.NET (No breaking changes)
Legacy Xamarin (stable) vs .NET

✅ Generator diff

Generator diff is empty

Pipeline on Agent
Hash: 8f6eb025423bcdaf77b04be60885e92269e07148 [CI build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💻 [CI Build] Tests on macOS M1 - Mac Big Sur (11.5) passed 💻

All tests on macOS M1 - Mac Big Sur (11.5) passed.

Pipeline on Agent
Hash: 8f6eb025423bcdaf77b04be60885e92269e07148 [CI build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📚 [CI Build] Artifacts 📚

Packages generated

View packages

Pipeline on Agent XAMMINI-051.Monterey'
Hash: 8f6eb025423bcdaf77b04be60885e92269e07148 [CI build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀 [CI Build] Test results 🚀

Test results

✅ All tests passed on VSTS: simulator tests.

🎉 All 225 tests passed 🎉

Tests counts

✅ bcl: All 69 tests passed. Html Report (VSDrops) Download
✅ cecil: All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests: All 1 tests passed. Html Report (VSDrops) Download
✅ fsharp: All 7 tests passed. Html Report (VSDrops) Download
✅ framework: All 8 tests passed. Html Report (VSDrops) Download
✅ generator: All 2 tests passed. Html Report (VSDrops) Download
✅ interdependent_binding_projects: All 7 tests passed. Html Report (VSDrops) Download
✅ install_source: All 1 tests passed. Html Report (VSDrops) Download
✅ introspection: All 8 tests passed. Html Report (VSDrops) Download
✅ linker: All 65 tests passed. Html Report (VSDrops) Download
✅ mac_binding_project: All 1 tests passed. Html Report (VSDrops) Download
✅ mmp: All 2 tests passed. Html Report (VSDrops) Download
✅ mononative: All 12 tests passed. Html Report (VSDrops) Download
✅ monotouch: All 25 tests passed. Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. Html Report (VSDrops) Download
✅ mtouch: All 1 tests passed. Html Report (VSDrops) Download
✅ xammac: All 3 tests passed. Html Report (VSDrops) Download
✅ xcframework: All 8 tests passed. Html Report (VSDrops) Download
✅ xtro: All 2 tests passed. Html Report (VSDrops) Download

Pipeline on Agent
Hash: 8f6eb025423bcdaf77b04be60885e92269e07148 [CI build]

Please sign in to comment.