From 57f24299b7fe0f7b20c2a3cf1e94c747825b568d Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Mon, 20 Apr 2015 10:16:55 +1000 Subject: 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 Reviewed-by: Chris Forbes Signed-off-by: Dave Airlie tests: fix warnings --- src/glsl/ir.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/glsl/ir.cpp') diff --git a/src/glsl/ir.cpp b/src/glsl/ir.cpp index 8fb7ca40cf1..fa1d85a5026 100644 --- a/src/glsl/ir.cpp +++ b/src/glsl/ir.cpp @@ -260,6 +260,7 @@ ir_expression::ir_expression(int op, ir_rvalue *op0) case ir_unop_bit_count: case ir_unop_find_msb: case ir_unop_find_lsb: + case ir_unop_subroutine_to_int: this->type = glsl_type::get_instance(GLSL_TYPE_INT, op0->type->vector_elements, 1); break; @@ -568,6 +569,7 @@ static const char *const operator_strs[] = { "frexp_sig", "frexp_exp", "noise", + "subroutine_to_int", "interpolate_at_centroid", "+", "-", -- cgit v1.2.3