[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Public WebGL] Unused varyings.

vec3 NeverCalled ()
 return NeverUsed ;

I believe this is considered reading the variable, even though this code is unreachable.  You're asking the compiler to solve the halting problem.  The spec isn't 100% clear, but I think you're asking to much given the following snippet.

"Likewise a varying in a fragment shader may be either a) not declared, b) declared but not read, c) declared and read in some paths or d) declared and read in all paths."

"The compiler should not attempt to discover if a varying is read or written in all possible paths. This is considered too complex for ES." -- The OpenGL ES Shading Language section 10.12.

For better or worse drivers tend to accept a superset of what the spec requires.

-- Kenneth Waters