summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJordan Justen <jordan.l.justen@intel.com>2014-08-27 11:32:08 -0700
committerJordan Justen <jordan.l.justen@intel.com>2014-10-27 11:52:27 -0700
commit374435e6a4b38e61355da83e2f3ebcfaa0b39f69 (patch)
treebc162d2fa798ab0b864fbfb2291b9c8a8d9370b8
parente02b98c33b9fcc3261452c4f57898e459cde3e3c (diff)
i965/cs: Support CS_OPCODE_CS_TERMINATE
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
-rw-r--r--src/mesa/drivers/dri/i965/brw_defines.h5
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs.h1
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs_visitor.cpp11
-rw-r--r--src/mesa/drivers/dri/i965/brw_shader.cpp3
4 files changed, 20 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_defines.h b/src/mesa/drivers/dri/i965/brw_defines.h
index 32810bfffc..fb338575ab 100644
--- a/src/mesa/drivers/dri/i965/brw_defines.h
+++ b/src/mesa/drivers/dri/i965/brw_defines.h
@@ -1084,6 +1084,11 @@ enum opcode {
* and number of SO primitives needed.
*/
GS_OPCODE_FF_SYNC_SET_PRIMITIVES,
+
+ /**
+ * Terminate the compute shader.
+ */
+ CS_OPCODE_CS_TERMINATE,
};
enum brw_derivative_quality {
diff --git a/src/mesa/drivers/dri/i965/brw_fs.h b/src/mesa/drivers/dri/i965/brw_fs.h
index bed071803d..8c34dc6d56 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.h
+++ b/src/mesa/drivers/dri/i965/brw_fs.h
@@ -563,6 +563,7 @@ public:
fs_inst *emit_single_fb_write(fs_reg color1, fs_reg color2,
fs_reg src0_alpha, unsigned components);
void emit_fb_writes();
+ void emit_cs_terminate();
void emit_shader_time_begin();
void emit_shader_time_end();
diff --git a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
index 3fc9e39484..85c43dcd10 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
@@ -3404,6 +3404,17 @@ fs_visitor::resolve_ud_negate(fs_reg *reg)
}
void
+fs_visitor::emit_cs_terminate()
+{
+ int base_mrf = 1;
+ fs_inst *inst = emit(CS_OPCODE_CS_TERMINATE);
+ inst->base_mrf = base_mrf;
+ inst->mlen = 0;
+ inst->eot = true;
+ inst->header_present = false;
+}
+
+void
fs_visitor::resolve_bool_comparison(ir_rvalue *rvalue, fs_reg *reg)
{
assert(ctx->Const.UniformBooleanTrue == 1);
diff --git a/src/mesa/drivers/dri/i965/brw_shader.cpp b/src/mesa/drivers/dri/i965/brw_shader.cpp
index 21dcf2da0e..b843c97a9b 100644
--- a/src/mesa/drivers/dri/i965/brw_shader.cpp
+++ b/src/mesa/drivers/dri/i965/brw_shader.cpp
@@ -521,6 +521,9 @@ brw_instruction_name(enum opcode op)
case GS_OPCODE_FF_SYNC_SET_PRIMITIVES:
return "gs_ff_sync_set_primitives";
+ case CS_OPCODE_CS_TERMINATE:
+ return "cs_terminate";
+
default:
/* Yes, this leaks. It's in debug code, it should never occur, and if
* it does, you should just add the case to the list above.