From a616fbd7aa2d21e670f5bb02c588eb17ef41436a Mon Sep 17 00:00:00 2001 From: Mike Stroyan Date: Wed, 12 Feb 2014 17:24:55 -0700 Subject: [PATCH] i965: Avoid dependency hints on math opcodes Putting NoDDClr and NoDDChk dependency control on instruction sequences that include math opcodes can cause corruption of channels. Treat math opcodes like send opcodes and suppress dependency hinting. Signed-off-by: Mike Stroyan Tested-by: Tony Bertapelli Cc: mesa-stable@lists.freedesktop.org Reviewed-by: Matt Turner (cherry picked from commit 602510395a96a1f6ca29189e4f5cfb3f07f21d23) --- src/mesa/drivers/dri/i965/brw_vec4.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/mesa/drivers/dri/i965/brw_vec4.cpp b/src/mesa/drivers/dri/i965/brw_vec4.cpp index d566ea16246..0ce5fbfb3fe 100644 --- a/src/mesa/drivers/dri/i965/brw_vec4.cpp +++ b/src/mesa/drivers/dri/i965/brw_vec4.cpp @@ -717,6 +717,14 @@ vec4_visitor::opt_set_dependency_control() continue; } + /* Dependency control does not work well over math instructions. + */ + if (inst->is_math()) { + memset(last_grf_write, 0, sizeof(last_grf_write)); + memset(last_mrf_write, 0, sizeof(last_mrf_write)); + continue; + } + /* Now, see if we can do dependency control for this instruction * against a previous one writing to its destination. */