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

[Public WebGL] Spec clarification: clear color with {preserveDrawingBuffer: false, alpha: false}

Something that my colleague Geoff Lang brought to my attention while working on the D3D11 backend for ANGLE. Acoording to the WebGL spec, section 2.2, when the preserveDrawingBuffer context creation attribute is false the canvas should be cleared to (0,0,0,0) after presentation. However, the context-attribute-preserve-drawing-buffer conformance test checks to ensure the value is actually (0,0,0,255). This is, presumably, because in that particular test the context creation attribute "alpha: false" is also set, which means that the context is by definition opaque and any alpha value other than 255 wouldn't match the actual output.

This is logical, but the behavior isn't actually described in the spec anywhere and caused some confusion on Geoff's part, and possibly others in the future. So, two question:

1) Is there some reason why this behavior isn't expected? If so, what is the expected behavior?

2) Assuming that a clear value of (0,0,0,255) is expected with {preserveDrawingBuffer: false, alpha: false}, should it be explicitly stated in the spec?