]> git.tdb.fi Git - libs/gl.git/commitdiff
Clear load ID when assigning to a component
authorMikko Rasa <tdb@tdb.fi>
Sat, 3 Sep 2022 13:31:16 +0000 (16:31 +0300)
committerMikko Rasa <tdb@tdb.fi>
Sat, 3 Sep 2022 13:38:44 +0000 (16:38 +0300)
This prevents an issue where reading the value of the entire variable
afterwards would incorrectly use the old cached load.

source/glsl/spirv.cpp

index b2eac3f0fe1925b11cc586e3e3485d19735ca388..b86734f623365e1724a8ec430d33d0cc5e67fbdf 100644 (file)
@@ -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())