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,
|
||||
&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) {
|
||||
goto fail_alloc;
|
||||
}
|
||||
|
@@ -783,7 +783,7 @@ create_physical_device(struct v3dv_instance *instance,
|
||||
vk_physical_device_dispatch_table_from_entrypoints(
|
||||
&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);
|
||||
|
||||
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,
|
||||
&supported_extensions,
|
||||
NULL,
|
||||
&dispatch_table);
|
||||
if (result != VK_SUCCESS)
|
||||
goto fail_free_vma;
|
||||
@@ -1501,7 +1502,7 @@ tu_GetPhysicalDeviceProperties2(VkPhysicalDevice physicalDevice,
|
||||
properties->robustStorageTexelBufferDescriptorSize = A6XX_TEX_CONST_DWORDS * 4;
|
||||
properties->uniformBufferDescriptorSize = A6XX_TEX_CONST_DWORDS * 4;
|
||||
properties->robustUniformBufferDescriptorSize = A6XX_TEX_CONST_DWORDS * 4;
|
||||
properties->storageBufferDescriptorSize =
|
||||
properties->storageBufferDescriptorSize =
|
||||
pdevice->info->a6xx.storage_16bit ?
|
||||
2 * A6XX_TEX_CONST_DWORDS * 4 :
|
||||
A6XX_TEX_CONST_DWORDS * 4;
|
||||
@@ -2475,7 +2476,7 @@ tu_DestroyDevice(VkDevice _device, const VkAllocationCallbacks *pAllocator)
|
||||
|
||||
if (device->fiber_pvtmem_bo.bo)
|
||||
tu_bo_finish(device, device->fiber_pvtmem_bo.bo);
|
||||
|
||||
|
||||
if (device->wave_pvtmem_bo.bo)
|
||||
tu_bo_finish(device, device->wave_pvtmem_bo.bo);
|
||||
|
||||
|
@@ -235,7 +235,7 @@ lvp_physical_device_init(struct lvp_physical_device *device,
|
||||
vk_physical_device_dispatch_table_from_entrypoints(
|
||||
&dispatch_table, &wsi_physical_device_entrypoints, false);
|
||||
result = vk_physical_device_init(&device->vk, &instance->vk,
|
||||
NULL, &dispatch_table);
|
||||
NULL, NULL, &dispatch_table);
|
||||
if (result != VK_SUCCESS) {
|
||||
vk_error(instance, result);
|
||||
goto fail;
|
||||
@@ -2373,9 +2373,9 @@ vk_icdNegotiateLoaderICDInterfaceVersion(uint32_t* pSupportedVersion)
|
||||
*
|
||||
* - Loader interface v4 differs from v3 in:
|
||||
* - The ICD must implement vk_icdGetPhysicalDeviceProcAddr().
|
||||
*
|
||||
*
|
||||
* - Loader interface v5 differs from v4 in:
|
||||
* - The ICD must support Vulkan API version 1.1 and must not return
|
||||
* - The ICD must support Vulkan API version 1.1 and must not return
|
||||
* VK_ERROR_INCOMPATIBLE_DRIVER from vkCreateInstance() unless a
|
||||
* Vulkan Loader with interface v4 or smaller is being used and the
|
||||
* application provides an API version that is greater than 1.0.
|
||||
|
@@ -348,6 +348,7 @@ static VkResult pvr_physical_device_init(struct pvr_physical_device *pdevice,
|
||||
result = vk_physical_device_init(&pdevice->vk,
|
||||
&instance->vk,
|
||||
&supported_extensions,
|
||||
NULL,
|
||||
&dispatch_table);
|
||||
if (result != VK_SUCCESS)
|
||||
return result;
|
||||
|
@@ -870,7 +870,7 @@ anv_physical_device_try_create(struct vk_instance *vk_instance,
|
||||
&dispatch_table, &wsi_physical_device_entrypoints, false);
|
||||
|
||||
result = vk_physical_device_init(&device->vk, &instance->vk,
|
||||
NULL, /* We set up extensions later */
|
||||
NULL, NULL, /* We set up extensions later */
|
||||
&dispatch_table);
|
||||
if (result != VK_SUCCESS) {
|
||||
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);
|
||||
|
||||
result = vk_physical_device_init(&device->vk, &instance->vk,
|
||||
NULL, /* We set up extensions later */
|
||||
NULL, NULL, /* We set up extensions later */
|
||||
&dispatch_table);
|
||||
if (result != VK_SUCCESS) {
|
||||
vk_error(instance, result);
|
||||
|
@@ -371,7 +371,7 @@ dzn_physical_device_create(struct vk_instance *instance,
|
||||
|
||||
VkResult result =
|
||||
vk_physical_device_init(&pdev->vk, instance,
|
||||
NULL, /* We set up extensions later */
|
||||
NULL, NULL, /* We set up extensions later */
|
||||
&dispatch_table);
|
||||
if (result != VK_SUCCESS) {
|
||||
vk_free(&instance->alloc, pdev);
|
||||
@@ -1156,7 +1156,7 @@ dzn_enumerate_physical_devices(struct vk_instance *instance)
|
||||
if (result != VK_SUCCESS)
|
||||
result = dzn_enumerate_physical_devices_dxgi(instance);
|
||||
#endif
|
||||
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -1598,9 +1598,9 @@ vk_icdNegotiateLoaderICDInterfaceVersion(uint32_t *pSupportedVersion)
|
||||
*
|
||||
* - Loader interface v4 differs from v3 in:
|
||||
* - The ICD must implement vk_icdGetPhysicalDeviceProcAddr().
|
||||
*
|
||||
*
|
||||
* - Loader interface v5 differs from v4 in:
|
||||
* - The ICD must support Vulkan API version 1.1 and must not return
|
||||
* - The ICD must support Vulkan API version 1.1 and must not return
|
||||
* VK_ERROR_INCOMPATIBLE_DRIVER from vkCreateInstance() unless a
|
||||
* Vulkan Loader with interface v4 or smaller is being used and the
|
||||
* application provides an API version that is greater than 1.0.
|
||||
@@ -2052,7 +2052,7 @@ dzn_queue_submit(struct vk_queue *q,
|
||||
}
|
||||
|
||||
ID3D12CommandQueue_ExecuteCommandLists(queue->cmdqueue, info->command_buffer_count, cmdlists);
|
||||
|
||||
|
||||
for (uint32_t i = 0; i < info->command_buffer_count; i++) {
|
||||
struct dzn_cmd_buffer* cmd_buffer =
|
||||
container_of(info->command_buffers[i], struct dzn_cmd_buffer, vk);
|
||||
|
@@ -300,7 +300,9 @@ panvk_physical_device_init(struct panvk_physical_device *device,
|
||||
&dispatch_table, &wsi_physical_device_entrypoints, false);
|
||||
|
||||
result = vk_physical_device_init(&device->vk, &instance->vk,
|
||||
&supported_extensions, &dispatch_table);
|
||||
&supported_extensions,
|
||||
NULL,
|
||||
&dispatch_table);
|
||||
|
||||
if (result != VK_SUCCESS) {
|
||||
vk_error(instance, result);
|
||||
|
@@ -275,7 +275,7 @@ vn_physical_device_base_init(
|
||||
{
|
||||
VkResult result =
|
||||
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;
|
||||
return result;
|
||||
}
|
||||
|
@@ -30,6 +30,7 @@ VkResult
|
||||
vk_physical_device_init(struct vk_physical_device *pdevice,
|
||||
struct vk_instance *instance,
|
||||
const struct vk_device_extension_table *supported_extensions,
|
||||
const struct vk_features *supported_features,
|
||||
const struct vk_physical_device_dispatch_table *dispatch_table)
|
||||
{
|
||||
memset(pdevice, 0, sizeof(*pdevice));
|
||||
@@ -39,6 +40,9 @@ vk_physical_device_init(struct vk_physical_device *pdevice,
|
||||
if (supported_extensions != NULL)
|
||||
pdevice->supported_extensions = *supported_extensions;
|
||||
|
||||
if (supported_features != NULL)
|
||||
pdevice->supported_features = *supported_features;
|
||||
|
||||
pdevice->dispatch_table = *dispatch_table;
|
||||
|
||||
/* Add common entrypoints without overwriting driver-provided ones. */
|
||||
|
@@ -106,12 +106,15 @@ VK_DEFINE_HANDLE_CASTS(vk_physical_device, base, VkPhysicalDevice,
|
||||
* physical device
|
||||
* @param[in] supported_extensions Table of all device extensions supported
|
||||
* 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
|
||||
*/
|
||||
VkResult MUST_CHECK
|
||||
vk_physical_device_init(struct vk_physical_device *physical_device,
|
||||
struct vk_instance *instance,
|
||||
const struct vk_device_extension_table *supported_extensions,
|
||||
const struct vk_features *supported_features,
|
||||
const struct vk_physical_device_dispatch_table *dispatch_table);
|
||||
|
||||
/** Tears down a vk_physical_device
|
||||
|
Reference in New Issue
Block a user