Skip to content

Commit 012eb15

Browse files
Merge pull request #95 from Mesonnaise/master
Fixed the quatifier and label problem assocated with bake_spirv_by_sw…
2 parents ae637fb + 917da99 commit 012eb15

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

include/misc/glsl_to_spirv.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ namespace Anvil
332332
EShLanguage get_glslang_shader_stage () const;
333333
#else
334334
bool bake_spirv_blob_by_spawning_glslang_process(const std::string& in_glsl_filename_with_path,
335-
const std::string& in_spirv_filename_with_path);
335+
const std::string& in_spirv_filename_with_path) const;
336336
#endif
337337

338338
/* Private members */

src/misc/glsl_to_spirv.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -553,14 +553,19 @@ bool Anvil::GLSLShaderToSPIRVGenerator::bake_spirv_blob() const
553553
result = bake_spirv_blob_by_calling_glslang(m_glsl_source_code.c_str() );
554554
}
555555
}
556+
556557
#else
557558
{
558559
/* We need to point glslangvalidator at a location where it can stash the SPIR-V blob. */
559560
result = bake_spirv_blob_by_spawning_glslang_process(glsl_filename_with_path,
560561
"temp.spv");
561562
}
563+
564+
end:
562565
#endif
563566

567+
568+
564569
return result;
565570
}
566571

@@ -722,12 +727,13 @@ bool Anvil::GLSLShaderToSPIRVGenerator::bake_spirv_blob() const
722727
* @return true if successful, false otherwise.
723728
**/
724729
bool Anvil::GLSLShaderToSPIRVGenerator::bake_spirv_blob_by_spawning_glslang_process(const std::string& in_glsl_filename_with_path,
725-
const std::string& in_spirv_filename_with_path)
730+
const std::string& in_spirv_filename_with_path) const
726731
{
727732
auto callback_arg = OnGLSLToSPIRVConversionAboutToBeStartedCallbackArgument(this);
728733
std::string glslangvalidator_params;
729734
bool result = false;
730735
size_t spirv_file_size = 0;
736+
char* spirv_blob_ptr = nullptr;
731737

732738
callback(GLSL_SHADER_TO_SPIRV_GENERATOR_CALLBACK_ID_CONVERSION_ABOUT_TO_START,
733739
&callback_arg);
@@ -818,7 +824,7 @@ bool Anvil::GLSLShaderToSPIRVGenerator::bake_spirv_blob() const
818824
#endif
819825

820826
/* Now, read the SPIR-V file contents */
821-
char* spirv_blob_ptr = nullptr;
827+
822828

823829
Anvil::IO::read_file(in_spirv_filename_with_path.c_str(),
824830
false, /* is_text_file */

0 commit comments

Comments
 (0)