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

Re: [Public WebGL] Shader validation and limitations

On Jun 18, 2010, at 1:04 PM, Ilmari Heikkinen wrote:

> 2010/6/18 Oliver Hunt <oliver@apple.com>:
>> On Jun 17, 2010, at 9:49 PM, Cedric Vivier wrote:
>>> On Fri, Jun 18, 2010 at 08:02, Chris Marrin <cmarrin@apple.com> wrote:
>>>> 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.
>>> It seems Ken and/or others investigated this issue in depth months
>>> ago, is there any document available demonstrating all shader
>>> constructs - besides loops - found to possibly take an extremely long
>>> time to run ?
>> I believe the trick was to make a very expensive shader, and then throw thousands of large polygons at it.
> Or you can just throw a model with a million screen-sized triangles at
> a trivial shader.

Not with OpenGL ES you can't. It's limited to 65535 vertices per call, which I suppose translates to 65533 triangles if you're using TStrips. But the point is that a malicious author can do damaging things without writing an infinite loop. Even with that, I still advocate restricting shaders to the limits in Appendix A. It is always easier to relax restrictions than to tighten them.


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: