[Mesa-dev] [PATCH] i965: Avoid dependency hints on math opcodes
Jordan Justen
jljusten at gmail.com
Sun Feb 23 18:13:27 PST 2014
On Wed, Feb 12, 2014 at 9:25 PM, Ian Romanick <idr at freedesktop.org> wrote:
> On 02/12/2014 06:59 PM, Matt Turner wrote:
>> On Wed, Feb 12, 2014 at 4:24 PM, <mike at lunarg.com> wrote:
>>> From: Mike Stroyan <mike at LunarG.com>
>>>
>>> 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 <mike at LunarG.com>
>>> Tested-by: Tony Bertapelli <anthony.p.bertapelli at intel.com>
>>> ---
>>> 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 dd23ed4..1c42ca8 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.
>>> */
>>> --
>>> 1.8.3.2
>>
>> I can't find any mention of this in the PRMs. Do we have a bug report
>> or something that this fixes?
>
> We have some code involving a lot of inversesqrt calls that I haven't
> quite turned into a shader_runner test yet... I also wonder if this
> could be related to the Dota2 too-much-specular bug, but I haven't tried
> that out yet either.
It didn't seem to help this bug:
https://bugs.freedesktop.org/show_bug.cgi?id=74700
-Jordan
More information about the mesa-dev
mailing list