Commit 2e3786ed by Cody Northrop Committed by Commit Bot

Capture/Replay: Use glUniform1iv on samplers, ignore images

In OpenGL, GL_INT is expected for sampler uniforms. Before this our emitted code was using the underlying return type, which can be unsigned, leading to glUniformuiv. Also, don't try to set image uniforms with glUniform calls, it is not allowed. Test: Fortnite MEC Bug: b/170755560 Change-Id: I6786df487285fee77cfe792dfa85eb17feb155e9 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2611557 Commit-Queue: Cody Northrop <cnorthrop@google.com> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarTim Van Patten <timvp@google.com>
parent e670fc72
...@@ -1826,6 +1826,26 @@ void CaptureUpdateUniformValues(const gl::State &replayState, ...@@ -1826,6 +1826,26 @@ void CaptureUpdateUniformValues(const gl::State &replayState,
if (readLoc.value == -1) if (readLoc.value == -1)
continue; continue;
// Image uniforms are special and cannot be set this way
if (typeInfo->isImageType)
continue;
// Samplers should be populated with GL_INT, regardless of return type
if (typeInfo->isSampler)
{
std::vector<GLint> uniformBuffer(uniformSize);
for (int index = 0; index < uniformCount; index++, readLoc.value++)
{
program->getUniformiv(context, readLoc,
uniformBuffer.data() + index * componentCount);
}
Capture(callsOut, CaptureUniform1iv(replayState, true, uniformLoc, uniformCount,
uniformBuffer.data()));
continue;
}
switch (typeInfo->componentType) switch (typeInfo->componentType)
{ {
case GL_FLOAT: case GL_FLOAT:
......
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