Changeset 261975 in webkit
- Timestamp:
- May 20, 2020 5:16:47 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 1 deleted
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r261973 r261975 1 2020-05-20 Kenneth Russell <kbr@chromium.org> 2 3 OES_texture_float / OES_texture_half_float unavailable in WebGL 1.0 on iOS Simulator with ANGLE 4 https://bugs.webkit.org/show_bug.cgi?id=210524 5 6 Reviewed by Dean Jackson. 7 8 Remove expected failure for 9 webgl/2.0.0/conformance/extensions/oes-texture-float-expected.txt 10 on ios-simulator. Enable 11 fast/canvas/webgl/oes-texture-half-float-uint16.html on iOS. 12 13 * platform/ios-simulator/webgl/2.0.0/conformance/extensions/oes-texture-float-expected.txt: Removed. 14 * platform/ios/TestExpectations: 15 1 16 2020-05-20 Chris Dumez <cdumez@apple.com> 2 17 -
trunk/LayoutTests/platform/ios/TestExpectations
r261946 r261975 3470 3470 webkit.org/b/207858 webgl/webgl-border.html [ Pass Failure ImageOnlyFailure ] 3471 3471 webkit.org/b/207858 webgl/webgl-box-shadow.html [ Pass Failure ImageOnlyFailure ] 3472 webkit.org/b/207858 fast/canvas/webgl/oes-texture-half-float-uint16.html [ Pass Failure ]3473 3472 webkit.org/b/207858 fast/canvas/webgl/program-test.html [ Failure ] 3474 3473 webkit.org/b/207858 fast/canvas/webgl/uninitialized-test.html [ Pass Failure ] -
trunk/Source/ThirdParty/ANGLE/ChangeLog
r261844 r261975 1 2020-05-20 Kenneth Russell <kbr@chromium.org> 2 3 OES_texture_float / OES_texture_half_float unavailable in WebGL 1.0 on iOS Simulator with ANGLE 4 https://bugs.webkit.org/show_bug.cgi?id=210524 5 6 Reviewed by Dean Jackson. 7 8 Emulate LUMINANCE, ALPHA and LUMINANCE_ALPHA floating-point 9 textures on top of RED / RG textures when the underlying 10 OES_texture_float/half_float OpenGL ES extensions are unavailable. 11 12 This makes the conformance/extensions/oes-texture{-half}-float* 13 tests run and pass in the iOS Simulator. 14 15 This change is being reviewed upstream in the ANGLE repository and 16 is only being uploaded here for testing purposes. It will be 17 rolled in with the next ANGLE update. 18 19 * src/libANGLE/renderer/gl/TextureGL.cpp: 20 (rx::TextureGL::setSwizzle): 21 * src/libANGLE/renderer/gl/formatutilsgl.cpp: 22 (rx::nativegl::BuildInternalFormatInfoMap): 23 (rx::nativegl::IsLUMAFormat): 24 (rx::nativegl::EmulateLUMAFormat): 25 (rx::nativegl::EmulateLUMA): 26 (rx::nativegl::GetNativeInternalFormat): 27 (rx::nativegl::GetNativeFormat): 28 (rx::nativegl::GetNativeType): 29 (rx::nativegl::GetTexImageFormat): 30 (rx::nativegl::GetTexSubImageFormat): 31 1 32 2020-05-18 James Darpinian <jdarpinian@chromium.org> 2 33 -
trunk/Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/TextureGL.cpp
r261750 r261975 1611 1611 1612 1612 stateManager->bindTexture(getType(), mTextureID); 1613 ANGLE_GL_TRY(context, functions->texParameteriv(ToGLenum(getType()), 1614 GL_TEXTURE_SWIZZLE_RGBA, swizzle)); 1613 if (functions->standard == STANDARD_GL_ES) 1614 { 1615 ANGLE_GL_TRY(context, functions->texParameteri(ToGLenum(getType()), 1616 GL_TEXTURE_SWIZZLE_R, swizzle[0])); 1617 ANGLE_GL_TRY(context, functions->texParameteri(ToGLenum(getType()), 1618 GL_TEXTURE_SWIZZLE_G, swizzle[1])); 1619 ANGLE_GL_TRY(context, functions->texParameteri(ToGLenum(getType()), 1620 GL_TEXTURE_SWIZZLE_B, swizzle[2])); 1621 ANGLE_GL_TRY(context, functions->texParameteri(ToGLenum(getType()), 1622 GL_TEXTURE_SWIZZLE_A, swizzle[3])); 1623 } 1624 else 1625 { 1626 ANGLE_GL_TRY(context, functions->texParameteriv(ToGLenum(getType()), 1627 GL_TEXTURE_SWIZZLE_RGBA, swizzle)); 1628 } 1615 1629 } 1616 1630 return angle::Result::Continue; -
trunk/Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/formatutilsgl.cpp
r261750 r261975 276 276 277 277 // Luminance alpha formats 278 // | Format | OpenGL texture support | Filter | Render | OpenGL ES texture support | Filter | OpenGL ES texture attachment support | OpenGL ES renderbuffer support|279 InsertFormatMapping(&map, GL_ALPHA8_EXT, AlwaysSupported(), AlwaysSupported(), NeverSupported(), AlwaysSupported(), AlwaysSupported(), NeverSupported(), NeverSupported() );280 InsertFormatMapping(&map, GL_LUMINANCE8_EXT, AlwaysSupported(), AlwaysSupported(), NeverSupported(), AlwaysSupported(), AlwaysSupported(), NeverSupported(), NeverSupported() );281 InsertFormatMapping(&map, GL_LUMINANCE8_ALPHA8_EXT, AlwaysSupported(), AlwaysSupported(), NeverSupported(), AlwaysSupported(), AlwaysSupported(), NeverSupported(), NeverSupported() );282 InsertFormatMapping(&map, GL_ALPHA16F_EXT, VersionOrExts(3, 0, "GL_ARB_texture_float"), AlwaysSupported(), NeverSupported(), ExtsOnly("GL_OES_texture_half_float"), ExtsOnly("GL_OES_texture_half_float_linear"), NeverSupported(), NeverSupported() );283 InsertFormatMapping(&map, GL_LUMINANCE16F_EXT, VersionOrExts(3, 0, "GL_ARB_texture_float"), AlwaysSupported(), NeverSupported(), ExtsOnly("GL_OES_texture_half_float"), ExtsOnly("GL_OES_texture_half_float_linear"), NeverSupported(), NeverSupported() );284 InsertFormatMapping(&map, GL_LUMINANCE_ALPHA16F_EXT, VersionOrExts(3, 0, "GL_ARB_texture_float"), AlwaysSupported(), NeverSupported(), ExtsOnly("GL_OES_texture_half_float"), ExtsOnly("GL_OES_texture_half_float_linear"), NeverSupported(), NeverSupported() );285 InsertFormatMapping(&map, GL_ALPHA32F_EXT, VersionOrExts(3, 0, "GL_ARB_texture_float"), AlwaysSupported(), NeverSupported(), ExtsOnly("GL_OES_texture_float"), ExtsOnly("GL_OES_texture_float_linear"), NeverSupported(), NeverSupported() );286 InsertFormatMapping(&map, GL_LUMINANCE32F_EXT, VersionOrExts(3, 0, "GL_ARB_texture_float"), AlwaysSupported(), NeverSupported(), ExtsOnly("GL_OES_texture_float"), ExtsOnly("GL_OES_texture_float_linear"), NeverSupported(), NeverSupported() );287 InsertFormatMapping(&map, GL_LUMINANCE_ALPHA32F_EXT, VersionOrExts(3, 0, "GL_ARB_texture_float"), AlwaysSupported(), NeverSupported(), ExtsOnly("GL_OES_texture_float"), ExtsOnly("GL_OES_texture_float_linear"), NeverSupported(), NeverSupported() );278 // | Format | OpenGL texture support | Filter | Render | OpenGL ES texture support | Filter | OpenGL ES texture attachment support | OpenGL ES renderbuffer support | 279 InsertFormatMapping(&map, GL_ALPHA8_EXT, AlwaysSupported(), AlwaysSupported(), NeverSupported(), AlwaysSupported(), AlwaysSupported(), NeverSupported(), NeverSupported() ); 280 InsertFormatMapping(&map, GL_LUMINANCE8_EXT, AlwaysSupported(), AlwaysSupported(), NeverSupported(), AlwaysSupported(), AlwaysSupported(), NeverSupported(), NeverSupported() ); 281 InsertFormatMapping(&map, GL_LUMINANCE8_ALPHA8_EXT, AlwaysSupported(), AlwaysSupported(), NeverSupported(), AlwaysSupported(), AlwaysSupported(), NeverSupported(), NeverSupported() ); 282 InsertFormatMapping(&map, GL_ALPHA16F_EXT, VersionOrExts(3, 0, "GL_ARB_texture_float"), AlwaysSupported(), NeverSupported(), VersionOrExts(3, 0, "GL_OES_texture_half_float"), ExtsOnly("GL_OES_texture_half_float_linear"), NeverSupported(), NeverSupported() ); 283 InsertFormatMapping(&map, GL_LUMINANCE16F_EXT, VersionOrExts(3, 0, "GL_ARB_texture_float"), AlwaysSupported(), NeverSupported(), VersionOrExts(3, 0, "GL_OES_texture_half_float"), ExtsOnly("GL_OES_texture_half_float_linear"), NeverSupported(), NeverSupported() ); 284 InsertFormatMapping(&map, GL_LUMINANCE_ALPHA16F_EXT, VersionOrExts(3, 0, "GL_ARB_texture_float"), AlwaysSupported(), NeverSupported(), VersionOrExts(3, 0, "GL_OES_texture_half_float"), ExtsOnly("GL_OES_texture_half_float_linear"), NeverSupported(), NeverSupported() ); 285 InsertFormatMapping(&map, GL_ALPHA32F_EXT, VersionOrExts(3, 0, "GL_ARB_texture_float"), AlwaysSupported(), NeverSupported(), VersionOrExts(3, 0, "GL_OES_texture_float"), ExtsOnly("GL_OES_texture_float_linear"), NeverSupported(), NeverSupported() ); 286 InsertFormatMapping(&map, GL_LUMINANCE32F_EXT, VersionOrExts(3, 0, "GL_ARB_texture_float"), AlwaysSupported(), NeverSupported(), VersionOrExts(3, 0, "GL_OES_texture_float"), ExtsOnly("GL_OES_texture_float_linear"), NeverSupported(), NeverSupported() ); 287 InsertFormatMapping(&map, GL_LUMINANCE_ALPHA32F_EXT, VersionOrExts(3, 0, "GL_ARB_texture_float"), AlwaysSupported(), NeverSupported(), VersionOrExts(3, 0, "GL_OES_texture_float"), ExtsOnly("GL_OES_texture_float_linear"), NeverSupported(), NeverSupported() ); 288 288 289 289 // EXT_texture_compression_rgtc formats … … 435 435 } 436 436 437 static bool IsLUMAFormat(GLenum format) 438 { 439 return (format == GL_LUMINANCE || format == GL_ALPHA || format == GL_LUMINANCE_ALPHA); 440 } 441 442 static GLenum EmulateLUMAFormat(const GLenum format) 443 { 444 // This is needed separately from EmulateLUMA because some format/type combinations that come in 445 // to GetNativeFormat don't have entries in the internal format map. 446 447 ASSERT(IsLUMAFormat(format)); 448 449 if (format == GL_LUMINANCE || format == GL_ALPHA) 450 return GL_RED; 451 452 return GL_RG; 453 } 454 455 static const gl::InternalFormat &EmulateLUMA(const gl::InternalFormat &internalFormat) 456 { 457 ASSERT(IsLUMAFormat(internalFormat.format)); 458 459 // Work around deprecated luminance/alpha formats in the OpenGL core profile, and OpenGL ES 3.0 460 // and greater, by backing them with R or RG textures. 461 return gl::GetInternalFormatInfo(EmulateLUMAFormat(internalFormat.format), internalFormat.type); 462 } 463 437 464 static GLenum GetNativeInternalFormat(const FunctionsGL *functions, 438 465 const angle::FeaturesGL &features, … … 480 507 if ((functions->profile & GL_CONTEXT_CORE_PROFILE_BIT) != 0) 481 508 { 482 // Work around deprecated luminance alpha formats in the OpenGL core profile by backing 483 // them with R or RG textures. 484 if (internalFormat.format == GL_LUMINANCE || internalFormat.format == GL_ALPHA) 509 if (IsLUMAFormat(internalFormat.format)) 485 510 { 486 result = gl::GetInternalFormatInfo(GL_RED, internalFormat.type).sizedInternalFormat;511 result = EmulateLUMA(internalFormat).sizedInternalFormat; 487 512 } 488 489 if (internalFormat.format == GL_LUMINANCE_ALPHA) 513 } 514 } 515 else if (functions->isAtLeastGLES(gl::Version(3, 0))) 516 { 517 if (internalFormat.componentType == GL_FLOAT) 518 { 519 if (!internalFormat.isLUMA()) 490 520 { 491 result = gl::GetInternalFormatInfo(GL_RG, internalFormat.type).sizedInternalFormat; 521 // Use sized internal formats for floating point textures. Extensions such as 522 // EXT_color_buffer_float require the sized formats to be renderable. 523 result = internalFormat.sizedInternalFormat; 492 524 } 493 } 494 } 495 else if (functions->isAtLeastGLES(gl::Version(3, 0))) 496 { 497 if (internalFormat.componentType == GL_FLOAT && !internalFormat.isLUMA()) 498 { 499 // Use sized internal formats for floating point textures. Extensions such as 500 // EXT_color_buffer_float require the sized formats to be renderable. 501 result = internalFormat.sizedInternalFormat; 525 else if ((internalFormat.type == GL_FLOAT && 526 !functions->hasGLESExtension("GL_OES_texture_float")) || 527 (internalFormat.type == GL_HALF_FLOAT_OES && 528 !functions->hasGLESExtension("GL_OES_texture_half_float"))) 529 { 530 // The legacy luminance/alpha formats from OES_texture_float are emulated with R/RG 531 // textures. 532 if (IsLUMAFormat(internalFormat.format)) 533 { 534 result = EmulateLUMA(internalFormat).sizedInternalFormat; 535 } 536 } 502 537 } 503 538 else if (internalFormat.format == GL_RED_EXT || internalFormat.format == GL_RG_EXT) … … 520 555 static GLenum GetNativeFormat(const FunctionsGL *functions, 521 556 const angle::FeaturesGL &features, 522 GLenum format) 557 GLenum format, 558 GLenum type) 523 559 { 524 560 GLenum result = format; … … 542 578 // Work around deprecated luminance alpha formats in the OpenGL core profile by backing 543 579 // them with R or RG textures. 544 if ( format == GL_LUMINANCE || format == GL_ALPHA)580 if (IsLUMAFormat(format)) 545 581 { 546 result = GL_RED; 547 } 548 549 if (format == GL_LUMINANCE_ALPHA) 550 { 551 result = GL_RG; 582 result = EmulateLUMAFormat(format); 552 583 } 553 584 } … … 567 598 } 568 599 } 600 601 if ((type == GL_FLOAT && !functions->hasGLESExtension("GL_OES_texture_float")) || 602 (type == GL_HALF_FLOAT_OES && 603 !functions->hasGLESExtension("GL_OES_texture_half_float"))) 604 { 605 // On ES 3.0 systems that don't have GL_OES_texture_float or OES_texture_half_float, the 606 // LUMINANCE/ALPHA formats from those extensions must be emulated with R/RG textures. 607 if (IsLUMAFormat(format)) 608 { 609 result = EmulateLUMAFormat(format); 610 } 611 } 569 612 } 570 613 … … 630 673 if (type == GL_HALF_FLOAT_OES) 631 674 { 632 switch (format)675 if (!IsLUMAFormat(format) || !functions->hasGLESExtension("GL_OES_texture_half_float")) 633 676 { 634 case GL_LUMINANCE_ALPHA: 635 case GL_LUMINANCE: 636 case GL_ALPHA: 637 // In ES3, these formats come from EXT_texture_storage, which uses 638 // HALF_FLOAT_OES. Other formats (like RGBA) use HALF_FLOAT (non-OES) in ES3. 639 break; 640 641 default: 642 result = GL_HALF_FLOAT; 643 break; 677 // In ES3, the luminance formats come from OES_texture_half_float, which uses 678 // HALF_FLOAT_OES. Other formats (like RGBA) use HALF_FLOAT (non-OES) in ES3. 679 // If they're emulated (see above), use HALF_FLOAT. 680 result = GL_HALF_FLOAT; 644 681 } 645 682 } … … 702 739 result.internalFormat = GetNativeInternalFormat( 703 740 functions, features, gl::GetInternalFormatInfo(internalFormat, type)); 704 result.format = GetNativeFormat(functions, features, format );741 result.format = GetNativeFormat(functions, features, format, type); 705 742 result.type = GetNativeType(functions, features, format, type); 706 743 return result; … … 713 750 { 714 751 TexSubImageFormat result; 715 result.format = GetNativeFormat(functions, features, format );752 result.format = GetNativeFormat(functions, features, format, type); 716 753 result.type = GetNativeType(functions, features, format, type); 717 754 return result;
Note: See TracChangeset
for help on using the changeset viewer.