Exemplo n.º 1
0
        internal PipelineCache(Device parent, ref PipelineCacheCreateInfo createInfo, ref AllocationCallbacks?allocator)
        {
            Parent    = parent;
            Allocator = allocator;

            fixed(byte *initialDataPtr = createInfo.InitialData)
            {
                createInfo.ToNative(out PipelineCacheCreateInfo.Native nativeCreateInfo, initialDataPtr);
                long   handle;
                Result result = vkCreatePipelineCache(Parent, &nativeCreateInfo, NativeAllocator, &handle);

                VulkanException.ThrowForInvalidResult(result);
                Handle = handle;
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// Creates a new pipeline cache.
 /// </summary>
 /// <param name="createInfo">
 /// The structure containing information of a newly created pipeline cache.
 /// </param>
 /// <param name="allocator">Controls host memory allocation.</param>
 /// <returns>Resulting pipeline cache.</returns>
 /// <exception cref="VulkanException">Vulkan returns an error code.</exception>
 public PipelineCache CreatePipelineCache(PipelineCacheCreateInfo createInfo = default(PipelineCacheCreateInfo),
                                          AllocationCallbacks?allocator      = null)
 {
     return(new PipelineCache(this, ref createInfo, ref allocator));
 }