Changeset 76988 in webkit
- Timestamp:
- Jan 28, 2011 2:20:31 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r76987 r76988 1 2011-01-28 Zhenyao Mo <zmo@google.com> 2 3 Reviewed by Kenneth Russell. 4 5 uniformN*v should generate INVALID_VALUE of the array size is not a multiple of N 6 https://bugs.webkit.org/show_bug.cgi?id=53306 7 8 * fast/canvas/webgl/gl-uniform-arrays-expected.txt: 9 * fast/canvas/webgl/gl-uniform-arrays.html: 10 * fast/canvas/webgl/gl-uniformmatrix4fv-expected.txt: 11 * fast/canvas/webgl/gl-uniformmatrix4fv.html: 12 1 13 2011-01-28 Tom Sepez <tsepez@chromium.org> 2 14 -
trunk/LayoutTests/fast/canvas/webgl/gl-uniform-arrays-expected.txt
r74499 r76988 30 30 PASS getError was expected value: INVALID_OPERATION : should fail if there is no current program 31 31 PASS getError was expected value: INVALID_VALUE : should fail with insufficient array size with gl.uniform2fv 32 PASS getError was expected value: INVALID_VALUE : should fail with non-multiple array size with gl.uniform2fv 32 33 PASS getError was expected value: NO_ERROR : can set an array of uniforms with gl.uniform2fv 33 34 PASS getError was expected value: NO_ERROR : can call gl.getUniform … … 51 52 PASS getError was expected value: INVALID_OPERATION : should fail if there is no current program 52 53 PASS getError was expected value: INVALID_VALUE : should fail with insufficient array size with gl.uniform3fv 54 PASS getError was expected value: INVALID_VALUE : should fail with non-multiple array size with gl.uniform3fv 53 55 PASS getError was expected value: NO_ERROR : can set an array of uniforms with gl.uniform3fv 54 56 PASS getError was expected value: NO_ERROR : can call gl.getUniform … … 72 74 PASS getError was expected value: INVALID_OPERATION : should fail if there is no current program 73 75 PASS getError was expected value: INVALID_VALUE : should fail with insufficient array size with gl.uniform4fv 76 PASS getError was expected value: INVALID_VALUE : should fail with non-multiple array size with gl.uniform4fv 74 77 PASS getError was expected value: NO_ERROR : can set an array of uniforms with gl.uniform4fv 75 78 PASS getError was expected value: NO_ERROR : can call gl.getUniform -
trunk/LayoutTests/fast/canvas/webgl/gl-uniform-arrays.html
r74499 r76988 110 110 }, 111 111 srcValues: [16, 15, 14], 112 srcValuesBad: [], 112 srcValuesLess: [], 113 srcValuesNonMultiple: null, 113 114 }, 114 115 { type: 'vec2', … … 141 142 }, 142 143 srcValues: [16, 15, 14, 13, 12, 11], 143 srcValuesBad: [16], 144 srcValuesLess: [16], 145 srcValuesNonMultiple: [16, 15, 14, 13, 12, 11, 10], 144 146 }, 145 147 { type: 'vec3', … … 175 177 }, 176 178 srcValues: [16, 15, 14, 13, 12, 11, 10, 9, 8], 177 srcValuesBad: [16, 15], 179 srcValuesLess: [16, 15], 180 srcValuesNonMultiple: [16, 15, 14, 13, 12, 11, 10, 9, 8, 7], 178 181 }, 179 182 { type: 'vec4', … … 212 215 }, 213 216 srcValues: [16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5], 214 srcValuesBad: [16, 15, 14], 217 srcValuesLess: [16, 15, 14], 218 srcValuesNonMultiple: [16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4], 215 219 } 216 220 ]; … … 232 236 var loc = gl.getUniformLocation(program, "color[0]"); 233 237 var srcValues = typeInfo.srcValues; 234 var srcValuesBad = typeInfo.srcValuesBad; 238 var srcValuesLess = typeInfo.srcValuesLess; 239 var srcValuesNonMultiple = typeInfo.srcValuesNonMultiple; 235 240 236 241 // Try setting the value before using the program 237 242 gl[typeInfo.setter](loc, srcValues); 238 243 glErrorShouldBe(gl, gl.INVALID_OPERATION, 239 "should fail if there is no current program");244 "should fail if there is no current program"); 240 245 241 246 gl.useProgram(program); 242 gl[typeInfo.setter](loc, srcValues Bad);247 gl[typeInfo.setter](loc, srcValuesLess); 243 248 glErrorShouldBe(gl, gl.INVALID_VALUE, 244 "should fail with insufficient array size with gl." + typeInfo.setter); 249 "should fail with insufficient array size with gl." + typeInfo.setter); 250 if (srcValuesNonMultiple) { 251 gl[typeInfo.setter](loc, srcValuesNonMultiple); 252 glErrorShouldBe(gl, gl.INVALID_VALUE, 253 "should fail with non-multiple array size with gl." + typeInfo.setter); 254 } 245 255 gl[typeInfo.setter](loc, srcValues); 246 256 glErrorShouldBe(gl, gl.NO_ERROR, 247 "can set an array of uniforms with gl." + typeInfo.setter);257 "can set an array of uniforms with gl." + typeInfo.setter); 248 258 var values = gl.getUniform(program, loc); 249 259 glErrorShouldBe(gl, gl.NO_ERROR, 250 "can call gl.getUniform");260 "can call gl.getUniform"); 251 261 assertMsg(typeInfo.checkType(values), 252 262 "gl.getUniform returns the correct type."); … … 254 264 var elemLoc = gl.getUniformLocation(program, "color[" + ii + "]"); 255 265 glErrorShouldBe(gl, gl.NO_ERROR, 256 "can get location of element " + ii +257 " of array from gl.getUniformLocation");266 "can get location of element " + ii + 267 " of array from gl.getUniformLocation"); 258 268 var value = gl.getUniform(program, elemLoc); 259 269 glErrorShouldBe(gl, gl.NO_ERROR, 260 "can get value of element " + ii + " of array from gl.getUniform");270 "can get value of element " + ii + " of array from gl.getUniform"); 261 271 assertMsg(typeInfo.checkValue(typeInfo, ii, value), 262 272 "value put in (" + typeInfo.srcValueAsString(ii, srcValues) + … … 266 276 typeInfo.invalidSet(loc); 267 277 glErrorShouldBe(gl, gl.INVALID_OPERATION, 268 "using the wrong size of gl.Uniform fails");278 "using the wrong size of gl.Uniform fails"); 269 279 var exceptionCaught = false; 270 280 if (typeInfo.illegalSet) { … … 279 289 gl.useProgram(null); 280 290 glErrorShouldBe(gl, gl.NO_ERROR, 281 "can call gl.useProgram(null)");291 "can call gl.useProgram(null)"); 282 292 } 283 293 debug(""); -
trunk/LayoutTests/fast/canvas/webgl/gl-uniformmatrix4fv-expected.txt
r62384 r76988 5 5 6 6 Checking gl.uniformMatrix. 7 PASS should fail with insufficient array size for uniformMatrix2fv 8 PASS can call uniformMatrix2fvwith transpose = false 9 PASS uniformMatrix2fv should return INVALID_VALUE with transpose = true 10 PASS should fail with insufficient array size for uniformMatrix3fv 11 PASS can call uniformMatrix3fvwith transpose = false 12 PASS uniformMatrix3fv should return INVALID_VALUE with transpose = true 13 PASS should fail with insufficient array size for uniformMatrix4fv 14 PASS can call uniformMatrix4fvwith transpose = false 15 PASS uniformMatrix4fv should return INVALID_VALUE with transpose = true 7 PASS getError was expected value: INVALID_VALUE : should fail with insufficient array size for uniformMatrix2fv 8 PASS getError was expected value: NO_ERROR : should succeed with correct array size for uniformMatrix2fv 9 PASS getError was expected value: INVALID_VALUE : should fail with more than 1 array size for uniformMatrix2fv 10 PASS getError was expected value: NO_ERROR : can call uniformMatrix2fvwith transpose = false 11 PASS getError was expected value: INVALID_VALUE : uniformMatrix2fv should return INVALID_VALUE with transpose = true 12 PASS getError was expected value: INVALID_VALUE : should fail with insufficient array size for uniformMatrix3fv 13 PASS getError was expected value: NO_ERROR : should succeed with correct array size for uniformMatrix3fv 14 PASS getError was expected value: INVALID_VALUE : should fail with more than 1 array size for uniformMatrix3fv 15 PASS getError was expected value: NO_ERROR : can call uniformMatrix3fvwith transpose = false 16 PASS getError was expected value: INVALID_VALUE : uniformMatrix3fv should return INVALID_VALUE with transpose = true 17 PASS getError was expected value: INVALID_VALUE : should fail with insufficient array size for uniformMatrix4fv 18 PASS getError was expected value: NO_ERROR : should succeed with correct array size for uniformMatrix4fv 19 PASS getError was expected value: INVALID_VALUE : should fail with more than 1 array size for uniformMatrix4fv 20 PASS getError was expected value: NO_ERROR : can call uniformMatrix4fvwith transpose = false 21 PASS getError was expected value: INVALID_VALUE : uniformMatrix4fv should return INVALID_VALUE with transpose = true 16 22 17 23 PASS successfullyParsed is true -
trunk/LayoutTests/fast/canvas/webgl/gl-uniformmatrix4fv.html
r63444 r76988 41 41 for (var ii = 2; ii <= 4; ++ii) { 42 42 var loc = gl.getUniformLocation(gl.program, "world" + ii); 43 var mat = [];43 var matLess = []; 44 44 for (var jj = 0; jj < ii; ++jj) { 45 45 for (var ll = 0; ll < ii; ++ll) { 46 46 if (jj == ii - 1 && ll == ii - 1) 47 47 continue; 48 mat [jj * ii + ll] = (jj == ll) ? 1 : 0;48 matLess[jj * ii + ll] = (jj == ll) ? 1 : 0; 49 49 } 50 50 } 51 var mat = matLess.concat([1]); 52 var matMore = mat.concat([1]); 51 53 name = "uniformMatrix" + ii + "fv"; 54 gl[name](loc, false, matLess); 55 glErrorShouldBe(gl, gl.INVALID_VALUE, "should fail with insufficient array size for " + name); 52 56 gl[name](loc, false, mat); 53 assertMsg(gl.getError() == gl.INVALID_VALUE, "should fail with insufficient array size for " + name); 57 glErrorShouldBe(gl, gl.NO_ERROR, "should succeed with correct array size for " + name); 58 gl[name](loc, false, matMore); 59 glErrorShouldBe(gl, gl.INVALID_VALUE, "should fail with more than 1 array size for " + name); 60 54 61 mat[ii * ii - 1] = 1; 55 62 gl[name](loc, false, mat); 56 assertMsg(gl.getError() ==gl.NO_ERROR, "can call " + name + "with transpose = false");63 glErrorShouldBe(gl, gl.NO_ERROR, "can call " + name + "with transpose = false"); 57 64 gl[name](loc, true, mat); 58 assertMsg(gl.getError() ==gl.INVALID_VALUE, name + " should return INVALID_VALUE with transpose = true");65 glErrorShouldBe(gl, gl.INVALID_VALUE, name + " should return INVALID_VALUE with transpose = true"); 59 66 } 60 67 -
trunk/Source/WebCore/ChangeLog
r76987 r76988 1 2011-01-28 Zhenyao Mo <zmo@google.com> 2 3 Reviewed by Kenneth Russell. 4 5 uniformN*v should generate INVALID_VALUE of the array size is not a multiple of N 6 https://bugs.webkit.org/show_bug.cgi?id=53306 7 8 * html/canvas/WebGLRenderingContext.cpp: 9 (WebCore::WebGLRenderingContext::validateUniformMatrixParameters): 10 1 11 2011-01-28 Tom Sepez <tsepez@chromium.org> 2 12 -
trunk/Source/WebCore/html/canvas/WebGLRenderingContext.cpp
r76944 r76988 4391 4391 return false; 4392 4392 } 4393 if (size < requiredMinSize ) {4393 if (size < requiredMinSize || (size % requiredMinSize)) { 4394 4394 m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE); 4395 4395 return false;
Note: See TracChangeset
for help on using the changeset viewer.