diff --git a/src/broadcom/vulkan/v3dv_device.c b/src/broadcom/vulkan/v3dv_device.c index 08e399bfe41..21e042fc955 100644 --- a/src/broadcom/vulkan/v3dv_device.c +++ b/src/broadcom/vulkan/v3dv_device.c @@ -618,14 +618,14 @@ init_uuids(struct v3dv_physical_device *device) const struct build_id_note *note = build_id_find_nhdr_for_addr(init_uuids); if (!note) { - return vk_errorf(device->instance, + return vk_errorf((struct v3dv_instance*) device->vk.instance, VK_ERROR_INITIALIZATION_FAILED, "Failed to find build-id"); } unsigned build_id_len = build_id_length(note); if (build_id_len < 20) { - return vk_errorf(device->instance, + return vk_errorf((struct v3dv_instance*) device->vk.instance, VK_ERROR_INITIALIZATION_FAILED, "build-id too short. It needs to be a SHA"); } @@ -679,7 +679,6 @@ physical_device_init(struct v3dv_physical_device *device, if (result != VK_SUCCESS) goto fail; - device->instance = instance; assert(drm_render_device); const char *path = drm_render_device->nodes[DRM_NODE_RENDER]; @@ -1446,7 +1445,8 @@ v3dv_EnumerateDeviceLayerProperties(VkPhysicalDevice physicalDevice, return VK_SUCCESS; } - return vk_error(physical_device->instance, VK_ERROR_LAYER_NOT_PRESENT); + return vk_error((struct v3dv_instance*) physical_device->vk.instance, + VK_ERROR_LAYER_NOT_PRESENT); } static VkResult @@ -1514,7 +1514,7 @@ v3dv_CreateDevice(VkPhysicalDevice physicalDevice, VkDevice *pDevice) { V3DV_FROM_HANDLE(v3dv_physical_device, physical_device, physicalDevice); - struct v3dv_instance *instance = physical_device->instance; + struct v3dv_instance *instance = (struct v3dv_instance*) physical_device->vk.instance; VkResult result; struct v3dv_device *device; @@ -1561,14 +1561,14 @@ v3dv_CreateDevice(VkPhysicalDevice physicalDevice, return vk_error(instance, VK_ERROR_INITIALIZATION_FAILED); } - device = vk_zalloc2(&physical_device->instance->vk.alloc, pAllocator, + device = vk_zalloc2(&physical_device->vk.instance->alloc, pAllocator, sizeof(*device), 8, VK_SYSTEM_ALLOCATION_SCOPE_DEVICE); if (!device) return vk_error(instance, VK_ERROR_OUT_OF_HOST_MEMORY); result = vk_device_init(&device->vk, NULL, NULL, pCreateInfo, - &physical_device->instance->vk.alloc, pAllocator); + &physical_device->vk.instance->alloc, pAllocator); if (result != VK_SUCCESS) { vk_free(&device->vk.alloc, device); return vk_error(instance, result); @@ -1580,7 +1580,7 @@ v3dv_CreateDevice(VkPhysicalDevice physicalDevice, if (pAllocator) device->vk.alloc = *pAllocator; else - device->vk.alloc = physical_device->instance->vk.alloc; + device->vk.alloc = physical_device->vk.instance->alloc; pthread_mutex_init(&device->mutex, NULL); diff --git a/src/broadcom/vulkan/v3dv_private.h b/src/broadcom/vulkan/v3dv_private.h index e4c16348954..fb912a0c091 100644 --- a/src/broadcom/vulkan/v3dv_private.h +++ b/src/broadcom/vulkan/v3dv_private.h @@ -129,8 +129,6 @@ struct v3d_simulator_file; struct v3dv_physical_device { struct vk_physical_device vk; - struct v3dv_instance *instance; - struct v3dv_device_extension_table supported_extensions; struct v3dv_physical_device_dispatch_table dispatch; diff --git a/src/broadcom/vulkan/v3dv_wsi.c b/src/broadcom/vulkan/v3dv_wsi.c index cf7e5456602..80ef8a34e47 100644 --- a/src/broadcom/vulkan/v3dv_wsi.c +++ b/src/broadcom/vulkan/v3dv_wsi.c @@ -44,7 +44,7 @@ v3dv_wsi_init(struct v3dv_physical_device *physical_device) result = wsi_device_init(&physical_device->wsi_device, v3dv_physical_device_to_handle(physical_device), v3dv_wsi_proc_addr, - &physical_device->instance->vk.alloc, + &physical_device->vk.instance->alloc, physical_device->master_fd, NULL, false); if (result != VK_SUCCESS) @@ -59,7 +59,7 @@ void v3dv_wsi_finish(struct v3dv_physical_device *physical_device) { wsi_device_finish(&physical_device->wsi_device, - &physical_device->instance->vk.alloc); + &physical_device->vk.instance->alloc); } void v3dv_DestroySurfaceKHR(