Clear spirv vector before generating spirv output

This makes spir-v generation idempotent.
This commit is contained in:
Bjorn 2024-02-14 16:44:34 -08:00 committed by GitHub
parent 7a2a1623d8
commit d84255296c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -95,6 +95,8 @@ GLSLANG_EXPORT void glslang_program_SPIRV_generate_with_options(glslang_program_
const glslang::TIntermediate* intermediate = program->program->getIntermediate(c_shader_stage(stage));
program->spirv.clear();
glslang::GlslangToSpv(*intermediate, program->spirv, &logger, reinterpret_cast<glslang::SpvOptions*>(spv_options));
program->loggerMessages = logger.getAllMessages();