mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-22 22:10:10 +01:00
lavapipe: implement physical device group enumeration
This was missing when I added physical device groups, and
was causing crashes on win32.
Fixes: 6af87193c ("lavapipe: add basic vulkan device group support.")
Acked-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9120>
This commit is contained in:
parent
0fd58b4537
commit
c0c03f29e0
1 changed files with 53 additions and 20 deletions
|
|
@ -206,15 +206,13 @@ static struct drisw_loader_funcs lvp_sw_lf = {
|
||||||
.put_image2 = lvp_put_image2,
|
.put_image2 = lvp_put_image2,
|
||||||
};
|
};
|
||||||
|
|
||||||
VKAPI_ATTR VkResult VKAPI_CALL lvp_EnumeratePhysicalDevices(
|
static VkResult
|
||||||
VkInstance _instance,
|
lvp_enumerate_physical_devices(struct lvp_instance *instance)
|
||||||
uint32_t* pPhysicalDeviceCount,
|
|
||||||
VkPhysicalDevice* pPhysicalDevices)
|
|
||||||
{
|
{
|
||||||
LVP_FROM_HANDLE(lvp_instance, instance, _instance);
|
|
||||||
VkResult result;
|
VkResult result;
|
||||||
|
|
||||||
if (instance->physicalDeviceCount < 0) {
|
if (instance->physicalDeviceCount != -1)
|
||||||
|
return VK_SUCCESS;
|
||||||
|
|
||||||
/* sw only for now */
|
/* sw only for now */
|
||||||
instance->num_devices = pipe_loader_sw_probe(NULL, 0);
|
instance->num_devices = pipe_loader_sw_probe(NULL, 0);
|
||||||
|
|
@ -223,17 +221,28 @@ VKAPI_ATTR VkResult VKAPI_CALL lvp_EnumeratePhysicalDevices(
|
||||||
|
|
||||||
pipe_loader_sw_probe_dri(&instance->devs, &lvp_sw_lf);
|
pipe_loader_sw_probe_dri(&instance->devs, &lvp_sw_lf);
|
||||||
|
|
||||||
|
|
||||||
result = lvp_physical_device_init(&instance->physicalDevice,
|
result = lvp_physical_device_init(&instance->physicalDevice,
|
||||||
instance, &instance->devs[0]);
|
instance, &instance->devs[0]);
|
||||||
if (result == VK_ERROR_INCOMPATIBLE_DRIVER) {
|
if (result == VK_ERROR_INCOMPATIBLE_DRIVER) {
|
||||||
instance->physicalDeviceCount = 0;
|
instance->physicalDeviceCount = 0;
|
||||||
} else if (result == VK_SUCCESS) {
|
} else if (result == VK_SUCCESS) {
|
||||||
instance->physicalDeviceCount = 1;
|
instance->physicalDeviceCount = 1;
|
||||||
} else {
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
VKAPI_ATTR VkResult VKAPI_CALL lvp_EnumeratePhysicalDevices(
|
||||||
|
VkInstance _instance,
|
||||||
|
uint32_t* pPhysicalDeviceCount,
|
||||||
|
VkPhysicalDevice* pPhysicalDevices)
|
||||||
|
{
|
||||||
|
LVP_FROM_HANDLE(lvp_instance, instance, _instance);
|
||||||
|
VkResult result;
|
||||||
|
|
||||||
|
result = lvp_enumerate_physical_devices(instance);
|
||||||
|
if (result != VK_SUCCESS)
|
||||||
return result;
|
return result;
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!pPhysicalDevices) {
|
if (!pPhysicalDevices) {
|
||||||
*pPhysicalDeviceCount = instance->physicalDeviceCount;
|
*pPhysicalDeviceCount = instance->physicalDeviceCount;
|
||||||
|
|
@ -247,6 +256,30 @@ VKAPI_ATTR VkResult VKAPI_CALL lvp_EnumeratePhysicalDevices(
|
||||||
return VK_SUCCESS;
|
return VK_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
VKAPI_ATTR VkResult VKAPI_CALL lvp_EnumeratePhysicalDeviceGroups(
|
||||||
|
VkInstance _instance,
|
||||||
|
uint32_t* pPhysicalDeviceGroupCount,
|
||||||
|
VkPhysicalDeviceGroupProperties* pPhysicalDeviceGroupProperties)
|
||||||
|
{
|
||||||
|
LVP_FROM_HANDLE(lvp_instance, instance, _instance);
|
||||||
|
VK_OUTARRAY_MAKE_TYPED(VkPhysicalDeviceGroupProperties, out,
|
||||||
|
pPhysicalDeviceGroupProperties,
|
||||||
|
pPhysicalDeviceGroupCount);
|
||||||
|
|
||||||
|
VkResult result = lvp_enumerate_physical_devices(instance);
|
||||||
|
if (result != VK_SUCCESS)
|
||||||
|
return result;
|
||||||
|
|
||||||
|
vk_outarray_append_typed(VkPhysicalDeviceGroupProperties, &out, p) {
|
||||||
|
p->physicalDeviceCount = 1;
|
||||||
|
memset(p->physicalDevices, 0, sizeof(p->physicalDevices));
|
||||||
|
p->physicalDevices[0] = lvp_physical_device_to_handle(&instance->physicalDevice);
|
||||||
|
p->subsetAllocation = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return vk_outarray_status(&out);
|
||||||
|
}
|
||||||
|
|
||||||
VKAPI_ATTR void VKAPI_CALL lvp_GetPhysicalDeviceFeatures(
|
VKAPI_ATTR void VKAPI_CALL lvp_GetPhysicalDeviceFeatures(
|
||||||
VkPhysicalDevice physicalDevice,
|
VkPhysicalDevice physicalDevice,
|
||||||
VkPhysicalDeviceFeatures* pFeatures)
|
VkPhysicalDeviceFeatures* pFeatures)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue