Exemplo n.º 1
0
 private void CreateDescriptorPool()
 {
     this.descriptorPool = device.CreateDescriptorPool(new DescriptorPoolCreateInfo
     {
         PoolSizes = new[]
         {
             new DescriptorPoolSize
             {
                 DescriptorCount = 1,
                 Type            = DescriptorType.UniformBuffer
             }
         },
         MaxSets = 1
     });
 }
Exemplo n.º 2
0
        private void TearDown()
        {
            device.WaitIdle();

            this.renderFinishedSemaphore.Dispose();
            this.renderFinishedSemaphore = null;

            this.imageAvailableSemaphore.Dispose();
            this.imageAvailableSemaphore = null;

            this.descriptorPool.Dispose();
            this.descriptorPool = null;
            this.descriptorSet  = null;

            this.device.FreeMemory(this.uniformBufferMemory);
            this.uniformBufferMemory = null;

            this.uniformBuffer.Dispose();
            this.uniformBuffer = null;

            this.device.FreeMemory(this.uniformStagingBufferMemory);
            this.uniformStagingBufferMemory = null;

            this.uniformStagingBuffer.Dispose();
            this.uniformStagingBuffer = null;

            this.device.FreeMemory(this.indexBufferMemory);
            this.indexBufferMemory = null;

            this.indexBuffer.Dispose();
            this.indexBuffer = null;

            this.device.FreeMemory(this.vertexBufferMemory);
            this.vertexBufferMemory = null;

            this.vertexBuffer.Dispose();
            this.vertexBuffer = null;

            this.commandPool.Dispose();
            this.commandPool    = null;
            this.commandBuffers = null;
            this.transientCommandPool.Dispose();
            this.transientCommandPool = null;

            foreach (var frameBuffer in this.frameBuffers)
            {
                frameBuffer.Dispose();
            }
            this.frameBuffers = null;

            this.pipeline.Dispose();
            this.pipeline = null;

            this.pipelineLayout.Dispose();
            this.pipelineLayout = null;

            foreach (var imageView in this.swapChainImageViews)
            {
                imageView.Dispose();
            }
            this.swapChainImageViews = null;

            this.descriptorSetLayout.Dispose();
            this.descriptorSetLayout = null;

            this.renderPass.Dispose();
            this.renderPass = null;

            this.swapChain.Dispose();
            this.swapChain = null;

            this.device.Dispose();
            this.device = null;

            this.surface.Dispose();
            this.surface = null;

            this.debugCallback.Dispose();
            this.debugCallback = null;

            this.instance.Dispose();
            this.instance = null;
        }
Exemplo n.º 3
0
 internal DescriptorSet(Interop.DescriptorSet handle, DescriptorPool parent, CommandCache commandCache)
 {
     this.handle       = handle;
     this.parent       = parent;
     this.commandCache = commandCache;
 }