Add wrap dependency for vulkan headers
Don't expect the vulkan headers to be present on the development system. Instead, download the using meson wrap. Signed-off-by: Piotr Krygier <piotrkrygier@everyonecancode.xyz>
This commit is contained in:
@@ -15,6 +15,8 @@ rse_graphics_sources = [
|
|||||||
'src/window.c',
|
'src/window.c',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
vulkan_headers_dep = dependency('VulkanHeaders')
|
||||||
|
|
||||||
vulkan_dep = dependency('Vulkan')
|
vulkan_dep = dependency('Vulkan')
|
||||||
|
|
||||||
sdl3_dep = dependency('sdl3', version: '>=3.4.0')
|
sdl3_dep = dependency('sdl3', version: '>=3.4.0')
|
||||||
@@ -32,6 +34,7 @@ rse_graphics_lib = shared_library(
|
|||||||
rse_graphics_sources,
|
rse_graphics_sources,
|
||||||
include_directories: ['../'],
|
include_directories: ['../'],
|
||||||
dependencies: [
|
dependencies: [
|
||||||
|
vulkan_headers_dep,
|
||||||
vulkan_dep,
|
vulkan_dep,
|
||||||
vma_dep,
|
vma_dep,
|
||||||
sdl3_dep,
|
sdl3_dep,
|
||||||
@@ -46,6 +49,7 @@ rse_graphics_lib = shared_library(
|
|||||||
rse_graphics_lib_dep = declare_dependency(
|
rse_graphics_lib_dep = declare_dependency(
|
||||||
link_with: rse_graphics_lib,
|
link_with: rse_graphics_lib,
|
||||||
dependencies: [
|
dependencies: [
|
||||||
|
vulkan_headers_dep,
|
||||||
vulkan_dep,
|
vulkan_dep,
|
||||||
vma_dep,
|
vma_dep,
|
||||||
glm_dep
|
glm_dep
|
||||||
|
|||||||
@@ -211,14 +211,14 @@ static rse_err_t create_instance(VkInstance* instance)
|
|||||||
|
|
||||||
/* Check if selected layers are supported*/
|
/* Check if selected layers are supported*/
|
||||||
for (i = 0; i < enabled_instance_layers_count; ++i) {
|
for (i = 0; i < enabled_instance_layers_count; ++i) {
|
||||||
for (j = 0; i < layersCount; ++j) {
|
for (j = 0; j < layersCount; ++j) {
|
||||||
if (strcmp(layer_properties[j].layerName, enabled_instance_layers_names[i]) == 0) {
|
if (strcmp(layer_properties[j].layerName, enabled_instance_layers_names[i]) == 0) {
|
||||||
supported = 1;
|
supported = 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (supported == 0) {
|
if (supported == 0) {
|
||||||
SDL_LogCritical(SDL_LOG_CATEGORY_GPU, "Selected layer is not supported: %s", layer_properties[j].layerName);
|
SDL_LogCritical(SDL_LOG_CATEGORY_GPU, "Selected layer is not supported: %s", enabled_instance_layers_names[i]);
|
||||||
return RSE_ERROR_INTERNAL_ERROR;
|
return RSE_ERROR_INTERNAL_ERROR;
|
||||||
}
|
}
|
||||||
supported = 0;
|
supported = 0;
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
project(
|
||||||
|
'vulkan-headers',
|
||||||
|
'c',
|
||||||
|
license: 'Apache-2.0',
|
||||||
|
version: '1.4.353',
|
||||||
|
meson_version: '>=0.56.0',
|
||||||
|
)
|
||||||
|
|
||||||
|
vulkan_api_xml = files('registry/vk.xml')
|
||||||
|
|
||||||
|
vulkan_headers_dep = declare_dependency(
|
||||||
|
include_directories: include_directories('include'),
|
||||||
|
)
|
||||||
|
|
||||||
|
meson.override_dependency('VulkanHeaders', vulkan_headers_dep)
|
||||||
@@ -1,14 +1,9 @@
|
|||||||
[wrap-file]
|
[wrap-file]
|
||||||
directory = Vulkan-Headers-1.4.346
|
directory = Vulkan-Headers-1.4.353
|
||||||
source_url = https://github.com/KhronosGroup/Vulkan-Headers/archive/v1.4.346.tar.gz
|
source_url = https://github.com/KhronosGroup/Vulkan-Headers/archive/v1.4.353.tar.gz
|
||||||
source_filename = vulkan-headers-1.4.346.tar.gz
|
source_filename = vulkan-headers-1.4.353.tar.gz
|
||||||
source_hash = 5bb77f5d7b460e255a9e51affc00d64354986b55cf577d8eab28529cad01fc80
|
source_hash = aead572dd86def896eddac84cb31acb4ede28e3ac1ab97439d6ddd1b5a14d38e
|
||||||
source_fallback_url = https://wrapdb.mesonbuild.com/v2/vulkan-headers_1.4.346-1/get_source/vulkan-headers-1.4.346.tar.gz
|
patch_directory = vulkan_headers/
|
||||||
patch_filename = vulkan-headers_1.4.346-1_patch.zip
|
|
||||||
patch_url = https://wrapdb.mesonbuild.com/v2/vulkan-headers_1.4.346-1/get_patch
|
|
||||||
patch_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/vulkan-headers_1.4.346-1/vulkan-headers_1.4.346-1_patch.zip
|
|
||||||
patch_hash = b85cbf6793193b28c5bd80858308b214816e66041b10ec00f0115b19f3a7a60e
|
|
||||||
wrapdb_version = 1.4.346-1
|
|
||||||
|
|
||||||
[provide]
|
[provide]
|
||||||
dependency_names = VulkanHeaders
|
dependency_names = VulkanHeaders
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
[wrap-file]
|
|
||||||
directory = Vulkan-ValidationLayers-1.2.158
|
|
||||||
source_url = https://github.com/KhronosGroup/Vulkan-ValidationLayers/archive/v1.2.158.tar.gz
|
|
||||||
source_filename = vulkan-validationlayers-1.2.158.tar.gz
|
|
||||||
source_hash = 9d7a6eba2db88b8af6457acce0b638324ca03cde2e9589ae96749114091c6e9e
|
|
||||||
patch_url = https://wrapdb.mesonbuild.com/v2/vulkan-validationlayers_1.2.158-2/get_patch
|
|
||||||
patch_filename = vulkan-validationlayers-1.2.158-2-wrap.zip
|
|
||||||
patch_hash = d38dae45ca6a7124ee8df045a8d5288390ab836b4d28c53234f90baee5c649fc
|
|
||||||
|
|
||||||
@@ -132,7 +132,7 @@ rse_err_t file_read_bytes(const char* file_name, size_t* bytes_count, unsigned c
|
|||||||
SDL_LogCritical(SDL_LOG_CATEGORY_APPLICATION, "Failed to open file for read: %s", real_path);
|
SDL_LogCritical(SDL_LOG_CATEGORY_APPLICATION, "Failed to open file for read: %s", real_path);
|
||||||
ret = RSE_ERROR_INTERNAL_ERROR;
|
ret = RSE_ERROR_INTERNAL_ERROR;
|
||||||
|
|
||||||
goto file_close;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
fseek(file, 0, SEEK_END);
|
fseek(file, 0, SEEK_END);
|
||||||
|
|||||||
Reference in New Issue
Block a user