From 67dfa0d9bb00f97cba290c159b592ebbaf25ef23 Mon Sep 17 00:00:00 2001 From: marcos balsa Date: Wed, 11 Dec 2024 12:27:38 +0100 Subject: [PATCH] Actually traverse the dependency chain through temporaries. Co-authored-by: Hans-Kristian Arntzen --- spirv_glsl.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spirv_glsl.cpp b/spirv_glsl.cpp index a5e8a4453..2252ae775 100644 --- a/spirv_glsl.cpp +++ b/spirv_glsl.cpp @@ -11766,10 +11766,10 @@ void CompilerGLSL::disallow_forwarding_in_expression_chain(const SPIRExpression // Allow trivially forwarded expressions like OpLoad or trivial shuffles, // these will be marked as having suppressed usage tracking. // Our only concern is to make sure arithmetic operations are done in similar ways. - if (expression_is_forwarded(expr.self) && !expression_suppresses_usage_tracking(expr.self) && - forced_invariant_temporaries.count(expr.self) == 0) + if (forced_invariant_temporaries.count(expr.self) == 0) { - force_temporary_and_recompile(expr.self); + if (!expression_suppresses_usage_tracking(expr.self)) + force_temporary_and_recompile(expr.self); forced_invariant_temporaries.insert(expr.self); for (auto &dependent : expr.invariance_dependencies)