Commit ced53ae2 by He Yunchao Committed by Commit Bot

Fix the coding style issue for validation code

Change-Id: I63aa1c1b3bbc52b0b522e4a703e6d20574eb21ad Reviewed-on: https://chromium-review.googlesource.com/414588Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent e157e5a9
...@@ -1387,15 +1387,20 @@ bool ValidTexture3DDestinationTarget(const ValidationContext *context, GLenum ta ...@@ -1387,15 +1387,20 @@ bool ValidTexture3DDestinationTarget(const ValidationContext *context, GLenum ta
bool ValidFramebufferTarget(GLenum target) bool ValidFramebufferTarget(GLenum target)
{ {
static_assert(GL_DRAW_FRAMEBUFFER_ANGLE == GL_DRAW_FRAMEBUFFER && GL_READ_FRAMEBUFFER_ANGLE == GL_READ_FRAMEBUFFER, static_assert(GL_DRAW_FRAMEBUFFER_ANGLE == GL_DRAW_FRAMEBUFFER &&
GL_READ_FRAMEBUFFER_ANGLE == GL_READ_FRAMEBUFFER,
"ANGLE framebuffer enums must equal the ES3 framebuffer enums."); "ANGLE framebuffer enums must equal the ES3 framebuffer enums.");
switch (target) switch (target)
{ {
case GL_FRAMEBUFFER: return true; case GL_FRAMEBUFFER:
case GL_READ_FRAMEBUFFER: return true; return true;
case GL_DRAW_FRAMEBUFFER: return true; case GL_READ_FRAMEBUFFER:
default: return false; return true;
case GL_DRAW_FRAMEBUFFER:
return true;
default:
return false;
} }
} }
...@@ -1454,7 +1459,8 @@ bool ValidMipLevel(const ValidationContext *context, GLenum target, GLint level) ...@@ -1454,7 +1459,8 @@ bool ValidMipLevel(const ValidationContext *context, GLenum target, GLint level)
case GL_TEXTURE_2D_ARRAY: case GL_TEXTURE_2D_ARRAY:
maxDimension = caps.max2DTextureSize; maxDimension = caps.max2DTextureSize;
break; break;
default: UNREACHABLE(); default:
UNREACHABLE();
} }
return level <= gl::log2(static_cast<int>(maxDimension)); return level <= gl::log2(static_cast<int>(maxDimension));
...@@ -1608,8 +1614,10 @@ bool ValidImageDataSize(ValidationContext *context, ...@@ -1608,8 +1614,10 @@ bool ValidImageDataSize(ValidationContext *context,
bool ValidQueryType(const Context *context, GLenum queryType) bool ValidQueryType(const Context *context, GLenum queryType)
{ {
static_assert(GL_ANY_SAMPLES_PASSED == GL_ANY_SAMPLES_PASSED_EXT, "GL extension enums not equal."); static_assert(GL_ANY_SAMPLES_PASSED == GL_ANY_SAMPLES_PASSED_EXT,
static_assert(GL_ANY_SAMPLES_PASSED_CONSERVATIVE == GL_ANY_SAMPLES_PASSED_CONSERVATIVE_EXT, "GL extension enums not equal."); "GL extension enums not equal.");
static_assert(GL_ANY_SAMPLES_PASSED_CONSERVATIVE == GL_ANY_SAMPLES_PASSED_CONSERVATIVE_EXT,
"GL extension enums not equal.");
switch (queryType) switch (queryType)
{ {
...@@ -1629,9 +1637,10 @@ bool ValidQueryType(const Context *context, GLenum queryType) ...@@ -1629,9 +1637,10 @@ bool ValidQueryType(const Context *context, GLenum queryType)
Program *GetValidProgram(ValidationContext *context, GLuint id) Program *GetValidProgram(ValidationContext *context, GLuint id)
{ {
// ES3 spec (section 2.11.1) -- "Commands that accept shader or program object names will generate the // ES3 spec (section 2.11.1) -- "Commands that accept shader or program object names will
// error INVALID_VALUE if the provided name is not the name of either a shader or program object and // generate the error INVALID_VALUE if the provided name is not the name of either a shader
// INVALID_OPERATION if the provided name identifies an object that is not the expected type." // or program object and INVALID_OPERATION if the provided name identifies an object
// that is not the expected type."
Program *validProgram = context->getProgram(id); Program *validProgram = context->getProgram(id);
...@@ -1711,8 +1720,12 @@ bool ValidateAttachmentTarget(gl::Context *context, GLenum attachment) ...@@ -1711,8 +1720,12 @@ bool ValidateAttachmentTarget(gl::Context *context, GLenum attachment)
return true; return true;
} }
bool ValidateRenderbufferStorageParametersBase(gl::Context *context, GLenum target, GLsizei samples, bool ValidateRenderbufferStorageParametersBase(gl::Context *context,
GLenum internalformat, GLsizei width, GLsizei height) GLenum target,
GLsizei samples,
GLenum internalformat,
GLsizei width,
GLsizei height)
{ {
switch (target) switch (target)
{ {
...@@ -1762,8 +1775,12 @@ bool ValidateRenderbufferStorageParametersBase(gl::Context *context, GLenum targ ...@@ -1762,8 +1775,12 @@ bool ValidateRenderbufferStorageParametersBase(gl::Context *context, GLenum targ
return true; return true;
} }
bool ValidateRenderbufferStorageParametersANGLE(gl::Context *context, GLenum target, GLsizei samples, bool ValidateRenderbufferStorageParametersANGLE(gl::Context *context,
GLenum internalformat, GLsizei width, GLsizei height) GLenum target,
GLsizei samples,
GLenum internalformat,
GLsizei width,
GLsizei height)
{ {
ASSERT(samples == 0 || context->getExtensions().framebufferMultisample); ASSERT(samples == 0 || context->getExtensions().framebufferMultisample);
...@@ -1790,11 +1807,15 @@ bool ValidateRenderbufferStorageParametersANGLE(gl::Context *context, GLenum tar ...@@ -1790,11 +1807,15 @@ bool ValidateRenderbufferStorageParametersANGLE(gl::Context *context, GLenum tar
} }
} }
return ValidateRenderbufferStorageParametersBase(context, target, samples, internalformat, width, height); return ValidateRenderbufferStorageParametersBase(context, target, samples, internalformat,
width, height);
} }
bool ValidateFramebufferRenderbufferParameters(gl::Context *context, GLenum target, GLenum attachment, bool ValidateFramebufferRenderbufferParameters(gl::Context *context,
GLenum renderbuffertarget, GLuint renderbuffer) GLenum target,
GLenum attachment,
GLenum renderbuffertarget,
GLuint renderbuffer)
{ {
if (!ValidFramebufferTarget(target)) if (!ValidFramebufferTarget(target))
{ {
...@@ -1934,8 +1955,10 @@ bool ValidateBlitFramebufferParameters(ValidationContext *context, ...@@ -1934,8 +1955,10 @@ bool ValidateBlitFramebufferParameters(ValidationContext *context,
// The GL ES 3.0.2 spec (pg 193) states that: // The GL ES 3.0.2 spec (pg 193) states that:
// 1) If the read buffer is fixed point format, the draw buffer must be as well // 1) If the read buffer is fixed point format, the draw buffer must be as well
// 2) If the read buffer is an unsigned integer format, the draw buffer must be as well // 2) If the read buffer is an unsigned integer format, the draw buffer must be
// 3) If the read buffer is a signed integer format, the draw buffer must be as well // as well
// 3) If the read buffer is a signed integer format, the draw buffer must be as
// well
// Changes with EXT_color_buffer_float: // Changes with EXT_color_buffer_float:
// Case 1) is changed to fixed point OR floating point // Case 1) is changed to fixed point OR floating point
GLenum readComponentType = readFormat.info->componentType; GLenum readComponentType = readFormat.info->componentType;
...@@ -2005,8 +2028,10 @@ bool ValidateBlitFramebufferParameters(ValidationContext *context, ...@@ -2005,8 +2028,10 @@ bool ValidateBlitFramebufferParameters(ValidationContext *context,
{ {
if (mask & masks[i]) if (mask & masks[i])
{ {
const gl::FramebufferAttachment *readBuffer = readFramebuffer->getAttachment(attachments[i]); const gl::FramebufferAttachment *readBuffer =
const gl::FramebufferAttachment *drawBuffer = drawFramebuffer->getAttachment(attachments[i]); readFramebuffer->getAttachment(attachments[i]);
const gl::FramebufferAttachment *drawBuffer =
drawFramebuffer->getAttachment(attachments[i]);
if (readBuffer && drawBuffer) if (readBuffer && drawBuffer)
{ {
...@@ -2693,7 +2718,10 @@ bool ValidateUniform(gl::Context *context, GLenum uniformType, GLint location, G ...@@ -2693,7 +2718,10 @@ bool ValidateUniform(gl::Context *context, GLenum uniformType, GLint location, G
return true; return true;
} }
bool ValidateUniformMatrix(gl::Context *context, GLenum matrixType, GLint location, GLsizei count, bool ValidateUniformMatrix(gl::Context *context,
GLenum matrixType,
GLint location,
GLsizei count,
GLboolean transpose) GLboolean transpose)
{ {
// Check for ES3 uniform entry points // Check for ES3 uniform entry points
...@@ -2855,7 +2883,8 @@ bool ValidateCopyTexImageParametersBase(ValidationContext *context, ...@@ -2855,7 +2883,8 @@ bool ValidateCopyTexImageParametersBase(ValidationContext *context,
return false; return false;
} }
if (std::numeric_limits<GLsizei>::max() - xoffset < width || std::numeric_limits<GLsizei>::max() - yoffset < height) if (std::numeric_limits<GLsizei>::max() - xoffset < width ||
std::numeric_limits<GLsizei>::max() - yoffset < height)
{ {
context->handleError(Error(GL_INVALID_VALUE)); context->handleError(Error(GL_INVALID_VALUE));
return false; return false;
...@@ -2977,7 +3006,8 @@ bool ValidateCopyTexImageParametersBase(ValidationContext *context, ...@@ -2977,7 +3006,8 @@ bool ValidateCopyTexImageParametersBase(ValidationContext *context,
} }
int maxLevelDimension = (maxDimension >> level); int maxLevelDimension = (maxDimension >> level);
if (static_cast<int>(width) > maxLevelDimension || static_cast<int>(height) > maxLevelDimension) if (static_cast<int>(width) > maxLevelDimension ||
static_cast<int>(height) > maxLevelDimension)
{ {
context->handleError(Error(GL_INVALID_VALUE)); context->handleError(Error(GL_INVALID_VALUE));
return false; return false;
...@@ -3041,8 +3071,7 @@ static bool ValidateDrawBase(ValidationContext *context, ...@@ -3041,8 +3071,7 @@ static bool ValidateDrawBase(ValidationContext *context,
{ {
// Note: these separate values are not supported in WebGL, due to D3D's limitations. See // Note: these separate values are not supported in WebGL, due to D3D's limitations. See
// Section 6.10 of the WebGL 1.0 spec // Section 6.10 of the WebGL 1.0 spec
ERR( ERR("This ANGLE implementation does not support separate front/back stencil "
"This ANGLE implementation does not support separate front/back stencil "
"writemasks, reference values, or stencil mask values."); "writemasks, reference values, or stencil mask values.");
context->handleError(Error(GL_INVALID_OPERATION)); context->handleError(Error(GL_INVALID_OPERATION));
return false; return false;
...@@ -3069,7 +3098,8 @@ static bool ValidateDrawBase(ValidationContext *context, ...@@ -3069,7 +3098,8 @@ static bool ValidateDrawBase(ValidationContext *context,
} }
// Uniform buffer validation // Uniform buffer validation
for (unsigned int uniformBlockIndex = 0; uniformBlockIndex < program->getActiveUniformBlockCount(); uniformBlockIndex++) for (unsigned int uniformBlockIndex = 0;
uniformBlockIndex < program->getActiveUniformBlockCount(); uniformBlockIndex++)
{ {
const gl::UniformBlock &uniformBlock = program->getUniformBlockByIndex(uniformBlockIndex); const gl::UniformBlock &uniformBlock = program->getUniformBlockByIndex(uniformBlockIndex);
GLuint blockBinding = program->getUniformBlockBinding(uniformBlockIndex); GLuint blockBinding = program->getUniformBlockBinding(uniformBlockIndex);
...@@ -3120,11 +3150,12 @@ bool ValidateDrawArrays(ValidationContext *context, ...@@ -3120,11 +3150,12 @@ bool ValidateDrawArrays(ValidationContext *context,
const State &state = context->getGLState(); const State &state = context->getGLState();
gl::TransformFeedback *curTransformFeedback = state.getCurrentTransformFeedback(); gl::TransformFeedback *curTransformFeedback = state.getCurrentTransformFeedback();
if (curTransformFeedback && curTransformFeedback->isActive() && !curTransformFeedback->isPaused() && if (curTransformFeedback && curTransformFeedback->isActive() &&
curTransformFeedback->getPrimitiveMode() != mode) !curTransformFeedback->isPaused() && curTransformFeedback->getPrimitiveMode() != mode)
{ {
// It is an invalid operation to call DrawArrays or DrawArraysInstanced with a draw mode // It is an invalid operation to call DrawArrays or DrawArraysInstanced with a draw mode
// that does not match the current transform feedback object's draw mode (if transform feedback // that does not match the current transform feedback object's draw mode (if transform
// feedback
// is active), (3.0.2, section 2.14, pg 86) // is active), (3.0.2, section 2.14, pg 86)
context->handleError(Error(GL_INVALID_OPERATION)); context->handleError(Error(GL_INVALID_OPERATION));
return false; return false;
...@@ -3143,7 +3174,11 @@ bool ValidateDrawArrays(ValidationContext *context, ...@@ -3143,7 +3174,11 @@ bool ValidateDrawArrays(ValidationContext *context,
return true; return true;
} }
bool ValidateDrawArraysInstanced(Context *context, GLenum mode, GLint first, GLsizei count, GLsizei primcount) bool ValidateDrawArraysInstanced(Context *context,
GLenum mode,
GLint first,
GLsizei count,
GLsizei primcount)
{ {
if (primcount < 0) if (primcount < 0)
{ {
...@@ -3183,7 +3218,11 @@ static bool ValidateDrawInstancedANGLE(Context *context) ...@@ -3183,7 +3218,11 @@ static bool ValidateDrawInstancedANGLE(Context *context)
return false; return false;
} }
bool ValidateDrawArraysInstancedANGLE(Context *context, GLenum mode, GLint first, GLsizei count, GLsizei primcount) bool ValidateDrawArraysInstancedANGLE(Context *context,
GLenum mode,
GLint first,
GLsizei count,
GLsizei primcount)
{ {
if (!ValidateDrawInstancedANGLE(context)) if (!ValidateDrawInstancedANGLE(context))
{ {
...@@ -3221,9 +3260,11 @@ bool ValidateDrawElements(ValidationContext *context, ...@@ -3221,9 +3260,11 @@ bool ValidateDrawElements(ValidationContext *context,
const State &state = context->getGLState(); const State &state = context->getGLState();
gl::TransformFeedback *curTransformFeedback = state.getCurrentTransformFeedback(); gl::TransformFeedback *curTransformFeedback = state.getCurrentTransformFeedback();
if (curTransformFeedback && curTransformFeedback->isActive() && !curTransformFeedback->isPaused()) if (curTransformFeedback && curTransformFeedback->isActive() &&
!curTransformFeedback->isPaused())
{ {
// It is an invalid operation to call DrawElements, DrawRangeElements or DrawElementsInstanced // It is an invalid operation to call DrawElements, DrawRangeElements or
// DrawElementsInstanced
// while transform feedback is active, (3.0.2, section 2.14, pg 86) // while transform feedback is active, (3.0.2, section 2.14, pg 86)
context->handleError(Error(GL_INVALID_OPERATION)); context->handleError(Error(GL_INVALID_OPERATION));
return false; return false;
...@@ -3249,7 +3290,8 @@ bool ValidateDrawElements(ValidationContext *context, ...@@ -3249,7 +3290,8 @@ bool ValidateDrawElements(ValidationContext *context,
const gl::Type &typeInfo = gl::GetTypeInfo(type); const gl::Type &typeInfo = gl::GetTypeInfo(type);
GLint64 offset = reinterpret_cast<GLint64>(indices); GLint64 offset = reinterpret_cast<GLint64>(indices);
GLint64 byteCount = static_cast<GLint64>(typeInfo.bytes) * static_cast<GLint64>(count)+offset; GLint64 byteCount =
static_cast<GLint64>(typeInfo.bytes) * static_cast<GLint64>(count) + offset;
// check for integer overflows // check for integer overflows
if (static_cast<GLuint>(count) > (std::numeric_limits<GLuint>::max() / typeInfo.bytes) || if (static_cast<GLuint>(count) > (std::numeric_limits<GLuint>::max() / typeInfo.bytes) ||
...@@ -3352,11 +3394,15 @@ bool ValidateDrawElementsInstancedANGLE(Context *context, ...@@ -3352,11 +3394,15 @@ bool ValidateDrawElementsInstancedANGLE(Context *context,
return false; return false;
} }
return ValidateDrawElementsInstanced(context, mode, count, type, indices, primcount, indexRangeOut); return ValidateDrawElementsInstanced(context, mode, count, type, indices, primcount,
indexRangeOut);
} }
bool ValidateFramebufferTextureBase(Context *context, GLenum target, GLenum attachment, bool ValidateFramebufferTextureBase(Context *context,
GLuint texture, GLint level) GLenum target,
GLenum attachment,
GLuint texture,
GLint level)
{ {
if (!ValidFramebufferTarget(target)) if (!ValidFramebufferTarget(target))
{ {
...@@ -3399,10 +3445,15 @@ bool ValidateFramebufferTextureBase(Context *context, GLenum target, GLenum atta ...@@ -3399,10 +3445,15 @@ bool ValidateFramebufferTextureBase(Context *context, GLenum target, GLenum atta
return true; return true;
} }
bool ValidateFramebufferTexture2D(Context *context, GLenum target, GLenum attachment, bool ValidateFramebufferTexture2D(Context *context,
GLenum textarget, GLuint texture, GLint level) GLenum target,
GLenum attachment,
GLenum textarget,
GLuint texture,
GLint level)
{ {
// Attachments are required to be bound to level 0 without ES3 or the GL_OES_fbo_render_mipmap extension // Attachments are required to be bound to level 0 without ES3 or the GL_OES_fbo_render_mipmap
// extension
if (context->getClientMajorVersion() < 3 && !context->getExtensions().fboRenderMipmap && if (context->getClientMajorVersion() < 3 && !context->getExtensions().fboRenderMipmap &&
level != 0) level != 0)
{ {
...@@ -3504,12 +3555,12 @@ bool ValidateGetUniformBase(Context *context, GLuint program, GLint location) ...@@ -3504,12 +3555,12 @@ bool ValidateGetUniformBase(Context *context, GLuint program, GLint location)
return true; return true;
} }
bool ValidateGetUniformfv(Context *context, GLuint program, GLint location, GLfloat* params) bool ValidateGetUniformfv(Context *context, GLuint program, GLint location, GLfloat *params)
{ {
return ValidateGetUniformBase(context, program, location); return ValidateGetUniformBase(context, program, location);
} }
bool ValidateGetUniformiv(Context *context, GLuint program, GLint location, GLint* params) bool ValidateGetUniformiv(Context *context, GLuint program, GLint location, GLint *params)
{ {
return ValidateGetUniformBase(context, program, location); return ValidateGetUniformBase(context, program, location);
} }
...@@ -3557,12 +3608,20 @@ static bool ValidateSizedGetUniform(Context *context, ...@@ -3557,12 +3608,20 @@ static bool ValidateSizedGetUniform(Context *context,
return true; return true;
} }
bool ValidateGetnUniformfvEXT(Context *context, GLuint program, GLint location, GLsizei bufSize, GLfloat* params) bool ValidateGetnUniformfvEXT(Context *context,
GLuint program,
GLint location,
GLsizei bufSize,
GLfloat *params)
{ {
return ValidateSizedGetUniform(context, program, location, bufSize, nullptr); return ValidateSizedGetUniform(context, program, location, bufSize, nullptr);
} }
bool ValidateGetnUniformivEXT(Context *context, GLuint program, GLint location, GLsizei bufSize, GLint* params) bool ValidateGetnUniformivEXT(Context *context,
GLuint program,
GLint location,
GLsizei bufSize,
GLint *params)
{ {
return ValidateSizedGetUniform(context, program, location, bufSize, nullptr); return ValidateSizedGetUniform(context, program, location, bufSize, nullptr);
} }
...@@ -3622,8 +3681,11 @@ bool ValidateGetUniformuivRobustANGLE(Context *context, ...@@ -3622,8 +3681,11 @@ bool ValidateGetUniformuivRobustANGLE(Context *context,
return ValidateSizedGetUniform(context, program, location, bufSize, length); return ValidateSizedGetUniform(context, program, location, bufSize, length);
} }
bool ValidateDiscardFramebufferBase(Context *context, GLenum target, GLsizei numAttachments, bool ValidateDiscardFramebufferBase(Context *context,
const GLenum *attachments, bool defaultFramebuffer) GLenum target,
GLsizei numAttachments,
const GLenum *attachments,
bool defaultFramebuffer)
{ {
if (numAttachments < 0) if (numAttachments < 0)
{ {
......
...@@ -313,8 +313,7 @@ bool ValidateES2TexImageParameters(Context *context, ...@@ -313,8 +313,7 @@ bool ValidateES2TexImageParameters(Context *context,
return false; return false;
} }
if (level < 0 || xoffset < 0 || if (level < 0 || xoffset < 0 || std::numeric_limits<GLsizei>::max() - xoffset < width ||
std::numeric_limits<GLsizei>::max() - xoffset < width ||
std::numeric_limits<GLsizei>::max() - yoffset < height) std::numeric_limits<GLsizei>::max() - yoffset < height)
{ {
context->handleError(Error(GL_INVALID_VALUE)); context->handleError(Error(GL_INVALID_VALUE));
...@@ -359,7 +358,8 @@ bool ValidateES2TexImageParameters(Context *context, ...@@ -359,7 +358,8 @@ bool ValidateES2TexImageParameters(Context *context,
return false; return false;
} }
gl::Texture *texture = context->getTargetTexture(IsCubeMapTextureTarget(target) ? GL_TEXTURE_CUBE_MAP : target); gl::Texture *texture =
context->getTargetTexture(IsCubeMapTextureTarget(target) ? GL_TEXTURE_CUBE_MAP : target);
if (!texture) if (!texture)
{ {
context->handleError(Error(GL_INVALID_OPERATION)); context->handleError(Error(GL_INVALID_OPERATION));
...@@ -445,14 +445,15 @@ bool ValidateES2TexImageParameters(Context *context, ...@@ -445,14 +445,15 @@ bool ValidateES2TexImageParameters(Context *context,
case GL_ETC1_RGB8_LOSSY_DECODE_ANGLE: case GL_ETC1_RGB8_LOSSY_DECODE_ANGLE:
if (!context->getExtensions().lossyETCDecode) if (!context->getExtensions().lossyETCDecode)
{ {
context->handleError( context->handleError(Error(
Error(GL_INVALID_ENUM, "ANGLE_lossy_etc_decode extension is not supported")); GL_INVALID_ENUM, "ANGLE_lossy_etc_decode extension is not supported"));
return false; return false;
} }
break; break;
default: default:
context->handleError(Error( context->handleError(
GL_INVALID_ENUM, "internalformat is not a supported compressed internal format")); Error(GL_INVALID_ENUM,
"internalformat is not a supported compressed internal format"));
return false; return false;
} }
if (!ValidCompressedImageSize(context, actualInternalFormat, width, height)) if (!ValidCompressedImageSize(context, actualInternalFormat, width, height))
...@@ -571,7 +572,8 @@ bool ValidateES2TexImageParameters(Context *context, ...@@ -571,7 +572,8 @@ bool ValidateES2TexImageParameters(Context *context,
return false; return false;
} }
break; break;
case GL_COMPRESSED_RGB_S3TC_DXT1_EXT: // error cases for compressed textures are handled below case GL_COMPRESSED_RGB_S3TC_DXT1_EXT: // error cases for compressed textures are
// handled below
case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT: case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT:
case GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE: case GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE:
case GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE: case GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE:
...@@ -663,8 +665,8 @@ bool ValidateES2TexImageParameters(Context *context, ...@@ -663,8 +665,8 @@ bool ValidateES2TexImageParameters(Context *context,
} }
else else
{ {
context->handleError( context->handleError(Error(
Error(GL_INVALID_ENUM, "ANGLE_lossy_etc_decode extension is not supported.")); GL_INVALID_ENUM, "ANGLE_lossy_etc_decode extension is not supported."));
return false; return false;
} }
break; break;
...@@ -756,22 +758,17 @@ bool ValidateES2CopyTexImageParameters(ValidationContext *context, ...@@ -756,22 +758,17 @@ bool ValidateES2CopyTexImageParameters(ValidationContext *context,
switch (formatInfo.format) switch (formatInfo.format)
{ {
case GL_ALPHA: case GL_ALPHA:
if (colorbufferFormat != GL_ALPHA8_EXT && if (colorbufferFormat != GL_ALPHA8_EXT && colorbufferFormat != GL_RGBA4 &&
colorbufferFormat != GL_RGBA4 && colorbufferFormat != GL_RGB5_A1 && colorbufferFormat != GL_RGBA8_OES)
colorbufferFormat != GL_RGB5_A1 &&
colorbufferFormat != GL_RGBA8_OES)
{ {
context->handleError(Error(GL_INVALID_OPERATION)); context->handleError(Error(GL_INVALID_OPERATION));
return false; return false;
} }
break; break;
case GL_LUMINANCE: case GL_LUMINANCE:
if (colorbufferFormat != GL_R8_EXT && if (colorbufferFormat != GL_R8_EXT && colorbufferFormat != GL_RG8_EXT &&
colorbufferFormat != GL_RG8_EXT && colorbufferFormat != GL_RGB565 && colorbufferFormat != GL_RGB8_OES &&
colorbufferFormat != GL_RGB565 && colorbufferFormat != GL_RGBA4 && colorbufferFormat != GL_RGB5_A1 &&
colorbufferFormat != GL_RGB8_OES &&
colorbufferFormat != GL_RGBA4 &&
colorbufferFormat != GL_RGB5_A1 &&
colorbufferFormat != GL_RGBA8_OES) colorbufferFormat != GL_RGBA8_OES)
{ {
context->handleError(Error(GL_INVALID_OPERATION)); context->handleError(Error(GL_INVALID_OPERATION));
...@@ -779,16 +776,11 @@ bool ValidateES2CopyTexImageParameters(ValidationContext *context, ...@@ -779,16 +776,11 @@ bool ValidateES2CopyTexImageParameters(ValidationContext *context,
} }
break; break;
case GL_RED_EXT: case GL_RED_EXT:
if (colorbufferFormat != GL_R8_EXT && if (colorbufferFormat != GL_R8_EXT && colorbufferFormat != GL_RG8_EXT &&
colorbufferFormat != GL_RG8_EXT && colorbufferFormat != GL_RGB565 && colorbufferFormat != GL_RGB8_OES &&
colorbufferFormat != GL_RGB565 && colorbufferFormat != GL_RGBA4 && colorbufferFormat != GL_RGB5_A1 &&
colorbufferFormat != GL_RGB8_OES && colorbufferFormat != GL_RGBA8_OES && colorbufferFormat != GL_R32F &&
colorbufferFormat != GL_RGBA4 && colorbufferFormat != GL_RG32F && colorbufferFormat != GL_RGB32F &&
colorbufferFormat != GL_RGB5_A1 &&
colorbufferFormat != GL_RGBA8_OES &&
colorbufferFormat != GL_R32F &&
colorbufferFormat != GL_RG32F &&
colorbufferFormat != GL_RGB32F &&
colorbufferFormat != GL_RGBA32F) colorbufferFormat != GL_RGBA32F)
{ {
context->handleError(Error(GL_INVALID_OPERATION)); context->handleError(Error(GL_INVALID_OPERATION));
...@@ -796,14 +788,10 @@ bool ValidateES2CopyTexImageParameters(ValidationContext *context, ...@@ -796,14 +788,10 @@ bool ValidateES2CopyTexImageParameters(ValidationContext *context,
} }
break; break;
case GL_RG_EXT: case GL_RG_EXT:
if (colorbufferFormat != GL_RG8_EXT && if (colorbufferFormat != GL_RG8_EXT && colorbufferFormat != GL_RGB565 &&
colorbufferFormat != GL_RGB565 && colorbufferFormat != GL_RGB8_OES && colorbufferFormat != GL_RGBA4 &&
colorbufferFormat != GL_RGB8_OES && colorbufferFormat != GL_RGB5_A1 && colorbufferFormat != GL_RGBA8_OES &&
colorbufferFormat != GL_RGBA4 && colorbufferFormat != GL_RG32F && colorbufferFormat != GL_RGB32F &&
colorbufferFormat != GL_RGB5_A1 &&
colorbufferFormat != GL_RGBA8_OES &&
colorbufferFormat != GL_RG32F &&
colorbufferFormat != GL_RGB32F &&
colorbufferFormat != GL_RGBA32F) colorbufferFormat != GL_RGBA32F)
{ {
context->handleError(Error(GL_INVALID_OPERATION)); context->handleError(Error(GL_INVALID_OPERATION));
...@@ -811,12 +799,9 @@ bool ValidateES2CopyTexImageParameters(ValidationContext *context, ...@@ -811,12 +799,9 @@ bool ValidateES2CopyTexImageParameters(ValidationContext *context,
} }
break; break;
case GL_RGB: case GL_RGB:
if (colorbufferFormat != GL_RGB565 && if (colorbufferFormat != GL_RGB565 && colorbufferFormat != GL_RGB8_OES &&
colorbufferFormat != GL_RGB8_OES && colorbufferFormat != GL_RGBA4 && colorbufferFormat != GL_RGB5_A1 &&
colorbufferFormat != GL_RGBA4 && colorbufferFormat != GL_RGBA8_OES && colorbufferFormat != GL_RGB32F &&
colorbufferFormat != GL_RGB5_A1 &&
colorbufferFormat != GL_RGBA8_OES &&
colorbufferFormat != GL_RGB32F &&
colorbufferFormat != GL_RGBA32F) colorbufferFormat != GL_RGBA32F)
{ {
context->handleError(Error(GL_INVALID_OPERATION)); context->handleError(Error(GL_INVALID_OPERATION));
...@@ -825,10 +810,8 @@ bool ValidateES2CopyTexImageParameters(ValidationContext *context, ...@@ -825,10 +810,8 @@ bool ValidateES2CopyTexImageParameters(ValidationContext *context,
break; break;
case GL_LUMINANCE_ALPHA: case GL_LUMINANCE_ALPHA:
case GL_RGBA: case GL_RGBA:
if (colorbufferFormat != GL_RGBA4 && if (colorbufferFormat != GL_RGBA4 && colorbufferFormat != GL_RGB5_A1 &&
colorbufferFormat != GL_RGB5_A1 && colorbufferFormat != GL_RGBA8_OES && colorbufferFormat != GL_RGBA32F)
colorbufferFormat != GL_RGBA8_OES &&
colorbufferFormat != GL_RGBA32F)
{ {
context->handleError(Error(GL_INVALID_OPERATION)); context->handleError(Error(GL_INVALID_OPERATION));
return false; return false;
...@@ -862,26 +845,19 @@ bool ValidateES2CopyTexImageParameters(ValidationContext *context, ...@@ -862,26 +845,19 @@ bool ValidateES2CopyTexImageParameters(ValidationContext *context,
switch (internalformat) switch (internalformat)
{ {
case GL_ALPHA: case GL_ALPHA:
if (colorbufferFormat != GL_ALPHA8_EXT && if (colorbufferFormat != GL_ALPHA8_EXT && colorbufferFormat != GL_RGBA4 &&
colorbufferFormat != GL_RGBA4 && colorbufferFormat != GL_RGB5_A1 && colorbufferFormat != GL_BGRA8_EXT &&
colorbufferFormat != GL_RGB5_A1 && colorbufferFormat != GL_RGBA8_OES && colorbufferFormat != GL_BGR5_A1_ANGLEX)
colorbufferFormat != GL_BGRA8_EXT &&
colorbufferFormat != GL_RGBA8_OES &&
colorbufferFormat != GL_BGR5_A1_ANGLEX)
{ {
context->handleError(Error(GL_INVALID_OPERATION)); context->handleError(Error(GL_INVALID_OPERATION));
return false; return false;
} }
break; break;
case GL_LUMINANCE: case GL_LUMINANCE:
if (colorbufferFormat != GL_R8_EXT && if (colorbufferFormat != GL_R8_EXT && colorbufferFormat != GL_RG8_EXT &&
colorbufferFormat != GL_RG8_EXT && colorbufferFormat != GL_RGB565 && colorbufferFormat != GL_RGB8_OES &&
colorbufferFormat != GL_RGB565 && colorbufferFormat != GL_RGBA4 && colorbufferFormat != GL_RGB5_A1 &&
colorbufferFormat != GL_RGB8_OES && colorbufferFormat != GL_BGRA8_EXT && colorbufferFormat != GL_RGBA8_OES &&
colorbufferFormat != GL_RGBA4 &&
colorbufferFormat != GL_RGB5_A1 &&
colorbufferFormat != GL_BGRA8_EXT &&
colorbufferFormat != GL_RGBA8_OES &&
colorbufferFormat != GL_BGR5_A1_ANGLEX) colorbufferFormat != GL_BGR5_A1_ANGLEX)
{ {
context->handleError(Error(GL_INVALID_OPERATION)); context->handleError(Error(GL_INVALID_OPERATION));
...@@ -889,14 +865,10 @@ bool ValidateES2CopyTexImageParameters(ValidationContext *context, ...@@ -889,14 +865,10 @@ bool ValidateES2CopyTexImageParameters(ValidationContext *context,
} }
break; break;
case GL_RED_EXT: case GL_RED_EXT:
if (colorbufferFormat != GL_R8_EXT && if (colorbufferFormat != GL_R8_EXT && colorbufferFormat != GL_RG8_EXT &&
colorbufferFormat != GL_RG8_EXT && colorbufferFormat != GL_RGB565 && colorbufferFormat != GL_RGB8_OES &&
colorbufferFormat != GL_RGB565 && colorbufferFormat != GL_RGBA4 && colorbufferFormat != GL_RGB5_A1 &&
colorbufferFormat != GL_RGB8_OES && colorbufferFormat != GL_BGRA8_EXT && colorbufferFormat != GL_RGBA8_OES &&
colorbufferFormat != GL_RGBA4 &&
colorbufferFormat != GL_RGB5_A1 &&
colorbufferFormat != GL_BGRA8_EXT &&
colorbufferFormat != GL_RGBA8_OES &&
colorbufferFormat != GL_BGR5_A1_ANGLEX) colorbufferFormat != GL_BGR5_A1_ANGLEX)
{ {
context->handleError(Error(GL_INVALID_OPERATION)); context->handleError(Error(GL_INVALID_OPERATION));
...@@ -904,26 +876,19 @@ bool ValidateES2CopyTexImageParameters(ValidationContext *context, ...@@ -904,26 +876,19 @@ bool ValidateES2CopyTexImageParameters(ValidationContext *context,
} }
break; break;
case GL_RG_EXT: case GL_RG_EXT:
if (colorbufferFormat != GL_RG8_EXT && if (colorbufferFormat != GL_RG8_EXT && colorbufferFormat != GL_RGB565 &&
colorbufferFormat != GL_RGB565 && colorbufferFormat != GL_RGB8_OES && colorbufferFormat != GL_RGBA4 &&
colorbufferFormat != GL_RGB8_OES && colorbufferFormat != GL_RGB5_A1 && colorbufferFormat != GL_BGRA8_EXT &&
colorbufferFormat != GL_RGBA4 && colorbufferFormat != GL_RGBA8_OES && colorbufferFormat != GL_BGR5_A1_ANGLEX)
colorbufferFormat != GL_RGB5_A1 &&
colorbufferFormat != GL_BGRA8_EXT &&
colorbufferFormat != GL_RGBA8_OES &&
colorbufferFormat != GL_BGR5_A1_ANGLEX)
{ {
context->handleError(Error(GL_INVALID_OPERATION)); context->handleError(Error(GL_INVALID_OPERATION));
return false; return false;
} }
break; break;
case GL_RGB: case GL_RGB:
if (colorbufferFormat != GL_RGB565 && if (colorbufferFormat != GL_RGB565 && colorbufferFormat != GL_RGB8_OES &&
colorbufferFormat != GL_RGB8_OES && colorbufferFormat != GL_RGBA4 && colorbufferFormat != GL_RGB5_A1 &&
colorbufferFormat != GL_RGBA4 && colorbufferFormat != GL_BGRA8_EXT && colorbufferFormat != GL_RGBA8_OES &&
colorbufferFormat != GL_RGB5_A1 &&
colorbufferFormat != GL_BGRA8_EXT &&
colorbufferFormat != GL_RGBA8_OES &&
colorbufferFormat != GL_BGR5_A1_ANGLEX) colorbufferFormat != GL_BGR5_A1_ANGLEX)
{ {
context->handleError(Error(GL_INVALID_OPERATION)); context->handleError(Error(GL_INVALID_OPERATION));
...@@ -932,10 +897,8 @@ bool ValidateES2CopyTexImageParameters(ValidationContext *context, ...@@ -932,10 +897,8 @@ bool ValidateES2CopyTexImageParameters(ValidationContext *context,
break; break;
case GL_LUMINANCE_ALPHA: case GL_LUMINANCE_ALPHA:
case GL_RGBA: case GL_RGBA:
if (colorbufferFormat != GL_RGBA4 && if (colorbufferFormat != GL_RGBA4 && colorbufferFormat != GL_RGB5_A1 &&
colorbufferFormat != GL_RGB5_A1 && colorbufferFormat != GL_BGRA8_EXT && colorbufferFormat != GL_RGBA8_OES &&
colorbufferFormat != GL_BGRA8_EXT &&
colorbufferFormat != GL_RGBA8_OES &&
colorbufferFormat != GL_BGR5_A1_ANGLEX) colorbufferFormat != GL_BGR5_A1_ANGLEX)
{ {
context->handleError(Error(GL_INVALID_OPERATION)); context->handleError(Error(GL_INVALID_OPERATION));
...@@ -1000,8 +963,8 @@ bool ValidateES2CopyTexImageParameters(ValidationContext *context, ...@@ -1000,8 +963,8 @@ bool ValidateES2CopyTexImageParameters(ValidationContext *context,
} }
else else
{ {
context->handleError( context->handleError(Error(
Error(GL_INVALID_ENUM, "ANGLE_lossy_etc_decode extension is not supported.")); GL_INVALID_ENUM, "ANGLE_lossy_etc_decode extension is not supported."));
return false; return false;
} }
break; break;
...@@ -1030,8 +993,12 @@ bool ValidateES2CopyTexImageParameters(ValidationContext *context, ...@@ -1030,8 +993,12 @@ bool ValidateES2CopyTexImageParameters(ValidationContext *context,
return (width > 0 && height > 0); return (width > 0 && height > 0);
} }
bool ValidateES2TexStorageParameters(Context *context, GLenum target, GLsizei levels, GLenum internalformat, bool ValidateES2TexStorageParameters(Context *context,
GLsizei width, GLsizei height) GLenum target,
GLsizei levels,
GLenum internalformat,
GLsizei width,
GLsizei height)
{ {
if (target != GL_TEXTURE_2D && target != GL_TEXTURE_CUBE_MAP) if (target != GL_TEXTURE_2D && target != GL_TEXTURE_CUBE_MAP)
{ {
...@@ -1211,7 +1178,9 @@ bool ValidateES2TexStorageParameters(Context *context, GLenum target, GLsizei le ...@@ -1211,7 +1178,9 @@ bool ValidateES2TexStorageParameters(Context *context, GLenum target, GLsizei le
return true; return true;
} }
bool ValidateDiscardFramebufferEXT(Context *context, GLenum target, GLsizei numAttachments, bool ValidateDiscardFramebufferEXT(Context *context,
GLenum target,
GLsizei numAttachments,
const GLenum *attachments) const GLenum *attachments)
{ {
if (!context->getExtensions().discardFramebuffer) if (!context->getExtensions().discardFramebuffer)
...@@ -1233,7 +1202,8 @@ bool ValidateDiscardFramebufferEXT(Context *context, GLenum target, GLsizei numA ...@@ -1233,7 +1202,8 @@ bool ValidateDiscardFramebufferEXT(Context *context, GLenum target, GLsizei numA
return false; return false;
} }
return ValidateDiscardFramebufferBase(context, target, numAttachments, attachments, defaultFramebuffer); return ValidateDiscardFramebufferBase(context, target, numAttachments, attachments,
defaultFramebuffer);
} }
bool ValidateBindVertexArrayOES(Context *context, GLuint array) bool ValidateBindVertexArrayOES(Context *context, GLuint array)
...@@ -1923,8 +1893,7 @@ bool ValidateBlitFramebufferANGLE(Context *context, ...@@ -1923,8 +1893,7 @@ bool ValidateBlitFramebufferANGLE(Context *context,
dstX0, dstY0, dstX1, dstY1)) dstX0, dstY0, dstX1, dstY1))
{ {
// only whole-buffer copies are permitted // only whole-buffer copies are permitted
ERR( ERR("Only whole-buffer depth and stencil blits are supported by this "
"Only whole-buffer depth and stencil blits are supported by this "
"implementation."); "implementation.");
context->handleError(Error(GL_INVALID_OPERATION)); context->handleError(Error(GL_INVALID_OPERATION));
return false; return false;
...@@ -3149,7 +3118,8 @@ bool ValidateProgramPathFragmentInputGen(Context *context, ...@@ -3149,7 +3118,8 @@ bool ValidateProgramPathFragmentInputGen(Context *context,
expectedComponents = 4; expectedComponents = 4;
break; break;
default: default:
context->handleError(Error(GL_INVALID_OPERATION, context->handleError(
Error(GL_INVALID_OPERATION,
"Fragment input type is not a floating point scalar or vector.")); "Fragment input type is not a floating point scalar or vector."));
return false; return false;
} }
......
...@@ -24,7 +24,10 @@ using namespace angle; ...@@ -24,7 +24,10 @@ using namespace angle;
namespace gl namespace gl
{ {
static bool ValidateTexImageFormatCombination(gl::Context *context, GLenum internalFormat, GLenum format, GLenum type) static bool ValidateTexImageFormatCombination(gl::Context *context,
GLenum internalFormat,
GLenum format,
GLenum type)
{ {
// For historical reasons, glTexImage2D and glTexImage3D pass in their internal format as a // For historical reasons, glTexImage2D and glTexImage3D pass in their internal format as a
// GLint instead of a GLenum. Therefor an invalid internal format gives a GL_INVALID_VALUE // GLint instead of a GLenum. Therefor an invalid internal format gives a GL_INVALID_VALUE
...@@ -152,7 +155,8 @@ bool ValidateES3TexImageParametersBase(Context *context, ...@@ -152,7 +155,8 @@ bool ValidateES3TexImageParametersBase(Context *context,
return false; return false;
} }
gl::Texture *texture = context->getTargetTexture(IsCubeMapTextureTarget(target) ? GL_TEXTURE_CUBE_MAP : target); gl::Texture *texture =
context->getTargetTexture(IsCubeMapTextureTarget(target) ? GL_TEXTURE_CUBE_MAP : target);
if (!texture) if (!texture)
{ {
context->handleError(Error(GL_INVALID_OPERATION)); context->handleError(Error(GL_INVALID_OPERATION));
...@@ -263,7 +267,8 @@ bool ValidateES3TexImageParametersBase(Context *context, ...@@ -263,7 +267,8 @@ bool ValidateES3TexImageParametersBase(Context *context,
gl::Buffer *pixelUnpackBuffer = context->getGLState().getTargetBuffer(GL_PIXEL_UNPACK_BUFFER); gl::Buffer *pixelUnpackBuffer = context->getGLState().getTargetBuffer(GL_PIXEL_UNPACK_BUFFER);
if (pixelUnpackBuffer != nullptr) if (pixelUnpackBuffer != nullptr)
{ {
// ...data is not evenly divisible into the number of bytes needed to store in memory a datum // ...data is not evenly divisible into the number of bytes needed to store in memory a
// datum
// indicated by type. // indicated by type.
if (!isCompressed) if (!isCompressed)
{ {
...@@ -442,7 +447,8 @@ bool GetUnsizedEffectiveInternalFormatInfo(const InternalFormat &srcFormat, ...@@ -442,7 +447,8 @@ bool GetUnsizedEffectiveInternalFormatInfo(const InternalFormat &srcFormat,
outEffectiveFormat); outEffectiveFormat);
} }
static bool GetEffectiveInternalFormat(const InternalFormat &srcFormat, const InternalFormat &destFormat, static bool GetEffectiveInternalFormat(const InternalFormat &srcFormat,
const InternalFormat &destFormat,
GLenum *outEffectiveFormat) GLenum *outEffectiveFormat)
{ {
if (destFormat.pixelBytes > 0) if (destFormat.pixelBytes > 0)
...@@ -903,8 +909,12 @@ bool ValidateGetQueryObjectuiv(Context *context, GLuint id, GLenum pname, GLuint ...@@ -903,8 +909,12 @@ bool ValidateGetQueryObjectuiv(Context *context, GLuint id, GLenum pname, GLuint
return ValidateGetQueryObjectValueBase(context, id, pname, nullptr); return ValidateGetQueryObjectValueBase(context, id, pname, nullptr);
} }
bool ValidateFramebufferTextureLayer(Context *context, GLenum target, GLenum attachment, bool ValidateFramebufferTextureLayer(Context *context,
GLuint texture, GLint level, GLint layer) GLenum target,
GLenum attachment,
GLuint texture,
GLint level,
GLint layer)
{ {
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
...@@ -979,17 +989,24 @@ bool ValidateFramebufferTextureLayer(Context *context, GLenum target, GLenum att ...@@ -979,17 +989,24 @@ bool ValidateFramebufferTextureLayer(Context *context, GLenum target, GLenum att
return true; return true;
} }
bool ValidateES3RenderbufferStorageParameters(gl::Context *context, GLenum target, GLsizei samples, bool ValidateES3RenderbufferStorageParameters(gl::Context *context,
GLenum internalformat, GLsizei width, GLsizei height) GLenum target,
GLsizei samples,
GLenum internalformat,
GLsizei width,
GLsizei height)
{ {
if (!ValidateRenderbufferStorageParametersBase(context, target, samples, internalformat, width, height)) if (!ValidateRenderbufferStorageParametersBase(context, target, samples, internalformat, width,
height))
{ {
return false; return false;
} }
//The ES3 spec(section 4.4.2) states that the internal format must be sized and not an integer format if samples is greater than zero. // The ES3 spec(section 4.4.2) states that the internal format must be sized and not an integer
// format if samples is greater than zero.
const gl::InternalFormat &formatInfo = gl::GetInternalFormatInfo(internalformat); const gl::InternalFormat &formatInfo = gl::GetInternalFormatInfo(internalformat);
if ((formatInfo.componentType == GL_UNSIGNED_INT || formatInfo.componentType == GL_INT) && samples > 0) if ((formatInfo.componentType == GL_UNSIGNED_INT || formatInfo.componentType == GL_INT) &&
samples > 0)
{ {
context->handleError(Error(GL_INVALID_OPERATION)); context->handleError(Error(GL_INVALID_OPERATION));
return false; return false;
...@@ -1008,7 +1025,9 @@ bool ValidateES3RenderbufferStorageParameters(gl::Context *context, GLenum targe ...@@ -1008,7 +1025,9 @@ bool ValidateES3RenderbufferStorageParameters(gl::Context *context, GLenum targe
return true; return true;
} }
bool ValidateInvalidateFramebuffer(Context *context, GLenum target, GLsizei numAttachments, bool ValidateInvalidateFramebuffer(Context *context,
GLenum target,
GLsizei numAttachments,
const GLenum *attachments) const GLenum *attachments)
{ {
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
...@@ -1034,7 +1053,8 @@ bool ValidateInvalidateFramebuffer(Context *context, GLenum target, GLsizei numA ...@@ -1034,7 +1053,8 @@ bool ValidateInvalidateFramebuffer(Context *context, GLenum target, GLsizei numA
return false; return false;
} }
return ValidateDiscardFramebufferBase(context, target, numAttachments, attachments, defaultFramebuffer); return ValidateDiscardFramebufferBase(context, target, numAttachments, attachments,
defaultFramebuffer);
} }
bool ValidateClearBuffer(ValidationContext *context) bool ValidateClearBuffer(ValidationContext *context)
...@@ -1091,7 +1111,7 @@ bool ValidateDrawRangeElements(Context *context, ...@@ -1091,7 +1111,7 @@ bool ValidateDrawRangeElements(Context *context,
return true; return true;
} }
bool ValidateGetUniformuiv(Context *context, GLuint program, GLint location, GLuint* params) bool ValidateGetUniformuiv(Context *context, GLuint program, GLint location, GLuint *params)
{ {
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
...@@ -1133,7 +1153,8 @@ bool ValidateReadBuffer(Context *context, GLenum src) ...@@ -1133,7 +1153,8 @@ bool ValidateReadBuffer(Context *context, GLenum src)
{ {
if (src != GL_BACK) if (src != GL_BACK)
{ {
const char *errorMsg = "'src' must be GL_NONE or GL_BACK when reading from the default framebuffer."; const char *errorMsg =
"'src' must be GL_NONE or GL_BACK when reading from the default framebuffer.";
context->handleError(gl::Error(GL_INVALID_OPERATION, errorMsg)); context->handleError(gl::Error(GL_INVALID_OPERATION, errorMsg));
return false; return false;
} }
......
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