From 8107f80b7f3a48ebd6a048243d697c40e19722a9 Mon Sep 17 00:00:00 2001 From: Jim Blandy Date: Sun, 24 Mar 2024 13:47:39 -0700 Subject: [PATCH] [naga] Tweak comments in `ConstantEvaluator::try_eval_and_append`. I found I needed a little bit more detail here. --- naga/src/proc/constant_evaluator.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/naga/src/proc/constant_evaluator.rs b/naga/src/proc/constant_evaluator.rs index f1f01e5855..547fbbc652 100644 --- a/naga/src/proc/constant_evaluator.rs +++ b/naga/src/proc/constant_evaluator.rs @@ -713,7 +713,10 @@ impl<'a> ConstantEvaluator<'a> { match self.expression_kind_tracker.type_of_with_expr(&expr) { ExpressionKind::Const => { let eval_result = self.try_eval_and_append_impl(&expr, span); - // avoid errors on unimplemented functionality if possible + // We should be able to evaluate `Const` expressions at this + // point. If we failed to, then that probably means we just + // haven't implemented that part of constant evaluation. Work + // around this by simply emitting it as a run-time expression. if self.behavior.has_runtime_restrictions() && matches!( eval_result,