Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion extensions/EXT_texture_norm16/extension.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<number>44</number>

<depends>
<api version="1.0"/>
<api version="2.0"/>
</depends>

<overview>
Expand Down Expand Up @@ -73,5 +73,10 @@ interface EXT_texture_norm16 {
<revision date="2019/09/25">
<change>Promoted to Draft.</change>
</revision>
<revision date="2020/08/10">
<change>Specialized to WebGL 2.0 after WG agreement, since this
extension refers to sized internal formats unavailable in WebGL
1.0.</change>
</revision>
</history>
</draft>
22 changes: 21 additions & 1 deletion sdk/tests/conformance2/extensions/ext-texture-norm16.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
debug("");

var wtu = WebGLTestUtils;
var gl = wtu.create3DContext();
var gl = wtu.create3DContext(null, null, 2);
Copy link
Contributor

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/*.

Copy link
Member Author

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.

var ext;

var formats = null;
Expand Down Expand Up @@ -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()];
Expand Down Expand Up @@ -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);
Copy link
Member

Choose a reason for hiding this comment

The 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
But since it's negtive test, I think it be okay as long as this wouldn't lead to crash.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it crashes, that would make this an essential negative test! :)

Copy link
Member Author

Choose a reason for hiding this comment

The 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() {
Expand Down