mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-04-08 02:12:17 +00:00
[qfcc] Ensure in and out blocks are distinct
This fixes the tangled gl_PerVertex in geometry shaders. Other block types aren't a concern as they're all user-specified and required to have unique names (though I do suspect I did in and out incorrectly, but that's for another day).
This commit is contained in:
parent
c0d0c71a7c
commit
7c0f7c7bec
1 changed files with 8 additions and 1 deletions
|
@ -257,6 +257,13 @@ glsl_declare_block_instance (glsl_block_t *block, symbol_t *instance_name)
|
|||
auto interface = interface_sym->namespace;
|
||||
bool transparent = false;
|
||||
|
||||
const char *tag = "blk";
|
||||
if (block->interface == glsl_in) {
|
||||
tag = "ibk";
|
||||
} else if (block->interface == glsl_out) {
|
||||
tag = "obk";
|
||||
}
|
||||
|
||||
if (!instance_name) {
|
||||
instance_name = new_symbol (va (0, ".%s", block->name->name));
|
||||
transparent = true;
|
||||
|
@ -264,7 +271,7 @@ glsl_declare_block_instance (glsl_block_t *block, symbol_t *instance_name)
|
|||
block->instance_name = instance_name;
|
||||
type_t type = {
|
||||
.type = ev_invalid,
|
||||
.name = save_string (va (0, "blk %s", block->name->name)),
|
||||
.name = save_string (va (0, "%s %s", tag, block->name->name)),
|
||||
.alignment = 4,
|
||||
.width = 1,
|
||||
.columns = 1,
|
||||
|
|
Loading…
Reference in a new issue