[qfcc] Mark non-out and non-push_constant blocks NonWritable

This is a hack until I rethink the entire glsl implementation, but it
gets my vertex shaders such that Vulkan no longer rejects them. However,
there are a couple struct related bugs (next).
This commit is contained in:
Bill Currie 2025-02-04 01:53:40 +09:00
parent 2c7a6c8a87
commit c6e98107ba

View file

@ -2442,6 +2442,14 @@ spirv_declare_sym (specifier_t spec, const expr_t *init, symtab_t *symtab,
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);
// FIXME this should be handled in the block code, but that
// needs a rethink
if (block->interface != glsl_out
&& block->interface != glsl_push_constant) {
auto attr = new_attribute ("NonWritable", nullptr);
attr->next = sym->attributes;
sym->attributes = attr;
}
}
}
if (symtab->type == stab_param || symtab->type == stab_local) {