summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2015-04-20 10:16:55 +1000
committerDave Airlie <[email protected]>2015-07-23 17:25:25 +1000
commit57f24299b7fe0f7b20c2a3cf1e94c747825b568d (patch)
treec2de7c35d3d0eefe644110fa5f106d23010ba12b /src/mesa
parentd16ff8ac783874c8ee74ef796b1c853829ff237d (diff)
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 <[email protected]> Reviewed-by: Chris Forbes <[email protected]> Signed-off-by: Dave Airlie <[email protected]> tests: fix warnings
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/state_tracker/st_glsl_to_tgsi.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index b0fc6254edb..9553791b07a 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -1108,6 +1108,7 @@ type_size(const struct glsl_type *type)
return size;
case GLSL_TYPE_SAMPLER:
case GLSL_TYPE_IMAGE:
+ case GLSL_TYPE_SUBROUTINE:
/* Samplers take up one slot in UNIFORMS[], but they're baked in
* at link time.
*/
@@ -1488,6 +1489,9 @@ glsl_to_tgsi_visitor::visit(ir_expression *ir)
result_src = op[0];
}
break;
+ case ir_unop_subroutine_to_int:
+ emit_asm(ir, TGSI_OPCODE_MOV, result_dst, op[0]);
+ break;
case ir_unop_abs:
emit_asm(ir, TGSI_OPCODE_ABS, result_dst, op[0]);
break;