Commit 939dc8d9 by Charlie Lao Committed by Commit Bot

Vulkan: minimize-gpu-work: Skip synchronization for glMapBufferRange

glMapBufferRange call requires CPU and GPU synchronization. Different drivers implement this differently. Some may choose to keep multiple copies of data to reduce the synchronization overhead while others may choose to wait for GPU access to finish to save memory. While this behavior is important, it should be looked under the scope of overall game performance and we can write a standalone test for this. When --minimize-gpu-work is specified, we mainly care about CPU overhead of driver logic of state tracking. For this purpose, we should get this out of picture in order to expose the true picture of what we intended to see. This CL always adds GL_MAP_UNSYNCHRONIZED_BIT to the access bit to avoid driver to do synchronization or make COW. Bug: b/184766477 Change-Id: I36228a4ed9913e26aa9ad4e8446fb42ee0182c18 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2847101Reviewed-by: 's avatarCody Northrop <cnorthrop@google.com> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com>
parent 7444466c
...@@ -303,6 +303,15 @@ void KHRONOS_APIENTRY BufferSubDataMinimizedProc(GLenum target, ...@@ -303,6 +303,15 @@ void KHRONOS_APIENTRY BufferSubDataMinimizedProc(GLenum target,
#endif #endif
} }
void *KHRONOS_APIENTRY MapBufferRangeMinimizedProc(GLenum target,
GLintptr offset,
GLsizeiptr length,
GLbitfield access)
{
access |= GL_MAP_UNSYNCHRONIZED_BIT;
return glMapBufferRange(target, offset, length, access);
}
void KHRONOS_APIENTRY TexImage2DMinimizedProc(GLenum target, void KHRONOS_APIENTRY TexImage2DMinimizedProc(GLenum target,
GLint level, GLint level,
GLint internalformat, GLint internalformat,
...@@ -522,6 +531,11 @@ angle::GenericProc KHRONOS_APIENTRY TraceLoadProc(const char *procName) ...@@ -522,6 +531,11 @@ angle::GenericProc KHRONOS_APIENTRY TraceLoadProc(const char *procName)
{ {
return reinterpret_cast<angle::GenericProc>(BufferSubDataMinimizedProc); return reinterpret_cast<angle::GenericProc>(BufferSubDataMinimizedProc);
} }
if (strcmp(procName, "glMapBufferRange") == 0 ||
strcmp(procName, "glMapBufferRangeEXT") == 0)
{
return reinterpret_cast<angle::GenericProc>(MapBufferRangeMinimizedProc);
}
if (strcmp(procName, "glTexImage2D") == 0) if (strcmp(procName, "glTexImage2D") == 0)
{ {
return reinterpret_cast<angle::GenericProc>(TexImage2DMinimizedProc); return reinterpret_cast<angle::GenericProc>(TexImage2DMinimizedProc);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment