[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mesa3d-dev
Subject:    [Mesa3d-dev] [Bug 11731] New: Bug in Mesa shader compiler affecting
From:       bugzilla-daemon () freedesktop ! org
Date:       2007-07-26 16:39:25
Message-ID: bug-11731-598 () http ! bugs ! freedesktop ! org/
[Download RAW message or body]

http://bugs.freedesktop.org/show_bug.cgi?id=11731

           Summary: Bug in Mesa shader compiler affecting operand ordering?
           Product: Mesa
           Version: CVS
          Platform: x86 (IA32)
        OS/Version: Windows (All)
            Status: NEW
          Severity: normal
          Priority: medium
         Component: Mesa core
        AssignedTo: mesa3d-dev@lists.sourceforge.net
        ReportedBy: peter.horsman@arm.com


Hi,

I've attached simlified source for the shader below, but essentially I have
found that in my fragment shader if I do:

float f = foo(i) * sin(j); // where foo() is my function: float foo(float);

I get a different result than if I did:

float f = sin(j) * foo(i); // float foo(float);

The first statement ends up drawing my test quad with a gradient in the y-axis
(wrong) but the second draws the quad with different gradients on the left and
right side of the quad (correct).

Under my ATI drivers I get the same (correct) result either way.

Am I missing something, or should the two statements result in the same value?

I tried this with a freshly-built Mesa 7.0 (built with VC8) and also grabbed
and built the latest source from GIT in case it'd been fixed - seems not.

I checked if a similar bug had been sumbitted and couldn't find one, but this
is my first time reporting a bug so please advise if I've broken any etiquette.

Cheers, Pete

---shader.frag START---
// The interpolated variables passed from the vertex shader.
varying vec2 vv2texCoord;     // The texture map's texcoords.

// Take the fractional part of the number, and
// return 1.0 if less than 0.5 else return -1.0
float step(in float a) {
  int i = int(a);
  a = a - float(i);
  if(a < 0.5) return 1.0;
  else return -1.0;
}

void main(void) {
  // Reversing the order of the multiplication changes behaviour on Mesa 7.0
  //float fI = step(vv2texCoord.x) * sin(vv2texCoord.y);
  float fI = sin(vv2texCoord.y) * step(vv2texCoord.x);
  fI = fI * 0.5 + 0.5;
  gl_FragColor = vec4(fI, fI, fI, 1.0);
}
---shader.frag END---


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

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic