2017-09-15 04:42:40 +03:00
|
|
|
|
#if __IOS__
|
|
|
|
|
|
|
|
|
|
using System;
|
|
|
|
|
|
|
|
|
|
using Metal;
|
|
|
|
|
|
|
|
|
|
using NUnit.Framework;
|
|
|
|
|
|
|
|
|
|
namespace MonoTouchFixtures.Metal {
|
|
|
|
|
|
|
|
|
|
[TestFixture]
|
|
|
|
|
public class MTLTileRenderPipelineDescriptorTests {
|
|
|
|
|
MTLTileRenderPipelineDescriptor descriptor = null;
|
|
|
|
|
|
|
|
|
|
[SetUp]
|
|
|
|
|
public void SetUp ()
|
|
|
|
|
{
|
|
|
|
|
TestRuntime.AssertXcodeVersion (9, 0);
|
|
|
|
|
descriptor = new MTLTileRenderPipelineDescriptor ();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[TearDown]
|
|
|
|
|
public void TearDown ()
|
|
|
|
|
{
|
|
|
|
|
if (descriptor != null)
|
|
|
|
|
descriptor.Dispose ();
|
|
|
|
|
descriptor = null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void ColorAttachmentsTest ()
|
|
|
|
|
{
|
|
|
|
|
var attachments = descriptor.ColorAttachments;
|
|
|
|
|
Assert.NotNull (attachments);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void GetSetLabelTest ()
|
|
|
|
|
{
|
|
|
|
|
descriptor.Label = "Foo";
|
|
|
|
|
Assert.AreEqual ("Foo", descriptor.Label);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void GetSetRasterSampleCount ()
|
|
|
|
|
{
|
|
|
|
|
descriptor.RasterSampleCount = 2;
|
2020-07-17 09:48:09 +03:00
|
|
|
|
Assert.AreEqual ((nuint) 2, descriptor.RasterSampleCount);
|
2017-09-15 04:42:40 +03:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void GetSetThreadgroupSizeMatchesTileSize ()
|
|
|
|
|
{
|
|
|
|
|
descriptor.ThreadgroupSizeMatchesTileSize = true;
|
|
|
|
|
Assert.AreEqual (true, descriptor.ThreadgroupSizeMatchesTileSize);
|
|
|
|
|
|
|
|
|
|
descriptor.ThreadgroupSizeMatchesTileSize = false;
|
|
|
|
|
Assert.AreEqual (false, descriptor.ThreadgroupSizeMatchesTileSize);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void GetTileBuffers ()
|
|
|
|
|
{
|
|
|
|
|
var buffers = descriptor.TileBuffers;
|
|
|
|
|
Assert.NotNull (buffers);
|
|
|
|
|
}
|
2018-08-15 17:09:23 +03:00
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void GetSetMaxTotalThreadsPerThreadgroupTest ()
|
|
|
|
|
{
|
|
|
|
|
TestRuntime.AssertXcodeVersion (10, 0);
|
|
|
|
|
descriptor.MaxTotalThreadsPerThreadgroup = 10;
|
2020-07-17 09:48:09 +03:00
|
|
|
|
Assert.AreEqual ((nuint) 10, descriptor.MaxTotalThreadsPerThreadgroup);
|
2018-08-15 17:09:23 +03:00
|
|
|
|
}
|
2017-09-15 04:42:40 +03:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif // !__WATCHOS__
|