Bug 1827047 - Avoid unsynchronized BufferSubData fast-path on ANGLE. r=gfx-reviewers,lsalzman

In bug 1826134 we added a fast-path to WebGLBuffer::BufferSubData used
by DrawTargetWebgl, which under the hood uses glMapBufferRange with
GL_MAP_UNSYNCHRONIZED_BIT. However, this causes performance issues on
ANGLE. This patch therefore avoids the fast-path on ANGLE, falling
back to a simple glBufferSubData instead.

Differential Revision: https://phabricator.services.mozilla.com/D175135
This commit is contained in:
Jamie Nicol 2023-04-11 16:06:13 +00:00
Родитель 38aec6a561
Коммит 7cace3aaaf
1 изменённых файлов: 4 добавлений и 1 удалений

Просмотреть файл

@ -205,7 +205,10 @@ void WebGLBuffer::BufferSubData(GLenum target, uint64_t rawDstByteOffset,
const ScopedLazyBind lazyBind(gl, target, this);
void* mapping = nullptr;
if (unsynchronized && gl->IsSupported(gl::GLFeature::map_buffer_range)) {
// Repeated calls to glMapBufferRange is slow on ANGLE, so fall back to the
// glBufferSubData path. See bug 1827047.
if (unsynchronized && gl->IsSupported(gl::GLFeature::map_buffer_range) &&
!gl->IsANGLE()) {
GLbitfield access = LOCAL_GL_MAP_WRITE_BIT |
LOCAL_GL_MAP_UNSYNCHRONIZED_BIT |
LOCAL_GL_MAP_INVALIDATE_RANGE_BIT;