aboutsummaryrefslogtreecommitdiffstats
path: root/src/intel/vulkan/anv_wsi.c
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2020-01-17 22:23:30 -0600
committerMarge Bot <[email protected]>2020-01-20 22:08:52 +0000
commit70e8064e131467527e70a681ac6cf763587bd8bf (patch)
tree12aab6d26dcf8c3aed8751225fde15086bae53ad /src/intel/vulkan/anv_wsi.c
parent735a3ba00765baa717ff541fb5aa5105dc816ad7 (diff)
anv: Add an anv_physical_device field to anv_device
Having to always pull the physical device from the instance has been annoying for almost as long as the driver has existed. It also won't work in a world where we ever have more than one physical device. This commit adds a new field called "physical" to anv_device and switches every location where we use device->instance->physicalDevice to use the new field instead. Reviewed-by: Lionel Landwerlin <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3461>
Diffstat (limited to 'src/intel/vulkan/anv_wsi.c')
-rw-r--r--src/intel/vulkan/anv_wsi.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/intel/vulkan/anv_wsi.c b/src/intel/vulkan/anv_wsi.c
index 29f13a06e1a..dbb8d512cbd 100644
--- a/src/intel/vulkan/anv_wsi.c
+++ b/src/intel/vulkan/anv_wsi.c
@@ -213,7 +213,7 @@ VkResult anv_CreateSwapchainKHR(
VkSwapchainKHR* pSwapchain)
{
ANV_FROM_HANDLE(anv_device, device, _device);
- struct wsi_device *wsi_device = &device->instance->physicalDevice.wsi_device;
+ struct wsi_device *wsi_device = &device->physical->wsi_device;
const VkAllocationCallbacks *alloc;
if (pAllocator)
@@ -278,10 +278,9 @@ VkResult anv_AcquireNextImage2KHR(
uint32_t* pImageIndex)
{
ANV_FROM_HANDLE(anv_device, device, _device);
- struct anv_physical_device *pdevice = &device->instance->physicalDevice;
- return wsi_common_acquire_next_image2(&pdevice->wsi_device, _device,
- pAcquireInfo, pImageIndex);
+ return wsi_common_acquire_next_image2(&device->physical->wsi_device,
+ _device, pAcquireInfo, pImageIndex);
}
VkResult anv_QueuePresentKHR(
@@ -289,10 +288,8 @@ VkResult anv_QueuePresentKHR(
const VkPresentInfoKHR* pPresentInfo)
{
ANV_FROM_HANDLE(anv_queue, queue, _queue);
- struct anv_physical_device *pdevice =
- &queue->device->instance->physicalDevice;
- return wsi_common_queue_present(&pdevice->wsi_device,
+ return wsi_common_queue_present(&queue->device->physical->wsi_device,
anv_device_to_handle(queue->device),
_queue, 0,
pPresentInfo);