mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-02-25 05:01:24 +00:00
[qfcc] Set struct member ids
The id matches the member's order in the struct's fields (needed for spir-v access chains).
This commit is contained in:
parent
14f428a81d
commit
52d38ce8a6
1 changed files with 4 additions and 0 deletions
|
@ -171,6 +171,7 @@ build_struct (int su, symbol_t *tag, symtab_t *symtab, const type_t *type,
|
|||
error (0, "%s defined as wrong kind of tag", tag->name);
|
||||
return sym;
|
||||
}
|
||||
int index = 0;
|
||||
for (s = symtab->symbols; s; s = s->next) {
|
||||
if (s->sy_type != sy_offset)
|
||||
continue;
|
||||
|
@ -214,10 +215,13 @@ build_struct (int su, symbol_t *tag, symtab_t *symtab, const type_t *type,
|
|||
s->offset += offset;
|
||||
s->table = symtab;
|
||||
s->no_auto_init = true;
|
||||
s->id = index++;
|
||||
Hash_Add (symtab->tab, s);
|
||||
}
|
||||
}
|
||||
s->next = t;
|
||||
} else {
|
||||
s->id = index++;
|
||||
}
|
||||
}
|
||||
if (!type)
|
||||
|
|
Loading…
Reference in a new issue