5 <title>WebGL EXT_float_blend Conformance Tests
</title>
6 <link rel=
"stylesheet" href=
"../../resources/js-test-style.css"/>
7 <script src=
"../../js/js-test-pre.js"></script>
8 <script src=
"../../js/webgl-test-utils.js"></script>
9 <script src=
"../../js/tests/ext-float-blend.js"></script>
12 <div id=
"description"></div>
13 <div id=
"console"></div>
16 description("This test verifies the functionality of the EXT_float_blend extension, if it is available.");
18 var wtu
= WebGLTestUtils
;
19 var canvas
= document
.getElementById("canvas");
20 var gl
= wtu
.create3DContext(canvas
);
23 function extFloatBlendTests(version
, config
) {
25 debug("Testing float32 blending without EXT_float_blend");
26 testExtFloatBlend(config
.internalFormat
);
27 testExtFloatBlendMRT(version
, config
.drawBuffers
);
28 testExtFloatBlendNonFloat32Type(version
, config
.oesTextureHalfFloat
);
30 const floatBlend
= gl
.getExtension("EXT_float_blend");
32 testPassed("EXT_float_blend is allowed to be missing.");
37 debug("Testing that float32 blending is allowed with EXT_float_blend");
38 testExtFloatBlend(config
.internalFormat
);
39 testExtFloatBlendMRT(version
, config
.drawBuffers
);
40 testExtFloatBlendNonFloat32Type(version
, config
.oesTextureHalfFloat
);
44 if (wtu
.getDefault3DContextVersion() < 2) {
45 const oesTextureFloat
= gl
.getExtension("OES_texture_float");
46 if (!oesTextureFloat
) {
47 testPassed("OES_texture_float is allowed to be missing.");
51 const colorBufferFloat
= gl
.getExtension("WEBGL_color_buffer_float");
52 if (!colorBufferFloat
) {
53 testPassed("WEBGL_color_buffer_float is allowed to be missing.");
57 const drawBuffers
= gl
.getExtension("WEBGL_draw_buffers");
59 debug("WEBGL_draw_buffers is allowed to be missing. MRT tests will be skipped.");
62 const oesTextureHalfFloat
= gl
.getExtension("OES_texture_half_float");
63 const extColorBufferHalfFloat
= gl
.getExtension("EXT_color_buffer_half_float");
64 const testHalfFloat
= !(!oesTextureHalfFloat
|| !extColorBufferHalfFloat
);
66 debug("OES_texture_half_float or EXT_color_buffer_half_float is allowed to be missing. NonFloat32Type tests will be skipped.");
69 const internalFormat
= gl
.RGBA
;
70 extFloatBlendTests(1, {
71 internalFormat
, drawBuffers
, oesTextureHalfFloat
74 const colorBufferFloat
= gl
.getExtension("EXT_color_buffer_float");
75 if (!colorBufferFloat
) {
76 testPassed("EXT_color_buffer_float is allowed to be missing.");
80 const internalFormat
= gl
.RGBA32F
;
81 extFloatBlendTests(2, {
88 var successfullyParsed
= true;
90 <script src=
"../../js/js-test-post.js"></script>
95 Copyright (c) 2019 The Khronos Group Inc.
96 Use of this source code is governed by an MIT-style license that can be
97 found in the LICENSE.txt file.