Skip to content

Commit

Permalink
Move WebGL extensions approved on 2024-01-25 out of draft
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=268163

Reviewed by Kimmo Kinnunen.

Enabled support for the following approved extensions:
* EXT_texture_mirror_clamp_to_edge
* WEBGL_render_shared_exponent
* WEBGL_stencil_texturing

* LayoutTests/platform/ios-simulator/webgl/webgl-draft-extensions-flag-default-expected.txt:
* LayoutTests/platform/ios-simulator/webgl/webgl-draft-extensions-flag-on-expected.txt:
* LayoutTests/webgl/resources/webgl-draft-extensions-flag.js:
* LayoutTests/webgl/webgl-draft-extensions-flag-default-expected.txt:
* LayoutTests/webgl/webgl-draft-extensions-flag-off-expected.txt:
* LayoutTests/webgl/webgl-draft-extensions-flag-on-expected.txt:
* Source/WebCore/html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::getExtension):
(WebCore::WebGL2RenderingContext::getSupportedExtensions):
* Source/WebCore/html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::getExtension):
(WebCore::WebGLRenderingContext::getSupportedExtensions):

Canonical link: https://commits.webkit.org/273645@main
  • Loading branch information
lexaknyazev authored and kkinnunen-apple committed Jan 29, 2024
1 parent eb1c484 commit e65977c
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 48 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,16 @@ This test outputs which WebGL draft extensions are available.

On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".

TEST COMPLETE: 14 PASS, 0 FAIL
TEST COMPLETE: 8 PASS, 0 FAIL


PASS webgl:EXT_texture_mirror_clamp_to_edge: Supported
PASS webgl:EXT_texture_mirror_clamp_to_edge: Has object.
PASS webgl2:EXT_render_snorm: Supported
PASS webgl2:EXT_render_snorm: Has object.
PASS webgl2:EXT_texture_mirror_clamp_to_edge: Supported
PASS webgl2:EXT_texture_mirror_clamp_to_edge: Has object.
PASS webgl2:OES_sample_variables: Supported
PASS webgl2:OES_sample_variables: Has object.
PASS webgl2:OES_shader_multisample_interpolation: Not supported
PASS webgl2:WEBGL_draw_instanced_base_vertex_base_instance: Not supported
PASS webgl2:WEBGL_multi_draw_instanced_base_vertex_base_instance: Not supported
PASS webgl2:WEBGL_stencil_texturing: Supported
PASS webgl2:WEBGL_stencil_texturing: Has object.
PASS successfullyParsed is true

TEST COMPLETE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,16 @@ This test outputs which WebGL draft extensions are available.

On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".

TEST COMPLETE: 14 PASS, 0 FAIL
TEST COMPLETE: 8 PASS, 0 FAIL


PASS webgl:EXT_texture_mirror_clamp_to_edge: Supported
PASS webgl:EXT_texture_mirror_clamp_to_edge: Has object.
PASS webgl2:EXT_render_snorm: Supported
PASS webgl2:EXT_render_snorm: Has object.
PASS webgl2:EXT_texture_mirror_clamp_to_edge: Supported
PASS webgl2:EXT_texture_mirror_clamp_to_edge: Has object.
PASS webgl2:OES_sample_variables: Supported
PASS webgl2:OES_sample_variables: Has object.
PASS webgl2:OES_shader_multisample_interpolation: Not supported
PASS webgl2:WEBGL_draw_instanced_base_vertex_base_instance: Not supported
PASS webgl2:WEBGL_multi_draw_instanced_base_vertex_base_instance: Not supported
PASS webgl2:WEBGL_stencil_texturing: Supported
PASS webgl2:WEBGL_stencil_texturing: Has object.
PASS successfullyParsed is true

TEST COMPLETE
Expand Down
6 changes: 0 additions & 6 deletions LayoutTests/webgl/resources/webgl-draft-extensions-flag.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,13 @@

