public void SetUp()
        {
            TestRuntime.AssertXcodeVersion(12, 0);

            device = MTLDevice.SystemDefault;
            // some older hardware won't have a default
            if (device == null)
            {
                Assert.Inconclusive("Metal is not supported");
            }

            library = device.CreateDefaultLibrary();
            if (library == null)              // this happens on a simulator
            {
                Assert.Inconclusive("Could not get the functions library for the device.");
            }

            if (library.FunctionNames.Length == 0)
            {
                Assert.Inconclusive("Could not get functions for the pipeline.");
            }

            function      = library.CreateFunction(library.FunctionNames [0]);
            pipelineState = device.CreateComputePipelineState(function, MTLPipelineOption.ArgumentInfo, out MTLComputePipelineReflection reflection, out NSError error);

            if (error != null)
            {
                Assert.Inconclusive($"Could not create pipeline {error}");
            }
            descriptor    = MTLIntersectionFunctionTableDescriptor.Create();
            functionTable = pipelineState.CreateIntersectionFunctionTable(descriptor);
        }
        public void FunctionCountTest()
        {
            using var descriptor = MTLIntersectionFunctionTableDescriptor.Create();

            nuint newCount = 10;
            nuint objCount = 0;

            Assert.DoesNotThrow(() => {
                descriptor.FunctionCount = newCount;
            }, "Setter");
            Assert.DoesNotThrow(() => {
                objCount = descriptor.FunctionCount;
            }, "Getter");
            Assert.AreEqual(newCount, objCount, "Count");
        }