Commit d5ca645e by Cody Northrop Committed by Commit Bot

Capture/Replay: Set uniform buffer offset alignment

During capture, we need to set a common uniform buffer offset alignment so the trace will be more portable. The offset used by the trace needs to be divisible by the device's actual value for GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT. Empirically I've seen the following values supported by devices: ARM (16), Intel (32), Qualcomm (128), Nvidia (256) Test: Manhattan 3.1 MEC Bug: angleproject:5589 Change-Id: I071b6ae7be4c827eb8df4a8b39db901226d0f00b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2659849Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarTim Van Patten <timvp@google.com> Commit-Queue: Cody Northrop <cnorthrop@google.com>
parent 37a0dced
......@@ -3700,6 +3700,15 @@ void Context::initCaps()
<< std::endl;
ANGLE_LIMIT_CAP(mState.mCaps.maxImageUnits, maxImageUnits);
// Set a large uniform buffer offset alignment that works on multiple platforms.
// The offset used by the trace needs to be divisible by the device's actual value.
// Values seen during development: ARM (16), Intel (32), Qualcomm (128), Nvidia (256)
constexpr GLint uniformBufferOffsetAlignment = 256;
ASSERT(uniformBufferOffsetAlignment % mState.mCaps.uniformBufferOffsetAlignment == 0);
INFO() << "Setting uniform buffer offset alignment to " << uniformBufferOffsetAlignment
<< " while FrameCapture enabled" << std::endl;
mState.mCaps.uniformBufferOffsetAlignment = uniformBufferOffsetAlignment;
INFO() << "Disabling GL_EXT_map_buffer_range and GL_OES_mapbuffer during capture, which "
"are not supported on some native drivers"
<< std::endl;
......
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