let currentDraftExtensions = {
"webgl": [
"EXT_texture_mirror_clamp_to_edge",
],
"webgl2" : [
"EXT_render_snorm",
"EXT_texture_mirror_clamp_to_edge",
"OES_sample_variables",
"OES_shader_multisample_interpolation",
"WEBGL_draw_instanced_base_vertex_base_instance",
"WEBGL_multi_draw_instanced_base_vertex_base_instance",
// Not checked here because availability would be
// different for Intel and Apple silicon Macs
// "WEBGL_render_shared_exponent",
"WEBGL_stencil_texturing",
]
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,11 @@ This test outputs which WebGL draft extensions are available.

On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".

TEST COMPLETE: 17 PASS, 0 FAIL
TEST COMPLETE: 11 PASS, 0 FAIL


PASS webgl:EXT_texture_mirror_clamp_to_edge: Supported
PASS webgl:EXT_texture_mirror_clamp_to_edge: Has object.
PASS webgl2:EXT_render_snorm: Supported
PASS webgl2:EXT_render_snorm: Has object.
PASS webgl2:EXT_texture_mirror_clamp_to_edge: Supported
PASS webgl2:EXT_texture_mirror_clamp_to_edge: Has object.
PASS webgl2:OES_sample_variables: Supported
PASS webgl2:OES_sample_variables: Has object.
PASS webgl2:OES_shader_multisample_interpolation: Supported
Expand All @@ -19,8 +15,6 @@ PASS webgl2:WEBGL_draw_instanced_base_vertex_base_instance: Supported
PASS webgl2:WEBGL_draw_instanced_base_vertex_base_instance: Has object.
PASS webgl2:WEBGL_multi_draw_instanced_base_vertex_base_instance: Supported
PASS webgl2:WEBGL_multi_draw_instanced_base_vertex_base_instance: Has object.
PASS webgl2:WEBGL_stencil_texturing: Supported
PASS webgl2:WEBGL_stencil_texturing: Has object.
PASS successfullyParsed is true

TEST COMPLETE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,14 @@ This test outputs which WebGL draft extensions are available.

On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".

TEST COMPLETE: 9 PASS, 0 FAIL
TEST COMPLETE: 6 PASS, 0 FAIL


PASS webgl:EXT_texture_mirror_clamp_to_edge: Not supported
PASS webgl2:EXT_render_snorm: Not supported
PASS webgl2:EXT_texture_mirror_clamp_to_edge: Not supported
PASS webgl2:OES_sample_variables: Not supported
PASS webgl2:OES_shader_multisample_interpolation: Not supported
PASS webgl2:WEBGL_draw_instanced_base_vertex_base_instance: Not supported
PASS webgl2:WEBGL_multi_draw_instanced_base_vertex_base_instance: Not supported
PASS webgl2:WEBGL_stencil_texturing: Not supported
PASS successfullyParsed is true

TEST COMPLETE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,11 @@ This test outputs which WebGL draft extensions are available.

On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".

TEST COMPLETE: 17 PASS, 0 FAIL
TEST COMPLETE: 11 PASS, 0 FAIL


PASS webgl:EXT_texture_mirror_clamp_to_edge: Supported
PASS webgl:EXT_texture_mirror_clamp_to_edge: Has object.
PASS webgl2:EXT_render_snorm: Supported
PASS webgl2:EXT_render_snorm: Has object.
PASS webgl2:EXT_texture_mirror_clamp_to_edge: Supported
PASS webgl2:EXT_texture_mirror_clamp_to_edge: Has object.
PASS webgl2:OES_sample_variables: Supported
PASS webgl2:OES_sample_variables: Has object.
PASS webgl2:OES_shader_multisample_interpolation: Supported
Expand All @@ -19,8 +15,6 @@ PASS webgl2:WEBGL_draw_instanced_base_vertex_base_instance: Supported
PASS webgl2:WEBGL_draw_instanced_base_vertex_base_instance: Has object.
PASS webgl2:WEBGL_multi_draw_instanced_base_vertex_base_instance: Supported
PASS webgl2:WEBGL_multi_draw_instanced_base_vertex_base_instance: Has object.
PASS webgl2:WEBGL_stencil_texturing: Supported
PASS webgl2:WEBGL_stencil_texturing: Has object.
PASS successfullyParsed is true

TEST COMPLETE
Expand Down
12 changes: 6 additions & 6 deletions Source/WebCore/html/canvas/WebGL2RenderingContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2606,7 +2606,7 @@ std::optional<WebGLExtensionAny> WebGL2RenderingContext::getExtension(const Stri
ENABLE_IF_REQUESTED(EXTTextureCompressionBPTC, m_extTextureCompressionBPTC, "EXT_texture_compression_bptc"_s, EXTTextureCompressionBPTC::supported(*m_context));
ENABLE_IF_REQUESTED(EXTTextureCompressionRGTC, m_extTextureCompressionRGTC, "EXT_texture_compression_rgtc"_s, EXTTextureCompressionRGTC::supported(*m_context));
ENABLE_IF_REQUESTED(EXTTextureFilterAnisotropic, m_extTextureFilterAnisotropic, "EXT_texture_filter_anisotropic"_s, EXTTextureFilterAnisotropic::supported(*m_context));
ENABLE_IF_REQUESTED(EXTTextureMirrorClampToEdge, m_extTextureMirrorClampToEdge, "EXT_texture_mirror_clamp_to_edge"_s, EXTTextureMirrorClampToEdge::supported(*m_context) && enableDraftExtensions);
ENABLE_IF_REQUESTED(EXTTextureMirrorClampToEdge, m_extTextureMirrorClampToEdge, "EXT_texture_mirror_clamp_to_edge"_s, EXTTextureMirrorClampToEdge::supported(*m_context));
ENABLE_IF_REQUESTED(EXTTextureNorm16, m_extTextureNorm16, "EXT_texture_norm16"_s, EXTTextureNorm16::supported(*m_context));
ENABLE_IF_REQUESTED(KHRParallelShaderCompile, m_khrParallelShaderCompile, "KHR_parallel_shader_compile"_s, KHRParallelShaderCompile::supported(*m_context));
ENABLE_IF_REQUESTED(NVShaderNoperspectiveInterpolation, m_nvShaderNoperspectiveInterpolation, "NV_shader_noperspective_interpolation"_s, NVShaderNoperspectiveInterpolation::supported(*m_context));
Expand All @@ -2631,8 +2631,8 @@ std::optional<WebGLExtensionAny> WebGL2RenderingContext::getExtension(const Stri
ENABLE_IF_REQUESTED(WebGLMultiDrawInstancedBaseVertexBaseInstance, m_webglMultiDrawInstancedBaseVertexBaseInstance, "WEBGL_multi_draw_instanced_base_vertex_base_instance"_s, WebGLMultiDrawInstancedBaseVertexBaseInstance::supported(*m_context) && enableDraftExtensions);
ENABLE_IF_REQUESTED(WebGLPolygonMode, m_webglPolygonMode, "WEBGL_polygon_mode"_s, WebGLPolygonMode::supported(*m_context));
ENABLE_IF_REQUESTED(WebGLProvokingVertex, m_webglProvokingVertex, "WEBGL_provoking_vertex"_s, WebGLProvokingVertex::supported(*m_context));
ENABLE_IF_REQUESTED(WebGLRenderSharedExponent, m_webglRenderSharedExponent, "WEBGL_render_shared_exponent"_s, WebGLRenderSharedExponent::supported(*m_context) && enableDraftExtensions);
ENABLE_IF_REQUESTED(WebGLStencilTexturing, m_webglStencilTexturing, "WEBGL_stencil_texturing"_s, WebGLStencilTexturing::supported(*m_context) && enableDraftExtensions);
ENABLE_IF_REQUESTED(WebGLRenderSharedExponent, m_webglRenderSharedExponent, "WEBGL_render_shared_exponent"_s, WebGLRenderSharedExponent::supported(*m_context));
ENABLE_IF_REQUESTED(WebGLStencilTexturing, m_webglStencilTexturing, "WEBGL_stencil_texturing"_s, WebGLStencilTexturing::supported(*m_context));
return std::nullopt;
}

Expand Down Expand Up @@ -2661,7 +2661,7 @@ std::optional<Vector<String>> WebGL2RenderingContext::getSupportedExtensions()
APPEND_IF_SUPPORTED("EXT_texture_compression_bptc", EXTTextureCompressionBPTC::supported(*m_context))
APPEND_IF_SUPPORTED("EXT_texture_compression_rgtc", EXTTextureCompressionRGTC::supported(*m_context))
APPEND_IF_SUPPORTED("EXT_texture_filter_anisotropic", EXTTextureFilterAnisotropic::supported(*m_context))
APPEND_IF_SUPPORTED("EXT_texture_mirror_clamp_to_edge", EXTTextureMirrorClampToEdge::supported(*m_context) && enableDraftExtensions)
APPEND_IF_SUPPORTED("EXT_texture_mirror_clamp_to_edge", EXTTextureMirrorClampToEdge::supported(*m_context))
APPEND_IF_SUPPORTED("EXT_texture_norm16", EXTTextureNorm16::supported(*m_context))
APPEND_IF_SUPPORTED("KHR_parallel_shader_compile", KHRParallelShaderCompile::supported(*m_context))
APPEND_IF_SUPPORTED("NV_shader_noperspective_interpolation", NVShaderNoperspectiveInterpolation::supported(*m_context))
Expand All @@ -2686,8 +2686,8 @@ std::optional<Vector<String>> WebGL2RenderingContext::getSupportedExtensions()
APPEND_IF_SUPPORTED("WEBGL_multi_draw_instanced_base_vertex_base_instance", WebGLMultiDrawInstancedBaseVertexBaseInstance::supported(*m_context) && enableDraftExtensions)
APPEND_IF_SUPPORTED("WEBGL_polygon_mode", WebGLPolygonMode::supported(*m_context))
APPEND_IF_SUPPORTED("WEBGL_provoking_vertex", WebGLProvokingVertex::supported(*m_context))
APPEND_IF_SUPPORTED("WEBGL_render_shared_exponent", WebGLRenderSharedExponent::supported(*m_context) && enableDraftExtensions)
APPEND_IF_SUPPORTED("WEBGL_stencil_texturing", WebGLStencilTexturing::supported(*m_context) && enableDraftExtensions)
APPEND_IF_SUPPORTED("WEBGL_render_shared_exponent", WebGLRenderSharedExponent::supported(*m_context))
APPEND_IF_SUPPORTED("WEBGL_stencil_texturing", WebGLStencilTexturing::supported(*m_context))

return result;
}
Expand Down
8 changes: 4 additions & 4 deletions Source/WebCore/html/canvas/WebGLRenderingContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ std::optional<WebGLExtensionAny> WebGLRenderingContext::getExtension(const Strin
return std::nullopt;

// When adding extensions that use enableDraftExtensions, add them to the webgl-draft-extensions-flag.js test.
const bool enableDraftExtensions = scriptExecutionContext()->settingsValues().webGLDraftExtensionsEnabled;
[[maybe_unused]] const bool enableDraftExtensions = scriptExecutionContext()->settingsValues().webGLDraftExtensionsEnabled;

#define ENABLE_IF_REQUESTED(type, variable, nameLiteral, canEnable) \
if (equalIgnoringASCIICase(name, nameLiteral ## _s)) { \
Expand All @@ -161,7 +161,7 @@ std::optional<WebGLExtensionAny> WebGLRenderingContext::getExtension(const Strin
ENABLE_IF_REQUESTED(EXTTextureCompressionBPTC, m_extTextureCompressionBPTC, "EXT_texture_compression_bptc", EXTTextureCompressionBPTC::supported(*m_context));
ENABLE_IF_REQUESTED(EXTTextureCompressionRGTC, m_extTextureCompressionRGTC, "EXT_texture_compression_rgtc", EXTTextureCompressionRGTC::supported(*m_context));
ENABLE_IF_REQUESTED(EXTTextureFilterAnisotropic, m_extTextureFilterAnisotropic, "EXT_texture_filter_anisotropic", EXTTextureFilterAnisotropic::supported(*m_context));
ENABLE_IF_REQUESTED(EXTTextureMirrorClampToEdge, m_extTextureMirrorClampToEdge, "EXT_texture_mirror_clamp_to_edge", EXTTextureMirrorClampToEdge::supported(*m_context) && enableDraftExtensions);
ENABLE_IF_REQUESTED(EXTTextureMirrorClampToEdge, m_extTextureMirrorClampToEdge, "EXT_texture_mirror_clamp_to_edge", EXTTextureMirrorClampToEdge::supported(*m_context));
ENABLE_IF_REQUESTED(EXTsRGB, m_extsRGB, "EXT_sRGB", EXTsRGB::supported(*m_context));
ENABLE_IF_REQUESTED(KHRParallelShaderCompile, m_khrParallelShaderCompile, "KHR_parallel_shader_compile", KHRParallelShaderCompile::supported(*m_context));
ENABLE_IF_REQUESTED(OESElementIndexUint, m_oesElementIndexUint, "OES_element_index_uint", OESElementIndexUint::supported(*m_context));
Expand Down Expand Up @@ -198,7 +198,7 @@ std::optional<Vector<String>> WebGLRenderingContext::getSupportedExtensions()

Vector<String> result;

const bool enableDraftExtensions = scriptExecutionContext()->settingsValues().webGLDraftExtensionsEnabled;
[[maybe_unused]] const bool enableDraftExtensions = scriptExecutionContext()->settingsValues().webGLDraftExtensionsEnabled;

#define APPEND_IF_SUPPORTED(nameLiteral, condition) \
if (condition) \
Expand All @@ -217,7 +217,7 @@ std::optional<Vector<String>> WebGLRenderingContext::getSupportedExtensions()
APPEND_IF_SUPPORTED("EXT_texture_compression_bptc", EXTTextureCompressionBPTC::supported(*m_context))
APPEND_IF_SUPPORTED("EXT_texture_compression_rgtc", EXTTextureCompressionRGTC::supported(*m_context))
APPEND_IF_SUPPORTED("EXT_texture_filter_anisotropic", EXTTextureFilterAnisotropic::supported(*m_context))
APPEND_IF_SUPPORTED("EXT_texture_mirror_clamp_to_edge", EXTTextureMirrorClampToEdge::supported(*m_context) && enableDraftExtensions)
APPEND_IF_SUPPORTED("EXT_texture_mirror_clamp_to_edge", EXTTextureMirrorClampToEdge::supported(*m_context))
APPEND_IF_SUPPORTED("EXT_sRGB", EXTsRGB::supported(*m_context))
APPEND_IF_SUPPORTED("KHR_parallel_shader_compile", KHRParallelShaderCompile::supported(*m_context))
APPEND_IF_SUPPORTED("OES_element_index_uint", OESElementIndexUint::supported(*m_context))
Expand Down

0 comments on commit e65977c

Please sign in to comment.