glsl/types: add new subroutine type (v3.2)

This type will be used to store the name of subroutine types

as in subroutine void myfunc(void);
will store myfunc into a subroutine type.

This is required to the parser can identify a subroutine
type in a uniform decleration as a valid type, and also for
looking up the type later.

Also add contains_subroutine method.

v2: handle subroutine to int comparisons, needed
for lowering pass.
v3: do subroutine to int with it's own IR
operation to avoid hacking on asserts (Kayden)
v3.1: fix warnings in this patch, fix nir,
fix tgsi
v3.2: fixup tests

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Signed-off-by: Dave Airlie <airlied@redhat.com>

tests: fix warnings
This commit is contained in:
Dave Airlie
2015-04-20 10:16:55 +10:00
parent d16ff8ac78
commit 57f24299b7
13 changed files with 111 additions and 0 deletions

View File

@@ -59,6 +59,8 @@ type_size(const struct glsl_type *type)
size += type_size(glsl_get_struct_field(type, i));
}
return size;
case GLSL_TYPE_SUBROUTINE:
return 1;
case GLSL_TYPE_SAMPLER:
return 0;
case GLSL_TYPE_ATOMIC_UINT: