Changeset 113733 in webkit
- Timestamp:
- Apr 10, 2012, 10:25:01 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r113727 r113733 1 2012-04-09 Zhenyao Mo <zmo@google.com> 2 3 getShaderFormatPrecision should return sensible values 4 https://bugs.webkit.org/show_bug.cgi?id=83520 5 6 Reviewed by Kenneth Russell. 7 8 * fast/canvas/webgl/shader-precision-format-expected.txt: 9 * fast/canvas/webgl/shader-precision-format.html: Add tests to make sure getShaderPrecisionFormat returns sensible values. 10 1 11 2012-04-10 Alexander Pavlov <apavlov@chromium.org> 2 12 -
trunk/LayoutTests/fast/canvas/webgl/shader-precision-format-expected.txt
r113092 r113733 25 25 PASS gl.getShaderPrecisionFormat(gl.HIGH_INT, gl.VERTEX_SHADER) generated expected GL error: INVALID_ENUM. 26 26 27 Test that WebGLShaderPrecisionFormat values are sensible. 28 29 PASS shaderPrecisionFormat.rangeMin >= 1 is true 30 PASS shaderPrecisionFormat.rangeMax >= 1 is true 31 PASS shaderPrecisionFormat.precision >= 8 is true 32 PASS shaderPrecisionFormat.rangeMin >= 14 is true 33 PASS shaderPrecisionFormat.rangeMax >= 14 is true 34 PASS shaderPrecisionFormat.precision >= 10 is true 35 PASS shaderPrecisionFormat.rangeMin >= 62 is true 36 PASS shaderPrecisionFormat.rangeMax >= 62 is true 37 PASS shaderPrecisionFormat.precision >= 16 is true 38 PASS shaderPrecisionFormat.rangeMin >= 8 is true 39 PASS shaderPrecisionFormat.rangeMax >= 8 is true 40 PASS shaderPrecisionFormat.precision == 0 is true 41 PASS shaderPrecisionFormat.rangeMin >= 10 is true 42 PASS shaderPrecisionFormat.rangeMax >= 10 is true 43 PASS shaderPrecisionFormat.precision == 0 is true 44 PASS shaderPrecisionFormat.rangeMin >= 16 is true 45 PASS shaderPrecisionFormat.rangeMax >= 16 is true 46 PASS shaderPrecisionFormat.precision == 0 is true 47 27 48 Test that getShaderPrecisionFormat returns the same thing every call. 28 49 -
trunk/LayoutTests/fast/canvas/webgl/shader-precision-format.html
r113092 r113733 49 49 50 50 debug(""); 51 debug("Test that WebGLShaderPrecisionFormat values are sensible."); 52 debug(""); 53 54 // The minimum values are from OpenGL ES Shading Language spec, section 4.5. 55 56 var shaderPrecisionFormat = gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.LOW_FLOAT); 57 shouldBeTrue('shaderPrecisionFormat.rangeMin >= 1'); 58 shouldBeTrue('shaderPrecisionFormat.rangeMax >= 1'); 59 shouldBeTrue('shaderPrecisionFormat.precision >= 8'); 60 61 shaderPrecisionFormat = gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.MEDIUM_FLOAT); 62 shouldBeTrue('shaderPrecisionFormat.rangeMin >= 14'); 63 shouldBeTrue('shaderPrecisionFormat.rangeMax >= 14'); 64 shouldBeTrue('shaderPrecisionFormat.precision >= 10'); 65 66 shaderPrecisionFormat = gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.HIGH_FLOAT); 67 shouldBeTrue('shaderPrecisionFormat.rangeMin >= 62'); 68 shouldBeTrue('shaderPrecisionFormat.rangeMax >= 62'); 69 shouldBeTrue('shaderPrecisionFormat.precision >= 16'); 70 71 shaderPrecisionFormat = gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.LOW_INT); 72 shouldBeTrue('shaderPrecisionFormat.rangeMin >= 8'); 73 shouldBeTrue('shaderPrecisionFormat.rangeMax >= 8'); 74 shouldBeTrue('shaderPrecisionFormat.precision == 0'); 75 76 shaderPrecisionFormat = gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.MEDIUM_INT); 77 shouldBeTrue('shaderPrecisionFormat.rangeMin >= 10'); 78 shouldBeTrue('shaderPrecisionFormat.rangeMax >= 10'); 79 shouldBeTrue('shaderPrecisionFormat.precision == 0'); 80 81 shaderPrecisionFormat = gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.HIGH_INT); 82 shouldBeTrue('shaderPrecisionFormat.rangeMin >= 16'); 83 shouldBeTrue('shaderPrecisionFormat.rangeMax >= 16'); 84 shouldBeTrue('shaderPrecisionFormat.precision == 0'); 85 86 debug(""); 51 87 debug("Test that getShaderPrecisionFormat returns the same thing every call."); 52 88 debug(""); 53 89 54 varshaderPrecisionFormat = gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.LOW_FLOAT);90 shaderPrecisionFormat = gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.LOW_FLOAT); 55 91 var shaderPrecisionFormat2 = gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.LOW_FLOAT); 56 92 shouldBeTrue('shaderPrecisionFormat.rangeMin == shaderPrecisionFormat2.rangeMin'); -
trunk/Source/WebCore/ChangeLog
r113731 r113733 1 2012-04-09 Zhenyao Mo <zmo@google.com> 2 3 getShaderFormatPrecision should return sensible values 4 https://bugs.webkit.org/show_bug.cgi?id=83520 5 6 Reviewed by Kenneth Russell. 7 8 * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp: Fix getShaderPrecisionFormat values. 9 (WebCore::GraphicsContext3D::getShaderPrecisionFormat): 10 * platform/graphics/qt/GraphicsContext3DQt.cpp: Ditto. 11 (WebCore::GraphicsContext3D::getShaderPrecisionFormat): 12 1 13 2012-04-10 Alexander Pavlov <apavlov@chromium.org> 2 14 -
trunk/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGL.cpp
r113092 r113733 198 198 makeContextCurrent(); 199 199 200 // These constants came from the Chromium port; we believe they originally201 // came from making the actual API call on a representative desktop system.202 200 switch (precisionType) { 203 201 case GraphicsContext3D::LOW_INT: 204 202 case GraphicsContext3D::MEDIUM_INT: 205 203 case GraphicsContext3D::HIGH_INT: 206 range[0] = -31; 207 range[1] = 31; 204 // These values are for a 32-bit twos-complement integer format. 205 range[0] = 31; 206 range[1] = 30; 208 207 precision[0] = 0; 209 208 break; … … 211 210 case GraphicsContext3D::MEDIUM_FLOAT: 212 211 case GraphicsContext3D::HIGH_FLOAT: 213 range[0] = -62; 214 range[1] = 62; 215 precision[0] = -16; 212 // These values are for an IEEE single-precision floating-point format. 213 range[0] = 127; 214 range[1] = 127; 215 precision[0] = 23; 216 216 break; 217 217 default: -
trunk/Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp
r113123 r113733 1376 1376 makeContextCurrent(); 1377 1377 1378 // These constants came from the Chromium port; we believe they originally1379 // came from making the actual API call on a representative desktop system.1380 1378 switch (precisionType) { 1381 1379 case GraphicsContext3D::LOW_INT: 1382 1380 case GraphicsContext3D::MEDIUM_INT: 1383 1381 case GraphicsContext3D::HIGH_INT: 1384 range[0] = -31; 1385 range[1] = 31; 1382 // These values are for a 32-bit twos-complement integer format. 1383 range[0] = 31; 1384 range[1] = 30; 1386 1385 precision[0] = 0; 1387 1386 break; … … 1389 1388 case GraphicsContext3D::MEDIUM_FLOAT: 1390 1389 case GraphicsContext3D::HIGH_FLOAT: 1391 range[0] = -62; 1392 range[1] = 62; 1393 precision[0] = -16; 1390 // These values are for an IEEE single-precision floating-point format. 1391 range[0] = 127; 1392 range[1] = 127; 1393 precision[0] = 23; 1394 1394 break; 1395 1395 default:
Note:
See TracChangeset
for help on using the changeset viewer.