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;
class Program;
class Shader;
void SetRobustLengthParam(GLsizei *length, GLsizei value);
bool IsETC2EACFormat(const GLenum format);
bool ValidTextureTarget(const Context *context, TextureType type);
bool ValidTexture2DTarget(const Context *context, TextureType type);
......@@ -227,12 +228,30 @@ bool ValidateUniformMatrix(Context *context,
GLint location,
GLsizei count,
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,
GLenum pname,
GLenum *nativeType,
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,
GLenum pname,
GLsizei bufSize,
......@@ -391,7 +410,8 @@ bool ValidateGetFramebufferAttachmentParameterivRobustANGLE(Context *context,
GLenum attachment,
GLenum pname,
GLsizei bufSize,
GLsizei *numParams);
GLsizei *length,
GLint *params);
bool ValidateGetBufferParameterBase(Context *context,
BufferBinding target,
......@@ -417,7 +437,8 @@ bool ValidateGetProgramivRobustANGLE(Context *context,
GLuint program,
GLenum pname,
GLsizei bufSize,
GLsizei *numParams);
GLsizei *length,
GLint *params);
bool ValidateGetRenderbufferParameterivBase(Context *context,
GLenum target,
......@@ -481,7 +502,7 @@ bool ValidateGetSamplerParameterfvRobustANGLE(Context *context,
bool ValidateGetSamplerParameterivRobustANGLE(Context *context,
GLuint sampler,
GLenum pname,
GLuint bufSize,
GLsizei bufSize,
GLsizei *length,
GLint *params);
......
......@@ -3483,6 +3483,16 @@ bool ValidateStencilStrokePathCHROMIUM(Context *context, GLuint path, GLint refe
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)
{
if (!context->getExtensions().pathRendering)
......@@ -3528,7 +3538,7 @@ bool ValidateStencilThenCoverStrokePathCHROMIUM(Context *context,
ValidateCoverPathCHROMIUM(context, path, coverMode);
}
bool ValidateIsPathCHROMIUM(Context *context)
bool ValidateIsPathCHROMIUM(Context *context, GLuint path)
{
if (!context->getExtensions().pathRendering)
{
......
......@@ -247,6 +247,8 @@ bool ValidateGetPathParameterivCHROMIUM(Context *context, GLuint path, GLenum pn
bool ValidatePathStencilFuncCHROMIUM(Context *context, GLenum func, GLint ref, GLuint mask);
bool ValidateStencilFillPathCHROMIUM(Context *context, GLuint path, GLenum fillMode, 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 ValidateStencilThenCoverFillPathCHROMIUM(Context *context,
GLuint path,
......@@ -258,7 +260,7 @@ bool ValidateStencilThenCoverStrokePathCHROMIUM(Context *context,
GLint reference,
GLuint mask,
GLenum coverMode);
bool ValidateIsPathCHROMIUM(Context *context);
bool ValidateIsPathCHROMIUM(Context *context, GLuint path);
bool ValidateCoverFillPathInstancedCHROMIUM(Context *context,
GLsizei numPaths,
GLenum pathNameType,
......
......@@ -2194,16 +2194,20 @@ bool ValidateGetBufferPointervRobustANGLE(Context *context,
return false;
}
if (!ValidateGetBufferPointervBase(context, target, pname, length, params))
GLsizei numParams = 0;
if (!ValidateGetBufferPointervBase(context, target, pname, &numParams, params))
{
return false;
}
if (!ValidateRobustBufferSize(context, bufSize, *length))
if (!ValidateRobustBufferSize(context, bufSize, numParams))
{
return false;
}
SetRobustLengthParam(length, numParams);
return true;
}
......@@ -2421,16 +2425,20 @@ bool ValidateGetIntegeri_vRobustANGLE(Context *context,
return false;
}
if (!ValidateIndexedStateQuery(context, target, index, length))
GLsizei numParams = 0;
if (!ValidateIndexedStateQuery(context, target, index, &numParams))
{
return false;
}
if (!ValidateRobustBufferSize(context, bufSize, *length))
if (!ValidateRobustBufferSize(context, bufSize, numParams))
{
return false;
}
SetRobustLengthParam(length, numParams);
return true;
}
......@@ -2462,16 +2470,20 @@ bool ValidateGetInteger64i_vRobustANGLE(Context *context,
return false;
}
if (!ValidateIndexedStateQuery(context, target, index, length))
GLsizei numParams = 0;
if (!ValidateIndexedStateQuery(context, target, index, &numParams))
{
return false;
}
if (!ValidateRobustBufferSize(context, bufSize, *length))
if (!ValidateRobustBufferSize(context, bufSize, numParams))
{
return false;
}
SetRobustLengthParam(length, numParams);
return true;
}
......
......@@ -389,16 +389,19 @@ bool ValidateGetBooleani_vRobustANGLE(Context *context,
return false;
}
if (!ValidateIndexedStateQuery(context, target, index, length))
GLsizei numParams = 0;
if (!ValidateIndexedStateQuery(context, target, index, &numParams))
{
return false;
}
if (!ValidateRobustBufferSize(context, bufSize, *length))
if (!ValidateRobustBufferSize(context, bufSize, numParams))
{
return false;
}
SetRobustLengthParam(length, numParams);
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