WebGL - incorrect return value from checkFramebufferStatus |
|||||
Issue description
UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.86 Safari/537.36
Steps to reproduce the problem:
On OS X, open the following code snippet in chrome and look in the developer console:
<!doctype html>
<html>
<head>
<script type = "text/javascript">
function main() {
var canvas = document.createElement("canvas");
document.body.appendChild(canvas);
canvas.width = 800; canvas.height = 600;
var gl = canvas.getContext("webgl");
var dte = gl.getExtension("WEBGL_depth_texture");
var depth_texture = gl.createTexture();
gl.bindTexture(gl.TEXTURE_2D, depth_texture);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
gl.texImage2D(gl.TEXTURE_2D, 0, gl.DEPTH_COMPONENT, 2048, 2048, 0, gl.DEPTH_COMPONENT, gl.UNSIGNED_SHORT, null);
gl.bindTexture(gl.TEXTURE_2D, null);
var fbo = gl.createFramebuffer();
gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.TEXTURE_2D, depth_texture, 0);
console.log(gl.checkFramebufferStatus(gl.FRAMEBUFFER), gl.FRAMEBUFFER_COMPLETE);
}
</script>
</head>
<body onload="main()">
</body>
</html>
It appears that on OS X it is illegal to have a FBO with only a depth attachment.
However, the call to checkFramebufferStatus returns an error code that is not equal to any of the ones listed here: https://www.khronos.org/opengles/sdk/docs/man/xhtml/glCheckFramebufferStatus.xml
It seems to be returning GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER, which isn't one of the possible return values according to the spec.
What is the expected behavior?
The error should be translated into one of those allowed by the spec.
What went wrong?
An unexpected error code was returned by glCheckFramebufferStatus
Did this work before? N/A
Chrome version: 50.0.2661.86 Channel: n/a
OS Version: 10.11.4
Flash Version: Shockwave Flash 21.0 r0
,
May 3 2016
,
Jun 2 2016
,
Dec 4 2016
Checking.
,
Dec 5 2016
This got fixed recently. It works with release 55. However, there is no test covering it. The test code is copied to https://jsfiddle.net/astojilj/x8a9fuhm/ so that the framebuffer status is visible on the page. Verified using different versions of official Chrome release run on OSX 10.11.6, MBP Mid 2014 with Intel GPU: 1) the bug is reproducible with 54. 54.0.2840.98 (Official Build) (64-bit) Revision8ee402c67ff2f8f7c746e56d3530b4dcec0709ad-refs/branch-heads/2840@{#829} page shows: FB status:0x8cdb 1) the bug is resolved with 55. 55.0.2883.75 (Official Build) (64-bit) Revision451c239c3b0722dc867b0f75839b959f729b756a-refs/branch-heads/2883@{#698} page shows: FB status:0x8cd5 About the missing tests. Conformance tests allow or mask GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER [1]. If status with only depth attached is not complete, allow it, attach the color and then check if complete. // TODO: remove this check if the spec is updated to require these combinations to work. if (gl.checkFramebufferStatus(gl.FRAMEBUFFER) != gl.FRAMEBUFFER_COMPLETE) { // try adding a color buffer. [1] https://cs.chromium.org/chromium/src/third_party/webgl/src/sdk/tests/conformance/extensions/webgl-depth-texture.html?rcl=0&l=261 (WebGL2) es3fFboStateQueryTests [2] seems to cover the attachment of depth only but doesn't check the state [2] es3fFboStateQueryTests. https://cs.chromium.org/chromium/src/third_party/webgl/src/conformance-suites/2.0.0/deqp/functional/gles3/es3fFboStateQueryTests.js?rcl=0&l=712 I'm setting this back to Available as it should get fixed in webgl conformance tests and someone else would know better how to do that. Feel free to reassign back if you'd prefer to have the test added to chrome gpu tests until gl conformance tests change lands.
,
Dec 5 2016
|
|||||
►
Sign in to add a comment |
|||||
Comment 1 by karandeepb@chromium.org
, May 3 2016