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
16 changes: 12 additions & 4 deletions extensions/WEBGL_shader_pixel_local_storage/extension.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,17 @@ interface WEBGL_shader_pixel_local_storage {
const GLenum PIXEL_LOCAL_TEXTURE_NAME_WEBGL = 0x96E8;
const GLenum PIXEL_LOCAL_TEXTURE_LEVEL_WEBGL = 0x96E9;
const GLenum PIXEL_LOCAL_TEXTURE_LAYER_WEBGL = 0x96EA;
const GLenum PIXEL_LOCAL_CLEAR_VALUE_FLOAT_WEBGL = 0x96EB;
const GLenum PIXEL_LOCAL_CLEAR_VALUE_INT_WEBGL = 0x96EC;
const GLenum PIXEL_LOCAL_CLEAR_VALUE_UNSIGNED_INT_WEBGL = 0x96ED;
const GLenum PIXEL_LOCAL_USAGE_WEBGL = 0x96EB;
const GLenum PIXEL_LOCAL_CLEAR_VALUE_FLOAT_WEBGL = 0x96EC;
const GLenum PIXEL_LOCAL_CLEAR_VALUE_INT_WEBGL = 0x96ED;
const GLenum PIXEL_LOCAL_CLEAR_VALUE_UNSIGNED_INT_WEBGL = 0x96EE;
const GLenum PIXEL_LOCAL_USAGE_ALWAYS_NONCOHERENT_BIT_WEBGL = 0x1;
GLboolean isCoherent();
undefined framebufferTexturePixelLocalStorageWEBGL(GLint plane,
WebGLTexture? texture,
GLint level,
GLint layer);
GLint layer,
GLbitfield usage);
undefined framebufferPixelLocalClearValuefvWEBGL(GLint plane,
Float32List value,
optional unsigned long long srcOffset = 0);
Expand Down Expand Up @@ -121,6 +124,7 @@ interface WEBGL_shader_pixel_local_storage {
<param name="texture" type="WebGLTexture?"/>
<param name="level" type="GLint"/>
<param name="layer" type="GLint"/>
<param name="usage" type="GLbitfield"/>
<p>
Establishes the backing texture for the given plane.
</p>
Expand Down Expand Up @@ -266,6 +270,7 @@ interface WEBGL_shader_pixel_local_storage {
<tr><td>PIXEL_LOCAL_TEXTURE_NAME_WEBGL</td><td>WebGLTexture?</td></tr>
<tr><td>PIXEL_LOCAL_TEXTURE_LEVEL_WEBGL</td><td>GLint</td></tr>
<tr><td>PIXEL_LOCAL_TEXTURE_LAYER_WEBGL</td><td>GLint</td></tr>
<tr><td>PIXEL_LOCAL_USAGE_WEBGL</td><td>GLbitfield</td></tr>
<tr><td>PIXEL_LOCAL_CLEAR_VALUE_FLOAT_WEBGL</td><td>Float32Array</td></tr>
<tr><td>PIXEL_LOCAL_CLEAR_VALUE_INT_WEBGL</td><td>Int32Array</td></tr>
<tr><td>PIXEL_LOCAL_CLEAR_VALUE_UNSIGNED_INT_WEBGL</td><td>Uint32Array</td></tr>
Expand All @@ -283,5 +288,8 @@ interface WEBGL_shader_pixel_local_storage {
<revision date="2025/03/24">
<change>Removed MAX_COLOR_ATTACHMENTS_WITH_ACTIVE_PIXEL_LOCAL_STORAGE_WEBGL enum, which was removed from the underlying ANGLE extension.</change>
</revision>
<revision date="2026/02/20">
<change>Added non-coherent "usage" flag and revised enum values, tracking ANGLE extension.</change>
</revision>
</history>
</draft>
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,11 @@
shouldBe("pls.PIXEL_LOCAL_TEXTURE_NAME_WEBGL", "0x96E8");
shouldBe("pls.PIXEL_LOCAL_TEXTURE_LEVEL_WEBGL", "0x96E9");
shouldBe("pls.PIXEL_LOCAL_TEXTURE_LAYER_WEBGL", "0x96EA");
shouldBe("pls.PIXEL_LOCAL_CLEAR_VALUE_FLOAT_WEBGL", "0x96EB");
shouldBe("pls.PIXEL_LOCAL_CLEAR_VALUE_INT_WEBGL", "0x96EC");
shouldBe("pls.PIXEL_LOCAL_CLEAR_VALUE_UNSIGNED_INT_WEBGL", "0x96ED");
shouldBe("pls.PIXEL_LOCAL_USAGE_WEBGL", "0x96EB");
shouldBe("pls.PIXEL_LOCAL_CLEAR_VALUE_FLOAT_WEBGL", "0x96EC");
shouldBe("pls.PIXEL_LOCAL_CLEAR_VALUE_INT_WEBGL", "0x96ED");
shouldBe("pls.PIXEL_LOCAL_CLEAR_VALUE_UNSIGNED_INT_WEBGL", "0x96EE");
shouldBe("pls.PIXEL_LOCAL_USAGE_ALWAYS_NONCOHERENT_BIT_WEBGL", "0x1");
}

function checkImplementationDependentLimits() {
Expand Down Expand Up @@ -182,6 +184,8 @@
i, pls.PIXEL_LOCAL_TEXTURE_LEVEL_WEBGL) == 0);
expectTrue(pls.getFramebufferPixelLocalStorageParameterWEBGL(
i, pls.PIXEL_LOCAL_TEXTURE_LAYER_WEBGL) == 0);
expectTrue(pls.getFramebufferPixelLocalStorageParameterWEBGL(
i, pls.PIXEL_LOCAL_USAGE_WEBGL) == 0);
expectTrue(arraysEqual(
pls.getFramebufferPixelLocalStorageParameterWEBGL(
i, pls.PIXEL_LOCAL_CLEAR_VALUE_FLOAT_WEBGL),
Expand Down Expand Up @@ -211,7 +215,7 @@
gl.texStorage2D(gl.TEXTURE_2D, 1, gl.RGBA8, 1, 1);
wtu.glErrorShouldBe(gl, gl.NONE);
gl.deleteTexture(tex);
pls.framebufferTexturePixelLocalStorageWEBGL(0, tex, 0, 0);
pls.framebufferTexturePixelLocalStorageWEBGL(0, tex, 0, 0, 0);
wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION);

debug("\nIf 'texture' was generated by a different WebGL2RenderingContext than this one, " +
Expand All @@ -220,7 +224,7 @@
const tex2 = gl2.createTexture();
gl2.bindTexture(gl2.TEXTURE_2D, tex2);
gl2.texStorage2D(gl2.TEXTURE_2D, 1, gl2.RGBA8, 1, 1);
pls.framebufferTexturePixelLocalStorageWEBGL(0, tex2, 0, 0);
pls.framebufferTexturePixelLocalStorageWEBGL(0, tex2, 0, 0, 0);
wtu.glErrorShouldBe(gl2, gl2.NONE);
wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION);

Expand Down Expand Up @@ -294,10 +298,10 @@
gl.bindTexture(gl.TEXTURE_2D, validTex);
gl.texStorage2D(gl.TEXTURE_2D, 1, gl.RGBA8, 1, 1);
wtu.glErrorShouldBe(gl, gl.NONE);
pls.framebufferTexturePixelLocalStorageWEBGL(0, validTex, 0, 0);
pls.framebufferTexturePixelLocalStorageWEBGL(0, validTex, 0, 0, 0);
shouldBeTrue(`pls.getFramebufferPixelLocalStorageParameterWEBGL(
0, pls.PIXEL_LOCAL_TEXTURE_NAME_WEBGL) === validTex`);
pls.framebufferTexturePixelLocalStorageWEBGL(0, null, 0, 0);
pls.framebufferTexturePixelLocalStorageWEBGL(0, null, 0, 0, 0);
shouldBeTrue(`pls.getFramebufferPixelLocalStorageParameterWEBGL(
0, pls.PIXEL_LOCAL_TEXTURE_NAME_WEBGL) === null`);

Expand All @@ -323,7 +327,7 @@

const plsFBO = localGL.createFramebuffer();
localGL.bindFramebuffer(localGL.FRAMEBUFFER, plsFBO);
localPLS.framebufferTexturePixelLocalStorageWEBGL(0, tex, 0, 0);
localPLS.framebufferTexturePixelLocalStorageWEBGL(0, tex, 0, 0, 0);
wtu.glErrorShouldBe(localGL, localGL.NONE);

localGL.viewport(0, 0, localCanvas.width, localCanvas.height);
Expand Down