Khronos Public Bugzilla
Bug 599 - Implement conformance test for a OSX Bug regarding branches in vertex shaders
Implement conformance test for a OSX Bug regarding branches in vertex shaders
Status: NEW
Product: WebGL
Classification: Unclassified
Component: Conformance Tests
unspecified
Macintosh Mac OS
: P3 normal
: ---
Assigned To: 3dweb Working Group email alias
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-02-22 13:57 PST by Roy Williams
Modified: 2013-09-27 16:39 PDT (History)
2 users (show)

See Also:


Attachments
Patch adding test case for branches inside of vertex shaders. (4.32 KB, patch)
2012-02-22 13:58 PST, Roy Williams
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Roy Williams 2012-02-22 13:57:50 PST
Regarding Apple Bug ID 10417088

There was a bug with the latest Mac Book Airs that was recently fixed that caused Google MapsGL to fail.  If there was a branch inside of a vertex shader, the addition step of a Multiply and Add (MAD) operation could get skipped under a very specific set of circumstances:

<Constant> * <built in function(<local float variable>)> + <Parameter to function>

This will only be triggered if the parameter to the function was originally a uniform.

Here is a concrete example:

attribute vec3 aPosition;
uniform float redIntensity;

varying vec4 vColor;

float MADBug(float paramValue) {
  float localVar = 1.0;
  return 0.25 * ceil(localVar) + paramValue;
}

void main(void) {
    float condition = 42.;
    if (condition == 0.) {}
    gl_Position = vec4(aPosition, 1.0);
    vColor = vec4(MADBug(redIntensity), 0., 0., 1.);
}
Comment 1 Roy Williams 2012-02-22 13:58:35 PST
Created attachment 103 [details]
Patch adding test case for branches inside of vertex shaders.
Comment 2 Gregg Tavares 2012-02-22 14:22:04 PST
lgtm. You want me to commit it?
Comment 3 Roy Williams 2012-02-22 14:33:18 PST
Yeah, that'd be great if you could commit it.  Thanks Gregg!