From 08d3b5a55fad7439b47fc93d8ba604cbeb7e19ca Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sat, 3 Sep 2022 16:31:16 +0300 Subject: [PATCH] Clear load ID when assigning to a component This prevents an issue where reading the value of the entire variable afterwards would incorrectly use the old cached load. --- source/glsl/spirv.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/glsl/spirv.cpp b/source/glsl/spirv.cpp index b2eac3f0..b86734f6 100644 --- a/source/glsl/spirv.cpp +++ b/source/glsl/spirv.cpp @@ -587,7 +587,9 @@ void SpirVGenerator::visit(VariableReference &var) if(composite_access) { r_expression_result_id = 0; - if(!assignment_source_id) + if(assignment_source_id) + variable_load_ids.erase(var.declaration); + else { auto i = variable_load_ids.find(var.declaration); if(i!=variable_load_ids.end()) -- 2.43.0