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

[Public WebGL] some samples and a question about looping


I've updated my samples at http://programming-progress.com/webgl.html
so that they now work (or do not work) as expected on the latest
browsers. At least check out the Xmas star.

One question: It seems like the ATI GL drivers on at least Windows 7
64bit seem to always unfold loops that have constant number of
iterations. My workaround was to force the looping to be unknown (by
using uniforms). This doesn't work anymore because ANGLE validator
doesn't accept it. Is there some example on any platform where
converting the shader code to the form accepted by ANGLE would
actually convert a non-working shader to a shader that works with the
Anyway even if there is some driver that cannot handle full looping,
it should not matter, because any program can be converted into the
form accepted by ANGLE for example using
while (cond) body; ===> for (int i = 0; i < INFINITY-1; i++) { if
(!(cond)) break; else body; }
As summary, this check might cause some shaders to become impossible
on some environments, and it does not add to compatibility, because
the shaders could be easily converted into form that should be
accepted, if the original code is rejected by the driver. Wouldn't it
just be better to drop this check and say that the loops are "too
long" (and hence undefined) if they are not supported by the driver?

-- Sami
You are currently subscribed to public_webgl@khronos.org.
To unsubscribe, send an email to majordomo@khronos.org with
the following command in the body of your email: