[Mesa-dev] [PATCH 09/19] st/glsl_to_tgsi: implement ARB_shader_ballot builtin functions
Nicolai Hähnle
nhaehnle at gmail.com
Fri Mar 31 17:14:09 UTC 2017
From: Nicolai Hähnle <nicolai.haehnle at amd.com>
---
src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index 7da08da..e84c61a 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -2360,20 +2360,29 @@ glsl_to_tgsi_visitor::visit_expression(ir_expression* ir, st_src_reg *op)
case ir_unop_vote_any:
emit_asm(ir, TGSI_OPCODE_VOTE_ANY, result_dst, op[0]);
break;
case ir_unop_vote_all:
emit_asm(ir, TGSI_OPCODE_VOTE_ALL, result_dst, op[0]);
break;
case ir_unop_vote_eq:
emit_asm(ir, TGSI_OPCODE_VOTE_EQ, result_dst, op[0]);
break;
+ case ir_unop_ballot:
+ emit_asm(ir, TGSI_OPCODE_BALLOT, result_dst, op[0]);
+ break;
+ case ir_unop_read_first_invocation:
+ emit_asm(ir, TGSI_OPCODE_READ_FIRST, result_dst, op[0]);
+ break;
+ case ir_binop_read_invocation:
+ emit_asm(ir, TGSI_OPCODE_READ_INVOC, result_dst, op[0], op[1]);
+ break;
case ir_unop_u2i64:
case ir_unop_u2u64:
case ir_unop_b2i64: {
st_src_reg temp = get_temp(glsl_type::uvec4_type);
st_dst_reg temp_dst = st_dst_reg(temp);
unsigned orig_swz = op[0].swizzle;
/*
* To convert unsigned to 64-bit:
* zero Y channel, copy X channel.
*/
--
2.9.3
More information about the mesa-dev
mailing list