Beispiel #1
0
        void CreateImageView(VkImage image, VkFormat format, ref VkImageView imageView)
        {
            var info = new VkImageViewCreateInfo();

            info.image    = image;
            info.viewType = VkImageViewType._2D;
            info.format   = format;
            info.subresourceRange.aspectMask     = VkImageAspectFlags.ColorBit;
            info.subresourceRange.baseMipLevel   = 0;;
            info.subresourceRange.levelCount     = 1;
            info.subresourceRange.baseArrayLayer = 0;
            info.subresourceRange.layerCount     = 1;

            imageView?.Dispose();
            imageView = new VkImageView(device, info);
        }
Beispiel #2
0
 public void Dispose()
 {
     generator.Dispose();
     imageAvailableSemaphore.Dispose();
     renderFinishedSemaphore.Dispose();
     descriptorPool.Dispose();
     uniformBuffer.Dispose();
     uniformBufferMemory.Dispose();
     indexBuffer.Dispose();
     indexBufferMemory.Dispose();
     vertexBuffer.Dispose();
     vertexBufferMemory.Dispose();
     textureSampler.Dispose();
     textureImageView.Dispose();
     textureImage.Dispose();
     textureImageMemory.Dispose();
     stagingBuffer.Dispose();
     stagingBufferMemory.Dispose();
     commandPool.Dispose();
     foreach (var fb in swapchainFramebuffers)
     {
         fb.Dispose();
     }
     pipeline.Dispose();
     pipelineLayout.Dispose();
     descriptorSetLayout.Dispose();
     renderPass.Dispose();
     foreach (var iv in swapchainImageViews)
     {
         iv.Dispose();
     }
     swapchain.Dispose();
     device.Dispose();
     surface.Dispose();
     instance.Dispose();
     window.Dispose();
     GLFW.Terminate();
 }