Esempio n. 1
0
        public MySwapchain CreateSwapChain(MySurface surface)
        {
            var surfaceFormat = _gpu.GetSurfaceFormats(surface).First();

            var capabilities = _gpu.GetSurfaceCapabilities(surface);

            var swapChainExtent = capabilities.CurrentExtent;
            var presentMode     = PresentModeKhr.Fifo;

            var numberOfSwapChainImages = capabilities.MinImageCount + 1;

            var swapchain = _device.CreateSwapchainKHR(new SwapchainCreateInfoKhr {
                Surface       = surface.Handle,
                MinImageCount = numberOfSwapChainImages,
                ImageFormat   = surfaceFormat.Format != Format.Undefined ? surfaceFormat.Format : Format.B8G8R8A8Unorm,
            });
        }
Esempio n. 2
0
 public bool Supports(MySurface surface)
 {
     return(_queueFamilyPropertiesExt.Supports(surface.Handle));
 }
Esempio n. 3
0
 public SurfaceCapabilitiesKhr GetSurfaceCapabilities(MySurface surface)
 {
     return(_physicalDevice.GetSurfaceCapabilitiesKHR(surface.Handle));
 }
Esempio n. 4
0
 public SurfaceFormatKhr[] GetSurfaceFormats(MySurface surface)
 {
     return(_physicalDevice.GetSurfaceFormatsKHR(surface.Handle));
 }