mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-04-07 01:42:04 +00:00
[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:
parent
2c7a6c8a87
commit
c6e98107ba
1 changed files with 8 additions and 0 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue