Changeset 265317 in webkit
- Timestamp:
- Aug 5, 2020 6:58:09 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/webgl/2.0.0/resources/webgl_test_files/conformance/attribs/gl-vertexattribpointer-offsets.html
r232783 r265317 1 1 <!-- 2 3 /* 4 ** Copyright (c) 2012 The Khronos Group Inc. 5 ** 6 ** Permission is hereby granted, free of charge, to any person obtaining a 7 ** copy of this software and/or associated documentation files (the 8 ** "Materials"), to deal in the Materials without restriction, including 9 ** without limitation the rights to use, copy, modify, merge, publish, 10 ** distribute, sublicense, and/or sell copies of the Materials, and to 11 ** permit persons to whom the Materials are furnished to do so, subject to 12 ** the following conditions: 13 ** 14 ** The above copyright notice and this permission notice shall be included 15 ** in all copies or substantial portions of the Materials. 16 ** 17 ** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 18 ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 19 ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 20 ** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 21 ** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 22 ** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 23 ** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. 24 */ 25 2 Copyright (c) 2019 The Khronos Group Inc. 3 Use of this source code is governed by an MIT-style license that can be 4 found in the LICENSE.txt file. 26 5 --> 27 6 … … 74 53 normalize: false, 75 54 }, 76 { data: new Float32Array([ 0, 1, 0, 1, 0, 0, 0, 0, 0 ]), 77 type: gl.FLOAT, 78 componentSize: 4, 79 normalize: false, 80 }, 81 { data: new Uint16Array([ 0, 32767, 0, 32767, 0, 0, 0, 0, 0 ]), 55 { data: new Uint16Array([ 0, 32767, 0, 32767, 0, 0, 0, 0, 0]), 82 56 type: gl.SHORT, 83 57 componentSize: 2, … … 120 94 } 121 95 ]; 96 97 if (wtu.getDefault3DContextVersion() >= 2) { 98 tests.push(...[ 99 { data: new Int32Array([ 0, 1, 0, 1, 0, 0, 0, 0, 0]), 100 type: gl.INT, 101 componentSize: 4, 102 normalize: false, 103 }, 104 { data: new Int32Array([ 0, 2147483647, 0, 2147483647, 0, 0, 0, 0, 0]), 105 type: gl.INT, 106 componentSize: 4, 107 normalize: true, 108 }, 109 { data: new Uint32Array([ 0, 1, 0, 1, 0, 0, 0, 0, 0]), 110 type: gl.UNSIGNED_INT, 111 componentSize: 4, 112 normalize: false, 113 }, 114 { data: new Uint32Array([ 0, 4294967295, 0, 4294967295, 0, 0, 0, 0, 0]), 115 type: gl.UNSIGNED_INT, 116 componentSize: 4, 117 normalize: true, 118 }, 119 { data: new Uint16Array([ 0, 0b11110000000000, 0, 0b11110000000000, 0, 0, 0, 0, 0]), 120 type: gl.HALF_FLOAT, 121 componentSize: 2, 122 normalize: false, 123 }, 124 { data: new Uint16Array([ 0, 0b11110000000000, 0, 0b11110000000000, 0, 0, 0, 0, 0]), 125 type: gl.HALF_FLOAT, 126 componentSize: 2, 127 normalize: false, 128 } 129 ]); 130 } 122 131 123 132 var vertexObject = gl.createBuffer(); -
trunk/LayoutTests/webgl/2.0.0/resources/webgl_test_files/conformance/attribs/gl-vertexattribpointer.html
r264997 r265317 1 1 <!-- 2 3 /* 4 ** Copyright (c) 2012 The Khronos Group Inc. 5 ** 6 ** Permission is hereby granted, free of charge, to any person obtaining a 7 ** copy of this software and/or associated documentation files (the 8 ** "Materials"), to deal in the Materials without restriction, including 9 ** without limitation the rights to use, copy, modify, merge, publish, 10 ** distribute, sublicense, and/or sell copies of the Materials, and to 11 ** permit persons to whom the Materials are furnished to do so, subject to 12 ** the following conditions: 13 ** 14 ** The above copyright notice and this permission notice shall be included 15 ** in all copies or substantial portions of the Materials. 16 ** 17 ** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 18 ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 19 ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 20 ** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 21 ** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 22 ** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 23 ** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. 24 */ 25 2 Copyright (c) 2019 The Khronos Group Inc. 3 Use of this source code is governed by an MIT-style license that can be 4 found in the LICENSE.txt file. 26 5 --> 27 6 … … 74 53 wtu.glErrorShouldBe(gl, gl.NO_ERROR); 75 54 76 //gl.bindBuffer(gl.ARRAY_BUFFER, null);77 //gl.vertexAttribPointer(0, 1, gl.FLOAT, false, 0, 0);78 //wtu.glErrorShouldBe(gl, gl.NO_ERROR,79 //"vertexAttribPointer should succeed if no buffer is bound and `offset` is zero.");55 gl.bindBuffer(gl.ARRAY_BUFFER, null); 56 gl.vertexAttribPointer(0, 1, gl.FLOAT, false, 0, 0); 57 wtu.glErrorShouldBe(gl, gl.NO_ERROR, 58 "vertexAttribPointer should succeed if no buffer is bound and `offset` is zero."); 80 59 81 60 gl.bindBuffer(gl.ARRAY_BUFFER, vertexObject); … … 89 68 wtu.glErrorShouldBe(gl, gl.INVALID_ENUM, 90 69 "vertexAttribPointer should not support UNSIGNED_INT"); 91 gl.vertexAttribPointer(0, 1, gl.FIXED, 0, 0, 0);92 wtu.glErrorShouldBe(gl, gl.INVALID_ENUM,93 "vertexAttribPointer should not support FIXED");94 70 } 71 gl.vertexAttribPointer(0, 1, gl.FIXED, 0, 0, 0); 72 wtu.glErrorShouldBe(gl, gl.INVALID_ENUM, 73 "vertexAttribPointer should not support FIXED"); 95 74 96 75 var checkVertexAttribPointer = function( … … 122 101 ]; 123 102 103 if (wtu.getDefault3DContextVersion() >= 2) { 104 types.push(...[ 105 { type:gl.INT, bytesPerComponent: 4 }, 106 { type:gl.UNSIGNED_INT, bytesPerComponent: 4 }, 107 { type:gl.HALF_FLOAT, bytesPerComponent: 2 }, 108 { type:gl.INT_2_10_10_10_REV, bytesPerComponent: 4, minSize: 4 }, 109 { type:gl.UNSIGNED_INT_2_10_10_10_REV, bytesPerComponent: 4, minSize: 4 }, 110 ]); 111 } 112 124 113 for (var ii = 0; ii < types.length; ++ii) { 125 114 var info = types[ii]; … … 150 139 err = gl.INVALID_OPERATION; 151 140 } 141 if (size < info.minSize) { 142 reason = "because size < minSize"; 143 err = gl.INVALID_OPERATION; 144 } 152 145 checkVertexAttribPointer( 153 146 gl, err, reason, size, info.type, false, stride, offset); … … 157 150 if (offset == 0) { 158 151 checkVertexAttribPointer( 159 gl, gl.NO_ERROR, "at stride limit",152 gl, size < info.minSize ? gl.INVALID_OPERATION : gl.NO_ERROR, "at stride limit", 160 153 size, info.type, false, stride, offset); 161 154 checkVertexAttribPointer( 162 gl, gl.INVALID_VALUE, "over stride limit",155 gl, size < info.minSize ? gl.INVALID_OPERATION : gl.INVALID_VALUE, "over stride limit", 163 156 size, info.type, false, 164 157 stride + info.bytesPerComponent, offset); -
trunk/Source/WebCore/ChangeLog
r265315 r265317 1 2020-08-05 James Darpinian <jdarpinian@chromium.org> 2 3 [WebGL2] Upgrade vertexAttribPointer with new supported types 4 https://bugs.webkit.org/show_bug.cgi?id=215036 5 6 Reviewed by Dean Jackson. 7 8 Tested by updated WebGL conformance tests webgl/2.0.0/conformance/attribs/gl-vertexattribpointer-offsets.html and webgl/2.0.0/conformance/attribs/gl-vertexattribpointer.html 9 10 * html/canvas/WebGLRenderingContextBase.cpp: 11 (WebCore::WebGLRenderingContextBase::sizeInBytes): 12 (WebCore::WebGLRenderingContextBase::vertexAttribPointer): 13 1 14 2020-08-05 Tim Horton <timothy_horton@apple.com> 2 15 -
trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp
r265208 r265317 1296 1296 case GraphicsContextGL::FLOAT: 1297 1297 return sizeof(GCGLfloat); 1298 case GraphicsContextGL::HALF_FLOAT: 1299 return 2; 1300 case GraphicsContextGL::INT_2_10_10_10_REV: 1301 case GraphicsContextGL::UNSIGNED_INT_2_10_10_10_REV: 1302 return 4; 1298 1303 } 1299 1304 ASSERT_NOT_REACHED(); … … 5966 5971 break; 5967 5972 default: 5968 synthesizeGLError(GraphicsContextGL::INVALID_ENUM, "vertexAttribPointer", "invalid type"); 5969 return; 5973 if (!isWebGL2()) { 5974 synthesizeGLError(GraphicsContextGL::INVALID_ENUM, "vertexAttribPointer", "invalid type"); 5975 return; 5976 } 5977 switch (type) { 5978 case GraphicsContextGL::INT: 5979 case GraphicsContextGL::UNSIGNED_INT: 5980 case GraphicsContextGL::HALF_FLOAT: 5981 break; 5982 case GraphicsContextGL::INT_2_10_10_10_REV: 5983 case GraphicsContextGL::UNSIGNED_INT_2_10_10_10_REV: 5984 if (size != 4) { 5985 synthesizeGLError(GraphicsContextGL::INVALID_OPERATION, "vertexAttribPointer", "[UNSIGNED_]INT_2_10_10_10_REV requires size 4"); 5986 return; 5987 } 5988 break; 5989 default: 5990 synthesizeGLError(GraphicsContextGL::INVALID_ENUM, "vertexAttribPointer", "invalid type"); 5991 return; 5992 } 5970 5993 } 5971 5994 if (index >= m_maxVertexAttribs) {
Note: See TracChangeset
for help on using the changeset viewer.