[Mesa-dev] [PATCH] i965: Use a UW source type for CS_OPCODE_CS_TERMINATE.

Kenneth Graunke kenneth at whitecape.org
Tue Jan 24 22:18:07 UTC 2017


SIMD16 compute shaders use a send(16) with mlen 1 for the EOT message,
using a source of g127 for the single register.  With a UD type, this
supposedly could read g128, which doesn't exist, causing the simulator
to get cranky.  Use a UW type to avoid this.

Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
---
 src/mesa/drivers/dri/i965/brw_fs_visitor.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
index cea38d86237..97420586d71 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
@@ -814,7 +814,8 @@ fs_visitor::emit_cs_terminate()
 
    /* Send a message to the thread spawner to terminate the thread. */
    fs_inst *inst = bld.exec_all()
-                      .emit(CS_OPCODE_CS_TERMINATE, reg_undef, payload);
+                      .emit(CS_OPCODE_CS_TERMINATE, reg_undef,
+                            retype(payload, BRW_REGISTER_TYPE_UW));
    inst->eot = true;
 }
 
-- 
2.11.0



More information about the mesa-dev mailing list