mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-23 22:00:13 +01:00
zink: introduce vk_dispatch_table
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11036>
This commit is contained in:
parent
c88eb66814
commit
ed2fb8099e
3 changed files with 25 additions and 4 deletions
|
|
@ -73,6 +73,18 @@ zink_nir_algebraic_c = custom_target(
|
|||
depend_files : nir_algebraic_py,
|
||||
)
|
||||
|
||||
zink_dispatch_table = custom_target(
|
||||
'zink_dispatch_table.c',
|
||||
input : join_paths(meson.source_root(), 'src/vulkan/util/vk_dispatch_table_gen.py'),
|
||||
output : ['zink_dispatch_table.h', 'zink_dispatch_table.c'],
|
||||
command : [
|
||||
prog_python, '@INPUT@',
|
||||
'--xml', join_paths(meson.source_root(), 'src/vulkan/registry/vk.xml'),
|
||||
'--out-h', '@OUTPUT0@',
|
||||
'--out-c', '@OUTPUT1@',
|
||||
],
|
||||
)
|
||||
|
||||
zink_c_args = []
|
||||
inc_zink_vk = []
|
||||
|
||||
|
|
@ -89,7 +101,7 @@ endif
|
|||
|
||||
libzink = static_library(
|
||||
'zink',
|
||||
[files_libzink, zink_device_info, zink_instance, zink_nir_algebraic_c],
|
||||
[files_libzink, zink_device_info, zink_instance, zink_nir_algebraic_c, zink_dispatch_table],
|
||||
gnu_symbol_visibility : 'hidden',
|
||||
include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux, inc_vulkan_wsi, inc_vulkan_util, inc_zink_vk],
|
||||
dependencies: [dep_vulkan, idep_nir_headers, idep_mesautil],
|
||||
|
|
|
|||
|
|
@ -1664,6 +1664,12 @@ zink_internal_create_screen(const struct pipe_screen_config *config)
|
|||
if (!screen->instance)
|
||||
goto fail;
|
||||
|
||||
vk_instance_dispatch_table_load(&screen->vk.instance, &vkGetInstanceProcAddr, screen->instance);
|
||||
vk_physical_device_dispatch_table_load(&screen->vk.physical_device, &vkGetInstanceProcAddr, screen->instance);
|
||||
|
||||
if (!zink_load_instance_extensions(screen))
|
||||
goto fail;
|
||||
|
||||
if (screen->instance_info.have_EXT_debug_utils &&
|
||||
(zink_debug & ZINK_DEBUG_VALIDATION) && !create_debug(screen))
|
||||
debug_printf("ZINK: failed to setup debug utils\n");
|
||||
|
|
@ -1679,9 +1685,6 @@ zink_internal_create_screen(const struct pipe_screen_config *config)
|
|||
screen->have_D24_UNORM_S8_UINT = zink_is_depth_format_supported(screen,
|
||||
VK_FORMAT_D24_UNORM_S8_UINT);
|
||||
|
||||
if (!zink_load_instance_extensions(screen))
|
||||
goto fail;
|
||||
|
||||
if (!zink_get_physical_device_info(screen)) {
|
||||
debug_printf("ZINK: failed to detect features\n");
|
||||
goto fail;
|
||||
|
|
@ -1703,9 +1706,12 @@ zink_internal_create_screen(const struct pipe_screen_config *config)
|
|||
screen->info.driver_props.driverID == VK_DRIVER_ID_AMD_PROPRIETARY)
|
||||
/* this has bad perf on AMD */
|
||||
screen->info.have_KHR_push_descriptor = false;
|
||||
|
||||
if (!load_device_extensions(screen))
|
||||
goto fail;
|
||||
|
||||
vk_device_dispatch_table_load(&screen->vk.device, &vkGetDeviceProcAddr, screen->dev);
|
||||
|
||||
check_base_requirements(screen);
|
||||
|
||||
screen->base.get_name = zink_get_name;
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@
|
|||
|
||||
#include "zink_device_info.h"
|
||||
#include "zink_instance.h"
|
||||
#include "zink_dispatch_table.h"
|
||||
|
||||
#include "util/u_idalloc.h"
|
||||
#include "pipe/p_screen.h"
|
||||
|
|
@ -114,6 +115,8 @@ struct zink_screen {
|
|||
bool needs_mesa_wsi;
|
||||
bool needs_mesa_flush_wsi;
|
||||
|
||||
struct vk_dispatch_table vk;
|
||||
|
||||
PFN_vkGetPhysicalDeviceFeatures2 vk_GetPhysicalDeviceFeatures2;
|
||||
PFN_vkGetPhysicalDeviceProperties2 vk_GetPhysicalDeviceProperties2;
|
||||
PFN_vkGetPhysicalDeviceFormatProperties2 vk_GetPhysicalDeviceFormatProperties2;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue