Changeset 284826 in webkit
- Timestamp:
- Oct 25, 2021, 2:50:43 PM (5 years ago)
- Location:
- branches/safari-612-branch
- Files:
-
- 4 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/TestExpectations (modified) (1 diff)
-
Source/ThirdParty/ANGLE/ChangeLog (modified) (1 diff)
-
Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/mtl_utils.mm (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/safari-612-branch/LayoutTests/ChangeLog
r284825 r284826 1 2021-10-25 Null <null@apple.com> 2 3 Cherry-pick r282627. rdar://problem/84630078 4 5 webgl/2.0.y/conformance/extensions/webgl-compressed-texture-s3tc-srgb.html fails on Intel+AMD Metal 6 https://bugs.webkit.org/show_bug.cgi?id=229941 7 8 Zero-initialize compressed textures explicitly, as they aren't implicitly initalized in Metal. 9 Reviewed by Kenneth Russell <kbr@chromium.org>. 10 11 Source/ThirdParty/ANGLE: 12 13 * src/libANGLE/renderer/metal/mtl_utils.h: 14 * src/libANGLE/renderer/metal/mtl_utils.mm: 15 (rx::mtl::GetCompressedBufferForTextureWithFormat): 16 (rx::mtl::InitializeCompressedTextureContents): 17 (rx::mtl::InitializeTextureContents): 18 19 LayoutTests: 20 21 * TestExpectations: 22 23 24 git-svn-id: https://svn.webkit.org/repository/webkit/trunk@282627 268f45cc-cd09-0410-ab3c-d52691b4dbfc 25 26 2021-09-16 Kyle Piddington <kpiddington@apple.com> 27 28 webgl/2.0.y/conformance/extensions/webgl-compressed-texture-s3tc-srgb.html fails on Intel+AMD Metal 29 https://bugs.webkit.org/show_bug.cgi?id=229941 30 31 Zero-initialize compressed textures explicitly, as they aren't implicitly initalized in Metal. 32 Reviewed by Kenneth Russell <kbr@chromium.org>. 33 34 * TestExpectations: 35 1 36 2021-10-25 Null <null@apple.com> 2 37 -
branches/safari-612-branch/LayoutTests/TestExpectations
r284355 r284826 3692 3692 webgl/2.0.y/conformance/misc/invalid-passed-params.html [ Pass ] 3693 3693 webgl/2.0.y/conformance/glsl/bugs/character-set.html [ Pass ] 3694 3695 # Explicitly turn on conformance test until all of webgl/2.0.y is enabled 3696 webgl/2.0.y/conformance/extensions/webgl-compressed-texture-s3tc-srgb.html [ Pass ] 3694 3697 3695 3698 # WebGL 1.0.3 and 2.0.0 tests where behavior is obsolete and WebKit contains implementation -
branches/safari-612-branch/Source/ThirdParty/ANGLE/ChangeLog
r284825 r284826 1 2021-10-25 Null <null@apple.com> 2 3 Cherry-pick r282627. rdar://problem/84630078 4 5 webgl/2.0.y/conformance/extensions/webgl-compressed-texture-s3tc-srgb.html fails on Intel+AMD Metal 6 https://bugs.webkit.org/show_bug.cgi?id=229941 7 8 Zero-initialize compressed textures explicitly, as they aren't implicitly initalized in Metal. 9 Reviewed by Kenneth Russell <kbr@chromium.org>. 10 11 Source/ThirdParty/ANGLE: 12 13 * src/libANGLE/renderer/metal/mtl_utils.h: 14 * src/libANGLE/renderer/metal/mtl_utils.mm: 15 (rx::mtl::GetCompressedBufferForTextureWithFormat): 16 (rx::mtl::InitializeCompressedTextureContents): 17 (rx::mtl::InitializeTextureContents): 18 19 LayoutTests: 20 21 * TestExpectations: 22 23 24 git-svn-id: https://svn.webkit.org/repository/webkit/trunk@282627 268f45cc-cd09-0410-ab3c-d52691b4dbfc 25 26 2021-09-16 Kyle Piddington <kpiddington@apple.com> 27 28 webgl/2.0.y/conformance/extensions/webgl-compressed-texture-s3tc-srgb.html fails on Intel+AMD Metal 29 https://bugs.webkit.org/show_bug.cgi?id=229941 30 31 Zero-initialize compressed textures explicitly, as they aren't implicitly initalized in Metal. 32 Reviewed by Kenneth Russell <kbr@chromium.org>. 33 34 * src/libANGLE/renderer/metal/mtl_utils.h: 35 * src/libANGLE/renderer/metal/mtl_utils.mm: 36 (rx::mtl::GetCompressedBufferForTextureWithFormat): 37 (rx::mtl::InitializeCompressedTextureContents): 38 (rx::mtl::InitializeTextureContents): 39 1 40 2021-10-25 Null <null@apple.com> 2 41 -
branches/safari-612-branch/Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/mtl_utils.mm
r279606 r284826 104 104 } 105 105 106 bool GetCompressedBufferSizeAndRowLengthForTextureWithFormat(const TextureRef &texture, 107 const Format &textureObjFormat, 108 const ImageNativeIndex &index, 109 size_t *bytesPerRowOut, 110 size_t *bytesPerImageOut) 111 { 112 gl::Extents size = texture->size(index); 113 GLuint bufferSizeInBytes; 114 uint32_t bufferRowLength; 115 if (!textureObjFormat.intendedInternalFormat().computeCompressedImageSize(size, 116 &bufferSizeInBytes)) 117 { 118 return false; 119 } 120 if (!textureObjFormat.intendedInternalFormat().computeBufferRowLength(size.width, 121 &bufferRowLength)) 122 { 123 return false; 124 } 125 *bytesPerImageOut = bufferSizeInBytes; 126 *bytesPerRowOut = bufferRowLength; 127 return true; 128 } 129 130 static angle::Result InitializeCompressedTextureContents(const gl::Context *context, 131 const TextureRef &texture, 132 const Format &textureObjFormat, 133 const ImageNativeIndex &index, 134 const uint layer, 135 const uint startDepth) 136 { 137 assert(textureObjFormat.actualAngleFormat().isBlock); 138 size_t bytesPerRow = 0; 139 size_t bytesPerImage = 0; 140 141 if (!GetCompressedBufferSizeAndRowLengthForTextureWithFormat(texture, textureObjFormat, index, 142 &bytesPerRow, &bytesPerImage)) 143 { 144 return angle::Result::Stop; 145 } 146 ContextMtl *contextMtl = mtl::GetImpl(context); 147 gl::Extents extents = texture->size(index); 148 if (texture->isCPUAccessible()) 149 { 150 angle::MemoryBuffer buffer; 151 if (!buffer.resize(bytesPerImage)) 152 { 153 return angle::Result::Stop; 154 } 155 buffer.fill(0); 156 for (NSUInteger d = 0; d < static_cast<NSUInteger>(extents.depth); ++d) 157 { 158 auto mtlTextureRegion = MTLRegionMake2D(0, 0, extents.width, extents.height); 159 mtlTextureRegion.origin.z = d + startDepth; 160 texture->replaceRegion(contextMtl, mtlTextureRegion, index.getNativeLevel(), layer, 161 buffer.data(), bytesPerRow, 0); 162 } 163 } 164 else 165 { 166 mtl::BufferRef zeroBuffer; 167 ANGLE_TRY(mtl::Buffer::MakeBuffer(contextMtl, bytesPerImage, nullptr, &zeroBuffer)); 168 mtl::BlitCommandEncoder *blitEncoder = contextMtl->getBlitCommandEncoder(); 169 for (NSUInteger d = 0; d < static_cast<NSUInteger>(extents.depth); ++d) 170 { 171 auto blitOrigin = MTLOriginMake(0, 0, d + startDepth); 172 blitEncoder->copyBufferToTexture(zeroBuffer, 0, bytesPerRow, 0, 173 MTLSizeMake(extents.width, extents.height, 1), texture, 174 layer, index.getNativeLevel(), blitOrigin, 0); 175 } 176 177 blitEncoder->endEncoding(); 178 } 179 return angle::Result::Continue; 180 } 181 106 182 angle::Result InitializeTextureContents(const gl::Context *context, 107 183 const TextureRef &texture, … … 119 195 forceGPUInitialization = true; 120 196 #endif // TARGET_OS_SIMULATOR 121 197 122 198 // This function is called in many places to initialize the content of a texture. 123 199 // So it's better we do the sanity check here instead of let the callers do it themselves: 124 if (!textureObjFormat.valid() || actualAngleFormat.isBlock || actualAngleFormat.depthBits > 0 || 200 // TODO: (kpiddington) update InitializeTextureContents with an upstreamed version that handles 201 // depth/stencil textures. 202 if (!textureObjFormat.valid() || actualAngleFormat.depthBits > 0 || 125 203 actualAngleFormat.stencilBits > 0) 126 204 { 127 // If dst format is compressed, ignore.205 // Depth or stencil textures need an updated path. 128 206 return angle::Result::Continue; 129 207 } … … 151 229 break; 152 230 } 231 } 232 233 if (actualAngleFormat.isBlock) 234 { 235 return InitializeCompressedTextureContents(context, texture, textureObjFormat, index, layer, 236 startDepth); 153 237 } 154 238
Note:
See TracChangeset
for help on using the changeset viewer.