Commit e61d3045 by Geoff Lang Committed by Commit Bot

Don't write to the <length> parameter if an error is generated.

BUG=angleproject:1354 Change-Id: I9ed4a675b2be07b00c29d34e283280dc65238fea Reviewed-on: https://chromium-review.googlesource.com/395109 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: 's avatarCorentin Wallez <cwallez@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent e9e8a899
...@@ -20,7 +20,7 @@ Status ...@@ -20,7 +20,7 @@ Status
Version Version
Version 1, September 26, 2016 Version 3, October 7, 2016
Number Number
...@@ -125,7 +125,7 @@ Additions to the OpenGL ES Specification: ...@@ -125,7 +125,7 @@ Additions to the OpenGL ES Specification:
to the provided buffer. INVALID_OPERATION is generated if <bufSize> is not to the provided buffer. INVALID_OPERATION is generated if <bufSize> is not
large enough. The optional <length> specifies an address of a variable to large enough. The optional <length> specifies an address of a variable to
recieve the number of values written to the buffer. When an error is recieve the number of values written to the buffer. When an error is
generated 0 will be written to <length>. generated nothing will be written to <length>.
Calls to "xRobustANGLE" will generate errors under the same conditions as Calls to "xRobustANGLE" will generate errors under the same conditions as
"x". Any instances of undefined behaviour in "x" will also be undefined in "x". Any instances of undefined behaviour in "x" will also be undefined in
...@@ -154,6 +154,10 @@ Issues ...@@ -154,6 +154,10 @@ Issues
specify data by void* such as TexImage2DRobustANGLE treat the client specify data by void* such as TexImage2DRobustANGLE treat the client
data as bytes. data as bytes.
4) Should <length> be written to if an error is generated?
RESOLVED: No, using the prescedent set by glGetSynciv.
Revision History Revision History
Rev. Date Author Changes Rev. Date Author Changes
...@@ -161,3 +165,4 @@ Revision History ...@@ -161,3 +165,4 @@ Revision History
1 Sept 26, 2016 geofflang Initial version 1 Sept 26, 2016 geofflang Initial version
2 Sept 28, 2016 geofflang Changed name from ANGLE_robust_queries to 2 Sept 28, 2016 geofflang Changed name from ANGLE_robust_queries to
ANGLE_robust_client_memory, added issue 3. ANGLE_robust_client_memory, added issue 3.
3 Oct 7, 2016 geofflang Added and resolved issue 4.
...@@ -1998,8 +1998,6 @@ ANGLE_EXPORT void GL_APIENTRY GetBooleanvRobustANGLE(GLenum pname, ...@@ -1998,8 +1998,6 @@ ANGLE_EXPORT void GL_APIENTRY GetBooleanvRobustANGLE(GLenum pname,
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
SetRobustLengthParam(length, 0);
GLenum nativeType; GLenum nativeType;
unsigned int numParams = 0; unsigned int numParams = 0;
if (!ValidateRobustStateQuery(context, pname, bufSize, &nativeType, &numParams)) if (!ValidateRobustStateQuery(context, pname, bufSize, &nativeType, &numParams))
...@@ -2032,8 +2030,6 @@ ANGLE_EXPORT void GL_APIENTRY GetBufferParameterivRobustANGLE(GLenum target, ...@@ -2032,8 +2030,6 @@ ANGLE_EXPORT void GL_APIENTRY GetBufferParameterivRobustANGLE(GLenum target,
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
SetRobustLengthParam(length, 0);
GLsizei numParams = 0; GLsizei numParams = 0;
if (!ValidateGetBufferParameteriv(context, target, pname, &numParams)) if (!ValidateGetBufferParameteriv(context, target, pname, &numParams))
{ {
...@@ -2060,8 +2056,6 @@ ANGLE_EXPORT void GL_APIENTRY GetFloatvRobustANGLE(GLenum pname, ...@@ -2060,8 +2056,6 @@ ANGLE_EXPORT void GL_APIENTRY GetFloatvRobustANGLE(GLenum pname,
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
SetRobustLengthParam(length, 0);
GLenum nativeType; GLenum nativeType;
unsigned int numParams = 0; unsigned int numParams = 0;
if (!ValidateRobustStateQuery(context, pname, bufSize, &nativeType, &numParams)) if (!ValidateRobustStateQuery(context, pname, bufSize, &nativeType, &numParams))
...@@ -2097,8 +2091,6 @@ ANGLE_EXPORT void GL_APIENTRY GetFramebufferAttachmentParameterivRobustANGLE(GLe ...@@ -2097,8 +2091,6 @@ ANGLE_EXPORT void GL_APIENTRY GetFramebufferAttachmentParameterivRobustANGLE(GLe
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
SetRobustLengthParam(length, 0);
GLsizei numParams = 0; GLsizei numParams = 0;
if (!ValidateGetFramebufferAttachmentParameterivRobustANGLE(context, target, attachment, if (!ValidateGetFramebufferAttachmentParameterivRobustANGLE(context, target, attachment,
pname, bufSize, &numParams)) pname, bufSize, &numParams))
...@@ -2125,8 +2117,6 @@ ANGLE_EXPORT void GL_APIENTRY GetIntegervRobustANGLE(GLenum pname, ...@@ -2125,8 +2117,6 @@ ANGLE_EXPORT void GL_APIENTRY GetIntegervRobustANGLE(GLenum pname,
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
SetRobustLengthParam(length, 0);
GLenum nativeType; GLenum nativeType;
unsigned int numParams = 0; unsigned int numParams = 0;
if (!ValidateRobustStateQuery(context, pname, bufSize, &nativeType, &numParams)) if (!ValidateRobustStateQuery(context, pname, bufSize, &nativeType, &numParams))
...@@ -2160,8 +2150,6 @@ ANGLE_EXPORT void GL_APIENTRY GetProgramivRobustANGLE(GLuint program, ...@@ -2160,8 +2150,6 @@ ANGLE_EXPORT void GL_APIENTRY GetProgramivRobustANGLE(GLuint program,
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
SetRobustLengthParam(length, 0);
GLsizei numParams = 0; GLsizei numParams = 0;
if (!ValidateGetProgramivRobustANGLE(context, program, pname, bufSize, &numParams)) if (!ValidateGetProgramivRobustANGLE(context, program, pname, bufSize, &numParams))
{ {
......
...@@ -272,7 +272,6 @@ TEST_P(RobustClientMemoryTest, GetInteger) ...@@ -272,7 +272,6 @@ TEST_P(RobustClientMemoryTest, GetInteger)
glGetIntegervRobustANGLE(GL_COMPRESSED_TEXTURE_FORMATS, numCompressedFormats - 1, &length, glGetIntegervRobustANGLE(GL_COMPRESSED_TEXTURE_FORMATS, numCompressedFormats - 1, &length,
resultBuf.data()); resultBuf.data());
EXPECT_GL_ERROR(GL_INVALID_OPERATION); EXPECT_GL_ERROR(GL_INVALID_OPERATION);
EXPECT_EQ(0, length);
EXPECT_TRUE(std::all_of(resultBuf.begin(), resultBuf.end(), EXPECT_TRUE(std::all_of(resultBuf.begin(), resultBuf.end(),
[](GLint value) { return value == 0; })); [](GLint value) { return value == 0; }));
......
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