Title: [157959] trunk
Revision
157959
Author
[email protected]
Date
2013-10-24 16:14:10 -0700 (Thu, 24 Oct 2013)

Log Message

Add texture level dependent size checks to textureImage2D calls.
https://bugs.webkit.org/show_bug.cgi?id=123290
<rdar://problem/15201382>

Reviewed by Dean Jackson.

Test covered by WebGL Conformance suite 1.0.2 test, textures/texture-size-limit.html.

There are different size limits when calling textureImage2D on different texture levels.
We should be throwing an error if our texture size exceeds these limits.

* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::validateTexFuncParameters):
* platform/mac/TestExpectations: Unskip now passing test texture-size-limit.html.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (157958 => 157959)


--- trunk/LayoutTests/ChangeLog	2013-10-24 22:22:21 UTC (rev 157958)
+++ trunk/LayoutTests/ChangeLog	2013-10-24 23:14:10 UTC (rev 157959)
@@ -1,3 +1,19 @@
+2013-10-24  Roger Fong  <[email protected]>
+
+        Add texture level dependent size checks to textureImage2D calls.
+        https://bugs.webkit.org/show_bug.cgi?id=123290
+        <rdar://problem/15201382>
+
+        Reviewed by Dean Jackson.
+
+        * platform/mac/TestExpectations: Unskip now passing test texture-size-limit.html.
+
+2013-10-24  Roger Fong  <[email protected]>
+
+        Unreviewed gardening. Skip some failing WebGL Conformance suite 1.0.1 tests.
+
+        * platform/mac/TestExpectations:
+
 2013-10-24  Grzegorz Czajkowski  <[email protected]>
 
         dumpAsText() is unnecessarily called in spellchecking tests

Modified: trunk/LayoutTests/platform/mac/TestExpectations (157958 => 157959)


--- trunk/LayoutTests/platform/mac/TestExpectations	2013-10-24 22:22:21 UTC (rev 157958)
+++ trunk/LayoutTests/platform/mac/TestExpectations	2013-10-24 23:14:10 UTC (rev 157959)
@@ -723,13 +723,8 @@
 webgl/1.0.2/conformance/ogles/GL/gl_FragCoord/gl_FragCoord_001_to_003.html
 webgl/1.0.2/conformance/renderbuffers/framebuffer-object-attachment.html
 webgl/1.0.2/conformance/rendering/gl-scissor-test.html
-webgl/1.0.2/conformance/textures/texture-size-limit.html
 webgl/1.0.2/conformance/typedarrays/array-unit-tests.html
 webgl/1.0.2/conformance/typedarrays/data-view-test.html
-webgl/1.0.2/conformance/glsl/functions/glsl-function-smoothstep-gentype.html
-webgl/1.0.2/conformance/glsl/variables/gl-pointcoord.html
-webgl/1.0.2/conformance/ogles/GL/operators/operators_009_to_016.html
-http/tests/webgl/1.0.2/origin-clean-conformance.html
 
 # Failing on bots.
 webgl/1.0.1/conformance/context/context-lost-restored.html [ Failure ]
@@ -750,6 +745,14 @@
 webgl/1.0.1/conformance/textures/origin-clean-conformance.html
 webgl/1.0.2/conformance/context/context-creation-and-destruction.html
 webgl/1.0.2/conformance/rendering/multisample-corruption.html
+webgl/1.0.2/conformance/glsl/functions/glsl-function-smoothstep-gentype.html
+webgl/1.0.2/conformance/glsl/variables/gl-pointcoord.html
+webgl/1.0.2/conformance/ogles/GL/operators/operators_009_to_016.html
+webgl/1.0.2/conformance/ogles/GL/control_flow/control_flow_009_to_010.html
+webgl/1.0.2/conformance/glsl/misc/shader-with-non-reserved-words.html
+webgl/1.0.2/conformance/state/gl-object-get-calls.html
+webgl/1.0.2/conformance/uniforms/gl-uniform-arrays.html
+http/tests/webgl/1.0.2/origin-clean-conformance.html
 
 # Sending the mouse down event to the scrollbar starts a nested run loop which causes a hang.
 fast/events/mousedown-in-subframe-scrollbar.html

Modified: trunk/Source/WebCore/ChangeLog (157958 => 157959)


--- trunk/Source/WebCore/ChangeLog	2013-10-24 22:22:21 UTC (rev 157958)
+++ trunk/Source/WebCore/ChangeLog	2013-10-24 23:14:10 UTC (rev 157959)
@@ -1,3 +1,19 @@
+2013-10-24  Roger Fong  <[email protected]>
+
+        Add texture level dependent size checks to textureImage2D calls.
+        https://bugs.webkit.org/show_bug.cgi?id=123290
+        <rdar://problem/15201382>
+
+        Reviewed by Dean Jackson
+
+        Test covered by WebGL Conformance suite 1.0.2 test, textures/texture-size-limit.html.
+
+        There are different size limits when calling textureImage2D on different texture levels.
+        We should be throwing an error if our texture size exceeds these limits.
+
+        * html/canvas/WebGLRenderingContext.cpp:
+        (WebCore::WebGLRenderingContext::validateTexFuncParameters):
+
 2013-10-24  Thiago de Barros Lacerda  <[email protected]>
 
         [MediaStream API] allow a stream source to be shared

Modified: trunk/Source/WebCore/html/canvas/WebGLRenderingContext.cpp (157958 => 157959)


--- trunk/Source/WebCore/html/canvas/WebGLRenderingContext.cpp	2013-10-24 22:22:21 UTC (rev 157958)
+++ trunk/Source/WebCore/html/canvas/WebGLRenderingContext.cpp	2013-10-24 23:14:10 UTC (rev 157959)
@@ -5156,9 +5156,10 @@
         return false;
     }
 
+    GC3Dint maxTextureSizeForLevel = pow(2.0, m_maxTextureLevel - 1 - level);
     switch (target) {
     case GraphicsContext3D::TEXTURE_2D:
-        if (width > m_maxTextureSize || height > m_maxTextureSize) {
+        if (width > maxTextureSizeForLevel || height > maxTextureSizeForLevel) {
             synthesizeGLError(GraphicsContext3D::INVALID_VALUE, functionName, "width or height out of range");
             return false;
         }
@@ -5170,12 +5171,12 @@
     case GraphicsContext3D::TEXTURE_CUBE_MAP_POSITIVE_Z:
     case GraphicsContext3D::TEXTURE_CUBE_MAP_NEGATIVE_Z:
         if (functionType != TexSubImage2D && width != height) {
-          synthesizeGLError(GraphicsContext3D::INVALID_VALUE, functionName, "width != height for cube map");
-          return false;
+            synthesizeGLError(GraphicsContext3D::INVALID_VALUE, functionName, "width != height for cube map");
+            return false;
         }
         // No need to check height here. For texImage width == height.
         // For texSubImage that will be checked when checking yoffset + height is in range.
-        if (width > m_maxCubeMapTextureSize) {
+        if (width > maxTextureSizeForLevel) {
             synthesizeGLError(GraphicsContext3D::INVALID_VALUE, functionName, "width or height out of range for cube map");
             return false;
         }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to