Commit afa75152 by Brandon Jones Committed by Commit Bot

Refactor More Validation Error Messages

Replace many error string literals with variables existing in ErrorStrings.h BUG=:angleproject:1644 Change-Id: If5665a6787a1fa8d789811d774711c3705dfb0ab Reviewed-on: https://chromium-review.googlesource.com/598588 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: 's avatarCorentin Wallez <cwallez@chromium.org>
parent aadc8f37
...@@ -16,27 +16,35 @@ ...@@ -16,27 +16,35 @@
namespace gl namespace gl
{ {
ERRMSG(ActiveTextureRange, "Cannot be less than 0 or greater than maximum number of textures.");
ERRMSG(BufferNotBound, "A buffer must be bound."); ERRMSG(BufferNotBound, "A buffer must be bound.");
ERRMSG(ClearInvalidMask, "Invalid mask bits."); ERRMSG(CompressedTextureDimensionsMustMatchData,
"Compressed texture dimensions must exactly match the dimensions of the data passed in.");
ERRMSG(CompressedTexturesNotAttachable, "Compressed textures cannot be attached to a framebuffer."); ERRMSG(CompressedTexturesNotAttachable, "Compressed textures cannot be attached to a framebuffer.");
ERRMSG(CubemapFacesEqualDimensions, "Each cubemap face must have equal width and height."); ERRMSG(CubemapFacesEqualDimensions, "Each cubemap face must have equal width and height.");
ERRMSG(CubemapIncomplete, ERRMSG(CubemapIncomplete,
"Texture is not cubemap complete. All cubemaps faces must be defined and be the same size."); "Texture is not cubemap complete. All cubemaps faces must be defined and be the same size.");
ERRMSG(DefaultFramebufferInvalidAttachment,
"Invalid attachment when the default framebuffer is bound.");
ERRMSG(DefaultFramebufferTarget, "It is invalid to change default FBO's attachments"); ERRMSG(DefaultFramebufferTarget, "It is invalid to change default FBO's attachments");
ERRMSG(EnumNotSupported, "Enum is not currently supported."); ERRMSG(EnumNotSupported, "Enum is not currently supported.");
ERRMSG(EnumRequiresGLES31, "Enum requires GLES 3.1"); ERRMSG(EnumRequiresGLES31, "Enum requires GLES 3.1");
ERRMSG(ES31Required, "OpenGL ES 3.1 Required");
ERRMSG(ES3Required, "OpenGL ES 3.0 Required.");
ERRMSG(ExceedsMaxElement, "Element value exceeds maximum element index."); ERRMSG(ExceedsMaxElement, "Element value exceeds maximum element index.");
ERRMSG(ExpectedProgramName, "Expected a program name, but found a shader name."); ERRMSG(ExpectedProgramName, "Expected a program name, but found a shader name.");
ERRMSG(ExpectedShaderName, "Expected a shader name, but found a program name."); ERRMSG(ExpectedShaderName, "Expected a shader name, but found a program name.");
ERRMSG(ExtensionNotEnabled, "Extension is not enabled."); ERRMSG(ExtensionNotEnabled, "Extension is not enabled.");
ERRMSG(FeedbackLoop, "Feedback loop formed between Framebuffer and active Texture.");
ERRMSG(FramebufferIncompleteAttachment, ERRMSG(FramebufferIncompleteAttachment,
"Attachment type must be compatible with attachment object."); "Attachment type must be compatible with attachment object.");
ERRMSG(FramebufferInvalidAttachment, "Invalid Attachment Type");
ERRMSG(GenerateMipmapNotAllowed, "Compressed textures do not support mipmap generation."); ERRMSG(GenerateMipmapNotAllowed, "Compressed textures do not support mipmap generation.");
ERRMSG(IndexExceedsMax, "Index exceeds MAX_VERTEX_ATTRIBS"); ERRMSG(IndexExceedsMaxActiveUniform, "Index exceeds program active uniform count.");
ERRMSG(IndexExceedsMaxDrawBuffer, "Index exceeds MAX_DRAW_BUFFERS.");
ERRMSG(IndexExceedsMaxVertexAttribute, "Index exceeds MAX_VERTEX_ATTRIBS.");
ERRMSG(InsufficientBufferSize, "Insufficient buffer size."); ERRMSG(InsufficientBufferSize, "Insufficient buffer size.");
ERRMSG(InsufficientVertexBufferSize, "Vertex buffer is not big enough for the draw call");
ERRMSG(IntegerOverflow, "Integer overflow."); ERRMSG(IntegerOverflow, "Integer overflow.");
ERRMSG(InvalidAttachment, "Invalid Attachment Type.");
ERRMSG(InvalidBlendEquation, "Invalid blend equation."); ERRMSG(InvalidBlendEquation, "Invalid blend equation.");
ERRMSG(InvalidBlendFunction, "Invalid blend function."); ERRMSG(InvalidBlendFunction, "Invalid blend function.");
ERRMSG(InvalidBorder, "Border must be 0."); ERRMSG(InvalidBorder, "Border must be 0.");
...@@ -47,53 +55,85 @@ ERRMSG(InvalidConstantColor, ...@@ -47,53 +55,85 @@ ERRMSG(InvalidConstantColor,
"CONSTANT_COLOR (or ONE_MINUS_CONSTANT_COLOR) and CONSTANT_ALPHA (or " "CONSTANT_COLOR (or ONE_MINUS_CONSTANT_COLOR) and CONSTANT_ALPHA (or "
"ONE_MINUS_CONSTANT_ALPHA) cannot be used together as source and destination factors in the " "ONE_MINUS_CONSTANT_ALPHA) cannot be used together as source and destination factors in the "
"blend function."); "blend function.");
ERRMSG(InvalidCoverMode, "Invalid cover mode.");
ERRMSG(InvalidCullMode, "Cull mode not recognized."); ERRMSG(InvalidCullMode, "Cull mode not recognized.");
ERRMSG(InvalidDebugSeverity, "Invalid debug severity.");
ERRMSG(InvalidDebugSource, "Invalid debug source.");
ERRMSG(InvalidDebugType, "Invalid debug type.");
ERRMSG(InvalidDepthRange, "Near value cannot be greater than far."); ERRMSG(InvalidDepthRange, "Near value cannot be greater than far.");
ERRMSG(InvalidDrawMode, "Invalid draw mode."); ERRMSG(InvalidDrawMode, "Invalid draw mode.");
ERRMSG(InvalidDrawModeTransformFeedback, ERRMSG(InvalidDrawModeTransformFeedback,
"Draw mode must match current transform feedback object's draw mode."); "Draw mode must match current transform feedback object's draw mode.");
ERRMSG(InvalidFillMode, "Invalid fill mode.");
ERRMSG(InvalidFilterTexture, "Texture only supports NEAREST and LINEAR filtering.");
ERRMSG(InvalidFormat, "Invalid format."); ERRMSG(InvalidFormat, "Invalid format.");
ERRMSG(InvalidFramebufferTarget, "Invalid framebuffer target."); ERRMSG(InvalidFramebufferTarget, "Invalid framebuffer target.");
ERRMSG(InvalidFramebufferTextureLevel, "Mipmap level must be 0 when attaching a texture."); ERRMSG(InvalidFramebufferTextureLevel, "Mipmap level must be 0 when attaching a texture.");
ERRMSG(InvalidFramebufferTextureParameter, "Invalid parameter name for framebuffer attachment.");
ERRMSG(InvalidInternalFormat, "Invalid internal format."); ERRMSG(InvalidInternalFormat, "Invalid internal format.");
ERRMSG(InvalidMatrixMode, "Invalid matrix mode.");
ERRMSG(InvalidMipLevel, "Level of detail outside of range."); ERRMSG(InvalidMipLevel, "Level of detail outside of range.");
ERRMSG(InvalidName, "Invalid name.");
ERRMSG(InvalidNameCharacters, "Name contains invalid characters."); ERRMSG(InvalidNameCharacters, "Name contains invalid characters.");
ERRMSG(InvalidPname, "Invalid pname.");
ERRMSG(InvalidPrecision, "Invalid or unsupported precision type."); ERRMSG(InvalidPrecision, "Invalid or unsupported precision type.");
ERRMSG(InvalidProgramName, "Program object expected."); ERRMSG(InvalidProgramName, "Program object expected.");
ERRMSG(InvalidQueryId, "Invalid query Id.");
ERRMSG(InvalidQueryTarget, "Invalid query target.");
ERRMSG(InvalidQueryType, "Invalid query type.");
ERRMSG(InvalidRange, "Invalid range.");
ERRMSG(InvalidRenderbufferInternalFormat, "Invalid renderbuffer internalformat."); ERRMSG(InvalidRenderbufferInternalFormat, "Invalid renderbuffer internalformat.");
ERRMSG(InvalidRenderbufferTarget, "Invalid renderbuffer target."); ERRMSG(InvalidRenderbufferTarget, "Invalid renderbuffer target.");
ERRMSG(InvalidRenderbufferTextureParameter, "Invalid parameter name for renderbuffer attachment."); ERRMSG(InvalidRenderbufferTextureParameter, "Invalid parameter name for renderbuffer attachment.");
ERRMSG(InvalidRenderbufferWidthHeight, ERRMSG(InvalidRenderbufferWidthHeight,
"Renderbuffer width and height cannot be negative and cannot exceed maximum texture size."); "Renderbuffer width and height cannot be negative and cannot exceed maximum texture size.");
ERRMSG(InvalidSampler, "Sampler is not valid");
ERRMSG(InvalidShaderName, "Shader object expected."); ERRMSG(InvalidShaderName, "Shader object expected.");
ERRMSG(InvalidShaderType, "Invalid shader type."); ERRMSG(InvalidShaderType, "Invalid shader type.");
ERRMSG(InvalidStencil, "Invalid stencil."); ERRMSG(InvalidStencil, "Invalid stencil.");
ERRMSG(InvalidStencilBitMask, "Invalid stencil bit mask.");
ERRMSG(InvalidTarget, "Invalid target.");
ERRMSG(InvalidTextureFilterParam, "Texture filter not recognized."); ERRMSG(InvalidTextureFilterParam, "Texture filter not recognized.");
ERRMSG(InvalidTextureRange, "Cannot be less than 0 or greater than maximum number of textures.");
ERRMSG(InvalidTextureTarget, "Invalid or unsupported texture target."); ERRMSG(InvalidTextureTarget, "Invalid or unsupported texture target.");
ERRMSG(InvalidTextureWrap, "Texture wrap mode not recognized.");
ERRMSG(InvalidType, "Invalid type."); ERRMSG(InvalidType, "Invalid type.");
ERRMSG(InvalidTypePureInt, "Invalid type, should be integer"); ERRMSG(InvalidTypePureInt, "Invalid type, should be integer");
ERRMSG(InvalidUnpackAlignment, "Unpack alignment must be 1, 2, 4, or 8."); ERRMSG(InvalidUnpackAlignment, "Unpack alignment must be 1, 2, 4, or 8.");
ERRMSG(InvalidVertexAttrSize, "Vertex attribute size must be 1, 2, 3, or 4."); ERRMSG(InvalidVertexAttrSize, "Vertex attribute size must be 1, 2, 3, or 4.");
ERRMSG(InvalidWidth, "Invalid width.");
ERRMSG(InvalidWrapModeTexture, "Invalid wrap mode for texture type.");
ERRMSG(LevelNotZero, "Texture level must be zero.");
ERRMSG(MismatchedFormat, "Format must match internal format."); ERRMSG(MismatchedFormat, "Format must match internal format.");
ERRMSG(MismatchedTargetAndFormat, "Invalid texture target and format combination.");
ERRMSG(MismatchedTypeAndFormat, "Invalid format and type combination."); ERRMSG(MismatchedTypeAndFormat, "Invalid format and type combination.");
ERRMSG(MismatchedVariableProgram, "Variable is not part of the current program."); ERRMSG(MismatchedVariableProgram, "Variable is not part of the current program.");
ERRMSG(MissingReadAttachment, "Missing read attachment."); ERRMSG(MissingReadAttachment, "Missing read attachment.");
ERRMSG(MustHaveElementArrayBinding, "Must have element array buffer binding."); ERRMSG(MustHaveElementArrayBinding, "Must have element array buffer binding.");
ERRMSG(NameBeginsWithGL, "Attributes that begin with 'gl_' are not allowed."); ERRMSG(NameBeginsWithGL, "Attributes that begin with 'gl_' are not allowed.");
ERRMSG(NegativeAttachments, "Negative number of attachments.");
ERRMSG(NegativeBufferSize, "Negative buffer size."); ERRMSG(NegativeBufferSize, "Negative buffer size.");
ERRMSG(NegativeCount, "Negative count."); ERRMSG(NegativeCount, "Negative count.");
ERRMSG(NegativeLength, "Negative length."); ERRMSG(NegativeLength, "Negative length.");
ERRMSG(NegativeMaxCount, "Negative maxcount.");
ERRMSG(NegativeOffset, "Negative offset."); ERRMSG(NegativeOffset, "Negative offset.");
ERRMSG(NegativePrimcount, "Primcount must be greater than or equal to zero.");
ERRMSG(NegativeSize, "Cannot have negative height or width."); ERRMSG(NegativeSize, "Cannot have negative height or width.");
ERRMSG(NegativeStart, "Cannot have negative start."); ERRMSG(NegativeStart, "Cannot have negative start.");
ERRMSG(NegativeStride, "Cannot have negative stride."); ERRMSG(NegativeStride, "Cannot have negative stride.");
ERRMSG(NoSuchPath, "No such path object.");
ERRMSG(NoZeroDivisor, "At least one enabled attribute must have a divisor of zero.");
ERRMSG(ObjectNotGenerated, "Object cannot be used because it has not been generated."); ERRMSG(ObjectNotGenerated, "Object cannot be used because it has not been generated.");
ERRMSG(OffsetMustBeMultipleOfType, "Offset must be a multiple of the passed in datatype."); ERRMSG(OffsetMustBeMultipleOfType, "Offset must be a multiple of the passed in datatype.");
ERRMSG(OutsideOfBounds, "Parameter outside of bounds."); ERRMSG(OutsideOfBounds, "Parameter outside of bounds.");
ERRMSG(ParamOverflow, "The provided parameters overflow with the provided buffer."); ERRMSG(ParamOverflow, "The provided parameters overflow with the provided buffer.");
ERRMSG(PixelDataNotNull, "Pixel data must be null.");
ERRMSG(ProgramDoesNotExist, "Program doesn't exist."); ERRMSG(ProgramDoesNotExist, "Program doesn't exist.");
ERRMSG(ProgramNotBound, "A program must be bound."); ERRMSG(ProgramNotBound, "A program must be bound.");
ERRMSG(ProgramNotLinked, "Program not linked."); ERRMSG(ProgramNotLinked, "Program not linked.");
ERRMSG(QueryActive, "Query is active.");
ERRMSG(QueryExtensionNotEnabled, "Query extension not enabled.");
ERRMSG(ReadBufferNone, "Read buffer is GL_NONE.");
ERRMSG(RenderbufferNotBound, "A renderbuffer must be bound."); ERRMSG(RenderbufferNotBound, "A renderbuffer must be bound.");
ERRMSG(ResourceMaxTextureSize, "Desired resource size is greater than max texture size."); ERRMSG(ResourceMaxTextureSize, "Desired resource size is greater than max texture size.");
ERRMSG(ShaderAttachmentHasShader, "Shader attachment already has a shader."); ERRMSG(ShaderAttachmentHasShader, "Shader attachment already has a shader.");
...@@ -107,11 +147,14 @@ ERRMSG(StencilReferenceMaskOrMismatch, ...@@ -107,11 +147,14 @@ ERRMSG(StencilReferenceMaskOrMismatch,
ERRMSG(StrideMustBeMultipleOfType, "Stride must be a multiple of the passed in datatype."); ERRMSG(StrideMustBeMultipleOfType, "Stride must be a multiple of the passed in datatype.");
ERRMSG(TextureNotBound, "A texture must be bound."); ERRMSG(TextureNotBound, "A texture must be bound.");
ERRMSG(TextureNotPow2, "The texture is a non-power-of-two texture."); ERRMSG(TextureNotPow2, "The texture is a non-power-of-two texture.");
ERRMSG(TypeMustMatchOriginalType, ERRMSG(TypeMismatch,
"Passed in texture target and format must match the one originally used to define the " "Passed in texture target and format must match the one originally used to define the "
"texture."); "texture.");
ERRMSG(TypeNotUnsignedShortByte, "Only UNSIGNED_SHORT and UNSIGNED_BYTE types are supported."); ERRMSG(TypeNotUnsignedShortByte, "Only UNSIGNED_SHORT and UNSIGNED_BYTE types are supported.");
ERRMSG(UniformSizeDoesNotMatchMethod, "Uniform size does not match uniform method."); ERRMSG(UniformSizeMismatch, "Uniform size does not match uniform method.");
ERRMSG(UnknownParameter, "Unknown parameter value.");
ERRMSG(VertexArrayNoBuffer, "An enabled vertex array has no buffer.");
ERRMSG(VertexArrayNoBufferPointer, "An enabled vertex array has no buffer and no pointer.");
ERRMSG(ViewportNegativeSize, "Viewport size cannot be negative."); ERRMSG(ViewportNegativeSize, "Viewport size cannot be negative.");
ERRMSG(WebglBindAttribLocationReservedPrefix, ERRMSG(WebglBindAttribLocationReservedPrefix,
"Attributes that begin with 'webgl_', or '_webgl_' are not allowed."); "Attributes that begin with 'webgl_', or '_webgl_' are not allowed.");
......
...@@ -70,16 +70,14 @@ bool ValidateDrawAttribs(ValidationContext *context, ...@@ -70,16 +70,14 @@ bool ValidateDrawAttribs(ValidationContext *context,
// no buffer is bound to that attribute via bindBuffer and vertexAttribPointer, // no buffer is bound to that attribute via bindBuffer and vertexAttribPointer,
// then calls to drawArrays or drawElements will generate an INVALID_OPERATION // then calls to drawArrays or drawElements will generate an INVALID_OPERATION
// error. // error.
context->handleError(InvalidOperation() ANGLE_VALIDATION_ERR(context, InvalidOperation(), VertexArrayNoBuffer);
<< "An enabled vertex array has no buffer.");
return false; return false;
} }
else if (attrib.pointer == nullptr) else if (attrib.pointer == nullptr)
{ {
// This is an application error that would normally result in a crash, // This is an application error that would normally result in a crash,
// but we catch it and return an error // but we catch it and return an error
context->handleError(InvalidOperation() ANGLE_VALIDATION_ERR(context, InvalidOperation(), VertexArrayNoBufferPointer);
<< "An enabled vertex array has no buffer and no pointer.");
return false; return false;
} }
continue; continue;
...@@ -134,7 +132,7 @@ bool ValidateDrawAttribs(ValidationContext *context, ...@@ -134,7 +132,7 @@ bool ValidateDrawAttribs(ValidationContext *context,
uint64_t attribOffset = ComputeVertexAttributeOffset(attrib, binding); uint64_t attribOffset = ComputeVertexAttributeOffset(attrib, binding);
if (attribDataSizeNoOffset > kUint64Max - attribOffset) if (attribDataSizeNoOffset > kUint64Max - attribOffset)
{ {
context->handleError(InvalidOperation() << "Integer overflow."); ANGLE_VALIDATION_ERR(context, InvalidOperation(), IntegerOverflow);
return false; return false;
} }
uint64_t attribDataSizeWithOffset = attribDataSizeNoOffset + attribOffset; uint64_t attribDataSizeWithOffset = attribDataSizeNoOffset + attribOffset;
...@@ -144,8 +142,7 @@ bool ValidateDrawAttribs(ValidationContext *context, ...@@ -144,8 +142,7 @@ bool ValidateDrawAttribs(ValidationContext *context,
// enough backing data. // enough backing data.
if (attribDataSizeWithOffset > static_cast<uint64_t>(buffer->getSize())) if (attribDataSizeWithOffset > static_cast<uint64_t>(buffer->getSize()))
{ {
context->handleError(InvalidOperation() ANGLE_VALIDATION_ERR(context, InvalidOperation(), InsufficientVertexBufferSize);
<< "Vertex buffer is not big enough for the draw call");
return false; return false;
} }
} }
...@@ -269,14 +266,13 @@ bool ValidateTextureWrapModeValue(Context *context, ParamType *params, bool rest ...@@ -269,14 +266,13 @@ bool ValidateTextureWrapModeValue(Context *context, ParamType *params, bool rest
if (restrictedWrapModes) if (restrictedWrapModes)
{ {
// OES_EGL_image_external and ANGLE_texture_rectangle specifies this error. // OES_EGL_image_external and ANGLE_texture_rectangle specifies this error.
context->handleError(InvalidEnum() ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidWrapModeTexture);
<< "texture only support CLAMP_TO_EDGE wrap mode");
return false; return false;
} }
break; break;
default: default:
context->handleError(InvalidEnum() << "Unknown param value."); ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidTextureWrap);
return false; return false;
} }
...@@ -299,8 +295,7 @@ bool ValidateTextureMinFilterValue(Context *context, ParamType *params, bool res ...@@ -299,8 +295,7 @@ bool ValidateTextureMinFilterValue(Context *context, ParamType *params, bool res
if (restrictedMinFilter) if (restrictedMinFilter)
{ {
// OES_EGL_image_external specifies this error. // OES_EGL_image_external specifies this error.
context->handleError(InvalidEnum() ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidFilterTexture);
<< "texture only support NEAREST and LINEAR filtering");
return false; return false;
} }
break; break;
...@@ -341,7 +336,7 @@ bool ValidateTextureCompareModeValue(Context *context, ParamType *params) ...@@ -341,7 +336,7 @@ bool ValidateTextureCompareModeValue(Context *context, ParamType *params)
break; break;
default: default:
context->handleError(InvalidEnum() << "Unknown param value."); ANGLE_VALIDATION_ERR(context, InvalidEnum(), UnknownParameter);
return false; return false;
} }
...@@ -365,7 +360,7 @@ bool ValidateTextureCompareFuncValue(Context *context, ParamType *params) ...@@ -365,7 +360,7 @@ bool ValidateTextureCompareFuncValue(Context *context, ParamType *params)
break; break;
default: default:
context->handleError(InvalidEnum() << "Unknown param value."); ANGLE_VALIDATION_ERR(context, InvalidEnum(), UnknownParameter);
return false; return false;
} }
...@@ -388,7 +383,7 @@ bool ValidateTextureSRGBDecodeValue(Context *context, ParamType *params) ...@@ -388,7 +383,7 @@ bool ValidateTextureSRGBDecodeValue(Context *context, ParamType *params)
break; break;
default: default:
context->handleError(InvalidEnum() << "Unknown param value."); ANGLE_VALIDATION_ERR(context, InvalidEnum(), UnknownParameter);
return false; return false;
} }
...@@ -404,20 +399,20 @@ bool ValidateSamplerParameterBase(Context *context, ...@@ -404,20 +399,20 @@ bool ValidateSamplerParameterBase(Context *context,
{ {
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->handleError(InvalidOperation() << "Context does not support OpenGL ES 3.0."); ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES3Required);
return false; return false;
} }
if (!context->isSampler(sampler)) if (!context->isSampler(sampler))
{ {
context->handleError(InvalidOperation() << "Sampler is not valid."); ANGLE_VALIDATION_ERR(context, InvalidOperation(), InvalidSampler);
return false; return false;
} }
const GLsizei minBufSize = 1; const GLsizei minBufSize = 1;
if (bufSize >= 0 && bufSize < minBufSize) if (bufSize >= 0 && bufSize < minBufSize)
{ {
context->handleError(InvalidOperation() << "bufSize must be at least " << minBufSize); ANGLE_VALIDATION_ERR(context, InvalidOperation(), InsufficientBufferSize);
return false; return false;
} }
...@@ -492,13 +487,13 @@ bool ValidateGetSamplerParameterBase(Context *context, ...@@ -492,13 +487,13 @@ bool ValidateGetSamplerParameterBase(Context *context,
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->handleError(InvalidOperation() << "Context does not support OpenGL ES 3.0."); ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES3Required);
return false; return false;
} }
if (!context->isSampler(sampler)) if (!context->isSampler(sampler))
{ {
context->handleError(InvalidOperation() << "Sampler is not valid."); ANGLE_VALIDATION_ERR(context, InvalidOperation(), InvalidSampler);
return false; return false;
} }
...@@ -638,7 +633,7 @@ bool ValidateGetInternalFormativBase(Context *context, ...@@ -638,7 +633,7 @@ bool ValidateGetInternalFormativBase(Context *context,
break; break;
default: default:
context->handleError(InvalidEnum() << "Invalid target."); ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidTarget);
return false; return false;
} }
...@@ -779,7 +774,7 @@ bool ValidateUniformValue(ValidationContext *context, GLenum valueType, GLenum u ...@@ -779,7 +774,7 @@ bool ValidateUniformValue(ValidationContext *context, GLenum valueType, GLenum u
return true; return true;
} }
ANGLE_VALIDATION_ERR(context, InvalidOperation(), UniformSizeDoesNotMatchMethod); ANGLE_VALIDATION_ERR(context, InvalidOperation(), UniformSizeMismatch);
return false; return false;
} }
...@@ -944,7 +939,7 @@ bool ValidateDrawElementsInstancedBase(ValidationContext *context, ...@@ -944,7 +939,7 @@ bool ValidateDrawElementsInstancedBase(ValidationContext *context,
{ {
if (primcount < 0) if (primcount < 0)
{ {
context->handleError(InvalidValue() << "primcount cannot be negative."); ANGLE_VALIDATION_ERR(context, InvalidValue(), NegativePrimcount);
return false; return false;
} }
...@@ -965,7 +960,7 @@ bool ValidateDrawArraysInstancedBase(Context *context, ...@@ -965,7 +960,7 @@ bool ValidateDrawArraysInstancedBase(Context *context,
{ {
if (primcount < 0) if (primcount < 0)
{ {
context->handleError(InvalidValue() << "primcount cannot be negative."); ANGLE_VALIDATION_ERR(context, InvalidValue(), NegativePrimcount);
return false; return false;
} }
...@@ -997,8 +992,7 @@ bool ValidateDrawInstancedANGLE(ValidationContext *context) ...@@ -997,8 +992,7 @@ bool ValidateDrawInstancedANGLE(ValidationContext *context)
} }
} }
context->handleError(InvalidOperation() ANGLE_VALIDATION_ERR(context, InvalidOperation(), NoZeroDivisor);
<< "At least one attribute must have a divisor of zero.");
return false; return false;
} }
...@@ -1927,7 +1921,7 @@ bool ValidateGenQueriesEXT(gl::Context *context, GLsizei n) ...@@ -1927,7 +1921,7 @@ bool ValidateGenQueriesEXT(gl::Context *context, GLsizei n)
if (!context->getExtensions().occlusionQueryBoolean && if (!context->getExtensions().occlusionQueryBoolean &&
!context->getExtensions().disjointTimerQuery) !context->getExtensions().disjointTimerQuery)
{ {
context->handleError(InvalidOperation() << "Query extension not enabled"); ANGLE_VALIDATION_ERR(context, InvalidOperation(), QueryExtensionNotEnabled);
return false; return false;
} }
...@@ -1939,7 +1933,7 @@ bool ValidateDeleteQueriesEXT(gl::Context *context, GLsizei n) ...@@ -1939,7 +1933,7 @@ bool ValidateDeleteQueriesEXT(gl::Context *context, GLsizei n)
if (!context->getExtensions().occlusionQueryBoolean && if (!context->getExtensions().occlusionQueryBoolean &&
!context->getExtensions().disjointTimerQuery) !context->getExtensions().disjointTimerQuery)
{ {
context->handleError(InvalidOperation() << "Query extension not enabled"); ANGLE_VALIDATION_ERR(context, InvalidOperation(), QueryExtensionNotEnabled);
return false; return false;
} }
...@@ -1950,7 +1944,7 @@ bool ValidateBeginQueryBase(gl::Context *context, GLenum target, GLuint id) ...@@ -1950,7 +1944,7 @@ bool ValidateBeginQueryBase(gl::Context *context, GLenum target, GLuint id)
{ {
if (!ValidQueryType(context, target)) if (!ValidQueryType(context, target))
{ {
context->handleError(InvalidEnum() << "Invalid query target"); ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidQueryType);
return false; return false;
} }
...@@ -1987,7 +1981,7 @@ bool ValidateBeginQueryBase(gl::Context *context, GLenum target, GLuint id) ...@@ -1987,7 +1981,7 @@ bool ValidateBeginQueryBase(gl::Context *context, GLenum target, GLuint id)
// check that name was obtained with glGenQueries // check that name was obtained with glGenQueries
if (!queryObject) if (!queryObject)
{ {
context->handleError(InvalidOperation() << "Invalid query id"); ANGLE_VALIDATION_ERR(context, InvalidOperation(), InvalidQueryId);
return false; return false;
} }
...@@ -2006,7 +2000,7 @@ bool ValidateBeginQueryEXT(gl::Context *context, GLenum target, GLuint id) ...@@ -2006,7 +2000,7 @@ bool ValidateBeginQueryEXT(gl::Context *context, GLenum target, GLuint id)
if (!context->getExtensions().occlusionQueryBoolean && if (!context->getExtensions().occlusionQueryBoolean &&
!context->getExtensions().disjointTimerQuery && !context->getExtensions().syncQuery) !context->getExtensions().disjointTimerQuery && !context->getExtensions().syncQuery)
{ {
context->handleError(InvalidOperation() << "Query extension not enabled"); ANGLE_VALIDATION_ERR(context, InvalidOperation(), QueryExtensionNotEnabled);
return false; return false;
} }
...@@ -2017,7 +2011,7 @@ bool ValidateEndQueryBase(gl::Context *context, GLenum target) ...@@ -2017,7 +2011,7 @@ bool ValidateEndQueryBase(gl::Context *context, GLenum target)
{ {
if (!ValidQueryType(context, target)) if (!ValidQueryType(context, target))
{ {
context->handleError(InvalidEnum() << "Invalid query target"); ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidQueryType);
return false; return false;
} }
...@@ -2037,7 +2031,7 @@ bool ValidateEndQueryEXT(gl::Context *context, GLenum target) ...@@ -2037,7 +2031,7 @@ bool ValidateEndQueryEXT(gl::Context *context, GLenum target)
if (!context->getExtensions().occlusionQueryBoolean && if (!context->getExtensions().occlusionQueryBoolean &&
!context->getExtensions().disjointTimerQuery && !context->getExtensions().syncQuery) !context->getExtensions().disjointTimerQuery && !context->getExtensions().syncQuery)
{ {
context->handleError(InvalidOperation() << "Query extension not enabled"); ANGLE_VALIDATION_ERR(context, InvalidOperation(), QueryExtensionNotEnabled);
return false; return false;
} }
...@@ -2054,20 +2048,20 @@ bool ValidateQueryCounterEXT(Context *context, GLuint id, GLenum target) ...@@ -2054,20 +2048,20 @@ bool ValidateQueryCounterEXT(Context *context, GLuint id, GLenum target)
if (target != GL_TIMESTAMP_EXT) if (target != GL_TIMESTAMP_EXT)
{ {
context->handleError(InvalidEnum() << "Invalid query target"); ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidQueryTarget);
return false; return false;
} }
Query *queryObject = context->getQuery(id, true, target); Query *queryObject = context->getQuery(id, true, target);
if (queryObject == nullptr) if (queryObject == nullptr)
{ {
context->handleError(InvalidOperation() << "Invalid query id"); ANGLE_VALIDATION_ERR(context, InvalidOperation(), InvalidQueryId);
return false; return false;
} }
if (context->getGLState().isQueryActive(queryObject)) if (context->getGLState().isQueryActive(queryObject))
{ {
context->handleError(InvalidOperation() << "Query is active"); ANGLE_VALIDATION_ERR(context, InvalidOperation(), QueryActive);
return false; return false;
} }
...@@ -2083,7 +2077,7 @@ bool ValidateGetQueryivBase(Context *context, GLenum target, GLenum pname, GLsiz ...@@ -2083,7 +2077,7 @@ bool ValidateGetQueryivBase(Context *context, GLenum target, GLenum pname, GLsiz
if (!ValidQueryType(context, target) && target != GL_TIMESTAMP_EXT) if (!ValidQueryType(context, target) && target != GL_TIMESTAMP_EXT)
{ {
context->handleError(InvalidEnum() << "Invalid query type"); ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidQueryType);
return false; return false;
} }
...@@ -2100,12 +2094,12 @@ bool ValidateGetQueryivBase(Context *context, GLenum target, GLenum pname, GLsiz ...@@ -2100,12 +2094,12 @@ bool ValidateGetQueryivBase(Context *context, GLenum target, GLenum pname, GLsiz
if (!context->getExtensions().disjointTimerQuery || if (!context->getExtensions().disjointTimerQuery ||
(target != GL_TIMESTAMP_EXT && target != GL_TIME_ELAPSED_EXT)) (target != GL_TIMESTAMP_EXT && target != GL_TIME_ELAPSED_EXT))
{ {
context->handleError(InvalidEnum() << "Invalid pname"); ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidPname);
return false; return false;
} }
break; break;
default: default:
context->handleError(InvalidEnum() << "Invalid pname"); ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidPname);
return false; return false;
} }
...@@ -2166,13 +2160,13 @@ bool ValidateGetQueryObjectValueBase(Context *context, GLuint id, GLenum pname, ...@@ -2166,13 +2160,13 @@ bool ValidateGetQueryObjectValueBase(Context *context, GLuint id, GLenum pname,
if (!queryObject) if (!queryObject)
{ {
context->handleError(InvalidOperation() << "Query does not exist"); ANGLE_VALIDATION_ERR(context, InvalidOperation(), InvalidQueryId);
return false; return false;
} }
if (context->getGLState().isQueryActive(queryObject)) if (context->getGLState().isQueryActive(queryObject))
{ {
context->handleError(InvalidOperation() << "Query currently active"); ANGLE_VALIDATION_ERR(context, InvalidOperation(), QueryActive);
return false; return false;
} }
...@@ -2538,7 +2532,7 @@ bool ValidateStateQuery(ValidationContext *context, ...@@ -2538,7 +2532,7 @@ bool ValidateStateQuery(ValidationContext *context,
if (framebuffer->getReadBufferState() == GL_NONE) if (framebuffer->getReadBufferState() == GL_NONE)
{ {
context->handleError(InvalidOperation() << "Read buffer is GL_NONE"); ANGLE_VALIDATION_ERR(context, InvalidOperation(), ReadBufferNone);
return false; return false;
} }
...@@ -2650,7 +2644,7 @@ bool ValidateCopyTexImageParametersBase(ValidationContext *context, ...@@ -2650,7 +2644,7 @@ bool ValidateCopyTexImageParametersBase(ValidationContext *context,
if (readFramebuffer->getReadBufferState() == GL_NONE) if (readFramebuffer->getReadBufferState() == GL_NONE)
{ {
context->handleError(InvalidOperation() << "Read buffer is GL_NONE"); ANGLE_VALIDATION_ERR(context, InvalidOperation(), ReadBufferNone);
return false; return false;
} }
...@@ -2777,9 +2771,7 @@ bool ValidateCopyTexImageParametersBase(ValidationContext *context, ...@@ -2777,9 +2771,7 @@ bool ValidateCopyTexImageParametersBase(ValidationContext *context,
{ {
if (readFramebuffer->formsCopyingFeedbackLoopWith(texture->id(), level, zoffset)) if (readFramebuffer->formsCopyingFeedbackLoopWith(texture->id(), level, zoffset))
{ {
context->handleError(InvalidOperation() << "Texture copying feedback loop formed " ANGLE_VALIDATION_ERR(context, InvalidOperation(), FeedbackLoop);
"between Framebuffer and specified "
"Texture level.");
return false; return false;
} }
} }
...@@ -2943,9 +2935,7 @@ bool ValidateDrawBase(ValidationContext *context, GLenum mode, GLsizei count) ...@@ -2943,9 +2935,7 @@ bool ValidateDrawBase(ValidationContext *context, GLenum mode, GLsizei count)
// Detect rendering feedback loops for WebGL. // Detect rendering feedback loops for WebGL.
if (framebuffer->formsRenderingFeedbackLoopWith(state)) if (framebuffer->formsRenderingFeedbackLoopWith(state))
{ {
context->handleError( ANGLE_VALIDATION_ERR(context, InvalidOperation(), FeedbackLoop);
InvalidOperation()
<< "Rendering feedback loop formed between Framebuffer and active Texture.");
return false; return false;
} }
...@@ -3329,7 +3319,7 @@ static bool ValidateSizedGetUniform(Context *context, ...@@ -3329,7 +3319,7 @@ static bool ValidateSizedGetUniform(Context *context,
if (bufSize < 0) if (bufSize < 0)
{ {
context->handleError(InvalidValue() << "bufSize cannot be negative."); ANGLE_VALIDATION_ERR(context, InvalidValue(), NegativeBufferSize);
return false; return false;
} }
...@@ -3341,8 +3331,7 @@ static bool ValidateSizedGetUniform(Context *context, ...@@ -3341,8 +3331,7 @@ static bool ValidateSizedGetUniform(Context *context,
size_t requiredBytes = VariableExternalSize(uniform.type); size_t requiredBytes = VariableExternalSize(uniform.type);
if (static_cast<size_t>(bufSize) < requiredBytes) if (static_cast<size_t>(bufSize) < requiredBytes)
{ {
context->handleError(InvalidOperation() ANGLE_VALIDATION_ERR(context, InvalidOperation(), InsufficientBufferSize);
<< "bufSize of at least " << requiredBytes << " is required.");
return false; return false;
} }
...@@ -3434,7 +3423,7 @@ bool ValidateDiscardFramebufferBase(Context *context, ...@@ -3434,7 +3423,7 @@ bool ValidateDiscardFramebufferBase(Context *context,
{ {
if (numAttachments < 0) if (numAttachments < 0)
{ {
context->handleError(InvalidValue() << "numAttachments must not be less than zero"); ANGLE_VALIDATION_ERR(context, InvalidValue(), NegativeAttachments);
return false; return false;
} }
...@@ -3444,8 +3433,7 @@ bool ValidateDiscardFramebufferBase(Context *context, ...@@ -3444,8 +3433,7 @@ bool ValidateDiscardFramebufferBase(Context *context,
{ {
if (defaultFramebuffer) if (defaultFramebuffer)
{ {
context->handleError(InvalidEnum() ANGLE_VALIDATION_ERR(context, InvalidEnum(), DefaultFramebufferInvalidAttachment);
<< "Invalid attachment when the default framebuffer is bound");
return false; return false;
} }
...@@ -3466,9 +3454,8 @@ bool ValidateDiscardFramebufferBase(Context *context, ...@@ -3466,9 +3454,8 @@ bool ValidateDiscardFramebufferBase(Context *context,
case GL_DEPTH_STENCIL_ATTACHMENT: case GL_DEPTH_STENCIL_ATTACHMENT:
if (defaultFramebuffer) if (defaultFramebuffer)
{ {
context->handleError( ANGLE_VALIDATION_ERR(context, InvalidEnum(),
InvalidEnum() DefaultFramebufferInvalidAttachment);
<< "Invalid attachment when the default framebuffer is bound");
return false; return false;
} }
break; break;
...@@ -3477,14 +3464,13 @@ bool ValidateDiscardFramebufferBase(Context *context, ...@@ -3477,14 +3464,13 @@ bool ValidateDiscardFramebufferBase(Context *context,
case GL_STENCIL: case GL_STENCIL:
if (!defaultFramebuffer) if (!defaultFramebuffer)
{ {
context->handleError( ANGLE_VALIDATION_ERR(context, InvalidEnum(),
InvalidEnum() DefaultFramebufferInvalidAttachment);
<< "Invalid attachment when the default framebuffer is not bound");
return false; return false;
} }
break; break;
default: default:
context->handleError(InvalidEnum() << "Invalid attachment"); ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidAttachment);
return false; return false;
} }
} }
...@@ -3602,7 +3588,7 @@ bool ValidateEGLImageTargetRenderbufferStorageOES(Context *context, ...@@ -3602,7 +3588,7 @@ bool ValidateEGLImageTargetRenderbufferStorageOES(Context *context,
break; break;
default: default:
context->handleError(InvalidEnum() << "invalid renderbuffer target."); ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidRenderbufferTarget);
return false; return false;
} }
...@@ -3701,10 +3687,14 @@ bool ValidateGetProgramBinaryBase(Context *context, ...@@ -3701,10 +3687,14 @@ bool ValidateGetProgramBinaryBase(Context *context,
bool ValidateDrawBuffersBase(ValidationContext *context, GLsizei n, const GLenum *bufs) bool ValidateDrawBuffersBase(ValidationContext *context, GLsizei n, const GLenum *bufs)
{ {
// INVALID_VALUE is generated if n is negative or greater than value of MAX_DRAW_BUFFERS // INVALID_VALUE is generated if n is negative or greater than value of MAX_DRAW_BUFFERS
if (n < 0 || static_cast<GLuint>(n) > context->getCaps().maxDrawBuffers) if (n < 0)
{ {
context->handleError(InvalidValue() ANGLE_VALIDATION_ERR(context, InvalidValue(), NegativeCount);
<< "n must be non-negative and no greater than MAX_DRAW_BUFFERS"); return false;
}
if (static_cast<GLuint>(n) > context->getCaps().maxDrawBuffers)
{
ANGLE_VALIDATION_ERR(context, InvalidValue(), IndexExceedsMaxDrawBuffer);
return false; return false;
} }
...@@ -4142,7 +4132,7 @@ bool ValidateGetFramebufferAttachmentParameterivBase(ValidationContext *context, ...@@ -4142,7 +4132,7 @@ bool ValidateGetFramebufferAttachmentParameterivBase(ValidationContext *context,
break; break;
default: default:
ANGLE_VALIDATION_ERR(context, InvalidOperation(), FramebufferInvalidAttachment); ANGLE_VALIDATION_ERR(context, InvalidOperation(), InvalidAttachment);
return false; return false;
} }
} }
...@@ -4169,7 +4159,7 @@ bool ValidateGetFramebufferAttachmentParameterivBase(ValidationContext *context, ...@@ -4169,7 +4159,7 @@ bool ValidateGetFramebufferAttachmentParameterivBase(ValidationContext *context,
break; break;
default: default:
ANGLE_VALIDATION_ERR(context, InvalidOperation(), FramebufferInvalidAttachment); ANGLE_VALIDATION_ERR(context, InvalidOperation(), InvalidAttachment);
return false; return false;
} }
} }
...@@ -4212,7 +4202,7 @@ bool ValidateGetFramebufferAttachmentParameterivBase(ValidationContext *context, ...@@ -4212,7 +4202,7 @@ bool ValidateGetFramebufferAttachmentParameterivBase(ValidationContext *context,
case GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE: case GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:
if (attachment == GL_DEPTH_STENCIL_ATTACHMENT) if (attachment == GL_DEPTH_STENCIL_ATTACHMENT)
{ {
ANGLE_VALIDATION_ERR(context, InvalidOperation(), FramebufferInvalidAttachment); ANGLE_VALIDATION_ERR(context, InvalidOperation(), InvalidAttachment);
return false; return false;
} }
break; break;
...@@ -4247,7 +4237,7 @@ bool ValidateGetFramebufferAttachmentParameterivBase(ValidationContext *context, ...@@ -4247,7 +4237,7 @@ bool ValidateGetFramebufferAttachmentParameterivBase(ValidationContext *context,
if (clientVersion < 3) if (clientVersion < 3)
{ {
ANGLE_VALIDATION_ERR(context, InvalidEnum(), ANGLE_VALIDATION_ERR(context, InvalidEnum(),
InvalidRenderbufferTextureParameter); InvalidFramebufferTextureParameter);
return false; return false;
} }
break; break;
...@@ -4256,13 +4246,13 @@ bool ValidateGetFramebufferAttachmentParameterivBase(ValidationContext *context, ...@@ -4256,13 +4246,13 @@ bool ValidateGetFramebufferAttachmentParameterivBase(ValidationContext *context,
if (clientVersion < 3) if (clientVersion < 3)
{ {
ANGLE_VALIDATION_ERR(context, InvalidEnum(), ANGLE_VALIDATION_ERR(context, InvalidEnum(),
InvalidRenderbufferTextureParameter); InvalidFramebufferTextureParameter);
return false; return false;
} }
else else
{ {
ANGLE_VALIDATION_ERR(context, InvalidOperation(), ANGLE_VALIDATION_ERR(context, InvalidOperation(),
InvalidRenderbufferTextureParameter); InvalidFramebufferTextureParameter);
return false; return false;
} }
} }
...@@ -4919,7 +4909,7 @@ bool ValidateVertexFormatBase(ValidationContext *context, ...@@ -4919,7 +4909,7 @@ bool ValidateVertexFormatBase(ValidationContext *context,
const Caps &caps = context->getCaps(); const Caps &caps = context->getCaps();
if (attribIndex >= caps.maxVertexAttributes) if (attribIndex >= caps.maxVertexAttributes)
{ {
ANGLE_VALIDATION_ERR(context, InvalidValue(), IndexExceedsMax); ANGLE_VALIDATION_ERR(context, InvalidValue(), IndexExceedsMaxVertexAttribute);
return false; return false;
} }
...@@ -5344,7 +5334,7 @@ bool ValidateGetVertexAttribBase(Context *context, ...@@ -5344,7 +5334,7 @@ bool ValidateGetVertexAttribBase(Context *context,
if (index >= context->getCaps().maxVertexAttributes) if (index >= context->getCaps().maxVertexAttributes)
{ {
ANGLE_VALIDATION_ERR(context, InvalidValue(), IndexExceedsMax); ANGLE_VALIDATION_ERR(context, InvalidValue(), IndexExceedsMaxVertexAttribute);
return false; return false;
} }
...@@ -5474,7 +5464,7 @@ bool ValidateReadPixelsBase(Context *context, ...@@ -5474,7 +5464,7 @@ bool ValidateReadPixelsBase(Context *context,
if (framebuffer->getReadBufferState() == GL_NONE) if (framebuffer->getReadBufferState() == GL_NONE)
{ {
context->handleError(InvalidOperation() << "Read buffer is GL_NONE"); ANGLE_VALIDATION_ERR(context, InvalidOperation(), ReadBufferNone);
return false; return false;
} }
...@@ -5510,13 +5500,13 @@ bool ValidateReadPixelsBase(Context *context, ...@@ -5510,13 +5500,13 @@ bool ValidateReadPixelsBase(Context *context,
// dEQP/WebGL. // dEQP/WebGL.
if (!ValidReadPixelsFormatEnum(context, format)) if (!ValidReadPixelsFormatEnum(context, format))
{ {
context->handleError(InvalidEnum() << "Invalid read format."); ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidFormat);
return false; return false;
} }
if (!ValidReadPixelsTypeEnum(context, type)) if (!ValidReadPixelsTypeEnum(context, type))
{ {
context->handleError(InvalidEnum() << "Invalid read type."); ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidType);
return false; return false;
} }
} }
...@@ -5561,8 +5551,7 @@ bool ValidateReadPixelsBase(Context *context, ...@@ -5561,8 +5551,7 @@ bool ValidateReadPixelsBase(Context *context,
{ {
if (pixelPackBuffer == nullptr && static_cast<size_t>(bufSize) < endByte) if (pixelPackBuffer == nullptr && static_cast<size_t>(bufSize) < endByte)
{ {
context->handleError(InvalidOperation() ANGLE_VALIDATION_ERR(context, InvalidOperation(), InsufficientBufferSize);
<< "bufSize must be at least " << endByte << " bytes.");
return false; return false;
} }
} }
...@@ -5670,7 +5659,7 @@ bool ValidateTexParameterBase(Context *context, ...@@ -5670,7 +5659,7 @@ bool ValidateTexParameterBase(Context *context,
case GL_TEXTURE_MAX_LOD: case GL_TEXTURE_MAX_LOD:
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->handleError(InvalidEnum() << "pname requires OpenGL ES 3.0."); ANGLE_VALIDATION_ERR(context, InvalidEnum(), ES3Required);
return false; return false;
} }
if (target == GL_TEXTURE_EXTERNAL_OES && if (target == GL_TEXTURE_EXTERNAL_OES &&
......
...@@ -76,7 +76,7 @@ bool ValidatePathInstances(gl::Context *context, ...@@ -76,7 +76,7 @@ bool ValidatePathInstances(gl::Context *context,
const GLuint pathName = array[i] + pathBase; const GLuint pathName = array[i] + pathBase;
if (context->hasPath(pathName) && !context->hasPathData(pathName)) if (context->hasPath(pathName) && !context->hasPathData(pathName))
{ {
context->handleError(InvalidOperation() << "No such path object."); ANGLE_VALIDATION_ERR(context, InvalidOperation(), NoSuchPath);
return false; return false;
} }
} }
...@@ -1070,7 +1070,7 @@ bool ValidateES2TexImageParameters(Context *context, ...@@ -1070,7 +1070,7 @@ bool ValidateES2TexImageParameters(Context *context,
if (GetInternalFormatInfo(format, type).sizedInternalFormat != if (GetInternalFormatInfo(format, type).sizedInternalFormat !=
textureInternalFormat.sizedInternalFormat) textureInternalFormat.sizedInternalFormat)
{ {
ANGLE_VALIDATION_ERR(context, InvalidOperation(), TypeMustMatchOriginalType); ANGLE_VALIDATION_ERR(context, InvalidOperation(), TypeMismatch);
return false; return false;
} }
} }
...@@ -1406,14 +1406,19 @@ bool ValidateES2TexImageParameters(Context *context, ...@@ -1406,14 +1406,19 @@ bool ValidateES2TexImageParameters(Context *context,
} }
if (target != GL_TEXTURE_2D) if (target != GL_TEXTURE_2D)
{ {
context->handleError(InvalidOperation()); ANGLE_VALIDATION_ERR(context, InvalidOperation(), MismatchedTargetAndFormat);
return false; return false;
} }
// OES_depth_texture supports loading depth data and multiple levels, // OES_depth_texture supports loading depth data and multiple levels,
// but ANGLE_depth_texture does not // but ANGLE_depth_texture does not
if (pixels != nullptr || level != 0) if (pixels != nullptr)
{ {
context->handleError(InvalidOperation()); ANGLE_VALIDATION_ERR(context, InvalidOperation(), PixelDataNotNull);
return false;
}
if (level != 0)
{
ANGLE_VALIDATION_ERR(context, InvalidOperation(), LevelNotZero);
return false; return false;
} }
break; break;
...@@ -1888,19 +1893,19 @@ bool ValidateDebugMessageControlKHR(Context *context, ...@@ -1888,19 +1893,19 @@ bool ValidateDebugMessageControlKHR(Context *context,
if (!ValidDebugSource(source, false) && source != GL_DONT_CARE) if (!ValidDebugSource(source, false) && source != GL_DONT_CARE)
{ {
context->handleError(InvalidEnum() << "Invalid debug source."); ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidDebugSource);
return false; return false;
} }
if (!ValidDebugType(type) && type != GL_DONT_CARE) if (!ValidDebugType(type) && type != GL_DONT_CARE)
{ {
context->handleError(InvalidEnum() << "Invalid debug type."); ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidDebugType);
return false; return false;
} }
if (!ValidDebugSeverity(severity) && severity != GL_DONT_CARE) if (!ValidDebugSeverity(severity) && severity != GL_DONT_CARE)
{ {
context->handleError(InvalidEnum() << "Invalid debug severity."); ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidDebugSeverity);
return false; return false;
} }
...@@ -1949,19 +1954,19 @@ bool ValidateDebugMessageInsertKHR(Context *context, ...@@ -1949,19 +1954,19 @@ bool ValidateDebugMessageInsertKHR(Context *context,
if (!ValidDebugSeverity(severity)) if (!ValidDebugSeverity(severity))
{ {
context->handleError(InvalidEnum() << "Invalid debug severity."); ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidDebugSource);
return false; return false;
} }
if (!ValidDebugType(type)) if (!ValidDebugType(type))
{ {
context->handleError(InvalidEnum() << "Invalid debug type."); ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidDebugType);
return false; return false;
} }
if (!ValidDebugSource(source, true)) if (!ValidDebugSource(source, true))
{ {
context->handleError(InvalidEnum() << "Invalid debug source."); ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidDebugSource);
return false; return false;
} }
...@@ -2028,7 +2033,7 @@ bool ValidatePushDebugGroupKHR(Context *context, ...@@ -2028,7 +2033,7 @@ bool ValidatePushDebugGroupKHR(Context *context,
if (!ValidDebugSource(source, true)) if (!ValidDebugSource(source, true))
{ {
context->handleError(InvalidEnum() << "Invalid debug source."); ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidDebugSource);
return false; return false;
} }
...@@ -2637,7 +2642,7 @@ bool ValidateCompressedTexImage2D(Context *context, ...@@ -2637,7 +2642,7 @@ bool ValidateCompressedTexImage2D(Context *context,
if (imageSize < 0 || static_cast<GLuint>(imageSize) != blockSizeOrErr.getResult()) if (imageSize < 0 || static_cast<GLuint>(imageSize) != blockSizeOrErr.getResult())
{ {
context->handleError(InvalidValue()); ANGLE_VALIDATION_ERR(context, InvalidValue(), CompressedTextureDimensionsMustMatchData);
return false; return false;
} }
...@@ -2849,7 +2854,7 @@ bool ValidateBindTexture(Context *context, GLenum target, GLuint texture) ...@@ -2849,7 +2854,7 @@ bool ValidateBindTexture(Context *context, GLenum target, GLuint texture)
Texture *textureObject = context->getTexture(texture); Texture *textureObject = context->getTexture(texture);
if (textureObject && textureObject->getTarget() != target && texture != 0) if (textureObject && textureObject->getTarget() != target && texture != 0)
{ {
ANGLE_VALIDATION_ERR(context, InvalidOperation(), TypeMustMatchOriginalType); ANGLE_VALIDATION_ERR(context, InvalidOperation(), TypeMismatch);
return false; return false;
} }
...@@ -2879,7 +2884,7 @@ bool ValidateBindTexture(Context *context, GLenum target, GLuint texture) ...@@ -2879,7 +2884,7 @@ bool ValidateBindTexture(Context *context, GLenum target, GLuint texture)
case GL_TEXTURE_2D_ARRAY: case GL_TEXTURE_2D_ARRAY:
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->handleError(InvalidEnum() << "GLES 3.0 disabled"); ANGLE_VALIDATION_ERR(context, InvalidEnum(), ES3Required);
return false; return false;
} }
break; break;
...@@ -2887,7 +2892,7 @@ bool ValidateBindTexture(Context *context, GLenum target, GLuint texture) ...@@ -2887,7 +2892,7 @@ bool ValidateBindTexture(Context *context, GLenum target, GLuint texture)
case GL_TEXTURE_2D_MULTISAMPLE: case GL_TEXTURE_2D_MULTISAMPLE:
if (context->getClientVersion() < Version(3, 1)) if (context->getClientVersion() < Version(3, 1))
{ {
context->handleError(InvalidEnum() << "Context does not support GLES3.1"); ANGLE_VALIDATION_ERR(context, InvalidEnum(), ES31Required);
return false; return false;
} }
break; break;
...@@ -2995,7 +3000,7 @@ bool ValidateMatrix(Context *context, GLenum matrixMode, const GLfloat *matrix) ...@@ -2995,7 +3000,7 @@ bool ValidateMatrix(Context *context, GLenum matrixMode, const GLfloat *matrix)
} }
if (matrixMode != GL_PATH_MODELVIEW_CHROMIUM && matrixMode != GL_PATH_PROJECTION_CHROMIUM) if (matrixMode != GL_PATH_MODELVIEW_CHROMIUM && matrixMode != GL_PATH_PROJECTION_CHROMIUM)
{ {
context->handleError(InvalidEnum() << "Invalid matrix mode."); ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidMatrixMode);
return false; return false;
} }
if (matrix == nullptr) if (matrix == nullptr)
...@@ -3015,7 +3020,7 @@ bool ValidateMatrixMode(Context *context, GLenum matrixMode) ...@@ -3015,7 +3020,7 @@ bool ValidateMatrixMode(Context *context, GLenum matrixMode)
} }
if (matrixMode != GL_PATH_MODELVIEW_CHROMIUM && matrixMode != GL_PATH_PROJECTION_CHROMIUM) if (matrixMode != GL_PATH_MODELVIEW_CHROMIUM && matrixMode != GL_PATH_PROJECTION_CHROMIUM)
{ {
context->handleError(InvalidEnum() << "Invalid matrix mode."); ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidMatrixMode);
return false; return false;
} }
return true; return true;
...@@ -3033,7 +3038,7 @@ bool ValidateGenPaths(Context *context, GLsizei range) ...@@ -3033,7 +3038,7 @@ bool ValidateGenPaths(Context *context, GLsizei range)
// we add stricter semantic check here and require a non zero positive range. // we add stricter semantic check here and require a non zero positive range.
if (range <= 0) if (range <= 0)
{ {
context->handleError(InvalidValue() << "Invalid range."); ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidRange);
return false; return false;
} }
...@@ -3058,7 +3063,7 @@ bool ValidateDeletePaths(Context *context, GLuint path, GLsizei range) ...@@ -3058,7 +3063,7 @@ bool ValidateDeletePaths(Context *context, GLuint path, GLsizei range)
// we add stricter semantic check here and require a non zero positive range. // we add stricter semantic check here and require a non zero positive range.
if (range <= 0) if (range <= 0)
{ {
context->handleError(InvalidValue() << "Invalid range."); ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidRange);
return false; return false;
} }
...@@ -3088,7 +3093,7 @@ bool ValidatePathCommands(Context *context, ...@@ -3088,7 +3093,7 @@ bool ValidatePathCommands(Context *context,
} }
if (!context->hasPath(path)) if (!context->hasPath(path))
{ {
context->handleError(InvalidOperation() << "No such path object."); ANGLE_VALIDATION_ERR(context, InvalidOperation(), NoSuchPath);
return false; return false;
} }
...@@ -3203,7 +3208,7 @@ bool ValidateSetPathParameter(Context *context, GLuint path, GLenum pname, GLflo ...@@ -3203,7 +3208,7 @@ bool ValidateSetPathParameter(Context *context, GLuint path, GLenum pname, GLflo
} }
if (!context->hasPath(path)) if (!context->hasPath(path))
{ {
context->handleError(InvalidOperation() << "No such path object."); ANGLE_VALIDATION_ERR(context, InvalidOperation(), NoSuchPath);
return false; return false;
} }
...@@ -3268,7 +3273,7 @@ bool ValidateGetPathParameter(Context *context, GLuint path, GLenum pname, GLflo ...@@ -3268,7 +3273,7 @@ bool ValidateGetPathParameter(Context *context, GLuint path, GLenum pname, GLflo
if (!context->hasPath(path)) if (!context->hasPath(path))
{ {
context->handleError(InvalidOperation() << "No such path object."); ANGLE_VALIDATION_ERR(context, InvalidOperation(), NoSuchPath);
return false; return false;
} }
if (!value) if (!value)
...@@ -3336,7 +3341,7 @@ bool ValidateStencilFillPath(Context *context, GLuint path, GLenum fillMode, GLu ...@@ -3336,7 +3341,7 @@ bool ValidateStencilFillPath(Context *context, GLuint path, GLenum fillMode, GLu
} }
if (context->hasPath(path) && !context->hasPathData(path)) if (context->hasPath(path) && !context->hasPathData(path))
{ {
context->handleError(InvalidOperation() << "No such path object."); ANGLE_VALIDATION_ERR(context, InvalidOperation(), NoSuchPath);
return false; return false;
} }
...@@ -3346,13 +3351,13 @@ bool ValidateStencilFillPath(Context *context, GLuint path, GLenum fillMode, GLu ...@@ -3346,13 +3351,13 @@ bool ValidateStencilFillPath(Context *context, GLuint path, GLenum fillMode, GLu
case GL_COUNT_DOWN_CHROMIUM: case GL_COUNT_DOWN_CHROMIUM:
break; break;
default: default:
context->handleError(InvalidEnum() << "Invalid fill mode."); ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidFillMode);
return false; return false;
} }
if (!isPow2(mask + 1)) if (!isPow2(mask + 1))
{ {
context->handleError(InvalidValue() << "Invalid stencil bit mask."); ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidStencilBitMask);
return false; return false;
} }
...@@ -3384,7 +3389,7 @@ bool ValidateCoverPath(Context *context, GLuint path, GLenum coverMode) ...@@ -3384,7 +3389,7 @@ bool ValidateCoverPath(Context *context, GLuint path, GLenum coverMode)
} }
if (context->hasPath(path) && !context->hasPathData(path)) if (context->hasPath(path) && !context->hasPathData(path))
{ {
context->handleError(InvalidOperation() << "No such path object."); ANGLE_VALIDATION_ERR(context, InvalidOperation(), NoSuchPath);
return false; return false;
} }
...@@ -3394,7 +3399,7 @@ bool ValidateCoverPath(Context *context, GLuint path, GLenum coverMode) ...@@ -3394,7 +3399,7 @@ bool ValidateCoverPath(Context *context, GLuint path, GLenum coverMode)
case GL_BOUNDING_BOX_CHROMIUM: case GL_BOUNDING_BOX_CHROMIUM:
break; break;
default: default:
context->handleError(InvalidEnum() << "Invalid cover mode."); ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidCoverMode);
return false; return false;
} }
return true; return true;
...@@ -3450,7 +3455,7 @@ bool ValidateCoverFillPathInstanced(Context *context, ...@@ -3450,7 +3455,7 @@ bool ValidateCoverFillPathInstanced(Context *context,
case GL_BOUNDING_BOX_OF_BOUNDING_BOXES_CHROMIUM: case GL_BOUNDING_BOX_OF_BOUNDING_BOXES_CHROMIUM:
break; break;
default: default:
context->handleError(InvalidEnum() << "Invalid cover mode."); ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidCoverMode);
return false; return false;
} }
...@@ -3477,7 +3482,7 @@ bool ValidateCoverStrokePathInstanced(Context *context, ...@@ -3477,7 +3482,7 @@ bool ValidateCoverStrokePathInstanced(Context *context,
case GL_BOUNDING_BOX_OF_BOUNDING_BOXES_CHROMIUM: case GL_BOUNDING_BOX_OF_BOUNDING_BOXES_CHROMIUM:
break; break;
default: default:
context->handleError(InvalidEnum() << "Invalid cover mode."); ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidCoverMode);
return false; return false;
} }
...@@ -3505,12 +3510,12 @@ bool ValidateStencilFillPathInstanced(Context *context, ...@@ -3505,12 +3510,12 @@ bool ValidateStencilFillPathInstanced(Context *context,
case GL_COUNT_DOWN_CHROMIUM: case GL_COUNT_DOWN_CHROMIUM:
break; break;
default: default:
context->handleError(InvalidEnum() << "Invalid fill mode."); ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidFillMode);
return false; return false;
} }
if (!isPow2(mask + 1)) if (!isPow2(mask + 1))
{ {
context->handleError(InvalidValue() << "Invalid stencil bit mask."); ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidStencilBitMask);
return false; return false;
} }
return true; return true;
...@@ -3557,7 +3562,7 @@ bool ValidateStencilThenCoverFillPathInstanced(Context *context, ...@@ -3557,7 +3562,7 @@ bool ValidateStencilThenCoverFillPathInstanced(Context *context,
case GL_BOUNDING_BOX_OF_BOUNDING_BOXES_CHROMIUM: case GL_BOUNDING_BOX_OF_BOUNDING_BOXES_CHROMIUM:
break; break;
default: default:
context->handleError(InvalidEnum() << "Invalid cover mode."); ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidCoverMode);
return false; return false;
} }
...@@ -3567,12 +3572,12 @@ bool ValidateStencilThenCoverFillPathInstanced(Context *context, ...@@ -3567,12 +3572,12 @@ bool ValidateStencilThenCoverFillPathInstanced(Context *context,
case GL_COUNT_DOWN_CHROMIUM: case GL_COUNT_DOWN_CHROMIUM:
break; break;
default: default:
context->handleError(InvalidEnum() << "Invalid fill mode."); ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidFillMode);
return false; return false;
} }
if (!isPow2(mask + 1)) if (!isPow2(mask + 1))
{ {
context->handleError(InvalidValue() << "Invalid stencil bit mask."); ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidStencilBitMask);
return false; return false;
} }
...@@ -3601,7 +3606,7 @@ bool ValidateStencilThenCoverStrokePathInstanced(Context *context, ...@@ -3601,7 +3606,7 @@ bool ValidateStencilThenCoverStrokePathInstanced(Context *context,
case GL_BOUNDING_BOX_OF_BOUNDING_BOXES_CHROMIUM: case GL_BOUNDING_BOX_OF_BOUNDING_BOXES_CHROMIUM:
break; break;
default: default:
context->handleError(InvalidEnum() << "Invalid cover mode."); ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidCoverMode);
return false; return false;
} }
...@@ -3641,7 +3646,7 @@ bool ValidateBindFragmentInputLocation(Context *context, ...@@ -3641,7 +3646,7 @@ bool ValidateBindFragmentInputLocation(Context *context,
if (angle::BeginsWith(name, "gl_")) if (angle::BeginsWith(name, "gl_"))
{ {
context->handleError(InvalidOperation() << "Cannot bind a built-in variable."); ANGLE_VALIDATION_ERR(context, InvalidOperation(), NameBeginsWithGL);
return false; return false;
} }
...@@ -4262,7 +4267,7 @@ bool ValidateBindAttribLocation(ValidationContext *context, ...@@ -4262,7 +4267,7 @@ bool ValidateBindAttribLocation(ValidationContext *context,
{ {
if (index >= MAX_VERTEX_ATTRIBS) if (index >= MAX_VERTEX_ATTRIBS)
{ {
ANGLE_VALIDATION_ERR(context, InvalidValue(), IndexExceedsMax); ANGLE_VALIDATION_ERR(context, InvalidValue(), IndexExceedsMaxVertexAttribute);
return false; return false;
} }
...@@ -4527,13 +4532,13 @@ bool ValidateGetString(Context *context, GLenum name) ...@@ -4527,13 +4532,13 @@ bool ValidateGetString(Context *context, GLenum name)
case GL_REQUESTABLE_EXTENSIONS_ANGLE: case GL_REQUESTABLE_EXTENSIONS_ANGLE:
if (!context->getExtensions().requestExtension) if (!context->getExtensions().requestExtension)
{ {
context->handleError(InvalidEnum() << "Invalid name."); ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidName);
return false; return false;
} }
break; break;
default: default:
context->handleError(InvalidEnum() << "Invalid name."); ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidName);
return false; return false;
} }
...@@ -4544,7 +4549,7 @@ bool ValidateLineWidth(ValidationContext *context, GLfloat width) ...@@ -4544,7 +4549,7 @@ bool ValidateLineWidth(ValidationContext *context, GLfloat width)
{ {
if (width <= 0.0f || isNaN(width)) if (width <= 0.0f || isNaN(width))
{ {
context->handleError(InvalidValue() << "Invalid width value."); ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidWidth);
return false; return false;
} }
...@@ -4875,7 +4880,7 @@ bool ValidateDisableVertexAttribArray(ValidationContext *context, GLuint index) ...@@ -4875,7 +4880,7 @@ bool ValidateDisableVertexAttribArray(ValidationContext *context, GLuint index)
{ {
if (index >= MAX_VERTEX_ATTRIBS) if (index >= MAX_VERTEX_ATTRIBS)
{ {
ANGLE_VALIDATION_ERR(context, InvalidValue(), IndexExceedsMax); ANGLE_VALIDATION_ERR(context, InvalidValue(), IndexExceedsMaxVertexAttribute);
return false; return false;
} }
...@@ -4886,7 +4891,7 @@ bool ValidateEnableVertexAttribArray(ValidationContext *context, GLuint index) ...@@ -4886,7 +4891,7 @@ bool ValidateEnableVertexAttribArray(ValidationContext *context, GLuint index)
{ {
if (index >= MAX_VERTEX_ATTRIBS) if (index >= MAX_VERTEX_ATTRIBS)
{ {
ANGLE_VALIDATION_ERR(context, InvalidValue(), IndexExceedsMax); ANGLE_VALIDATION_ERR(context, InvalidValue(), IndexExceedsMaxVertexAttribute);
return false; return false;
} }
...@@ -4942,7 +4947,7 @@ bool ValidateGetActiveAttrib(ValidationContext *context, ...@@ -4942,7 +4947,7 @@ bool ValidateGetActiveAttrib(ValidationContext *context,
if (index >= static_cast<GLuint>(programObject->getActiveAttributeCount())) if (index >= static_cast<GLuint>(programObject->getActiveAttributeCount()))
{ {
context->handleError(InvalidValue() << "index exeeds program active attribute count."); ANGLE_VALIDATION_ERR(context, InvalidValue(), IndexExceedsMaxActiveUniform);
return false; return false;
} }
...@@ -4973,7 +4978,7 @@ bool ValidateGetActiveUniform(ValidationContext *context, ...@@ -4973,7 +4978,7 @@ bool ValidateGetActiveUniform(ValidationContext *context,
if (index >= static_cast<GLuint>(programObject->getActiveUniformCount())) if (index >= static_cast<GLuint>(programObject->getActiveUniformCount()))
{ {
context->handleError(InvalidValue() << "index exceeds program active uniform count."); ANGLE_VALIDATION_ERR(context, InvalidValue(), IndexExceedsMaxActiveUniform);
return false; return false;
} }
...@@ -4988,7 +4993,7 @@ bool ValidateGetAttachedShaders(ValidationContext *context, ...@@ -4988,7 +4993,7 @@ bool ValidateGetAttachedShaders(ValidationContext *context,
{ {
if (maxcount < 0) if (maxcount < 0)
{ {
context->handleError(InvalidValue() << "max count must be non-negative."); ANGLE_VALIDATION_ERR(context, InvalidValue(), NegativeMaxCount);
return false; return false;
} }
...@@ -5628,7 +5633,7 @@ bool ValidateVertexAttribIndex(ValidationContext *context, GLuint index) ...@@ -5628,7 +5633,7 @@ bool ValidateVertexAttribIndex(ValidationContext *context, GLuint index)
{ {
if (index >= MAX_VERTEX_ATTRIBS) if (index >= MAX_VERTEX_ATTRIBS)
{ {
ANGLE_VALIDATION_ERR(context, InvalidValue(), IndexExceedsMax); ANGLE_VALIDATION_ERR(context, InvalidValue(), IndexExceedsMaxVertexAttribute);
return false; return false;
} }
...@@ -5927,15 +5932,13 @@ bool ValidateFramebufferTexture2D(Context *context, ...@@ -5927,15 +5932,13 @@ bool ValidateFramebufferTexture2D(Context *context,
{ {
if (context->getClientVersion() < ES_3_1) if (context->getClientVersion() < ES_3_1)
{ {
context->handleError(InvalidOperation() ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES31Required);
<< "Texture target requires at least OpenGL ES 3.1.");
return false; return false;
} }
if (level != 0) if (level != 0)
{ {
context->handleError(InvalidValue() ANGLE_VALIDATION_ERR(context, InvalidValue(), LevelNotZero);
<< "Level must be 0 for TEXTURE_2D_MULTISAMPLE.");
return false; return false;
} }
if (tex->getTarget() != GL_TEXTURE_2D_MULTISAMPLE) if (tex->getTarget() != GL_TEXTURE_2D_MULTISAMPLE)
......
...@@ -94,13 +94,13 @@ static bool ValidateTexImageFormatCombination(gl::Context *context, ...@@ -94,13 +94,13 @@ static bool ValidateTexImageFormatCombination(gl::Context *context,
// The type and format are valid if any supported internal format has that type and format // The type and format are valid if any supported internal format has that type and format
if (!ValidES3Format(format)) if (!ValidES3Format(format))
{ {
context->handleError(InvalidEnum() << "Invalid format."); ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidFormat);
return false; return false;
} }
if (!ValidES3Type(type)) if (!ValidES3Type(type))
{ {
context->handleError(InvalidEnum() << "Invalid type."); ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidType);
return false; return false;
} }
...@@ -110,7 +110,7 @@ static bool ValidateTexImageFormatCombination(gl::Context *context, ...@@ -110,7 +110,7 @@ static bool ValidateTexImageFormatCombination(gl::Context *context,
// the validation codepaths for glTexImage2D/3D, we record a GL_INVALID_VALUE error. // the validation codepaths for glTexImage2D/3D, we record a GL_INVALID_VALUE error.
if (!ValidES3InternalFormat(internalFormat)) if (!ValidES3InternalFormat(internalFormat))
{ {
context->handleError(InvalidValue() << "Invalid internalFormat."); ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidInternalFormat);
return false; return false;
} }
...@@ -1125,7 +1125,7 @@ bool ValidateInvalidateFramebuffer(Context *context, ...@@ -1125,7 +1125,7 @@ bool ValidateInvalidateFramebuffer(Context *context,
{ {
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->handleError(InvalidOperation() << "Operation only supported on ES 3.0 and above"); ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES3Required);
return false; return false;
} }
...@@ -1141,7 +1141,7 @@ bool ValidateInvalidateFramebuffer(Context *context, ...@@ -1141,7 +1141,7 @@ bool ValidateInvalidateFramebuffer(Context *context,
defaultFramebuffer = context->getGLState().getReadFramebuffer()->id() == 0; defaultFramebuffer = context->getGLState().getReadFramebuffer()->id() == 0;
break; break;
default: default:
context->handleError(InvalidEnum() << "Invalid framebuffer target"); ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidFramebufferTarget);
return false; return false;
} }
...@@ -1176,7 +1176,7 @@ bool ValidateDrawRangeElements(Context *context, ...@@ -1176,7 +1176,7 @@ bool ValidateDrawRangeElements(Context *context,
{ {
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->handleError(InvalidOperation() << "Context does not support GLES3."); ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES3Required);
return false; return false;
} }
...@@ -1566,7 +1566,7 @@ bool ValidateProgramParameteri(Context *context, GLuint program, GLenum pname, G ...@@ -1566,7 +1566,7 @@ bool ValidateProgramParameteri(Context *context, GLuint program, GLenum pname, G
{ {
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->handleError(InvalidOperation() << "Context does not support GLES3."); ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES3Required);
return false; return false;
} }
...@@ -1777,7 +1777,7 @@ bool ValidateDrawBuffers(ValidationContext *context, GLsizei n, const GLenum *bu ...@@ -1777,7 +1777,7 @@ bool ValidateDrawBuffers(ValidationContext *context, GLsizei n, const GLenum *bu
{ {
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->handleError(InvalidOperation() << "Context does not support GLES3."); ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES3Required);
return false; return false;
} }
...@@ -2051,7 +2051,7 @@ bool ValidateGenOrDeleteCountES3(Context *context, GLint count) ...@@ -2051,7 +2051,7 @@ bool ValidateGenOrDeleteCountES3(Context *context, GLint count)
{ {
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->handleError(InvalidOperation() << "Context does not support GLES3."); ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES3Required);
return false; return false;
} }
if (count < 0) if (count < 0)
...@@ -2066,7 +2066,7 @@ bool ValidateBeginTransformFeedback(Context *context, GLenum primitiveMode) ...@@ -2066,7 +2066,7 @@ bool ValidateBeginTransformFeedback(Context *context, GLenum primitiveMode)
{ {
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->handleError(InvalidOperation() << "Context does not support GLES3."); ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES3Required);
return false; return false;
} }
switch (primitiveMode) switch (primitiveMode)
...@@ -2152,7 +2152,7 @@ bool ValidateMapBufferRange(Context *context, ...@@ -2152,7 +2152,7 @@ bool ValidateMapBufferRange(Context *context,
{ {
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->handleError(InvalidOperation() << "Context does not support GLES3."); ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES3Required);
return false; return false;
} }
...@@ -2166,7 +2166,7 @@ bool ValidateFlushMappedBufferRange(Context *context, ...@@ -2166,7 +2166,7 @@ bool ValidateFlushMappedBufferRange(Context *context,
{ {
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->handleError(InvalidOperation() << "Context does not support GLES3."); ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES3Required);
return false; return false;
} }
...@@ -2297,7 +2297,7 @@ bool ValidateGetIntegeri_v(ValidationContext *context, GLenum target, GLuint ind ...@@ -2297,7 +2297,7 @@ bool ValidateGetIntegeri_v(ValidationContext *context, GLenum target, GLuint ind
{ {
if (context->getClientVersion() < ES_3_0) if (context->getClientVersion() < ES_3_0)
{ {
context->handleError(InvalidOperation() << "Context does not support GLES3.0"); ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES3Required);
return false; return false;
} }
return ValidateIndexedStateQuery(context, target, index, nullptr); return ValidateIndexedStateQuery(context, target, index, nullptr);
...@@ -2312,7 +2312,7 @@ bool ValidateGetIntegeri_vRobustANGLE(ValidationContext *context, ...@@ -2312,7 +2312,7 @@ bool ValidateGetIntegeri_vRobustANGLE(ValidationContext *context,
{ {
if (context->getClientVersion() < ES_3_0) if (context->getClientVersion() < ES_3_0)
{ {
context->handleError(InvalidOperation() << "Context does not support GLES3.0"); ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES3Required);
return false; return false;
} }
...@@ -2338,7 +2338,7 @@ bool ValidateGetInteger64i_v(ValidationContext *context, GLenum target, GLuint i ...@@ -2338,7 +2338,7 @@ bool ValidateGetInteger64i_v(ValidationContext *context, GLenum target, GLuint i
{ {
if (context->getClientVersion() < ES_3_0) if (context->getClientVersion() < ES_3_0)
{ {
context->handleError(InvalidOperation() << "Context does not support GLES3.0"); ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES3Required);
return false; return false;
} }
return ValidateIndexedStateQuery(context, target, index, nullptr); return ValidateIndexedStateQuery(context, target, index, nullptr);
...@@ -2353,7 +2353,7 @@ bool ValidateGetInteger64i_vRobustANGLE(ValidationContext *context, ...@@ -2353,7 +2353,7 @@ bool ValidateGetInteger64i_vRobustANGLE(ValidationContext *context,
{ {
if (context->getClientVersion() < ES_3_0) if (context->getClientVersion() < ES_3_0)
{ {
context->handleError(InvalidOperation() << "Context does not support GLES3.0"); ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES3Required);
return false; return false;
} }
...@@ -2384,7 +2384,7 @@ bool ValidateCopyBufferSubData(ValidationContext *context, ...@@ -2384,7 +2384,7 @@ bool ValidateCopyBufferSubData(ValidationContext *context,
{ {
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->handleError(InvalidOperation() << "CopyBufferSubData requires ES 3 or greater"); ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES3Required);
return false; return false;
} }
...@@ -2466,8 +2466,7 @@ bool ValidateGetStringi(Context *context, GLenum name, GLuint index) ...@@ -2466,8 +2466,7 @@ bool ValidateGetStringi(Context *context, GLenum name, GLuint index)
{ {
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->handleError(InvalidOperation() ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES3Required);
<< "glGetStringi requires OpenGL ES 3.0 or higher.");
return false; return false;
} }
...@@ -2485,7 +2484,7 @@ bool ValidateGetStringi(Context *context, GLenum name, GLuint index) ...@@ -2485,7 +2484,7 @@ bool ValidateGetStringi(Context *context, GLenum name, GLuint index)
case GL_REQUESTABLE_EXTENSIONS_ANGLE: case GL_REQUESTABLE_EXTENSIONS_ANGLE:
if (!context->getExtensions().requestExtension) if (!context->getExtensions().requestExtension)
{ {
context->handleError(InvalidEnum() << "Invalid name."); ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidName);
return false; return false;
} }
if (index >= context->getRequestableExtensionStringCount()) if (index >= context->getRequestableExtensionStringCount())
...@@ -2498,7 +2497,7 @@ bool ValidateGetStringi(Context *context, GLenum name, GLuint index) ...@@ -2498,7 +2497,7 @@ bool ValidateGetStringi(Context *context, GLenum name, GLuint index)
break; break;
default: default:
context->handleError(InvalidEnum() << "Invalid name."); ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidName);
return false; return false;
} }
...@@ -2556,8 +2555,7 @@ bool ValidateVertexAttribIPointer(ValidationContext *context, ...@@ -2556,8 +2555,7 @@ bool ValidateVertexAttribIPointer(ValidationContext *context,
{ {
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->handleError(InvalidOperation() ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES3Required);
<< "VertexAttribIPointer requires OpenGL ES 3.0 or higher.");
return false; return false;
} }
...@@ -2568,7 +2566,7 @@ bool ValidateVertexAttribIPointer(ValidationContext *context, ...@@ -2568,7 +2566,7 @@ bool ValidateVertexAttribIPointer(ValidationContext *context,
if (stride < 0) if (stride < 0)
{ {
context->handleError(InvalidValue() << "stride cannot be negative."); ANGLE_VALIDATION_ERR(context, InvalidValue(), NegativeStride);
return false; return false;
} }
...@@ -2626,13 +2624,13 @@ bool ValidateGetSynciv(Context *context, ...@@ -2626,13 +2624,13 @@ bool ValidateGetSynciv(Context *context,
{ {
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->handleError(InvalidOperation() << "GetSynciv requires OpenGL ES 3.0 or higher."); ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES3Required);
return false; return false;
} }
if (bufSize < 0) if (bufSize < 0)
{ {
context->handleError(InvalidValue() << "bufSize cannot be negative."); ANGLE_VALIDATION_ERR(context, InvalidValue(), NegativeBufferSize);
return false; return false;
} }
...@@ -2652,7 +2650,7 @@ bool ValidateGetSynciv(Context *context, ...@@ -2652,7 +2650,7 @@ bool ValidateGetSynciv(Context *context,
break; break;
default: default:
context->handleError(InvalidEnum() << "Invalid pname."); ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidPname);
return false; return false;
} }
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include "libANGLE/validationES31.h" #include "libANGLE/validationES31.h"
#include "libANGLE/Context.h" #include "libANGLE/Context.h"
#include "libANGLE/ErrorStrings.h"
#include "libANGLE/Framebuffer.h" #include "libANGLE/Framebuffer.h"
#include "libANGLE/VertexArray.h" #include "libANGLE/VertexArray.h"
#include "libANGLE/validationES.h" #include "libANGLE/validationES.h"
...@@ -277,7 +278,7 @@ bool ValidateGetBooleani_v(Context *context, GLenum target, GLuint index, GLbool ...@@ -277,7 +278,7 @@ bool ValidateGetBooleani_v(Context *context, GLenum target, GLuint index, GLbool
{ {
if (context->getClientVersion() < ES_3_1) if (context->getClientVersion() < ES_3_1)
{ {
context->handleError(InvalidOperation() << "Context does not support GLES3.1"); ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES31Required);
return false; return false;
} }
...@@ -298,7 +299,7 @@ bool ValidateGetBooleani_vRobustANGLE(Context *context, ...@@ -298,7 +299,7 @@ bool ValidateGetBooleani_vRobustANGLE(Context *context,
{ {
if (context->getClientVersion() < ES_3_1) if (context->getClientVersion() < ES_3_1)
{ {
context->handleError(InvalidOperation() << "Context does not support GLES3.1"); ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES31Required);
return false; return false;
} }
...@@ -324,7 +325,7 @@ bool ValidateDrawIndirectBase(Context *context, GLenum mode, const void *indirec ...@@ -324,7 +325,7 @@ bool ValidateDrawIndirectBase(Context *context, GLenum mode, const void *indirec
{ {
if (context->getClientVersion() < ES_3_1) if (context->getClientVersion() < ES_3_1)
{ {
context->handleError(InvalidOperation() << "Context does not support GLES3.1"); ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES31Required);
return false; return false;
} }
...@@ -452,7 +453,7 @@ bool ValidateGetTexLevelParameterBase(Context *context, ...@@ -452,7 +453,7 @@ bool ValidateGetTexLevelParameterBase(Context *context,
{ {
if (context->getClientVersion() < ES_3_1) if (context->getClientVersion() < ES_3_1)
{ {
context->handleError(InvalidOperation() << "Context does not support GLES3.1"); ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES31Required);
return false; return false;
} }
...@@ -463,7 +464,7 @@ bool ValidateGetTexLevelParameterBase(Context *context, ...@@ -463,7 +464,7 @@ bool ValidateGetTexLevelParameterBase(Context *context,
if (!ValidTexLevelDestinationTarget(context, target)) if (!ValidTexLevelDestinationTarget(context, target))
{ {
context->handleError(InvalidEnum() << "Invalid texture target"); ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidTextureTarget);
return false; return false;
} }
...@@ -507,7 +508,7 @@ bool ValidateGetTexLevelParameterBase(Context *context, ...@@ -507,7 +508,7 @@ bool ValidateGetTexLevelParameterBase(Context *context,
case GL_TEXTURE_COMPRESSED: case GL_TEXTURE_COMPRESSED:
break; break;
default: default:
context->handleError(InvalidEnum() << "Unknown pname."); ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidPname);
return false; return false;
} }
...@@ -546,7 +547,7 @@ bool ValidateTexStorage2DMultiSample(Context *context, ...@@ -546,7 +547,7 @@ bool ValidateTexStorage2DMultiSample(Context *context,
{ {
if (context->getClientVersion() < ES_3_1) if (context->getClientVersion() < ES_3_1)
{ {
context->handleError(InvalidOperation() << "Context does not support GLES3.1."); ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES31Required);
return false; return false;
} }
...@@ -558,7 +559,7 @@ bool ValidateTexStorage2DMultiSample(Context *context, ...@@ -558,7 +559,7 @@ bool ValidateTexStorage2DMultiSample(Context *context,
if (width < 1 || height < 1) if (width < 1 || height < 1)
{ {
context->handleError(InvalidValue() << "Width and height must be positive."); ANGLE_VALIDATION_ERR(context, InvalidValue(), NegativeSize);
return false; return false;
} }
...@@ -627,7 +628,7 @@ bool ValidateGetMultisamplefv(Context *context, GLenum pname, GLuint index, GLfl ...@@ -627,7 +628,7 @@ bool ValidateGetMultisamplefv(Context *context, GLenum pname, GLuint index, GLfl
{ {
if (context->getClientVersion() < ES_3_1) if (context->getClientVersion() < ES_3_1)
{ {
context->handleError(InvalidOperation() << "Context does not support GLES3.1."); ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES31Required);
return false; return false;
} }
...@@ -651,7 +652,7 @@ bool ValidationFramebufferParameteri(Context *context, GLenum target, GLenum pna ...@@ -651,7 +652,7 @@ bool ValidationFramebufferParameteri(Context *context, GLenum target, GLenum pna
{ {
if (context->getClientVersion() < ES_3_1) if (context->getClientVersion() < ES_3_1)
{ {
context->handleError(InvalidOperation() << "Context does not support GLES3.1."); ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES31Required);
return false; return false;
} }
...@@ -705,8 +706,7 @@ bool ValidationFramebufferParameteri(Context *context, GLenum target, GLenum pna ...@@ -705,8 +706,7 @@ bool ValidationFramebufferParameteri(Context *context, GLenum target, GLenum pna
} }
default: default:
{ {
context->handleError(InvalidEnum() ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidPname);
<< "Invalid pname: 0x" << std::hex << std::uppercase << pname);
return false; return false;
} }
} }
...@@ -728,13 +728,13 @@ bool ValidationGetFramebufferParameteri(Context *context, ...@@ -728,13 +728,13 @@ bool ValidationGetFramebufferParameteri(Context *context,
{ {
if (context->getClientVersion() < ES_3_1) if (context->getClientVersion() < ES_3_1)
{ {
context->handleError(InvalidOperation() << "Context does not support GLES3.1."); ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES31Required);
return false; return false;
} }
if (!ValidFramebufferTarget(target)) if (!ValidFramebufferTarget(target))
{ {
context->handleError(InvalidEnum() << "Invalid framebuffer target."); ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidFramebufferTarget);
return false; return false;
} }
...@@ -746,8 +746,7 @@ bool ValidationGetFramebufferParameteri(Context *context, ...@@ -746,8 +746,7 @@ bool ValidationGetFramebufferParameteri(Context *context,
case GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS: case GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS:
break; break;
default: default:
context->handleError(InvalidEnum() ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidPname);
<< "Invalid pname: 0x" << std::hex << std::uppercase << pname);
return false; return false;
} }
...@@ -769,7 +768,7 @@ bool ValidateGetProgramResourceIndex(Context *context, ...@@ -769,7 +768,7 @@ bool ValidateGetProgramResourceIndex(Context *context,
{ {
if (context->getClientVersion() < ES_3_1) if (context->getClientVersion() < ES_3_1)
{ {
context->handleError(InvalidOperation() << "Context does not support GLES 3.1."); ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES31Required);
return false; return false;
} }
...@@ -797,7 +796,7 @@ bool ValidateBindVertexBuffer(ValidationContext *context, ...@@ -797,7 +796,7 @@ bool ValidateBindVertexBuffer(ValidationContext *context,
{ {
if (context->getClientVersion() < ES_3_1) if (context->getClientVersion() < ES_3_1)
{ {
context->handleError(InvalidOperation() << "Context does not support GLES3.1."); ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES31Required);
return false; return false;
} }
...@@ -817,7 +816,7 @@ bool ValidateBindVertexBuffer(ValidationContext *context, ...@@ -817,7 +816,7 @@ bool ValidateBindVertexBuffer(ValidationContext *context,
if (offset < 0) if (offset < 0)
{ {
context->handleError(InvalidValue() << "offset cannot be negative."); ANGLE_VALIDATION_ERR(context, InvalidValue(), NegativeOffset);
return false; return false;
} }
...@@ -843,7 +842,7 @@ bool ValidateVertexBindingDivisor(ValidationContext *context, GLuint bindingInde ...@@ -843,7 +842,7 @@ bool ValidateVertexBindingDivisor(ValidationContext *context, GLuint bindingInde
{ {
if (context->getClientVersion() < ES_3_1) if (context->getClientVersion() < ES_3_1)
{ {
context->handleError(InvalidOperation() << "Context does not support GLES3.1."); ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES31Required);
return false; return false;
} }
...@@ -875,7 +874,7 @@ bool ValidateVertexAttribFormat(ValidationContext *context, ...@@ -875,7 +874,7 @@ bool ValidateVertexAttribFormat(ValidationContext *context,
{ {
if (context->getClientVersion() < ES_3_1) if (context->getClientVersion() < ES_3_1)
{ {
context->handleError(InvalidOperation() << "Context does not support GLES3.1."); ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES31Required);
return false; return false;
} }
...@@ -905,7 +904,7 @@ bool ValidateVertexAttribBinding(ValidationContext *context, ...@@ -905,7 +904,7 @@ bool ValidateVertexAttribBinding(ValidationContext *context,
{ {
if (context->getClientVersion() < ES_3_1) if (context->getClientVersion() < ES_3_1)
{ {
context->handleError(InvalidOperation() << "Context does not support GLES3.1."); ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES31Required);
return false; return false;
} }
...@@ -920,8 +919,7 @@ bool ValidateVertexAttribBinding(ValidationContext *context, ...@@ -920,8 +919,7 @@ bool ValidateVertexAttribBinding(ValidationContext *context,
const Caps &caps = context->getCaps(); const Caps &caps = context->getCaps();
if (attribIndex >= caps.maxVertexAttributes) if (attribIndex >= caps.maxVertexAttributes)
{ {
context->handleError(InvalidValue() ANGLE_VALIDATION_ERR(context, InvalidValue(), IndexExceedsMaxVertexAttribute);
<< "attribindex must be smaller than MAX_VERTEX_ATTRIBS.");
return false; return false;
} }
...@@ -945,7 +943,7 @@ bool ValidateGetProgramResourceName(Context *context, ...@@ -945,7 +943,7 @@ bool ValidateGetProgramResourceName(Context *context,
{ {
if (context->getClientVersion() < ES_3_1) if (context->getClientVersion() < ES_3_1)
{ {
context->handleError(InvalidOperation() << "Context does not support GLES3.1."); ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES31Required);
return false; return false;
} }
...@@ -970,7 +968,7 @@ bool ValidateGetProgramResourceName(Context *context, ...@@ -970,7 +968,7 @@ bool ValidateGetProgramResourceName(Context *context,
if (bufSize < 0) if (bufSize < 0)
{ {
context->handleError(InvalidValue() << "Invalid bufSize: " << bufSize); ANGLE_VALIDATION_ERR(context, InvalidValue(), NegativeBufferSize);
return false; return false;
} }
...@@ -984,7 +982,7 @@ bool ValidateDispatchCompute(Context *context, ...@@ -984,7 +982,7 @@ bool ValidateDispatchCompute(Context *context,
{ {
if (context->getClientVersion() < ES_3_1) if (context->getClientVersion() < ES_3_1)
{ {
context->handleError(InvalidOperation() << "Context does not support GLES3.1."); ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES31Required);
return false; return false;
} }
...@@ -1119,7 +1117,7 @@ bool ValidateGetProgramResourceLocation(Context *context, ...@@ -1119,7 +1117,7 @@ bool ValidateGetProgramResourceLocation(Context *context,
{ {
if (context->getClientVersion() < ES_3_1) if (context->getClientVersion() < ES_3_1)
{ {
context->handleError(InvalidOperation() << "Context does not support GLES3.1."); ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES31Required);
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