mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 02:38:04 +02:00
zink: hook zink_device_info.py to build system
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com> Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6789>
This commit is contained in:
parent
f1432fd3e2
commit
0ed17a212c
3 changed files with 26 additions and 1 deletions
|
|
@ -39,6 +39,15 @@ files_libzink = files(
|
|||
'zink_surface.c',
|
||||
)
|
||||
|
||||
zink_device_info = custom_target(
|
||||
'zink_device_info.c',
|
||||
input : ['zink_device_info.py'],
|
||||
output : ['zink_device_info.h', 'zink_device_info.c'],
|
||||
command : [
|
||||
prog_python, '@INPUT@', '@OUTPUT@'
|
||||
]
|
||||
)
|
||||
|
||||
zink_nir_algebraic_c = custom_target(
|
||||
'zink_nir_algebraic.c',
|
||||
input : 'nir_to_spirv/zink_nir_algebraic.py',
|
||||
|
|
@ -53,7 +62,7 @@ zink_nir_algebraic_c = custom_target(
|
|||
|
||||
libzink = static_library(
|
||||
'zink',
|
||||
[files_libzink, zink_nir_algebraic_c],
|
||||
[files_libzink, zink_device_info, zink_nir_algebraic_c],
|
||||
gnu_symbol_visibility : 'hidden',
|
||||
include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux],
|
||||
dependencies: [dep_vulkan, idep_nir_headers],
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@
|
|||
|
||||
#include "zink_compiler.h"
|
||||
#include "zink_context.h"
|
||||
#include "zink_device_info.h"
|
||||
#include "zink_fence.h"
|
||||
#include "zink_public.h"
|
||||
#include "zink_resource.h"
|
||||
|
|
@ -974,6 +975,17 @@ zink_internal_create_screen(struct sw_winsys *winsys, int fd)
|
|||
|
||||
dci.ppEnabledExtensionNames = extensions;
|
||||
dci.enabledExtensionCount = num_extensions;
|
||||
|
||||
if (!zink_get_physical_device_info(screen)) {
|
||||
debug_printf("ZINK: failed to detect features\n");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (fd >= 0 && !screen->info.have_KHR_external_memory_fd) {
|
||||
debug_printf("ZINK: KHR_external_memory_fd required!\n");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (vkCreateDevice(screen->pdev, &dci, NULL, &screen->dev) != VK_SUCCESS)
|
||||
goto fail;
|
||||
|
||||
|
|
|
|||
|
|
@ -24,6 +24,8 @@
|
|||
#ifndef ZINK_SCREEN_H
|
||||
#define ZINK_SCREEN_H
|
||||
|
||||
#include "zink_device_info.h"
|
||||
|
||||
#include "pipe/p_screen.h"
|
||||
#include "util/slab.h"
|
||||
|
||||
|
|
@ -45,6 +47,8 @@ struct zink_screen {
|
|||
VkInstance instance;
|
||||
VkPhysicalDevice pdev;
|
||||
|
||||
struct zink_device_info info;
|
||||
|
||||
VkPhysicalDeviceProperties props;
|
||||
VkPhysicalDeviceFeatures feats;
|
||||
VkPhysicalDeviceMemoryProperties mem_props;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue