lion0406 / angleproject

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

Prefix decrement operator in fragment shader wrong when --use-gl=desktop is passed on the commandline in Chrome #385

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
    Load test page at :
    http://tiborshub.github.com/WebGL-Tests/GLSLFragmentShaderDecrementOperatorIssue.html
    Press run decrement test
    Observe result, observe fragment shader code.
    The result is a repeated pattern of 4 columns of numbers.
    The first column is the vertical index in the framebuffer pixel grid (its the vertical texture coordinate devided by the height of one pixel).
    The second column stores that index value in a variable and does --var (prefix decrement) and adds 100.
    The third column stores that index value in a variable and does var-- (postfix decrement).
    The fourth column stores that index value in a variable and does var -= 1.0 (subtraction assignment);

    So when the code runs correctly the values in the second column are the values in the first column + 99 (+ 100 - 1). 
    The values in the third column are the values in the first column minus one. 
    The values in the fourth column are the values in the first column minus one.

    The issue occurs on Chrome Canary (25.0.1332.0) and Chrome stable (23.0.1271.64 m) with the commandline parameter : --use-gl=desktop
    and on Firefox 17.0 with webgl.prefer-native-gl : true.
    Prefix decrement computes in that case : var = -var + 1. 
    That is why I had to add 100 the the result, otherwise the negative values would have been clamped to 0.

    When that commandline parameter is not used (on Chrome) or webgl.prefer-native-gl : false on Firefox, the prefix decrement operator
    behaves as expected.

    The other button (run increment test) does the same operations for the increment and assign addition operator. 
    They behave as expected with and without the above parameter changes. I also tested the variant : var = var op 1.0.
    That also behaved as expected.

    Questions :
    Can somebody else reproduce this ?

    How much is the angle library involved when --use-gl=desktop (on chrome) or webgl.prefer-native-gl : true (Firefox).
    (I assume the effect of the parameter in both browsers is the same) ?

    All test were done on a Win 64 machine with all patches applied (up till 22 Nov 2012).
    The Graphics card is a AMD Radeon HD 6800 Series with driver version : 9.002-120928m-148276C-ATI (Catalyst 12.10).

    So any info on a non AMD/ATI card will be interesting.

Original issue reported on code.google.com by tiborden...@gmail.com on 22 Nov 2012 at 3:50

GoogleCodeExporter commented 9 years ago
If -use-gl=desktop or prefer-native-gl are set, ANGLE is only use for shader 
validation.  This seems like it would be a bug in the Desktop GL drivers, not 
ANGLE.

Original comment by dan...@transgaming.com on 22 Nov 2012 at 3:55

GoogleCodeExporter commented 9 years ago
So the shader code is passed unaltered to the driver ?
I see if I can reproduce the issue in a C/C++ app.

Original comment by tiborden...@gmail.com on 22 Nov 2012 at 4:55

GoogleCodeExporter commented 9 years ago
I could recreate the issue in a C app.
Source : http://tiborshub.github.com/WebGL-Tests/ShaderIssueDemo.c (needs 
FreeGlut).
So it is not angle related.
I reported the issue at AMD.
This issue can be closed.
Apologies for bothering you.

Original comment by tiborden...@gmail.com on 22 Nov 2012 at 10:23

GoogleCodeExporter commented 9 years ago
No worries. Thanks for narrowing it down further.

Original comment by dan...@transgaming.com on 23 Nov 2012 at 1:10