devwaker / angleproject

Automatically exported from code.google.com/p/angleproject
Other
0 stars 0 forks source link

D3D9 Compiler optimization bug causes issues with short-circuiting #486

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Problematic pixel shader:

precision highp float;
varying float varA;
void main(void) {
  if (varA < -1. || (varA < -1. && varA > 1.)) {
    discard;
  }
  gl_FragColor = vec4(0, 1, 0, 1) + 2. * varA * 2.;
}
</script>

Vertex shader:

attribute vec4 pos;
varying float varA;
void main(void) {
  varA = 0.;
  gl_Position = pos;
}

Results in displaying a black square instead of a green square, due to 
incorrect shader optimization.

Original issue reported on code.google.com by jmad...@chromium.org on 16 Oct 2013 at 5:09