vulkan: introduce supported_features parameter to vk_physical_device_init
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22333>
This commit is contained in:

committed by
Marge Bot

parent
cc02214304
commit
61413d70a0
@@ -2173,7 +2173,7 @@ radv_physical_device_try_create(struct radv_instance *instance, drmDevicePtr drm
|
|||||||
vk_physical_device_dispatch_table_from_entrypoints(&dispatch_table,
|
vk_physical_device_dispatch_table_from_entrypoints(&dispatch_table,
|
||||||
&wsi_physical_device_entrypoints, false);
|
&wsi_physical_device_entrypoints, false);
|
||||||
|
|
||||||
result = vk_physical_device_init(&device->vk, &instance->vk, NULL, &dispatch_table);
|
result = vk_physical_device_init(&device->vk, &instance->vk, NULL, NULL, &dispatch_table);
|
||||||
if (result != VK_SUCCESS) {
|
if (result != VK_SUCCESS) {
|
||||||
goto fail_alloc;
|
goto fail_alloc;
|
||||||
}
|
}
|
||||||
|
@@ -783,7 +783,7 @@ create_physical_device(struct v3dv_instance *instance,
|
|||||||
vk_physical_device_dispatch_table_from_entrypoints(
|
vk_physical_device_dispatch_table_from_entrypoints(
|
||||||
&dispatch_table, &wsi_physical_device_entrypoints, false);
|
&dispatch_table, &wsi_physical_device_entrypoints, false);
|
||||||
|
|
||||||
result = vk_physical_device_init(&device->vk, &instance->vk, NULL,
|
result = vk_physical_device_init(&device->vk, &instance->vk, NULL, NULL,
|
||||||
&dispatch_table);
|
&dispatch_table);
|
||||||
|
|
||||||
if (result != VK_SUCCESS)
|
if (result != VK_SUCCESS)
|
||||||
|
@@ -370,6 +370,7 @@ tu_physical_device_init(struct tu_physical_device *device,
|
|||||||
|
|
||||||
result = vk_physical_device_init(&device->vk, &instance->vk,
|
result = vk_physical_device_init(&device->vk, &instance->vk,
|
||||||
&supported_extensions,
|
&supported_extensions,
|
||||||
|
NULL,
|
||||||
&dispatch_table);
|
&dispatch_table);
|
||||||
if (result != VK_SUCCESS)
|
if (result != VK_SUCCESS)
|
||||||
goto fail_free_vma;
|
goto fail_free_vma;
|
||||||
|
@@ -235,7 +235,7 @@ lvp_physical_device_init(struct lvp_physical_device *device,
|
|||||||
vk_physical_device_dispatch_table_from_entrypoints(
|
vk_physical_device_dispatch_table_from_entrypoints(
|
||||||
&dispatch_table, &wsi_physical_device_entrypoints, false);
|
&dispatch_table, &wsi_physical_device_entrypoints, false);
|
||||||
result = vk_physical_device_init(&device->vk, &instance->vk,
|
result = vk_physical_device_init(&device->vk, &instance->vk,
|
||||||
NULL, &dispatch_table);
|
NULL, NULL, &dispatch_table);
|
||||||
if (result != VK_SUCCESS) {
|
if (result != VK_SUCCESS) {
|
||||||
vk_error(instance, result);
|
vk_error(instance, result);
|
||||||
goto fail;
|
goto fail;
|
||||||
|
@@ -348,6 +348,7 @@ static VkResult pvr_physical_device_init(struct pvr_physical_device *pdevice,
|
|||||||
result = vk_physical_device_init(&pdevice->vk,
|
result = vk_physical_device_init(&pdevice->vk,
|
||||||
&instance->vk,
|
&instance->vk,
|
||||||
&supported_extensions,
|
&supported_extensions,
|
||||||
|
NULL,
|
||||||
&dispatch_table);
|
&dispatch_table);
|
||||||
if (result != VK_SUCCESS)
|
if (result != VK_SUCCESS)
|
||||||
return result;
|
return result;
|
||||||
|
@@ -870,7 +870,7 @@ anv_physical_device_try_create(struct vk_instance *vk_instance,
|
|||||||
&dispatch_table, &wsi_physical_device_entrypoints, false);
|
&dispatch_table, &wsi_physical_device_entrypoints, false);
|
||||||
|
|
||||||
result = vk_physical_device_init(&device->vk, &instance->vk,
|
result = vk_physical_device_init(&device->vk, &instance->vk,
|
||||||
NULL, /* We set up extensions later */
|
NULL, NULL, /* We set up extensions later */
|
||||||
&dispatch_table);
|
&dispatch_table);
|
||||||
if (result != VK_SUCCESS) {
|
if (result != VK_SUCCESS) {
|
||||||
vk_error(instance, result);
|
vk_error(instance, result);
|
||||||
|
@@ -725,7 +725,7 @@ anv_physical_device_try_create(struct vk_instance *vk_instance,
|
|||||||
&dispatch_table, &wsi_physical_device_entrypoints, false);
|
&dispatch_table, &wsi_physical_device_entrypoints, false);
|
||||||
|
|
||||||
result = vk_physical_device_init(&device->vk, &instance->vk,
|
result = vk_physical_device_init(&device->vk, &instance->vk,
|
||||||
NULL, /* We set up extensions later */
|
NULL, NULL, /* We set up extensions later */
|
||||||
&dispatch_table);
|
&dispatch_table);
|
||||||
if (result != VK_SUCCESS) {
|
if (result != VK_SUCCESS) {
|
||||||
vk_error(instance, result);
|
vk_error(instance, result);
|
||||||
|
@@ -371,7 +371,7 @@ dzn_physical_device_create(struct vk_instance *instance,
|
|||||||
|
|
||||||
VkResult result =
|
VkResult result =
|
||||||
vk_physical_device_init(&pdev->vk, instance,
|
vk_physical_device_init(&pdev->vk, instance,
|
||||||
NULL, /* We set up extensions later */
|
NULL, NULL, /* We set up extensions later */
|
||||||
&dispatch_table);
|
&dispatch_table);
|
||||||
if (result != VK_SUCCESS) {
|
if (result != VK_SUCCESS) {
|
||||||
vk_free(&instance->alloc, pdev);
|
vk_free(&instance->alloc, pdev);
|
||||||
|
@@ -300,7 +300,9 @@ panvk_physical_device_init(struct panvk_physical_device *device,
|
|||||||
&dispatch_table, &wsi_physical_device_entrypoints, false);
|
&dispatch_table, &wsi_physical_device_entrypoints, false);
|
||||||
|
|
||||||
result = vk_physical_device_init(&device->vk, &instance->vk,
|
result = vk_physical_device_init(&device->vk, &instance->vk,
|
||||||
&supported_extensions, &dispatch_table);
|
&supported_extensions,
|
||||||
|
NULL,
|
||||||
|
&dispatch_table);
|
||||||
|
|
||||||
if (result != VK_SUCCESS) {
|
if (result != VK_SUCCESS) {
|
||||||
vk_error(instance, result);
|
vk_error(instance, result);
|
||||||
|
@@ -275,7 +275,7 @@ vn_physical_device_base_init(
|
|||||||
{
|
{
|
||||||
VkResult result =
|
VkResult result =
|
||||||
vk_physical_device_init(&physical_dev->base, &instance->base,
|
vk_physical_device_init(&physical_dev->base, &instance->base,
|
||||||
supported_extensions, dispatch_table);
|
supported_extensions, NULL, dispatch_table);
|
||||||
physical_dev->id = (uintptr_t)physical_dev;
|
physical_dev->id = (uintptr_t)physical_dev;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@@ -30,6 +30,7 @@ VkResult
|
|||||||
vk_physical_device_init(struct vk_physical_device *pdevice,
|
vk_physical_device_init(struct vk_physical_device *pdevice,
|
||||||
struct vk_instance *instance,
|
struct vk_instance *instance,
|
||||||
const struct vk_device_extension_table *supported_extensions,
|
const struct vk_device_extension_table *supported_extensions,
|
||||||
|
const struct vk_features *supported_features,
|
||||||
const struct vk_physical_device_dispatch_table *dispatch_table)
|
const struct vk_physical_device_dispatch_table *dispatch_table)
|
||||||
{
|
{
|
||||||
memset(pdevice, 0, sizeof(*pdevice));
|
memset(pdevice, 0, sizeof(*pdevice));
|
||||||
@@ -39,6 +40,9 @@ vk_physical_device_init(struct vk_physical_device *pdevice,
|
|||||||
if (supported_extensions != NULL)
|
if (supported_extensions != NULL)
|
||||||
pdevice->supported_extensions = *supported_extensions;
|
pdevice->supported_extensions = *supported_extensions;
|
||||||
|
|
||||||
|
if (supported_features != NULL)
|
||||||
|
pdevice->supported_features = *supported_features;
|
||||||
|
|
||||||
pdevice->dispatch_table = *dispatch_table;
|
pdevice->dispatch_table = *dispatch_table;
|
||||||
|
|
||||||
/* Add common entrypoints without overwriting driver-provided ones. */
|
/* Add common entrypoints without overwriting driver-provided ones. */
|
||||||
|
@@ -106,12 +106,15 @@ VK_DEFINE_HANDLE_CASTS(vk_physical_device, base, VkPhysicalDevice,
|
|||||||
* physical device
|
* physical device
|
||||||
* @param[in] supported_extensions Table of all device extensions supported
|
* @param[in] supported_extensions Table of all device extensions supported
|
||||||
* by this physical device
|
* by this physical device
|
||||||
|
* @param[in] supported_features Table of all features supported by this
|
||||||
|
* physical device
|
||||||
* @param[in] dispatch_table Physical-device-level dispatch table
|
* @param[in] dispatch_table Physical-device-level dispatch table
|
||||||
*/
|
*/
|
||||||
VkResult MUST_CHECK
|
VkResult MUST_CHECK
|
||||||
vk_physical_device_init(struct vk_physical_device *physical_device,
|
vk_physical_device_init(struct vk_physical_device *physical_device,
|
||||||
struct vk_instance *instance,
|
struct vk_instance *instance,
|
||||||
const struct vk_device_extension_table *supported_extensions,
|
const struct vk_device_extension_table *supported_extensions,
|
||||||
|
const struct vk_features *supported_features,
|
||||||
const struct vk_physical_device_dispatch_table *dispatch_table);
|
const struct vk_physical_device_dispatch_table *dispatch_table);
|
||||||
|
|
||||||
/** Tears down a vk_physical_device
|
/** Tears down a vk_physical_device
|
||||||
|
Reference in New Issue
Block a user