diff options
author | Jason Ekstrand <[email protected]> | 2017-11-15 22:30:20 -0800 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2017-12-04 10:04:19 -0800 |
commit | e12688f365258f6f719983528a2af9b6ca4e25c5 (patch) | |
tree | 2db39e32fdfb6cbbe4f1aa27cb94ab7cfd71bc14 /src/vulkan/wsi/wsi_common.h | |
parent | d50937f137201e1d90ce18bbea1383af7a7ebd5d (diff) |
vulkan/wsi: Do image creation in common code
This uses the mock extension created in a previous commit to tell the
driver that the image it's just been asked to create is, in fact, a
window system image with whatever assumptions that implies. There was a
lot of redundant code between the two drivers to do basically exactly
the same thing.
Reviewed-by: Dave Airlie <[email protected]>
Reviewed-by: Chad Versace <[email protected]>
Diffstat (limited to 'src/vulkan/wsi/wsi_common.h')
-rw-r--r-- | src/vulkan/wsi/wsi_common.h | 28 |
1 files changed, 1 insertions, 27 deletions
diff --git a/src/vulkan/wsi/wsi_common.h b/src/vulkan/wsi/wsi_common.h index d77ae446b08..a5e7e655fc8 100644 --- a/src/vulkan/wsi/wsi_common.h +++ b/src/vulkan/wsi/wsi_common.h @@ -48,39 +48,13 @@ struct wsi_memory_allocate_info { bool implicit_sync; }; -struct wsi_image { - VkImage image; - VkDeviceMemory memory; - - struct { - VkBuffer buffer; - VkDeviceMemory memory; - VkCommandBuffer *blit_cmd_buffers; - } prime; - - uint32_t size; - uint32_t offset; - uint32_t row_pitch; - int fd; -}; - struct wsi_device; -struct wsi_image_fns { - VkResult (*create_wsi_image)(VkDevice device_h, - const VkSwapchainCreateInfoKHR *pCreateInfo, - const VkAllocationCallbacks *pAllocator, - struct wsi_image *image_p); - void (*free_wsi_image)(VkDevice device, - const VkAllocationCallbacks *pAllocator, - struct wsi_image *image); -}; struct wsi_swapchain { const struct wsi_device *wsi; VkDevice device; VkAllocationCallbacks alloc; - const struct wsi_image_fns *image_fns; VkFence fences[3]; VkPresentModeKHR present_mode; uint32_t image_count; @@ -134,7 +108,6 @@ struct wsi_interface { int local_fd, const VkSwapchainCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, - const struct wsi_image_fns *image_fns, struct wsi_swapchain **swapchain); }; @@ -164,6 +137,7 @@ struct wsi_device { WSI_CB(FreeCommandBuffers); WSI_CB(GetBufferMemoryRequirements); WSI_CB(GetImageMemoryRequirements); + WSI_CB(GetImageSubresourceLayout); WSI_CB(GetMemoryFdKHR); WSI_CB(QueueSubmit); #undef WSI_CB |