Skip to content

Commit cfd25b2

Browse files
Always use BlitFramebuffer to copy textures on Emscripten (close #455)
CopyTexSubimage has a very high performance penalty on WebGL
1 parent 4a15a7c commit cfd25b2

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

Graphics/GraphicsEngineOpenGL/src/TextureBaseGL.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -625,6 +625,11 @@ void TextureBaseGL::CopyData(DeviceContextGLImpl* pDeviceCtxGL,
625625
else
626626
#endif
627627
{
628+
#if PLATFORM_EMSCRIPTEN
629+
// Always use BlitFramebuffer on WebGL as CopyTexSubimage has
630+
// a very high performance penalty.
631+
bool UseBlitFramebuffer = true;
632+
#else
628633
bool UseBlitFramebuffer = IsDefaultBackBuffer;
629634
if (!UseBlitFramebuffer && m_pDevice->GetDeviceInfo().Type == RENDER_DEVICE_TYPE_GLES)
630635
{
@@ -636,6 +641,7 @@ void TextureBaseGL::CopyData(DeviceContextGLImpl* pDeviceCtxGL,
636641
UseBlitFramebuffer = true;
637642
}
638643
}
644+
#endif
639645

640646
auto& GLState = pDeviceCtxGL->GetContextState();
641647

0 commit comments

Comments
 (0)