Commit 246ee04f authored by Niklas Haas's avatar Niklas Haas
Browse files

meson: simplify shaderc check

`meson.pc` has existed since 2 years ago. We really longer need to
manually cc.find_library() this. Also, that performance optimization
level exists since v2018.0.

I think 2 years is a good time to relax this stuff, especially after a
major release.
parent 0b903f07
......@@ -7,6 +7,7 @@ test_deps = []
vulkan = dependency('vulkan', version: '>=1.0.42', required: get_option('vulkan'))
opengl = dependency('epoxy', version: '>=1.4.0', required: get_option('opengl'))
shaderc = dependency('shaderc', version: '>=2018.0', required: get_option('shaderc'))
# configuration data
conf_public = configuration_data()
......@@ -23,27 +24,6 @@ if opengl.found()
endif
endif
# work-arounds for shaderc braindeath
shaderc_names = [
'shaderc_shared',
'shaderc_combined',
]
shaderc = disabler()
foreach n : shaderc_names
if not shaderc.found()
shaderc = cc.find_library(n, required: get_option('shaderc'))
endif
endforeach
if shaderc.found()
conf_internal.set('SHADERC_HAS_PERF', cc.has_header_symbol(
'shaderc/shaderc.h',
'shaderc_optimization_level_performance',
dependencies: shaderc,
))
endif
# work-arounds for glslang braindeath
glslang_combined = disabler()
glslang_min_ver = '>=0.0.2763'
......
......@@ -48,14 +48,8 @@ static struct spirv_compiler *shaderc_create(struct pl_context *ctx,
if (!p->opts)
goto error;
#ifdef SHADERC_HAS_PERF
shaderc_compile_options_set_optimization_level(p->opts,
shaderc_optimization_level_performance);
#else
shaderc_compile_options_set_optimization_level(p->opts,
shaderc_optimization_level_size);
#endif
shaderc_compile_options_set_target_env(p->opts,
shaderc_target_env_vulkan,
api_version);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment