public Pipeline(Device device, GraphicsPipelineCreateInfo info, PipelineCache cache) { if (device == null) { throw new ArgumentNullException(nameof(device)); } if (info == null) { throw new ArgumentNullException(nameof(info)); } Device = device; VkPipelineCache nativeCache = VkPipelineCache.Null; if (cache != null) { nativeCache = cache.Native; } pipeline = CreatePipelinesInternal(device, new GraphicsPipelineCreateInfo[] { info }, nativeCache)[0]; }
//graphics public static Pipeline[] CreatePipelines(Device device, GraphicsPipelineCreateInfo[] infos, PipelineCache cache) { if (device == null) { throw new ArgumentNullException(nameof(device)); } if (infos == null) { throw new ArgumentNullException(nameof(infos)); } for (int i = 0; i < infos.Length; i++) { if (infos[i] == null) { throw new ArgumentNullException(string.Format("Element {0} of {1} is null", i, nameof(infos))); } } VkPipelineCache nativeCache = VkPipelineCache.Null; if (cache != null) { nativeCache = cache.Native; } var pipelines = new Pipeline[infos.Length]; var natives = CreatePipelinesInternal(device, infos, nativeCache); for (int i = 0; i < infos.Length; i++) { pipelines[i] = new Pipeline(device, natives[i]); } return(pipelines); }
//compute public static Pipeline[] CreatePipelines(Device device, ComputePipelineCreateInfo[] infos, PipelineCache cache) { if (device == null) { throw new ArgumentNullException(nameof(device)); } if (infos == null) { throw new ArgumentNullException(nameof(infos)); } VkPipelineCache nativeCache = VkPipelineCache.Null; if (cache != null) { nativeCache = cache.Native; } var pipelines = new Pipeline[infos.Length]; var natives = CreatePipelinesInternal(device, infos, nativeCache); for (int i = 0; i < infos.Length; i++) { pipelines[i] = new Pipeline(device, natives[i]); } return(pipelines); }