Skip to content

Commit

Permalink
Adjust EXT_sRGB spec and extend its test (#3505)
Browse files Browse the repository at this point in the history
  • Loading branch information
lexaknyazev authored Dec 9, 2022
1 parent bbd2fa4 commit 9ffe585
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
6 changes: 6 additions & 0 deletions extensions/EXT_sRGB/extension.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
<overview>
<mirrors href="http://www.khronos.org/registry/gles/extensions/EXT/EXT_sRGB.txt"
name="EXT_sRGB">
<addendum>
Support for <code>OES_rgb8_rgba8</code> or equivalent functionality is not required.
</addendum>
</mirrors>

<features>
Expand Down Expand Up @@ -83,5 +86,8 @@
<revision date="2014/07/15">
<change>Added NoInterfaceObject extended attribute.</change>
</revision>
<revision date="2022/12/01">
<change>Clarified WebGL-specific behavioral changes.</change>
</revision>
</history>
</extension>
34 changes: 34 additions & 0 deletions sdk/tests/conformance/extensions/ext-sRGB.html
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,40 @@
runFormatTest(textureFormatFixture, false);
runFormatTest(renderbufferFormatFixture, false);

{
var fbo = gl.createFramebuffer();
gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);

debug("Checking getFramebufferAttachmentParameter with a renderbuffer");
{
var rbo = gl.createRenderbuffer();
gl.bindRenderbuffer(gl.RENDERBUFFER, rbo);
gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGB565, 1, 1);
gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, rbo);
wtu.glErrorShouldBe(gl, gl.NO_ERROR);
shouldBeNull('gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, 0x8210 /* FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT */)');
wtu.glErrorShouldBe(gl, gl.INVALID_ENUM);
gl.bindRenderbuffer(gl.RENDERBUFFER, null);
gl.deleteRenderbuffer(rbo);
}

debug("Checking getFramebufferAttachmentParameter with a texture");
{
var tex = gl.createTexture();
gl.bindTexture(gl.TEXTURE_2D, tex);
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex, 0);
wtu.glErrorShouldBe(gl, gl.NO_ERROR);
shouldBeNull('gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, 0x8210 /* FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT */)');
wtu.glErrorShouldBe(gl, gl.INVALID_ENUM);
gl.bindTexture(gl.TEXTURE_2D, null);
gl.deleteTexture(tex);
}

gl.bindFramebuffer(gl.FRAMEBUFFER, null);
gl.deleteFramebuffer(fbo);
}

debug("");
debug("Checking sRGB texture support");

Expand Down

0 comments on commit 9ffe585

Please sign in to comment.