Commit a73818aa by Peng Huang Committed by Commit Bot

Workaround a GL_OES_depth32 bug on Android emulator

Bug: chromium:1184261 Change-Id: I7aac7c696ff2d08dc2aaac86abc1c3b0e54cda1c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2733287 Commit-Queue: Peng Huang <penghuang@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org>
parent e44595f2
...@@ -84,6 +84,20 @@ bool IsAdreno42xOr3xx(const FunctionsGL *functions) ...@@ -84,6 +84,20 @@ bool IsAdreno42xOr3xx(const FunctionsGL *functions)
return adrenoNumber < 430; return adrenoNumber < 430;
} }
void ClearErrors(const FunctionsGL *functions,
const char *file,
const char *function,
unsigned int line)
{
GLenum error = functions->getError();
while (error != GL_NO_ERROR)
{
ERR() << "Preexisting GL error " << gl::FmtHex(error) << " as of " << file << ", "
<< function << ":" << line << ". ";
error = functions->getError();
}
}
} // namespace } // namespace
SwapControlData::SwapControlData() SwapControlData::SwapControlData()
...@@ -365,9 +379,17 @@ static gl::TextureCaps GenerateTextureFormatCaps(const FunctionsGL *functions, ...@@ -365,9 +379,17 @@ static gl::TextureCaps GenerateTextureFormatCaps(const FunctionsGL *functions,
queryInternalFormat = GL_RGBA8; queryInternalFormat = GL_RGBA8;
} }
ClearErrors(functions, __FILE__, __FUNCTION__, __LINE__);
GLint numSamples = 0; GLint numSamples = 0;
functions->getInternalformativ(GL_RENDERBUFFER, queryInternalFormat, GL_NUM_SAMPLE_COUNTS, functions->getInternalformativ(GL_RENDERBUFFER, queryInternalFormat, GL_NUM_SAMPLE_COUNTS,
1, &numSamples); 1, &numSamples);
GLenum error = functions->getError();
if (error != GL_NO_ERROR)
{
ERR() << "glGetInternalformativ generated error " << gl::FmtHex(error) << " for format "
<< gl::FmtHex(queryInternalFormat) << ". Skipping multisample checks.";
numSamples = 0;
}
if (numSamples > 0) if (numSamples > 0)
{ {
...@@ -2219,14 +2241,7 @@ void ClearErrors(const gl::Context *context, ...@@ -2219,14 +2241,7 @@ void ClearErrors(const gl::Context *context,
unsigned int line) unsigned int line)
{ {
const FunctionsGL *functions = GetFunctionsGL(context); const FunctionsGL *functions = GetFunctionsGL(context);
ClearErrors(functions, file, function, line);
GLenum error = functions->getError();
while (error != GL_NO_ERROR)
{
ERR() << "Preexisting GL error " << gl::FmtHex(error) << " as of " << file << ", "
<< function << ":" << line << ". ";
error = functions->getError();
}
} }
angle::Result CheckError(const gl::Context *context, angle::Result CheckError(const gl::Context *context,
......
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