Commit 610640fa by Jamie Madill Committed by Commit Bot

Don't use gl::Error in validation.

Instead pass error code and error message directly to the Context. As a side effect every validation error has an associated message now. Reduces binary size by almost 100k. Bug: angleproject:2957 Change-Id: I045e8ab57f8f9d787654a32f6f037011fe3a9f24 Reviewed-on: https://chromium-review.googlesource.com/c/1335890 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarYuly Novikov <ynovikov@chromium.org>
parent dc65c5bd
...@@ -98,14 +98,6 @@ using ErrorStream = angle::ErrorStreamBase<Error, GLenum, GL_NO_ERROR, GLenum, E ...@@ -98,14 +98,6 @@ using ErrorStream = angle::ErrorStreamBase<Error, GLenum, GL_NO_ERROR, GLenum, E
} // namespace priv } // namespace priv
using InvalidEnum = priv::ErrorStream<GL_INVALID_ENUM>;
using InvalidValue = priv::ErrorStream<GL_INVALID_VALUE>;
using InvalidOperation = priv::ErrorStream<GL_INVALID_OPERATION>;
using StackOverflow = priv::ErrorStream<GL_STACK_OVERFLOW>;
using StackUnderflow = priv::ErrorStream<GL_STACK_UNDERFLOW>;
using OutOfMemory = priv::ErrorStream<GL_OUT_OF_MEMORY>;
using InvalidFramebufferOperation = priv::ErrorStream<GL_INVALID_FRAMEBUFFER_OPERATION>;
inline Error NoError() inline Error NoError()
{ {
return Error::NoError(); return Error::NoError();
......
...@@ -9,366 +9,485 @@ ...@@ -9,366 +9,485 @@
#ifndef LIBANGLE_ERRORSTRINGS_H_ #ifndef LIBANGLE_ERRORSTRINGS_H_
#define LIBANGLE_ERRORSTRINGS_H_ #define LIBANGLE_ERRORSTRINGS_H_
#define ERRMSG(name, message) \
static const constexpr char *kError##name = static_cast<const char *>(message);
#define ANGLE_VALIDATION_ERR(context, error, errorName) \
context->handleError(error << kError##errorName)
namespace gl namespace gl
{ {
ERRMSG(ANGLECopyTexture3DUnavailable, "GL_ANGLE_copy_texture_3d extension not available."); constexpr const char *kError3DDepthStencil =
ERRMSG(BlitDimensionsOutOfRange, "BlitFramebuffer dimensions out of 32-bit integer range."); "Format cannot be GL_DEPTH_COMPONENT or GL_DEPTH_STENCIL if target is GL_TEXTURE_3D";
ERRMSG(BlitExtensionDepthStencilWholeBufferBlit, constexpr const char *kErrorANGLECopyTexture3DUnavailable =
"Only whole-buffer depth and stencil blits are supported by this extension."); "GL_ANGLE_copy_texture_3d extension not available.";
ERRMSG(BlitExtensionFormatMismatch, constexpr const char *kErrorBaseLevelOutOfRange = "Texture base level out of range";
"Attempting to blit and the read and draw buffer formats don't match."); constexpr const char *kErrorBlitDimensionsOutOfRange =
ERRMSG(BlitExtensionFromInvalidAttachmentType, "BlitFramebuffer dimensions out of 32-bit integer range.";
"Blits are only supported from 2D texture, renderbuffer or default framebuffer attachments " constexpr const char *kErrorBlitExtensionDepthStencilWholeBufferBlit =
"in this extension."); "Only whole-buffer depth and stencil blits are supported by this extension.";
ERRMSG(BlitExtensionLinear, "Linear blit not supported in this extension."); constexpr const char *kErrorBlitExtensionFormatMismatch =
ERRMSG(BlitExtensionMultisampledDepthOrStencil, "Attempting to blit and the read and draw buffer formats don't match.";
"Multisampled depth/stencil blit is not supported by this extension."); constexpr const char *kErrorBlitExtensionFromInvalidAttachmentType =
ERRMSG(BlitExtensionMultisampledWholeBufferBlit, "Blits are only supported from 2D texture = renderbuffer or default framebuffer attachments "
"Only whole-buffer blit is supported from a multisampled read buffer in this extension."); "in this extension.";
ERRMSG(BlitExtensionNotAvailable, "Blit extension not available."); constexpr const char *kErrorBlitExtensionLinear = "Linear blit not supported in this extension.";
ERRMSG(BlitExtensionScaleOrFlip, constexpr const char *kErrorBlitExtensionMultisampledDepthOrStencil =
"Scaling and flipping in BlitFramebufferANGLE not supported by this implementation."); "Multisampled depth/stencil blit is not supported by this extension.";
ERRMSG(BlitExtensionToInvalidAttachmentType, constexpr const char *kErrorBlitExtensionMultisampledWholeBufferBlit =
"Blits are only supported to 2D texture, renderbuffer or default framebuffer attachments in " "Only whole-buffer blit is supported from a multisampled read buffer in this extension.";
"this extension."); constexpr const char *kErrorBlitExtensionNotAvailable = "Blit extension not available.";
ERRMSG(BlitFeedbackLoop, "Blit feedback loop: the read and draw framebuffers are the same."); constexpr const char *kErrorBlitExtensionScaleOrFlip =
ERRMSG(BlitFramebufferMissing, "Read and draw framebuffers must both exist for a blit to succeed."); "Scaling and flipping in BlitFramebufferANGLE not supported by this implementation.";
ERRMSG(BlitFromMultiview, "Attempt to read from a multi-view framebuffer."); constexpr const char *kErrorBlitExtensionToInvalidAttachmentType =
ERRMSG(BlitDepthOrStencilFormatMismatch, "Blits are only supported to 2D texture = renderbuffer or default framebuffer attachments in "
"Depth/stencil buffer format combination not allowed for blit."); "this extension.";
ERRMSG(BlitIntegerWithLinearFilter, constexpr const char *kErrorBlitFeedbackLoop =
"Cannot use GL_LINEAR filter when blitting a integer framebuffer."); "Blit feedback loop: the read and draw framebuffers are the same.";
ERRMSG(BlitInvalidFilter, "Invalid blit filter."); constexpr const char *kErrorBlitFramebufferMissing =
ERRMSG(BlitInvalidMask, "Invalid blit mask."); "Read and draw framebuffers must both exist for a blit to succeed.";
ERRMSG(BlitMissingColor, constexpr const char *kErrorBlitFromMultiview = "Attempt to read from a multi-view framebuffer.";
"Attempt to read from a missing color attachment of a complete framebuffer."); constexpr const char *kErrorBlitDepthOrStencilFormatMismatch =
ERRMSG(BlitMissingDepthOrStencil, "Depth/stencil buffer format combination not allowed for blit.";
"Attempt to read from a missing depth/stencil attachment of a complete framebuffer."); constexpr const char *kErrorBlitIntegerWithLinearFilter =
ERRMSG(BlitOnlyNearestForNonColor, "Cannot use GL_LINEAR filter when blitting a integer framebuffer.";
"Only nearest filtering can be used when blitting buffers other than the color buffer."); constexpr const char *kErrorBlitInvalidFilter = "Invalid blit filter.";
ERRMSG(BlitToMultiview, "Attempt to write to a multi-view framebuffer."); constexpr const char *kErrorBlitInvalidMask = "Invalid blit mask.";
ERRMSG(BlitTypeMismatchFixedOrFloat, constexpr const char *kErrorBlitMissingColor =
"If the read buffer contains fixed-point or floating-point values, the draw buffer must as " "Attempt to read from a missing color attachment of a complete framebuffer.";
"well."); constexpr const char *kErrorBlitMissingDepthOrStencil =
ERRMSG(BlitTypeMismatchFixedPoint, "Attempt to read from a missing depth/stencil attachment of a complete framebuffer.";
"If the read buffer contains fixed-point values, the draw buffer must as well."); constexpr const char *kErrorBlitOnlyNearestForNonColor =
ERRMSG(BlitTypeMismatchSignedInteger, "Only nearest filtering can be used when blitting buffers other than the color buffer.";
"If the read buffer contains signed integer values the draw buffer must as well."); constexpr const char *kErrorBlitToMultiview = "Attempt to write to a multi-view framebuffer.";
ERRMSG(BlitTypeMismatchUnsignedInteger, constexpr const char *kErrorBlitTypeMismatchFixedOrFloat =
"If the read buffer contains unsigned integer values the draw buffer must as well."); "If the read buffer contains fixed-point or floating-point values = the draw buffer must as "
ERRMSG(BlitMultisampledBoundsMismatch, "well.";
"Attempt to blit from a multisampled framebuffer and the bounds don't match with the draw " constexpr const char *kErrorBlitTypeMismatchFixedPoint =
"framebuffer."); "If the read buffer contains fixed-point values = the draw buffer must as well.";
ERRMSG(BlitMultisampledFormatOrBoundsMismatch, constexpr const char *kErrorBlitTypeMismatchSignedInteger =
"Attempt to blit from a multisampled framebuffer and the bounds or format of the color " "If the read buffer contains signed integer values the draw buffer must as well.";
"buffer don't match with the draw framebuffer."); constexpr const char *kErrorBlitTypeMismatchUnsignedInteger =
ERRMSG(BlitSameImageColor, "Read and write color attachments cannot be the same image."); "If the read buffer contains unsigned integer values the draw buffer must as well.";
ERRMSG(BlitSameImageDepthOrStencil, constexpr const char *kErrorBlitMultisampledBoundsMismatch =
"Read and write depth stencil attachments cannot be the same image."); "Attempt to blit from a multisampled framebuffer and the bounds don't match with the draw "
ERRMSG(BufferBoundForTransformFeedback, "Buffer is bound for transform feedback."); "framebuffer.";
ERRMSG(BufferNotBound, "A buffer must be bound."); constexpr const char *kErrorBlitMultisampledFormatOrBoundsMismatch =
ERRMSG(BufferMapped, "An active buffer is mapped"); "Attempt to blit from a multisampled framebuffer and the bounds or format of the color "
ERRMSG(ColorNumberGreaterThanMaxDualSourceDrawBuffers, "buffer don't match with the draw framebuffer.";
"Color number for secondary color greater than or equal to MAX_DUAL_SOURCE_DRAW_BUFFERS"); constexpr const char *kErrorBlitSameImageColor =
ERRMSG(ColorNumberGreaterThanMaxDrawBuffers, "Read and write color attachments cannot be the same image.";
"Color number for primary color greater than or equal to MAX_DRAW_BUFFERS"); constexpr const char *kErrorBlitSameImageDepthOrStencil =
ERRMSG(CompressedTextureDimensionsMustMatchData, "Read and write depth stencil attachments cannot be the same image.";
"Compressed texture dimensions must exactly match the dimensions of the data passed in."); constexpr const char *kErrorBufferBoundForTransformFeedback =
ERRMSG(CompressedTexturesNotAttachable, "Compressed textures cannot be attached to a framebuffer."); "Buffer is bound for transform feedback.";
ERRMSG(CubemapFacesEqualDimensions, "Each cubemap face must have equal width and height."); constexpr const char *kErrorBufferNotBound = "A buffer must be bound.";
ERRMSG(CubemapIncomplete, constexpr const char *kErrorBufferMapped = "An active buffer is mapped";
"Texture is not cubemap complete. All cubemaps faces must be defined and be the same size."); constexpr const char *kErrorColorNumberGreaterThanMaxDualSourceDrawBuffers =
ERRMSG(DefaultFramebufferInvalidAttachment, "Color number for secondary color greater than or equal to MAX_DUAL_SOURCE_DRAW_BUFFERS";
"Invalid attachment when the default framebuffer is bound."); constexpr const char *kErrorColorNumberGreaterThanMaxDrawBuffers =
ERRMSG(DefaultFramebufferTarget, "It is invalid to change default FBO's attachments"); "Color number for primary color greater than or equal to MAX_DRAW_BUFFERS";
ERRMSG(DestinationImmutable, "Destination texture cannot be immutable."); constexpr const char *kErrorCompressedMismatch =
ERRMSG(DestinationLevelNotDefined, "Compressed data is valid if-and-only-if the texture is compressed.";
"The destination level of the destination texture must be defined."); constexpr const char *kErrorCompressedTextureDimensionsMustMatchData =
ERRMSG(DestinationTextureTooSmall, "Destination texture too small."); "Compressed texture dimensions must exactly match the dimensions of the data passed in.";
ERRMSG(DispatchIndirectBufferNotBound, "Dispatch indirect buffer must be bound."); constexpr const char *kErrorCompressedTexturesNotAttachable =
ERRMSG(DrawBufferTypeMismatch, "Compressed textures cannot be attached to a framebuffer.";
"Fragment shader output type does not match the bound framebuffer attachment type."); constexpr const char *kErrorCopyAlias = "The read and write copy regions alias memory.";
ERRMSG(DrawFramebufferIncomplete, "Draw framebuffer is incomplete"); constexpr const char *kErrorCubemapFacesEqualDimensions =
ERRMSG(ElementArrayBufferBoundForTransformFeedback, "Each cubemap face must have equal width and height.";
"It is undefined behavior to use an element array buffer that is bound for transform " constexpr const char *kErrorCubemapIncomplete =
"feedback."); "Texture is not cubemap complete. All cubemaps faces must be defined and be the same size.";
ERRMSG(EnumNotSupported, "Enum is not currently supported."); constexpr const char *kErrorDefaultFramebufferInvalidAttachment =
ERRMSG(EnumRequiresGLES31, "Enum requires GLES 3.1"); "Invalid attachment when the default framebuffer is bound.";
ERRMSG(ES31Required, "OpenGL ES 3.1 Required"); constexpr const char *kErrorDefaultFramebufferTarget =
ERRMSG(ES3Required, "OpenGL ES 3.0 Required."); "It is invalid to change default FBO's attachments";
ERRMSG(ExceedsMaxElement, "Element value exceeds maximum element index."); constexpr const char *kErrorDefaultVertexArray = "Default vertex array object is bound.";
ERRMSG(ExpectedProgramName, "Expected a program name, but found a shader name."); constexpr const char *kErrorDestinationImmutable = "Destination texture cannot be immutable.";
ERRMSG(ExpectedShaderName, "Expected a shader name, but found a program name."); constexpr const char *kErrorDestinationLevelNotDefined =
ERRMSG(ExtensionNotEnabled, "Extension is not enabled."); "The destination level of the destination texture must be defined.";
ERRMSG(FeedbackLoop, "Feedback loop formed between Framebuffer and active Texture."); constexpr const char *kErrorDestinationTextureTooSmall = "Destination texture too small.";
ERRMSG(FragDataBindingIndexOutOfRange, "Fragment output color index must be zero or one."); constexpr const char *kErrorDimensionsMustBePow2 = "Texture dimensions must be power-of-two.";
ERRMSG(FramebufferIncompleteAttachment, constexpr const char *kErrorDispatchIndirectBufferNotBound =
"Attachment type must be compatible with attachment object."); "Dispatch indirect buffer must be bound.";
ERRMSG(FramebufferTextureInvalidLayer, "Layer invalid for framebuffer texture attachment."); constexpr const char *kErrorDrawIndirectBufferNotBound = "Draw indirect buffer must be bound.";
ERRMSG(FramebufferTextureInvalidMipLevel, "Mip level invalid for framebuffer texture attachment."); constexpr const char *kErrorDrawBufferTypeMismatch =
ERRMSG(FramebufferTextureLayerIncorrectTextureType, "Fragment shader output type does not match the bound framebuffer attachment type.";
"Texture is not a three-dimensional or two-dimensionsal array texture."); constexpr const char *kErrorDrawFramebufferIncomplete = "Draw framebuffer is incomplete";
ERRMSG(GenerateMipmapNotAllowed, "Texture format does not support mipmap generation."); constexpr const char *kErrorElementArrayBufferBoundForTransformFeedback =
ERRMSG(GeometryShaderExtensionNotEnabled, "GL_EXT_geometry_shader extension not enabled."); "It is undefined behavior to use an element array buffer that is bound for transform "
ERRMSG(GLES1Only, "GLES1-only function."); "feedback.";
ERRMSG(ImmutableTextureBound, constexpr const char *kErrorEnumNotSupported = "Enum is not currently supported.";
"The value of TEXTURE_IMMUTABLE_FORMAT for the texture currently bound to target on the " constexpr const char *kErrorEnumRequiresGLES31 = "Enum requires GLES 3.1";
"active texture unit is true."); constexpr const char *kErrorES31Required = "OpenGL ES 3.1 Required";
ERRMSG(IncompatibleDrawModeAgainstGeometryShader, constexpr const char *kErrorES3Required = "OpenGL ES 3.0 Required.";
"Primitive mode is incompatible with the input primitive type of the geometry shader."); constexpr const char *kErrorExceedsMaxElement = "Element value exceeds maximum element index.";
ERRMSG(IndexExceedsMaxActiveUniform, "Index exceeds program active uniform count."); constexpr const char *kErrorExpectedProgramName =
ERRMSG(IndexExceedsMaxDrawBuffer, "Index exceeds MAX_DRAW_BUFFERS."); "Expected a program name = but found a shader name.";
ERRMSG(IndexExceedsMaxVertexAttribute, "Index exceeds MAX_VERTEX_ATTRIBS."); constexpr const char *kErrorExpectedShaderName =
ERRMSG(InsufficientBufferSize, "Insufficient buffer size."); "Expected a shader name = but found a program name.";
ERRMSG(InsufficientVertexBufferSize, "Vertex buffer is not big enough for the draw call"); constexpr const char *kErrorExtensionNotEnabled = "Extension is not enabled.";
ERRMSG(IntegerOverflow, "Integer overflow."); constexpr const char *kErrorFeedbackLoop =
ERRMSG(InternalFormatRequiresTexture2DArray, "Feedback loop formed between Framebuffer and active Texture.";
"internalformat is an ETC2/EAC format and target is not GL_TEXTURE_2D_ARRAY."); constexpr const char *kErrorFragDataBindingIndexOutOfRange =
ERRMSG(InvalidAttachment, "Invalid Attachment Type."); "Fragment output color index must be zero or one.";
ERRMSG(InvalidBlendEquation, "Invalid blend equation."); constexpr const char *kErrorFramebufferIncomplete = "Framebuffer is incomplete.";
ERRMSG(InvalidBlendFunction, "Invalid blend function."); constexpr const char *kErrorFramebufferIncompleteAttachment =
ERRMSG(InvalidBorder, "Border must be 0."); "Attachment type must be compatible with attachment object.";
ERRMSG(InvalidBufferTypes, "Invalid buffer target enum."); constexpr const char *kErrorFramebufferTextureInvalidLayer =
ERRMSG(InvalidBufferUsage, "Invalid buffer usage enum."); "Layer invalid for framebuffer texture attachment.";
ERRMSG(InvalidClearMask, "Invalid mask bits."); constexpr const char *kErrorFramebufferTextureInvalidMipLevel =
ERRMSG(InvalidClientState, "Invalid client vertex array type."); "Mip level invalid for framebuffer texture attachment.";
ERRMSG(InvalidClipPlane, "Invalid clip plane."); constexpr const char *kErrorFramebufferTextureLayerIncorrectTextureType =
ERRMSG(InvalidCombinedImageUnit, "Texture is not a three-dimensional or two-dimensionsal array texture.";
"Specified unit must be in [GL_TEXTURE0, GL_TEXTURE0 + GL_MAX_COMBINED_IMAGE_UNITS)"); constexpr const char *kErrorGenerateMipmapNotAllowed =
ERRMSG(InvalidConstantColor, "Texture format does not support mipmap generation.";
"CONSTANT_COLOR (or ONE_MINUS_CONSTANT_COLOR) and CONSTANT_ALPHA (or " constexpr const char *kErrorGeometryShaderExtensionNotEnabled =
"ONE_MINUS_CONSTANT_ALPHA) cannot be used together as source and destination factors in the " "GL_EXT_geometry_shader extension not enabled.";
"blend function."); constexpr const char *kErrorGLES1Only = "GLES1-only function.";
ERRMSG(InvalidCoverMode, "Invalid cover mode."); constexpr const char *kErrorImmutableTextureBound =
ERRMSG(InvalidCullMode, "Cull mode not recognized."); "The value of TEXTURE_IMMUTABLE_FORMAT for the texture currently bound to target on the "
ERRMSG(InvalidDebugSeverity, "Invalid debug severity."); "active texture unit is true.";
ERRMSG(InvalidDebugSource, "Invalid debug source."); constexpr const char *kErrorIncompatibleDrawModeAgainstGeometryShader =
ERRMSG(InvalidDebugType, "Invalid debug type."); "Primitive mode is incompatible with the input primitive type of the geometry shader.";
ERRMSG(InvalidDepthRange, "Near value cannot be greater than far."); constexpr const char *kErrorIndexExceedsMaxActiveUniform =
ERRMSG(InvalidDestinationTexture, "Destination texture is not a valid texture object."); "Index must be less than program active uniform count.";
ERRMSG(InvalidDestinationTextureType, "Invalid destination texture type."); constexpr const char *kErrorIndexExceedsMaxActiveUniformBlock =
ERRMSG(InvalidDrawMode, "Invalid draw mode."); "Index must be less than program active uniform block count.";
ERRMSG(InvalidDrawModeTransformFeedback, constexpr const char *kErrorIndexExceedsMaxAtomicCounterBufferBindings =
"Draw mode must match current transform feedback object's draw mode."); "Index must be less than MAX_ATOMIC_COUNTER_BUFFER_BINDINGS.";
ERRMSG(InvalidFence, "Invalid fence object."); constexpr const char *kErrorIndexExceedsMaxDrawBuffer = "Index must be less than MAX_DRAW_BUFFERS.";
ERRMSG(InvalidFenceState, "Fence must be set."); constexpr const char *kErrorIndexExceedsMaxTransformFeedbackAttribs =
ERRMSG(InvalidFillMode, "Invalid fill mode."); "Index must be less than MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS.";
ERRMSG(InvalidFilterTexture, "Texture only supports NEAREST and LINEAR filtering."); constexpr const char *kErrorIndexExceedsMaxUniformBufferBindings =
ERRMSG(InvalidFogDensity, "Invalid fog density (must be nonnegative)."); "Index must be less than MAX_UNIFORM_BUFFER_BINDINGS.";
ERRMSG(InvalidFogMode, "Invalid fog mode."); constexpr const char *kErrorIndexExceedsMaxVertexAttribute =
ERRMSG(InvalidFogParameter, "Invalid fog parameter."); "Index must be less than MAX_VERTEX_ATTRIBS.";
ERRMSG(InvalidFormat, "Invalid format."); constexpr const char *kErrorIndexExceedsMaxWorkgroupDimensions =
ERRMSG(InvalidFramebufferTarget, "Invalid framebuffer target."); "Index must be less than the number of workgroup dimensions (3).";
ERRMSG(InvalidFramebufferTextureLevel, "Mipmap level must be 0 when attaching a texture."); constexpr const char *kErrorIndexExceedsSamples = "Index must be less than the value of SAMPLES.";
ERRMSG(InvalidFramebufferAttachmentParameter, "Invalid parameter name for framebuffer attachment."); constexpr const char *kErrorInsufficientBufferSize = "Insufficient buffer size.";
ERRMSG(InvalidFramebufferLayer, constexpr const char *kErrorInsufficientVertexBufferSize =
"Framebuffer layer cannot be less than 0 or greater than GL_MAX_FRAMEBUFFER_LAYERS_EXT."); "Vertex buffer is not big enough for the draw call";
ERRMSG(InvalidImageUnit, constexpr const char *kErrorIntegerOverflow = "Integer overflow.";
"Image unit cannot be greater than or equal to the value of MAX_IMAGE_UNITS."); constexpr const char *kErrorInternalFormatRequiresTexture2DArray =
ERRMSG(InvalidInternalFormat, "Invalid internal format."); "internalformat is an ETC2/EAC format and target is not GL_TEXTURE_2D_ARRAY.";
ERRMSG(InvalidLight, "Invalid light."); constexpr const char *kErrorInvalidAttachment = "Invalid Attachment Type.";
ERRMSG(InvalidLightModelParameter, "Invalid light model parameter."); constexpr const char *kErrorInvalidBlendEquation = "Invalid blend equation.";
ERRMSG(InvalidLightParameter, "Invalid light parameter."); constexpr const char *kErrorInvalidBlendFunction = "Invalid blend function.";
ERRMSG(InvalidLogicOp, "Invalid logical operation."); constexpr const char *kErrorInvalidBooleanValue =
ERRMSG(InvalidMaterialFace, "Invalid material face."); "Invalid boolean value. Must be GL_FALSE or GL_TRUE.";
ERRMSG(InvalidMaterialParameter, "Invalid material parameter."); constexpr const char *kErrorInvalidBorder = "Border must be 0.";
ERRMSG(InvalidMatrixMode, "Invalid matrix mode."); constexpr const char *kErrorInvalidBufferTypes = "Invalid buffer target.";
ERRMSG(InvalidMemoryBarrierBit, "Invalid memory barrier bit."); constexpr const char *kErrorInvalidBufferUsage = "Invalid buffer usage enum.";
ERRMSG(InvalidMipLevel, "Level of detail outside of range."); constexpr const char *kErrorInvalidClearMask = "Invalid mask bits.";
ERRMSG(InvalidMultitextureUnit, constexpr const char *kErrorInvalidClientState = "Invalid client vertex array type.";
"Specified unit must be in [GL_TEXTURE0, GL_TEXTURE0 + GL_MAX_TEXTURE_UNITS)"); constexpr const char *kErrorInvalidClipPlane = "Invalid clip plane.";
ERRMSG(InvalidMultisampledFramebufferOperation, "Invalid operation on multisampled framebuffer"); constexpr const char *kErrorInvalidCombinedImageUnit =
ERRMSG(InvalidName, "Invalid name."); "Specified unit must be in [GL_TEXTURE0 = GL_TEXTURE0 + GL_MAX_COMBINED_IMAGE_UNITS)";
ERRMSG(InvalidNameCharacters, "Name contains invalid characters."); constexpr const char *kErrorInvalidCompressedFormat = "Not a valid compressed texture format.";
ERRMSG(InvalidPname, "Invalid pname."); constexpr const char *kErrorInvalidCompressedImageSize = "Invalid compressed image size.";
ERRMSG(InvalidPointerQuery, "Invalid pointer query."); constexpr const char *kErrorInvalidConstantColor =
ERRMSG(InvalidPointParameter, "Invalid point parameter."); "CONSTANT_COLOR (or ONE_MINUS_CONSTANT_COLOR) and CONSTANT_ALPHA (or "
ERRMSG(InvalidPointParameterValue, "Invalid point parameter value (must be non-negative)."); "ONE_MINUS_CONSTANT_ALPHA) cannot be used together as source and destination factors in the "
ERRMSG(InvalidPointSizeValue, "Invalid point size (must be positive)."); "blend function.";
ERRMSG(InvalidPrecision, "Invalid or unsupported precision type."); constexpr const char *kErrorInvalidCopyCombination = "Invalid copy texture format combination.";
ERRMSG(InvalidProgramName, "Program object expected."); constexpr const char *kErrorInvalidCoverMode = "Invalid cover mode.";
ERRMSG(InvalidProjectionMatrix, constexpr const char *kErrorInvalidCullMode = "Cull mode not recognized.";
"Invalid projection matrix. Left/right, top/bottom, near/far intervals cannot be zero, and " constexpr const char *kErrorInvalidDebugSeverity = "Invalid debug severity.";
"near/far cannot be less than zero."); constexpr const char *kErrorInvalidDebugSource = "Invalid debug source.";
ERRMSG(InvalidQueryId, "Invalid query Id."); constexpr const char *kErrorInvalidDebugType = "Invalid debug type.";
ERRMSG(InvalidQueryTarget, "Invalid query target."); constexpr const char *kErrorInvalidDepthRange = "Near value cannot be greater than far.";
ERRMSG(InvalidQueryType, "Invalid query type."); constexpr const char *kErrorInvalidDepthStencilDrawBuffer =
ERRMSG(InvalidRange, "Invalid range."); "Draw buffer must be zero when using depth or stencil.";
ERRMSG(InvalidRenderbufferInternalFormat, "Invalid renderbuffer internalformat."); constexpr const char *kErrorInvalidDestinationTexture =
ERRMSG(InvalidRenderbufferTarget, "Invalid renderbuffer target."); "Destination texture is not a valid texture object.";
ERRMSG(InvalidRenderbufferTextureParameter, "Invalid parameter name for renderbuffer attachment."); constexpr const char *kErrorInvalidDestinationTextureType = "Invalid destination texture type.";
ERRMSG(InvalidRenderbufferWidthHeight, constexpr const char *kErrorInvalidDrawMode = "Invalid draw mode.";
"Renderbuffer width and height cannot be negative and cannot exceed maximum texture size."); constexpr const char *kErrorInvalidDrawModeTransformFeedback =
ERRMSG(InvalidSampleMaskNumber, "Draw mode must match current transform feedback object's draw mode.";
"MaskNumber cannot be greater than or equal to the value of MAX_SAMPLE_MASK_WORDS."); constexpr const char *kErrorInvalidFence = "Invalid fence object.";
ERRMSG(InvalidSampler, "Sampler is not valid"); constexpr const char *kErrorInvalidFenceCondition = "Invalid value for condition.";
ERRMSG(InvalidShaderName, "Shader object expected."); constexpr const char *kErrorInvalidFenceState = "Fence must be set.";
ERRMSG(InvalidShaderType, "Invalid shader type."); constexpr const char *kErrorInvalidFillMode = "Invalid fill mode.";
ERRMSG(InvalidShadingModel, "Invalid shading model."); constexpr const char *kErrorInvalidFilterTexture =
ERRMSG(InvalidSourceTexture, "Source texture is not a valid texture object."); "Texture only supports NEAREST and LINEAR filtering.";
ERRMSG(InvalidSourceTextureLevel, "Invalid source texture level."); constexpr const char *kErrorInvalidFlags = "Invalid value for flags.";
ERRMSG(InvalidSourceTextureSize, "Invalid source texture height or width."); constexpr const char *kErrorInvalidFogDensity = "Invalid fog density (must be nonnegative).";
ERRMSG(InvalidStencil, "Invalid stencil."); constexpr const char *kErrorInvalidFogMode = "Invalid fog mode.";
ERRMSG(InvalidStencilBitMask, "Invalid stencil bit mask."); constexpr const char *kErrorInvalidFogParameter = "Invalid fog parameter.";
ERRMSG(InvalidTarget, "Invalid target."); constexpr const char *kErrorInvalidFormat = "Invalid format.";
ERRMSG(InvalidTextureCombine, "Invalid texture combine mode."); constexpr const char *kErrorInvalidFormatCombination =
ERRMSG(InvalidTextureCombineSrc, "Invalid texture combine source."); "Invalid combination of format = type and internalFormat.";
ERRMSG(InvalidTextureCombineOp, "Invalid texture combine operand."); constexpr const char *kErrorInvalidFramebufferTarget = "Invalid framebuffer target.";
ERRMSG(InvalidTextureEnvMode, "Invalid texture environment mode."); constexpr const char *kErrorInvalidFramebufferTextureLevel =
ERRMSG(InvalidTextureEnvParameter, "Invalid texture environment parameter."); "Mipmap level must be 0 when attaching a texture.";
ERRMSG(InvalidTextureEnvScale, "Invalid texture environment scale."); constexpr const char *kErrorInvalidFramebufferAttachmentParameter =
ERRMSG(InvalidTextureEnvTarget, "Invalid texture environment target."); "Invalid parameter name for framebuffer attachment.";
ERRMSG(InvalidTextureFilterParam, "Texture filter not recognized."); constexpr const char *kErrorInvalidFramebufferLayer =
ERRMSG(InvalidTextureName, "Not a valid texture object name."); "Framebuffer layer cannot be less than 0 or greater than GL_MAX_FRAMEBUFFER_LAYERS_EXT.";
ERRMSG(InvalidTextureRange, "Cannot be less than 0 or greater than maximum number of textures."); constexpr const char *kErrorInvalidIndirectOffset =
ERRMSG(InvalidTextureTarget, "Invalid or unsupported texture target."); "indirect must be a multiple of the size of uint in basic machine units.";
ERRMSG(InvalidTextureWrap, "Texture wrap mode not recognized."); constexpr const char *kErrorInvalidImageUnit =
ERRMSG(InvalidType, "Invalid type."); "Image unit cannot be greater than or equal to the value of MAX_IMAGE_UNITS.";
ERRMSG(InvalidTypePureInt, "Invalid type, should be integer"); constexpr const char *kErrorInvalidInternalFormat = "Invalid internal format.";
ERRMSG(InvalidUnpackAlignment, "Unpack alignment must be 1, 2, 4, or 8."); constexpr const char *kErrorInvalidLight = "Invalid light.";
ERRMSG(InvalidVertexAttrSize, "Vertex attribute size must be 1, 2, 3, or 4."); constexpr const char *kErrorInvalidLightModelParameter = "Invalid light model parameter.";
ERRMSG(InvalidVertexPointerSize, "Size for built-in vertex attribute is outside allowed range."); constexpr const char *kErrorInvalidLightParameter = "Invalid light parameter.";
ERRMSG(InvalidVertexPointerStride, "Invalid stride for built-in vertex attribute."); constexpr const char *kErrorInvalidLogicOp = "Invalid logical operation.";
ERRMSG(InvalidVertexPointerType, "Invalid type for built-in vertex attribute."); constexpr const char *kErrorInvalidMaterialFace = "Invalid material face.";
ERRMSG(InvalidWidth, "Invalid width."); constexpr const char *kErrorInvalidMaterialParameter = "Invalid material parameter.";
ERRMSG(InvalidWrapModeTexture, "Invalid wrap mode for texture type."); constexpr const char *kErrorInvalidMatrixMode = "Invalid matrix mode.";
ERRMSG(LevelNotZero, "Texture level must be zero."); constexpr const char *kErrorInvalidMemoryBarrierBit = "Invalid memory barrier bit.";
ERRMSG(LightParameterOutOfRange, "Light parameter out of range."); constexpr const char *kErrorInvalidMipLevel = "Level of detail outside of range.";
ERRMSG(MaterialParameterOutOfRange, "Material parameter out of range."); constexpr const char *kErrorInvalidMipLevels = "Invalid level count.";
ERRMSG(MatrixStackOverflow, "Current matrix stack is full."); constexpr const char *kErrorInvalidMultitextureUnit =
ERRMSG(MatrixStackUnderflow, "Current matrix stack has only a single matrix."); "Specified unit must be in [GL_TEXTURE0 = GL_TEXTURE0 + GL_MAX_TEXTURE_UNITS)";
ERRMSG(MismatchedByteCountType, "Buffer size does not align with data type."); constexpr const char *kErrorInvalidMultisampledFramebufferOperation =
ERRMSG(MismatchedFormat, "Format must match internal format."); "Invalid operation on multisampled framebuffer";
ERRMSG(MismatchedTargetAndFormat, "Invalid texture target and format combination."); constexpr const char *kErrorInvalidName = "Invalid name.";
ERRMSG(MismatchedTypeAndFormat, "Invalid format and type combination."); constexpr const char *kErrorInvalidNameCharacters = "Name contains invalid characters.";
ERRMSG(MismatchedVariableProgram, "Variable is not part of the current program."); constexpr const char *kErrorInvalidPname = "Invalid pname.";
ERRMSG(MissingReadAttachment, "Missing read attachment."); constexpr const char *kErrorInvalidPointerQuery = "Invalid pointer query.";
ERRMSG(MustHaveElementArrayBinding, "Must have element array buffer binding."); constexpr const char *kErrorInvalidPointParameter = "Invalid point parameter.";
ERRMSG(MultiviewMismatch, constexpr const char *kErrorInvalidPointParameterValue =
"The number of views in the active program and draw " "Invalid point parameter value (must be non-negative).";
"framebuffer does not match."); constexpr const char *kErrorInvalidPointSizeValue = "Invalid point size (must be positive).";
ERRMSG(MultiviewTransformFeedback, constexpr const char *kErrorInvalidPrecision = "Invalid or unsupported precision type.";
"There is an active transform feedback object when " constexpr const char *kErrorInvalidProgramName = "Program object expected.";
"the number of views in the active draw framebuffer " constexpr const char *kErrorInvalidProjectionMatrix =
"is greater than 1."); "Invalid projection matrix. Left/right = top/bottom = near/far intervals cannot be zero = and "
ERRMSG(MultiviewTimerQuery, "near/far cannot be less than zero.";
"There is an active query for target " constexpr const char *kErrorInvalidQueryId = "Invalid query Id.";
"GL_TIME_ELAPSED_EXT when the number of views in the " constexpr const char *kErrorInvalidQueryTarget = "Invalid query target.";
"active draw framebuffer is greater than 1."); constexpr const char *kErrorInvalidQueryType = "Invalid query type.";
ERRMSG(MultisampleArrayExtensionRequired, "GL_ANGLE_texture_multisample_array not enabled."); constexpr const char *kErrorInvalidRange = "Invalid range.";
ERRMSG(MultisampleTextureExtensionOrES31Required, constexpr const char *kErrorInvalidRenderbufferInternalFormat =
"GL_ANGLE_texture_multisample or GLES 3.1 required."); "Invalid renderbuffer internalformat.";
ERRMSG(NameBeginsWithGL, "Attributes that begin with 'gl_' are not allowed."); constexpr const char *kErrorInvalidRenderbufferTarget = "Invalid renderbuffer target.";
ERRMSG(NegativeAttachments, "Negative number of attachments."); constexpr const char *kErrorInvalidRenderbufferTextureParameter =
ERRMSG(NegativeBufferSize, "Negative buffer size."); "Invalid parameter name for renderbuffer attachment.";
ERRMSG(NegativeCount, "Negative count."); constexpr const char *kErrorInvalidRenderbufferWidthHeight =
ERRMSG(NegativeHeightWidthDepth, "Cannot have negative height, width, or depth."); "Renderbuffer width and height cannot be negative and cannot exceed maximum texture size.";
ERRMSG(NegativeLength, "Negative length."); constexpr const char *kErrorInvalidSampleMaskNumber =
ERRMSG(NegativeMaxCount, "Negative maxcount."); "MaskNumber cannot be greater than or equal to the value of MAX_SAMPLE_MASK_WORDS.";
ERRMSG(NegativeOffset, "Negative offset."); constexpr const char *kErrorInvalidSampler = "Sampler is not valid";
ERRMSG(NegativePrimcount, "Primcount must be greater than or equal to zero."); constexpr const char *kErrorInvalidShaderName = "Shader object expected.";
ERRMSG(NegativeSize, "Cannot have negative height or width."); constexpr const char *kErrorInvalidShaderType = "Invalid shader type.";
ERRMSG(NegativeStart, "Cannot have negative start."); constexpr const char *kErrorInvalidShadingModel = "Invalid shading model.";
ERRMSG(NegativeStride, "Cannot have negative stride."); constexpr const char *kErrorInvalidSourceTexture = "Source texture is not a valid texture object.";
ERRMSG(NegativeXYZ, "x, y, or z cannot be negative."); constexpr const char *kErrorInvalidSourceTextureLevel = "Invalid source texture level.";
ERRMSG(NoActiveComputeShaderStage, "No active compute shader stage in this program."); constexpr const char *kErrorInvalidSourceTextureSize = "Invalid source texture height or width.";
ERRMSG(NoActiveGeometryShaderStage, "No active geometry shader stage in this program."); constexpr const char *kErrorInvalidStencil = "Invalid stencil.";
ERRMSG( constexpr const char *kErrorInvalidStencilBitMask = "Invalid stencil bit mask.";
NoActiveGraphicsShaderStage, constexpr const char *kErrorInvalidTarget = "Invalid target.";
"It is a undefined behaviour to render without vertex shader stage or fragment shader stage."); constexpr const char *kErrorInvalidTextureCombine = "Invalid texture combine mode.";
ERRMSG(NoActiveProgramWithComputeShader, "No active program for the compute shader stage."); constexpr const char *kErrorInvalidTextureCombineSrc = "Invalid texture combine source.";
ERRMSG(NonPositiveDrawTextureDimension, constexpr const char *kErrorInvalidTextureCombineOp = "Invalid texture combine operand.";
"Both width and height argument of drawn texture must be positive."); constexpr const char *kErrorInvalidTextureEnvMode = "Invalid texture environment mode.";
ERRMSG(NoSuchPath, "No such path object."); constexpr const char *kErrorInvalidTextureEnvParameter = "Invalid texture environment parameter.";
ERRMSG(NoTransformFeedbackOutputVariables, constexpr const char *kErrorInvalidTextureEnvScale = "Invalid texture environment scale.";
"The active program has specified no output variables to record."); constexpr const char *kErrorInvalidTextureEnvTarget = "Invalid texture environment target.";
ERRMSG(NoZeroDivisor, "At least one enabled attribute must have a divisor of zero."); constexpr const char *kErrorInvalidTextureFilterParam = "Texture filter not recognized.";
ERRMSG(NVFenceNotSupported, "GL_NV_fence is not supported"); constexpr const char *kErrorInvalidTextureName = "Not a valid texture object name.";
ERRMSG(ObjectNotGenerated, "Object cannot be used because it has not been generated."); constexpr const char *kErrorInvalidTextureRange =
ERRMSG(OffsetMustBeMultipleOfType, "Offset must be a multiple of the passed in datatype."); "Cannot be less than 0 or greater than maximum number of textures.";
ERRMSG(OffsetMustBeMultipleOfUint, constexpr const char *kErrorInvalidTextureTarget = "Invalid or unsupported texture target.";
"Offset must be a multiple of the size, in basic machine units, of uint"); constexpr const char *kErrorInvalidTextureWrap = "Texture wrap mode not recognized.";
ERRMSG(OutsideOfBounds, "Parameter outside of bounds."); constexpr const char *kErrorInvalidTimeout = "Invalid value for timeout.";
ERRMSG(ParamOverflow, "The provided parameters overflow with the provided buffer."); constexpr const char *kErrorInvalidTransformFeedbackAttribsCount =
ERRMSG(PixelDataNotNull, "Pixel data must be null."); "Count exeeds MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS.";
ERRMSG(PixelDataNull, "Pixel data cannot be null."); constexpr const char *kErrorInvalidType = "Invalid type.";
ERRMSG(PixelPackBufferBoundForTransformFeedback, constexpr const char *kErrorInvalidTypePureInt = "Invalid type = should be integer";
"It is undefined behavior to use a pixel pack buffer that is bound for transform feedback."); constexpr const char *kErrorInvalidUniformCount = "Only array uniforms may have count > 1.";
ERRMSG( constexpr const char *kErrorInvalidUniformLocation = "Invalid uniform location";
PixelUnpackBufferBoundForTransformFeedback, constexpr const char *kErrorInvalidUnpackAlignment = "Unpack alignment must be 1 = 2 = 4 = or 8.";
"It is undefined behavior to use a pixel unpack buffer that is bound for transform feedback."); constexpr const char *kErrorInvalidVertexArray = "Vertex array does not exist.";
ERRMSG(PointSizeArrayExtensionNotEnabled, "GL_OES_point_size_array not enabled."); constexpr const char *kErrorInvalidVertexAttrSize =
ERRMSG(ProgramDoesNotExist, "Program doesn't exist."); "Vertex attribute size must be 1 = 2 = 3 = or 4.";
ERRMSG(ProgramInterfaceMustBeProgramOutput, "programInterface must be set to GL_PROGRAM_OUTPUT."); constexpr const char *kErrorInvalidVertexPointerSize =
ERRMSG(ProgramNotBound, "A program must be bound."); "Size for built-in vertex attribute is outside allowed range.";
ERRMSG(ProgramNotLinked, "Program not linked."); constexpr const char *kErrorInvalidVertexPointerStride =
ERRMSG(QueryActive, "Query is active."); "Invalid stride for built-in vertex attribute.";
ERRMSG(QueryExtensionNotEnabled, "Query extension not enabled."); constexpr const char *kErrorInvalidVertexPointerType =
ERRMSG(ReadBufferNone, "Read buffer is GL_NONE."); "Invalid type for built-in vertex attribute.";
ERRMSG(RenderableInternalFormat, constexpr const char *kErrorInvalidWidth = "Invalid width.";
"SizedInternalformat must be color-renderable, depth-renderable, or stencil-renderable."); constexpr const char *kErrorInvalidWrapModeTexture = "Invalid wrap mode for texture type.";
ERRMSG(RenderbufferNotBound, "A renderbuffer must be bound."); constexpr const char *kErrorLevelNotZero = "Texture level must be zero.";
ERRMSG(ResourceMaxTextureSize, "Desired resource size is greater than max texture size."); constexpr const char *kErrorLightParameterOutOfRange = "Light parameter out of range.";
ERRMSG(SamplesZero, "Samples may not be zero."); constexpr const char *kErrorMaterialParameterOutOfRange = "Material parameter out of range.";
ERRMSG(SamplesOutOfRange, constexpr const char *kErrorMatrixStackOverflow = "Current matrix stack is full.";
"Samples must not be greater than maximum supported value for the format."); constexpr const char *kErrorMatrixStackUnderflow = "Current matrix stack has only a single matrix.";
ERRMSG(ShaderAttachmentHasShader, "Shader attachment already has a shader."); constexpr const char *kErrorMismatchedByteCountType = "Buffer size does not align with data type.";
ERRMSG(ShaderSourceInvalidCharacters, "Shader source contains invalid characters."); constexpr const char *kErrorMismatchedFormat = "Format must match internal format.";
ERRMSG(ShaderToDetachMustBeAttached, constexpr const char *kErrorMismatchedTargetAndFormat =
"Shader to be detached must be currently attached to the program."); "Invalid texture target and format combination.";
ERRMSG(SourceLevelNotDefined, "The source level of the source texture must be defined."); constexpr const char *kErrorMismatchedTypeAndFormat = "Invalid format and type combination.";
ERRMSG(SourceTextureTooSmall, "The specified dimensions are outside of the bounds of the texture."); constexpr const char *kErrorMismatchedVariableProgram =
ERRMSG(StencilReferenceMaskOrMismatch, "Variable is not part of the current program.";
"Stencil reference and mask values must be the same for front facing and back facing " constexpr const char *kErrorMissingReadAttachment = "Missing read attachment.";
"triangles."); constexpr const char *kErrorMissingTexture = "No Texture is bound to the specified target.";
ERRMSG(StrideMustBeMultipleOfType, "Stride must be a multiple of the passed in datatype."); constexpr const char *kErrorMustHaveElementArrayBinding = "Must have element array buffer bound.";
ERRMSG(TargetMustBeTexture2DMultisampleArrayOES, constexpr const char *kErrorMultiviewActive =
"Target must be TEXTURE_2D_MULTISAMPLE_ARRAY_OES."); "The number of views in the active draw framebuffer is greater than 1.";
ERRMSG(TextureNotBound, "A texture must be bound."); constexpr const char *kErrorMultiviewViewsTooLarge =
ERRMSG(TextureNotPow2, "The texture is a non-power-of-two texture."); "numViews cannot be greater than GL_MAX_VIEWS_ANGLE.";
ERRMSG(TextureTargetRequiresES31, "Texture target requires at least OpenGL ES 3.1."); constexpr const char *kErrorMultiviewViewsTooSmall = "numViews cannot be less than 1.";
ERRMSG(TextureTypeConflict, "Two textures of different types use the same sampler location."); constexpr const char *kErrorMultiviewNotAvailable = "ANGLE_multiview is not available.";
ERRMSG(TextureWidthOrHeightOutOfRange, constexpr const char *kErrorMultiviewMismatch =
"Width and height must be less than or equal to GL_MAX_TEXTURE_SIZE."); "The number of views in the active program and draw "
ERRMSG(TransformFeedbackBufferDoubleBound, "framebuffer does not match.";
"A transform feedback buffer that would be written to is also bound to a " constexpr const char *kErrorMultiviewTransformFeedback =
"non-transform-feedback target, which would cause undefined behavior."); "There is an active transform feedback object when "
ERRMSG(TransformFeedbackBufferTooSmall, "Not enough space in bound transform feedback buffers."); "the number of views in the active draw framebuffer "
ERRMSG(TransformFeedbackDoesNotExist, "Transform feedback object that does not exist."); "is greater than 1.";
ERRMSG(TypeMismatch, constexpr const char *kErrorMultiviewTimerQuery =
"Passed in texture target and format must match the one originally used to define the " "There is an active query for target "
"texture."); "GL_TIME_ELAPSED_EXT when the number of views in the "
ERRMSG(TypeNotUnsignedShortByte, "Only UNSIGNED_SHORT and UNSIGNED_BYTE types are supported."); "active draw framebuffer is greater than 1.";
ERRMSG(UniformBufferBoundForTransformFeedback, constexpr const char *kErrorMultisampleArrayExtensionRequired =
"It is undefined behavior to use an uniform buffer that is bound for transform feedback."); "GL_ANGLE_texture_multisample_array not enabled.";
ERRMSG(UniformBufferTooSmall, constexpr const char *kErrorMultisampleTextureExtensionOrES31Required =
"It is undefined behaviour to use a uniform buffer that is too small."); "GL_ANGLE_texture_multisample or GLES 3.1 required.";
ERRMSG(UniformBufferUnbound, constexpr const char *kErrorNameBeginsWithGL = "Attributes that begin with 'gl_' are not allowed.";
"It is undefined behaviour to have a used but unbound uniform buffer."); constexpr const char *kErrorNegativeAttachments = "Negative number of attachments.";
ERRMSG(UniformSizeMismatch, "Uniform size does not match uniform method."); constexpr const char *kErrorNegativeBufferSize = "Negative buffer size.";
ERRMSG(UnknownParameter, "Unknown parameter value."); constexpr const char *kErrorNegativeCount = "Negative count.";
ERRMSG(UnsizedInternalFormatUnsupported, constexpr const char *kErrorNegativeHeightWidthDepth =
"Internalformat is one of the unsupported unsized base internalformats."); "Cannot have negative height = width = or depth.";
ERRMSG(UnsupportedDrawModeForTransformFeedback, constexpr const char *kErrorNegativeLayer = "Negative layer.";
"The draw command is unsupported when transform feedback is active and not paused."); constexpr const char *kErrorNegativeLength = "Negative length.";
ERRMSG(VertexArrayNoBuffer, "An enabled vertex array has no buffer."); constexpr const char *kErrorNegativeMaxCount = "Negative maxcount.";
ERRMSG(VertexArrayNoBufferPointer, "An enabled vertex array has no buffer and no pointer."); constexpr const char *kErrorNegativeOffset = "Negative offset.";
ERRMSG(VertexBufferBoundForTransformFeedback, constexpr const char *kErrorNegativePrimcount = "Primcount must be greater than or equal to zero.";
"It is undefined behavior to use a vertex buffer that is bound for transform feedback."); constexpr const char *kErrorNegativeSize = "Cannot have negative height or width.";
ERRMSG(VertexShaderTypeMismatch, constexpr const char *kErrorNegativeStart = "Cannot have negative start.";
"Vertex shader input type does not match the type of the bound vertex attribute.") constexpr const char *kErrorNegativeStride = "Cannot have negative stride.";
ERRMSG(ViewportNegativeSize, "Viewport size cannot be negative."); constexpr const char *kErrorNegativeXYZ = "x = y = or z cannot be negative.";
ERRMSG(Webgl2NameLengthLimitExceeded, "Location lengths must not be greater than 1024 characters."); constexpr const char *kErrorNoActiveComputeShaderStage =
ERRMSG(WebglBindAttribLocationReservedPrefix, "No active compute shader stage in this program.";
"Attributes that begin with 'webgl_', or '_webgl_' are not allowed."); constexpr const char *kErrorNoActiveGeometryShaderStage =
ERRMSG(WebglNameLengthLimitExceeded, "No active geometry shader stage in this program.";
"Location name lengths must not be greater than 256 characters."); constexpr const char *kErrorNoActiveGraphicsShaderStage =
ERRMSG(ZeroBoundToTarget, "Zero is bound to target."); "It is a undefined behaviour to render without vertex shader stage or fragment shader stage.";
} constexpr const char *kErrorNoActiveProgramWithComputeShader =
#undef ERRMSG "No active program for the compute shader stage.";
constexpr const char *kErrorNonPositiveDrawTextureDimension =
"Both width and height argument of drawn texture must be positive.";
constexpr const char *kErrorNoSuchPath = "No such path object.";
constexpr const char *kErrorNoTransformFeedbackOutputVariables =
"The active program has specified no output variables to record.";
constexpr const char *kErrorNoZeroDivisor =
"At least one enabled attribute must have a divisor of zero.";
constexpr const char *kErrorNVFenceNotSupported = "GL_NV_fence is not supported";
constexpr const char *kErrorObjectNotGenerated =
"Object cannot be used because it has not been generated.";
constexpr const char *kErrorOffsetMustBeMultipleOfType =
"Offset must be a multiple of the passed in datatype.";
constexpr const char *kErrorOffsetMustBeMultipleOfUint =
"Offset must be a multiple of the size = in basic machine units = of uint";
constexpr const char *kErrorOffsetOverflow = "Offset overflows texture dimensions.";
constexpr const char *kErrorOutsideOfBounds = "Parameter outside of bounds.";
constexpr const char *kErrorParamOverflow =
"The provided parameters overflow with the provided buffer.";
constexpr const char *kErrorPixelDataNotNull = "Pixel data must be null.";
constexpr const char *kErrorPixelDataNull = "Pixel data cannot be null.";
constexpr const char *kErrorPixelPackBufferBoundForTransformFeedback =
"It is undefined behavior to use a pixel pack buffer that is bound for transform feedback.";
constexpr const char *kErrorPixelUnpackBufferBoundForTransformFeedback =
"It is undefined behavior to use a pixel unpack buffer that is bound for transform feedback.";
constexpr const char *kErrorPointSizeArrayExtensionNotEnabled =
"GL_OES_point_size_array not enabled.";
constexpr const char *kErrorProgramDoesNotExist = "Program doesn't exist.";
constexpr const char *kErrorProgramInterfaceMustBeProgramOutput =
"programInterface must be set to GL_PROGRAM_OUTPUT.";
constexpr const char *kErrorProgramNotBound = "A program must be bound.";
constexpr const char *kErrorProgramNotLinked = "Program not linked.";
constexpr const char *kErrorQueryActive = "Query is active.";
constexpr const char *kErrorQueryExtensionNotEnabled = "Query extension not enabled.";
constexpr const char *kErrorReadBufferNone = "Read buffer is GL_NONE.";
constexpr const char *kErrorReadBufferNotAttached = "Read buffer has no attachment.";
constexpr const char *kErrorRectangleTextureCompressed =
"Rectangle texture cannot have a compressed format.";
constexpr const char *kErrorRelativeOffsetTooLarge =
"relativeOffset cannot be greater than MAX_VERTEX_ATTRIB_RELATIVE_OFFSET.";
constexpr const char *kErrorRenderableInternalFormat =
"SizedInternalformat must be color-renderable = depth-renderable = or stencil-renderable.";
constexpr const char *kErrorRenderbufferNotBound = "A renderbuffer must be bound.";
constexpr const char *kErrorResourceMaxRenderbufferSize =
"Desired resource size is greater than max renderbuffer size.";
constexpr const char *kErrorResourceMaxTextureSize =
"Desired resource size is greater than max texture size.";
constexpr const char *kErrorSamplesZero = "Samples may not be zero.";
constexpr const char *kErrorSamplesOutOfRange =
"Samples must not be greater than maximum supported value for the format.";
constexpr const char *kErrorShaderAttachmentHasShader = "Shader attachment already has a shader.";
constexpr const char *kErrorShaderSourceInvalidCharacters =
"Shader source contains invalid characters.";
constexpr const char *kErrorShaderToDetachMustBeAttached =
"Shader to be detached must be currently attached to the program.";
constexpr const char *kErrorSourceLevelNotDefined =
"The source level of the source texture must be defined.";
constexpr const char *kErrorSourceTextureTooSmall =
"The specified dimensions are outside of the bounds of the texture.";
constexpr const char *kErrorStencilReferenceMaskOrMismatch =
"Stencil reference and mask values must be the same for front facing and back facing "
"triangles.";
constexpr const char *kErrorStrideMustBeMultipleOfType =
"Stride must be a multiple of the passed in datatype.";
constexpr const char *kErrorSyncMissing = "Sync object does not exist.";
constexpr const char *kErrorTargetMustBeTexture2DMultisampleArrayOES =
"Target must be TEXTURE_2D_MULTISAMPLE_ARRAY_OES.";
constexpr const char *kErrorTextureIsImmutable = "Texture is immutable.";
constexpr const char *kErrorTextureNotBound = "A texture must be bound.";
constexpr const char *kErrorTextureNotPow2 = "The texture is a non-power-of-two texture.";
constexpr const char *kErrorTextureSizeTooSmall =
"Texture dimensions must all be greater than zero.";
constexpr const char *kErrorTextureTargetRequiresES31 =
"Texture target requires at least OpenGL ES 3.1.";
constexpr const char *kErrorTextureTypeConflict =
"Two textures of different types use the same sampler location.";
constexpr const char *kErrorTextureWidthOrHeightOutOfRange =
"Width and height must be less than or equal to GL_MAX_TEXTURE_SIZE.";
constexpr const char *kErrorTransformFeedbackBufferDoubleBound =
"A transform feedback buffer that would be written to is also bound to a "
"non-transform-feedback target = which would cause undefined behavior.";
constexpr const char *kErrorTransformFeedbackBufferTooSmall =
"Not enough space in bound transform feedback buffers.";
constexpr const char *kErrorTransformFeedbackDoesNotExist =
"Transform feedback object that does not exist.";
constexpr const char *kErrorTransformFeedbackNotActive = "No Transform Feedback object is active.";
constexpr const char *kErrorTransformFeedbackNotPaused =
"The active Transform Feedback object is not paused.";
constexpr const char *kErrorTransformFeedbackPaused =
"The active Transform Feedback object is paused.";
constexpr const char *kErrorTransformFeedbackVaryingIndexOutOfRange =
"Index must be less than the transform feedback varying count in the program.";
constexpr const char *kErrorTypeMismatch =
"Passed in texture target and format must match the one originally used to define the "
"texture.";
constexpr const char *kErrorTypeNotUnsignedShortByte =
"Only UNSIGNED_SHORT and UNSIGNED_BYTE types are supported.";
constexpr const char *kErrorUniformBufferBoundForTransformFeedback =
"It is undefined behavior to use an uniform buffer that is bound for transform feedback.";
constexpr const char *kErrorUniformBufferTooSmall =
"It is undefined behaviour to use a uniform buffer that is too small.";
constexpr const char *kErrorUniformBufferUnbound =
"It is undefined behaviour to have a used but unbound uniform buffer.";
constexpr const char *kErrorUniformSizeMismatch = "Uniform size does not match uniform method.";
constexpr const char *kErrorUnknownParameter = "Unknown parameter value.";
constexpr const char *kErrorUnsizedInternalFormatUnsupported =
"Internalformat is one of the unsupported unsized base internalformats.";
constexpr const char *kErrorUnsupportedDrawModeForTransformFeedback =
"The draw command is unsupported when transform feedback is active and not paused.";
constexpr const char *kErrorVertexArrayNoBuffer = "An enabled vertex array has no buffer.";
constexpr const char *kErrorVertexArrayNoBufferPointer =
"An enabled vertex array has no buffer and no pointer.";
constexpr const char *kErrorVertexBufferBoundForTransformFeedback =
"It is undefined behavior to use a vertex buffer that is bound for transform feedback.";
constexpr const char *kErrorVertexShaderTypeMismatch =
"Vertex shader input type does not match the type of the bound vertex attribute.";
constexpr const char *kErrorViewportNegativeSize = "Viewport size cannot be negative.";
constexpr const char *kErrorWebgl2NameLengthLimitExceeded =
"Location lengths must not be greater than 1024 characters.";
constexpr const char *kErrorWebglBindAttribLocationReservedPrefix =
"Attributes that begin with 'webgl_' = or '_webgl_' are not allowed.";
constexpr const char *kErrorWebglNameLengthLimitExceeded =
"Location name lengths must not be greater than 256 characters.";
constexpr const char *kErrorZeroBoundToTarget = "Zero is bound to target.";
} // namespace gl
#endif // LIBANGLE_ERRORSTRINGS_H_ #endif // LIBANGLE_ERRORSTRINGS_H_
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -600,12 +600,12 @@ bool ValidateES3TexStorage3DParameters(Context *context, ...@@ -600,12 +600,12 @@ bool ValidateES3TexStorage3DParameters(Context *context,
// implementation format info for incomplete framebuffers. It seems like these queries are // implementation format info for incomplete framebuffers. It seems like these queries are
// incongruent with the other errors. // incongruent with the other errors.
// Inlined for speed. // Inlined for speed.
template <typename ErrorStream = InvalidFramebufferOperation> template <GLenum ErrorCode = GL_INVALID_FRAMEBUFFER_OPERATION>
ANGLE_INLINE bool ValidateFramebufferComplete(Context *context, Framebuffer *framebuffer) ANGLE_INLINE bool ValidateFramebufferComplete(Context *context, Framebuffer *framebuffer)
{ {
if (!framebuffer->isComplete(context)) if (!framebuffer->isComplete(context))
{ {
context->handleError(ErrorStream()); context->validationError(ErrorCode, kErrorFramebufferIncomplete);
return false; return false;
} }
......
...@@ -16,11 +16,11 @@ ...@@ -16,11 +16,11 @@
#include "libANGLE/queryutils.h" #include "libANGLE/queryutils.h"
#include "libANGLE/validationES.h" #include "libANGLE/validationES.h"
#define ANGLE_VALIDATE_IS_GLES1(context) \ #define ANGLE_VALIDATE_IS_GLES1(context) \
if (context->getClientMajorVersion() > 1) \ if (context->getClientMajorVersion() > 1) \
{ \ { \
ANGLE_VALIDATION_ERR(context, InvalidOperation(), GLES1Only); \ context->validationError(GL_INVALID_OPERATION, kErrorGLES1Only); \
return false; \ return false; \
} }
namespace gl namespace gl
...@@ -40,7 +40,7 @@ bool ValidateAlphaFuncCommon(Context *context, AlphaTestFunc func) ...@@ -40,7 +40,7 @@ bool ValidateAlphaFuncCommon(Context *context, AlphaTestFunc func)
case AlphaTestFunc::NotEqual: case AlphaTestFunc::NotEqual:
return true; return true;
default: default:
ANGLE_VALIDATION_ERR(context, InvalidEnum(), EnumNotSupported); context->validationError(GL_INVALID_ENUM, kErrorEnumNotSupported);
return false; return false;
} }
} }
...@@ -58,12 +58,12 @@ bool ValidateClientStateCommon(Context *context, ClientVertexArrayType arrayType ...@@ -58,12 +58,12 @@ bool ValidateClientStateCommon(Context *context, ClientVertexArrayType arrayType
case ClientVertexArrayType::PointSize: case ClientVertexArrayType::PointSize:
if (!context->getExtensions().pointSizeArray) if (!context->getExtensions().pointSizeArray)
{ {
ANGLE_VALIDATION_ERR(context, InvalidEnum(), PointSizeArrayExtensionNotEnabled); context->validationError(GL_INVALID_ENUM, kErrorPointSizeArrayExtensionNotEnabled);
return false; return false;
} }
return true; return true;
default: default:
ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidClientState); context->validationError(GL_INVALID_ENUM, kErrorInvalidClientState);
return false; return false;
} }
} }
...@@ -79,7 +79,7 @@ bool ValidateBuiltinVertexAttributeCommon(Context *context, ...@@ -79,7 +79,7 @@ bool ValidateBuiltinVertexAttributeCommon(Context *context,
if (stride < 0) if (stride < 0)
{ {
ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidVertexPointerStride); context->validationError(GL_INVALID_VALUE, kErrorInvalidVertexPointerStride);
return false; return false;
} }
...@@ -104,7 +104,7 @@ bool ValidateBuiltinVertexAttributeCommon(Context *context, ...@@ -104,7 +104,7 @@ bool ValidateBuiltinVertexAttributeCommon(Context *context,
case ClientVertexArrayType::PointSize: case ClientVertexArrayType::PointSize:
if (!context->getExtensions().pointSizeArray) if (!context->getExtensions().pointSizeArray)
{ {
ANGLE_VALIDATION_ERR(context, InvalidEnum(), PointSizeArrayExtensionNotEnabled); context->validationError(GL_INVALID_ENUM, kErrorPointSizeArrayExtensionNotEnabled);
return false; return false;
} }
...@@ -118,7 +118,7 @@ bool ValidateBuiltinVertexAttributeCommon(Context *context, ...@@ -118,7 +118,7 @@ bool ValidateBuiltinVertexAttributeCommon(Context *context,
if (size < minSize || size > maxSize) if (size < minSize || size > maxSize)
{ {
ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidVertexPointerSize); context->validationError(GL_INVALID_VALUE, kErrorInvalidVertexPointerSize);
return false; return false;
} }
...@@ -127,7 +127,7 @@ bool ValidateBuiltinVertexAttributeCommon(Context *context, ...@@ -127,7 +127,7 @@ bool ValidateBuiltinVertexAttributeCommon(Context *context,
case GL_BYTE: case GL_BYTE:
if (arrayType == ClientVertexArrayType::PointSize) if (arrayType == ClientVertexArrayType::PointSize)
{ {
ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidVertexPointerType); context->validationError(GL_INVALID_ENUM, kErrorInvalidVertexPointerType);
return false; return false;
} }
break; break;
...@@ -135,7 +135,7 @@ bool ValidateBuiltinVertexAttributeCommon(Context *context, ...@@ -135,7 +135,7 @@ bool ValidateBuiltinVertexAttributeCommon(Context *context,
if (arrayType == ClientVertexArrayType::PointSize || if (arrayType == ClientVertexArrayType::PointSize ||
arrayType == ClientVertexArrayType::Color) arrayType == ClientVertexArrayType::Color)
{ {
ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidVertexPointerType); context->validationError(GL_INVALID_ENUM, kErrorInvalidVertexPointerType);
return false; return false;
} }
break; break;
...@@ -143,7 +143,7 @@ bool ValidateBuiltinVertexAttributeCommon(Context *context, ...@@ -143,7 +143,7 @@ bool ValidateBuiltinVertexAttributeCommon(Context *context,
case GL_FLOAT: case GL_FLOAT:
break; break;
default: default:
ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidVertexPointerType); context->validationError(GL_INVALID_ENUM, kErrorInvalidVertexPointerType);
return false; return false;
} }
...@@ -154,7 +154,7 @@ bool ValidateLightCaps(Context *context, GLenum light) ...@@ -154,7 +154,7 @@ bool ValidateLightCaps(Context *context, GLenum light)
{ {
if (light < GL_LIGHT0 || light >= GL_LIGHT0 + context->getCaps().maxLights) if (light < GL_LIGHT0 || light >= GL_LIGHT0 + context->getCaps().maxLights)
{ {
ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidLight); context->validationError(GL_INVALID_ENUM, kErrorInvalidLight);
return false; return false;
} }
...@@ -185,7 +185,7 @@ bool ValidateLightCommon(Context *context, ...@@ -185,7 +185,7 @@ bool ValidateLightCommon(Context *context,
case LightParameter::SpotExponent: case LightParameter::SpotExponent:
if (params[0] < 0.0f || params[0] > 128.0f) if (params[0] < 0.0f || params[0] > 128.0f)
{ {
ANGLE_VALIDATION_ERR(context, InvalidValue(), LightParameterOutOfRange); context->validationError(GL_INVALID_VALUE, kErrorLightParameterOutOfRange);
return false; return false;
} }
return true; return true;
...@@ -196,7 +196,7 @@ bool ValidateLightCommon(Context *context, ...@@ -196,7 +196,7 @@ bool ValidateLightCommon(Context *context,
} }
if (params[0] < 0.0f || params[0] > 90.0f) if (params[0] < 0.0f || params[0] > 90.0f)
{ {
ANGLE_VALIDATION_ERR(context, InvalidValue(), LightParameterOutOfRange); context->validationError(GL_INVALID_VALUE, kErrorLightParameterOutOfRange);
return false; return false;
} }
return true; return true;
...@@ -205,12 +205,12 @@ bool ValidateLightCommon(Context *context, ...@@ -205,12 +205,12 @@ bool ValidateLightCommon(Context *context,
case LightParameter::QuadraticAttenuation: case LightParameter::QuadraticAttenuation:
if (params[0] < 0.0f) if (params[0] < 0.0f)
{ {
ANGLE_VALIDATION_ERR(context, InvalidValue(), LightParameterOutOfRange); context->validationError(GL_INVALID_VALUE, kErrorLightParameterOutOfRange);
return false; return false;
} }
return true; return true;
default: default:
ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidLightParameter); context->validationError(GL_INVALID_ENUM, kErrorInvalidLightParameter);
return false; return false;
} }
} }
...@@ -227,7 +227,7 @@ bool ValidateLightSingleComponent(Context *context, ...@@ -227,7 +227,7 @@ bool ValidateLightSingleComponent(Context *context,
if (GetLightParameterCount(pname) > 1) if (GetLightParameterCount(pname) > 1)
{ {
ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidLightParameter); context->validationError(GL_INVALID_ENUM, kErrorInvalidLightParameter);
return false; return false;
} }
...@@ -249,12 +249,12 @@ bool ValidateMaterialCommon(Context *context, ...@@ -249,12 +249,12 @@ bool ValidateMaterialCommon(Context *context,
case MaterialParameter::Shininess: case MaterialParameter::Shininess:
if (params[0] < 0.0f || params[0] > 128.0f) if (params[0] < 0.0f || params[0] > 128.0f)
{ {
ANGLE_VALIDATION_ERR(context, InvalidValue(), MaterialParameterOutOfRange); context->validationError(GL_INVALID_VALUE, kErrorMaterialParameterOutOfRange);
return false; return false;
} }
return true; return true;
default: default:
ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidMaterialParameter); context->validationError(GL_INVALID_ENUM, kErrorInvalidMaterialParameter);
return false; return false;
} }
} }
...@@ -268,7 +268,7 @@ bool ValidateMaterialSetting(Context *context, ...@@ -268,7 +268,7 @@ bool ValidateMaterialSetting(Context *context,
if (face != GL_FRONT_AND_BACK) if (face != GL_FRONT_AND_BACK)
{ {
ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidMaterialFace); context->validationError(GL_INVALID_ENUM, kErrorInvalidMaterialFace);
return false; return false;
} }
...@@ -281,7 +281,7 @@ bool ValidateMaterialQuery(Context *context, GLenum face, MaterialParameter pnam ...@@ -281,7 +281,7 @@ bool ValidateMaterialQuery(Context *context, GLenum face, MaterialParameter pnam
if (face != GL_FRONT && face != GL_BACK) if (face != GL_FRONT && face != GL_BACK)
{ {
ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidMaterialFace); context->validationError(GL_INVALID_ENUM, kErrorInvalidMaterialFace);
return false; return false;
} }
...@@ -302,7 +302,7 @@ bool ValidateMaterialSingleComponent(Context *context, ...@@ -302,7 +302,7 @@ bool ValidateMaterialSingleComponent(Context *context,
if (GetMaterialParameterCount(pname) > 1) if (GetMaterialParameterCount(pname) > 1)
{ {
ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidMaterialParameter); context->validationError(GL_INVALID_ENUM, kErrorInvalidMaterialParameter);
return false; return false;
} }
...@@ -318,7 +318,7 @@ bool ValidateLightModelCommon(Context *context, GLenum pname) ...@@ -318,7 +318,7 @@ bool ValidateLightModelCommon(Context *context, GLenum pname)
case GL_LIGHT_MODEL_TWO_SIDE: case GL_LIGHT_MODEL_TWO_SIDE:
return true; return true;
default: default:
ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidLightModelParameter); context->validationError(GL_INVALID_ENUM, kErrorInvalidLightModelParameter);
return false; return false;
} }
} }
...@@ -335,7 +335,7 @@ bool ValidateLightModelSingleComponent(Context *context, GLenum pname) ...@@ -335,7 +335,7 @@ bool ValidateLightModelSingleComponent(Context *context, GLenum pname)
case GL_LIGHT_MODEL_TWO_SIDE: case GL_LIGHT_MODEL_TWO_SIDE:
return true; return true;
default: default:
ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidLightModelParameter); context->validationError(GL_INVALID_ENUM, kErrorInvalidLightModelParameter);
return false; return false;
} }
} }
...@@ -346,7 +346,7 @@ bool ValidateClipPlaneCommon(Context *context, GLenum plane) ...@@ -346,7 +346,7 @@ bool ValidateClipPlaneCommon(Context *context, GLenum plane)
if (plane < GL_CLIP_PLANE0 || plane >= GL_CLIP_PLANE0 + context->getCaps().maxClipPlanes) if (plane < GL_CLIP_PLANE0 || plane >= GL_CLIP_PLANE0 + context->getCaps().maxClipPlanes)
{ {
ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidClipPlane); context->validationError(GL_INVALID_ENUM, kErrorInvalidClipPlane);
return false; return false;
} }
...@@ -369,7 +369,7 @@ bool ValidateFogCommon(Context *context, GLenum pname, const GLfloat *params) ...@@ -369,7 +369,7 @@ bool ValidateFogCommon(Context *context, GLenum pname, const GLfloat *params)
case GL_LINEAR: case GL_LINEAR:
return true; return true;
default: default:
ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidFogMode); context->validationError(GL_INVALID_VALUE, kErrorInvalidFogMode);
return false; return false;
} }
} }
...@@ -381,12 +381,12 @@ bool ValidateFogCommon(Context *context, GLenum pname, const GLfloat *params) ...@@ -381,12 +381,12 @@ bool ValidateFogCommon(Context *context, GLenum pname, const GLfloat *params)
case GL_FOG_DENSITY: case GL_FOG_DENSITY:
if (params[0] < 0.0f) if (params[0] < 0.0f)
{ {
ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidFogDensity); context->validationError(GL_INVALID_VALUE, kErrorInvalidFogDensity);
return false; return false;
} }
break; break;
default: default:
ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidFogParameter); context->validationError(GL_INVALID_ENUM, kErrorInvalidFogParameter);
return false; return false;
} }
return true; return true;
...@@ -417,7 +417,7 @@ bool ValidateTexEnvCommon(Context *context, ...@@ -417,7 +417,7 @@ bool ValidateTexEnvCommon(Context *context,
case TextureEnvMode::Replace: case TextureEnvMode::Replace:
break; break;
default: default:
ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidTextureEnvMode); context->validationError(GL_INVALID_VALUE, kErrorInvalidTextureEnvMode);
return false; return false;
} }
break; break;
...@@ -439,13 +439,13 @@ bool ValidateTexEnvCommon(Context *context, ...@@ -439,13 +439,13 @@ bool ValidateTexEnvCommon(Context *context,
case TextureCombine::Dot3Rgba: case TextureCombine::Dot3Rgba:
if (pname == TextureEnvParameter::CombineAlpha) if (pname == TextureEnvParameter::CombineAlpha)
{ {
ANGLE_VALIDATION_ERR(context, InvalidValue(), context->validationError(GL_INVALID_VALUE,
InvalidTextureCombine); kErrorInvalidTextureCombine);
return false; return false;
} }
break; break;
default: default:
ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidTextureCombine); context->validationError(GL_INVALID_VALUE, kErrorInvalidTextureCombine);
return false; return false;
} }
break; break;
...@@ -466,7 +466,8 @@ bool ValidateTexEnvCommon(Context *context, ...@@ -466,7 +466,8 @@ bool ValidateTexEnvCommon(Context *context,
case TextureSrc::Texture: case TextureSrc::Texture:
break; break;
default: default:
ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidTextureCombineSrc); context->validationError(GL_INVALID_VALUE,
kErrorInvalidTextureCombineSrc);
return false; return false;
} }
break; break;
...@@ -490,13 +491,14 @@ bool ValidateTexEnvCommon(Context *context, ...@@ -490,13 +491,14 @@ bool ValidateTexEnvCommon(Context *context,
pname == TextureEnvParameter::Op1Alpha || pname == TextureEnvParameter::Op1Alpha ||
pname == TextureEnvParameter::Op2Alpha) pname == TextureEnvParameter::Op2Alpha)
{ {
ANGLE_VALIDATION_ERR(context, InvalidValue(), context->validationError(GL_INVALID_VALUE,
InvalidTextureCombine); kErrorInvalidTextureCombine);
return false; return false;
} }
break; break;
default: default:
ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidTextureCombineOp); context->validationError(GL_INVALID_VALUE,
kErrorInvalidTextureCombineOp);
return false; return false;
} }
break; break;
...@@ -505,21 +507,21 @@ bool ValidateTexEnvCommon(Context *context, ...@@ -505,21 +507,21 @@ bool ValidateTexEnvCommon(Context *context,
case TextureEnvParameter::AlphaScale: case TextureEnvParameter::AlphaScale:
if (params[0] != 1.0f && params[0] != 2.0f && params[0] != 4.0f) if (params[0] != 1.0f && params[0] != 2.0f && params[0] != 4.0f)
{ {
ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidTextureEnvScale); context->validationError(GL_INVALID_VALUE, kErrorInvalidTextureEnvScale);
return false; return false;
} }
break; break;
case TextureEnvParameter::Color: case TextureEnvParameter::Color:
break; break;
default: default:
ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidTextureEnvParameter); context->validationError(GL_INVALID_ENUM, kErrorInvalidTextureEnvParameter);
return false; return false;
} }
break; break;
case TextureEnvTarget::PointSprite: case TextureEnvTarget::PointSprite:
if (!context->getExtensions().pointSprite) if (!context->getExtensions().pointSprite)
{ {
ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidTextureEnvTarget); context->validationError(GL_INVALID_ENUM, kErrorInvalidTextureEnvTarget);
return false; return false;
} }
switch (pname) switch (pname)
...@@ -527,12 +529,12 @@ bool ValidateTexEnvCommon(Context *context, ...@@ -527,12 +529,12 @@ bool ValidateTexEnvCommon(Context *context,
case TextureEnvParameter::PointCoordReplace: case TextureEnvParameter::PointCoordReplace:
break; break;
default: default:
ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidTextureEnvParameter); context->validationError(GL_INVALID_ENUM, kErrorInvalidTextureEnvParameter);
return false; return false;
} }
break; break;
default: default:
ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidTextureEnvTarget); context->validationError(GL_INVALID_ENUM, kErrorInvalidTextureEnvTarget);
return false; return false;
} }
return true; return true;
...@@ -592,13 +594,13 @@ bool ValidatePointParameterCommon(Context *context, PointParameter pname, const ...@@ -592,13 +594,13 @@ bool ValidatePointParameterCommon(Context *context, PointParameter pname, const
{ {
if (params[i] < 0.0f) if (params[i] < 0.0f)
{ {
ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidPointParameterValue); context->validationError(GL_INVALID_VALUE, kErrorInvalidPointParameterValue);
return false; return false;
} }
} }
break; break;
default: default:
ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidPointParameter); context->validationError(GL_INVALID_ENUM, kErrorInvalidPointParameter);
return false; return false;
} }
...@@ -611,7 +613,7 @@ bool ValidatePointSizeCommon(Context *context, GLfloat size) ...@@ -611,7 +613,7 @@ bool ValidatePointSizeCommon(Context *context, GLfloat size)
if (size <= 0.0f) if (size <= 0.0f)
{ {
ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidPointSizeValue); context->validationError(GL_INVALID_VALUE, kErrorInvalidPointSizeValue);
return false; return false;
} }
...@@ -624,7 +626,7 @@ bool ValidateDrawTexCommon(Context *context, float width, float height) ...@@ -624,7 +626,7 @@ bool ValidateDrawTexCommon(Context *context, float width, float height)
if (width <= 0.0f || height <= 0.0f) if (width <= 0.0f || height <= 0.0f)
{ {
ANGLE_VALIDATION_ERR(context, InvalidValue(), NonPositiveDrawTextureDimension); context->validationError(GL_INVALID_VALUE, kErrorNonPositiveDrawTextureDimension);
return false; return false;
} }
...@@ -766,7 +768,7 @@ bool ValidateFrustumf(Context *context, ...@@ -766,7 +768,7 @@ bool ValidateFrustumf(Context *context,
ANGLE_VALIDATE_IS_GLES1(context); ANGLE_VALIDATE_IS_GLES1(context);
if (l == r || b == t || n == f || n <= 0.0f || f <= 0.0f) if (l == r || b == t || n == f || n <= 0.0f || f <= 0.0f)
{ {
ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidProjectionMatrix); context->validationError(GL_INVALID_VALUE, kErrorInvalidProjectionMatrix);
} }
return true; return true;
} }
...@@ -782,7 +784,7 @@ bool ValidateFrustumx(Context *context, ...@@ -782,7 +784,7 @@ bool ValidateFrustumx(Context *context,
ANGLE_VALIDATE_IS_GLES1(context); ANGLE_VALIDATE_IS_GLES1(context);
if (l == r || b == t || n == f || n <= 0 || f <= 0) if (l == r || b == t || n == f || n <= 0 || f <= 0)
{ {
ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidProjectionMatrix); context->validationError(GL_INVALID_VALUE, kErrorInvalidProjectionMatrix);
} }
return true; return true;
} }
...@@ -843,7 +845,7 @@ bool ValidateGetPointerv(Context *context, GLenum pname, void **params) ...@@ -843,7 +845,7 @@ bool ValidateGetPointerv(Context *context, GLenum pname, void **params)
case GL_POINT_SIZE_ARRAY_POINTER_OES: case GL_POINT_SIZE_ARRAY_POINTER_OES:
return true; return true;
default: default:
ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidPointerQuery); context->validationError(GL_INVALID_ENUM, kErrorInvalidPointerQuery);
return false; return false;
} }
} }
...@@ -977,7 +979,7 @@ bool ValidateLogicOp(Context *context, LogicalOperation opcode) ...@@ -977,7 +979,7 @@ bool ValidateLogicOp(Context *context, LogicalOperation opcode)
case LogicalOperation::Xor: case LogicalOperation::Xor:
return true; return true;
default: default:
ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidLogicOp); context->validationError(GL_INVALID_ENUM, kErrorInvalidLogicOp);
return false; return false;
} }
} }
...@@ -1025,7 +1027,7 @@ bool ValidateMatrixMode(Context *context, MatrixType mode) ...@@ -1025,7 +1027,7 @@ bool ValidateMatrixMode(Context *context, MatrixType mode)
case MatrixType::Texture: case MatrixType::Texture:
return true; return true;
default: default:
ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidMatrixMode); context->validationError(GL_INVALID_ENUM, kErrorInvalidMatrixMode);
return false; return false;
} }
} }
...@@ -1093,7 +1095,7 @@ bool ValidateOrthof(Context *context, ...@@ -1093,7 +1095,7 @@ bool ValidateOrthof(Context *context,
ANGLE_VALIDATE_IS_GLES1(context); ANGLE_VALIDATE_IS_GLES1(context);
if (l == r || b == t || n == f || n <= 0.0f || f <= 0.0f) if (l == r || b == t || n == f || n <= 0.0f || f <= 0.0f)
{ {
ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidProjectionMatrix); context->validationError(GL_INVALID_VALUE, kErrorInvalidProjectionMatrix);
} }
return true; return true;
} }
...@@ -1109,7 +1111,7 @@ bool ValidateOrthox(Context *context, ...@@ -1109,7 +1111,7 @@ bool ValidateOrthox(Context *context,
ANGLE_VALIDATE_IS_GLES1(context); ANGLE_VALIDATE_IS_GLES1(context);
if (l == r || b == t || n == f || n <= 0 || f <= 0) if (l == r || b == t || n == f || n <= 0 || f <= 0)
{ {
ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidProjectionMatrix); context->validationError(GL_INVALID_VALUE, kErrorInvalidProjectionMatrix);
} }
return true; return true;
} }
...@@ -1119,7 +1121,7 @@ bool ValidatePointParameterf(Context *context, PointParameter pname, GLfloat par ...@@ -1119,7 +1121,7 @@ bool ValidatePointParameterf(Context *context, PointParameter pname, GLfloat par
unsigned int paramCount = GetPointParameterCount(pname); unsigned int paramCount = GetPointParameterCount(pname);
if (paramCount != 1) if (paramCount != 1)
{ {
ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidPointParameter); context->validationError(GL_INVALID_ENUM, kErrorInvalidPointParameter);
return false; return false;
} }
...@@ -1136,7 +1138,7 @@ bool ValidatePointParameterx(Context *context, PointParameter pname, GLfixed par ...@@ -1136,7 +1138,7 @@ bool ValidatePointParameterx(Context *context, PointParameter pname, GLfixed par
unsigned int paramCount = GetPointParameterCount(pname); unsigned int paramCount = GetPointParameterCount(pname);
if (paramCount != 1) if (paramCount != 1)
{ {
ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidPointParameter); context->validationError(GL_INVALID_ENUM, kErrorInvalidPointParameter);
return false; return false;
} }
...@@ -1176,7 +1178,7 @@ bool ValidatePopMatrix(Context *context) ...@@ -1176,7 +1178,7 @@ bool ValidatePopMatrix(Context *context)
const auto &stack = context->getGLState().gles1().currentMatrixStack(); const auto &stack = context->getGLState().gles1().currentMatrixStack();
if (stack.size() == 1) if (stack.size() == 1)
{ {
ANGLE_VALIDATION_ERR(context, StackUnderflow(), MatrixStackUnderflow); context->validationError(GL_STACK_UNDERFLOW, kErrorMatrixStackUnderflow);
return false; return false;
} }
return true; return true;
...@@ -1188,7 +1190,7 @@ bool ValidatePushMatrix(Context *context) ...@@ -1188,7 +1190,7 @@ bool ValidatePushMatrix(Context *context)
const auto &stack = context->getGLState().gles1().currentMatrixStack(); const auto &stack = context->getGLState().gles1().currentMatrixStack();
if (stack.size() == stack.max_size()) if (stack.size() == stack.max_size())
{ {
ANGLE_VALIDATION_ERR(context, StackOverflow(), MatrixStackOverflow); context->validationError(GL_STACK_OVERFLOW, kErrorMatrixStackOverflow);
return false; return false;
} }
return true; return true;
...@@ -1233,7 +1235,7 @@ bool ValidateShadeModel(Context *context, ShadingModel mode) ...@@ -1233,7 +1235,7 @@ bool ValidateShadeModel(Context *context, ShadingModel mode)
case ShadingModel::Smooth: case ShadingModel::Smooth:
return true; return true;
default: default:
ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidShadingModel); context->validationError(GL_INVALID_ENUM, kErrorInvalidShadingModel);
return false; return false;
} }
} }
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -304,7 +304,7 @@ bool ValidateProgramUniform(Context *context, ...@@ -304,7 +304,7 @@ bool ValidateProgramUniform(Context *context,
// Check for ES31 program uniform entry points // Check for ES31 program uniform entry points
if (context->getClientVersion() < Version(3, 1)) if (context->getClientVersion() < Version(3, 1))
{ {
ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES31Required); context->validationError(GL_INVALID_OPERATION, kErrorES31Required);
return false; return false;
} }
...@@ -324,7 +324,7 @@ bool ValidateProgramUniformMatrix(Context *context, ...@@ -324,7 +324,7 @@ bool ValidateProgramUniformMatrix(Context *context,
// Check for ES31 program uniform entry points // Check for ES31 program uniform entry points
if (context->getClientVersion() < Version(3, 1)) if (context->getClientVersion() < Version(3, 1))
{ {
ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES31Required); context->validationError(GL_INVALID_OPERATION, kErrorES31Required);
return false; return false;
} }
...@@ -343,16 +343,14 @@ bool ValidateVertexAttribFormatCommon(Context *context, ...@@ -343,16 +343,14 @@ bool ValidateVertexAttribFormatCommon(Context *context,
{ {
if (context->getClientVersion() < ES_3_1) if (context->getClientVersion() < ES_3_1)
{ {
ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES31Required); context->validationError(GL_INVALID_OPERATION, kErrorES31Required);
return false; return false;
} }
const Caps &caps = context->getCaps(); const Caps &caps = context->getCaps();
if (relativeOffset > static_cast<GLuint>(caps.maxVertexAttribRelativeOffset)) if (relativeOffset > static_cast<GLuint>(caps.maxVertexAttribRelativeOffset))
{ {
context->handleError( context->validationError(GL_INVALID_VALUE, kErrorRelativeOffsetTooLarge);
InvalidValue()
<< "relativeOffset cannot be greater than MAX_VERTEX_ATTRIB_RELATIVE_OFFSET.");
return false; return false;
} }
...@@ -360,7 +358,7 @@ bool ValidateVertexAttribFormatCommon(Context *context, ...@@ -360,7 +358,7 @@ bool ValidateVertexAttribFormatCommon(Context *context,
// An INVALID_OPERATION error is generated if the default vertex array object is bound. // An INVALID_OPERATION error is generated if the default vertex array object is bound.
if (context->getGLState().getVertexArrayId() == 0) if (context->getGLState().getVertexArrayId() == 0)
{ {
context->handleError(InvalidOperation() << "Default vertex array object is bound."); context->validationError(GL_INVALID_OPERATION, kErrorDefaultVertexArray);
return false; return false;
} }
...@@ -373,7 +371,7 @@ bool ValidateGetBooleani_v(Context *context, GLenum target, GLuint index, GLbool ...@@ -373,7 +371,7 @@ bool ValidateGetBooleani_v(Context *context, GLenum target, GLuint index, GLbool
{ {
if (context->getClientVersion() < ES_3_1) if (context->getClientVersion() < ES_3_1)
{ {
ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES31Required); context->validationError(GL_INVALID_OPERATION, kErrorES31Required);
return false; return false;
} }
...@@ -394,7 +392,7 @@ bool ValidateGetBooleani_vRobustANGLE(Context *context, ...@@ -394,7 +392,7 @@ bool ValidateGetBooleani_vRobustANGLE(Context *context,
{ {
if (context->getClientVersion() < ES_3_1) if (context->getClientVersion() < ES_3_1)
{ {
ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES31Required); context->validationError(GL_INVALID_OPERATION, kErrorES31Required);
return false; return false;
} }
...@@ -423,7 +421,7 @@ bool ValidateDrawIndirectBase(Context *context, PrimitiveMode mode, const void * ...@@ -423,7 +421,7 @@ bool ValidateDrawIndirectBase(Context *context, PrimitiveMode mode, const void *
{ {
if (context->getClientVersion() < ES_3_1) if (context->getClientVersion() < ES_3_1)
{ {
ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES31Required); context->validationError(GL_INVALID_OPERATION, kErrorES31Required);
return false; return false;
} }
...@@ -439,14 +437,14 @@ bool ValidateDrawIndirectBase(Context *context, PrimitiveMode mode, const void * ...@@ -439,14 +437,14 @@ bool ValidateDrawIndirectBase(Context *context, PrimitiveMode mode, const void *
// DRAW_INDIRECT_BUFFER or to any enabled vertex array. // DRAW_INDIRECT_BUFFER or to any enabled vertex array.
if (!state.getVertexArrayId()) if (!state.getVertexArrayId())
{ {
context->handleError(InvalidOperation() << "zero is bound to VERTEX_ARRAY_BINDING"); context->validationError(GL_INVALID_OPERATION, kErrorDefaultVertexArray);
return false; return false;
} }
Buffer *drawIndirectBuffer = state.getTargetBuffer(BufferBinding::DrawIndirect); Buffer *drawIndirectBuffer = state.getTargetBuffer(BufferBinding::DrawIndirect);
if (!drawIndirectBuffer) if (!drawIndirectBuffer)
{ {
context->handleError(InvalidOperation() << "zero is bound to DRAW_INDIRECT_BUFFER"); context->validationError(GL_INVALID_OPERATION, kErrorDrawIndirectBufferNotBound);
return false; return false;
} }
...@@ -455,9 +453,7 @@ bool ValidateDrawIndirectBase(Context *context, PrimitiveMode mode, const void * ...@@ -455,9 +453,7 @@ bool ValidateDrawIndirectBase(Context *context, PrimitiveMode mode, const void *
GLint64 offset = reinterpret_cast<GLint64>(indirect); GLint64 offset = reinterpret_cast<GLint64>(indirect);
if ((static_cast<GLuint>(offset) % sizeof(GLuint)) != 0) if ((static_cast<GLuint>(offset) % sizeof(GLuint)) != 0)
{ {
context->handleError( context->validationError(GL_INVALID_VALUE, kErrorInvalidIndirectOffset);
InvalidValue()
<< "indirect is not a multiple of the size, in basic machine units, of uint");
return false; return false;
} }
...@@ -468,9 +464,7 @@ bool ValidateDrawIndirectBase(Context *context, PrimitiveMode mode, const void * ...@@ -468,9 +464,7 @@ bool ValidateDrawIndirectBase(Context *context, PrimitiveMode mode, const void *
ASSERT(drawFramebuffer != nullptr); ASSERT(drawFramebuffer != nullptr);
if (drawFramebuffer->getNumViews() > 1) if (drawFramebuffer->getNumViews() > 1)
{ {
context->handleError( context->validationError(GL_INVALID_OPERATION, kErrorMultiviewActive);
InvalidOperation()
<< "The number of views in the active draw framebuffer is greater than 1.");
return false; return false;
} }
...@@ -491,7 +485,8 @@ bool ValidateDrawArraysIndirect(Context *context, PrimitiveMode mode, const void ...@@ -491,7 +485,8 @@ bool ValidateDrawArraysIndirect(Context *context, PrimitiveMode mode, const void
if (!ValidateTransformFeedbackPrimitiveMode( if (!ValidateTransformFeedbackPrimitiveMode(
context, curTransformFeedback->getPrimitiveMode(), mode)) context, curTransformFeedback->getPrimitiveMode(), mode))
{ {
ANGLE_VALIDATION_ERR(context, InvalidOperation(), InvalidDrawModeTransformFeedback); context->validationError(GL_INVALID_OPERATION,
kErrorInvalidDrawModeTransformFeedback);
return false; return false;
} }
} }
...@@ -499,8 +494,8 @@ bool ValidateDrawArraysIndirect(Context *context, PrimitiveMode mode, const void ...@@ -499,8 +494,8 @@ bool ValidateDrawArraysIndirect(Context *context, PrimitiveMode mode, const void
{ {
// An INVALID_OPERATION error is generated if transform feedback is active and not // An INVALID_OPERATION error is generated if transform feedback is active and not
// paused. // paused.
ANGLE_VALIDATION_ERR(context, InvalidOperation(), context->validationError(GL_INVALID_OPERATION,
UnsupportedDrawModeForTransformFeedback); kErrorUnsupportedDrawModeForTransformFeedback);
return false; return false;
} }
} }
...@@ -516,9 +511,7 @@ bool ValidateDrawArraysIndirect(Context *context, PrimitiveMode mode, const void ...@@ -516,9 +511,7 @@ bool ValidateDrawArraysIndirect(Context *context, PrimitiveMode mode, const void
if (!checkedSum.IsValid() || if (!checkedSum.IsValid() ||
checkedSum.ValueOrDie() > static_cast<size_t>(drawIndirectBuffer->getSize())) checkedSum.ValueOrDie() > static_cast<size_t>(drawIndirectBuffer->getSize()))
{ {
context->handleError( context->validationError(GL_INVALID_OPERATION, kErrorParamOverflow);
InvalidOperation()
<< "the command would source data beyond the end of the buffer object.");
return false; return false;
} }
...@@ -540,7 +533,7 @@ bool ValidateDrawElementsIndirect(Context *context, ...@@ -540,7 +533,7 @@ bool ValidateDrawElementsIndirect(Context *context,
Buffer *elementArrayBuffer = vao->getElementArrayBuffer(); Buffer *elementArrayBuffer = vao->getElementArrayBuffer();
if (!elementArrayBuffer) if (!elementArrayBuffer)
{ {
context->handleError(InvalidOperation() << "zero is bound to ELEMENT_ARRAY_BUFFER"); context->validationError(GL_INVALID_OPERATION, kErrorMustHaveElementArrayBinding);
return false; return false;
} }
...@@ -555,9 +548,9 @@ bool ValidateDrawElementsIndirect(Context *context, ...@@ -555,9 +548,9 @@ bool ValidateDrawElementsIndirect(Context *context,
if (!checkedSum.IsValid() || if (!checkedSum.IsValid() ||
checkedSum.ValueOrDie() > static_cast<size_t>(drawIndirectBuffer->getSize())) checkedSum.ValueOrDie() > static_cast<size_t>(drawIndirectBuffer->getSize()))
{ {
context->handleError( context->validationError(
InvalidOperation() GL_INVALID_OPERATION,
<< "the command would source data beyond the end of the buffer object."); "the command would source data beyond the end of the buffer object.");
return false; return false;
} }
...@@ -683,7 +676,7 @@ bool ValidateProgramUniform1iv(Context *context, ...@@ -683,7 +676,7 @@ bool ValidateProgramUniform1iv(Context *context,
// Check for ES31 program uniform entry points // Check for ES31 program uniform entry points
if (context->getClientVersion() < Version(3, 1)) if (context->getClientVersion() < Version(3, 1))
{ {
ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES31Required); context->validationError(GL_INVALID_OPERATION, kErrorES31Required);
return false; return false;
} }
...@@ -899,7 +892,7 @@ bool ValidateGetTexLevelParameterfv(Context *context, ...@@ -899,7 +892,7 @@ bool ValidateGetTexLevelParameterfv(Context *context,
{ {
if (context->getClientVersion() < ES_3_1) if (context->getClientVersion() < ES_3_1)
{ {
ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES31Required); context->validationError(GL_INVALID_OPERATION, kErrorES31Required);
return false; return false;
} }
...@@ -926,7 +919,7 @@ bool ValidateGetTexLevelParameteriv(Context *context, ...@@ -926,7 +919,7 @@ bool ValidateGetTexLevelParameteriv(Context *context,
{ {
if (context->getClientVersion() < ES_3_1) if (context->getClientVersion() < ES_3_1)
{ {
ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES31Required); context->validationError(GL_INVALID_OPERATION, kErrorES31Required);
return false; return false;
} }
...@@ -955,7 +948,7 @@ bool ValidateTexStorage2DMultisample(Context *context, ...@@ -955,7 +948,7 @@ bool ValidateTexStorage2DMultisample(Context *context,
{ {
if (context->getClientVersion() < ES_3_1) if (context->getClientVersion() < ES_3_1)
{ {
ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES31Required); context->validationError(GL_INVALID_OPERATION, kErrorES31Required);
return false; return false;
} }
...@@ -967,13 +960,13 @@ bool ValidateGetMultisamplefv(Context *context, GLenum pname, GLuint index, GLfl ...@@ -967,13 +960,13 @@ bool ValidateGetMultisamplefv(Context *context, GLenum pname, GLuint index, GLfl
{ {
if (context->getClientVersion() < ES_3_1) if (context->getClientVersion() < ES_3_1)
{ {
ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES31Required); context->validationError(GL_INVALID_OPERATION, kErrorES31Required);
return false; return false;
} }
if (pname != GL_SAMPLE_POSITION) if (pname != GL_SAMPLE_POSITION)
{ {
context->handleError(InvalidEnum() << "Pname must be SAMPLE_POSITION."); context->validationError(GL_INVALID_ENUM, kErrorInvalidPname);
return false; return false;
} }
...@@ -982,7 +975,7 @@ bool ValidateGetMultisamplefv(Context *context, GLenum pname, GLuint index, GLfl ...@@ -982,7 +975,7 @@ bool ValidateGetMultisamplefv(Context *context, GLenum pname, GLuint index, GLfl
if (index >= static_cast<GLuint>(samples)) if (index >= static_cast<GLuint>(samples))
{ {
context->handleError(InvalidValue() << "Index must be less than the value of SAMPLES."); context->validationError(GL_INVALID_VALUE, kErrorIndexExceedsSamples);
return false; return false;
} }
...@@ -1004,13 +997,13 @@ bool ValidateFramebufferParameteri(Context *context, GLenum target, GLenum pname ...@@ -1004,13 +997,13 @@ bool ValidateFramebufferParameteri(Context *context, GLenum target, GLenum pname
{ {
if (context->getClientVersion() < ES_3_1) if (context->getClientVersion() < ES_3_1)
{ {
ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES31Required); context->validationError(GL_INVALID_OPERATION, kErrorES31Required);
return false; return false;
} }
if (!ValidFramebufferTarget(context, target)) if (!ValidFramebufferTarget(context, target))
{ {
context->handleError(InvalidEnum() << "Invalid framebuffer target."); context->validationError(GL_INVALID_ENUM, kErrorInvalidFramebufferTarget);
return false; return false;
} }
...@@ -1021,9 +1014,9 @@ bool ValidateFramebufferParameteri(Context *context, GLenum target, GLenum pname ...@@ -1021,9 +1014,9 @@ bool ValidateFramebufferParameteri(Context *context, GLenum target, GLenum pname
GLint maxWidth = context->getCaps().maxFramebufferWidth; GLint maxWidth = context->getCaps().maxFramebufferWidth;
if (param < 0 || param > maxWidth) if (param < 0 || param > maxWidth)
{ {
context->handleError( context->validationError(
InvalidValue() GL_INVALID_VALUE,
<< "Params less than 0 or greater than GL_MAX_FRAMEBUFFER_WIDTH."); "Params less than 0 or greater than GL_MAX_FRAMEBUFFER_WIDTH.");
return false; return false;
} }
break; break;
...@@ -1033,9 +1026,9 @@ bool ValidateFramebufferParameteri(Context *context, GLenum target, GLenum pname ...@@ -1033,9 +1026,9 @@ bool ValidateFramebufferParameteri(Context *context, GLenum target, GLenum pname
GLint maxHeight = context->getCaps().maxFramebufferHeight; GLint maxHeight = context->getCaps().maxFramebufferHeight;
if (param < 0 || param > maxHeight) if (param < 0 || param > maxHeight)
{ {
context->handleError( context->validationError(
InvalidValue() GL_INVALID_VALUE,
<< "Params less than 0 or greater than GL_MAX_FRAMEBUFFER_HEIGHT."); "Params less than 0 or greater than GL_MAX_FRAMEBUFFER_HEIGHT.");
return false; return false;
} }
break; break;
...@@ -1045,9 +1038,9 @@ bool ValidateFramebufferParameteri(Context *context, GLenum target, GLenum pname ...@@ -1045,9 +1038,9 @@ bool ValidateFramebufferParameteri(Context *context, GLenum target, GLenum pname
GLint maxSamples = context->getCaps().maxFramebufferSamples; GLint maxSamples = context->getCaps().maxFramebufferSamples;
if (param < 0 || param > maxSamples) if (param < 0 || param > maxSamples)
{ {
context->handleError( context->validationError(
InvalidValue() GL_INVALID_VALUE,
<< "Params less than 0 or greater than GL_MAX_FRAMEBUFFER_SAMPLES."); "Params less than 0 or greater than GL_MAX_FRAMEBUFFER_SAMPLES.");
return false; return false;
} }
break; break;
...@@ -1060,20 +1053,20 @@ bool ValidateFramebufferParameteri(Context *context, GLenum target, GLenum pname ...@@ -1060,20 +1053,20 @@ bool ValidateFramebufferParameteri(Context *context, GLenum target, GLenum pname
{ {
if (!context->getExtensions().geometryShader) if (!context->getExtensions().geometryShader)
{ {
ANGLE_VALIDATION_ERR(context, InvalidEnum(), GeometryShaderExtensionNotEnabled); context->validationError(GL_INVALID_ENUM, kErrorGeometryShaderExtensionNotEnabled);
return false; return false;
} }
GLint maxLayers = context->getCaps().maxFramebufferLayers; GLint maxLayers = context->getCaps().maxFramebufferLayers;
if (param < 0 || param > maxLayers) if (param < 0 || param > maxLayers)
{ {
ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidFramebufferLayer); context->validationError(GL_INVALID_VALUE, kErrorInvalidFramebufferLayer);
return false; return false;
} }
break; break;
} }
default: default:
{ {
ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidPname); context->validationError(GL_INVALID_ENUM, kErrorInvalidPname);
return false; return false;
} }
} }
...@@ -1082,7 +1075,7 @@ bool ValidateFramebufferParameteri(Context *context, GLenum target, GLenum pname ...@@ -1082,7 +1075,7 @@ bool ValidateFramebufferParameteri(Context *context, GLenum target, GLenum pname
ASSERT(framebuffer); ASSERT(framebuffer);
if (framebuffer->id() == 0) if (framebuffer->id() == 0)
{ {
context->handleError(InvalidOperation() << "Default framebuffer is bound to target."); context->validationError(GL_INVALID_OPERATION, "Default framebuffer is bound to target.");
return false; return false;
} }
return true; return true;
...@@ -1092,13 +1085,13 @@ bool ValidateGetFramebufferParameteriv(Context *context, GLenum target, GLenum p ...@@ -1092,13 +1085,13 @@ bool ValidateGetFramebufferParameteriv(Context *context, GLenum target, GLenum p
{ {
if (context->getClientVersion() < ES_3_1) if (context->getClientVersion() < ES_3_1)
{ {
ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES31Required); context->validationError(GL_INVALID_OPERATION, kErrorES31Required);
return false; return false;
} }
if (!ValidFramebufferTarget(context, target)) if (!ValidFramebufferTarget(context, target))
{ {
ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidFramebufferTarget); context->validationError(GL_INVALID_ENUM, kErrorInvalidFramebufferTarget);
return false; return false;
} }
...@@ -1112,12 +1105,12 @@ bool ValidateGetFramebufferParameteriv(Context *context, GLenum target, GLenum p ...@@ -1112,12 +1105,12 @@ bool ValidateGetFramebufferParameteriv(Context *context, GLenum target, GLenum p
case GL_FRAMEBUFFER_DEFAULT_LAYERS_EXT: case GL_FRAMEBUFFER_DEFAULT_LAYERS_EXT:
if (!context->getExtensions().geometryShader) if (!context->getExtensions().geometryShader)
{ {
ANGLE_VALIDATION_ERR(context, InvalidEnum(), GeometryShaderExtensionNotEnabled); context->validationError(GL_INVALID_ENUM, kErrorGeometryShaderExtensionNotEnabled);
return false; return false;
} }
break; break;
default: default:
ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidPname); context->validationError(GL_INVALID_ENUM, kErrorInvalidPname);
return false; return false;
} }
...@@ -1126,7 +1119,7 @@ bool ValidateGetFramebufferParameteriv(Context *context, GLenum target, GLenum p ...@@ -1126,7 +1119,7 @@ bool ValidateGetFramebufferParameteriv(Context *context, GLenum target, GLenum p
if (framebuffer->id() == 0) if (framebuffer->id() == 0)
{ {
context->handleError(InvalidOperation() << "Default framebuffer is bound to target."); context->validationError(GL_INVALID_OPERATION, "Default framebuffer is bound to target.");
return false; return false;
} }
return true; return true;
...@@ -1150,7 +1143,7 @@ bool ValidateGetProgramResourceIndex(Context *context, ...@@ -1150,7 +1143,7 @@ bool ValidateGetProgramResourceIndex(Context *context,
{ {
if (context->getClientVersion() < ES_3_1) if (context->getClientVersion() < ES_3_1)
{ {
ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES31Required); context->validationError(GL_INVALID_OPERATION, kErrorES31Required);
return false; return false;
} }
...@@ -1162,8 +1155,7 @@ bool ValidateGetProgramResourceIndex(Context *context, ...@@ -1162,8 +1155,7 @@ bool ValidateGetProgramResourceIndex(Context *context,
if (!ValidateNamedProgramInterface(programInterface)) if (!ValidateNamedProgramInterface(programInterface))
{ {
context->handleError(InvalidEnum() << "Invalid program interface: 0x" << std::hex context->validationError(GL_INVALID_ENUM, "Invalid program interface");
<< std::uppercase << programInterface);
return false; return false;
} }
...@@ -1178,34 +1170,34 @@ bool ValidateBindVertexBuffer(Context *context, ...@@ -1178,34 +1170,34 @@ bool ValidateBindVertexBuffer(Context *context,
{ {
if (context->getClientVersion() < ES_3_1) if (context->getClientVersion() < ES_3_1)
{ {
ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES31Required); context->validationError(GL_INVALID_OPERATION, kErrorES31Required);
return false; return false;
} }
if (!context->isBufferGenerated(buffer)) if (!context->isBufferGenerated(buffer))
{ {
context->handleError(InvalidOperation() << "Buffer is not generated."); context->validationError(GL_INVALID_OPERATION, "Buffer is not generated.");
return false; return false;
} }
const Caps &caps = context->getCaps(); const Caps &caps = context->getCaps();
if (bindingIndex >= caps.maxVertexAttribBindings) if (bindingIndex >= caps.maxVertexAttribBindings)
{ {
context->handleError(InvalidValue() context->validationError(GL_INVALID_VALUE,
<< "bindingindex must be smaller than MAX_VERTEX_ATTRIB_BINDINGS."); "bindingindex must be smaller than MAX_VERTEX_ATTRIB_BINDINGS.");
return false; return false;
} }
if (offset < 0) if (offset < 0)
{ {
ANGLE_VALIDATION_ERR(context, InvalidValue(), NegativeOffset); context->validationError(GL_INVALID_VALUE, kErrorNegativeOffset);
return false; return false;
} }
if (stride < 0 || stride > caps.maxVertexAttribStride) if (stride < 0 || stride > caps.maxVertexAttribStride)
{ {
context->handleError(InvalidValue() context->validationError(GL_INVALID_VALUE,
<< "stride must be between 0 and MAX_VERTEX_ATTRIB_STRIDE."); "stride must be between 0 and MAX_VERTEX_ATTRIB_STRIDE.");
return false; return false;
} }
...@@ -1213,7 +1205,7 @@ bool ValidateBindVertexBuffer(Context *context, ...@@ -1213,7 +1205,7 @@ bool ValidateBindVertexBuffer(Context *context,
// An INVALID_OPERATION error is generated if the default vertex array object is bound. // An INVALID_OPERATION error is generated if the default vertex array object is bound.
if (context->getGLState().getVertexArrayId() == 0) if (context->getGLState().getVertexArrayId() == 0)
{ {
context->handleError(InvalidOperation() << "Default vertex array buffer is bound."); context->validationError(GL_INVALID_OPERATION, "Default vertex array buffer is bound.");
return false; return false;
} }
...@@ -1224,15 +1216,15 @@ bool ValidateVertexBindingDivisor(Context *context, GLuint bindingIndex, GLuint ...@@ -1224,15 +1216,15 @@ bool ValidateVertexBindingDivisor(Context *context, GLuint bindingIndex, GLuint
{ {
if (context->getClientVersion() < ES_3_1) if (context->getClientVersion() < ES_3_1)
{ {
ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES31Required); context->validationError(GL_INVALID_OPERATION, kErrorES31Required);
return false; return false;
} }
const Caps &caps = context->getCaps(); const Caps &caps = context->getCaps();
if (bindingIndex >= caps.maxVertexAttribBindings) if (bindingIndex >= caps.maxVertexAttribBindings)
{ {
context->handleError(InvalidValue() context->validationError(GL_INVALID_VALUE,
<< "bindingindex must be smaller than MAX_VERTEX_ATTRIB_BINDINGS."); "bindingindex must be smaller than MAX_VERTEX_ATTRIB_BINDINGS.");
return false; return false;
} }
...@@ -1240,7 +1232,7 @@ bool ValidateVertexBindingDivisor(Context *context, GLuint bindingIndex, GLuint ...@@ -1240,7 +1232,7 @@ bool ValidateVertexBindingDivisor(Context *context, GLuint bindingIndex, GLuint
// An INVALID_OPERATION error is generated if the default vertex array object is bound. // An INVALID_OPERATION error is generated if the default vertex array object is bound.
if (context->getGLState().getVertexArrayId() == 0) if (context->getGLState().getVertexArrayId() == 0)
{ {
context->handleError(InvalidOperation() << "Default vertex array object is bound."); context->validationError(GL_INVALID_OPERATION, "Default vertex array object is bound.");
return false; return false;
} }
...@@ -1271,7 +1263,7 @@ bool ValidateVertexAttribBinding(Context *context, GLuint attribIndex, GLuint bi ...@@ -1271,7 +1263,7 @@ bool ValidateVertexAttribBinding(Context *context, GLuint attribIndex, GLuint bi
{ {
if (context->getClientVersion() < ES_3_1) if (context->getClientVersion() < ES_3_1)
{ {
ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES31Required); context->validationError(GL_INVALID_OPERATION, kErrorES31Required);
return false; return false;
} }
...@@ -1279,21 +1271,21 @@ bool ValidateVertexAttribBinding(Context *context, GLuint attribIndex, GLuint bi ...@@ -1279,21 +1271,21 @@ bool ValidateVertexAttribBinding(Context *context, GLuint attribIndex, GLuint bi
// An INVALID_OPERATION error is generated if the default vertex array object is bound. // An INVALID_OPERATION error is generated if the default vertex array object is bound.
if (context->getGLState().getVertexArrayId() == 0) if (context->getGLState().getVertexArrayId() == 0)
{ {
context->handleError(InvalidOperation() << "Default vertex array object is bound."); context->validationError(GL_INVALID_OPERATION, "Default vertex array object is bound.");
return false; return false;
} }
const Caps &caps = context->getCaps(); const Caps &caps = context->getCaps();
if (attribIndex >= caps.maxVertexAttributes) if (attribIndex >= caps.maxVertexAttributes)
{ {
ANGLE_VALIDATION_ERR(context, InvalidValue(), IndexExceedsMaxVertexAttribute); context->validationError(GL_INVALID_VALUE, kErrorIndexExceedsMaxVertexAttribute);
return false; return false;
} }
if (bindingIndex >= caps.maxVertexAttribBindings) if (bindingIndex >= caps.maxVertexAttribBindings)
{ {
context->handleError(InvalidValue() context->validationError(GL_INVALID_VALUE,
<< "bindingindex must be smaller than MAX_VERTEX_ATTRIB_BINDINGS"); "bindingindex must be smaller than MAX_VERTEX_ATTRIB_BINDINGS");
return false; return false;
} }
...@@ -1310,7 +1302,7 @@ bool ValidateGetProgramResourceName(Context *context, ...@@ -1310,7 +1302,7 @@ bool ValidateGetProgramResourceName(Context *context,
{ {
if (context->getClientVersion() < ES_3_1) if (context->getClientVersion() < ES_3_1)
{ {
ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES31Required); context->validationError(GL_INVALID_OPERATION, kErrorES31Required);
return false; return false;
} }
...@@ -1322,20 +1314,19 @@ bool ValidateGetProgramResourceName(Context *context, ...@@ -1322,20 +1314,19 @@ bool ValidateGetProgramResourceName(Context *context,
if (!ValidateNamedProgramInterface(programInterface)) if (!ValidateNamedProgramInterface(programInterface))
{ {
context->handleError(InvalidEnum() << "Invalid program interface: 0x" << std::hex context->validationError(GL_INVALID_ENUM, "Invalid program interface");
<< std::uppercase << programInterface);
return false; return false;
} }
if (!ValidateProgramResourceIndex(programObject, programInterface, index)) if (!ValidateProgramResourceIndex(programObject, programInterface, index))
{ {
context->handleError(InvalidValue() << "Invalid index: " << index); context->validationError(GL_INVALID_VALUE, "Invalid index");
return false; return false;
} }
if (bufSize < 0) if (bufSize < 0)
{ {
ANGLE_VALIDATION_ERR(context, InvalidValue(), NegativeBufferSize); context->validationError(GL_INVALID_VALUE, kErrorNegativeBufferSize);
return false; return false;
} }
...@@ -1349,7 +1340,7 @@ bool ValidateDispatchCompute(Context *context, ...@@ -1349,7 +1340,7 @@ bool ValidateDispatchCompute(Context *context,
{ {
if (context->getClientVersion() < ES_3_1) if (context->getClientVersion() < ES_3_1)
{ {
ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES31Required); context->validationError(GL_INVALID_OPERATION, kErrorES31Required);
return false; return false;
} }
...@@ -1358,30 +1349,30 @@ bool ValidateDispatchCompute(Context *context, ...@@ -1358,30 +1349,30 @@ bool ValidateDispatchCompute(Context *context,
if (program == nullptr || !program->hasLinkedShaderStage(ShaderType::Compute)) if (program == nullptr || !program->hasLinkedShaderStage(ShaderType::Compute))
{ {
ANGLE_VALIDATION_ERR(context, InvalidOperation(), NoActiveProgramWithComputeShader); context->validationError(GL_INVALID_OPERATION, kErrorNoActiveProgramWithComputeShader);
return false; return false;
} }
const Caps &caps = context->getCaps(); const Caps &caps = context->getCaps();
if (numGroupsX > caps.maxComputeWorkGroupCount[0]) if (numGroupsX > caps.maxComputeWorkGroupCount[0])
{ {
context->handleError( context->validationError(
InvalidValue() << "num_groups_x cannot be greater than MAX_COMPUTE_WORK_GROUP_COUNT[0]=" GL_INVALID_VALUE,
<< caps.maxComputeWorkGroupCount[0]); "num_groups_x cannot be greater than MAX_COMPUTE_WORK_GROUP_COUNT[0]");
return false; return false;
} }
if (numGroupsY > caps.maxComputeWorkGroupCount[1]) if (numGroupsY > caps.maxComputeWorkGroupCount[1])
{ {
context->handleError( context->validationError(
InvalidValue() << "num_groups_y cannot be greater than MAX_COMPUTE_WORK_GROUP_COUNT[1]=" GL_INVALID_VALUE,
<< caps.maxComputeWorkGroupCount[1]); "num_groups_y cannot be greater than MAX_COMPUTE_WORK_GROUP_COUNT[1]");
return false; return false;
} }
if (numGroupsZ > caps.maxComputeWorkGroupCount[2]) if (numGroupsZ > caps.maxComputeWorkGroupCount[2])
{ {
context->handleError( context->validationError(
InvalidValue() << "num_groups_z cannot be greater than MAX_COMPUTE_WORK_GROUP_COUNT[2]=" GL_INVALID_VALUE,
<< caps.maxComputeWorkGroupCount[2]); "num_groups_z cannot be greater than MAX_COMPUTE_WORK_GROUP_COUNT[2]");
return false; return false;
} }
...@@ -1392,7 +1383,7 @@ bool ValidateDispatchComputeIndirect(Context *context, GLintptr indirect) ...@@ -1392,7 +1383,7 @@ bool ValidateDispatchComputeIndirect(Context *context, GLintptr indirect)
{ {
if (context->getClientVersion() < ES_3_1) if (context->getClientVersion() < ES_3_1)
{ {
ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES31Required); context->validationError(GL_INVALID_OPERATION, kErrorES31Required);
return false; return false;
} }
...@@ -1401,26 +1392,26 @@ bool ValidateDispatchComputeIndirect(Context *context, GLintptr indirect) ...@@ -1401,26 +1392,26 @@ bool ValidateDispatchComputeIndirect(Context *context, GLintptr indirect)
if (program == nullptr || !program->hasLinkedShaderStage(ShaderType::Compute)) if (program == nullptr || !program->hasLinkedShaderStage(ShaderType::Compute))
{ {
ANGLE_VALIDATION_ERR(context, InvalidOperation(), NoActiveProgramWithComputeShader); context->validationError(GL_INVALID_OPERATION, kErrorNoActiveProgramWithComputeShader);
return false; return false;
} }
if (indirect < 0) if (indirect < 0)
{ {
ANGLE_VALIDATION_ERR(context, InvalidValue(), NegativeOffset); context->validationError(GL_INVALID_VALUE, kErrorNegativeOffset);
return false; return false;
} }
if ((indirect & (sizeof(GLuint) - 1)) != 0) if ((indirect & (sizeof(GLuint) - 1)) != 0)
{ {
ANGLE_VALIDATION_ERR(context, InvalidValue(), OffsetMustBeMultipleOfUint); context->validationError(GL_INVALID_VALUE, kErrorOffsetMustBeMultipleOfUint);
return false; return false;
} }
Buffer *dispatchIndirectBuffer = state.getTargetBuffer(BufferBinding::DispatchIndirect); Buffer *dispatchIndirectBuffer = state.getTargetBuffer(BufferBinding::DispatchIndirect);
if (!dispatchIndirectBuffer) if (!dispatchIndirectBuffer)
{ {
ANGLE_VALIDATION_ERR(context, InvalidOperation(), DispatchIndirectBufferNotBound); context->validationError(GL_INVALID_OPERATION, kErrorDispatchIndirectBufferNotBound);
return false; return false;
} }
...@@ -1429,7 +1420,7 @@ bool ValidateDispatchComputeIndirect(Context *context, GLintptr indirect) ...@@ -1429,7 +1420,7 @@ bool ValidateDispatchComputeIndirect(Context *context, GLintptr indirect)
if (!checkedSum.IsValid() || if (!checkedSum.IsValid() ||
checkedSum.ValueOrDie() > static_cast<GLuint64>(dispatchIndirectBuffer->getSize())) checkedSum.ValueOrDie() > static_cast<GLuint64>(dispatchIndirectBuffer->getSize()))
{ {
ANGLE_VALIDATION_ERR(context, InvalidOperation(), InsufficientBufferSize); context->validationError(GL_INVALID_OPERATION, kErrorInsufficientBufferSize);
return false; return false;
} }
...@@ -1448,27 +1439,26 @@ bool ValidateBindImageTexture(Context *context, ...@@ -1448,27 +1439,26 @@ bool ValidateBindImageTexture(Context *context,
GLuint maxImageUnits = context->getCaps().maxImageUnits; GLuint maxImageUnits = context->getCaps().maxImageUnits;
if (unit >= maxImageUnits) if (unit >= maxImageUnits)
{ {
context->handleError(InvalidValue() context->validationError(GL_INVALID_VALUE,
<< "unit cannot be greater than or equal than MAX_IMAGE_UNITS = " "unit cannot be greater than or equal than MAX_IMAGE_UNITS");
<< maxImageUnits);
return false; return false;
} }
if (level < 0) if (level < 0)
{ {
context->handleError(InvalidValue() << "level is negative."); context->validationError(GL_INVALID_VALUE, "level is negative.");
return false; return false;
} }
if (layer < 0) if (layer < 0)
{ {
context->handleError(InvalidValue() << "layer is negative."); context->validationError(GL_INVALID_VALUE, "layer is negative.");
return false; return false;
} }
if (access != GL_READ_ONLY && access != GL_WRITE_ONLY && access != GL_READ_WRITE) if (access != GL_READ_ONLY && access != GL_WRITE_ONLY && access != GL_READ_WRITE)
{ {
context->handleError(InvalidEnum() << "access is not one of the supported tokens."); context->validationError(GL_INVALID_ENUM, "access is not one of the supported tokens.");
return false; return false;
} }
...@@ -1489,8 +1479,8 @@ bool ValidateBindImageTexture(Context *context, ...@@ -1489,8 +1479,8 @@ bool ValidateBindImageTexture(Context *context,
case GL_RGBA8_SNORM: case GL_RGBA8_SNORM:
break; break;
default: default:
context->handleError(InvalidValue() context->validationError(GL_INVALID_VALUE,
<< "format is not one of supported image unit formats."); "format is not one of supported image unit formats.");
return false; return false;
} }
...@@ -1500,15 +1490,15 @@ bool ValidateBindImageTexture(Context *context, ...@@ -1500,15 +1490,15 @@ bool ValidateBindImageTexture(Context *context,
if (tex == nullptr) if (tex == nullptr)
{ {
context->handleError(InvalidValue() context->validationError(GL_INVALID_VALUE,
<< "texture is not the name of an existing texture object."); "texture is not the name of an existing texture object.");
return false; return false;
} }
if (!tex->getImmutableFormat()) if (!tex->getImmutableFormat())
{ {
context->handleError(InvalidOperation() context->validationError(GL_INVALID_OPERATION,
<< "texture is not the name of an immutable texture object."); "texture is not the name of an immutable texture object.");
return false; return false;
} }
} }
...@@ -1523,7 +1513,7 @@ bool ValidateGetProgramResourceLocation(Context *context, ...@@ -1523,7 +1513,7 @@ bool ValidateGetProgramResourceLocation(Context *context,
{ {
if (context->getClientVersion() < ES_3_1) if (context->getClientVersion() < ES_3_1)
{ {
ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES31Required); context->validationError(GL_INVALID_OPERATION, kErrorES31Required);
return false; return false;
} }
...@@ -1535,13 +1525,13 @@ bool ValidateGetProgramResourceLocation(Context *context, ...@@ -1535,13 +1525,13 @@ bool ValidateGetProgramResourceLocation(Context *context,
if (!programObject->isLinked()) if (!programObject->isLinked())
{ {
context->handleError(InvalidOperation() << "Program is not successfully linked."); context->validationError(GL_INVALID_OPERATION, "Program is not successfully linked.");
return false; return false;
} }
if (!ValidateLocationProgramInterface(programInterface)) if (!ValidateLocationProgramInterface(programInterface))
{ {
context->handleError(InvalidEnum() << "Invalid program interface."); context->validationError(GL_INVALID_ENUM, "Invalid program interface.");
return false; return false;
} }
return true; return true;
...@@ -1559,7 +1549,7 @@ bool ValidateGetProgramResourceiv(Context *context, ...@@ -1559,7 +1549,7 @@ bool ValidateGetProgramResourceiv(Context *context,
{ {
if (context->getClientVersion() < ES_3_1) if (context->getClientVersion() < ES_3_1)
{ {
ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES31Required); context->validationError(GL_INVALID_OPERATION, kErrorES31Required);
return false; return false;
} }
...@@ -1570,34 +1560,34 @@ bool ValidateGetProgramResourceiv(Context *context, ...@@ -1570,34 +1560,34 @@ bool ValidateGetProgramResourceiv(Context *context,
} }
if (!ValidateProgramInterface(programInterface)) if (!ValidateProgramInterface(programInterface))
{ {
context->handleError(InvalidEnum() << "Invalid program interface."); context->validationError(GL_INVALID_ENUM, "Invalid program interface.");
return false; return false;
} }
if (propCount <= 0) if (propCount <= 0)
{ {
context->handleError(InvalidValue() << "Invalid propCount."); context->validationError(GL_INVALID_VALUE, "Invalid propCount.");
return false; return false;
} }
if (bufSize < 0) if (bufSize < 0)
{ {
context->handleError(InvalidValue() << "Invalid bufSize."); context->validationError(GL_INVALID_VALUE, "Invalid bufSize.");
return false; return false;
} }
if (!ValidateProgramResourceIndex(programObject, programInterface, index)) if (!ValidateProgramResourceIndex(programObject, programInterface, index))
{ {
context->handleError(InvalidValue() << "Invalid index: " << index); context->validationError(GL_INVALID_VALUE, "Invalid index");
return false; return false;
} }
for (GLsizei i = 0; i < propCount; i++) for (GLsizei i = 0; i < propCount; i++)
{ {
if (!ValidateProgramResourceProperty(context, props[i])) if (!ValidateProgramResourceProperty(context, props[i]))
{ {
context->handleError(InvalidEnum() << "Invalid prop."); context->validationError(GL_INVALID_ENUM, "Invalid prop.");
return false; return false;
} }
if (!ValidateProgramResourcePropertyByInterface(props[i], programInterface)) if (!ValidateProgramResourcePropertyByInterface(props[i], programInterface))
{ {
context->handleError(InvalidOperation() << "Not an allowed prop for interface"); context->validationError(GL_INVALID_OPERATION, "Not an allowed prop for interface");
return false; return false;
} }
} }
...@@ -1612,7 +1602,7 @@ bool ValidateGetProgramInterfaceiv(Context *context, ...@@ -1612,7 +1602,7 @@ bool ValidateGetProgramInterfaceiv(Context *context,
{ {
if (context->getClientVersion() < ES_3_1) if (context->getClientVersion() < ES_3_1)
{ {
ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES31Required); context->validationError(GL_INVALID_OPERATION, kErrorES31Required);
return false; return false;
} }
...@@ -1624,7 +1614,7 @@ bool ValidateGetProgramInterfaceiv(Context *context, ...@@ -1624,7 +1614,7 @@ bool ValidateGetProgramInterfaceiv(Context *context,
if (!ValidateProgramInterface(programInterface)) if (!ValidateProgramInterface(programInterface))
{ {
context->handleError(InvalidEnum() << "Invalid program interface."); context->validationError(GL_INVALID_ENUM, "Invalid program interface.");
return false; return false;
} }
...@@ -1636,14 +1626,14 @@ bool ValidateGetProgramInterfaceiv(Context *context, ...@@ -1636,14 +1626,14 @@ bool ValidateGetProgramInterfaceiv(Context *context,
break; break;
default: default:
context->handleError(InvalidEnum() << "Unknown property of program interface."); context->validationError(GL_INVALID_ENUM, "Unknown property of program interface.");
return false; return false;
} }
if (pname == GL_MAX_NAME_LENGTH && programInterface == GL_ATOMIC_COUNTER_BUFFER) if (pname == GL_MAX_NAME_LENGTH && programInterface == GL_ATOMIC_COUNTER_BUFFER)
{ {
context->handleError(InvalidOperation() context->validationError(GL_INVALID_OPERATION,
<< "Active atomic counter resources are not assigned name strings."); "Active atomic counter resources are not assigned name strings.");
return false; return false;
} }
...@@ -1657,9 +1647,9 @@ bool ValidateGetProgramInterfaceiv(Context *context, ...@@ -1657,9 +1647,9 @@ bool ValidateGetProgramInterfaceiv(Context *context,
break; break;
default: default:
context->handleError( context->validationError(
InvalidOperation() GL_INVALID_OPERATION,
<< "MAX_NUM_ACTIVE_VARIABLES requires a buffer or block interface."); "MAX_NUM_ACTIVE_VARIABLES requires a buffer or block interface.");
return false; return false;
} }
} }
...@@ -1683,7 +1673,7 @@ static bool ValidateGenOrDeleteES31(Context *context, GLint n) ...@@ -1683,7 +1673,7 @@ static bool ValidateGenOrDeleteES31(Context *context, GLint n)
{ {
if (context->getClientVersion() < ES_3_1) if (context->getClientVersion() < ES_3_1)
{ {
ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES31Required); context->validationError(GL_INVALID_OPERATION, kErrorES31Required);
return false; return false;
} }
...@@ -1704,13 +1694,13 @@ bool ValidateBindProgramPipeline(Context *context, GLuint pipeline) ...@@ -1704,13 +1694,13 @@ bool ValidateBindProgramPipeline(Context *context, GLuint pipeline)
{ {
if (context->getClientVersion() < ES_3_1) if (context->getClientVersion() < ES_3_1)
{ {
ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES31Required); context->validationError(GL_INVALID_OPERATION, kErrorES31Required);
return false; return false;
} }
if (!context->isProgramPipelineGenerated(pipeline)) if (!context->isProgramPipelineGenerated(pipeline))
{ {
ANGLE_VALIDATION_ERR(context, InvalidOperation(), ObjectNotGenerated); context->validationError(GL_INVALID_OPERATION, kErrorObjectNotGenerated);
return false; return false;
} }
...@@ -1721,7 +1711,7 @@ bool ValidateIsProgramPipeline(Context *context, GLuint pipeline) ...@@ -1721,7 +1711,7 @@ bool ValidateIsProgramPipeline(Context *context, GLuint pipeline)
{ {
if (context->getClientVersion() < ES_3_1) if (context->getClientVersion() < ES_3_1)
{ {
ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES31Required); context->validationError(GL_INVALID_OPERATION, kErrorES31Required);
return false; return false;
} }
...@@ -1775,7 +1765,7 @@ bool ValidateMemoryBarrier(Context *context, GLbitfield barriers) ...@@ -1775,7 +1765,7 @@ bool ValidateMemoryBarrier(Context *context, GLbitfield barriers)
{ {
if (context->getClientVersion() < ES_3_1) if (context->getClientVersion() < ES_3_1)
{ {
ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES31Required); context->validationError(GL_INVALID_OPERATION, kErrorES31Required);
return false; return false;
} }
...@@ -1792,7 +1782,7 @@ bool ValidateMemoryBarrier(Context *context, GLbitfield barriers) ...@@ -1792,7 +1782,7 @@ bool ValidateMemoryBarrier(Context *context, GLbitfield barriers)
GL_ATOMIC_COUNTER_BARRIER_BIT | GL_SHADER_STORAGE_BARRIER_BIT; GL_ATOMIC_COUNTER_BARRIER_BIT | GL_SHADER_STORAGE_BARRIER_BIT;
if ((barriers & ~supported_barrier_bits) != 0) if ((barriers & ~supported_barrier_bits) != 0)
{ {
ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidMemoryBarrierBit); context->validationError(GL_INVALID_VALUE, kErrorInvalidMemoryBarrierBit);
return false; return false;
} }
...@@ -1803,7 +1793,7 @@ bool ValidateMemoryBarrierByRegion(Context *context, GLbitfield barriers) ...@@ -1803,7 +1793,7 @@ bool ValidateMemoryBarrierByRegion(Context *context, GLbitfield barriers)
{ {
if (context->getClientVersion() < ES_3_1) if (context->getClientVersion() < ES_3_1)
{ {
ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES31Required); context->validationError(GL_INVALID_OPERATION, kErrorES31Required);
return false; return false;
} }
...@@ -1818,7 +1808,7 @@ bool ValidateMemoryBarrierByRegion(Context *context, GLbitfield barriers) ...@@ -1818,7 +1808,7 @@ bool ValidateMemoryBarrierByRegion(Context *context, GLbitfield barriers)
GL_TEXTURE_FETCH_BARRIER_BIT | GL_UNIFORM_BARRIER_BIT; GL_TEXTURE_FETCH_BARRIER_BIT | GL_UNIFORM_BARRIER_BIT;
if ((barriers & ~supported_barrier_bits) != 0) if ((barriers & ~supported_barrier_bits) != 0)
{ {
ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidMemoryBarrierBit); context->validationError(GL_INVALID_VALUE, kErrorInvalidMemoryBarrierBit);
return false; return false;
} }
...@@ -1829,13 +1819,13 @@ bool ValidateSampleMaski(Context *context, GLuint maskNumber, GLbitfield mask) ...@@ -1829,13 +1819,13 @@ bool ValidateSampleMaski(Context *context, GLuint maskNumber, GLbitfield mask)
{ {
if (context->getClientVersion() < ES_3_1) if (context->getClientVersion() < ES_3_1)
{ {
ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES31Required); context->validationError(GL_INVALID_OPERATION, kErrorES31Required);
return false; return false;
} }
if (maskNumber >= context->getCaps().maxSampleMaskWords) if (maskNumber >= context->getCaps().maxSampleMaskWords)
{ {
ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidSampleMaskNumber); context->validationError(GL_INVALID_VALUE, kErrorInvalidSampleMaskNumber);
return false; return false;
} }
...@@ -1850,7 +1840,7 @@ bool ValidateFramebufferTextureEXT(Context *context, ...@@ -1850,7 +1840,7 @@ bool ValidateFramebufferTextureEXT(Context *context,
{ {
if (!context->getExtensions().geometryShader) if (!context->getExtensions().geometryShader)
{ {
ANGLE_VALIDATION_ERR(context, InvalidOperation(), GeometryShaderExtensionNotEnabled); context->validationError(GL_INVALID_OPERATION, kErrorGeometryShaderExtensionNotEnabled);
return false; return false;
} }
...@@ -1870,13 +1860,13 @@ bool ValidateFramebufferTextureEXT(Context *context, ...@@ -1870,13 +1860,13 @@ bool ValidateFramebufferTextureEXT(Context *context,
// three-dimensional or two-dimensional array texture. // three-dimensional or two-dimensional array texture.
if (tex == nullptr) if (tex == nullptr)
{ {
ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidTextureName); context->validationError(GL_INVALID_VALUE, kErrorInvalidTextureName);
return false; return false;
} }
if (!ValidMipLevel(context, tex->getType(), level)) if (!ValidMipLevel(context, tex->getType(), level))
{ {
ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidMipLevel); context->validationError(GL_INVALID_VALUE, kErrorInvalidMipLevel);
return false; return false;
} }
} }
...@@ -1901,19 +1891,19 @@ bool ValidateTexStorage3DMultisampleOES(Context *context, ...@@ -1901,19 +1891,19 @@ bool ValidateTexStorage3DMultisampleOES(Context *context,
{ {
if (!context->getExtensions().textureStorageMultisample2DArray) if (!context->getExtensions().textureStorageMultisample2DArray)
{ {
ANGLE_VALIDATION_ERR(context, InvalidEnum(), MultisampleArrayExtensionRequired); context->validationError(GL_INVALID_ENUM, kErrorMultisampleArrayExtensionRequired);
return false; return false;
} }
if (target != TextureType::_2DMultisampleArray) if (target != TextureType::_2DMultisampleArray)
{ {
ANGLE_VALIDATION_ERR(context, InvalidEnum(), TargetMustBeTexture2DMultisampleArrayOES); context->validationError(GL_INVALID_ENUM, kErrorTargetMustBeTexture2DMultisampleArrayOES);
return false; return false;
} }
if (width < 1 || height < 1 || depth < 1) if (width < 1 || height < 1 || depth < 1)
{ {
ANGLE_VALIDATION_ERR(context, InvalidValue(), NegativeSize); context->validationError(GL_INVALID_VALUE, kErrorNegativeSize);
return false; return false;
} }
...@@ -1928,17 +1918,17 @@ bool ValidateGetProgramResourceLocationIndexEXT(Context *context, ...@@ -1928,17 +1918,17 @@ bool ValidateGetProgramResourceLocationIndexEXT(Context *context,
{ {
if (!context->getExtensions().blendFuncExtended) if (!context->getExtensions().blendFuncExtended)
{ {
ANGLE_VALIDATION_ERR(context, InvalidOperation(), ExtensionNotEnabled); context->validationError(GL_INVALID_OPERATION, kErrorExtensionNotEnabled);
return false; return false;
} }
if (context->getClientVersion() < ES_3_1) if (context->getClientVersion() < ES_3_1)
{ {
ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES31Required); context->validationError(GL_INVALID_OPERATION, kErrorES31Required);
return false; return false;
} }
if (programInterface != GL_PROGRAM_OUTPUT) if (programInterface != GL_PROGRAM_OUTPUT)
{ {
ANGLE_VALIDATION_ERR(context, InvalidEnum(), ProgramInterfaceMustBeProgramOutput); context->validationError(GL_INVALID_ENUM, kErrorProgramInterfaceMustBeProgramOutput);
return false; return false;
} }
Program *programObject = GetValidProgram(context, program); Program *programObject = GetValidProgram(context, program);
...@@ -1948,7 +1938,7 @@ bool ValidateGetProgramResourceLocationIndexEXT(Context *context, ...@@ -1948,7 +1938,7 @@ bool ValidateGetProgramResourceLocationIndexEXT(Context *context,
} }
if (!programObject->isLinked()) if (!programObject->isLinked())
{ {
ANGLE_VALIDATION_ERR(context, InvalidOperation(), ProgramNotLinked); context->validationError(GL_INVALID_OPERATION, kErrorProgramNotLinked);
return false; return false;
} }
return true; return true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment