mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-02-25 05:01:24 +00:00
[qfcc] Declare block instance arrays correctly
I think this was broken by the deferred type processing, but now my geometry shaders try to emit code (fail due to missing function definitions).
This commit is contained in:
parent
3e32ce4caf
commit
7bbe0d991b
1 changed files with 7 additions and 3 deletions
|
@ -157,8 +157,7 @@ glsl_declare_block_instance (glsl_block_t *block, symbol_t *instance_name)
|
|||
transparent = true;
|
||||
}
|
||||
block->instance_name = instance_name;
|
||||
auto type = new_type ();
|
||||
*type = (type_t) {
|
||||
type_t type = {
|
||||
.type = ev_invalid,
|
||||
.name = save_string (va (0, "blk %s", block->name->name)),
|
||||
.alignment = 4,
|
||||
|
@ -167,11 +166,16 @@ glsl_declare_block_instance (glsl_block_t *block, symbol_t *instance_name)
|
|||
.meta = ty_struct,
|
||||
.symtab = block->members,
|
||||
};
|
||||
auto inst_type = find_type (&type);
|
||||
specifier_t spec = {
|
||||
.sym = instance_name,
|
||||
.storage = glsl_sc_from_iftype (block->interface),
|
||||
};
|
||||
spec.sym->type = find_type (type);
|
||||
if (spec.sym->type) {
|
||||
inst_type = append_type (spec.sym->type, inst_type);
|
||||
inst_type = find_type (inst_type);
|
||||
}
|
||||
spec.sym->type = inst_type;
|
||||
auto symtab = current_symtab;// FIXME
|
||||
current_target.declare_sym (spec, nullptr, symtab, nullptr);
|
||||
|
||||
|
|
Loading…
Reference in a new issue