Skip to content

Commit 4a50d1e

Browse files
committed
Fix SPIR-V cache breaking when previous cache was read partially
1 parent 800c62b commit 4a50d1e

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

source/effect_codegen_spirv.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -382,12 +382,14 @@ class codegen_spirv final : public codegen
382382
if (entry_point == nullptr)
383383
return false;
384384

385+
spirv.clear();
386+
387+
finalize_header_section(spirv);
388+
385389
// Build list of IDs to remove
386390
std::vector<spv::Id> variables_to_remove;
387391
std::vector<spv::Id> functions_to_remove;
388392

389-
finalize_header_section(spirv);
390-
391393
// The entry point and execution mode declaration
392394
for (const spirv_instruction &inst : _entries.instructions)
393395
{

source/runtime.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1900,6 +1900,9 @@ bool reshade::runtime::load_effect(const std::filesystem::path &source_file, con
19001900
}
19011901
else
19021902
{
1903+
cso.clear();
1904+
assembly.clear();
1905+
19031906
if (!codegen->assemble_code_for_entry_point(entry_point.first, cso, assembly, errors))
19041907
{
19051908
compiled = false;

0 commit comments

Comments
 (0)