[Mesa-dev] [Bug 29199] New: Using negation as an argument to a shader function sometimes negates twice

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Wed Jul 21 11:40:04 PDT 2010


https://bugs.freedesktop.org/show_bug.cgi?id=29199

           Summary: Using negation as an argument to a shader function
                    sometimes negates twice
           Product: Mesa
           Version: git
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: medium
         Component: Mesa core
        AssignedTo: mesa-dev at lists.freedesktop.org
        ReportedBy: neil at linux.intel.com


In some situations (I'm not exactly sure what) if you use the unary negate
operator in one of the arguments to a function then Mesa generates opcodes
which do the negation twice (once in a MOV and once as part of a swizzle).

For example, something like this:

vec3 vec_a;
vec3 vec_b;

/* .... */

float result = dot(-vec_a, vec_b);

generates the following instructions:

MOV TEMP[1].xyz, TEMP[1].-x-y-z-w;           <-- negation once with MOV
MOV (-1 -0 -0 -0)
DP3 TEMP[0].w, TEMP[1].-x-y-z-w, UNIFORM[1]; <-- negation again with swizzle
DP3 -1 = (1 0 0) . (-1 0 0)

Attached is a test for piglit.

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the mesa-dev mailing list