⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 276507 in webkit


Ignore:
Timestamp:
Apr 23, 2021, 11:15:55 AM (5 years ago)
Author:
Truitt Savell
Message:

Unreviewed, reverting r276190.

broke a test internally.

Reverted changeset:

"Metal-ANGLE: Shared memory texture tests failing in iOS
Simulator"
https://bugs.webkit.org/show_bug.cgi?id=222685
https://commits.webkit.org/r276190

Location:
trunk/Source/ThirdParty/ANGLE
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/ThirdParty/ANGLE/ChangeLog

    r276466 r276507  
     12021-04-23  Truitt Savell  <tsavell@apple.com>
     2
     3        Unreviewed, reverting r276190.
     4
     5        broke a test internally.
     6
     7        Reverted changeset:
     8
     9        "Metal-ANGLE: Shared memory texture tests failing in iOS
     10        Simulator"
     11        https://bugs.webkit.org/show_bug.cgi?id=222685
     12        https://commits.webkit.org/r276190
     13
    1142021-04-22  Lauro Moura  <lmoura@igalia.com>
    215
  • trunk/Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/TextureMtl.mm

    r276190 r276507  
    175175}
    176176
    177 
    178 #if TARGET_OS_SIMULATOR
    179 void CopyTextureData(const MTLSize &regionSize,
    180                              size_t srcRowPitch,
    181                              size_t src2DImageSize,
    182                              const uint8_t *psrc,
    183                              size_t destRowPitch,
    184                              size_t dest2DImageSize,
    185                              uint8_t *pdst)
    186 {
    187     {
    188         size_t rowCopySize = std::min(srcRowPitch, destRowPitch);
    189         for (NSUInteger d = 0; d < regionSize.depth; ++d)
    190         {
    191             for (NSUInteger r = 0; r < regionSize.height; ++r)
    192             {
    193                 const uint8_t *pCopySrc = psrc + d * src2DImageSize + r * srcRowPitch;
    194                 uint8_t *pCopyDst       = pdst + d * dest2DImageSize + r * destRowPitch;
    195                 memcpy(pCopyDst, pCopySrc, rowCopySize);
    196             }
    197         }
    198     }
    199 }
    200 #endif
    201 
    202177void ConvertDepthStencilData(const MTLSize &regionSize,
    203178                             const angle::Format &srcAngleFormat,
     
    291266    return angle::Result::Continue;
    292267}
    293 
    294 #if TARGET_OS_SIMULATOR
    295 angle::Result CopyTextureContentsToStagingBuffer(
    296     ContextMtl *contextMtl,
    297     const angle::Format &textureAngleFormat,
    298     const MTLSize &regionSize,
    299     const uint8_t *data,
    300     size_t bytesPerRow,
    301     size_t bytesPer2DImage,
    302     size_t *bufferRowPitchOut,
    303     size_t *buffer2DImageSizeOut,
    304     mtl::BufferRef *bufferOut)
    305 {
    306     size_t stagingBufferRowPitch    = regionSize.width * textureAngleFormat.pixelBytes;
    307     size_t stagingBuffer2DImageSize = stagingBufferRowPitch * regionSize.height;
    308     size_t stagingBufferSize        = stagingBuffer2DImageSize * regionSize.depth;
    309     mtl::BufferRef stagingBuffer;
    310     ANGLE_TRY(mtl::Buffer::MakeBuffer(contextMtl, stagingBufferSize, nullptr, &stagingBuffer));
    311 
    312     uint8_t *pdst = stagingBuffer->map(contextMtl);
    313 
    314     CopyTextureData(regionSize, bytesPerRow, bytesPer2DImage,
    315                     data, stagingBufferRowPitch, stagingBuffer2DImageSize, pdst);
    316 
    317     stagingBuffer->unmap(contextMtl);
    318 
    319     *bufferOut            = stagingBuffer;
    320     *bufferRowPitchOut    = stagingBufferRowPitch;
    321     *buffer2DImageSizeOut = stagingBuffer2DImageSize;
    322 
    323     return angle::Result::Continue;
    324 }
    325 #endif
    326268
    327269angle::Result UploadDepthStencilTextureContentsWithStagingBuffer(
     
    437379}
    438380
    439 #if TARGET_OS_SIMULATOR
    440 angle::Result UploadTextureContentsWithStagingBuffer(
    441     ContextMtl *contextMtl,
    442     const angle::Format &textureAngleFormat,
    443     MTLRegion region,
    444     const mtl::MipmapNativeLevel &mipmapLevel,
    445     uint32_t slice,
    446     const uint8_t *data,
    447     size_t bytesPerRow,
    448     size_t bytesPer2DImage,
    449     const mtl::TextureRef &texture)
    450 {
    451     ASSERT(texture && texture->valid());
    452    
    453     angle::FormatID stagingBufferFormatID = textureAngleFormat.id;
    454     const angle::Format &angleStagingFormat = angle::Format::Get(stagingBufferFormatID);
    455    
    456 
    457     size_t stagingBufferRowPitch;
    458     size_t stagingBuffer2DImageSize;
    459     mtl::BufferRef stagingBuffer;
    460 
    461     // Copy depth data to staging depth buffer
    462     ANGLE_TRY(CopyTextureContentsToStagingBuffer(contextMtl, angleStagingFormat, region.size, data, bytesPerRow, bytesPer2DImage, &stagingBufferRowPitch, &stagingBuffer2DImageSize, &stagingBuffer));
    463     mtl::BlitCommandEncoder *encoder = contextMtl->getBlitCommandEncoder();
    464 
    465     encoder->copyBufferToTexture(stagingBuffer, 0, stagingBufferRowPitch,
    466                                  stagingBuffer2DImageSize, region.size, texture, slice,
    467                                  mipmapLevel, region.origin, 0);
    468    
    469 
    470     return angle::Result::Continue;
    471 }
    472 #endif
    473 
    474381angle::Result UploadTextureContents(const gl::Context *context,
    475382                                    const angle::Format &textureAngleFormat,
     
    484391    ASSERT(texture && texture->valid());
    485392    ContextMtl *contextMtl = mtl::GetImpl(context);
    486 #if TARGET_OS_SIMULATOR
    487     if (!textureAngleFormat.depthBits && !textureAngleFormat.stencilBits)
    488     {
    489         ANGLE_TRY(UploadTextureContentsWithStagingBuffer(contextMtl,textureAngleFormat,region,mipmapLevel,slice,data,bytesPerRow,bytesPer2DImage,texture));
    490         return angle::Result::Continue;
    491     }
    492 #else
     393
    493394    if (texture->isCPUAccessible())
    494395    {
     
    499400        return angle::Result::Continue;
    500401    }
    501 #endif
     402
    502403    ASSERT(textureAngleFormat.depthBits || textureAngleFormat.stencilBits);
    503404
     
    517418
    518419    return angle::Result::Continue;
    519    
    520420}
    521421
  • trunk/Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/mtl_utils.mm

    r276190 r276507  
    114114    const angle::Format &actualAngleFormat           = textureObjFormat.actualAngleFormat();
    115115    const gl::InternalFormat &intendedInternalFormat = textureObjFormat.intendedInternalFormat();
    116     bool forceGPUInitialization = false;
    117 #if TARGET_OS_SIMULATOR
    118     forceGPUInitialization = true;
    119 #endif
     116
    120117    // This function is called in many places to initialize the content of a texture.
    121118    // So it's better we do the sanity check here instead of let the callers do it themselves:
     
    152149
    153150    if (texture->isCPUAccessible() && index.getType() != gl::TextureType::_2DMultisample &&
    154         index.getType() != gl::TextureType::_2DMultisampleArray && forceGPUInitialization == false)
     151        index.getType() != gl::TextureType::_2DMultisampleArray)
    155152    {
    156153        const angle::Format &dstFormat = angle::Format::Get(textureObjFormat.actualFormatId);
     
    202199        }
    203200    }  // if (texture->isCPUAccessible())
    204 
    205201    else
    206202    {
Note: See TracChangeset for help on using the changeset viewer.