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

[Public WebGL] Shader validation and limitations



If you look at section A.4 of the SLES spec:

	http://www.khronos.org/registry/gles/specs/2.0/GLSL_ES_Specification_1.0.17.pdf

you'll see the minimal requirements of GLSL ES shaders, specifically control flow. I think we should adopt these rules in their entirety. It will not ensure that all shaders are safe, but it will avoid obvious mistakes like infinite loops. It also reduces the floorplan of the shader language a bit to make it easier to to do a better job of validation.

I also like Vlad's suggestion of restricting loop indices to ints (as opposed to ints plus floats). This will allow us to accurately determine the number of iterations a for loop will perform so we can choose to reject those that go over some limit.

I believe this solves the halting problem issue, (although I suspect Ken disagrees with me). But doesn't necessarily prevent a shader from running for an extremely long time, which I suppose is the same thing in most cases.

I think we should be as restrictive as possible in the first release. It is much easier to relax restrictions than to tighten them.

-----
~Chris
cmarrin@apple.com





-----------------------------------------------------------
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: