mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-04-16 06:11:15 +00:00
[qfcc] Add constexpr initializers to the ctor list
So far, this affects only glsl (because only glsl marks expressions as constexpr), but it does get specialization constant initializers for global variables working.
This commit is contained in:
parent
f73e1bf353
commit
5a9ef35199
1 changed files with 3 additions and 0 deletions
|
@ -637,6 +637,9 @@ initialize_def (symbol_t *sym, const expr_t *init, defspace_t *space,
|
|||
init = assign_expr (new_symbol_expr (sym), init);
|
||||
// fold_constants takes care of int/float conversions
|
||||
append_expr (local_expr, fold_constants (init));
|
||||
} else if (is_constexpr (init)) {
|
||||
init = assign_expr (new_symbol_expr (sym), init);
|
||||
add_ctor_expr (init);
|
||||
} else {
|
||||
if (!is_constant (init)) {
|
||||
error (init, "non-constant initializier");
|
||||
|
|
Loading…
Reference in a new issue