From 3d488354b7f92ca1dcc8f05303b3af33e8ad96c5 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Tue, 4 Feb 2025 07:38:09 +0900 Subject: [PATCH] [qfcc] Use symbol expression for constexpr symbols Prevents specialization constants from getting folded (and thus fixes the NaN normals for iqm models). --- tools/qfcc/source/expr_process.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/qfcc/source/expr_process.c b/tools/qfcc/source/expr_process.c index 6fab119d7..5981df9ad 100644 --- a/tools/qfcc/source/expr_process.c +++ b/tools/qfcc/source/expr_process.c @@ -393,6 +393,9 @@ proc_symbol (const expr_t *expr, rua_ctx_t *ctx) } sym = symtab_lookup (current_symtab, sym->name); if (sym) { + if (sym->is_constexpr) { + return new_symbol_expr (sym); + } if (sym->sy_type == sy_expr || sym->sy_type == sy_type_param) { return sym->expr; }