Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[WebGL] Only require that the stencil value and write masks have as m…
…any bits set as the stencil buffer is deep

https://bugs.webkit.org/show_bug.cgi?id=149174

Patch by Jinyoung Hur <hur.ims@navercorp.com> on 2015-09-15
Reviewed by Dean Jackson.

Copied the stencil mask related tests from the webgl/1.0.2/resources/webgl_test_files/conformance/state/gl-get-calls.html.

It seems that there is a difference in the way that glGetIntegerV returns an unsigned int type value among
OpenGL implementatios. Some return the whole bits of value(e.g., 0xffffffff -> 0xffffffff), whereas some(e.g., ANGLE)
return a max-int-clamped value(e.g., 0xffffffff -> 0x7fffffff).

It would be good to make this test independent on the OpenGL implementations.

* fast/canvas/webgl/gl-get-calls-expected.txt:
* fast/canvas/webgl/gl-get-calls.html:

Canonical link: https://commits.webkit.org/167295@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@189838 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
hurims authored and webkit-commit-queue committed Sep 16, 2015
1 parent 8cec197 commit 6f7d719
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 8 deletions.
18 changes: 18 additions & 0 deletions LayoutTests/ChangeLog
@@ -1,3 +1,21 @@
2015-09-15 Jinyoung Hur <hur.ims@navercorp.com>

[WebGL] Only require that the stencil value and write masks have as many bits set as the stencil buffer is deep
https://bugs.webkit.org/show_bug.cgi?id=149174

Reviewed by Dean Jackson.

Copied the stencil mask related tests from the webgl/1.0.2/resources/webgl_test_files/conformance/state/gl-get-calls.html.

It seems that there is a difference in the way that glGetIntegerV returns an unsigned int type value among
OpenGL implementatios. Some return the whole bits of value(e.g., 0xffffffff -> 0xffffffff), whereas some(e.g., ANGLE)
return a max-int-clamped value(e.g., 0xffffffff -> 0x7fffffff).

It would be good to make this test independent on the OpenGL implementations.

* fast/canvas/webgl/gl-get-calls-expected.txt:
* fast/canvas/webgl/gl-get-calls.html:

2015-09-15 Gyuyoung Kim <gyuyoung.kim@webkit.org>

[EFL] Unreviewed gardening 16th Sep.
Expand Down
8 changes: 4 additions & 4 deletions LayoutTests/fast/canvas/webgl/gl-get-calls-expected.txt
Expand Up @@ -54,8 +54,8 @@ PASS context.getParameter(context.STENCIL_BACK_FUNC) is context.ALWAYS
PASS context.getParameter(context.STENCIL_BACK_PASS_DEPTH_FAIL) is context.KEEP
PASS context.getParameter(context.STENCIL_BACK_PASS_DEPTH_PASS) is context.KEEP
PASS context.getParameter(context.STENCIL_BACK_REF) is 0
PASS context.getParameter(context.STENCIL_BACK_VALUE_MASK) is 0xFFFFFFFF
PASS context.getParameter(context.STENCIL_BACK_WRITEMASK) is 0xFFFFFFFF
PASS context.getParameter(context.STENCIL_BACK_VALUE_MASK) & minimumRequiredStencilMask is minimumRequiredStencilMask
PASS context.getParameter(context.STENCIL_BACK_WRITEMASK) & minimumRequiredStencilMask is minimumRequiredStencilMask
PASS context.getParameter(context.STENCIL_BITS) >= 0 is true
PASS context.getParameter(context.STENCIL_CLEAR_VALUE) is 0
PASS context.getParameter(context.STENCIL_FAIL) is context.KEEP
Expand All @@ -64,8 +64,8 @@ PASS context.getParameter(context.STENCIL_PASS_DEPTH_FAIL) is context.KEEP
PASS context.getParameter(context.STENCIL_PASS_DEPTH_PASS) is context.KEEP
PASS context.getParameter(context.STENCIL_REF) is 0
PASS context.getParameter(context.STENCIL_TEST) is false
PASS context.getParameter(context.STENCIL_VALUE_MASK) is 0xFFFFFFFF
PASS context.getParameter(context.STENCIL_WRITEMASK) is 0xFFFFFFFF
PASS context.getParameter(context.STENCIL_VALUE_MASK) & minimumRequiredStencilMask is minimumRequiredStencilMask
PASS context.getParameter(context.STENCIL_WRITEMASK) & minimumRequiredStencilMask is minimumRequiredStencilMask
PASS context.getParameter(context.TEXTURE_BINDING_2D) is null
PASS context.getParameter(context.TEXTURE_BINDING_CUBE_MAP) is null
PASS context.getParameter(context.UNPACK_ALIGNMENT) is 4
Expand Down
12 changes: 8 additions & 4 deletions LayoutTests/fast/canvas/webgl/gl-get-calls.html
Expand Up @@ -17,6 +17,7 @@
debug("");
debug("Canvas.getContext");

var minimumRequiredStencilMask = 0;
var context = create3DContext(document.getElementById("canvas"));
if (!context)
testFailed("context does not exist");
Expand Down Expand Up @@ -81,8 +82,11 @@
shouldBe('context.getParameter(context.STENCIL_BACK_PASS_DEPTH_PASS)', 'context.KEEP');
shouldBe('context.getParameter(context.STENCIL_BACK_REF)', '0');

shouldBe('context.getParameter(context.STENCIL_BACK_VALUE_MASK)', '0xFFFFFFFF');
shouldBe('context.getParameter(context.STENCIL_BACK_WRITEMASK)', '0xFFFFFFFF');
var stencilBits = context.getParameter(context.STENCIL_BITS);
minimumRequiredStencilMask = (1 << stencilBits) - 1;

shouldBe('context.getParameter(context.STENCIL_BACK_VALUE_MASK) & minimumRequiredStencilMask', 'minimumRequiredStencilMask');
shouldBe('context.getParameter(context.STENCIL_BACK_WRITEMASK) & minimumRequiredStencilMask', 'minimumRequiredStencilMask');

// If EXT_packed_depth_stencil is supported, STENCIL_BITS > 0; otherwise, STENCIL_BITS == 0.
shouldBe('context.getParameter(context.STENCIL_BITS) >= 0', 'true');
Expand All @@ -94,8 +98,8 @@
shouldBe('context.getParameter(context.STENCIL_REF)', '0');
shouldBe('context.getParameter(context.STENCIL_TEST)', 'false');

shouldBe('context.getParameter(context.STENCIL_VALUE_MASK)', '0xFFFFFFFF');
shouldBe('context.getParameter(context.STENCIL_WRITEMASK)', '0xFFFFFFFF');
shouldBe('context.getParameter(context.STENCIL_VALUE_MASK) & minimumRequiredStencilMask', 'minimumRequiredStencilMask');
shouldBe('context.getParameter(context.STENCIL_WRITEMASK) & minimumRequiredStencilMask', 'minimumRequiredStencilMask');

shouldBe('context.getParameter(context.TEXTURE_BINDING_2D)', 'null');
shouldBe('context.getParameter(context.TEXTURE_BINDING_CUBE_MAP)', 'null');
Expand Down

0 comments on commit 6f7d719

Please sign in to comment.