Changeset 249218 in webkit
- Timestamp:
- Aug 28, 2019, 1:34:19 PM (7 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 11 edited
-
ChangeLog (modified) (1 diff)
-
html/canvas/ANGLEInstancedArrays.cpp (modified) (3 diffs)
-
html/canvas/WebGLCompressedTextureASTC.cpp (modified) (1 diff)
-
html/canvas/WebGLCompressedTextureATC.cpp (modified) (1 diff)
-
html/canvas/WebGLCompressedTexturePVRTC.cpp (modified) (1 diff)
-
html/canvas/WebGLCompressedTextureS3TC.cpp (modified) (2 diffs)
-
html/canvas/WebGLDebugShaders.cpp (modified) (1 diff)
-
html/canvas/WebGLDepthTexture.cpp (modified) (1 diff)
-
html/canvas/WebGLDrawBuffers.cpp (modified) (2 diffs)
-
platform/graphics/angle/GraphicsContext3DANGLE.cpp (modified) (3 diffs)
-
platform/graphics/cocoa/GraphicsContext3DCocoa.mm (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r249217 r249218 1 2019-08-28 Austin Eng <enga@chromium.org> 2 3 Create ANGLE EGL Context with all extensions disabled by default 4 https://bugs.webkit.org/show_bug.cgi?id=200900 5 6 Reviewed by Alex Christensen. 7 8 In WebGL, extensions must be explicitly requested before they are enabled. 9 Fixes the following WebGL conformance tests with the ANGLE backend 10 LayoutTests/webgl/*/conformance/extensions/ext-blend-minmax.html 11 LayoutTests/webgl/*/conformance/extensions/ext-frag-depth.html 12 LayoutTests/webgl/*/conformance/extensions/ext-shader-texture-lod.html 13 LayoutTests/webgl/*/conformance/extensions/ext-sRGB.html 14 LayoutTests/webgl/*/conformance/extensions/oes-standard-derivatives.html 15 LayoutTests/webgl/*/conformance/extensions/oes-texture-float.html 16 LayoutTests/webgl/*/conformance/extensions/webgl-compressed-texture-s3tc.html 17 LayoutTests/webgl/*/conformance/glsl/misc/shader-with-dfdx.frag.html 18 LayoutTests/webgl/*/conformance/glsl/variables/glsl-built-ins.html 19 LayoutTests/webgl/*/conformance/textures/misc/texture-npot-video.html 20 LayoutTests/webgl/*/conformance/textures/misc/texture-npot.html 21 22 * html/canvas/ANGLEInstancedArrays.cpp: 23 (WebCore::ANGLEInstancedArrays::ANGLEInstancedArrays): 24 (WebCore::ANGLEInstancedArrays::supported): 25 * html/canvas/WebGLCompressedTextureASTC.cpp: 26 (WebCore::WebGLCompressedTextureASTC::WebGLCompressedTextureASTC): 27 * html/canvas/WebGLCompressedTextureATC.cpp: 28 (WebCore::WebGLCompressedTextureATC::WebGLCompressedTextureATC): 29 * html/canvas/WebGLCompressedTexturePVRTC.cpp: 30 (WebCore::WebGLCompressedTexturePVRTC::WebGLCompressedTexturePVRTC): 31 * html/canvas/WebGLCompressedTextureS3TC.cpp: 32 (WebCore::WebGLCompressedTextureS3TC::WebGLCompressedTextureS3TC): 33 (WebCore::WebGLCompressedTextureS3TC::supported): 34 * html/canvas/WebGLDebugShaders.cpp: 35 (WebCore::WebGLDebugShaders::WebGLDebugShaders): 36 * html/canvas/WebGLDepthTexture.cpp: 37 (WebCore::WebGLDepthTexture::WebGLDepthTexture): 38 * html/canvas/WebGLDrawBuffers.cpp: 39 (WebCore::WebGLDrawBuffers::WebGLDrawBuffers): 40 (WebCore::WebGLDrawBuffers::supported): 41 * platform/graphics/angle/GraphicsContext3DANGLE.cpp: 42 (WebCore::GraphicsContext3D::reshapeFBOs): 43 (WebCore::GraphicsContext3D::validateDepthStencil): 44 * platform/graphics/cocoa/GraphicsContext3DCocoa.mm: 45 (WebCore::GraphicsContext3D::GraphicsContext3D): 46 1 47 2019-08-28 Said Abou-Hallawa <sabouhallawa@apple.com> 2 48 -
trunk/Source/WebCore/html/canvas/ANGLEInstancedArrays.cpp
r223728 r249218 29 29 #include "ANGLEInstancedArrays.h" 30 30 31 #if PLATFORM(GTK) 31 #if PLATFORM(GTK) || USE(ANGLE) 32 32 #include "Extensions3D.h" 33 33 #endif … … 38 38 : WebGLExtension(context) 39 39 { 40 #if USE(ANGLE) 41 context.graphicsContext3D()->getExtensions().ensureEnabled("GL_ANGLE_instanced_arrays"); 42 #endif 40 43 } 41 44 … … 50 53 { 51 54 #if PLATFORM(COCOA) 55 #if USE(ANGLE) 56 return context.graphicsContext3D()->getExtensions().supports("GL_ANGLE_instanced_arrays"); 57 #else 52 58 UNUSED_PARAM(context); 53 59 return true; 60 #endif 54 61 #elif PLATFORM(GTK) 55 62 return context.graphicsContext3D()->getExtensions().supports("GL_ANGLE_instanced_arrays"); -
trunk/Source/WebCore/html/canvas/WebGLCompressedTextureASTC.cpp
r233122 r249218 40 40 , m_isLDRSupported(context.graphicsContext3D()->getExtensions().supports("GL_KHR_texture_compression_astc_ldr"_s)) 41 41 { 42 context.graphicsContext3D()->getExtensions().ensureEnabled("GL_KHR_texture_compression_astc_hdr"_s); 43 context.graphicsContext3D()->getExtensions().ensureEnabled("GL_KHR_texture_compression_astc_ldr"_s); 44 42 45 context.addCompressedTextureFormat(Extensions3D::COMPRESSED_RGBA_ASTC_4x4_KHR); 43 46 context.addCompressedTextureFormat(Extensions3D::COMPRESSED_RGBA_ASTC_5x4_KHR); -
trunk/Source/WebCore/html/canvas/WebGLCompressedTextureATC.cpp
r223728 r249218 37 37 : WebGLExtension(context) 38 38 { 39 context.graphicsContext3D()->getExtensions().ensureEnabled("GL_AMD_compressed_ATC_texture"); 40 39 41 context.addCompressedTextureFormat(Extensions3D::COMPRESSED_ATC_RGB_AMD); 40 42 context.addCompressedTextureFormat(Extensions3D::COMPRESSED_ATC_RGBA_EXPLICIT_ALPHA_AMD); -
trunk/Source/WebCore/html/canvas/WebGLCompressedTexturePVRTC.cpp
r223728 r249218 38 38 : WebGLExtension(context) 39 39 { 40 context.graphicsContext3D()->getExtensions().ensureEnabled("GL_IMG_texture_compression_pvrtc"); 41 40 42 context.addCompressedTextureFormat(Extensions3D::COMPRESSED_RGB_PVRTC_4BPPV1_IMG); 41 43 context.addCompressedTextureFormat(Extensions3D::COMPRESSED_RGB_PVRTC_2BPPV1_IMG); -
trunk/Source/WebCore/html/canvas/WebGLCompressedTextureS3TC.cpp
r223728 r249218 38 38 : WebGLExtension(context) 39 39 { 40 auto& extensions = context.graphicsContext3D()->getExtensions(); 41 extensions.ensureEnabled("GL_EXT_texture_compression_dxt1"); 42 extensions.ensureEnabled("GL_ANGLE_texture_compression_dxt3"); 43 extensions.ensureEnabled("GL_ANGLE_texture_compression_dxt5"); 44 40 45 context.addCompressedTextureFormat(Extensions3D::COMPRESSED_RGB_S3TC_DXT1_EXT); 41 46 context.addCompressedTextureFormat(Extensions3D::COMPRESSED_RGBA_S3TC_DXT1_EXT); … … 54 59 { 55 60 auto& extensions = context.graphicsContext3D()->getExtensions(); 61 #if USE(ANGLE) 62 return extensions.supports("GL_EXT_texture_compression_dxt1") 63 && extensions.supports("GL_ANGLE_texture_compression_dxt3") 64 && extensions.supports("GL_ANGLE_texture_compression_dxt5"); 65 #else 56 66 return extensions.supports("GL_EXT_texture_compression_s3tc") 57 67 || extensions.supports("GL_EXT_texture_compression_dxt1"); 68 #endif 58 69 } 59 70 -
trunk/Source/WebCore/html/canvas/WebGLDebugShaders.cpp
r223728 r249218 39 39 : WebGLExtension(context) 40 40 { 41 context.graphicsContext3D()->getExtensions().ensureEnabled("GL_ANGLE_translated_shader_source"); 41 42 } 42 43 -
trunk/Source/WebCore/html/canvas/WebGLDepthTexture.cpp
r223728 r249218 37 37 : WebGLExtension(context) 38 38 { 39 context.graphicsContext3D()->getExtensions().ensureEnabled("GL_OES_depth_texture"); 40 context.graphicsContext3D()->getExtensions().ensureEnabled("GL_ARB_depth_texture"); 39 41 } 40 42 -
trunk/Source/WebCore/html/canvas/WebGLDrawBuffers.cpp
r223728 r249218 36 36 : WebGLExtension(context) 37 37 { 38 context.graphicsContext3D()->getExtensions().ensureEnabled("GL_EXT_draw_buffers"); 38 39 } 39 40 … … 47 48 bool WebGLDrawBuffers::supported(WebGLRenderingContextBase& context) 48 49 { 50 #if USE(ANGLE) 51 return context.graphicsContext3D()->getExtensions().supports("GL_EXT_draw_buffers"); 52 #else 49 53 return context.graphicsContext3D()->getExtensions().supports("GL_EXT_draw_buffers") 50 54 && satisfiesWebGLRequirements(context); 55 #endif 51 56 } 52 57 -
trunk/Source/WebCore/platform/graphics/angle/GraphicsContext3DANGLE.cpp
r248846 r249218 146 146 Extensions3D& extensions = getExtensions(); 147 147 // Use a 24 bit depth buffer where we know we have it. 148 if (extensions.supports( "GL_OES_packed_depth_stencil"))148 if (extensions.supports(packedDepthStencilExtensionName)) 149 149 internalDepthStencilFormat = GL_DEPTH24_STENCIL8_OES; 150 150 else … … 393 393 void GraphicsContext3D::validateDepthStencil(const char* packedDepthStencilExtension) 394 394 { 395 // Note there are no Extensions3D::ensureEnabled calls here. The ANGLE396 // backend currently assumes at a fairly deep level that397 // EGL_EXTENSIONS_ENABLED_ANGLE is set to true during context creation: for398 // the allocation of rectangular textures, etc.399 395 Extensions3D& extensions = getExtensions(); 400 396 if (m_attrs.stencil) { 401 397 if (extensions.supports(packedDepthStencilExtension)) { 398 extensions.ensureEnabled(packedDepthStencilExtension); 402 399 // Force depth if stencil is true. 403 400 m_attrs.depth = true; … … 410 407 if (!extensions.supports("GL_ANGLE_framebuffer_multisample") || !extensions.supports("GL_ANGLE_framebuffer_blit") || !extensions.supports("GL_OES_rgb8_rgba8") || isGLES2Compliant()) 411 408 m_attrs.antialias = false; 409 else { 410 extensions.ensureEnabled("GL_ANGLE_framebuffer_multisample"); 411 extensions.ensureEnabled("GL_ANGLE_framebuffer_blit"); 412 extensions.ensureEnabled("GL_OES_rgb8_rgba8"); 413 } 412 414 } 413 415 } -
trunk/Source/WebCore/platform/graphics/cocoa/GraphicsContext3DCocoa.mm
r248846 r249218 330 330 contextAttributes.push_back(EGL_CONTEXT_WEBGL_COMPATIBILITY_ANGLE); 331 331 contextAttributes.push_back(EGL_TRUE); 332 contextAttributes.push_back(EGL_EXTENSIONS_ENABLED_ANGLE);333 contextAttributes.push_back(EGL_TRUE);334 332 if (strstr(displayExtensions, "EGL_ANGLE_power_preference")) { 335 333 contextAttributes.push_back(EGL_POWER_PREFERENCE_ANGLE); … … 348 346 349 347 EGL_MakeCurrent(m_displayObj, EGL_NO_SURFACE, EGL_NO_SURFACE, m_contextObj); 348 349 static constexpr const char* requiredExtensions[] = { 350 "GL_ANGLE_texture_rectangle", // For IOSurface-backed textures 351 "GL_EXT_texture_format_BGRA8888", // For creating the EGL surface from an IOSurface 352 }; 353 354 static constexpr const char* optionalExtensions[] = { 355 "GL_EXT_debug_marker", 356 }; 357 358 Extensions3D& extensions = getExtensions(); 359 360 for (size_t i = 0; i < WTF_ARRAY_LENGTH(requiredExtensions); ++i) { 361 if (!extensions.supports(requiredExtensions[i])) { 362 LOG(WebGL, "Missing required extension."); 363 return; 364 } 365 366 extensions.ensureEnabled(requiredExtensions[i]); 367 } 368 369 for (size_t i = 0; i < WTF_ARRAY_LENGTH(optionalExtensions); ++i) { 370 if (extensions.supports(optionalExtensions[i])) 371 extensions.ensureEnabled(optionalExtensions[i]); 372 } 350 373 351 374 #endif // #elif USE(ANGLE)
Note:
See TracChangeset
for help on using the changeset viewer.