[Mesa-dev] [PATCH] i965: Avoid dependency hints on math opcodes

Mike Stroyan mike at lunarg.com
Fri Feb 21 10:30:52 PST 2014


Matt,

  I still see the math instructions as the troublemakers.  The NoDDChk bit
is about write hazards and should not disable checking for read hazards.

  Here is a slightly changed shader test that avoids using NoDDChk on the
instruction that consumes the result of the 'math exp' instructions.  The
only difference between the shaders when applying my patch is the presence
of NoDDChk and NoDDClr on the math instructions.  And the z channel still
gets almost always incorrect results when NoDDChk is used.



On Thu, Feb 20, 2014 at 7:52 PM, Matt Turner <mattst88 at gmail.com> wrote:

> On Thu, Feb 20, 2014 at 4:55 PM, Mike Stroyan <mike at lunarg.com> wrote:
> > Ian,
> >
> >   Here is a shader_test version.  It lacks the sparkling uncertainty of
> the
> > pixel values in the previous animated example program.
> > It just gets all vertices uniformly wrong when I run it.
>
> Thanks for the test Mike. I reproduced it locally.
>
> Comparing the vertex shader assembly before and after your patch, I
> get the attached diff.
>
> The good news is that it doesn't look like the math instructions'
> dependency control flags are broken. The bad news is that our
> dependency control optimization has a bug. :)
>
> After three math exp instructions write to g8.{x,y,z}, we mov.sat
> g8.xyz into g116.xyz which we use as a message register. The problem
> is that we wrote a 1.0 into g116.w before the exp instructions, and
> the dependency control optimization code recognized that the write to
> g116.xyz would stall waiting for the write to g116.w and marked the
> instructions with NoDDClr/NoDDChk. Unfortunately, marking the write to
> g116.xyz with NoDDChk means that the instruction doesn't wait on the
> writes to g8 to complete either!
>



-- 

 Mike Stroyan - Software Architect
 LunarG, Inc.  - The Graphics Experts
 Cell:  (970) 219-7905
 Email: Mike at LunarG.com
 Website: http://www.lunarg.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20140221/c4ecb124/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: newer-glsl-vs-math-dependency.shader_test
Type: application/octet-stream
Size: 2030 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20140221/c4ecb124/attachment-0003.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: DD_hinted_math_vs
Type: application/octet-stream
Size: 28978 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20140221/c4ecb124/attachment-0004.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: DD_no_hinted_math_vs
Type: application/octet-stream
Size: 28649 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20140221/c4ecb124/attachment-0005.obj>


More information about the mesa-dev mailing list