Commit d104918f by Brandon Jones Committed by Commit Bot

Refactor ANGLE Extensions Validation

Refactors ANGLE Extensions Validation functions into a common format for future autogeneration. Any writes to output parameters that occurred within the ANGLE entry point have been moved into the corresponding validation function. Bug:angleproject:2263 Change-Id: I7a678310ad481c1379596a493fcb0b0383fcf3b8 Reviewed-on: https://chromium-review.googlesource.com/985244 Commit-Queue: Brandon1 Jones <brandon1.jones@intel.com> Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent b33972d4
...@@ -31,6 +31,7 @@ struct LinkedUniform; ...@@ -31,6 +31,7 @@ struct LinkedUniform;
class Program; class Program;
class Shader; class Shader;
void SetRobustLengthParam(GLsizei *length, GLsizei value);
bool IsETC2EACFormat(const GLenum format); bool IsETC2EACFormat(const GLenum format);
bool ValidTextureTarget(const Context *context, TextureType type); bool ValidTextureTarget(const Context *context, TextureType type);
bool ValidTexture2DTarget(const Context *context, TextureType type); bool ValidTexture2DTarget(const Context *context, TextureType type);
...@@ -227,12 +228,30 @@ bool ValidateUniformMatrix(Context *context, ...@@ -227,12 +228,30 @@ bool ValidateUniformMatrix(Context *context,
GLint location, GLint location,
GLsizei count, GLsizei count,
GLboolean transpose); GLboolean transpose);
bool ValidateGetBooleanvRobustANGLE(Context *context,
GLenum pname,
GLsizei bufSize,
GLsizei *length,
GLboolean *params);
bool ValidateGetFloatvRobustANGLE(Context *context,
GLenum pname,
GLsizei bufSize,
GLsizei *length,
GLfloat *params);
bool ValidateStateQuery(Context *context, bool ValidateStateQuery(Context *context,
GLenum pname, GLenum pname,
GLenum *nativeType, GLenum *nativeType,
unsigned int *numParams); unsigned int *numParams);
bool ValidateGetIntegervRobustANGLE(Context *context,
GLenum pname,
GLsizei bufSize,
GLsizei *length,
GLint *data);
bool ValidateGetInteger64vRobustANGLE(Context *context,
GLenum pname,
GLsizei bufSize,
GLsizei *length,
GLint64 *data);
bool ValidateRobustStateQuery(Context *context, bool ValidateRobustStateQuery(Context *context,
GLenum pname, GLenum pname,
GLsizei bufSize, GLsizei bufSize,
...@@ -391,7 +410,8 @@ bool ValidateGetFramebufferAttachmentParameterivRobustANGLE(Context *context, ...@@ -391,7 +410,8 @@ bool ValidateGetFramebufferAttachmentParameterivRobustANGLE(Context *context,
GLenum attachment, GLenum attachment,
GLenum pname, GLenum pname,
GLsizei bufSize, GLsizei bufSize,
GLsizei *numParams); GLsizei *length,
GLint *params);
bool ValidateGetBufferParameterBase(Context *context, bool ValidateGetBufferParameterBase(Context *context,
BufferBinding target, BufferBinding target,
...@@ -417,7 +437,8 @@ bool ValidateGetProgramivRobustANGLE(Context *context, ...@@ -417,7 +437,8 @@ bool ValidateGetProgramivRobustANGLE(Context *context,
GLuint program, GLuint program,
GLenum pname, GLenum pname,
GLsizei bufSize, GLsizei bufSize,
GLsizei *numParams); GLsizei *length,
GLint *params);
bool ValidateGetRenderbufferParameterivBase(Context *context, bool ValidateGetRenderbufferParameterivBase(Context *context,
GLenum target, GLenum target,
...@@ -481,7 +502,7 @@ bool ValidateGetSamplerParameterfvRobustANGLE(Context *context, ...@@ -481,7 +502,7 @@ bool ValidateGetSamplerParameterfvRobustANGLE(Context *context,
bool ValidateGetSamplerParameterivRobustANGLE(Context *context, bool ValidateGetSamplerParameterivRobustANGLE(Context *context,
GLuint sampler, GLuint sampler,
GLenum pname, GLenum pname,
GLuint bufSize, GLsizei bufSize,
GLsizei *length, GLsizei *length,
GLint *params); GLint *params);
......
...@@ -3483,6 +3483,16 @@ bool ValidateStencilStrokePathCHROMIUM(Context *context, GLuint path, GLint refe ...@@ -3483,6 +3483,16 @@ bool ValidateStencilStrokePathCHROMIUM(Context *context, GLuint path, GLint refe
return true; return true;
} }
bool ValidateCoverFillPathCHROMIUM(Context *context, GLuint path, GLenum coverMode)
{
return ValidateCoverPathCHROMIUM(context, path, coverMode);
}
bool ValidateCoverStrokePathCHROMIUM(Context *context, GLuint path, GLenum coverMode)
{
return ValidateCoverPathCHROMIUM(context, path, coverMode);
}
bool ValidateCoverPathCHROMIUM(Context *context, GLuint path, GLenum coverMode) bool ValidateCoverPathCHROMIUM(Context *context, GLuint path, GLenum coverMode)
{ {
if (!context->getExtensions().pathRendering) if (!context->getExtensions().pathRendering)
...@@ -3528,7 +3538,7 @@ bool ValidateStencilThenCoverStrokePathCHROMIUM(Context *context, ...@@ -3528,7 +3538,7 @@ bool ValidateStencilThenCoverStrokePathCHROMIUM(Context *context,
ValidateCoverPathCHROMIUM(context, path, coverMode); ValidateCoverPathCHROMIUM(context, path, coverMode);
} }
bool ValidateIsPathCHROMIUM(Context *context) bool ValidateIsPathCHROMIUM(Context *context, GLuint path)
{ {
if (!context->getExtensions().pathRendering) if (!context->getExtensions().pathRendering)
{ {
......
...@@ -247,6 +247,8 @@ bool ValidateGetPathParameterivCHROMIUM(Context *context, GLuint path, GLenum pn ...@@ -247,6 +247,8 @@ bool ValidateGetPathParameterivCHROMIUM(Context *context, GLuint path, GLenum pn
bool ValidatePathStencilFuncCHROMIUM(Context *context, GLenum func, GLint ref, GLuint mask); bool ValidatePathStencilFuncCHROMIUM(Context *context, GLenum func, GLint ref, GLuint mask);
bool ValidateStencilFillPathCHROMIUM(Context *context, GLuint path, GLenum fillMode, GLuint mask); bool ValidateStencilFillPathCHROMIUM(Context *context, GLuint path, GLenum fillMode, GLuint mask);
bool ValidateStencilStrokePathCHROMIUM(Context *context, GLuint path, GLint reference, GLuint mask); bool ValidateStencilStrokePathCHROMIUM(Context *context, GLuint path, GLint reference, GLuint mask);
bool ValidateCoverFillPathCHROMIUM(Context *context, GLuint path, GLenum coverMode);
bool ValidateCoverStrokePathCHROMIUM(Context *context, GLuint path, GLenum coverMode);
bool ValidateCoverPathCHROMIUM(Context *context, GLuint path, GLenum coverMode); bool ValidateCoverPathCHROMIUM(Context *context, GLuint path, GLenum coverMode);
bool ValidateStencilThenCoverFillPathCHROMIUM(Context *context, bool ValidateStencilThenCoverFillPathCHROMIUM(Context *context,
GLuint path, GLuint path,
...@@ -258,7 +260,7 @@ bool ValidateStencilThenCoverStrokePathCHROMIUM(Context *context, ...@@ -258,7 +260,7 @@ bool ValidateStencilThenCoverStrokePathCHROMIUM(Context *context,
GLint reference, GLint reference,
GLuint mask, GLuint mask,
GLenum coverMode); GLenum coverMode);
bool ValidateIsPathCHROMIUM(Context *context); bool ValidateIsPathCHROMIUM(Context *context, GLuint path);
bool ValidateCoverFillPathInstancedCHROMIUM(Context *context, bool ValidateCoverFillPathInstancedCHROMIUM(Context *context,
GLsizei numPaths, GLsizei numPaths,
GLenum pathNameType, GLenum pathNameType,
......
...@@ -2194,16 +2194,20 @@ bool ValidateGetBufferPointervRobustANGLE(Context *context, ...@@ -2194,16 +2194,20 @@ bool ValidateGetBufferPointervRobustANGLE(Context *context,
return false; return false;
} }
if (!ValidateGetBufferPointervBase(context, target, pname, length, params)) GLsizei numParams = 0;
if (!ValidateGetBufferPointervBase(context, target, pname, &numParams, params))
{ {
return false; return false;
} }
if (!ValidateRobustBufferSize(context, bufSize, *length)) if (!ValidateRobustBufferSize(context, bufSize, numParams))
{ {
return false; return false;
} }
SetRobustLengthParam(length, numParams);
return true; return true;
} }
...@@ -2421,16 +2425,20 @@ bool ValidateGetIntegeri_vRobustANGLE(Context *context, ...@@ -2421,16 +2425,20 @@ bool ValidateGetIntegeri_vRobustANGLE(Context *context,
return false; return false;
} }
if (!ValidateIndexedStateQuery(context, target, index, length)) GLsizei numParams = 0;
if (!ValidateIndexedStateQuery(context, target, index, &numParams))
{ {
return false; return false;
} }
if (!ValidateRobustBufferSize(context, bufSize, *length)) if (!ValidateRobustBufferSize(context, bufSize, numParams))
{ {
return false; return false;
} }
SetRobustLengthParam(length, numParams);
return true; return true;
} }
...@@ -2462,16 +2470,20 @@ bool ValidateGetInteger64i_vRobustANGLE(Context *context, ...@@ -2462,16 +2470,20 @@ bool ValidateGetInteger64i_vRobustANGLE(Context *context,
return false; return false;
} }
if (!ValidateIndexedStateQuery(context, target, index, length)) GLsizei numParams = 0;
if (!ValidateIndexedStateQuery(context, target, index, &numParams))
{ {
return false; return false;
} }
if (!ValidateRobustBufferSize(context, bufSize, *length)) if (!ValidateRobustBufferSize(context, bufSize, numParams))
{ {
return false; return false;
} }
SetRobustLengthParam(length, numParams);
return true; return true;
} }
......
...@@ -389,16 +389,19 @@ bool ValidateGetBooleani_vRobustANGLE(Context *context, ...@@ -389,16 +389,19 @@ bool ValidateGetBooleani_vRobustANGLE(Context *context,
return false; return false;
} }
if (!ValidateIndexedStateQuery(context, target, index, length)) GLsizei numParams = 0;
if (!ValidateIndexedStateQuery(context, target, index, &numParams))
{ {
return false; return false;
} }
if (!ValidateRobustBufferSize(context, bufSize, *length)) if (!ValidateRobustBufferSize(context, bufSize, numParams))
{ {
return false; return false;
} }
SetRobustLengthParam(length, numParams);
return true; return true;
} }
......
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