vulkan: Add a generated vk_properties struct

Generates a physical device properties table to avoid dealing with pNext
chains in the driver. Based on vk_features.

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24575>
This commit is contained in:
Konstantin Seurer
2023-08-07 19:04:15 +02:00
committed by Marge Bot
parent 0ab0e5d803
commit eaee792ea5
16 changed files with 333 additions and 10 deletions
+14 -2
View File
@@ -194,6 +194,18 @@ vk_physical_device_features = custom_target(
depend_files : vk_physical_device_features_gen_depend_files,
)
vk_physical_device_properties = custom_target(
'vk_physical_device_properties',
input : [vk_physical_device_properties_gen, vk_api_xml],
output : ['vk_physical_device_properties.c', 'vk_physical_device_properties.h'],
command : [
prog_python, '@INPUT0@', '--xml', '@INPUT1@',
'--out-c', '@OUTPUT0@', '--out-h', '@OUTPUT1@',
'--beta', with_vulkan_beta.to_string()
],
depend_files : vk_physical_device_properties_gen_depend_files,
)
vk_format_info = custom_target(
'vk_format_info',
input : ['vk_format_info_gen.py', vk_api_xml],
@@ -209,7 +221,7 @@ libvulkan_runtime = static_library(
[vulkan_runtime_files, vk_common_entrypoints,
vk_cmd_queue, vk_cmd_enqueue_entrypoints,
vk_dispatch_trampolines, vk_physical_device_features,
vk_format_info],
vk_physical_device_properties, vk_format_info],
include_directories : [inc_include, inc_src, inc_gallium],
dependencies : vulkan_runtime_deps,
# For glsl_type_singleton
@@ -220,7 +232,7 @@ libvulkan_runtime = static_library(
)
idep_vulkan_runtime_headers = declare_dependency(
sources : [vk_cmd_queue[1], vk_physical_device_features[1]],
sources : [vk_cmd_queue[1], vk_physical_device_features[1], vk_physical_device_properties[1]],
include_directories : include_directories('.'),
)
+4
View File
@@ -31,6 +31,7 @@ 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_properties *properties,
const struct vk_physical_device_dispatch_table *dispatch_table)
{
memset(pdevice, 0, sizeof(*pdevice));
@@ -43,6 +44,9 @@ vk_physical_device_init(struct vk_physical_device *pdevice,
if (supported_features != NULL)
pdevice->supported_features = *supported_features;
if (properties != NULL)
pdevice->properties = *properties;
pdevice->dispatch_table = *dispatch_table;
/* Add common entrypoints without overwriting driver-provided ones. */
+7
View File
@@ -27,6 +27,7 @@
#include "vk_extensions.h"
#include "vk_object.h"
#include "vk_physical_device_features.h"
#include "vk_physical_device_properties.h"
#include "util/list.h"
@@ -74,6 +75,11 @@ struct vk_physical_device {
*/
struct vk_features supported_features;
/** Table of all physical device properties which is initialized similarly
* to supported_features
*/
struct vk_properties properties;
/** Physical-device-level dispatch table */
struct vk_physical_device_dispatch_table dispatch_table;
@@ -125,6 +131,7 @@ 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_properties *properties,
const struct vk_physical_device_dispatch_table *dispatch_table);
/** Tears down a vk_physical_device