Use build in glslangValidator functionally to generate shader include

file.
This removes the xxd dependency.
This commit is contained in:
Oschowa 2020-01-28 21:30:20 +01:00
parent bc39b20a8f
commit 2a74683c11
3 changed files with 5 additions and 9 deletions

View file

@ -31,13 +31,14 @@ wlroots_proj = subproject('wlroots')
wlroots_static_dep = wlroots_proj.get_variable('wlroots_static_dep') wlroots_static_dep = wlroots_proj.get_variable('wlroots_static_dep')
shadercompiler = find_program('glslangValidator') shadercompiler = find_program('glslangValidator')
extratool = find_program('xxd')
shaderbuilder = find_program('src/shaderbuild.sh')
spirv_shader = custom_target('shader_target', spirv_shader = custom_target('shader_target',
output : 'composite.h', output : 'composite.h',
input : 'src/composite.comp.hlsl', input : 'src/composite.comp.hlsl',
command : [shaderbuilder, '@INPUT@', '@OUTPUT@'], command : [
shadercompiler, '-V', '-e', 'main', '--vn',
'composite_spv', '@INPUT@', '-o', '@OUTPUT@'
],
install : false, install : false,
) )

View file

@ -520,7 +520,7 @@ int init_device()
VkShaderModuleCreateInfo shaderModuleCreateInfo = {}; VkShaderModuleCreateInfo shaderModuleCreateInfo = {};
shaderModuleCreateInfo.sType = VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO; shaderModuleCreateInfo.sType = VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO;
shaderModuleCreateInfo.codeSize = composite_spv_len; shaderModuleCreateInfo.codeSize = sizeof(composite_spv);
shaderModuleCreateInfo.pCode = (const uint32_t*)composite_spv; shaderModuleCreateInfo.pCode = (const uint32_t*)composite_spv;
VkResult res = vkCreateShaderModule( device, &shaderModuleCreateInfo, nullptr, &shaderModule ); VkResult res = vkCreateShaderModule( device, &shaderModuleCreateInfo, nullptr, &shaderModule );

View file

@ -1,5 +0,0 @@
#!/bin/sh
glslangValidator -e main -o composite.spv -V $1
xxd -i composite.spv > $2