Ejemplo 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,
            });
        }
Ejemplo n.º 2
0
 public bool Supports(MySurface surface)
 {
     return(_queueFamilyPropertiesExt.Supports(surface.Handle));
 }
Ejemplo n.º 3
0
 public SurfaceCapabilitiesKhr GetSurfaceCapabilities(MySurface surface)
 {
     return(_physicalDevice.GetSurfaceCapabilitiesKHR(surface.Handle));
 }
Ejemplo n.º 4
0
 public SurfaceFormatKhr[] GetSurfaceFormats(MySurface surface)
 {
     return(_physicalDevice.GetSurfaceFormatsKHR(surface.Handle));
 }