Min Chen
unread,Nov 28, 2012, 7:27:03 PM11/28/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to uoft_csc...@googlegroups.com
Hi Peter,
I got some semantic errors for the *.frag files included in the demos.
1. Reading from a result-qualified variable.
In shader.frag (line 5, col 28), the value of gl_FragCoord is read.
As gl_FragCoord is a predefined "result" variable, shouldn't it be write-only and cannot be written in a if/else scope?
2. Const Initialization by a constructor.
In phong.frag (line 9, col 21)
const vec4 red = vec4(1.0,0.0,0.0,1.0);
In lab 3 spec, it says that "const qualified variables must be initialized with a literal value or with a uniform variable
(see pre-defined variables below), and not an expression."
I thought a constructor call is only an expression but definitely not a literal value. Thus, it shouldn't be allowed to initialize a const variable?
Did I misunderstand anything?
Thanks,
Min