From e813fb426a18a70df09463b84a9fd3d01303665c Mon Sep 17 00:00:00 2001 From: "HuYingzhuo(hugo/hyzboy)" Date: Tue, 28 Jun 2022 21:00:59 +0800 Subject: [PATCH] supported preamble --- SPIRV-Cross | 2 +- glsl2spv.cpp | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/SPIRV-Cross b/SPIRV-Cross index 1964799..ac5524e 160000 --- a/SPIRV-Cross +++ b/SPIRV-Cross @@ -1 +1 @@ -Subproject commit 1964799fba06abcbad2ff684cba360f0067c34a2 +Subproject commit ac5524ef523e663e19493e77013873391e866340 diff --git a/glsl2spv.cpp b/glsl2spv.cpp index af6b7b3..692eea5 100644 --- a/glsl2spv.cpp +++ b/glsl2spv.cpp @@ -227,6 +227,7 @@ extern "C" const char * entrypoint; uint32_t includes_count; const char ** includes; + const char * preamble; }; enum class VertexAttribBaseType @@ -474,7 +475,7 @@ extern "C" ++sr; } } - + SPVData *Shader2SPV( const uint32_t shader_stage, const char * shader_source, @@ -508,6 +509,9 @@ extern "C" } } + if(compile_info->preamble) + shader.setPreamble(compile_info->preamble); + shaderStrings[0] = shader_source; shader.setStrings(shaderStrings, 1);