Commit fdfb2b82 by Cody Northrop Committed by Commit Bot

Capture/Replay: Support non-binary GLboolean

This CL contains two changes. One to how we print out GLboolean values, and another to how we capture GLbooleans. According to the spec, anything non-zero can be considered GL_TRUE when setting state: When the type of internal state is boolean, zero integer or floating-point values are converted to FALSE and non-zero values are converted to TRUE. Dota Underlords is using 0xFF for GL_TRUE. Before the change, this manifested as: // logcat glColorMask(context = 4, red = kUnknownGLenumString, green = kUnknownGLenumString, blue = kUnknownGLenumString, alpha = GL_FALSE) // trace glColorMask(GL_INVALID_ENUM, GL_INVALID_ENUM, GL_INVALID_ENUM, GL_FALSE); After: // logcat glColorMask(context = 4, red = 0x00FF, green = 0x00FF, blue = 0x00FF, alpha = GL_FALSE) // trace glColorMask(0xFF, 0xFF, 0xFF, GL_FALSE); Test: MEC for Dota Underlords Bug: b/185192780 Bug: angleproject:5857 Change-Id: Ie53aeba8d8a40f91ee375467b325d8e6be053a98 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2821947 Commit-Queue: Cody Northrop <cnorthrop@google.com> Reviewed-by: 's avatarTim Van Patten <timvp@google.com> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent 7a95a620
...@@ -4949,7 +4949,7 @@ void WriteParamValueReplay<ParamType::TGLboolean>(std::ostream &os, ...@@ -4949,7 +4949,7 @@ void WriteParamValueReplay<ParamType::TGLboolean>(std::ostream &os,
os << "GL_FALSE"; os << "GL_FALSE";
break; break;
default: default:
os << "GL_INVALID_ENUM"; os << "0x" << std::hex << std::uppercase << GLint(value);
} }
} }
......
...@@ -26,6 +26,21 @@ void OutputGLenumString(std::ostream &out, GLenumGroup enumGroup, unsigned int v ...@@ -26,6 +26,21 @@ void OutputGLenumString(std::ostream &out, GLenumGroup enumGroup, unsigned int v
return; return;
} }
if (enumGroup == GLenumGroup::Boolean)
{
// If an unknown enum was submitted as GLboolean, just write out the value.
if (enumStr == kUnknownGLenumString)
{
out << value;
}
else
{
out << enumStr;
}
return;
}
if (enumGroup != GLenumGroup::DefaultGroup) if (enumGroup != GLenumGroup::DefaultGroup)
{ {
// Retry with the "Default" group // Retry with the "Default" group
...@@ -47,15 +62,7 @@ void OutputGLbitfieldString(std::ostream &out, GLenumGroup enumGroup, unsigned i ...@@ -47,15 +62,7 @@ void OutputGLbitfieldString(std::ostream &out, GLenumGroup enumGroup, unsigned i
const char *GLbooleanToString(unsigned int value) const char *GLbooleanToString(unsigned int value)
{ {
switch (value) return GLenumToString(GLenumGroup::Boolean, value);
{
case 0x0:
return "GL_FALSE";
case 0x1:
return "GL_TRUE";
default:
return kUnknownGLenumString;
}
} }
std::string GLbitfieldToString(GLenumGroup enumGroup, unsigned int value) std::string GLbitfieldToString(GLenumGroup enumGroup, unsigned int value)
......
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