Commit 942796f6 by Jamie Madill Committed by Commit Bot

Capture/Replay: Use BindAttribLocation to force MEC compat.

In some cases we'd end up with attributes that are optimized out by the GL driver. BindAttribLocation forces the programs to use the same attribute indexing numbers so that the command stream works mostly the same even if some attributes aren't active in the shader. Bug: angleproject:4598 Change-Id: I2d02dd38d29a1489706ae70bcc0b262b1c076942 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2174266 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarCody Northrop <cnorthrop@google.com> Reviewed-by: 's avatarCourtney Goeltzenleuchter <courtneygo@google.com>
parent e09f7a14
......@@ -2286,6 +2286,15 @@ void CaptureMidExecutionSetup(const gl::Context *context,
varyingsStrings.data(), xfbMode));
}
// Force the attributes to be bound the same way as in the existing program.
// This can affect attributes that are optimized out in some implementations.
for (const sh::ShaderVariable &attrib : program->getState().getProgramInputs())
{
ASSERT(attrib.location != -1);
cap(CaptureBindAttribLocation(
replayState, true, id, static_cast<GLuint>(attrib.location), attrib.name.c_str()));
}
cap(CaptureLinkProgram(replayState, true, id));
CaptureUpdateUniformLocations(program, setupCalls);
CaptureUpdateUniformValues(replayState, context, program, setupCalls);
......
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