-
Notifications
You must be signed in to change notification settings - Fork 685
Specialize EXT_texture_norm16 to WebGL 2.0. #3136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,7 +23,7 @@ | |
| debug(""); | ||
|
|
||
| var wtu = WebGLTestUtils; | ||
| var gl = wtu.create3DContext(); | ||
| var gl = wtu.create3DContext(null, null, 2); | ||
| var ext; | ||
|
|
||
| var formats = null; | ||
|
|
@@ -138,6 +138,21 @@ | |
| gl.bindTexture(gl.TEXTURE_2D, null); | ||
| } | ||
|
|
||
| function testSnorm16Unrenderable(internalFormat, format, type) { | ||
| gl.bindTexture(gl.TEXTURE_2D, textures[1]); | ||
| gl.texImage2D(gl.TEXTURE_2D, 0, internalFormat, 1, 1, 0, format, type, null); | ||
|
|
||
| wtu.glErrorShouldBe(gl, gl.NO_ERROR, "texture definition succeeded"); | ||
|
|
||
| gl.bindFramebuffer(gl.FRAMEBUFFER, fbos[0]); | ||
| gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, textures[1], 0); | ||
|
|
||
| wtu.glErrorShouldBe(gl, gl.NO_ERROR, "fbo binding succeeded"); | ||
|
|
||
| wtu.framebufferStatusShouldBe(gl, gl.FRAMEBUFFER, [ gl.FRAMEBUFFER_INCOMPLETE_ATTACHMENT, gl.FRAMEBUFFER_UNSUPPORTED ], | ||
| "framebuffer should not be complete with SNORM16 texture attached"); | ||
| } | ||
|
|
||
| function runTestExtension() { | ||
| textures = [gl.createTexture(), gl.createTexture()]; | ||
| fbos = [gl.createFramebuffer(), gl.createFramebuffer()]; | ||
|
|
@@ -174,6 +189,11 @@ | |
| testNorm16Render(ext.R16_EXT, gl.RED, gl.UNSIGNED_SHORT, 0); | ||
| testNorm16Render(ext.RG16_EXT, gl.RG, gl.UNSIGNED_SHORT, 0); | ||
| testNorm16Render(ext.RGBA16_EXT, gl.RGBA, gl.UNSIGNED_SHORT, 0); | ||
|
|
||
| testSnorm16Unrenderable(ext.R16_SNORM_EXT, gl.RED, gl.SHORT); | ||
| testSnorm16Unrenderable(ext.RG16_SNORM_EXT, gl.RG, gl.SHORT); | ||
| testSnorm16Unrenderable(ext.RGB16_SNORM_EXT, gl.RGB, gl.SHORT); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. https://www.khronos.org/registry/OpenGL/extensions/EXT/EXT_render_snorm.txt doesn't include RGB16_SNORM
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If it crashes, that would make this an essential negative test! :)
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for pointing that out. It's probably an oversight in EXT_render_snorm; there is a reference to RGB16_SNORM_EXT in the section "Interactions with EXT_texture_norm16". |
||
| testSnorm16Unrenderable(ext.RGBA16_SNORM_EXT, gl.RGBA, gl.SHORT); | ||
| }; | ||
|
|
||
| function runTest() { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't need this, since this is in conformance2/*.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's needed to support navigating directly to this test rather than running it inside the harness, which makes debugging simpler. Most of the other tests under conformance2/ do this; it was an oversight that this test didn't.