示例#1
0
        public Result CreateGraphicsPipelines(IMgPipelineCache pipelineCache, MgGraphicsPipelineCreateInfo[] pCreateInfos, IMgAllocationCallbacks allocator, out IMgPipeline[] pPipelines)
        {
            var output = new List <IMgPipeline> ();

            foreach (var info in pCreateInfos)
            {
                var bLayout = (IGLPipelineLayout)info.Layout;
                if (bLayout == null)
                {
                    throw new ArgumentException("pCreateInfos[].Layout");
                }

                if (info.VertexInputState == null)
                {
                    throw new ArgumentNullException("pCreateInfos[].VertexInputState");
                }

                if (info.InputAssemblyState == null)
                {
                    throw new ArgumentNullException("pCreateInfos[].InputAssemblyState");
                }

                if (info.RasterizationState == null)
                {
                    throw new ArgumentNullException("pCreateInfos[].RasterizationState");
                }

                var programId = mEntrypoint.GraphicsCompiler.Compile(info);

                var blocks        = mEntrypoint.GraphicsCompiler.Inspect(programId);
                var arrayMapper   = new GLInternalCacheArrayMapper(bLayout, blocks);
                var internalCache = new GLInternalCache(bLayout, blocks, arrayMapper);

                /// MAKE SURE ACTIVE UNIFORMS ARE AVAILABLE
                //int noOfActiveUniforms = mEntrypoint.GraphicsPipeline.GetActiveUniforms(programId);

                // var names = mEntrypoint.GraphicsPipeline.GetUniformBlocks(programId);

                //var binder = ConstructBinder(bLayout, programId, noOfActiveUniforms);

                var pipeline = new GLGraphicsPipeline(
                    mEntrypoint.GraphicsPipeline,
                    programId,
                    info,
                    internalCache,
                    bLayout
                    );

                // TODO : BASE PIPELINE / CHILD

                output.Add(pipeline);
            }
            pPipelines = output.ToArray();
            return(Result.SUCCESS);
        }
示例#2
0
        public Result CreateComputePipelines(IMgPipelineCache pipelineCache, MgComputePipelineCreateInfo[] pCreateInfos, IMgAllocationCallbacks allocator, out IMgPipeline[] pPipelines)
        {
            var output = new List <IMgPipeline>();

            foreach (var info in pCreateInfos)
            {
                var pipeline = new AmtComputePipeline(mDevice, info);
                output.Add(pipeline);
            }
            pPipelines = output.ToArray();
            return(Result.SUCCESS);
        }
示例#3
0
        public Result CreateGraphicsPipelines(IMgPipelineCache pipelineCache, MgGraphicsPipelineCreateInfo[] pCreateInfos, IMgAllocationCallbacks allocator, out IMgPipeline[] pPipelines)
        {
            var noOfPipelines = pCreateInfos.Length;
            var output        = new IMgPipeline[pCreateInfos.Length];

            for (var i = 0; i < noOfPipelines; i += 1)
            {
                output[i] = new MockGraphicsPipeline();
            }
            pPipelines = output;
            return(Result.SUCCESS);
        }
示例#4
0
        public Result CreateGraphicsPipelines(IMgPipelineCache pipelineCache, MgGraphicsPipelineCreateInfo[] pCreateInfos, IMgAllocationCallbacks allocator, out IMgPipeline[] pPipelines)
        {
            if (pCreateInfos == null)
            {
                throw new ArgumentNullException(nameof(pCreateInfos));
            }

            var output = new List <IMgPipeline>();

            foreach (var info in pCreateInfos)
            {
                var pipeline = new AmtGraphicsPipeline(mGenerator, mDevice, info);
                output.Add(pipeline);
            }
            pPipelines = output.ToArray();
            return(Result.SUCCESS);
        }
示例#5
0
        public Result CreateGraphicsPipelines(IMgPipelineCache pipelineCache, MgGraphicsPipelineCreateInfo[] pCreateInfos, IMgAllocationCallbacks allocator, out IMgPipeline[] pPipelines)
        {
            var noOfPipelines = pCreateInfos.Length;

            pPipelines = new IMgPipeline[noOfPipelines];
            for (var i = 0; i < noOfPipelines; i += 1)
            {
                var createInfo = pCreateInfos[i];

                var bLayout = (IGLPipelineLayout)createInfo.Layout;

                var programId = 0;
                IGLShaderModuleInspector inspector = null;

                var blocks      = inspector.Inspect(programId);
                var arrayMapper = new GLInternalCacheArrayMapper(bLayout, blocks);
                var cache       = new GLInternalCache(bLayout, blocks, arrayMapper);
            }

            return(Result.SUCCESS);
        }
示例#6
0
 public Result MergePipelineCaches(IMgPipelineCache dstCache, IMgPipelineCache[] pSrcCaches)
 {
     throw new NotImplementedException();
 }
示例#7
0
 public Result GetPipelineCacheData(IMgPipelineCache pipelineCache, out byte[] pData)
 {
     throw new NotImplementedException();
 }
示例#8
0
 public Result CreatePipelineCache(MgPipelineCacheCreateInfo pCreateInfo, IMgAllocationCallbacks allocator, out IMgPipelineCache pPipelineCache)
 {
     throw new NotImplementedException();
 }
示例#9
0
 public Result CreateComputePipelines(IMgPipelineCache pipelineCache, MgComputePipelineCreateInfo[] pCreateInfos, IMgAllocationCallbacks allocator, out IMgPipeline[] pPipelines)
 {
     throw new NotImplementedException();
 }