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

Re: [Public WebGL] getContext multiple context language



On Tue, Feb 2, 2010 at 2:25 AM, Mark Callow <callow_mark@hicorp.co.jp> wrote:
> Apologies for my delayed response. I took a week off.
>
> The language is fine up until the last paragraph.
>
> Vladimir Vukicevic wrote:
>
> Here's the language for getContext() -- let me know of any suggestions
> before I send it off to hixie:
>
> ...
>
> If multiple rendering contexts are active, they all render to the same
> canvas; they are not layered or otherwise isolated.  Changes made to the
> canvas with one context must be immediately visible to any other active
> contexts on the canvas.  It is up to the implementation to manage
> synchronization issues associated with rendering with different contexts to
> the same canvas.
>
> Implicit synchronization is fraught with problems as I have stated many
> times before during this discussion. Lack of explicit synchronization is a
> nightmare for implementers (with the tangled web of checks between contexts
> growing as each new context type is added) and will encourage developers to
> interleave calls in ways that will be horrendously inefficient on any
> hardware that is attempting parallelism, which these days is pretty much
> everything.
>
> An explicit waitContext(in DOMString contextId) function should be added to
> the canvas for synchronization between contexts. This would flush commands
> previously issued to "contextId" and wait for them to complete and would be
> required between calls to drawing commands of different contexts.

In earlier discussions it was stated that if the developer fails to
call waitContext() then incorrect or undefined rendering results will
occur. This will lead to nonportable behavior and I don't think it is
a good idea.

If the synchronization checks occur in the implementation, their added
cost is a fetch from thread-local storage per rendering call. Such
checks already exist in the WebKit WebGL implementation and they are
nowhere near the top of the profile, at least at this point. I think
the synchronization among the various contexts should remain implicit.

-Ken

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