gxquickly / angleproject

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

redefenition of _i #260

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
void main()
{
  for(int i=0;i<0;i++);
  int i;
  gl_FragColor=vec4(0.0);
}

What is the expected output? What do you see instead?
The shader should compile successfully. Instead it errors out with "error 
X3003: redefinition of _i".

What version of the product are you using? On what operating system?
The one shipped with Google Chrome 15.0.874.121 m

Please provide any additional information below.

The ESSL specification 
(http://www.khronos.org/registry/gles/specs/2.0/GLSL_ES_Specification_1.0.17.pdf
), section 6.3 says "Variables declared in for-init-statement or condition are 
only in scope until the end of the statement-no-new-scope of the for loop". But 
HLSL seems to have different for-scoping.

Original issue reported on code.google.com by kusmab...@gmail.com on 1 Dec 2011 at 11:46

GoogleCodeExporter commented 9 years ago
I guess something along the lines of this patch should fix it...

Original comment by kusmab...@gmail.com on 1 Dec 2011 at 12:39

Attachments:

GoogleCodeExporter commented 9 years ago
minus the "exptra"-typo, that is ;)

Original comment by kusmab...@gmail.com on 1 Dec 2011 at 12:40

GoogleCodeExporter commented 9 years ago
Thanks for the patch. That should indeed take care of it.

Original comment by nicolas....@gmail.com on 1 Dec 2011 at 7:09

GoogleCodeExporter commented 9 years ago
I believe the patch is not correct for do-while loops. I'll have another look 
at this when I find some spare time...

Original comment by nicolas....@gmail.com on 7 Dec 2011 at 9:14

GoogleCodeExporter commented 9 years ago

Original comment by nicolas....@gmail.com on 8 Mar 2012 at 9:28

GoogleCodeExporter commented 9 years ago
Fixed in r999.

Original comment by nicolas....@gmail.com on 9 Mar 2012 at 11:46