anv/pipeline: Handle output lowering in anv_pipeline instead of spirv_to_nir
[mesa.git] / src / vulkan / anv_wsi.h
index cbff854c2fcc86be556c21f678b8d21de5ca16f4..15b3f862499c9fb3923ecd7daecc34ed54cb3f46 100644 (file)
 
 #include "anv_private.h"
 
-struct anv_swap_chain {
-   struct anv_device *                          device;
+struct anv_swapchain;
 
-   VkResult (*destroy)(struct anv_swap_chain *swap_chain);
-   VkResult (*get_swap_chain_info)(struct anv_swap_chain *swap_chain,
-                                   VkSwapChainInfoTypeWSI infoType,
-                                   size_t *pDataSize, void *pData);
-   VkResult (*acquire_next_image)(struct anv_swap_chain *swap_chain,
+struct anv_wsi_surface {
+   struct anv_instance *instance;
+
+   void (*destroy)(struct anv_wsi_surface *surface,
+                   const VkAllocationCallbacks *pAllocator);
+   VkResult (*get_support)(struct anv_wsi_surface *surface,
+                           struct anv_physical_device *device,
+                           uint32_t queueFamilyIndex,
+                           VkBool32* pSupported);
+   VkResult (*get_capabilities)(struct anv_wsi_surface *surface,
+                                struct anv_physical_device *device,
+                                VkSurfaceCapabilitiesKHR* pSurfaceCapabilities);
+   VkResult (*get_formats)(struct anv_wsi_surface *surface,
+                           struct anv_physical_device *device,
+                           uint32_t* pSurfaceFormatCount,
+                           VkSurfaceFormatKHR* pSurfaceFormats);
+   VkResult (*get_present_modes)(struct anv_wsi_surface *surface,
+                                 struct anv_physical_device *device,
+                                 uint32_t* pPresentModeCount,
+                                 VkPresentModeKHR* pPresentModes);
+   VkResult (*create_swapchain)(struct anv_wsi_surface *surface,
+                                struct anv_device *device,
+                                const VkSwapchainCreateInfoKHR* pCreateInfo,
+                                const VkAllocationCallbacks* pAllocator,
+                                struct anv_swapchain **swapchain);
+};
+
+struct anv_swapchain {
+   struct anv_device *device;
+
+   VkResult (*destroy)(struct anv_swapchain *swapchain,
+                       const VkAllocationCallbacks *pAllocator);
+   VkResult (*get_images)(struct anv_swapchain *swapchain,
+                          uint32_t *pCount, VkImage *pSwapchainImages);
+   VkResult (*acquire_next_image)(struct anv_swapchain *swap_chain,
                                   uint64_t timeout, VkSemaphore semaphore,
                                   uint32_t *image_index);
-   VkResult (*queue_present)(struct anv_swap_chain *swap_chain,
+   VkResult (*queue_present)(struct anv_swapchain *swap_chain,
                              struct anv_queue *queue,
                              uint32_t image_index);
 };
 
-ANV_DEFINE_NONDISP_HANDLE_CASTS(anv_swap_chain, VkSwapChainWSI)
-
-struct anv_wsi_implementation {
-   VkResult (*get_window_supported)(struct anv_wsi_implementation *impl,
-                                    struct anv_physical_device *physical_device,
-                                    const VkSurfaceDescriptionWindowWSI *window,
-                                    VkBool32 *pSupported);
-   VkResult (*get_surface_info)(struct anv_wsi_implementation *impl,
-                                struct anv_device *device,
-                                VkSurfaceDescriptionWindowWSI *window,
-                                VkSurfaceInfoTypeWSI infoType,
-                                size_t* pDataSize, void* pData);
-   VkResult (*create_swap_chain)(struct anv_wsi_implementation *impl,
-                                 struct anv_device *device,
-                                 const VkSwapChainCreateInfoWSI *pCreateInfo,
-                                 struct anv_swap_chain **swap_chain);
-};
+ANV_DEFINE_NONDISP_HANDLE_CASTS(anv_wsi_surface, VkSurfaceKHR)
+ANV_DEFINE_NONDISP_HANDLE_CASTS(anv_swapchain, VkSwapchainKHR)
 
 VkResult anv_x11_init_wsi(struct anv_instance *instance);
 void anv_x11_finish_wsi(struct anv_instance *instance);