From d2568072c71c4a07f552c4c2566daa2f25d987f5 Mon Sep 17 00:00:00 2001 From: "HuYingzhuo(hugo/hyzboy)" Date: Fri, 17 Feb 2023 12:10:14 +0800 Subject: [PATCH] fixed a bug that Init after error position. --- glsl2spv.cpp | 36 ++++++++++++++---------------------- 1 file changed, 14 insertions(+), 22 deletions(-) diff --git a/glsl2spv.cpp b/glsl2spv.cpp index f7d0c71..408c030 100644 --- a/glsl2spv.cpp +++ b/glsl2spv.cpp @@ -326,7 +326,6 @@ extern "C" uint32_t *spv_data; uint32_t spv_length; - uint32_t shader_stage; ShaderStageData input,output; ShaderResourceData resource[VK_DESCRIPTOR_TYPE_COUNT]; @@ -338,18 +337,6 @@ extern "C" memset(this,0,sizeof(SPVData)); } - void Clear() - { - for(uint32_t i=0;i &spirv) { + Init(); + result=true; log=nullptr; @@ -379,13 +368,18 @@ extern "C" spv_data=new uint32_t[spv_length]; spv_length*=sizeof(uint32_t); memcpy(spv_data,spirv.data(),spv_length); - - Init(); } ~SPVData() - { - Clear(); + { + for(uint32_t i=0;iincludes_count; i++) { includer.pushExternalLocalDirectory(compile_info->includes[i]); - } + } } if(compile_info->preamble) @@ -558,8 +552,6 @@ extern "C" glslang::GlslangToSpv(*program.getIntermediate(stage),spirv); SPVData *spv=new SPVData(spirv); - - spv->shader_stage = shader_stage; { ShaderParse sp(spirv.data(),(uint32_t)spirv.size()*sizeof(uint32_t));