mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-04-07 01:42:04 +00:00
[qfcc] Fix spir-v buffer struct copying
I had forgotten the parameters needed to be in reverse order (since constructor_expr was written as the implementation of a function call), and I had also forgotten I need to do the assignment. No more broken lights :)
This commit is contained in:
parent
c6e98107ba
commit
059936d18f
1 changed files with 5 additions and 4 deletions
|
@ -2669,15 +2669,16 @@ spirv_check_types_compatible (const expr_t *dst, const expr_t *src)
|
|||
.typ.type = dst_type,
|
||||
};
|
||||
const expr_t *param_exprs[count];
|
||||
int i = 0;
|
||||
for (ssym = src_tab->symbols; ssym; ssym = ssym->next, i++) {
|
||||
auto e = new_field_expr (src, new_name_expr (ssym->name));
|
||||
int i = count - 1;// build params in reverse for constructor_expr
|
||||
for (ssym = src_tab->symbols; ssym; ssym = ssym->next, i--) {
|
||||
auto e = new_field_expr (src, new_symbol_expr (ssym));
|
||||
e->field.type = ssym->type;
|
||||
param_exprs[i] = e;
|
||||
}
|
||||
auto params = new_list_expr (nullptr);
|
||||
list_gather (¶ms->list, param_exprs, count);
|
||||
return constructor_expr (&type_expr, params);
|
||||
auto cast = constructor_expr (&type_expr, params);
|
||||
return assign_expr (dst, cast);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
Loading…
Reference in a new issue