Bug 28320 - [Metal] - MTLRegion.Create throwing an exception
Summary: [Metal] - MTLRegion.Create throwing an exception
Alias: None
Product: iOS
Classification: Xamarin
Component: General ()
Version: XI 8.8.0
Hardware: PC Mac OS
: Normal normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2015-03-23 04:49 UTC by Anton
Modified: 2015-03-23 10:29 UTC (History)
3 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Anton 2015-03-23 04:49:13 UTC
MTLRegion.Create2D (actually, all overloads) throwing EntryPointNotFoundException

Xamarin Studio 5.8 (build 442) Mono 3.12.1
iPhone 6+ with iOS 8.2
Comment 1 Sebastien Pouliot 2015-03-23 10:25:50 UTC
There's no overload for Create2D, but I think you mean that Create1D and 3D do not work either.
Comment 2 Rolf Bjarne Kvinge [MSFT] 2015-03-23 10:29:40 UTC

This is implemented as inline methods in the iOS headers, and thus does not have a native method to P/Invoke.

Until the fix comes out you can easily work around it by using this code:

	public static MTLRegion Create2D (nint x, nint y, nint width, nint height)
		var region = new MTLRegion ();
		region.Origin.X = x;
		region.Origin.Y = y;
		region.Origin.Z = 0;
		region.Size.Width = width;
		region.Size.Height = height;
		region.Size.Depth = 1;
		return region;

maccore/master: 815b20650344df750927f5f2b0fbbde0f088fcbe