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

Re: [Public WebGL] CORS and resource provider awareness





On Thu, Nov 1, 2012 at 8:47 AM, Mark Callow <callow.mark@artspark.co.jp> wrote:

How do you run JS on the GPU?
You don't, you pass the computation off to the GPU. http://matrixmultiplygpu.appspot.com/sylvesterTest.html
 
You still seem to be failing to understand that these limitations would only come into play when cross-origin textures are in use and the alternatives are (a) don't allow cross-origin textures, as is the case now, (b) restrictions on what you can do in the shaders or (c) a solution nobody has thought of yet.
Well, ok, so here's the thing. Suppose I implement some terrain LOD shader making use of branching for tessellation on the GPU (don't ask, please, it's trivial, no, no polygons are generated, just their positions are computed creatively). So suppose I want to feed that shader data from a provider of heightfield slippy maps. Now suppose that provider doesn't set CORS headers. Now suppose what happens when I pass that shader to webgl. I get a taint switch, which nukes my context, then I get my context back, I'll try to recover only to find that my app is now broken. So granted, that kind of thing is probably not the most prominent CORS usecase. But is is ONE usecase I happen to have direct experience with which would not work.  
 
There is no need for adding artificial fuzz. Browsers already limit the maximum rate renderAnimationFrame will be called. Therefore disabling finish() will prevent reliable timing of anything that renders in less than the minimum time between calls to renderAnimationFrame. What's left is to deal with renders that take longer than that. For that I suggested aborting shader execution after a set time possibly coupled with improvements to GLSL optimization and asked which approach is least objectionable: today's status quo, CSS filter restrictions or my proposal. The question should be answered from the perspective of the applications mostly likely to want to use cross-origin textures.
 So thing is, I think I'm completely fine a fully working webgl that can't display non CORS resources. Because I think I'm not fine with any sort of automagic foobaring of apps. But this is the reason for my plea, please implement CORS if you're a resource provider.