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

Re: [Public WebGL] Ambiguity and Non-deterministicness in the WebGL Spec



On Dec 13, 2010, at 6:42 PM, Mark Callow wrote:

> On 14/12/2010 03:57, Chris Marrin wrote:
>>> On 12/12/2010 04:20 PM, Gregg Tavares (wrk) wrote:
>>> 
>>>> The spec has changed to effectively require a clear each time the
>>>> WebGL draw buffer is composited
>>>> 
>>>>    WebGL presents its drawing buffer to the HTML page compositor
>>>>    immediately before a compositing operation, but only if the
>>>>    drawing buffer has been modified since the last compositing
>>>>    operation. Before the drawing buffer is presented for compositing
>>>>    the implementation shall ensure that all rendering operations have
>>>>    been flushed to the drawing buffer. By default, after compositing
>>>>    the contents of the drawing buffer shall be cleared to their
>>>>    default values. This includes the color buffer as well as the
>>>>    depth and stencil buffers if they are defined
>>>> 
>>>> ...
>>>> 
>> Note that I don't say that the buffers are cleared to the current clear values in the state. This was intentional to make it clear that the state is not involved in this clear operation. But this clear operation can be done lazily. If the author first clears the buffers first (which will almost always be the case), then this clear can be skipped. Using the word "default" is really only a placeholder. We need to make it clear that it is the default value from the state, which I believe is well defined in the GLES spec.
>> 
>> 
> A lazy clear operation implies a single clear to the current values set in the state. So isn't that violating the spec. that you just wrote: "clears the buffers to their default values"?

I'm not sure what you mean by that, but I like where you're going below...

> 
> I think that we should use the proposal you wrote in another message in this thread:
>> We could always say that the drawing buffers have values that are "undefined but guaranteed NOT to contain information from another process", or something like that.
> I added the emphasized "not" as I think you inadvertently omitted it.

Yep, my mistake.

> 
> So I'd rewrite as "By default (what does that mean? ed) after compositing the contents of the drawing buffer are undefined but are guaranteed not to contain information from another process." Then add a non-normative note somewhere that "One way to an implementation can guarantee buffers do not contain information from another process is to clear the buffer to the default values specified in OpenGL ES."
> 
> This gives maximum flexibility to the implementation while maintaining security.

These words sound good. I have incorporated them into the spec in section 2.2.

> 
> Another point, why does this talk about buffers? Only the color buffer is handed off for compositing so only that has the possibility to contain information from another process. So why mandate clearing the depth & stencil buffers after present?

That's a good point. The current iOS design only makes the color buffer unavailable. I guess I was thinking that it would be better to have uniform behavior. Is it possible for other implementations to have a performance restriction on preserving the depth and stencil buffers?

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