forked from KhronosGroup/WebGL
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ext-float-blend.html
72 lines (64 loc) · 2.22 KB
/
ext-float-blend.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>WebGL EXT_float_blend Conformance Tests</title>
<link rel="stylesheet" href="../../resources/js-test-style.css"/>
<script src="../../js/js-test-pre.js"></script>
<script src="../../js/webgl-test-utils.js"></script>
<script src="../../js/tests/ext-float-blend.js"></script>
</head>
<body>
<div id="description"></div>
<div id="console"></div>
<script>
"use strict";
description("This test verifies the functionality of the EXT_float_blend extension, if it is available.");
var wtu = WebGLTestUtils;
var canvas = document.getElementById("canvas");
var gl = wtu.create3DContext(canvas);
var ext = null;
(function(){
const colorBufferFloat = gl.getExtension("EXT_color_buffer_float");
if (!colorBufferFloat) {
testPassed("EXT_color_buffer_float is allowed to be missing.");
return;
}
let shouldBlend = testExtFloatBlendFunctionality();
debug( shouldBlend ?
"This device has float 32 blending capability" :
"This device cannot do float 32 blending"
);
const hasExtFloatBlend = gl.getSupportedExtensions().indexOf('EXT_float_blend') != -1;
debug( hasExtFloatBlend ?
"This device has EXT_float_blend listed" :
"This device doesn't have EXT_float_blend listed"
);
shouldBlend = shouldBlend || hasExtFloatBlend;
debug("");
debug("Testing float32 blending without EXT_float_blend");
testExtFloatBlend(gl.RGBA32F, shouldBlend);
testExtFloatBlendMRT(shouldBlend);
testExtFloatBlendNonFloat32Type(shouldBlend);
const floatBlend = gl.getExtension("EXT_float_blend");
if (!floatBlend && !shouldBlend) {
testPassed("EXT_float_blend is allowed to be missing.");
return;
}
debug("");
debug("Testing that float32 blending is allowed with EXT_float_blend");
testExtFloatBlend(gl.RGBA32F, shouldBlend);
testExtFloatBlendMRT(shouldBlend);
testExtFloatBlendNonFloat32Type(shouldBlend);
})();
debug("");
var successfullyParsed = true;
</script>
<script src="../../js/js-test-post.js"></script>
</body>
</html>
<!--
Copyright (c) 2019 The Khronos Group Inc.
Use of this source code is governed by an MIT-style license that can be
found in the LICENSE.txt file.
-->