Bug 1102667 - Fix our copy of OES_texture_float test. - r=kamidphish
authorjdashg <jdashg+github@gmail.com>
Fri, 21 Nov 2014 19:10:32 -0800
changeset 217295 d95090fbf3dc7d2830e6f022dee1dc982561e759
parent 217294 e8fb97477d9ef999141b764dd4dd8828f5d3c4d6
child 217296 6a871ae07d1fc0293f5635b921366b07bddc4e1a
push idunknown
push userunknown
push dateunknown
reviewerskamidphish
bugs1102667
milestone36.0a1
Bug 1102667 - Fix our copy of OES_texture_float test. - r=kamidphish
dom/canvas/test/webgl-conformance/conformance/extensions/oes-texture-float.html
--- a/dom/canvas/test/webgl-conformance/conformance/extensions/oes-texture-float.html
+++ b/dom/canvas/test/webgl-conformance/conformance/extensions/oes-texture-float.html
@@ -151,24 +151,26 @@ function runRenderTargetTest(testProgram
     gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width, height, 0, gl.RGBA, gl.FLOAT, null);
     glErrorShouldBe(gl, gl.NO_ERROR, "floating-point texture allocation should succeed if OES_texture_float is enabled");
 
     // Use this texture as a render target.
     var fbo = gl.createFramebuffer();
     gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
     gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0);
     gl.bindTexture(gl.TEXTURE_2D, null);
+
+    // Enabling OES_texture_float will either implicitly enable the entirety of
+    // WEBGL_color_buffer_float, or it will not enable any of it. If it is not
+    // enabled, we'll get an FB_INCOMPLETE_ATTACHMENT here.
+    if (gl.checkFramebufferStatus(gl.FRAMEBUFFER) != gl.FRAMEBUFFER_COMPLETE) {
+        shouldBe("gl.checkFramebufferStatus(gl.FRAMEBUFFER)", "gl.FRAMEBUFFER_INCOMPLETE_ATTACHMENT");
+        return;
+    }
+
     shouldBe("gl.checkFramebufferStatus(gl.FRAMEBUFFER)", "gl.FRAMEBUFFER_COMPLETE");
-    // While strictly speaking it is probably legal for a WebGL implementation to support
-    // floating-point textures but not as attachments to framebuffer objects, any such
-    // implementation is so poor that it arguably should not advertise support for the
-    // OES_texture_float extension. For this reason the conformance test requires that the
-    // framebuffer is complete here.
-    if (gl.checkFramebufferStatus(gl.FRAMEBUFFER) != gl.FRAMEBUFFER_COMPLETE)
-        return;
 
     var renderProgram =
         wtu.setupProgram(gl,
                          ["positionVertexShader", "floatingPointFragmentShader"],
                          ['vPosition'],
                          [0]);
     wtu.drawQuad(gl);
     glErrorShouldBe(gl, gl.NO_ERROR, "rendering to floating-point texture should succeed");