[qfcc] Process attributes for blocks

And now they get their `set` and `binding` decorations so slice.vert
actually works in nq-x11 :D
This commit is contained in:
Bill Currie 2025-02-03 16:51:08 +09:00
parent d952bec679
commit de2d108e41
2 changed files with 9 additions and 1 deletions

View file

@ -999,6 +999,9 @@ layout_check_qualifier (const layout_qual_t *qual, specifier_t spec)
if (sym->table->type == stab_block) {
obj_mask = decl_member;
if_mask = get_interface_mask (sym->table->storage);
} else if (is_struct (type)
&& type_symtab (type)->type == stab_block) {
obj_mask = decl_block;
}
} else {
obj_mask = decl_block;

View file

@ -2430,13 +2430,18 @@ spirv_declare_sym (specifier_t spec, const expr_t *init, symtab_t *symtab,
}
}
auto storage = spirv_storage_class (spec.storage, sym->type);
sym->type = auto_type (sym->type, init);
auto type = auto_type (sym->type, init);
sym->type = type;
sym->type = tagged_reference_type (storage, sym->type);
sym->lvalue = !spec.is_const;
sym->sy_type = sy_var;
sym->var.storage = spec.storage;
if (sym->name[0]) {
symtab_addsymbol (symtab, sym);
if (is_struct (type) && type_symtab (type)->type == stab_block) {
auto block = (glsl_block_t *) type_symtab (type)->data;
glsl_apply_attributes (block->attributes, spec);
}
}
if (symtab->type == stab_param || symtab->type == stab_local) {
if (init) {