From a520d6cc38dd13c68bf7fac24a919ec8b0bfcdfe Mon Sep 17 00:00:00 2001 From: Camillo Lugaresi Date: Tue, 15 Nov 2022 15:39:41 -0800 Subject: [PATCH] Remove FORCE_CONTIGUOUS_PIXEL_BUFFER_ON_IPHONE_SIMULATOR This workaround code is no longer necessary, as per the comment. PiperOrigin-RevId: 488777606 --- mediapipe/gpu/gpu_buffer_multi_pool.cc | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/mediapipe/gpu/gpu_buffer_multi_pool.cc b/mediapipe/gpu/gpu_buffer_multi_pool.cc index 5e8ce06b..2bceb1c0 100644 --- a/mediapipe/gpu/gpu_buffer_multi_pool.cc +++ b/mediapipe/gpu/gpu_buffer_multi_pool.cc @@ -117,25 +117,9 @@ void GpuBufferMultiPool::FlushTextureCaches() { } } -// Turning this on disables the pixel buffer pools when using the simulator. -// It is no longer necessary, since the helper code now supports non-contiguous -// buffers. We leave the code in for now for the sake of documentation. -#define FORCE_CONTIGUOUS_PIXEL_BUFFER_ON_IPHONE_SIMULATOR 0 - GpuBuffer GpuBufferMultiPool::GetBufferFromSimplePool( BufferSpec spec, GpuBufferMultiPool::SimplePool& pool) { -#if TARGET_IPHONE_SIMULATOR && FORCE_CONTIGUOUS_PIXEL_BUFFER_ON_IPHONE_SIMULATOR - // On the simulator, syncing the texture with the pixelbuffer does not work, - // and we have to use glReadPixels. Since GL_UNPACK_ROW_LENGTH is not - // available in OpenGL ES 2, we should create the buffer so the pixels are - // contiguous. - // - // TODO: verify if we can use kIOSurfaceBytesPerRow to force the - // pool to give us contiguous data. - return GetBufferWithoutPool(spec); -#else return pool.GetBuffer([this]() { FlushTextureCaches(); }); -#endif // TARGET_IPHONE_SIMULATOR } #else