From: Mikko Rasa Date: Sat, 3 Sep 2022 13:31:16 +0000 (+0300) Subject: Clear load ID when assigning to a component X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=08d3b5a55fad7439b47fc93d8ba604cbeb7e19ca;p=libs%2Fgl.git 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. --- 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())