Commit e0472f3d by Jamie Madill Committed by Commit Bot

Slight refactor to ErrorStrings.h.

Allows for better readability. Also sort the error strings by ID. Bug: angleproject:2957 Change-Id: Ib3900a4c90507ac84496fd5ff916417eb768667b Reviewed-on: https://chromium-review.googlesource.com/c/1337461 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarYuly Novikov <ynovikov@chromium.org>
parent 752d220a
...@@ -11,485 +11,327 @@ ...@@ -11,485 +11,327 @@
namespace gl namespace gl
{ {
constexpr const char *kError3DDepthStencil = namespace err
"Format cannot be GL_DEPTH_COMPONENT or GL_DEPTH_STENCIL if target is GL_TEXTURE_3D"; {
constexpr const char *kErrorANGLECopyTexture3DUnavailable = #define MSG constexpr const char *
"GL_ANGLE_copy_texture_3d extension not available.";
constexpr const char *kErrorBaseLevelOutOfRange = "Texture base level out of range"; // clang-format off
constexpr const char *kErrorBlitDimensionsOutOfRange = MSG k3DDepthStencil = "Format cannot be GL_DEPTH_COMPONENT or GL_DEPTH_STENCIL if target is GL_TEXTURE_3D";
"BlitFramebuffer dimensions out of 32-bit integer range."; MSG kANGLECopyTexture3DUnavailable = "GL_ANGLE_copy_texture_3d extension not available.";
constexpr const char *kErrorBlitExtensionDepthStencilWholeBufferBlit = MSG kBaseLevelOutOfRange = "Texture base level out of range";
"Only whole-buffer depth and stencil blits are supported by this extension."; MSG kBlitDepthOrStencilFormatMismatch = "Depth/stencil buffer format combination not allowed for blit.";
constexpr const char *kErrorBlitExtensionFormatMismatch = MSG kBlitDimensionsOutOfRange = "BlitFramebuffer dimensions out of 32-bit integer range.";
"Attempting to blit and the read and draw buffer formats don't match."; MSG kBlitExtensionDepthStencilWholeBufferBlit = "Only whole-buffer depth and stencil blits are supported by this extension.";
constexpr const char *kErrorBlitExtensionFromInvalidAttachmentType = MSG kBlitExtensionFormatMismatch = "Attempting to blit and the read and draw buffer formats don't match.";
"Blits are only supported from 2D texture = renderbuffer or default framebuffer attachments " MSG kBlitExtensionFromInvalidAttachmentType = "Blits are only supported from 2D texture = renderbuffer or default framebuffer attachments in this extension.";
"in this extension."; MSG kBlitExtensionLinear = "Linear blit not supported in this extension.";
constexpr const char *kErrorBlitExtensionLinear = "Linear blit not supported in this extension."; MSG kBlitExtensionMultisampledDepthOrStencil = "Multisampled depth/stencil blit is not supported by this extension.";
constexpr const char *kErrorBlitExtensionMultisampledDepthOrStencil = MSG kBlitExtensionMultisampledWholeBufferBlit = "Only whole-buffer blit is supported from a multisampled read buffer in this extension.";
"Multisampled depth/stencil blit is not supported by this extension."; MSG kBlitExtensionNotAvailable = "Blit extension not available.";
constexpr const char *kErrorBlitExtensionMultisampledWholeBufferBlit = MSG kBlitExtensionScaleOrFlip = "Scaling and flipping in BlitFramebufferANGLE not supported by this implementation.";
"Only whole-buffer blit is supported from a multisampled read buffer in this extension."; MSG kBlitExtensionToInvalidAttachmentType = "Blits are only supported to 2D texture = renderbuffer or default framebuffer attachments in this extension.";
constexpr const char *kErrorBlitExtensionNotAvailable = "Blit extension not available."; MSG kBlitFeedbackLoop = "Blit feedback loop: the read and draw framebuffers are the same.";
constexpr const char *kErrorBlitExtensionScaleOrFlip = MSG kBlitFramebufferMissing = "Read and draw framebuffers must both exist for a blit to succeed.";
"Scaling and flipping in BlitFramebufferANGLE not supported by this implementation."; MSG kBlitFromMultiview = "Attempt to read from a multi-view framebuffer.";
constexpr const char *kErrorBlitExtensionToInvalidAttachmentType = MSG kBlitIntegerWithLinearFilter = "Cannot use GL_LINEAR filter when blitting a integer framebuffer.";
"Blits are only supported to 2D texture = renderbuffer or default framebuffer attachments in " MSG kBlitInvalidFilter = "Invalid blit filter.";
"this extension."; MSG kBlitInvalidMask = "Invalid blit mask.";
constexpr const char *kErrorBlitFeedbackLoop = MSG kBlitMissingColor = "Attempt to read from a missing color attachment of a complete framebuffer.";
"Blit feedback loop: the read and draw framebuffers are the same."; MSG kBlitMissingDepthOrStencil = "Attempt to read from a missing depth/stencil attachment of a complete framebuffer.";
constexpr const char *kErrorBlitFramebufferMissing = MSG kBlitMultisampledBoundsMismatch = "Attempt to blit from a multisampled framebuffer and the bounds don't match with the draw framebuffer.";
"Read and draw framebuffers must both exist for a blit to succeed."; MSG kBlitMultisampledFormatOrBoundsMismatch = "Attempt to blit from a multisampled framebuffer and the bounds or format of the color buffer don't match with the draw framebuffer.";
constexpr const char *kErrorBlitFromMultiview = "Attempt to read from a multi-view framebuffer."; MSG kBlitOnlyNearestForNonColor = "Only nearest filtering can be used when blitting buffers other than the color buffer.";
constexpr const char *kErrorBlitDepthOrStencilFormatMismatch = MSG kBlitSameImageColor = "Read and write color attachments cannot be the same image.";
"Depth/stencil buffer format combination not allowed for blit."; MSG kBlitSameImageDepthOrStencil = "Read and write depth stencil attachments cannot be the same image.";
constexpr const char *kErrorBlitIntegerWithLinearFilter = MSG kBlitToMultiview = "Attempt to write to a multi-view framebuffer.";
"Cannot use GL_LINEAR filter when blitting a integer framebuffer."; MSG kBlitTypeMismatchFixedOrFloat = "If the read buffer contains fixed-point or floating-point values = the draw buffer must as well.";
constexpr const char *kErrorBlitInvalidFilter = "Invalid blit filter."; MSG kBlitTypeMismatchFixedPoint = "If the read buffer contains fixed-point values = the draw buffer must as well.";
constexpr const char *kErrorBlitInvalidMask = "Invalid blit mask."; MSG kBlitTypeMismatchSignedInteger = "If the read buffer contains signed integer values the draw buffer must as well.";
constexpr const char *kErrorBlitMissingColor = MSG kBlitTypeMismatchUnsignedInteger = "If the read buffer contains unsigned integer values the draw buffer must as well.";
"Attempt to read from a missing color attachment of a complete framebuffer."; MSG kBufferBoundForTransformFeedback = "Buffer is bound for transform feedback.";
constexpr const char *kErrorBlitMissingDepthOrStencil = MSG kBufferMapped = "An active buffer is mapped";
"Attempt to read from a missing depth/stencil attachment of a complete framebuffer."; MSG kBufferNotBound = "A buffer must be bound.";
constexpr const char *kErrorBlitOnlyNearestForNonColor = MSG kColorNumberGreaterThanMaxDrawBuffers = "Color number for primary color greater than or equal to MAX_DRAW_BUFFERS";
"Only nearest filtering can be used when blitting buffers other than the color buffer."; MSG kColorNumberGreaterThanMaxDualSourceDrawBuffers = "Color number for secondary color greater than or equal to MAX_DUAL_SOURCE_DRAW_BUFFERS";
constexpr const char *kErrorBlitToMultiview = "Attempt to write to a multi-view framebuffer."; MSG kCompressedMismatch = "Compressed data is valid if-and-only-if the texture is compressed.";
constexpr const char *kErrorBlitTypeMismatchFixedOrFloat = MSG kCompressedTextureDimensionsMustMatchData = "Compressed texture dimensions must exactly match the dimensions of the data passed in.";
"If the read buffer contains fixed-point or floating-point values = the draw buffer must as " MSG kCompressedTexturesNotAttachable = "Compressed textures cannot be attached to a framebuffer.";
"well."; MSG kCopyAlias = "The read and write copy regions alias memory.";
constexpr const char *kErrorBlitTypeMismatchFixedPoint = MSG kCubemapFacesEqualDimensions = "Each cubemap face must have equal width and height.";
"If the read buffer contains fixed-point values = the draw buffer must as well."; MSG kCubemapIncomplete = "Texture is not cubemap complete. All cubemaps faces must be defined and be the same size.";
constexpr const char *kErrorBlitTypeMismatchSignedInteger = MSG kDefaultFramebufferInvalidAttachment = "Invalid attachment when the default framebuffer is bound.";
"If the read buffer contains signed integer values the draw buffer must as well."; MSG kDefaultFramebufferTarget = "It is invalid to change default FBO's attachments";
constexpr const char *kErrorBlitTypeMismatchUnsignedInteger = MSG kDefaultVertexArray = "Default vertex array object is bound.";
"If the read buffer contains unsigned integer values the draw buffer must as well."; MSG kDestinationImmutable = "Destination texture cannot be immutable.";
constexpr const char *kErrorBlitMultisampledBoundsMismatch = MSG kDestinationLevelNotDefined = "The destination level of the destination texture must be defined.";
"Attempt to blit from a multisampled framebuffer and the bounds don't match with the draw " MSG kDestinationTextureTooSmall = "Destination texture too small.";
"framebuffer."; MSG kDimensionsMustBePow2 = "Texture dimensions must be power-of-two.";
constexpr const char *kErrorBlitMultisampledFormatOrBoundsMismatch = MSG kDispatchIndirectBufferNotBound = "Dispatch indirect buffer must be bound.";
"Attempt to blit from a multisampled framebuffer and the bounds or format of the color " MSG kDrawBufferTypeMismatch = "Fragment shader output type does not match the bound framebuffer attachment type.";
"buffer don't match with the draw framebuffer."; MSG kDrawFramebufferIncomplete = "Draw framebuffer is incomplete";
constexpr const char *kErrorBlitSameImageColor = MSG kDrawIndirectBufferNotBound = "Draw indirect buffer must be bound.";
"Read and write color attachments cannot be the same image."; MSG kES31Required = "OpenGL ES 3.1 Required";
constexpr const char *kErrorBlitSameImageDepthOrStencil = MSG kES3Required = "OpenGL ES 3.0 Required.";
"Read and write depth stencil attachments cannot be the same image."; MSG kElementArrayBufferBoundForTransformFeedback = "It is undefined behavior to use an element array buffer that is bound for transform feedback.";
constexpr const char *kErrorBufferBoundForTransformFeedback = MSG kEnumNotSupported = "Enum is not currently supported.";
"Buffer is bound for transform feedback."; MSG kEnumRequiresGLES31 = "Enum requires GLES 3.1";
constexpr const char *kErrorBufferNotBound = "A buffer must be bound."; MSG kExceedsMaxElement = "Element value exceeds maximum element index.";
constexpr const char *kErrorBufferMapped = "An active buffer is mapped"; MSG kExpectedProgramName = "Expected a program name = but found a shader name.";
constexpr const char *kErrorColorNumberGreaterThanMaxDualSourceDrawBuffers = MSG kExpectedShaderName = "Expected a shader name = but found a program name.";
"Color number for secondary color greater than or equal to MAX_DUAL_SOURCE_DRAW_BUFFERS"; MSG kExtensionNotEnabled = "Extension is not enabled.";
constexpr const char *kErrorColorNumberGreaterThanMaxDrawBuffers = MSG kFeedbackLoop = "Feedback loop formed between Framebuffer and active Texture.";
"Color number for primary color greater than or equal to MAX_DRAW_BUFFERS"; MSG kFragDataBindingIndexOutOfRange = "Fragment output color index must be zero or one.";
constexpr const char *kErrorCompressedMismatch = MSG kFramebufferIncomplete = "Framebuffer is incomplete.";
"Compressed data is valid if-and-only-if the texture is compressed."; MSG kFramebufferIncompleteAttachment = "Attachment type must be compatible with attachment object.";
constexpr const char *kErrorCompressedTextureDimensionsMustMatchData = MSG kFramebufferTextureInvalidLayer = "Layer invalid for framebuffer texture attachment.";
"Compressed texture dimensions must exactly match the dimensions of the data passed in."; MSG kFramebufferTextureInvalidMipLevel = "Mip level invalid for framebuffer texture attachment.";
constexpr const char *kErrorCompressedTexturesNotAttachable = MSG kFramebufferTextureLayerIncorrectTextureType = "Texture is not a three-dimensional or two-dimensionsal array texture.";
"Compressed textures cannot be attached to a framebuffer."; MSG kGLES1Only = "GLES1-only function.";
constexpr const char *kErrorCopyAlias = "The read and write copy regions alias memory."; MSG kGenerateMipmapNotAllowed = "Texture format does not support mipmap generation.";
constexpr const char *kErrorCubemapFacesEqualDimensions = MSG kGeometryShaderExtensionNotEnabled = "GL_EXT_geometry_shader extension not enabled.";
"Each cubemap face must have equal width and height."; MSG kImmutableTextureBound = "The value of TEXTURE_IMMUTABLE_FORMAT for the texture currently bound to target on the active texture unit is true.";
constexpr const char *kErrorCubemapIncomplete = MSG kIncompatibleDrawModeAgainstGeometryShader = "Primitive mode is incompatible with the input primitive type of the geometry shader.";
"Texture is not cubemap complete. All cubemaps faces must be defined and be the same size."; MSG kIndexExceedsMaxActiveUniform = "Index must be less than program active uniform count.";
constexpr const char *kErrorDefaultFramebufferInvalidAttachment = MSG kIndexExceedsMaxActiveUniformBlock = "Index must be less than program active uniform block count.";
"Invalid attachment when the default framebuffer is bound."; MSG kIndexExceedsMaxAtomicCounterBufferBindings = "Index must be less than MAX_ATOMIC_COUNTER_BUFFER_BINDINGS.";
constexpr const char *kErrorDefaultFramebufferTarget = MSG kIndexExceedsMaxDrawBuffer = "Index must be less than MAX_DRAW_BUFFERS.";
"It is invalid to change default FBO's attachments"; MSG kIndexExceedsMaxTransformFeedbackAttribs = "Index must be less than MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS.";
constexpr const char *kErrorDefaultVertexArray = "Default vertex array object is bound."; MSG kIndexExceedsMaxUniformBufferBindings = "Index must be less than MAX_UNIFORM_BUFFER_BINDINGS.";
constexpr const char *kErrorDestinationImmutable = "Destination texture cannot be immutable."; MSG kIndexExceedsMaxVertexAttribute = "Index must be less than MAX_VERTEX_ATTRIBS.";
constexpr const char *kErrorDestinationLevelNotDefined = MSG kIndexExceedsMaxWorkgroupDimensions = "Index must be less than the number of workgroup dimensions (3).";
"The destination level of the destination texture must be defined."; MSG kIndexExceedsSamples = "Index must be less than the value of SAMPLES.";
constexpr const char *kErrorDestinationTextureTooSmall = "Destination texture too small."; MSG kInsufficientBufferSize = "Insufficient buffer size.";
constexpr const char *kErrorDimensionsMustBePow2 = "Texture dimensions must be power-of-two."; MSG kInsufficientVertexBufferSize = "Vertex buffer is not big enough for the draw call";
constexpr const char *kErrorDispatchIndirectBufferNotBound = MSG kIntegerOverflow = "Integer overflow.";
"Dispatch indirect buffer must be bound."; MSG kInternalFormatRequiresTexture2DArray = "internalformat is an ETC2/EAC format and target is not GL_TEXTURE_2D_ARRAY.";
constexpr const char *kErrorDoubleBoundTransformFeedbackBuffer = MSG kInvalidAttachment = "Invalid Attachment Type.";
"Transform feedback has a buffer bound to multiple outputs."; MSG kInvalidBlendEquation = "Invalid blend equation.";
constexpr const char *kErrorDrawIndirectBufferNotBound = "Draw indirect buffer must be bound."; MSG kInvalidBlendFunction = "Invalid blend function.";
constexpr const char *kErrorDrawBufferTypeMismatch = MSG kInvalidBooleanValue = "Invalid boolean value. Must be GL_FALSE or GL_TRUE.";
"Fragment shader output type does not match the bound framebuffer attachment type."; MSG kInvalidBorder = "Border must be 0.";
constexpr const char *kErrorDrawFramebufferIncomplete = "Draw framebuffer is incomplete"; MSG kInvalidBufferTypes = "Invalid buffer target.";
constexpr const char *kErrorElementArrayBufferBoundForTransformFeedback = MSG kInvalidBufferUsage = "Invalid buffer usage enum.";
"It is undefined behavior to use an element array buffer that is bound for transform " MSG kInvalidClearMask = "Invalid mask bits.";
"feedback."; MSG kInvalidClientState = "Invalid client vertex array type.";
constexpr const char *kErrorEnumNotSupported = "Enum is not currently supported."; MSG kInvalidClipPlane = "Invalid clip plane.";
constexpr const char *kErrorEnumRequiresGLES31 = "Enum requires GLES 3.1"; MSG kInvalidCombinedImageUnit = "Specified unit must be in [GL_TEXTURE0 = GL_TEXTURE0 + GL_MAX_COMBINED_IMAGE_UNITS)";
constexpr const char *kErrorES31Required = "OpenGL ES 3.1 Required"; MSG kInvalidCompressedFormat = "Not a valid compressed texture format.";
constexpr const char *kErrorES3Required = "OpenGL ES 3.0 Required."; MSG kInvalidCompressedImageSize = "Invalid compressed image size.";
constexpr const char *kErrorExceedsMaxElement = "Element value exceeds maximum element index."; MSG kInvalidConstantColor = "CONSTANT_COLOR (or ONE_MINUS_CONSTANT_COLOR) and CONSTANT_ALPHA (or ONE_MINUS_CONSTANT_ALPHA) cannot be used together as source and destination factors in the blend function.";
constexpr const char *kErrorExpectedProgramName = MSG kInvalidCopyCombination = "Invalid copy texture format combination.";
"Expected a program name = but found a shader name."; MSG kInvalidCoverMode = "Invalid cover mode.";
constexpr const char *kErrorExpectedShaderName = MSG kInvalidCullMode = "Cull mode not recognized.";
"Expected a shader name = but found a program name."; MSG kInvalidDebugSeverity = "Invalid debug severity.";
constexpr const char *kErrorExtensionNotEnabled = "Extension is not enabled."; MSG kInvalidDebugSource = "Invalid debug source.";
constexpr const char *kErrorFeedbackLoop = MSG kInvalidDebugType = "Invalid debug type.";
"Feedback loop formed between Framebuffer and active Texture."; MSG kInvalidDepthRange = "Near value cannot be greater than far.";
constexpr const char *kErrorFragDataBindingIndexOutOfRange = MSG kInvalidDepthStencilDrawBuffer = "Draw buffer must be zero when using depth or stencil.";
"Fragment output color index must be zero or one."; MSG kInvalidDestinationTexture = "Destination texture is not a valid texture object.";
constexpr const char *kErrorFramebufferIncomplete = "Framebuffer is incomplete."; MSG kInvalidDestinationTextureType = "Invalid destination texture type.";
constexpr const char *kErrorFramebufferIncompleteAttachment = MSG kInvalidDrawMode = "Invalid draw mode.";
"Attachment type must be compatible with attachment object."; MSG kInvalidDrawModeTransformFeedback = "Draw mode must match current transform feedback object's draw mode.";
constexpr const char *kErrorFramebufferTextureInvalidLayer = MSG kInvalidFence = "Invalid fence object.";
"Layer invalid for framebuffer texture attachment."; MSG kInvalidFenceCondition = "Invalid value for condition.";
constexpr const char *kErrorFramebufferTextureInvalidMipLevel = MSG kInvalidFenceState = "Fence must be set.";
"Mip level invalid for framebuffer texture attachment."; MSG kInvalidFillMode = "Invalid fill mode.";
constexpr const char *kErrorFramebufferTextureLayerIncorrectTextureType = MSG kInvalidFilterTexture = "Texture only supports NEAREST and LINEAR filtering.";
"Texture is not a three-dimensional or two-dimensionsal array texture."; MSG kInvalidFlags = "Invalid value for flags.";
constexpr const char *kErrorGenerateMipmapNotAllowed = MSG kInvalidFogDensity = "Invalid fog density (must be nonnegative).";
"Texture format does not support mipmap generation."; MSG kInvalidFogMode = "Invalid fog mode.";
constexpr const char *kErrorGeometryShaderExtensionNotEnabled = MSG kInvalidFogParameter = "Invalid fog parameter.";
"GL_EXT_geometry_shader extension not enabled."; MSG kInvalidFormat = "Invalid format.";
constexpr const char *kErrorGLES1Only = "GLES1-only function."; MSG kInvalidFormatCombination = "Invalid combination of format = type and internalFormat.";
constexpr const char *kErrorImmutableTextureBound = MSG kInvalidFramebufferAttachmentParameter = "Invalid parameter name for framebuffer attachment.";
"The value of TEXTURE_IMMUTABLE_FORMAT for the texture currently bound to target on the " MSG kInvalidFramebufferLayer = "Framebuffer layer cannot be less than 0 or greater than GL_MAX_FRAMEBUFFER_LAYERS_EXT.";
"active texture unit is true."; MSG kInvalidFramebufferTarget = "Invalid framebuffer target.";
constexpr const char *kErrorIncompatibleDrawModeAgainstGeometryShader = MSG kInvalidFramebufferTextureLevel = "Mipmap level must be 0 when attaching a texture.";
"Primitive mode is incompatible with the input primitive type of the geometry shader."; MSG kInvalidImageUnit = "Image unit cannot be greater than or equal to the value of MAX_IMAGE_UNITS.";
constexpr const char *kErrorIndexExceedsMaxActiveUniform = MSG kInvalidIndirectOffset = "indirect must be a multiple of the size of uint in basic machine units.";
"Index must be less than program active uniform count."; MSG kInvalidInternalFormat = "Invalid internal format.";
constexpr const char *kErrorIndexExceedsMaxActiveUniformBlock = MSG kInvalidLight = "Invalid light.";
"Index must be less than program active uniform block count."; MSG kInvalidLightModelParameter = "Invalid light model parameter.";
constexpr const char *kErrorIndexExceedsMaxAtomicCounterBufferBindings = MSG kInvalidLightParameter = "Invalid light parameter.";
"Index must be less than MAX_ATOMIC_COUNTER_BUFFER_BINDINGS."; MSG kInvalidLogicOp = "Invalid logical operation.";
constexpr const char *kErrorIndexExceedsMaxDrawBuffer = "Index must be less than MAX_DRAW_BUFFERS."; MSG kInvalidMaterialFace = "Invalid material face.";
constexpr const char *kErrorIndexExceedsMaxTransformFeedbackAttribs = MSG kInvalidMaterialParameter = "Invalid material parameter.";
"Index must be less than MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS."; MSG kInvalidMatrixMode = "Invalid matrix mode.";
constexpr const char *kErrorIndexExceedsMaxUniformBufferBindings = MSG kInvalidMemoryBarrierBit = "Invalid memory barrier bit.";
"Index must be less than MAX_UNIFORM_BUFFER_BINDINGS."; MSG kInvalidMipLevel = "Level of detail outside of range.";
constexpr const char *kErrorIndexExceedsMaxVertexAttribute = MSG kInvalidMipLevels = "Invalid level count.";
"Index must be less than MAX_VERTEX_ATTRIBS."; MSG kInvalidMultisampledFramebufferOperation = "Invalid operation on multisampled framebuffer";
constexpr const char *kErrorIndexExceedsMaxWorkgroupDimensions = MSG kInvalidMultitextureUnit = "Specified unit must be in [GL_TEXTURE0 = GL_TEXTURE0 + GL_MAX_TEXTURE_UNITS)";
"Index must be less than the number of workgroup dimensions (3)."; MSG kInvalidName = "Invalid name.";
constexpr const char *kErrorIndexExceedsSamples = "Index must be less than the value of SAMPLES."; MSG kInvalidNameCharacters = "Name contains invalid characters.";
constexpr const char *kErrorInsufficientBufferSize = "Insufficient buffer size."; MSG kInvalidPname = "Invalid pname.";
constexpr const char *kErrorInsufficientVertexBufferSize = MSG kInvalidPointParameter = "Invalid point parameter.";
"Vertex buffer is not big enough for the draw call"; MSG kInvalidPointParameterValue = "Invalid point parameter value (must be non-negative).";
constexpr const char *kErrorIntegerOverflow = "Integer overflow."; MSG kInvalidPointSizeValue = "Invalid point size (must be positive).";
constexpr const char *kErrorInternalFormatRequiresTexture2DArray = MSG kInvalidPointerQuery = "Invalid pointer query.";
"internalformat is an ETC2/EAC format and target is not GL_TEXTURE_2D_ARRAY."; MSG kInvalidPrecision = "Invalid or unsupported precision type.";
constexpr const char *kErrorInvalidAttachment = "Invalid Attachment Type."; MSG kInvalidProgramName = "Program object expected.";
constexpr const char *kErrorInvalidBlendEquation = "Invalid blend equation."; MSG kInvalidProjectionMatrix = "Invalid projection matrix. Left/right = top/bottom = near/far intervals cannot be zero = and near/far cannot be less than zero.";
constexpr const char *kErrorInvalidBlendFunction = "Invalid blend function."; MSG kInvalidQueryId = "Invalid query Id.";
constexpr const char *kErrorInvalidBooleanValue = MSG kInvalidQueryTarget = "Invalid query target.";
"Invalid boolean value. Must be GL_FALSE or GL_TRUE."; MSG kInvalidQueryType = "Invalid query type.";
constexpr const char *kErrorInvalidBorder = "Border must be 0."; MSG kInvalidRange = "Invalid range.";
constexpr const char *kErrorInvalidBufferTypes = "Invalid buffer target."; MSG kInvalidRenderbufferInternalFormat = "Invalid renderbuffer internalformat.";
constexpr const char *kErrorInvalidBufferUsage = "Invalid buffer usage enum."; MSG kInvalidRenderbufferTarget = "Invalid renderbuffer target.";
constexpr const char *kErrorInvalidClearMask = "Invalid mask bits."; MSG kInvalidRenderbufferTextureParameter = "Invalid parameter name for renderbuffer attachment.";
constexpr const char *kErrorInvalidClientState = "Invalid client vertex array type."; MSG kInvalidRenderbufferWidthHeight = "Renderbuffer width and height cannot be negative and cannot exceed maximum texture size.";
constexpr const char *kErrorInvalidClipPlane = "Invalid clip plane."; MSG kInvalidSampleMaskNumber = "MaskNumber cannot be greater than or equal to the value of MAX_SAMPLE_MASK_WORDS.";
constexpr const char *kErrorInvalidCombinedImageUnit = MSG kInvalidSampler = "Sampler is not valid";
"Specified unit must be in [GL_TEXTURE0 = GL_TEXTURE0 + GL_MAX_COMBINED_IMAGE_UNITS)"; MSG kInvalidShaderName = "Shader object expected.";
constexpr const char *kErrorInvalidCompressedFormat = "Not a valid compressed texture format."; MSG kInvalidShaderType = "Invalid shader type.";
constexpr const char *kErrorInvalidCompressedImageSize = "Invalid compressed image size."; MSG kInvalidShadingModel = "Invalid shading model.";
constexpr const char *kErrorInvalidConstantColor = MSG kInvalidSourceTexture = "Source texture is not a valid texture object.";
"CONSTANT_COLOR (or ONE_MINUS_CONSTANT_COLOR) and CONSTANT_ALPHA (or " MSG kInvalidSourceTextureLevel = "Invalid source texture level.";
"ONE_MINUS_CONSTANT_ALPHA) cannot be used together as source and destination factors in the " MSG kInvalidSourceTextureSize = "Invalid source texture height or width.";
"blend function."; MSG kInvalidStencil = "Invalid stencil.";
constexpr const char *kErrorInvalidCopyCombination = "Invalid copy texture format combination."; MSG kInvalidStencilBitMask = "Invalid stencil bit mask.";
constexpr const char *kErrorInvalidCoverMode = "Invalid cover mode."; MSG kInvalidTarget = "Invalid target.";
constexpr const char *kErrorInvalidCullMode = "Cull mode not recognized."; MSG kInvalidTextureCombine = "Invalid texture combine mode.";
constexpr const char *kErrorInvalidDebugSeverity = "Invalid debug severity."; MSG kInvalidTextureCombineOp = "Invalid texture combine operand.";
constexpr const char *kErrorInvalidDebugSource = "Invalid debug source."; MSG kInvalidTextureCombineSrc = "Invalid texture combine source.";
constexpr const char *kErrorInvalidDebugType = "Invalid debug type."; MSG kInvalidTextureEnvMode = "Invalid texture environment mode.";
constexpr const char *kErrorInvalidDepthRange = "Near value cannot be greater than far."; MSG kInvalidTextureEnvParameter = "Invalid texture environment parameter.";
constexpr const char *kErrorInvalidDepthStencilDrawBuffer = MSG kInvalidTextureEnvScale = "Invalid texture environment scale.";
"Draw buffer must be zero when using depth or stencil."; MSG kInvalidTextureEnvTarget = "Invalid texture environment target.";
constexpr const char *kErrorInvalidDestinationTexture = MSG kInvalidTextureFilterParam = "Texture filter not recognized.";
"Destination texture is not a valid texture object."; MSG kInvalidTextureName = "Not a valid texture object name.";
constexpr const char *kErrorInvalidDestinationTextureType = "Invalid destination texture type."; MSG kInvalidTextureRange = "Cannot be less than 0 or greater than maximum number of textures.";
constexpr const char *kErrorInvalidDrawMode = "Invalid draw mode."; MSG kInvalidTextureTarget = "Invalid or unsupported texture target.";
constexpr const char *kErrorInvalidDrawModeTransformFeedback = MSG kInvalidTextureWrap = "Texture wrap mode not recognized.";
"Draw mode must match current transform feedback object's draw mode."; MSG kInvalidTimeout = "Invalid value for timeout.";
constexpr const char *kErrorInvalidFence = "Invalid fence object."; MSG kInvalidTransformFeedbackAttribsCount = "Count exeeds MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS.";
constexpr const char *kErrorInvalidFenceCondition = "Invalid value for condition."; MSG kInvalidType = "Invalid type.";
constexpr const char *kErrorInvalidFenceState = "Fence must be set."; MSG kInvalidTypePureInt = "Invalid type = should be integer";
constexpr const char *kErrorInvalidFillMode = "Invalid fill mode."; MSG kInvalidUniformCount = "Only array uniforms may have count > 1.";
constexpr const char *kErrorInvalidFilterTexture = MSG kInvalidUniformLocation = "Invalid uniform location";
"Texture only supports NEAREST and LINEAR filtering."; MSG kInvalidUnpackAlignment = "Unpack alignment must be 1 = 2 = 4 = or 8.";
constexpr const char *kErrorInvalidFlags = "Invalid value for flags."; MSG kInvalidVertexArray = "Vertex array does not exist.";
constexpr const char *kErrorInvalidFogDensity = "Invalid fog density (must be nonnegative)."; MSG kInvalidVertexAttrSize = "Vertex attribute size must be 1 = 2 = 3 = or 4.";
constexpr const char *kErrorInvalidFogMode = "Invalid fog mode."; MSG kInvalidVertexPointerSize = "Size for built-in vertex attribute is outside allowed range.";
constexpr const char *kErrorInvalidFogParameter = "Invalid fog parameter."; MSG kInvalidVertexPointerStride = "Invalid stride for built-in vertex attribute.";
constexpr const char *kErrorInvalidFormat = "Invalid format."; MSG kInvalidVertexPointerType = "Invalid type for built-in vertex attribute.";
constexpr const char *kErrorInvalidFormatCombination = MSG kInvalidWidth = "Invalid width.";
"Invalid combination of format = type and internalFormat."; MSG kInvalidWrapModeTexture = "Invalid wrap mode for texture type.";
constexpr const char *kErrorInvalidFramebufferTarget = "Invalid framebuffer target."; MSG kLevelNotZero = "Texture level must be zero.";
constexpr const char *kErrorInvalidFramebufferTextureLevel = MSG kLightParameterOutOfRange = "Light parameter out of range.";
"Mipmap level must be 0 when attaching a texture."; MSG kMaterialParameterOutOfRange = "Material parameter out of range.";
constexpr const char *kErrorInvalidFramebufferAttachmentParameter = MSG kMatrixStackOverflow = "Current matrix stack is full.";
"Invalid parameter name for framebuffer attachment."; MSG kMatrixStackUnderflow = "Current matrix stack has only a single matrix.";
constexpr const char *kErrorInvalidFramebufferLayer = MSG kMismatchedByteCountType = "Buffer size does not align with data type.";
"Framebuffer layer cannot be less than 0 or greater than GL_MAX_FRAMEBUFFER_LAYERS_EXT."; MSG kMismatchedFormat = "Format must match internal format.";
constexpr const char *kErrorInvalidIndirectOffset = MSG kMismatchedTargetAndFormat = "Invalid texture target and format combination.";
"indirect must be a multiple of the size of uint in basic machine units."; MSG kMismatchedTypeAndFormat = "Invalid format and type combination.";
constexpr const char *kErrorInvalidImageUnit = MSG kMismatchedVariableProgram = "Variable is not part of the current program.";
"Image unit cannot be greater than or equal to the value of MAX_IMAGE_UNITS."; MSG kMissingReadAttachment = "Missing read attachment.";
constexpr const char *kErrorInvalidInternalFormat = "Invalid internal format."; MSG kMissingTexture = "No Texture is bound to the specified target.";
constexpr const char *kErrorInvalidLight = "Invalid light."; MSG kMultisampleArrayExtensionRequired = "GL_ANGLE_texture_multisample_array not enabled.";
constexpr const char *kErrorInvalidLightModelParameter = "Invalid light model parameter."; MSG kMultisampleTextureExtensionOrES31Required = "GL_ANGLE_texture_multisample or GLES 3.1 required.";
constexpr const char *kErrorInvalidLightParameter = "Invalid light parameter."; MSG kMultiviewActive = "The number of views in the active draw framebuffer is greater than 1.";
constexpr const char *kErrorInvalidLogicOp = "Invalid logical operation."; MSG kMultiviewMismatch = "The number of views in the active program and draw framebuffer does not match.";
constexpr const char *kErrorInvalidMaterialFace = "Invalid material face."; MSG kMultiviewNotAvailable = "ANGLE_multiview is not available.";
constexpr const char *kErrorInvalidMaterialParameter = "Invalid material parameter."; MSG kMultiviewTimerQuery = "There is an active query for target GL_TIME_ELAPSED_EXT when the number of views in the active draw framebuffer is greater than 1.";
constexpr const char *kErrorInvalidMatrixMode = "Invalid matrix mode."; MSG kMultiviewTransformFeedback = "There is an active transform feedback object when the number of views in the active draw framebuffer is greater than 1.";
constexpr const char *kErrorInvalidMemoryBarrierBit = "Invalid memory barrier bit."; MSG kMultiviewViewsTooLarge = "numViews cannot be greater than GL_MAX_VIEWS_ANGLE.";
constexpr const char *kErrorInvalidMipLevel = "Level of detail outside of range."; MSG kMultiviewViewsTooSmall = "numViews cannot be less than 1.";
constexpr const char *kErrorInvalidMipLevels = "Invalid level count."; MSG kMustHaveElementArrayBinding = "Must have element array buffer bound.";
constexpr const char *kErrorInvalidMultitextureUnit = MSG kNVFenceNotSupported = "GL_NV_fence is not supported";
"Specified unit must be in [GL_TEXTURE0 = GL_TEXTURE0 + GL_MAX_TEXTURE_UNITS)"; MSG kNameBeginsWithGL = "Attributes that begin with 'gl_' are not allowed.";
constexpr const char *kErrorInvalidMultisampledFramebufferOperation = MSG kNegativeAttachments = "Negative number of attachments.";
"Invalid operation on multisampled framebuffer"; MSG kNegativeBufferSize = "Negative buffer size.";
constexpr const char *kErrorInvalidName = "Invalid name."; MSG kNegativeCount = "Negative count.";
constexpr const char *kErrorInvalidNameCharacters = "Name contains invalid characters."; MSG kNegativeHeightWidthDepth = "Cannot have negative height = width = or depth.";
constexpr const char *kErrorInvalidPname = "Invalid pname."; MSG kNegativeLayer = "Negative layer.";
constexpr const char *kErrorInvalidPointerQuery = "Invalid pointer query."; MSG kNegativeLength = "Negative length.";
constexpr const char *kErrorInvalidPointParameter = "Invalid point parameter."; MSG kNegativeMaxCount = "Negative maxcount.";
constexpr const char *kErrorInvalidPointParameterValue = MSG kNegativeOffset = "Negative offset.";
"Invalid point parameter value (must be non-negative)."; MSG kNegativePrimcount = "Primcount must be greater than or equal to zero.";
constexpr const char *kErrorInvalidPointSizeValue = "Invalid point size (must be positive)."; MSG kNegativeSize = "Cannot have negative height or width.";
constexpr const char *kErrorInvalidPrecision = "Invalid or unsupported precision type."; MSG kNegativeStart = "Cannot have negative start.";
constexpr const char *kErrorInvalidProgramName = "Program object expected."; MSG kNegativeStride = "Cannot have negative stride.";
constexpr const char *kErrorInvalidProjectionMatrix = MSG kNegativeXYZ = "x = y = or z cannot be negative.";
"Invalid projection matrix. Left/right = top/bottom = near/far intervals cannot be zero = and " MSG kNoActiveComputeShaderStage = "No active compute shader stage in this program.";
"near/far cannot be less than zero."; MSG kNoActiveGeometryShaderStage = "No active geometry shader stage in this program.";
constexpr const char *kErrorInvalidQueryId = "Invalid query Id."; MSG kNoActiveGraphicsShaderStage = "It is a undefined behaviour to render without vertex shader stage or fragment shader stage.";
constexpr const char *kErrorInvalidQueryTarget = "Invalid query target."; MSG kNoActiveProgramWithComputeShader = "No active program for the compute shader stage.";
constexpr const char *kErrorInvalidQueryType = "Invalid query type."; MSG kNoSuchPath = "No such path object.";
constexpr const char *kErrorInvalidRange = "Invalid range."; MSG kNoTransformFeedbackOutputVariables = "The active program has specified no output variables to record.";
constexpr const char *kErrorInvalidRenderbufferInternalFormat = MSG kNoZeroDivisor = "At least one enabled attribute must have a divisor of zero.";
"Invalid renderbuffer internalformat."; MSG kNonPositiveDrawTextureDimension = "Both width and height argument of drawn texture must be positive.";
constexpr const char *kErrorInvalidRenderbufferTarget = "Invalid renderbuffer target."; MSG kObjectNotGenerated = "Object cannot be used because it has not been generated.";
constexpr const char *kErrorInvalidRenderbufferTextureParameter = MSG kOffsetMustBeMultipleOfType = "Offset must be a multiple of the passed in datatype.";
"Invalid parameter name for renderbuffer attachment."; MSG kOffsetMustBeMultipleOfUint = "Offset must be a multiple of the size = in basic machine units = of uint";
constexpr const char *kErrorInvalidRenderbufferWidthHeight = MSG kOffsetOverflow = "Offset overflows texture dimensions.";
"Renderbuffer width and height cannot be negative and cannot exceed maximum texture size."; MSG kOutsideOfBounds = "Parameter outside of bounds.";
constexpr const char *kErrorInvalidSampleMaskNumber = MSG kParamOverflow = "The provided parameters overflow with the provided buffer.";
"MaskNumber cannot be greater than or equal to the value of MAX_SAMPLE_MASK_WORDS."; MSG kPixelDataNotNull = "Pixel data must be null.";
constexpr const char *kErrorInvalidSampler = "Sampler is not valid"; MSG kPixelDataNull = "Pixel data cannot be null.";
constexpr const char *kErrorInvalidShaderName = "Shader object expected."; MSG kPixelPackBufferBoundForTransformFeedback = "It is undefined behavior to use a pixel pack buffer that is bound for transform feedback.";
constexpr const char *kErrorInvalidShaderType = "Invalid shader type."; MSG kPixelUnpackBufferBoundForTransformFeedback = "It is undefined behavior to use a pixel unpack buffer that is bound for transform feedback.";
constexpr const char *kErrorInvalidShadingModel = "Invalid shading model."; MSG kPointSizeArrayExtensionNotEnabled = "GL_OES_point_size_array not enabled.";
constexpr const char *kErrorInvalidSourceTexture = "Source texture is not a valid texture object."; MSG kProgramDoesNotExist = "Program doesn't exist.";
constexpr const char *kErrorInvalidSourceTextureLevel = "Invalid source texture level."; MSG kProgramInterfaceMustBeProgramOutput = "programInterface must be set to GL_PROGRAM_OUTPUT.";
constexpr const char *kErrorInvalidSourceTextureSize = "Invalid source texture height or width."; MSG kProgramNotBound = "A program must be bound.";
constexpr const char *kErrorInvalidStencil = "Invalid stencil."; MSG kProgramNotLinked = "Program not linked.";
constexpr const char *kErrorInvalidStencilBitMask = "Invalid stencil bit mask."; MSG kQueryActive = "Query is active.";
constexpr const char *kErrorInvalidTarget = "Invalid target."; MSG kQueryExtensionNotEnabled = "Query extension not enabled.";
constexpr const char *kErrorInvalidTextureCombine = "Invalid texture combine mode."; MSG kReadBufferNone = "Read buffer is GL_NONE.";
constexpr const char *kErrorInvalidTextureCombineSrc = "Invalid texture combine source."; MSG kReadBufferNotAttached = "Read buffer has no attachment.";
constexpr const char *kErrorInvalidTextureCombineOp = "Invalid texture combine operand."; MSG kRectangleTextureCompressed = "Rectangle texture cannot have a compressed format.";
constexpr const char *kErrorInvalidTextureEnvMode = "Invalid texture environment mode."; MSG kRelativeOffsetTooLarge = "relativeOffset cannot be greater than MAX_VERTEX_ATTRIB_RELATIVE_OFFSET.";
constexpr const char *kErrorInvalidTextureEnvParameter = "Invalid texture environment parameter."; MSG kRenderableInternalFormat = "SizedInternalformat must be color-renderable = depth-renderable = or stencil-renderable.";
constexpr const char *kErrorInvalidTextureEnvScale = "Invalid texture environment scale."; MSG kRenderbufferNotBound = "A renderbuffer must be bound.";
constexpr const char *kErrorInvalidTextureEnvTarget = "Invalid texture environment target."; MSG kResourceMaxRenderbufferSize = "Desired resource size is greater than max renderbuffer size.";
constexpr const char *kErrorInvalidTextureFilterParam = "Texture filter not recognized."; MSG kResourceMaxTextureSize = "Desired resource size is greater than max texture size.";
constexpr const char *kErrorInvalidTextureName = "Not a valid texture object name."; MSG kSamplesOutOfRange = "Samples must not be greater than maximum supported value for the format.";
constexpr const char *kErrorInvalidTextureRange = MSG kSamplesZero = "Samples may not be zero.";
"Cannot be less than 0 or greater than maximum number of textures."; MSG kShaderAttachmentHasShader = "Shader attachment already has a shader.";
constexpr const char *kErrorInvalidTextureTarget = "Invalid or unsupported texture target."; MSG kShaderSourceInvalidCharacters = "Shader source contains invalid characters.";
constexpr const char *kErrorInvalidTextureWrap = "Texture wrap mode not recognized."; MSG kShaderToDetachMustBeAttached = "Shader to be detached must be currently attached to the program.";
constexpr const char *kErrorInvalidTimeout = "Invalid value for timeout."; MSG kSourceLevelNotDefined = "The source level of the source texture must be defined.";
constexpr const char *kErrorInvalidTransformFeedbackAttribsCount = MSG kSourceTextureTooSmall = "The specified dimensions are outside of the bounds of the texture.";
"Count exeeds MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS."; MSG kStencilReferenceMaskOrMismatch = "Stencil reference and mask values must be the same for front facing and back facing triangles.";
constexpr const char *kErrorInvalidType = "Invalid type."; MSG kStrideMustBeMultipleOfType = "Stride must be a multiple of the passed in datatype.";
constexpr const char *kErrorInvalidTypePureInt = "Invalid type = should be integer"; MSG kSyncMissing = "Sync object does not exist.";
constexpr const char *kErrorInvalidUniformCount = "Only array uniforms may have count > 1."; MSG kTargetMustBeTexture2DMultisampleArrayOES = "Target must be TEXTURE_2D_MULTISAMPLE_ARRAY_OES.";
constexpr const char *kErrorInvalidUniformLocation = "Invalid uniform location"; MSG kTextureIsImmutable = "Texture is immutable.";
constexpr const char *kErrorInvalidUnpackAlignment = "Unpack alignment must be 1 = 2 = 4 = or 8."; MSG kTextureNotBound = "A texture must be bound.";
constexpr const char *kErrorInvalidVertexArray = "Vertex array does not exist."; MSG kTextureNotPow2 = "The texture is a non-power-of-two texture.";
constexpr const char *kErrorInvalidVertexAttrSize = MSG kTextureSizeTooSmall = "Texture dimensions must all be greater than zero.";
"Vertex attribute size must be 1 = 2 = 3 = or 4."; MSG kTextureTargetRequiresES31 = "Texture target requires at least OpenGL ES 3.1.";
constexpr const char *kErrorInvalidVertexPointerSize = MSG kTextureTypeConflict = "Two textures of different types use the same sampler location.";
"Size for built-in vertex attribute is outside allowed range."; MSG kTextureWidthOrHeightOutOfRange = "Width and height must be less than or equal to GL_MAX_TEXTURE_SIZE.";
constexpr const char *kErrorInvalidVertexPointerStride = MSG kTransformFeedbackBufferDoubleBound = "A transform feedback buffer that would be written to is also bound to a non-transform-feedback target = which would cause undefined behavior.";
"Invalid stride for built-in vertex attribute."; MSG kTransformFeedbackBufferMultipleOutputs = "Transform feedback has a buffer bound to multiple outputs.";
constexpr const char *kErrorInvalidVertexPointerType = MSG kTransformFeedbackBufferTooSmall = "Not enough space in bound transform feedback buffers.";
"Invalid type for built-in vertex attribute."; MSG kTransformFeedbackDoesNotExist = "Transform feedback object that does not exist.";
constexpr const char *kErrorInvalidWidth = "Invalid width."; MSG kTransformFeedbackNotActive = "No Transform Feedback object is active.";
constexpr const char *kErrorInvalidWrapModeTexture = "Invalid wrap mode for texture type."; MSG kTransformFeedbackNotPaused = "The active Transform Feedback object is not paused.";
constexpr const char *kErrorLevelNotZero = "Texture level must be zero."; MSG kTransformFeedbackPaused = "The active Transform Feedback object is paused.";
constexpr const char *kErrorLightParameterOutOfRange = "Light parameter out of range."; MSG kTransformFeedbackVaryingIndexOutOfRange = "Index must be less than the transform feedback varying count in the program.";
constexpr const char *kErrorMaterialParameterOutOfRange = "Material parameter out of range."; MSG kTypeMismatch = "Passed in texture target and format must match the one originally used to define the texture.";
constexpr const char *kErrorMatrixStackOverflow = "Current matrix stack is full."; MSG kTypeNotUnsignedShortByte = "Only UNSIGNED_SHORT and UNSIGNED_BYTE types are supported.";
constexpr const char *kErrorMatrixStackUnderflow = "Current matrix stack has only a single matrix."; MSG kUniformBufferBoundForTransformFeedback = "It is undefined behavior to use an uniform buffer that is bound for transform feedback.";
constexpr const char *kErrorMismatchedByteCountType = "Buffer size does not align with data type."; MSG kUniformBufferTooSmall = "It is undefined behaviour to use a uniform buffer that is too small.";
constexpr const char *kErrorMismatchedFormat = "Format must match internal format."; MSG kUniformBufferUnbound = "It is undefined behaviour to have a used but unbound uniform buffer.";
constexpr const char *kErrorMismatchedTargetAndFormat = MSG kUniformSizeMismatch = "Uniform size does not match uniform method.";
"Invalid texture target and format combination."; MSG kUnknownParameter = "Unknown parameter value.";
constexpr const char *kErrorMismatchedTypeAndFormat = "Invalid format and type combination."; MSG kUnsizedInternalFormatUnsupported = "Internalformat is one of the unsupported unsized base internalformats.";
constexpr const char *kErrorMismatchedVariableProgram = MSG kUnsupportedDrawModeForTransformFeedback = "The draw command is unsupported when transform feedback is active and not paused.";
"Variable is not part of the current program."; MSG kVertexArrayNoBuffer = "An enabled vertex array has no buffer.";
constexpr const char *kErrorMissingReadAttachment = "Missing read attachment."; MSG kVertexArrayNoBufferPointer = "An enabled vertex array has no buffer and no pointer.";
constexpr const char *kErrorMissingTexture = "No Texture is bound to the specified target."; MSG kVertexBufferBoundForTransformFeedback = "It is undefined behavior to use a vertex buffer that is bound for transform feedback.";
constexpr const char *kErrorMustHaveElementArrayBinding = "Must have element array buffer bound."; MSG kVertexShaderTypeMismatch = "Vertex shader input type does not match the type of the bound vertex attribute.";
constexpr const char *kErrorMultiviewActive = MSG kViewportNegativeSize = "Viewport size cannot be negative.";
"The number of views in the active draw framebuffer is greater than 1."; MSG kWebgl2NameLengthLimitExceeded = "Location lengths must not be greater than 1024 characters.";
constexpr const char *kErrorMultiviewViewsTooLarge = MSG kWebglBindAttribLocationReservedPrefix = "Attributes that begin with 'webgl_' = or '_webgl_' are not allowed.";
"numViews cannot be greater than GL_MAX_VIEWS_ANGLE."; MSG kWebglNameLengthLimitExceeded = "Location name lengths must not be greater than 256 characters.";
constexpr const char *kErrorMultiviewViewsTooSmall = "numViews cannot be less than 1."; MSG kZeroBoundToTarget = "Zero is bound to target.";
constexpr const char *kErrorMultiviewNotAvailable = "ANGLE_multiview is not available."; // clang-format on
constexpr const char *kErrorMultiviewMismatch =
"The number of views in the active program and draw " #undef MSG
"framebuffer does not match."; } // namespace err
constexpr const char *kErrorMultiviewTransformFeedback =
"There is an active transform feedback object when "
"the number of views in the active draw framebuffer "
"is greater than 1.";
constexpr const char *kErrorMultiviewTimerQuery =
"There is an active query for target "
"GL_TIME_ELAPSED_EXT when the number of views in the "
"active draw framebuffer is greater than 1.";
constexpr const char *kErrorMultisampleArrayExtensionRequired =
"GL_ANGLE_texture_multisample_array not enabled.";
constexpr const char *kErrorMultisampleTextureExtensionOrES31Required =
"GL_ANGLE_texture_multisample or GLES 3.1 required.";
constexpr const char *kErrorNameBeginsWithGL = "Attributes that begin with 'gl_' are not allowed.";
constexpr const char *kErrorNegativeAttachments = "Negative number of attachments.";
constexpr const char *kErrorNegativeBufferSize = "Negative buffer size.";
constexpr const char *kErrorNegativeCount = "Negative count.";
constexpr const char *kErrorNegativeHeightWidthDepth =
"Cannot have negative height = width = or depth.";
constexpr const char *kErrorNegativeLayer = "Negative layer.";
constexpr const char *kErrorNegativeLength = "Negative length.";
constexpr const char *kErrorNegativeMaxCount = "Negative maxcount.";
constexpr const char *kErrorNegativeOffset = "Negative offset.";
constexpr const char *kErrorNegativePrimcount = "Primcount must be greater than or equal to zero.";
constexpr const char *kErrorNegativeSize = "Cannot have negative height or width.";
constexpr const char *kErrorNegativeStart = "Cannot have negative start.";
constexpr const char *kErrorNegativeStride = "Cannot have negative stride.";
constexpr const char *kErrorNegativeXYZ = "x = y = or z cannot be negative.";
constexpr const char *kErrorNoActiveComputeShaderStage =
"No active compute shader stage in this program.";
constexpr const char *kErrorNoActiveGeometryShaderStage =
"No active geometry shader stage in this program.";
constexpr const char *kErrorNoActiveGraphicsShaderStage =
"It is a undefined behaviour to render without vertex shader stage or fragment shader stage.";
constexpr const char *kErrorNoActiveProgramWithComputeShader =
"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 } // 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.
...@@ -228,7 +228,7 @@ ANGLE_INLINE bool ValidateUniformValue(Context *context, GLenum valueType, GLenu ...@@ -228,7 +228,7 @@ ANGLE_INLINE bool ValidateUniformValue(Context *context, GLenum valueType, GLenu
// Do the cheaper test first, for a little extra speed. // Do the cheaper test first, for a little extra speed.
if (valueType != uniformType && VariableBoolVectorType(valueType) != uniformType) if (valueType != uniformType && VariableBoolVectorType(valueType) != uniformType)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorUniformSizeMismatch); context->validationError(GL_INVALID_OPERATION, err::kUniformSizeMismatch);
return false; return false;
} }
return true; return true;
...@@ -605,7 +605,7 @@ ANGLE_INLINE bool ValidateFramebufferComplete(Context *context, Framebuffer *fra ...@@ -605,7 +605,7 @@ ANGLE_INLINE bool ValidateFramebufferComplete(Context *context, Framebuffer *fra
{ {
if (!framebuffer->isComplete(context)) if (!framebuffer->isComplete(context))
{ {
context->validationError(ErrorCode, kErrorFramebufferIncomplete); context->validationError(ErrorCode, err::kFramebufferIncomplete);
return false; return false;
} }
......
...@@ -19,12 +19,13 @@ ...@@ -19,12 +19,13 @@
#define ANGLE_VALIDATE_IS_GLES1(context) \ #define ANGLE_VALIDATE_IS_GLES1(context) \
if (context->getClientMajorVersion() > 1) \ if (context->getClientMajorVersion() > 1) \
{ \ { \
context->validationError(GL_INVALID_OPERATION, kErrorGLES1Only); \ context->validationError(GL_INVALID_OPERATION, kGLES1Only); \
return false; \ return false; \
} }
namespace gl namespace gl
{ {
using namespace err;
bool ValidateAlphaFuncCommon(Context *context, AlphaTestFunc func) bool ValidateAlphaFuncCommon(Context *context, AlphaTestFunc func)
{ {
...@@ -40,7 +41,7 @@ bool ValidateAlphaFuncCommon(Context *context, AlphaTestFunc func) ...@@ -40,7 +41,7 @@ bool ValidateAlphaFuncCommon(Context *context, AlphaTestFunc func)
case AlphaTestFunc::NotEqual: case AlphaTestFunc::NotEqual:
return true; return true;
default: default:
context->validationError(GL_INVALID_ENUM, kErrorEnumNotSupported); context->validationError(GL_INVALID_ENUM, kEnumNotSupported);
return false; return false;
} }
} }
...@@ -58,12 +59,12 @@ bool ValidateClientStateCommon(Context *context, ClientVertexArrayType arrayType ...@@ -58,12 +59,12 @@ bool ValidateClientStateCommon(Context *context, ClientVertexArrayType arrayType
case ClientVertexArrayType::PointSize: case ClientVertexArrayType::PointSize:
if (!context->getExtensions().pointSizeArray) if (!context->getExtensions().pointSizeArray)
{ {
context->validationError(GL_INVALID_ENUM, kErrorPointSizeArrayExtensionNotEnabled); context->validationError(GL_INVALID_ENUM, kPointSizeArrayExtensionNotEnabled);
return false; return false;
} }
return true; return true;
default: default:
context->validationError(GL_INVALID_ENUM, kErrorInvalidClientState); context->validationError(GL_INVALID_ENUM, kInvalidClientState);
return false; return false;
} }
} }
...@@ -79,7 +80,7 @@ bool ValidateBuiltinVertexAttributeCommon(Context *context, ...@@ -79,7 +80,7 @@ bool ValidateBuiltinVertexAttributeCommon(Context *context,
if (stride < 0) if (stride < 0)
{ {
context->validationError(GL_INVALID_VALUE, kErrorInvalidVertexPointerStride); context->validationError(GL_INVALID_VALUE, kInvalidVertexPointerStride);
return false; return false;
} }
...@@ -104,7 +105,7 @@ bool ValidateBuiltinVertexAttributeCommon(Context *context, ...@@ -104,7 +105,7 @@ bool ValidateBuiltinVertexAttributeCommon(Context *context,
case ClientVertexArrayType::PointSize: case ClientVertexArrayType::PointSize:
if (!context->getExtensions().pointSizeArray) if (!context->getExtensions().pointSizeArray)
{ {
context->validationError(GL_INVALID_ENUM, kErrorPointSizeArrayExtensionNotEnabled); context->validationError(GL_INVALID_ENUM, kPointSizeArrayExtensionNotEnabled);
return false; return false;
} }
...@@ -118,7 +119,7 @@ bool ValidateBuiltinVertexAttributeCommon(Context *context, ...@@ -118,7 +119,7 @@ bool ValidateBuiltinVertexAttributeCommon(Context *context,
if (size < minSize || size > maxSize) if (size < minSize || size > maxSize)
{ {
context->validationError(GL_INVALID_VALUE, kErrorInvalidVertexPointerSize); context->validationError(GL_INVALID_VALUE, kInvalidVertexPointerSize);
return false; return false;
} }
...@@ -127,7 +128,7 @@ bool ValidateBuiltinVertexAttributeCommon(Context *context, ...@@ -127,7 +128,7 @@ bool ValidateBuiltinVertexAttributeCommon(Context *context,
case GL_BYTE: case GL_BYTE:
if (arrayType == ClientVertexArrayType::PointSize) if (arrayType == ClientVertexArrayType::PointSize)
{ {
context->validationError(GL_INVALID_ENUM, kErrorInvalidVertexPointerType); context->validationError(GL_INVALID_ENUM, kInvalidVertexPointerType);
return false; return false;
} }
break; break;
...@@ -135,7 +136,7 @@ bool ValidateBuiltinVertexAttributeCommon(Context *context, ...@@ -135,7 +136,7 @@ bool ValidateBuiltinVertexAttributeCommon(Context *context,
if (arrayType == ClientVertexArrayType::PointSize || if (arrayType == ClientVertexArrayType::PointSize ||
arrayType == ClientVertexArrayType::Color) arrayType == ClientVertexArrayType::Color)
{ {
context->validationError(GL_INVALID_ENUM, kErrorInvalidVertexPointerType); context->validationError(GL_INVALID_ENUM, kInvalidVertexPointerType);
return false; return false;
} }
break; break;
...@@ -143,7 +144,7 @@ bool ValidateBuiltinVertexAttributeCommon(Context *context, ...@@ -143,7 +144,7 @@ bool ValidateBuiltinVertexAttributeCommon(Context *context,
case GL_FLOAT: case GL_FLOAT:
break; break;
default: default:
context->validationError(GL_INVALID_ENUM, kErrorInvalidVertexPointerType); context->validationError(GL_INVALID_ENUM, kInvalidVertexPointerType);
return false; return false;
} }
...@@ -154,7 +155,7 @@ bool ValidateLightCaps(Context *context, GLenum light) ...@@ -154,7 +155,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)
{ {
context->validationError(GL_INVALID_ENUM, kErrorInvalidLight); context->validationError(GL_INVALID_ENUM, kInvalidLight);
return false; return false;
} }
...@@ -185,7 +186,7 @@ bool ValidateLightCommon(Context *context, ...@@ -185,7 +186,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)
{ {
context->validationError(GL_INVALID_VALUE, kErrorLightParameterOutOfRange); context->validationError(GL_INVALID_VALUE, kLightParameterOutOfRange);
return false; return false;
} }
return true; return true;
...@@ -196,7 +197,7 @@ bool ValidateLightCommon(Context *context, ...@@ -196,7 +197,7 @@ bool ValidateLightCommon(Context *context,
} }
if (params[0] < 0.0f || params[0] > 90.0f) if (params[0] < 0.0f || params[0] > 90.0f)
{ {
context->validationError(GL_INVALID_VALUE, kErrorLightParameterOutOfRange); context->validationError(GL_INVALID_VALUE, kLightParameterOutOfRange);
return false; return false;
} }
return true; return true;
...@@ -205,12 +206,12 @@ bool ValidateLightCommon(Context *context, ...@@ -205,12 +206,12 @@ bool ValidateLightCommon(Context *context,
case LightParameter::QuadraticAttenuation: case LightParameter::QuadraticAttenuation:
if (params[0] < 0.0f) if (params[0] < 0.0f)
{ {
context->validationError(GL_INVALID_VALUE, kErrorLightParameterOutOfRange); context->validationError(GL_INVALID_VALUE, kLightParameterOutOfRange);
return false; return false;
} }
return true; return true;
default: default:
context->validationError(GL_INVALID_ENUM, kErrorInvalidLightParameter); context->validationError(GL_INVALID_ENUM, kInvalidLightParameter);
return false; return false;
} }
} }
...@@ -227,7 +228,7 @@ bool ValidateLightSingleComponent(Context *context, ...@@ -227,7 +228,7 @@ bool ValidateLightSingleComponent(Context *context,
if (GetLightParameterCount(pname) > 1) if (GetLightParameterCount(pname) > 1)
{ {
context->validationError(GL_INVALID_ENUM, kErrorInvalidLightParameter); context->validationError(GL_INVALID_ENUM, kInvalidLightParameter);
return false; return false;
} }
...@@ -249,12 +250,12 @@ bool ValidateMaterialCommon(Context *context, ...@@ -249,12 +250,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)
{ {
context->validationError(GL_INVALID_VALUE, kErrorMaterialParameterOutOfRange); context->validationError(GL_INVALID_VALUE, kMaterialParameterOutOfRange);
return false; return false;
} }
return true; return true;
default: default:
context->validationError(GL_INVALID_ENUM, kErrorInvalidMaterialParameter); context->validationError(GL_INVALID_ENUM, kInvalidMaterialParameter);
return false; return false;
} }
} }
...@@ -268,7 +269,7 @@ bool ValidateMaterialSetting(Context *context, ...@@ -268,7 +269,7 @@ bool ValidateMaterialSetting(Context *context,
if (face != GL_FRONT_AND_BACK) if (face != GL_FRONT_AND_BACK)
{ {
context->validationError(GL_INVALID_ENUM, kErrorInvalidMaterialFace); context->validationError(GL_INVALID_ENUM, kInvalidMaterialFace);
return false; return false;
} }
...@@ -281,7 +282,7 @@ bool ValidateMaterialQuery(Context *context, GLenum face, MaterialParameter pnam ...@@ -281,7 +282,7 @@ bool ValidateMaterialQuery(Context *context, GLenum face, MaterialParameter pnam
if (face != GL_FRONT && face != GL_BACK) if (face != GL_FRONT && face != GL_BACK)
{ {
context->validationError(GL_INVALID_ENUM, kErrorInvalidMaterialFace); context->validationError(GL_INVALID_ENUM, kInvalidMaterialFace);
return false; return false;
} }
...@@ -302,7 +303,7 @@ bool ValidateMaterialSingleComponent(Context *context, ...@@ -302,7 +303,7 @@ bool ValidateMaterialSingleComponent(Context *context,
if (GetMaterialParameterCount(pname) > 1) if (GetMaterialParameterCount(pname) > 1)
{ {
context->validationError(GL_INVALID_ENUM, kErrorInvalidMaterialParameter); context->validationError(GL_INVALID_ENUM, kInvalidMaterialParameter);
return false; return false;
} }
...@@ -318,7 +319,7 @@ bool ValidateLightModelCommon(Context *context, GLenum pname) ...@@ -318,7 +319,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:
context->validationError(GL_INVALID_ENUM, kErrorInvalidLightModelParameter); context->validationError(GL_INVALID_ENUM, kInvalidLightModelParameter);
return false; return false;
} }
} }
...@@ -335,7 +336,7 @@ bool ValidateLightModelSingleComponent(Context *context, GLenum pname) ...@@ -335,7 +336,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:
context->validationError(GL_INVALID_ENUM, kErrorInvalidLightModelParameter); context->validationError(GL_INVALID_ENUM, kInvalidLightModelParameter);
return false; return false;
} }
} }
...@@ -346,7 +347,7 @@ bool ValidateClipPlaneCommon(Context *context, GLenum plane) ...@@ -346,7 +347,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)
{ {
context->validationError(GL_INVALID_ENUM, kErrorInvalidClipPlane); context->validationError(GL_INVALID_ENUM, kInvalidClipPlane);
return false; return false;
} }
...@@ -369,7 +370,7 @@ bool ValidateFogCommon(Context *context, GLenum pname, const GLfloat *params) ...@@ -369,7 +370,7 @@ bool ValidateFogCommon(Context *context, GLenum pname, const GLfloat *params)
case GL_LINEAR: case GL_LINEAR:
return true; return true;
default: default:
context->validationError(GL_INVALID_VALUE, kErrorInvalidFogMode); context->validationError(GL_INVALID_VALUE, kInvalidFogMode);
return false; return false;
} }
} }
...@@ -381,12 +382,12 @@ bool ValidateFogCommon(Context *context, GLenum pname, const GLfloat *params) ...@@ -381,12 +382,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)
{ {
context->validationError(GL_INVALID_VALUE, kErrorInvalidFogDensity); context->validationError(GL_INVALID_VALUE, kInvalidFogDensity);
return false; return false;
} }
break; break;
default: default:
context->validationError(GL_INVALID_ENUM, kErrorInvalidFogParameter); context->validationError(GL_INVALID_ENUM, kInvalidFogParameter);
return false; return false;
} }
return true; return true;
...@@ -417,7 +418,7 @@ bool ValidateTexEnvCommon(Context *context, ...@@ -417,7 +418,7 @@ bool ValidateTexEnvCommon(Context *context,
case TextureEnvMode::Replace: case TextureEnvMode::Replace:
break; break;
default: default:
context->validationError(GL_INVALID_VALUE, kErrorInvalidTextureEnvMode); context->validationError(GL_INVALID_VALUE, kInvalidTextureEnvMode);
return false; return false;
} }
break; break;
...@@ -439,13 +440,12 @@ bool ValidateTexEnvCommon(Context *context, ...@@ -439,13 +440,12 @@ bool ValidateTexEnvCommon(Context *context,
case TextureCombine::Dot3Rgba: case TextureCombine::Dot3Rgba:
if (pname == TextureEnvParameter::CombineAlpha) if (pname == TextureEnvParameter::CombineAlpha)
{ {
context->validationError(GL_INVALID_VALUE, context->validationError(GL_INVALID_VALUE, kInvalidTextureCombine);
kErrorInvalidTextureCombine);
return false; return false;
} }
break; break;
default: default:
context->validationError(GL_INVALID_VALUE, kErrorInvalidTextureCombine); context->validationError(GL_INVALID_VALUE, kInvalidTextureCombine);
return false; return false;
} }
break; break;
...@@ -466,8 +466,7 @@ bool ValidateTexEnvCommon(Context *context, ...@@ -466,8 +466,7 @@ bool ValidateTexEnvCommon(Context *context,
case TextureSrc::Texture: case TextureSrc::Texture:
break; break;
default: default:
context->validationError(GL_INVALID_VALUE, context->validationError(GL_INVALID_VALUE, kInvalidTextureCombineSrc);
kErrorInvalidTextureCombineSrc);
return false; return false;
} }
break; break;
...@@ -491,14 +490,12 @@ bool ValidateTexEnvCommon(Context *context, ...@@ -491,14 +490,12 @@ bool ValidateTexEnvCommon(Context *context,
pname == TextureEnvParameter::Op1Alpha || pname == TextureEnvParameter::Op1Alpha ||
pname == TextureEnvParameter::Op2Alpha) pname == TextureEnvParameter::Op2Alpha)
{ {
context->validationError(GL_INVALID_VALUE, context->validationError(GL_INVALID_VALUE, kInvalidTextureCombine);
kErrorInvalidTextureCombine);
return false; return false;
} }
break; break;
default: default:
context->validationError(GL_INVALID_VALUE, context->validationError(GL_INVALID_VALUE, kInvalidTextureCombineOp);
kErrorInvalidTextureCombineOp);
return false; return false;
} }
break; break;
...@@ -507,21 +504,21 @@ bool ValidateTexEnvCommon(Context *context, ...@@ -507,21 +504,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)
{ {
context->validationError(GL_INVALID_VALUE, kErrorInvalidTextureEnvScale); context->validationError(GL_INVALID_VALUE, kInvalidTextureEnvScale);
return false; return false;
} }
break; break;
case TextureEnvParameter::Color: case TextureEnvParameter::Color:
break; break;
default: default:
context->validationError(GL_INVALID_ENUM, kErrorInvalidTextureEnvParameter); context->validationError(GL_INVALID_ENUM, kInvalidTextureEnvParameter);
return false; return false;
} }
break; break;
case TextureEnvTarget::PointSprite: case TextureEnvTarget::PointSprite:
if (!context->getExtensions().pointSprite) if (!context->getExtensions().pointSprite)
{ {
context->validationError(GL_INVALID_ENUM, kErrorInvalidTextureEnvTarget); context->validationError(GL_INVALID_ENUM, kInvalidTextureEnvTarget);
return false; return false;
} }
switch (pname) switch (pname)
...@@ -529,12 +526,12 @@ bool ValidateTexEnvCommon(Context *context, ...@@ -529,12 +526,12 @@ bool ValidateTexEnvCommon(Context *context,
case TextureEnvParameter::PointCoordReplace: case TextureEnvParameter::PointCoordReplace:
break; break;
default: default:
context->validationError(GL_INVALID_ENUM, kErrorInvalidTextureEnvParameter); context->validationError(GL_INVALID_ENUM, kInvalidTextureEnvParameter);
return false; return false;
} }
break; break;
default: default:
context->validationError(GL_INVALID_ENUM, kErrorInvalidTextureEnvTarget); context->validationError(GL_INVALID_ENUM, kInvalidTextureEnvTarget);
return false; return false;
} }
return true; return true;
...@@ -594,13 +591,13 @@ bool ValidatePointParameterCommon(Context *context, PointParameter pname, const ...@@ -594,13 +591,13 @@ bool ValidatePointParameterCommon(Context *context, PointParameter pname, const
{ {
if (params[i] < 0.0f) if (params[i] < 0.0f)
{ {
context->validationError(GL_INVALID_VALUE, kErrorInvalidPointParameterValue); context->validationError(GL_INVALID_VALUE, kInvalidPointParameterValue);
return false; return false;
} }
} }
break; break;
default: default:
context->validationError(GL_INVALID_ENUM, kErrorInvalidPointParameter); context->validationError(GL_INVALID_ENUM, kInvalidPointParameter);
return false; return false;
} }
...@@ -613,7 +610,7 @@ bool ValidatePointSizeCommon(Context *context, GLfloat size) ...@@ -613,7 +610,7 @@ bool ValidatePointSizeCommon(Context *context, GLfloat size)
if (size <= 0.0f) if (size <= 0.0f)
{ {
context->validationError(GL_INVALID_VALUE, kErrorInvalidPointSizeValue); context->validationError(GL_INVALID_VALUE, kInvalidPointSizeValue);
return false; return false;
} }
...@@ -626,7 +623,7 @@ bool ValidateDrawTexCommon(Context *context, float width, float height) ...@@ -626,7 +623,7 @@ bool ValidateDrawTexCommon(Context *context, float width, float height)
if (width <= 0.0f || height <= 0.0f) if (width <= 0.0f || height <= 0.0f)
{ {
context->validationError(GL_INVALID_VALUE, kErrorNonPositiveDrawTextureDimension); context->validationError(GL_INVALID_VALUE, kNonPositiveDrawTextureDimension);
return false; return false;
} }
...@@ -768,7 +765,7 @@ bool ValidateFrustumf(Context *context, ...@@ -768,7 +765,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)
{ {
context->validationError(GL_INVALID_VALUE, kErrorInvalidProjectionMatrix); context->validationError(GL_INVALID_VALUE, kInvalidProjectionMatrix);
} }
return true; return true;
} }
...@@ -784,7 +781,7 @@ bool ValidateFrustumx(Context *context, ...@@ -784,7 +781,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)
{ {
context->validationError(GL_INVALID_VALUE, kErrorInvalidProjectionMatrix); context->validationError(GL_INVALID_VALUE, kInvalidProjectionMatrix);
} }
return true; return true;
} }
...@@ -845,7 +842,7 @@ bool ValidateGetPointerv(Context *context, GLenum pname, void **params) ...@@ -845,7 +842,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:
context->validationError(GL_INVALID_ENUM, kErrorInvalidPointerQuery); context->validationError(GL_INVALID_ENUM, kInvalidPointerQuery);
return false; return false;
} }
} }
...@@ -979,7 +976,7 @@ bool ValidateLogicOp(Context *context, LogicalOperation opcode) ...@@ -979,7 +976,7 @@ bool ValidateLogicOp(Context *context, LogicalOperation opcode)
case LogicalOperation::Xor: case LogicalOperation::Xor:
return true; return true;
default: default:
context->validationError(GL_INVALID_ENUM, kErrorInvalidLogicOp); context->validationError(GL_INVALID_ENUM, kInvalidLogicOp);
return false; return false;
} }
} }
...@@ -1027,7 +1024,7 @@ bool ValidateMatrixMode(Context *context, MatrixType mode) ...@@ -1027,7 +1024,7 @@ bool ValidateMatrixMode(Context *context, MatrixType mode)
case MatrixType::Texture: case MatrixType::Texture:
return true; return true;
default: default:
context->validationError(GL_INVALID_ENUM, kErrorInvalidMatrixMode); context->validationError(GL_INVALID_ENUM, kInvalidMatrixMode);
return false; return false;
} }
} }
...@@ -1095,7 +1092,7 @@ bool ValidateOrthof(Context *context, ...@@ -1095,7 +1092,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)
{ {
context->validationError(GL_INVALID_VALUE, kErrorInvalidProjectionMatrix); context->validationError(GL_INVALID_VALUE, kInvalidProjectionMatrix);
} }
return true; return true;
} }
...@@ -1111,7 +1108,7 @@ bool ValidateOrthox(Context *context, ...@@ -1111,7 +1108,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)
{ {
context->validationError(GL_INVALID_VALUE, kErrorInvalidProjectionMatrix); context->validationError(GL_INVALID_VALUE, kInvalidProjectionMatrix);
} }
return true; return true;
} }
...@@ -1121,7 +1118,7 @@ bool ValidatePointParameterf(Context *context, PointParameter pname, GLfloat par ...@@ -1121,7 +1118,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)
{ {
context->validationError(GL_INVALID_ENUM, kErrorInvalidPointParameter); context->validationError(GL_INVALID_ENUM, kInvalidPointParameter);
return false; return false;
} }
...@@ -1138,7 +1135,7 @@ bool ValidatePointParameterx(Context *context, PointParameter pname, GLfixed par ...@@ -1138,7 +1135,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)
{ {
context->validationError(GL_INVALID_ENUM, kErrorInvalidPointParameter); context->validationError(GL_INVALID_ENUM, kInvalidPointParameter);
return false; return false;
} }
...@@ -1178,7 +1175,7 @@ bool ValidatePopMatrix(Context *context) ...@@ -1178,7 +1175,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)
{ {
context->validationError(GL_STACK_UNDERFLOW, kErrorMatrixStackUnderflow); context->validationError(GL_STACK_UNDERFLOW, kMatrixStackUnderflow);
return false; return false;
} }
return true; return true;
...@@ -1190,7 +1187,7 @@ bool ValidatePushMatrix(Context *context) ...@@ -1190,7 +1187,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())
{ {
context->validationError(GL_STACK_OVERFLOW, kErrorMatrixStackOverflow); context->validationError(GL_STACK_OVERFLOW, kMatrixStackOverflow);
return false; return false;
} }
return true; return true;
...@@ -1235,7 +1232,7 @@ bool ValidateShadeModel(Context *context, ShadingModel mode) ...@@ -1235,7 +1232,7 @@ bool ValidateShadeModel(Context *context, ShadingModel mode)
case ShadingModel::Smooth: case ShadingModel::Smooth:
return true; return true;
default: default:
context->validationError(GL_INVALID_ENUM, kErrorInvalidShadingModel); context->validationError(GL_INVALID_ENUM, kInvalidShadingModel);
return false; return false;
} }
} }
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -32,14 +32,14 @@ ANGLE_INLINE bool ValidateBindBuffer(Context *context, BufferBinding target, GLu ...@@ -32,14 +32,14 @@ ANGLE_INLINE bool ValidateBindBuffer(Context *context, BufferBinding target, GLu
{ {
if (!context->isValidBufferBinding(target)) if (!context->isValidBufferBinding(target))
{ {
context->validationError(GL_INVALID_ENUM, kErrorInvalidBufferTypes); context->validationError(GL_INVALID_ENUM, err::kInvalidBufferTypes);
return false; return false;
} }
if (!context->getGLState().isBindGeneratesResourceEnabled() && if (!context->getGLState().isBindGeneratesResourceEnabled() &&
!context->isBufferGenerated(buffer)) !context->isBufferGenerated(buffer))
{ {
context->validationError(GL_INVALID_OPERATION, kErrorObjectNotGenerated); context->validationError(GL_INVALID_OPERATION, err::kObjectNotGenerated);
return false; return false;
} }
......
...@@ -25,6 +25,7 @@ using namespace angle; ...@@ -25,6 +25,7 @@ using namespace angle;
namespace gl namespace gl
{ {
using namespace err;
namespace namespace
{ {
...@@ -37,7 +38,7 @@ bool ValidateFramebufferTextureMultiviewBaseANGLE(Context *context, ...@@ -37,7 +38,7 @@ bool ValidateFramebufferTextureMultiviewBaseANGLE(Context *context,
{ {
if (!context->getExtensions().multiview) if (!context->getExtensions().multiview)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorMultiviewNotAvailable); context->validationError(GL_INVALID_OPERATION, kMultiviewNotAvailable);
return false; return false;
} }
...@@ -48,14 +49,14 @@ bool ValidateFramebufferTextureMultiviewBaseANGLE(Context *context, ...@@ -48,14 +49,14 @@ bool ValidateFramebufferTextureMultiviewBaseANGLE(Context *context,
if (texture != 0 && numViews < 1) if (texture != 0 && numViews < 1)
{ {
context->validationError(GL_INVALID_VALUE, kErrorMultiviewViewsTooSmall); context->validationError(GL_INVALID_VALUE, kMultiviewViewsTooSmall);
return false; return false;
} }
const Extensions &extensions = context->getExtensions(); const Extensions &extensions = context->getExtensions();
if (static_cast<GLuint>(numViews) > extensions.maxViews) if (static_cast<GLuint>(numViews) > extensions.maxViews)
{ {
context->validationError(GL_INVALID_VALUE, kErrorMultiviewViewsTooLarge); context->validationError(GL_INVALID_VALUE, kMultiviewViewsTooLarge);
return false; return false;
} }
...@@ -69,14 +70,14 @@ bool ValidateFramebufferTextureMultiviewLevelAndFormat(Context *context, ...@@ -69,14 +70,14 @@ bool ValidateFramebufferTextureMultiviewLevelAndFormat(Context *context,
TextureType type = texture->getType(); TextureType type = texture->getType();
if (!ValidMipLevel(context, type, level)) if (!ValidMipLevel(context, type, level))
{ {
context->validationError(GL_INVALID_VALUE, kErrorInvalidMipLevel); context->validationError(GL_INVALID_VALUE, kInvalidMipLevel);
return false; return false;
} }
const auto &format = texture->getFormat(NonCubeTextureTypeToTarget(type), level); const auto &format = texture->getFormat(NonCubeTextureTypeToTarget(type), level);
if (format.info->compressed) if (format.info->compressed)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorCompressedTexturesNotAttachable); context->validationError(GL_INVALID_OPERATION, kCompressedTexturesNotAttachable);
return false; return false;
} }
return true; return true;
...@@ -86,7 +87,7 @@ bool ValidateUniformES3(Context *context, GLenum uniformType, GLint location, GL ...@@ -86,7 +87,7 @@ bool ValidateUniformES3(Context *context, GLenum uniformType, GLint location, GL
{ {
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES3Required); context->validationError(GL_INVALID_OPERATION, kES3Required);
return false; return false;
} }
...@@ -102,7 +103,7 @@ bool ValidateUniformMatrixES3(Context *context, ...@@ -102,7 +103,7 @@ bool ValidateUniformMatrixES3(Context *context,
// Check for ES3 uniform entry points // Check for ES3 uniform entry points
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES3Required); context->validationError(GL_INVALID_OPERATION, kES3Required);
return false; return false;
} }
...@@ -113,7 +114,7 @@ bool ValidateGenOrDeleteES3(Context *context, GLint n) ...@@ -113,7 +114,7 @@ bool ValidateGenOrDeleteES3(Context *context, GLint n)
{ {
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES3Required); context->validationError(GL_INVALID_OPERATION, kES3Required);
return false; return false;
} }
return ValidateGenOrDelete(context, n); return ValidateGenOrDelete(context, n);
...@@ -123,12 +124,12 @@ bool ValidateGenOrDeleteCountES3(Context *context, GLint count) ...@@ -123,12 +124,12 @@ bool ValidateGenOrDeleteCountES3(Context *context, GLint count)
{ {
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES3Required); context->validationError(GL_INVALID_OPERATION, kES3Required);
return false; return false;
} }
if (count < 0) if (count < 0)
{ {
context->validationError(GL_INVALID_VALUE, kErrorNegativeCount); context->validationError(GL_INVALID_VALUE, kNegativeCount);
return false; return false;
} }
return true; return true;
...@@ -145,19 +146,19 @@ bool ValidateCopyTexture3DCommon(Context *context, ...@@ -145,19 +146,19 @@ bool ValidateCopyTexture3DCommon(Context *context,
{ {
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES3Required); context->validationError(GL_INVALID_OPERATION, kES3Required);
return false; return false;
} }
if (!context->getExtensions().copyTexture3d) if (!context->getExtensions().copyTexture3d)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorANGLECopyTexture3DUnavailable); context->validationError(GL_INVALID_OPERATION, kANGLECopyTexture3DUnavailable);
return false; return false;
} }
if (!ValidTexture3DTarget(context, source->getType())) if (!ValidTexture3DTarget(context, source->getType()))
{ {
context->validationError(GL_INVALID_ENUM, kErrorInvalidTextureTarget); context->validationError(GL_INVALID_ENUM, kInvalidTextureTarget);
return false; return false;
} }
...@@ -179,13 +180,13 @@ bool ValidateCopyTexture3DCommon(Context *context, ...@@ -179,13 +180,13 @@ bool ValidateCopyTexture3DCommon(Context *context,
case GL_DEPTH_STENCIL: case GL_DEPTH_STENCIL:
break; break;
default: default:
context->validationError(GL_INVALID_OPERATION, kErrorInvalidInternalFormat); context->validationError(GL_INVALID_OPERATION, kInvalidInternalFormat);
return false; return false;
} }
if (!ValidTexture3DTarget(context, TextureTargetToType(destTarget))) if (!ValidTexture3DTarget(context, TextureTargetToType(destTarget)))
{ {
context->validationError(GL_INVALID_ENUM, kErrorInvalidTextureTarget); context->validationError(GL_INVALID_ENUM, kInvalidTextureTarget);
return false; return false;
} }
...@@ -249,7 +250,7 @@ bool ValidateCopyTexture3DCommon(Context *context, ...@@ -249,7 +250,7 @@ bool ValidateCopyTexture3DCommon(Context *context,
case GL_RGBA32UI: case GL_RGBA32UI:
break; break;
default: default:
context->validationError(GL_INVALID_OPERATION, kErrorInvalidInternalFormat); context->validationError(GL_INVALID_OPERATION, kInvalidInternalFormat);
return false; return false;
} }
...@@ -267,13 +268,13 @@ static bool ValidateTexImageFormatCombination(gl::Context *context, ...@@ -267,13 +268,13 @@ static bool ValidateTexImageFormatCombination(gl::Context *context,
// The type and format are valid if any supported internal format has that type and format // The type and format are valid if any supported internal format has that type and format
if (!ValidES3Format(format)) if (!ValidES3Format(format))
{ {
context->validationError(GL_INVALID_ENUM, kErrorInvalidFormat); context->validationError(GL_INVALID_ENUM, kInvalidFormat);
return false; return false;
} }
if (!ValidES3Type(type)) if (!ValidES3Type(type))
{ {
context->validationError(GL_INVALID_ENUM, kErrorInvalidType); context->validationError(GL_INVALID_ENUM, kInvalidType);
return false; return false;
} }
...@@ -283,7 +284,7 @@ static bool ValidateTexImageFormatCombination(gl::Context *context, ...@@ -283,7 +284,7 @@ static bool ValidateTexImageFormatCombination(gl::Context *context,
// the validation codepaths for glTexImage2D/3D, we record a GL_INVALID_VALUE error. // the validation codepaths for glTexImage2D/3D, we record a GL_INVALID_VALUE error.
if (!ValidES3InternalFormat(internalFormat)) if (!ValidES3InternalFormat(internalFormat))
{ {
context->validationError(GL_INVALID_VALUE, kErrorInvalidInternalFormat); context->validationError(GL_INVALID_VALUE, kInvalidInternalFormat);
return false; return false;
} }
...@@ -294,21 +295,21 @@ static bool ValidateTexImageFormatCombination(gl::Context *context, ...@@ -294,21 +295,21 @@ static bool ValidateTexImageFormatCombination(gl::Context *context,
// INVALID_OPERATION error. // INVALID_OPERATION error.
if (target == TextureType::_3D && (format == GL_DEPTH_COMPONENT || format == GL_DEPTH_STENCIL)) if (target == TextureType::_3D && (format == GL_DEPTH_COMPONENT || format == GL_DEPTH_STENCIL))
{ {
context->validationError(GL_INVALID_OPERATION, kError3DDepthStencil); context->validationError(GL_INVALID_OPERATION, k3DDepthStencil);
return false; return false;
} }
// Check if this is a valid format combination to load texture data // Check if this is a valid format combination to load texture data
if (!ValidES3FormatCombination(format, type, internalFormat)) if (!ValidES3FormatCombination(format, type, internalFormat))
{ {
context->validationError(GL_INVALID_OPERATION, kErrorInvalidFormatCombination); context->validationError(GL_INVALID_OPERATION, kInvalidFormatCombination);
return false; return false;
} }
const gl::InternalFormat &formatInfo = gl::GetInternalFormatInfo(internalFormat, type); const gl::InternalFormat &formatInfo = gl::GetInternalFormatInfo(internalFormat, type);
if (!formatInfo.textureSupport(context->getClientVersion(), context->getExtensions())) if (!formatInfo.textureSupport(context->getClientVersion(), context->getExtensions()))
{ {
context->validationError(GL_INVALID_OPERATION, kErrorInvalidInternalFormat); context->validationError(GL_INVALID_OPERATION, kInvalidInternalFormat);
return false; return false;
} }
...@@ -345,13 +346,13 @@ bool ValidateES3TexImageParametersBase(Context *context, ...@@ -345,13 +346,13 @@ bool ValidateES3TexImageParametersBase(Context *context,
// Verify zero border // Verify zero border
if (border != 0) if (border != 0)
{ {
context->validationError(GL_INVALID_VALUE, kErrorInvalidBorder); context->validationError(GL_INVALID_VALUE, kInvalidBorder);
return false; return false;
} }
if (xoffset < 0 || yoffset < 0 || zoffset < 0) if (xoffset < 0 || yoffset < 0 || zoffset < 0)
{ {
context->validationError(GL_INVALID_VALUE, kErrorNegativeOffset); context->validationError(GL_INVALID_VALUE, kNegativeOffset);
return false; return false;
} }
...@@ -359,7 +360,7 @@ bool ValidateES3TexImageParametersBase(Context *context, ...@@ -359,7 +360,7 @@ bool ValidateES3TexImageParametersBase(Context *context,
std::numeric_limits<GLsizei>::max() - yoffset < height || std::numeric_limits<GLsizei>::max() - yoffset < height ||
std::numeric_limits<GLsizei>::max() - zoffset < depth) std::numeric_limits<GLsizei>::max() - zoffset < depth)
{ {
context->validationError(GL_INVALID_VALUE, kErrorOffsetOverflow); context->validationError(GL_INVALID_VALUE, kOffsetOverflow);
return false; return false;
} }
...@@ -371,7 +372,7 @@ bool ValidateES3TexImageParametersBase(Context *context, ...@@ -371,7 +372,7 @@ bool ValidateES3TexImageParametersBase(Context *context,
if (static_cast<GLuint>(width) > (caps.max2DTextureSize >> level) || if (static_cast<GLuint>(width) > (caps.max2DTextureSize >> level) ||
static_cast<GLuint>(height) > (caps.max2DTextureSize >> level)) static_cast<GLuint>(height) > (caps.max2DTextureSize >> level))
{ {
context->validationError(GL_INVALID_VALUE, kErrorResourceMaxTextureSize); context->validationError(GL_INVALID_VALUE, kResourceMaxTextureSize);
return false; return false;
} }
break; break;
...@@ -381,12 +382,12 @@ bool ValidateES3TexImageParametersBase(Context *context, ...@@ -381,12 +382,12 @@ bool ValidateES3TexImageParametersBase(Context *context,
if (static_cast<GLuint>(width) > caps.maxRectangleTextureSize || if (static_cast<GLuint>(width) > caps.maxRectangleTextureSize ||
static_cast<GLuint>(height) > caps.maxRectangleTextureSize) static_cast<GLuint>(height) > caps.maxRectangleTextureSize)
{ {
context->validationError(GL_INVALID_VALUE, kErrorResourceMaxTextureSize); context->validationError(GL_INVALID_VALUE, kResourceMaxTextureSize);
return false; return false;
} }
if (isCompressed) if (isCompressed)
{ {
context->validationError(GL_INVALID_ENUM, kErrorRectangleTextureCompressed); context->validationError(GL_INVALID_ENUM, kRectangleTextureCompressed);
return false; return false;
} }
break; break;
...@@ -394,13 +395,13 @@ bool ValidateES3TexImageParametersBase(Context *context, ...@@ -394,13 +395,13 @@ bool ValidateES3TexImageParametersBase(Context *context,
case TextureType::CubeMap: case TextureType::CubeMap:
if (!isSubImage && width != height) if (!isSubImage && width != height)
{ {
context->validationError(GL_INVALID_VALUE, kErrorCubemapFacesEqualDimensions); context->validationError(GL_INVALID_VALUE, kCubemapFacesEqualDimensions);
return false; return false;
} }
if (static_cast<GLuint>(width) > (caps.maxCubeMapTextureSize >> level)) if (static_cast<GLuint>(width) > (caps.maxCubeMapTextureSize >> level))
{ {
context->validationError(GL_INVALID_VALUE, kErrorResourceMaxTextureSize); context->validationError(GL_INVALID_VALUE, kResourceMaxTextureSize);
return false; return false;
} }
break; break;
...@@ -410,7 +411,7 @@ bool ValidateES3TexImageParametersBase(Context *context, ...@@ -410,7 +411,7 @@ bool ValidateES3TexImageParametersBase(Context *context,
static_cast<GLuint>(height) > (caps.max3DTextureSize >> level) || static_cast<GLuint>(height) > (caps.max3DTextureSize >> level) ||
static_cast<GLuint>(depth) > (caps.max3DTextureSize >> level)) static_cast<GLuint>(depth) > (caps.max3DTextureSize >> level))
{ {
context->validationError(GL_INVALID_VALUE, kErrorResourceMaxTextureSize); context->validationError(GL_INVALID_VALUE, kResourceMaxTextureSize);
return false; return false;
} }
break; break;
...@@ -420,26 +421,26 @@ bool ValidateES3TexImageParametersBase(Context *context, ...@@ -420,26 +421,26 @@ bool ValidateES3TexImageParametersBase(Context *context,
static_cast<GLuint>(height) > (caps.max2DTextureSize >> level) || static_cast<GLuint>(height) > (caps.max2DTextureSize >> level) ||
static_cast<GLuint>(depth) > caps.maxArrayTextureLayers) static_cast<GLuint>(depth) > caps.maxArrayTextureLayers)
{ {
context->validationError(GL_INVALID_VALUE, kErrorResourceMaxTextureSize); context->validationError(GL_INVALID_VALUE, kResourceMaxTextureSize);
return false; return false;
} }
break; break;
default: default:
context->validationError(GL_INVALID_ENUM, kErrorEnumNotSupported); context->validationError(GL_INVALID_ENUM, kEnumNotSupported);
return false; return false;
} }
gl::Texture *texture = context->getTargetTexture(texType); gl::Texture *texture = context->getTargetTexture(texType);
if (!texture) if (!texture)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorMissingTexture); context->validationError(GL_INVALID_OPERATION, kMissingTexture);
return false; return false;
} }
if (texture->getImmutableFormat() && !isSubImage) if (texture->getImmutableFormat() && !isSubImage)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorTextureIsImmutable); context->validationError(GL_INVALID_OPERATION, kTextureIsImmutable);
return false; return false;
} }
...@@ -484,7 +485,7 @@ bool ValidateES3TexImageParametersBase(Context *context, ...@@ -484,7 +485,7 @@ bool ValidateES3TexImageParametersBase(Context *context,
if (actualInternalFormat == GL_ETC1_RGB8_OES) if (actualInternalFormat == GL_ETC1_RGB8_OES)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorInvalidInternalFormat); context->validationError(GL_INVALID_OPERATION, kInvalidInternalFormat);
return false; return false;
} }
} }
...@@ -500,13 +501,13 @@ bool ValidateES3TexImageParametersBase(Context *context, ...@@ -500,13 +501,13 @@ bool ValidateES3TexImageParametersBase(Context *context,
if (!actualFormatInfo.textureSupport(context->getClientVersion(), context->getExtensions())) if (!actualFormatInfo.textureSupport(context->getClientVersion(), context->getExtensions()))
{ {
context->validationError(GL_INVALID_ENUM, kErrorInvalidFormat); context->validationError(GL_INVALID_ENUM, kInvalidFormat);
return false; return false;
} }
if (texType == TextureType::_3D) if (texType == TextureType::_3D)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorInvalidTextureTarget); context->validationError(GL_INVALID_OPERATION, kInvalidTextureTarget);
return false; return false;
} }
} }
...@@ -524,13 +525,13 @@ bool ValidateES3TexImageParametersBase(Context *context, ...@@ -524,13 +525,13 @@ bool ValidateES3TexImageParametersBase(Context *context,
{ {
if (isCompressed != actualFormatInfo.compressed) if (isCompressed != actualFormatInfo.compressed)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorCompressedMismatch); context->validationError(GL_INVALID_OPERATION, kCompressedMismatch);
return false; return false;
} }
if (xoffset < 0 || yoffset < 0 || zoffset < 0) if (xoffset < 0 || yoffset < 0 || zoffset < 0)
{ {
context->validationError(GL_INVALID_VALUE, kErrorNegativeOffset); context->validationError(GL_INVALID_VALUE, kNegativeOffset);
return false; return false;
} }
...@@ -538,7 +539,7 @@ bool ValidateES3TexImageParametersBase(Context *context, ...@@ -538,7 +539,7 @@ bool ValidateES3TexImageParametersBase(Context *context,
std::numeric_limits<GLsizei>::max() - yoffset < height || std::numeric_limits<GLsizei>::max() - yoffset < height ||
std::numeric_limits<GLsizei>::max() - zoffset < depth) std::numeric_limits<GLsizei>::max() - zoffset < depth)
{ {
context->validationError(GL_INVALID_VALUE, kErrorOffsetOverflow); context->validationError(GL_INVALID_VALUE, kOffsetOverflow);
return false; return false;
} }
...@@ -546,14 +547,14 @@ bool ValidateES3TexImageParametersBase(Context *context, ...@@ -546,14 +547,14 @@ bool ValidateES3TexImageParametersBase(Context *context,
static_cast<size_t>(yoffset + height) > texture->getHeight(target, level) || static_cast<size_t>(yoffset + height) > texture->getHeight(target, level) ||
static_cast<size_t>(zoffset + depth) > texture->getDepth(target, level)) static_cast<size_t>(zoffset + depth) > texture->getDepth(target, level))
{ {
context->validationError(GL_INVALID_VALUE, kErrorOffsetOverflow); context->validationError(GL_INVALID_VALUE, kOffsetOverflow);
return false; return false;
} }
if (width > 0 && height > 0 && depth > 0 && pixels == nullptr && if (width > 0 && height > 0 && depth > 0 && pixels == nullptr &&
context->getGLState().getTargetBuffer(gl::BufferBinding::PixelUnpack) == nullptr) context->getGLState().getTargetBuffer(gl::BufferBinding::PixelUnpack) == nullptr)
{ {
context->validationError(GL_INVALID_VALUE, kErrorPixelDataNull); context->validationError(GL_INVALID_VALUE, kPixelDataNull);
return false; return false;
} }
} }
...@@ -617,7 +618,7 @@ bool ValidateES3TexImage2DParameters(Context *context, ...@@ -617,7 +618,7 @@ bool ValidateES3TexImage2DParameters(Context *context,
{ {
if (!ValidTexture2DDestinationTarget(context, target)) if (!ValidTexture2DDestinationTarget(context, target))
{ {
context->validationError(GL_INVALID_ENUM, kErrorInvalidTextureTarget); context->validationError(GL_INVALID_ENUM, kInvalidTextureTarget);
return false; return false;
} }
...@@ -646,14 +647,14 @@ bool ValidateES3TexImage3DParameters(Context *context, ...@@ -646,14 +647,14 @@ bool ValidateES3TexImage3DParameters(Context *context,
{ {
if (!ValidTexture3DDestinationTarget(context, target)) if (!ValidTexture3DDestinationTarget(context, target))
{ {
context->validationError(GL_INVALID_ENUM, kErrorInvalidTextureTarget); context->validationError(GL_INVALID_ENUM, kInvalidTextureTarget);
return false; return false;
} }
if (IsETC2EACFormat(format) && target != TextureType::_2DArray) if (IsETC2EACFormat(format) && target != TextureType::_2DArray)
{ {
// ES 3.1, Section 8.7, page 169. // ES 3.1, Section 8.7, page 169.
context->validationError(GL_INVALID_OPERATION, kErrorInternalFormatRequiresTexture2DArray); context->validationError(GL_INVALID_OPERATION, kInternalFormatRequiresTexture2DArray);
return false; return false;
} }
...@@ -948,7 +949,7 @@ bool ValidateES3CopyTexImageParametersBase(Context *context, ...@@ -948,7 +949,7 @@ bool ValidateES3CopyTexImageParametersBase(Context *context,
// is RGB9_E5 and copy to such a texture, generate INVALID_OPERATION. // is RGB9_E5 and copy to such a texture, generate INVALID_OPERATION.
if (textureFormat.info->internalFormat == GL_RGB9_E5) if (textureFormat.info->internalFormat == GL_RGB9_E5)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorInvalidFormat); context->validationError(GL_INVALID_OPERATION, kInvalidFormat);
return false; return false;
} }
...@@ -957,7 +958,7 @@ bool ValidateES3CopyTexImageParametersBase(Context *context, ...@@ -957,7 +958,7 @@ bool ValidateES3CopyTexImageParametersBase(Context *context,
if (!IsValidES3CopyTexImageCombination(*textureFormat.info, *source->getFormat().info, if (!IsValidES3CopyTexImageCombination(*textureFormat.info, *source->getFormat().info,
readFramebufferID)) readFramebufferID))
{ {
context->validationError(GL_INVALID_OPERATION, kErrorInvalidCopyCombination); context->validationError(GL_INVALID_OPERATION, kInvalidCopyCombination);
return false; return false;
} }
} }
...@@ -968,7 +969,7 @@ bool ValidateES3CopyTexImageParametersBase(Context *context, ...@@ -968,7 +969,7 @@ bool ValidateES3CopyTexImageParametersBase(Context *context,
const InternalFormat &copyFormat = GetInternalFormatInfo(internalformat, GL_UNSIGNED_BYTE); const InternalFormat &copyFormat = GetInternalFormatInfo(internalformat, GL_UNSIGNED_BYTE);
if (!IsValidES3CopyTexImageCombination(copyFormat, framebufferFormat, readFramebufferID)) if (!IsValidES3CopyTexImageCombination(copyFormat, framebufferFormat, readFramebufferID))
{ {
context->validationError(GL_INVALID_OPERATION, kErrorInvalidCopyCombination); context->validationError(GL_INVALID_OPERATION, kInvalidCopyCombination);
return false; return false;
} }
} }
...@@ -993,7 +994,7 @@ bool ValidateES3CopyTexImage2DParameters(Context *context, ...@@ -993,7 +994,7 @@ bool ValidateES3CopyTexImage2DParameters(Context *context,
{ {
if (!ValidTexture2DDestinationTarget(context, target)) if (!ValidTexture2DDestinationTarget(context, target))
{ {
context->validationError(GL_INVALID_ENUM, kErrorInvalidTextureTarget); context->validationError(GL_INVALID_ENUM, kInvalidTextureTarget);
return false; return false;
} }
...@@ -1018,7 +1019,7 @@ bool ValidateES3CopyTexImage3DParameters(Context *context, ...@@ -1018,7 +1019,7 @@ bool ValidateES3CopyTexImage3DParameters(Context *context,
{ {
if (!ValidTexture3DDestinationTarget(context, target)) if (!ValidTexture3DDestinationTarget(context, target))
{ {
context->validationError(GL_INVALID_ENUM, kErrorInvalidTextureTarget); context->validationError(GL_INVALID_ENUM, kInvalidTextureTarget);
return false; return false;
} }
...@@ -1037,7 +1038,7 @@ bool ValidateES3TexStorageParametersBase(Context *context, ...@@ -1037,7 +1038,7 @@ bool ValidateES3TexStorageParametersBase(Context *context,
{ {
if (width < 1 || height < 1 || depth < 1 || levels < 1) if (width < 1 || height < 1 || depth < 1 || levels < 1)
{ {
context->validationError(GL_INVALID_VALUE, kErrorTextureSizeTooSmall); context->validationError(GL_INVALID_VALUE, kTextureSizeTooSmall);
return false; return false;
} }
...@@ -1049,7 +1050,7 @@ bool ValidateES3TexStorageParametersBase(Context *context, ...@@ -1049,7 +1050,7 @@ bool ValidateES3TexStorageParametersBase(Context *context,
if (levels > gl::log2(maxDim) + 1) if (levels > gl::log2(maxDim) + 1)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorInvalidMipLevels); context->validationError(GL_INVALID_OPERATION, kInvalidMipLevels);
return false; return false;
} }
...@@ -1062,7 +1063,7 @@ bool ValidateES3TexStorageParametersBase(Context *context, ...@@ -1062,7 +1063,7 @@ bool ValidateES3TexStorageParametersBase(Context *context,
if (static_cast<GLuint>(width) > caps.max2DTextureSize || if (static_cast<GLuint>(width) > caps.max2DTextureSize ||
static_cast<GLuint>(height) > caps.max2DTextureSize) static_cast<GLuint>(height) > caps.max2DTextureSize)
{ {
context->validationError(GL_INVALID_VALUE, kErrorResourceMaxTextureSize); context->validationError(GL_INVALID_VALUE, kResourceMaxTextureSize);
return false; return false;
} }
} }
...@@ -1072,14 +1073,14 @@ bool ValidateES3TexStorageParametersBase(Context *context, ...@@ -1072,14 +1073,14 @@ bool ValidateES3TexStorageParametersBase(Context *context,
{ {
if (levels != 1) if (levels != 1)
{ {
context->validationError(GL_INVALID_VALUE, kErrorInvalidMipLevels); context->validationError(GL_INVALID_VALUE, kInvalidMipLevels);
return false; return false;
} }
if (static_cast<GLuint>(width) > caps.maxRectangleTextureSize || if (static_cast<GLuint>(width) > caps.maxRectangleTextureSize ||
static_cast<GLuint>(height) > caps.maxRectangleTextureSize) static_cast<GLuint>(height) > caps.maxRectangleTextureSize)
{ {
context->validationError(GL_INVALID_VALUE, kErrorResourceMaxTextureSize); context->validationError(GL_INVALID_VALUE, kResourceMaxTextureSize);
return false; return false;
} }
} }
...@@ -1089,13 +1090,13 @@ bool ValidateES3TexStorageParametersBase(Context *context, ...@@ -1089,13 +1090,13 @@ bool ValidateES3TexStorageParametersBase(Context *context,
{ {
if (width != height) if (width != height)
{ {
context->validationError(GL_INVALID_VALUE, kErrorCubemapFacesEqualDimensions); context->validationError(GL_INVALID_VALUE, kCubemapFacesEqualDimensions);
return false; return false;
} }
if (static_cast<GLuint>(width) > caps.maxCubeMapTextureSize) if (static_cast<GLuint>(width) > caps.maxCubeMapTextureSize)
{ {
context->validationError(GL_INVALID_VALUE, kErrorResourceMaxTextureSize); context->validationError(GL_INVALID_VALUE, kResourceMaxTextureSize);
return false; return false;
} }
} }
...@@ -1107,7 +1108,7 @@ bool ValidateES3TexStorageParametersBase(Context *context, ...@@ -1107,7 +1108,7 @@ bool ValidateES3TexStorageParametersBase(Context *context,
static_cast<GLuint>(height) > caps.max3DTextureSize || static_cast<GLuint>(height) > caps.max3DTextureSize ||
static_cast<GLuint>(depth) > caps.max3DTextureSize) static_cast<GLuint>(depth) > caps.max3DTextureSize)
{ {
context->validationError(GL_INVALID_VALUE, kErrorResourceMaxTextureSize); context->validationError(GL_INVALID_VALUE, kResourceMaxTextureSize);
return false; return false;
} }
} }
...@@ -1119,7 +1120,7 @@ bool ValidateES3TexStorageParametersBase(Context *context, ...@@ -1119,7 +1120,7 @@ bool ValidateES3TexStorageParametersBase(Context *context,
static_cast<GLuint>(height) > caps.max2DTextureSize || static_cast<GLuint>(height) > caps.max2DTextureSize ||
static_cast<GLuint>(depth) > caps.maxArrayTextureLayers) static_cast<GLuint>(depth) > caps.maxArrayTextureLayers)
{ {
context->validationError(GL_INVALID_VALUE, kErrorResourceMaxTextureSize); context->validationError(GL_INVALID_VALUE, kResourceMaxTextureSize);
return false; return false;
} }
} }
...@@ -1133,32 +1134,32 @@ bool ValidateES3TexStorageParametersBase(Context *context, ...@@ -1133,32 +1134,32 @@ bool ValidateES3TexStorageParametersBase(Context *context,
gl::Texture *texture = context->getTargetTexture(target); gl::Texture *texture = context->getTargetTexture(target);
if (!texture || texture->id() == 0) if (!texture || texture->id() == 0)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorMissingTexture); context->validationError(GL_INVALID_OPERATION, kMissingTexture);
return false; return false;
} }
if (texture->getImmutableFormat()) if (texture->getImmutableFormat())
{ {
context->validationError(GL_INVALID_OPERATION, kErrorTextureIsImmutable); context->validationError(GL_INVALID_OPERATION, kTextureIsImmutable);
return false; return false;
} }
const gl::InternalFormat &formatInfo = gl::GetSizedInternalFormatInfo(internalformat); const gl::InternalFormat &formatInfo = gl::GetSizedInternalFormatInfo(internalformat);
if (!formatInfo.textureSupport(context->getClientVersion(), context->getExtensions())) if (!formatInfo.textureSupport(context->getClientVersion(), context->getExtensions()))
{ {
context->validationError(GL_INVALID_ENUM, kErrorInvalidFormat); context->validationError(GL_INVALID_ENUM, kInvalidFormat);
return false; return false;
} }
if (!formatInfo.sized) if (!formatInfo.sized)
{ {
context->validationError(GL_INVALID_ENUM, kErrorInvalidFormat); context->validationError(GL_INVALID_ENUM, kInvalidFormat);
return false; return false;
} }
if (formatInfo.compressed && target == TextureType::Rectangle) if (formatInfo.compressed && target == TextureType::Rectangle)
{ {
context->validationError(GL_INVALID_ENUM, kErrorRectangleTextureCompressed); context->validationError(GL_INVALID_ENUM, kRectangleTextureCompressed);
return false; return false;
} }
...@@ -1175,7 +1176,7 @@ bool ValidateES3TexStorage2DParameters(Context *context, ...@@ -1175,7 +1176,7 @@ bool ValidateES3TexStorage2DParameters(Context *context,
{ {
if (!ValidTexture2DTarget(context, target)) if (!ValidTexture2DTarget(context, target))
{ {
context->validationError(GL_INVALID_ENUM, kErrorInvalidTextureTarget); context->validationError(GL_INVALID_ENUM, kInvalidTextureTarget);
return false; return false;
} }
...@@ -1193,7 +1194,7 @@ bool ValidateES3TexStorage3DParameters(Context *context, ...@@ -1193,7 +1194,7 @@ bool ValidateES3TexStorage3DParameters(Context *context,
{ {
if (!ValidTexture3DTarget(context, target)) if (!ValidTexture3DTarget(context, target))
{ {
context->validationError(GL_INVALID_ENUM, kErrorInvalidTextureTarget); context->validationError(GL_INVALID_ENUM, kInvalidTextureTarget);
return false; return false;
} }
...@@ -1205,7 +1206,7 @@ bool ValidateBeginQuery(gl::Context *context, QueryType target, GLuint id) ...@@ -1205,7 +1206,7 @@ bool ValidateBeginQuery(gl::Context *context, QueryType target, GLuint id)
{ {
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES3Required); context->validationError(GL_INVALID_OPERATION, kES3Required);
return false; return false;
} }
...@@ -1216,7 +1217,7 @@ bool ValidateEndQuery(gl::Context *context, QueryType target) ...@@ -1216,7 +1217,7 @@ bool ValidateEndQuery(gl::Context *context, QueryType target)
{ {
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES3Required); context->validationError(GL_INVALID_OPERATION, kES3Required);
return false; return false;
} }
...@@ -1227,7 +1228,7 @@ bool ValidateGetQueryiv(Context *context, QueryType target, GLenum pname, GLint ...@@ -1227,7 +1228,7 @@ bool ValidateGetQueryiv(Context *context, QueryType target, GLenum pname, GLint
{ {
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES3Required); context->validationError(GL_INVALID_OPERATION, kES3Required);
return false; return false;
} }
...@@ -1238,7 +1239,7 @@ bool ValidateGetQueryObjectuiv(Context *context, GLuint id, GLenum pname, GLuint ...@@ -1238,7 +1239,7 @@ bool ValidateGetQueryObjectuiv(Context *context, GLuint id, GLenum pname, GLuint
{ {
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES3Required); context->validationError(GL_INVALID_OPERATION, kES3Required);
return false; return false;
} }
...@@ -1254,7 +1255,7 @@ bool ValidateFramebufferTextureLayer(Context *context, ...@@ -1254,7 +1255,7 @@ bool ValidateFramebufferTextureLayer(Context *context,
{ {
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES3Required); context->validationError(GL_INVALID_OPERATION, kES3Required);
return false; return false;
} }
...@@ -1268,7 +1269,7 @@ bool ValidateFramebufferTextureLayer(Context *context, ...@@ -1268,7 +1269,7 @@ bool ValidateFramebufferTextureLayer(Context *context,
{ {
if (layer < 0) if (layer < 0)
{ {
context->validationError(GL_INVALID_VALUE, kErrorNegativeLayer); context->validationError(GL_INVALID_VALUE, kNegativeLayer);
return false; return false;
} }
...@@ -1281,15 +1282,13 @@ bool ValidateFramebufferTextureLayer(Context *context, ...@@ -1281,15 +1282,13 @@ bool ValidateFramebufferTextureLayer(Context *context,
{ {
if (level > gl::log2(caps.max2DTextureSize)) if (level > gl::log2(caps.max2DTextureSize))
{ {
context->validationError(GL_INVALID_VALUE, context->validationError(GL_INVALID_VALUE, kFramebufferTextureInvalidMipLevel);
kErrorFramebufferTextureInvalidMipLevel);
return false; return false;
} }
if (static_cast<GLuint>(layer) >= caps.maxArrayTextureLayers) if (static_cast<GLuint>(layer) >= caps.maxArrayTextureLayers)
{ {
context->validationError(GL_INVALID_VALUE, context->validationError(GL_INVALID_VALUE, kFramebufferTextureInvalidLayer);
kErrorFramebufferTextureInvalidLayer);
return false; return false;
} }
} }
...@@ -1299,15 +1298,13 @@ bool ValidateFramebufferTextureLayer(Context *context, ...@@ -1299,15 +1298,13 @@ bool ValidateFramebufferTextureLayer(Context *context,
{ {
if (level > gl::log2(caps.max3DTextureSize)) if (level > gl::log2(caps.max3DTextureSize))
{ {
context->validationError(GL_INVALID_VALUE, context->validationError(GL_INVALID_VALUE, kFramebufferTextureInvalidMipLevel);
kErrorFramebufferTextureInvalidMipLevel);
return false; return false;
} }
if (static_cast<GLuint>(layer) >= caps.max3DTextureSize) if (static_cast<GLuint>(layer) >= caps.max3DTextureSize)
{ {
context->validationError(GL_INVALID_VALUE, context->validationError(GL_INVALID_VALUE, kFramebufferTextureInvalidLayer);
kErrorFramebufferTextureInvalidLayer);
return false; return false;
} }
} }
...@@ -1317,15 +1314,13 @@ bool ValidateFramebufferTextureLayer(Context *context, ...@@ -1317,15 +1314,13 @@ bool ValidateFramebufferTextureLayer(Context *context,
{ {
if (level != 0) if (level != 0)
{ {
context->validationError(GL_INVALID_VALUE, context->validationError(GL_INVALID_VALUE, kFramebufferTextureInvalidMipLevel);
kErrorFramebufferTextureInvalidMipLevel);
return false; return false;
} }
if (static_cast<GLuint>(layer) >= caps.maxArrayTextureLayers) if (static_cast<GLuint>(layer) >= caps.maxArrayTextureLayers)
{ {
context->validationError(GL_INVALID_VALUE, context->validationError(GL_INVALID_VALUE, kFramebufferTextureInvalidLayer);
kErrorFramebufferTextureInvalidLayer);
return false; return false;
} }
} }
...@@ -1333,14 +1328,14 @@ bool ValidateFramebufferTextureLayer(Context *context, ...@@ -1333,14 +1328,14 @@ bool ValidateFramebufferTextureLayer(Context *context,
default: default:
context->validationError(GL_INVALID_OPERATION, context->validationError(GL_INVALID_OPERATION,
kErrorFramebufferTextureLayerIncorrectTextureType); kFramebufferTextureLayerIncorrectTextureType);
return false; return false;
} }
const auto &format = tex->getFormat(NonCubeTextureTypeToTarget(tex->getType()), level); const auto &format = tex->getFormat(NonCubeTextureTypeToTarget(tex->getType()), level);
if (format.info->compressed) if (format.info->compressed)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorCompressedTexturesNotAttachable); context->validationError(GL_INVALID_OPERATION, kCompressedTexturesNotAttachable);
return false; return false;
} }
} }
...@@ -1355,7 +1350,7 @@ bool ValidateInvalidateFramebuffer(Context *context, ...@@ -1355,7 +1350,7 @@ bool ValidateInvalidateFramebuffer(Context *context,
{ {
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES3Required); context->validationError(GL_INVALID_OPERATION, kES3Required);
return false; return false;
} }
...@@ -1371,7 +1366,7 @@ bool ValidateInvalidateFramebuffer(Context *context, ...@@ -1371,7 +1366,7 @@ bool ValidateInvalidateFramebuffer(Context *context,
defaultFramebuffer = context->getGLState().getReadFramebuffer()->id() == 0; defaultFramebuffer = context->getGLState().getReadFramebuffer()->id() == 0;
break; break;
default: default:
context->validationError(GL_INVALID_ENUM, kErrorInvalidFramebufferTarget); context->validationError(GL_INVALID_ENUM, kInvalidFramebufferTarget);
return false; return false;
} }
...@@ -1390,7 +1385,7 @@ bool ValidateInvalidateSubFramebuffer(Context *context, ...@@ -1390,7 +1385,7 @@ bool ValidateInvalidateSubFramebuffer(Context *context,
{ {
if (width < 0 || height < 0) if (width < 0 || height < 0)
{ {
context->validationError(GL_INVALID_VALUE, kErrorNegativeSize); context->validationError(GL_INVALID_VALUE, kNegativeSize);
return false; return false;
} }
...@@ -1401,7 +1396,7 @@ bool ValidateClearBuffer(Context *context) ...@@ -1401,7 +1396,7 @@ bool ValidateClearBuffer(Context *context)
{ {
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES3Required); context->validationError(GL_INVALID_OPERATION, kES3Required);
return false; return false;
} }
...@@ -1423,7 +1418,7 @@ bool ValidateDrawRangeElements(Context *context, ...@@ -1423,7 +1418,7 @@ bool ValidateDrawRangeElements(Context *context,
{ {
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES3Required); context->validationError(GL_INVALID_OPERATION, kES3Required);
return false; return false;
} }
...@@ -1462,7 +1457,7 @@ bool ValidateGetUniformuiv(Context *context, GLuint program, GLint location, GLu ...@@ -1462,7 +1457,7 @@ bool ValidateGetUniformuiv(Context *context, GLuint program, GLint location, GLu
{ {
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES3Required); context->validationError(GL_INVALID_OPERATION, kES3Required);
return false; return false;
} }
...@@ -1473,7 +1468,7 @@ bool ValidateReadBuffer(Context *context, GLenum src) ...@@ -1473,7 +1468,7 @@ bool ValidateReadBuffer(Context *context, GLenum src)
{ {
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES3Required); context->validationError(GL_INVALID_OPERATION, kES3Required);
return false; return false;
} }
...@@ -1534,13 +1529,13 @@ bool ValidateCompressedTexImage3D(Context *context, ...@@ -1534,13 +1529,13 @@ bool ValidateCompressedTexImage3D(Context *context,
{ {
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES3Required); context->validationError(GL_INVALID_OPERATION, kES3Required);
return false; return false;
} }
if (!ValidTextureTarget(context, target)) if (!ValidTextureTarget(context, target))
{ {
context->validationError(GL_INVALID_ENUM, kErrorInvalidTextureTarget); context->validationError(GL_INVALID_ENUM, kInvalidTextureTarget);
return false; return false;
} }
...@@ -1554,20 +1549,20 @@ bool ValidateCompressedTexImage3D(Context *context, ...@@ -1554,20 +1549,20 @@ bool ValidateCompressedTexImage3D(Context *context,
const InternalFormat &formatInfo = GetSizedInternalFormatInfo(internalformat); const InternalFormat &formatInfo = GetSizedInternalFormatInfo(internalformat);
if (!formatInfo.compressed) if (!formatInfo.compressed)
{ {
context->validationError(GL_INVALID_ENUM, kErrorInvalidCompressedFormat); context->validationError(GL_INVALID_ENUM, kInvalidCompressedFormat);
return false; return false;
} }
GLuint blockSize = 0; GLuint blockSize = 0;
if (!formatInfo.computeCompressedImageSize(gl::Extents(width, height, depth), &blockSize)) if (!formatInfo.computeCompressedImageSize(gl::Extents(width, height, depth), &blockSize))
{ {
context->validationError(GL_INVALID_VALUE, kErrorIntegerOverflow); context->validationError(GL_INVALID_VALUE, kIntegerOverflow);
return false; return false;
} }
if (imageSize < 0 || static_cast<GLuint>(imageSize) != blockSize) if (imageSize < 0 || static_cast<GLuint>(imageSize) != blockSize)
{ {
context->validationError(GL_INVALID_VALUE, kErrorInvalidCompressedImageSize); context->validationError(GL_INVALID_VALUE, kInvalidCompressedImageSize);
return false; return false;
} }
...@@ -1615,7 +1610,7 @@ bool ValidateBindVertexArray(Context *context, GLuint array) ...@@ -1615,7 +1610,7 @@ bool ValidateBindVertexArray(Context *context, GLuint array)
{ {
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES3Required); context->validationError(GL_INVALID_OPERATION, kES3Required);
return false; return false;
} }
...@@ -1626,7 +1621,7 @@ bool ValidateIsVertexArray(Context *context, GLuint array) ...@@ -1626,7 +1621,7 @@ bool ValidateIsVertexArray(Context *context, GLuint array)
{ {
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES3Required); context->validationError(GL_INVALID_OPERATION, kES3Required);
return false; return false;
} }
...@@ -1642,7 +1637,7 @@ static bool ValidateBindBufferCommon(Context *context, ...@@ -1642,7 +1637,7 @@ static bool ValidateBindBufferCommon(Context *context,
{ {
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES3Required); context->validationError(GL_INVALID_OPERATION, kES3Required);
return false; return false;
} }
...@@ -1798,7 +1793,7 @@ bool ValidateProgramBinary(Context *context, ...@@ -1798,7 +1793,7 @@ bool ValidateProgramBinary(Context *context,
{ {
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES3Required); context->validationError(GL_INVALID_OPERATION, kES3Required);
return false; return false;
} }
...@@ -1814,7 +1809,7 @@ bool ValidateGetProgramBinary(Context *context, ...@@ -1814,7 +1809,7 @@ bool ValidateGetProgramBinary(Context *context,
{ {
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES3Required); context->validationError(GL_INVALID_OPERATION, kES3Required);
return false; return false;
} }
...@@ -1825,7 +1820,7 @@ bool ValidateProgramParameteri(Context *context, GLuint program, GLenum pname, G ...@@ -1825,7 +1820,7 @@ bool ValidateProgramParameteri(Context *context, GLuint program, GLenum pname, G
{ {
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES3Required); context->validationError(GL_INVALID_OPERATION, kES3Required);
return false; return false;
} }
...@@ -1839,7 +1834,7 @@ bool ValidateProgramParameteri(Context *context, GLuint program, GLenum pname, G ...@@ -1839,7 +1834,7 @@ bool ValidateProgramParameteri(Context *context, GLuint program, GLenum pname, G
case GL_PROGRAM_BINARY_RETRIEVABLE_HINT: case GL_PROGRAM_BINARY_RETRIEVABLE_HINT:
if (value != GL_FALSE && value != GL_TRUE) if (value != GL_FALSE && value != GL_TRUE)
{ {
context->validationError(GL_INVALID_VALUE, kErrorInvalidBooleanValue); context->validationError(GL_INVALID_VALUE, kInvalidBooleanValue);
return false; return false;
} }
break; break;
...@@ -1847,19 +1842,19 @@ bool ValidateProgramParameteri(Context *context, GLuint program, GLenum pname, G ...@@ -1847,19 +1842,19 @@ bool ValidateProgramParameteri(Context *context, GLuint program, GLenum pname, G
case GL_PROGRAM_SEPARABLE: case GL_PROGRAM_SEPARABLE:
if (context->getClientVersion() < ES_3_1) if (context->getClientVersion() < ES_3_1)
{ {
context->validationError(GL_INVALID_ENUM, kErrorES31Required); context->validationError(GL_INVALID_ENUM, kES31Required);
return false; return false;
} }
if (value != GL_FALSE && value != GL_TRUE) if (value != GL_FALSE && value != GL_TRUE)
{ {
context->validationError(GL_INVALID_VALUE, kErrorInvalidBooleanValue); context->validationError(GL_INVALID_VALUE, kInvalidBooleanValue);
return false; return false;
} }
break; break;
default: default:
context->validationError(GL_INVALID_ENUM, kErrorInvalidPname); context->validationError(GL_INVALID_ENUM, kInvalidPname);
return false; return false;
} }
...@@ -1880,7 +1875,7 @@ bool ValidateBlitFramebuffer(Context *context, ...@@ -1880,7 +1875,7 @@ bool ValidateBlitFramebuffer(Context *context,
{ {
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES3Required); context->validationError(GL_INVALID_OPERATION, kES3Required);
return false; return false;
} }
...@@ -1896,7 +1891,7 @@ bool ValidateClearBufferiv(Context *context, GLenum buffer, GLint drawbuffer, co ...@@ -1896,7 +1891,7 @@ bool ValidateClearBufferiv(Context *context, GLenum buffer, GLint drawbuffer, co
if (drawbuffer < 0 || if (drawbuffer < 0 ||
static_cast<GLuint>(drawbuffer) >= context->getCaps().maxDrawBuffers) static_cast<GLuint>(drawbuffer) >= context->getCaps().maxDrawBuffers)
{ {
context->validationError(GL_INVALID_VALUE, kErrorIndexExceedsMaxDrawBuffer); context->validationError(GL_INVALID_VALUE, kIndexExceedsMaxDrawBuffer);
return false; return false;
} }
if (context->getExtensions().webglCompatibility) if (context->getExtensions().webglCompatibility)
...@@ -1913,13 +1908,13 @@ bool ValidateClearBufferiv(Context *context, GLenum buffer, GLint drawbuffer, co ...@@ -1913,13 +1908,13 @@ bool ValidateClearBufferiv(Context *context, GLenum buffer, GLint drawbuffer, co
case GL_STENCIL: case GL_STENCIL:
if (drawbuffer != 0) if (drawbuffer != 0)
{ {
context->validationError(GL_INVALID_VALUE, kErrorInvalidDepthStencilDrawBuffer); context->validationError(GL_INVALID_VALUE, kInvalidDepthStencilDrawBuffer);
return false; return false;
} }
break; break;
default: default:
context->validationError(GL_INVALID_ENUM, kErrorEnumNotSupported); context->validationError(GL_INVALID_ENUM, kEnumNotSupported);
return false; return false;
} }
...@@ -1934,7 +1929,7 @@ bool ValidateClearBufferuiv(Context *context, GLenum buffer, GLint drawbuffer, c ...@@ -1934,7 +1929,7 @@ bool ValidateClearBufferuiv(Context *context, GLenum buffer, GLint drawbuffer, c
if (drawbuffer < 0 || if (drawbuffer < 0 ||
static_cast<GLuint>(drawbuffer) >= context->getCaps().maxDrawBuffers) static_cast<GLuint>(drawbuffer) >= context->getCaps().maxDrawBuffers)
{ {
context->validationError(GL_INVALID_VALUE, kErrorIndexExceedsMaxDrawBuffer); context->validationError(GL_INVALID_VALUE, kIndexExceedsMaxDrawBuffer);
return false; return false;
} }
if (context->getExtensions().webglCompatibility) if (context->getExtensions().webglCompatibility)
...@@ -1949,7 +1944,7 @@ bool ValidateClearBufferuiv(Context *context, GLenum buffer, GLint drawbuffer, c ...@@ -1949,7 +1944,7 @@ bool ValidateClearBufferuiv(Context *context, GLenum buffer, GLint drawbuffer, c
break; break;
default: default:
context->validationError(GL_INVALID_ENUM, kErrorEnumNotSupported); context->validationError(GL_INVALID_ENUM, kEnumNotSupported);
return false; return false;
} }
...@@ -1964,7 +1959,7 @@ bool ValidateClearBufferfv(Context *context, GLenum buffer, GLint drawbuffer, co ...@@ -1964,7 +1959,7 @@ bool ValidateClearBufferfv(Context *context, GLenum buffer, GLint drawbuffer, co
if (drawbuffer < 0 || if (drawbuffer < 0 ||
static_cast<GLuint>(drawbuffer) >= context->getCaps().maxDrawBuffers) static_cast<GLuint>(drawbuffer) >= context->getCaps().maxDrawBuffers)
{ {
context->validationError(GL_INVALID_VALUE, kErrorIndexExceedsMaxDrawBuffer); context->validationError(GL_INVALID_VALUE, kIndexExceedsMaxDrawBuffer);
return false; return false;
} }
if (context->getExtensions().webglCompatibility) if (context->getExtensions().webglCompatibility)
...@@ -1982,13 +1977,13 @@ bool ValidateClearBufferfv(Context *context, GLenum buffer, GLint drawbuffer, co ...@@ -1982,13 +1977,13 @@ bool ValidateClearBufferfv(Context *context, GLenum buffer, GLint drawbuffer, co
case GL_DEPTH: case GL_DEPTH:
if (drawbuffer != 0) if (drawbuffer != 0)
{ {
context->validationError(GL_INVALID_VALUE, kErrorInvalidDepthStencilDrawBuffer); context->validationError(GL_INVALID_VALUE, kInvalidDepthStencilDrawBuffer);
return false; return false;
} }
break; break;
default: default:
context->validationError(GL_INVALID_ENUM, kErrorEnumNotSupported); context->validationError(GL_INVALID_ENUM, kEnumNotSupported);
return false; return false;
} }
...@@ -2006,13 +2001,13 @@ bool ValidateClearBufferfi(Context *context, ...@@ -2006,13 +2001,13 @@ bool ValidateClearBufferfi(Context *context,
case GL_DEPTH_STENCIL: case GL_DEPTH_STENCIL:
if (drawbuffer != 0) if (drawbuffer != 0)
{ {
context->validationError(GL_INVALID_VALUE, kErrorInvalidDepthStencilDrawBuffer); context->validationError(GL_INVALID_VALUE, kInvalidDepthStencilDrawBuffer);
return false; return false;
} }
break; break;
default: default:
context->validationError(GL_INVALID_ENUM, kErrorEnumNotSupported); context->validationError(GL_INVALID_ENUM, kEnumNotSupported);
return false; return false;
} }
...@@ -2023,7 +2018,7 @@ bool ValidateDrawBuffers(Context *context, GLsizei n, const GLenum *bufs) ...@@ -2023,7 +2018,7 @@ bool ValidateDrawBuffers(Context *context, GLsizei n, const GLenum *bufs)
{ {
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES3Required); context->validationError(GL_INVALID_OPERATION, kES3Required);
return false; return false;
} }
...@@ -2043,7 +2038,7 @@ bool ValidateCopyTexSubImage3D(Context *context, ...@@ -2043,7 +2038,7 @@ bool ValidateCopyTexSubImage3D(Context *context,
{ {
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES3Required); context->validationError(GL_INVALID_OPERATION, kES3Required);
return false; return false;
} }
...@@ -2066,7 +2061,7 @@ bool ValidateCopyTexture3DANGLE(Context *context, ...@@ -2066,7 +2061,7 @@ bool ValidateCopyTexture3DANGLE(Context *context,
const Texture *source = context->getTexture(sourceId); const Texture *source = context->getTexture(sourceId);
if (source == nullptr) if (source == nullptr)
{ {
context->validationError(GL_INVALID_VALUE, kErrorInvalidSourceTexture); context->validationError(GL_INVALID_VALUE, kInvalidSourceTexture);
return false; return false;
} }
...@@ -2078,7 +2073,7 @@ bool ValidateCopyTexture3DANGLE(Context *context, ...@@ -2078,7 +2073,7 @@ bool ValidateCopyTexture3DANGLE(Context *context,
const Texture *dest = context->getTexture(destId); const Texture *dest = context->getTexture(destId);
if (dest == nullptr) if (dest == nullptr)
{ {
context->validationError(GL_INVALID_VALUE, kErrorInvalidDestinationTexture); context->validationError(GL_INVALID_VALUE, kInvalidDestinationTexture);
return false; return false;
} }
...@@ -2091,7 +2086,7 @@ bool ValidateCopyTexture3DANGLE(Context *context, ...@@ -2091,7 +2086,7 @@ bool ValidateCopyTexture3DANGLE(Context *context,
if (!ValidMipLevel(context, source->getType(), sourceLevel)) if (!ValidMipLevel(context, source->getType(), sourceLevel))
{ {
context->validationError(GL_INVALID_VALUE, kErrorInvalidSourceTextureLevel); context->validationError(GL_INVALID_VALUE, kInvalidSourceTextureLevel);
return false; return false;
} }
...@@ -2099,13 +2094,13 @@ bool ValidateCopyTexture3DANGLE(Context *context, ...@@ -2099,13 +2094,13 @@ bool ValidateCopyTexture3DANGLE(Context *context,
GLsizei sourceHeight = static_cast<GLsizei>(source->getHeight(sourceTarget, sourceLevel)); GLsizei sourceHeight = static_cast<GLsizei>(source->getHeight(sourceTarget, sourceLevel));
if (sourceWidth == 0 || sourceHeight == 0) if (sourceWidth == 0 || sourceHeight == 0)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorInvalidSourceTextureSize); context->validationError(GL_INVALID_OPERATION, kInvalidSourceTextureSize);
return false; return false;
} }
if (dest->getImmutableFormat()) if (dest->getImmutableFormat())
{ {
context->validationError(GL_INVALID_OPERATION, kErrorDestinationImmutable); context->validationError(GL_INVALID_OPERATION, kDestinationImmutable);
return false; return false;
} }
...@@ -2134,7 +2129,7 @@ bool ValidateCopySubTexture3DANGLE(Context *context, ...@@ -2134,7 +2129,7 @@ bool ValidateCopySubTexture3DANGLE(Context *context,
const Texture *source = context->getTexture(sourceId); const Texture *source = context->getTexture(sourceId);
if (source == nullptr) if (source == nullptr)
{ {
context->validationError(GL_INVALID_VALUE, kErrorInvalidSourceTexture); context->validationError(GL_INVALID_VALUE, kInvalidSourceTexture);
return false; return false;
} }
...@@ -2146,7 +2141,7 @@ bool ValidateCopySubTexture3DANGLE(Context *context, ...@@ -2146,7 +2141,7 @@ bool ValidateCopySubTexture3DANGLE(Context *context,
const Texture *dest = context->getTexture(destId); const Texture *dest = context->getTexture(destId);
if (dest == nullptr) if (dest == nullptr)
{ {
context->validationError(GL_INVALID_VALUE, kErrorInvalidDestinationTexture); context->validationError(GL_INVALID_VALUE, kInvalidDestinationTexture);
return false; return false;
} }
...@@ -2161,13 +2156,13 @@ bool ValidateCopySubTexture3DANGLE(Context *context, ...@@ -2161,13 +2156,13 @@ bool ValidateCopySubTexture3DANGLE(Context *context,
if (x < 0 || y < 0 || z < 0) if (x < 0 || y < 0 || z < 0)
{ {
context->validationError(GL_INVALID_VALUE, kErrorNegativeXYZ); context->validationError(GL_INVALID_VALUE, kNegativeXYZ);
return false; return false;
} }
if (width < 0 || height < 0 || depth < 0) if (width < 0 || height < 0 || depth < 0)
{ {
context->validationError(GL_INVALID_VALUE, kErrorNegativeHeightWidthDepth); context->validationError(GL_INVALID_VALUE, kNegativeHeightWidthDepth);
return false; return false;
} }
...@@ -2175,19 +2170,19 @@ bool ValidateCopySubTexture3DANGLE(Context *context, ...@@ -2175,19 +2170,19 @@ bool ValidateCopySubTexture3DANGLE(Context *context,
static_cast<size_t>(y + height) > source->getHeight(sourceTarget, sourceLevel) || static_cast<size_t>(y + height) > source->getHeight(sourceTarget, sourceLevel) ||
static_cast<size_t>(z + depth) > source->getDepth(sourceTarget, sourceLevel)) static_cast<size_t>(z + depth) > source->getDepth(sourceTarget, sourceLevel))
{ {
context->validationError(GL_INVALID_VALUE, kErrorSourceTextureTooSmall); context->validationError(GL_INVALID_VALUE, kSourceTextureTooSmall);
return false; return false;
} }
if (TextureTargetToType(destTarget) != dest->getType()) if (TextureTargetToType(destTarget) != dest->getType())
{ {
context->validationError(GL_INVALID_VALUE, kErrorInvalidDestinationTextureType); context->validationError(GL_INVALID_VALUE, kInvalidDestinationTextureType);
return false; return false;
} }
if (xoffset < 0 || yoffset < 0 || zoffset < 0) if (xoffset < 0 || yoffset < 0 || zoffset < 0)
{ {
context->validationError(GL_INVALID_VALUE, kErrorNegativeOffset); context->validationError(GL_INVALID_VALUE, kNegativeOffset);
return false; return false;
} }
...@@ -2195,7 +2190,7 @@ bool ValidateCopySubTexture3DANGLE(Context *context, ...@@ -2195,7 +2190,7 @@ bool ValidateCopySubTexture3DANGLE(Context *context,
static_cast<size_t>(yoffset + height) > dest->getHeight(destTarget, destLevel) || static_cast<size_t>(yoffset + height) > dest->getHeight(destTarget, destLevel) ||
static_cast<size_t>(zoffset + depth) > dest->getDepth(destTarget, destLevel)) static_cast<size_t>(zoffset + depth) > dest->getDepth(destTarget, destLevel))
{ {
context->validationError(GL_INVALID_VALUE, kErrorDestinationTextureTooSmall); context->validationError(GL_INVALID_VALUE, kDestinationTextureTooSmall);
return false; return false;
} }
...@@ -2216,7 +2211,7 @@ bool ValidateTexImage3D(Context *context, ...@@ -2216,7 +2211,7 @@ bool ValidateTexImage3D(Context *context,
{ {
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES3Required); context->validationError(GL_INVALID_OPERATION, kES3Required);
return false; return false;
} }
...@@ -2240,7 +2235,7 @@ bool ValidateTexImage3DRobustANGLE(Context *context, ...@@ -2240,7 +2235,7 @@ bool ValidateTexImage3DRobustANGLE(Context *context,
{ {
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES3Required); context->validationError(GL_INVALID_OPERATION, kES3Required);
return false; return false;
} }
...@@ -2269,7 +2264,7 @@ bool ValidateTexSubImage3D(Context *context, ...@@ -2269,7 +2264,7 @@ bool ValidateTexSubImage3D(Context *context,
{ {
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES3Required); context->validationError(GL_INVALID_OPERATION, kES3Required);
return false; return false;
} }
...@@ -2294,7 +2289,7 @@ bool ValidateTexSubImage3DRobustANGLE(Context *context, ...@@ -2294,7 +2289,7 @@ bool ValidateTexSubImage3DRobustANGLE(Context *context,
{ {
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES3Required); context->validationError(GL_INVALID_OPERATION, kES3Required);
return false; return false;
} }
...@@ -2323,27 +2318,27 @@ bool ValidateCompressedTexSubImage3D(Context *context, ...@@ -2323,27 +2318,27 @@ bool ValidateCompressedTexSubImage3D(Context *context,
{ {
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES3Required); context->validationError(GL_INVALID_OPERATION, kES3Required);
return false; return false;
} }
const InternalFormat &formatInfo = GetSizedInternalFormatInfo(format); const InternalFormat &formatInfo = GetSizedInternalFormatInfo(format);
if (!formatInfo.compressed) if (!formatInfo.compressed)
{ {
context->validationError(GL_INVALID_ENUM, kErrorInvalidCompressedFormat); context->validationError(GL_INVALID_ENUM, kInvalidCompressedFormat);
return false; return false;
} }
GLuint blockSize = 0; GLuint blockSize = 0;
if (!formatInfo.computeCompressedImageSize(gl::Extents(width, height, depth), &blockSize)) if (!formatInfo.computeCompressedImageSize(gl::Extents(width, height, depth), &blockSize))
{ {
context->validationError(GL_INVALID_OPERATION, kErrorIntegerOverflow); context->validationError(GL_INVALID_OPERATION, kIntegerOverflow);
return false; return false;
} }
if (imageSize < 0 || static_cast<GLuint>(imageSize) != blockSize) if (imageSize < 0 || static_cast<GLuint>(imageSize) != blockSize)
{ {
context->validationError(GL_INVALID_VALUE, kErrorInvalidCompressedImageSize); context->validationError(GL_INVALID_VALUE, kInvalidCompressedImageSize);
return false; return false;
} }
...@@ -2356,7 +2351,7 @@ bool ValidateCompressedTexSubImage3D(Context *context, ...@@ -2356,7 +2351,7 @@ bool ValidateCompressedTexSubImage3D(Context *context,
if (!data) if (!data)
{ {
context->validationError(GL_INVALID_VALUE, kErrorPixelDataNull); context->validationError(GL_INVALID_VALUE, kPixelDataNull);
return false; return false;
} }
...@@ -2445,7 +2440,7 @@ bool ValidateBeginTransformFeedback(Context *context, PrimitiveMode primitiveMod ...@@ -2445,7 +2440,7 @@ bool ValidateBeginTransformFeedback(Context *context, PrimitiveMode primitiveMod
{ {
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES3Required); context->validationError(GL_INVALID_OPERATION, kES3Required);
return false; return false;
} }
switch (primitiveMode) switch (primitiveMode)
...@@ -2485,7 +2480,7 @@ bool ValidateBeginTransformFeedback(Context *context, PrimitiveMode primitiveMod ...@@ -2485,7 +2480,7 @@ bool ValidateBeginTransformFeedback(Context *context, PrimitiveMode primitiveMod
buffer->isDoubleBoundForTransformFeedback()) buffer->isDoubleBoundForTransformFeedback())
{ {
context->validationError(GL_INVALID_OPERATION, context->validationError(GL_INVALID_OPERATION,
kErrorDoubleBoundTransformFeedbackBuffer); kTransformFeedbackBufferMultipleOutputs);
return false; return false;
} }
} }
...@@ -2495,13 +2490,13 @@ bool ValidateBeginTransformFeedback(Context *context, PrimitiveMode primitiveMod ...@@ -2495,13 +2490,13 @@ bool ValidateBeginTransformFeedback(Context *context, PrimitiveMode primitiveMod
if (!program) if (!program)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorProgramNotBound); context->validationError(GL_INVALID_OPERATION, kProgramNotBound);
return false; return false;
} }
if (program->getTransformFeedbackVaryingCount() == 0) if (program->getTransformFeedbackVaryingCount() == 0)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorNoTransformFeedbackOutputVariables); context->validationError(GL_INVALID_OPERATION, kNoTransformFeedbackOutputVariables);
return false; return false;
} }
...@@ -2546,7 +2541,7 @@ bool ValidateUnmapBuffer(Context *context, BufferBinding target) ...@@ -2546,7 +2541,7 @@ bool ValidateUnmapBuffer(Context *context, BufferBinding target)
{ {
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES3Required); context->validationError(GL_INVALID_OPERATION, kES3Required);
return false; return false;
} }
...@@ -2561,7 +2556,7 @@ bool ValidateMapBufferRange(Context *context, ...@@ -2561,7 +2556,7 @@ bool ValidateMapBufferRange(Context *context,
{ {
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES3Required); context->validationError(GL_INVALID_OPERATION, kES3Required);
return false; return false;
} }
...@@ -2575,7 +2570,7 @@ bool ValidateFlushMappedBufferRange(Context *context, ...@@ -2575,7 +2570,7 @@ bool ValidateFlushMappedBufferRange(Context *context,
{ {
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES3Required); context->validationError(GL_INVALID_OPERATION, kES3Required);
return false; return false;
} }
...@@ -2593,7 +2588,7 @@ bool ValidateIndexedStateQuery(Context *context, GLenum pname, GLuint index, GLs ...@@ -2593,7 +2588,7 @@ bool ValidateIndexedStateQuery(Context *context, GLenum pname, GLuint index, GLs
unsigned int numParams; unsigned int numParams;
if (!context->getIndexedQueryParameterInfo(pname, &nativeType, &numParams)) if (!context->getIndexedQueryParameterInfo(pname, &nativeType, &numParams))
{ {
context->validationError(GL_INVALID_ENUM, kErrorInvalidPname); context->validationError(GL_INVALID_ENUM, kInvalidPname);
return false; return false;
} }
...@@ -2606,7 +2601,7 @@ bool ValidateIndexedStateQuery(Context *context, GLenum pname, GLuint index, GLs ...@@ -2606,7 +2601,7 @@ bool ValidateIndexedStateQuery(Context *context, GLenum pname, GLuint index, GLs
if (index >= caps.maxTransformFeedbackSeparateAttributes) if (index >= caps.maxTransformFeedbackSeparateAttributes)
{ {
context->validationError(GL_INVALID_VALUE, context->validationError(GL_INVALID_VALUE,
kErrorIndexExceedsMaxTransformFeedbackAttribs); kIndexExceedsMaxTransformFeedbackAttribs);
return false; return false;
} }
break; break;
...@@ -2616,8 +2611,7 @@ bool ValidateIndexedStateQuery(Context *context, GLenum pname, GLuint index, GLs ...@@ -2616,8 +2611,7 @@ bool ValidateIndexedStateQuery(Context *context, GLenum pname, GLuint index, GLs
case GL_UNIFORM_BUFFER_BINDING: case GL_UNIFORM_BUFFER_BINDING:
if (index >= caps.maxUniformBufferBindings) if (index >= caps.maxUniformBufferBindings)
{ {
context->validationError(GL_INVALID_VALUE, context->validationError(GL_INVALID_VALUE, kIndexExceedsMaxUniformBufferBindings);
kErrorIndexExceedsMaxUniformBufferBindings);
return false; return false;
} }
break; break;
...@@ -2626,8 +2620,7 @@ bool ValidateIndexedStateQuery(Context *context, GLenum pname, GLuint index, GLs ...@@ -2626,8 +2620,7 @@ bool ValidateIndexedStateQuery(Context *context, GLenum pname, GLuint index, GLs
case GL_MAX_COMPUTE_WORK_GROUP_COUNT: case GL_MAX_COMPUTE_WORK_GROUP_COUNT:
if (index >= 3u) if (index >= 3u)
{ {
context->validationError(GL_INVALID_VALUE, context->validationError(GL_INVALID_VALUE, kIndexExceedsMaxWorkgroupDimensions);
kErrorIndexExceedsMaxWorkgroupDimensions);
return false; return false;
} }
break; break;
...@@ -2637,13 +2630,13 @@ bool ValidateIndexedStateQuery(Context *context, GLenum pname, GLuint index, GLs ...@@ -2637,13 +2630,13 @@ bool ValidateIndexedStateQuery(Context *context, GLenum pname, GLuint index, GLs
case GL_ATOMIC_COUNTER_BUFFER_BINDING: case GL_ATOMIC_COUNTER_BUFFER_BINDING:
if (context->getClientVersion() < ES_3_1) if (context->getClientVersion() < ES_3_1)
{ {
context->validationError(GL_INVALID_ENUM, kErrorEnumRequiresGLES31); context->validationError(GL_INVALID_ENUM, kEnumRequiresGLES31);
return false; return false;
} }
if (index >= caps.maxAtomicCounterBufferBindings) if (index >= caps.maxAtomicCounterBufferBindings)
{ {
context->validationError(GL_INVALID_VALUE, context->validationError(GL_INVALID_VALUE,
kErrorIndexExceedsMaxAtomicCounterBufferBindings); kIndexExceedsMaxAtomicCounterBufferBindings);
return false; return false;
} }
break; break;
...@@ -2653,7 +2646,7 @@ bool ValidateIndexedStateQuery(Context *context, GLenum pname, GLuint index, GLs ...@@ -2653,7 +2646,7 @@ bool ValidateIndexedStateQuery(Context *context, GLenum pname, GLuint index, GLs
case GL_SHADER_STORAGE_BUFFER_BINDING: case GL_SHADER_STORAGE_BUFFER_BINDING:
if (context->getClientVersion() < ES_3_1) if (context->getClientVersion() < ES_3_1)
{ {
context->validationError(GL_INVALID_ENUM, kErrorEnumRequiresGLES31); context->validationError(GL_INVALID_ENUM, kEnumRequiresGLES31);
return false; return false;
} }
if (index >= caps.maxShaderStorageBufferBindings) if (index >= caps.maxShaderStorageBufferBindings)
...@@ -2671,7 +2664,7 @@ bool ValidateIndexedStateQuery(Context *context, GLenum pname, GLuint index, GLs ...@@ -2671,7 +2664,7 @@ bool ValidateIndexedStateQuery(Context *context, GLenum pname, GLuint index, GLs
case GL_VERTEX_BINDING_STRIDE: case GL_VERTEX_BINDING_STRIDE:
if (context->getClientVersion() < ES_3_1) if (context->getClientVersion() < ES_3_1)
{ {
context->validationError(GL_INVALID_ENUM, kErrorEnumRequiresGLES31); context->validationError(GL_INVALID_ENUM, kEnumRequiresGLES31);
return false; return false;
} }
if (index >= caps.maxVertexAttribBindings) if (index >= caps.maxVertexAttribBindings)
...@@ -2685,12 +2678,12 @@ bool ValidateIndexedStateQuery(Context *context, GLenum pname, GLuint index, GLs ...@@ -2685,12 +2678,12 @@ bool ValidateIndexedStateQuery(Context *context, GLenum pname, GLuint index, GLs
case GL_SAMPLE_MASK_VALUE: case GL_SAMPLE_MASK_VALUE:
if (context->getClientVersion() < ES_3_1) if (context->getClientVersion() < ES_3_1)
{ {
context->validationError(GL_INVALID_ENUM, kErrorEnumRequiresGLES31); context->validationError(GL_INVALID_ENUM, kEnumRequiresGLES31);
return false; return false;
} }
if (index >= caps.maxSampleMaskWords) if (index >= caps.maxSampleMaskWords)
{ {
context->validationError(GL_INVALID_VALUE, kErrorInvalidSampleMaskNumber); context->validationError(GL_INVALID_VALUE, kInvalidSampleMaskNumber);
return false; return false;
} }
break; break;
...@@ -2702,17 +2695,17 @@ bool ValidateIndexedStateQuery(Context *context, GLenum pname, GLuint index, GLs ...@@ -2702,17 +2695,17 @@ bool ValidateIndexedStateQuery(Context *context, GLenum pname, GLuint index, GLs
case GL_IMAGE_BINDING_FORMAT: case GL_IMAGE_BINDING_FORMAT:
if (context->getClientVersion() < ES_3_1) if (context->getClientVersion() < ES_3_1)
{ {
context->validationError(GL_INVALID_ENUM, kErrorEnumRequiresGLES31); context->validationError(GL_INVALID_ENUM, kEnumRequiresGLES31);
return false; return false;
} }
if (index >= caps.maxImageUnits) if (index >= caps.maxImageUnits)
{ {
context->validationError(GL_INVALID_VALUE, kErrorInvalidImageUnit); context->validationError(GL_INVALID_VALUE, kInvalidImageUnit);
return false; return false;
} }
break; break;
default: default:
context->validationError(GL_INVALID_ENUM, kErrorEnumNotSupported); context->validationError(GL_INVALID_ENUM, kEnumNotSupported);
return false; return false;
} }
...@@ -2728,7 +2721,7 @@ bool ValidateGetIntegeri_v(Context *context, GLenum target, GLuint index, GLint ...@@ -2728,7 +2721,7 @@ bool ValidateGetIntegeri_v(Context *context, GLenum target, GLuint index, GLint
{ {
if (context->getClientVersion() < ES_3_0) if (context->getClientVersion() < ES_3_0)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES3Required); context->validationError(GL_INVALID_OPERATION, kES3Required);
return false; return false;
} }
return ValidateIndexedStateQuery(context, target, index, nullptr); return ValidateIndexedStateQuery(context, target, index, nullptr);
...@@ -2743,7 +2736,7 @@ bool ValidateGetIntegeri_vRobustANGLE(Context *context, ...@@ -2743,7 +2736,7 @@ bool ValidateGetIntegeri_vRobustANGLE(Context *context,
{ {
if (context->getClientVersion() < ES_3_0) if (context->getClientVersion() < ES_3_0)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES3Required); context->validationError(GL_INVALID_OPERATION, kES3Required);
return false; return false;
} }
...@@ -2773,7 +2766,7 @@ bool ValidateGetInteger64i_v(Context *context, GLenum target, GLuint index, GLin ...@@ -2773,7 +2766,7 @@ bool ValidateGetInteger64i_v(Context *context, GLenum target, GLuint index, GLin
{ {
if (context->getClientVersion() < ES_3_0) if (context->getClientVersion() < ES_3_0)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES3Required); context->validationError(GL_INVALID_OPERATION, kES3Required);
return false; return false;
} }
return ValidateIndexedStateQuery(context, target, index, nullptr); return ValidateIndexedStateQuery(context, target, index, nullptr);
...@@ -2788,7 +2781,7 @@ bool ValidateGetInteger64i_vRobustANGLE(Context *context, ...@@ -2788,7 +2781,7 @@ bool ValidateGetInteger64i_vRobustANGLE(Context *context,
{ {
if (context->getClientVersion() < ES_3_0) if (context->getClientVersion() < ES_3_0)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES3Required); context->validationError(GL_INVALID_OPERATION, kES3Required);
return false; return false;
} }
...@@ -2823,13 +2816,13 @@ bool ValidateCopyBufferSubData(Context *context, ...@@ -2823,13 +2816,13 @@ bool ValidateCopyBufferSubData(Context *context,
{ {
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES3Required); context->validationError(GL_INVALID_OPERATION, kES3Required);
return false; return false;
} }
if (!context->isValidBufferBinding(readTarget) || !context->isValidBufferBinding(writeTarget)) if (!context->isValidBufferBinding(readTarget) || !context->isValidBufferBinding(writeTarget))
{ {
context->validationError(GL_INVALID_ENUM, kErrorInvalidBufferTypes); context->validationError(GL_INVALID_ENUM, kInvalidBufferTypes);
return false; return false;
} }
...@@ -2854,7 +2847,7 @@ bool ValidateCopyBufferSubData(Context *context, ...@@ -2854,7 +2847,7 @@ bool ValidateCopyBufferSubData(Context *context,
(readBuffer->isBoundForTransformFeedbackAndOtherUse() || (readBuffer->isBoundForTransformFeedbackAndOtherUse() ||
writeBuffer->isBoundForTransformFeedbackAndOtherUse())) writeBuffer->isBoundForTransformFeedbackAndOtherUse()))
{ {
context->validationError(GL_INVALID_OPERATION, kErrorBufferBoundForTransformFeedback); context->validationError(GL_INVALID_OPERATION, kBufferBoundForTransformFeedback);
return false; return false;
} }
...@@ -2869,7 +2862,7 @@ bool ValidateCopyBufferSubData(Context *context, ...@@ -2869,7 +2862,7 @@ bool ValidateCopyBufferSubData(Context *context,
!IsValueInRangeForNumericType<GLintptr>(readBuffer->getSize()) || !IsValueInRangeForNumericType<GLintptr>(readBuffer->getSize()) ||
!IsValueInRangeForNumericType<GLintptr>(writeBuffer->getSize())) !IsValueInRangeForNumericType<GLintptr>(writeBuffer->getSize()))
{ {
context->validationError(GL_INVALID_VALUE, kErrorIntegerOverflow); context->validationError(GL_INVALID_VALUE, kIntegerOverflow);
return false; return false;
} }
...@@ -2894,13 +2887,13 @@ bool ValidateCopyBufferSubData(Context *context, ...@@ -2894,13 +2887,13 @@ bool ValidateCopyBufferSubData(Context *context,
{ {
// This shold not be possible. // This shold not be possible.
UNREACHABLE(); UNREACHABLE();
context->validationError(GL_INVALID_VALUE, kErrorIntegerOverflow); context->validationError(GL_INVALID_VALUE, kIntegerOverflow);
return false; return false;
} }
if (checkedOffsetDiff.ValueOrDie() < size) if (checkedOffsetDiff.ValueOrDie() < size)
{ {
context->validationError(GL_INVALID_VALUE, kErrorCopyAlias); context->validationError(GL_INVALID_VALUE, kCopyAlias);
return false; return false;
} }
} }
...@@ -2912,7 +2905,7 @@ bool ValidateGetStringi(Context *context, GLenum name, GLuint index) ...@@ -2912,7 +2905,7 @@ bool ValidateGetStringi(Context *context, GLenum name, GLuint index)
{ {
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES3Required); context->validationError(GL_INVALID_OPERATION, kES3Required);
return false; return false;
} }
...@@ -2930,7 +2923,7 @@ bool ValidateGetStringi(Context *context, GLenum name, GLuint index) ...@@ -2930,7 +2923,7 @@ bool ValidateGetStringi(Context *context, GLenum name, GLuint index)
case GL_REQUESTABLE_EXTENSIONS_ANGLE: case GL_REQUESTABLE_EXTENSIONS_ANGLE:
if (!context->getExtensions().requestExtension) if (!context->getExtensions().requestExtension)
{ {
context->validationError(GL_INVALID_ENUM, kErrorInvalidName); context->validationError(GL_INVALID_ENUM, kInvalidName);
return false; return false;
} }
if (index >= context->getRequestableExtensionStringCount()) if (index >= context->getRequestableExtensionStringCount())
...@@ -2943,7 +2936,7 @@ bool ValidateGetStringi(Context *context, GLenum name, GLuint index) ...@@ -2943,7 +2936,7 @@ bool ValidateGetStringi(Context *context, GLenum name, GLuint index)
break; break;
default: default:
context->validationError(GL_INVALID_ENUM, kErrorInvalidName); context->validationError(GL_INVALID_ENUM, kInvalidName);
return false; return false;
} }
...@@ -2959,7 +2952,7 @@ bool ValidateRenderbufferStorageMultisample(Context *context, ...@@ -2959,7 +2952,7 @@ bool ValidateRenderbufferStorageMultisample(Context *context,
{ {
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES3Required); context->validationError(GL_INVALID_OPERATION, kES3Required);
return false; return false;
} }
...@@ -2978,7 +2971,7 @@ bool ValidateRenderbufferStorageMultisample(Context *context, ...@@ -2978,7 +2971,7 @@ bool ValidateRenderbufferStorageMultisample(Context *context,
if ((samples > 0 && context->getClientVersion() == ES_3_0) || if ((samples > 0 && context->getClientVersion() == ES_3_0) ||
static_cast<GLuint>(samples) > context->getCaps().maxIntegerSamples) static_cast<GLuint>(samples) > context->getCaps().maxIntegerSamples)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorSamplesOutOfRange); context->validationError(GL_INVALID_OPERATION, kSamplesOutOfRange);
return false; return false;
} }
} }
...@@ -2987,7 +2980,7 @@ bool ValidateRenderbufferStorageMultisample(Context *context, ...@@ -2987,7 +2980,7 @@ bool ValidateRenderbufferStorageMultisample(Context *context,
const TextureCaps &formatCaps = context->getTextureCaps().get(internalformat); const TextureCaps &formatCaps = context->getTextureCaps().get(internalformat);
if (static_cast<GLuint>(samples) > formatCaps.getMaxSamples()) if (static_cast<GLuint>(samples) > formatCaps.getMaxSamples())
{ {
context->validationError(GL_INVALID_OPERATION, kErrorSamplesOutOfRange); context->validationError(GL_INVALID_OPERATION, kSamplesOutOfRange);
return false; return false;
} }
...@@ -3003,7 +2996,7 @@ bool ValidateVertexAttribIPointer(Context *context, ...@@ -3003,7 +2996,7 @@ bool ValidateVertexAttribIPointer(Context *context,
{ {
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES3Required); context->validationError(GL_INVALID_OPERATION, kES3Required);
return false; return false;
} }
...@@ -3014,7 +3007,7 @@ bool ValidateVertexAttribIPointer(Context *context, ...@@ -3014,7 +3007,7 @@ bool ValidateVertexAttribIPointer(Context *context,
if (stride < 0) if (stride < 0)
{ {
context->validationError(GL_INVALID_VALUE, kErrorNegativeStride); context->validationError(GL_INVALID_VALUE, kNegativeStride);
return false; return false;
} }
...@@ -3072,13 +3065,13 @@ bool ValidateGetSynciv(Context *context, ...@@ -3072,13 +3065,13 @@ bool ValidateGetSynciv(Context *context,
{ {
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES3Required); context->validationError(GL_INVALID_OPERATION, kES3Required);
return false; return false;
} }
if (bufSize < 0) if (bufSize < 0)
{ {
context->validationError(GL_INVALID_VALUE, kErrorNegativeBufferSize); context->validationError(GL_INVALID_VALUE, kNegativeBufferSize);
return false; return false;
} }
...@@ -3098,7 +3091,7 @@ bool ValidateGetSynciv(Context *context, ...@@ -3098,7 +3091,7 @@ bool ValidateGetSynciv(Context *context,
break; break;
default: default:
context->validationError(GL_INVALID_ENUM, kErrorInvalidPname); context->validationError(GL_INVALID_ENUM, kInvalidPname);
return false; return false;
} }
...@@ -3114,7 +3107,7 @@ bool ValidateDrawElementsInstanced(Context *context, ...@@ -3114,7 +3107,7 @@ bool ValidateDrawElementsInstanced(Context *context,
{ {
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES3Required); context->validationError(GL_INVALID_OPERATION, kES3Required);
return false; return false;
} }
...@@ -3130,14 +3123,14 @@ bool ValidateMultiDrawArraysInstancedANGLE(Context *context, ...@@ -3130,14 +3123,14 @@ bool ValidateMultiDrawArraysInstancedANGLE(Context *context,
{ {
if (!context->getExtensions().multiDraw) if (!context->getExtensions().multiDraw)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorExtensionNotEnabled); context->validationError(GL_INVALID_OPERATION, kExtensionNotEnabled);
return false; return false;
} }
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
if (!context->getExtensions().instancedArrays) if (!context->getExtensions().instancedArrays)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorExtensionNotEnabled); context->validationError(GL_INVALID_OPERATION, kExtensionNotEnabled);
return false; return false;
} }
if (!ValidateDrawInstancedANGLE(context)) if (!ValidateDrawInstancedANGLE(context))
...@@ -3166,14 +3159,14 @@ bool ValidateMultiDrawElementsInstancedANGLE(Context *context, ...@@ -3166,14 +3159,14 @@ bool ValidateMultiDrawElementsInstancedANGLE(Context *context,
{ {
if (!context->getExtensions().multiDraw) if (!context->getExtensions().multiDraw)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorExtensionNotEnabled); context->validationError(GL_INVALID_OPERATION, kExtensionNotEnabled);
return false; return false;
} }
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
if (!context->getExtensions().instancedArrays) if (!context->getExtensions().instancedArrays)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorExtensionNotEnabled); context->validationError(GL_INVALID_OPERATION, kExtensionNotEnabled);
return false; return false;
} }
if (!ValidateDrawInstancedANGLE(context)) if (!ValidateDrawInstancedANGLE(context))
...@@ -3358,7 +3351,7 @@ bool ValidateIsQuery(Context *context, GLuint id) ...@@ -3358,7 +3351,7 @@ bool ValidateIsQuery(Context *context, GLuint id)
{ {
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES3Required); context->validationError(GL_INVALID_OPERATION, kES3Required);
return false; return false;
} }
...@@ -3423,7 +3416,7 @@ bool ValidateEndTransformFeedback(Context *context) ...@@ -3423,7 +3416,7 @@ bool ValidateEndTransformFeedback(Context *context)
{ {
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES3Required); context->validationError(GL_INVALID_OPERATION, kES3Required);
return false; return false;
} }
...@@ -3432,7 +3425,7 @@ bool ValidateEndTransformFeedback(Context *context) ...@@ -3432,7 +3425,7 @@ bool ValidateEndTransformFeedback(Context *context)
if (!transformFeedback->isActive()) if (!transformFeedback->isActive())
{ {
context->validationError(GL_INVALID_OPERATION, kErrorTransformFeedbackNotActive); context->validationError(GL_INVALID_OPERATION, kTransformFeedbackNotActive);
return false; return false;
} }
...@@ -3447,13 +3440,13 @@ bool ValidateTransformFeedbackVaryings(Context *context, ...@@ -3447,13 +3440,13 @@ bool ValidateTransformFeedbackVaryings(Context *context,
{ {
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES3Required); context->validationError(GL_INVALID_OPERATION, kES3Required);
return false; return false;
} }
if (count < 0) if (count < 0)
{ {
context->validationError(GL_INVALID_VALUE, kErrorNegativeCount); context->validationError(GL_INVALID_VALUE, kNegativeCount);
return false; return false;
} }
...@@ -3466,14 +3459,13 @@ bool ValidateTransformFeedbackVaryings(Context *context, ...@@ -3466,14 +3459,13 @@ bool ValidateTransformFeedbackVaryings(Context *context,
const Caps &caps = context->getCaps(); const Caps &caps = context->getCaps();
if (static_cast<GLuint>(count) > caps.maxTransformFeedbackSeparateAttributes) if (static_cast<GLuint>(count) > caps.maxTransformFeedbackSeparateAttributes)
{ {
context->validationError(GL_INVALID_VALUE, context->validationError(GL_INVALID_VALUE, kInvalidTransformFeedbackAttribsCount);
kErrorInvalidTransformFeedbackAttribsCount);
return false; return false;
} }
break; break;
} }
default: default:
context->validationError(GL_INVALID_ENUM, kErrorEnumNotSupported); context->validationError(GL_INVALID_ENUM, kEnumNotSupported);
return false; return false;
} }
...@@ -3497,13 +3489,13 @@ bool ValidateGetTransformFeedbackVarying(Context *context, ...@@ -3497,13 +3489,13 @@ bool ValidateGetTransformFeedbackVarying(Context *context,
{ {
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES3Required); context->validationError(GL_INVALID_OPERATION, kES3Required);
return false; return false;
} }
if (bufSize < 0) if (bufSize < 0)
{ {
context->validationError(GL_INVALID_VALUE, kErrorNegativeBufferSize); context->validationError(GL_INVALID_VALUE, kNegativeBufferSize);
return false; return false;
} }
...@@ -3515,7 +3507,7 @@ bool ValidateGetTransformFeedbackVarying(Context *context, ...@@ -3515,7 +3507,7 @@ bool ValidateGetTransformFeedbackVarying(Context *context,
if (index >= static_cast<GLuint>(programObject->getTransformFeedbackVaryingCount())) if (index >= static_cast<GLuint>(programObject->getTransformFeedbackVaryingCount()))
{ {
context->validationError(GL_INVALID_VALUE, kErrorTransformFeedbackVaryingIndexOutOfRange); context->validationError(GL_INVALID_VALUE, kTransformFeedbackVaryingIndexOutOfRange);
return false; return false;
} }
...@@ -3526,7 +3518,7 @@ bool ValidateBindTransformFeedback(Context *context, GLenum target, GLuint id) ...@@ -3526,7 +3518,7 @@ bool ValidateBindTransformFeedback(Context *context, GLenum target, GLuint id)
{ {
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES3Required); context->validationError(GL_INVALID_OPERATION, kES3Required);
return false; return false;
} }
...@@ -3541,7 +3533,7 @@ bool ValidateBindTransformFeedback(Context *context, GLenum target, GLuint id) ...@@ -3541,7 +3533,7 @@ bool ValidateBindTransformFeedback(Context *context, GLenum target, GLuint id)
if (curTransformFeedback && curTransformFeedback->isActive() && if (curTransformFeedback && curTransformFeedback->isActive() &&
!curTransformFeedback->isPaused()) !curTransformFeedback->isPaused())
{ {
context->validationError(GL_INVALID_OPERATION, kErrorTransformFeedbackNotPaused); context->validationError(GL_INVALID_OPERATION, kTransformFeedbackNotPaused);
return false; return false;
} }
...@@ -3549,14 +3541,14 @@ bool ValidateBindTransformFeedback(Context *context, GLenum target, GLuint id) ...@@ -3549,14 +3541,14 @@ bool ValidateBindTransformFeedback(Context *context, GLenum target, GLuint id)
// 2.14.1) // 2.14.1)
if (!context->isTransformFeedbackGenerated(id)) if (!context->isTransformFeedbackGenerated(id))
{ {
context->validationError(GL_INVALID_OPERATION, kErrorTransformFeedbackDoesNotExist); context->validationError(GL_INVALID_OPERATION, kTransformFeedbackDoesNotExist);
return false; return false;
} }
} }
break; break;
default: default:
context->validationError(GL_INVALID_ENUM, kErrorEnumNotSupported); context->validationError(GL_INVALID_ENUM, kEnumNotSupported);
return false; return false;
} }
...@@ -3567,7 +3559,7 @@ bool ValidateIsTransformFeedback(Context *context, GLuint id) ...@@ -3567,7 +3559,7 @@ bool ValidateIsTransformFeedback(Context *context, GLuint id)
{ {
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES3Required); context->validationError(GL_INVALID_OPERATION, kES3Required);
return false; return false;
} }
...@@ -3578,7 +3570,7 @@ bool ValidatePauseTransformFeedback(Context *context) ...@@ -3578,7 +3570,7 @@ bool ValidatePauseTransformFeedback(Context *context)
{ {
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES3Required); context->validationError(GL_INVALID_OPERATION, kES3Required);
return false; return false;
} }
...@@ -3588,13 +3580,13 @@ bool ValidatePauseTransformFeedback(Context *context) ...@@ -3588,13 +3580,13 @@ bool ValidatePauseTransformFeedback(Context *context)
// Current transform feedback must be active and not paused in order to pause (3.0.2 pg 86) // Current transform feedback must be active and not paused in order to pause (3.0.2 pg 86)
if (!transformFeedback->isActive()) if (!transformFeedback->isActive())
{ {
context->validationError(GL_INVALID_OPERATION, kErrorTransformFeedbackNotActive); context->validationError(GL_INVALID_OPERATION, kTransformFeedbackNotActive);
return false; return false;
} }
if (transformFeedback->isPaused()) if (transformFeedback->isPaused())
{ {
context->validationError(GL_INVALID_OPERATION, kErrorTransformFeedbackPaused); context->validationError(GL_INVALID_OPERATION, kTransformFeedbackPaused);
return false; return false;
} }
...@@ -3605,7 +3597,7 @@ bool ValidateResumeTransformFeedback(Context *context) ...@@ -3605,7 +3597,7 @@ bool ValidateResumeTransformFeedback(Context *context)
{ {
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES3Required); context->validationError(GL_INVALID_OPERATION, kES3Required);
return false; return false;
} }
...@@ -3615,13 +3607,13 @@ bool ValidateResumeTransformFeedback(Context *context) ...@@ -3615,13 +3607,13 @@ bool ValidateResumeTransformFeedback(Context *context)
// Current transform feedback must be active and paused in order to resume (3.0.2 pg 86) // Current transform feedback must be active and paused in order to resume (3.0.2 pg 86)
if (!transformFeedback->isActive()) if (!transformFeedback->isActive())
{ {
context->validationError(GL_INVALID_OPERATION, kErrorTransformFeedbackNotActive); context->validationError(GL_INVALID_OPERATION, kTransformFeedbackNotActive);
return false; return false;
} }
if (!transformFeedback->isPaused()) if (!transformFeedback->isPaused())
{ {
context->validationError(GL_INVALID_OPERATION, kErrorTransformFeedbackNotPaused); context->validationError(GL_INVALID_OPERATION, kTransformFeedbackNotPaused);
return false; return false;
} }
...@@ -3632,7 +3624,7 @@ bool ValidateVertexAttribI4i(Context *context, GLuint index, GLint x, GLint y, G ...@@ -3632,7 +3624,7 @@ bool ValidateVertexAttribI4i(Context *context, GLuint index, GLint x, GLint y, G
{ {
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES3Required); context->validationError(GL_INVALID_OPERATION, kES3Required);
return false; return false;
} }
...@@ -3648,7 +3640,7 @@ bool ValidateVertexAttribI4ui(Context *context, ...@@ -3648,7 +3640,7 @@ bool ValidateVertexAttribI4ui(Context *context,
{ {
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES3Required); context->validationError(GL_INVALID_OPERATION, kES3Required);
return false; return false;
} }
...@@ -3659,7 +3651,7 @@ bool ValidateVertexAttribI4iv(Context *context, GLuint index, const GLint *v) ...@@ -3659,7 +3651,7 @@ bool ValidateVertexAttribI4iv(Context *context, GLuint index, const GLint *v)
{ {
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES3Required); context->validationError(GL_INVALID_OPERATION, kES3Required);
return false; return false;
} }
...@@ -3670,7 +3662,7 @@ bool ValidateVertexAttribI4uiv(Context *context, GLuint index, const GLuint *v) ...@@ -3670,7 +3662,7 @@ bool ValidateVertexAttribI4uiv(Context *context, GLuint index, const GLuint *v)
{ {
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES3Required); context->validationError(GL_INVALID_OPERATION, kES3Required);
return false; return false;
} }
...@@ -3681,7 +3673,7 @@ bool ValidateGetFragDataLocation(Context *context, GLuint program, const GLchar ...@@ -3681,7 +3673,7 @@ bool ValidateGetFragDataLocation(Context *context, GLuint program, const GLchar
{ {
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES3Required); context->validationError(GL_INVALID_OPERATION, kES3Required);
return false; return false;
} }
...@@ -3693,7 +3685,7 @@ bool ValidateGetFragDataLocation(Context *context, GLuint program, const GLchar ...@@ -3693,7 +3685,7 @@ bool ValidateGetFragDataLocation(Context *context, GLuint program, const GLchar
if (!programObject->isLinked()) if (!programObject->isLinked())
{ {
context->validationError(GL_INVALID_OPERATION, kErrorProgramNotLinked); context->validationError(GL_INVALID_OPERATION, kProgramNotLinked);
return false; return false;
} }
...@@ -3708,13 +3700,13 @@ bool ValidateGetUniformIndices(Context *context, ...@@ -3708,13 +3700,13 @@ bool ValidateGetUniformIndices(Context *context,
{ {
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES3Required); context->validationError(GL_INVALID_OPERATION, kES3Required);
return false; return false;
} }
if (uniformCount < 0) if (uniformCount < 0)
{ {
context->validationError(GL_INVALID_VALUE, kErrorNegativeCount); context->validationError(GL_INVALID_VALUE, kNegativeCount);
return false; return false;
} }
...@@ -3736,13 +3728,13 @@ bool ValidateGetActiveUniformsiv(Context *context, ...@@ -3736,13 +3728,13 @@ bool ValidateGetActiveUniformsiv(Context *context,
{ {
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES3Required); context->validationError(GL_INVALID_OPERATION, kES3Required);
return false; return false;
} }
if (uniformCount < 0) if (uniformCount < 0)
{ {
context->validationError(GL_INVALID_VALUE, kErrorNegativeCount); context->validationError(GL_INVALID_VALUE, kNegativeCount);
return false; return false;
} }
...@@ -3760,7 +3752,7 @@ bool ValidateGetActiveUniformsiv(Context *context, ...@@ -3760,7 +3752,7 @@ bool ValidateGetActiveUniformsiv(Context *context,
case GL_UNIFORM_NAME_LENGTH: case GL_UNIFORM_NAME_LENGTH:
if (context->getExtensions().webglCompatibility) if (context->getExtensions().webglCompatibility)
{ {
context->validationError(GL_INVALID_ENUM, kErrorEnumNotSupported); context->validationError(GL_INVALID_ENUM, kEnumNotSupported);
return false; return false;
} }
break; break;
...@@ -3772,13 +3764,13 @@ bool ValidateGetActiveUniformsiv(Context *context, ...@@ -3772,13 +3764,13 @@ bool ValidateGetActiveUniformsiv(Context *context,
break; break;
default: default:
context->validationError(GL_INVALID_ENUM, kErrorEnumNotSupported); context->validationError(GL_INVALID_ENUM, kEnumNotSupported);
return false; return false;
} }
if (uniformCount > programObject->getActiveUniformCount()) if (uniformCount > programObject->getActiveUniformCount())
{ {
context->validationError(GL_INVALID_VALUE, kErrorIndexExceedsMaxActiveUniform); context->validationError(GL_INVALID_VALUE, kIndexExceedsMaxActiveUniform);
return false; return false;
} }
...@@ -3788,7 +3780,7 @@ bool ValidateGetActiveUniformsiv(Context *context, ...@@ -3788,7 +3780,7 @@ bool ValidateGetActiveUniformsiv(Context *context,
if (index >= static_cast<GLuint>(programObject->getActiveUniformCount())) if (index >= static_cast<GLuint>(programObject->getActiveUniformCount()))
{ {
context->validationError(GL_INVALID_VALUE, kErrorIndexExceedsMaxActiveUniform); context->validationError(GL_INVALID_VALUE, kIndexExceedsMaxActiveUniform);
return false; return false;
} }
} }
...@@ -3800,7 +3792,7 @@ bool ValidateGetUniformBlockIndex(Context *context, GLuint program, const GLchar ...@@ -3800,7 +3792,7 @@ bool ValidateGetUniformBlockIndex(Context *context, GLuint program, const GLchar
{ {
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES3Required); context->validationError(GL_INVALID_OPERATION, kES3Required);
return false; return false;
} }
...@@ -3831,7 +3823,7 @@ bool ValidateGetActiveUniformBlockName(Context *context, ...@@ -3831,7 +3823,7 @@ bool ValidateGetActiveUniformBlockName(Context *context,
{ {
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES3Required); context->validationError(GL_INVALID_OPERATION, kES3Required);
return false; return false;
} }
...@@ -3843,7 +3835,7 @@ bool ValidateGetActiveUniformBlockName(Context *context, ...@@ -3843,7 +3835,7 @@ bool ValidateGetActiveUniformBlockName(Context *context,
if (uniformBlockIndex >= programObject->getActiveUniformBlockCount()) if (uniformBlockIndex >= programObject->getActiveUniformBlockCount())
{ {
context->validationError(GL_INVALID_VALUE, kErrorIndexExceedsMaxActiveUniformBlock); context->validationError(GL_INVALID_VALUE, kIndexExceedsMaxActiveUniformBlock);
return false; return false;
} }
...@@ -3857,13 +3849,13 @@ bool ValidateUniformBlockBinding(Context *context, ...@@ -3857,13 +3849,13 @@ bool ValidateUniformBlockBinding(Context *context,
{ {
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES3Required); context->validationError(GL_INVALID_OPERATION, kES3Required);
return false; return false;
} }
if (uniformBlockBinding >= context->getCaps().maxUniformBufferBindings) if (uniformBlockBinding >= context->getCaps().maxUniformBufferBindings)
{ {
context->validationError(GL_INVALID_VALUE, kErrorIndexExceedsMaxUniformBufferBindings); context->validationError(GL_INVALID_VALUE, kIndexExceedsMaxUniformBufferBindings);
return false; return false;
} }
...@@ -3876,7 +3868,7 @@ bool ValidateUniformBlockBinding(Context *context, ...@@ -3876,7 +3868,7 @@ bool ValidateUniformBlockBinding(Context *context,
// if never linked, there won't be any uniform blocks // if never linked, there won't be any uniform blocks
if (uniformBlockIndex >= programObject->getActiveUniformBlockCount()) if (uniformBlockIndex >= programObject->getActiveUniformBlockCount())
{ {
context->validationError(GL_INVALID_VALUE, kErrorIndexExceedsMaxUniformBufferBindings); context->validationError(GL_INVALID_VALUE, kIndexExceedsMaxUniformBufferBindings);
return false; return false;
} }
...@@ -3891,7 +3883,7 @@ bool ValidateDrawArraysInstanced(Context *context, ...@@ -3891,7 +3883,7 @@ bool ValidateDrawArraysInstanced(Context *context,
{ {
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES3Required); context->validationError(GL_INVALID_OPERATION, kES3Required);
return false; return false;
} }
...@@ -3902,19 +3894,19 @@ bool ValidateFenceSync(Context *context, GLenum condition, GLbitfield flags) ...@@ -3902,19 +3894,19 @@ bool ValidateFenceSync(Context *context, GLenum condition, GLbitfield flags)
{ {
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES3Required); context->validationError(GL_INVALID_OPERATION, kES3Required);
return false; return false;
} }
if (condition != GL_SYNC_GPU_COMMANDS_COMPLETE) if (condition != GL_SYNC_GPU_COMMANDS_COMPLETE)
{ {
context->validationError(GL_INVALID_ENUM, kErrorInvalidFenceCondition); context->validationError(GL_INVALID_ENUM, kInvalidFenceCondition);
return false; return false;
} }
if (flags != 0) if (flags != 0)
{ {
context->validationError(GL_INVALID_VALUE, kErrorInvalidFlags); context->validationError(GL_INVALID_VALUE, kInvalidFlags);
return false; return false;
} }
...@@ -3925,7 +3917,7 @@ bool ValidateIsSync(Context *context, GLsync sync) ...@@ -3925,7 +3917,7 @@ bool ValidateIsSync(Context *context, GLsync sync)
{ {
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES3Required); context->validationError(GL_INVALID_OPERATION, kES3Required);
return false; return false;
} }
...@@ -3936,13 +3928,13 @@ bool ValidateDeleteSync(Context *context, GLsync sync) ...@@ -3936,13 +3928,13 @@ bool ValidateDeleteSync(Context *context, GLsync sync)
{ {
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES3Required); context->validationError(GL_INVALID_OPERATION, kES3Required);
return false; return false;
} }
if (sync != static_cast<GLsync>(0) && !context->getSync(sync)) if (sync != static_cast<GLsync>(0) && !context->getSync(sync))
{ {
context->validationError(GL_INVALID_VALUE, kErrorSyncMissing); context->validationError(GL_INVALID_VALUE, kSyncMissing);
return false; return false;
} }
...@@ -3953,20 +3945,20 @@ bool ValidateClientWaitSync(Context *context, GLsync sync, GLbitfield flags, GLu ...@@ -3953,20 +3945,20 @@ bool ValidateClientWaitSync(Context *context, GLsync sync, GLbitfield flags, GLu
{ {
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES3Required); context->validationError(GL_INVALID_OPERATION, kES3Required);
return false; return false;
} }
if ((flags & ~(GL_SYNC_FLUSH_COMMANDS_BIT)) != 0) if ((flags & ~(GL_SYNC_FLUSH_COMMANDS_BIT)) != 0)
{ {
context->validationError(GL_INVALID_VALUE, kErrorInvalidFlags); context->validationError(GL_INVALID_VALUE, kInvalidFlags);
return false; return false;
} }
Sync *clientWaitSync = context->getSync(sync); Sync *clientWaitSync = context->getSync(sync);
if (!clientWaitSync) if (!clientWaitSync)
{ {
context->validationError(GL_INVALID_VALUE, kErrorSyncMissing); context->validationError(GL_INVALID_VALUE, kSyncMissing);
return false; return false;
} }
...@@ -3977,26 +3969,26 @@ bool ValidateWaitSync(Context *context, GLsync sync, GLbitfield flags, GLuint64 ...@@ -3977,26 +3969,26 @@ bool ValidateWaitSync(Context *context, GLsync sync, GLbitfield flags, GLuint64
{ {
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES3Required); context->validationError(GL_INVALID_OPERATION, kES3Required);
return false; return false;
} }
if (flags != 0) if (flags != 0)
{ {
context->validationError(GL_INVALID_VALUE, kErrorInvalidFlags); context->validationError(GL_INVALID_VALUE, kInvalidFlags);
return false; return false;
} }
if (timeout != GL_TIMEOUT_IGNORED) if (timeout != GL_TIMEOUT_IGNORED)
{ {
context->validationError(GL_INVALID_VALUE, kErrorInvalidTimeout); context->validationError(GL_INVALID_VALUE, kInvalidTimeout);
return false; return false;
} }
Sync *waitSync = context->getSync(sync); Sync *waitSync = context->getSync(sync);
if (!waitSync) if (!waitSync)
{ {
context->validationError(GL_INVALID_VALUE, kErrorSyncMissing); context->validationError(GL_INVALID_VALUE, kSyncMissing);
return false; return false;
} }
...@@ -4007,7 +3999,7 @@ bool ValidateGetInteger64v(Context *context, GLenum pname, GLint64 *params) ...@@ -4007,7 +3999,7 @@ bool ValidateGetInteger64v(Context *context, GLenum pname, GLint64 *params)
{ {
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES3Required); context->validationError(GL_INVALID_OPERATION, kES3Required);
return false; return false;
} }
...@@ -4025,7 +4017,7 @@ bool ValidateIsSampler(Context *context, GLuint sampler) ...@@ -4025,7 +4017,7 @@ bool ValidateIsSampler(Context *context, GLuint sampler)
{ {
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES3Required); context->validationError(GL_INVALID_OPERATION, kES3Required);
return false; return false;
} }
...@@ -4036,19 +4028,19 @@ bool ValidateBindSampler(Context *context, GLuint unit, GLuint sampler) ...@@ -4036,19 +4028,19 @@ bool ValidateBindSampler(Context *context, GLuint unit, GLuint sampler)
{ {
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES3Required); context->validationError(GL_INVALID_OPERATION, kES3Required);
return false; return false;
} }
if (sampler != 0 && !context->isSampler(sampler)) if (sampler != 0 && !context->isSampler(sampler))
{ {
context->validationError(GL_INVALID_OPERATION, kErrorInvalidSampler); context->validationError(GL_INVALID_OPERATION, kInvalidSampler);
return false; return false;
} }
if (unit >= context->getCaps().maxCombinedTextureImageUnits) if (unit >= context->getCaps().maxCombinedTextureImageUnits)
{ {
context->validationError(GL_INVALID_VALUE, kErrorInvalidCombinedImageUnit); context->validationError(GL_INVALID_VALUE, kInvalidCombinedImageUnit);
return false; return false;
} }
...@@ -4059,7 +4051,7 @@ bool ValidateVertexAttribDivisor(Context *context, GLuint index, GLuint divisor) ...@@ -4059,7 +4051,7 @@ bool ValidateVertexAttribDivisor(Context *context, GLuint index, GLuint divisor)
{ {
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES3Required); context->validationError(GL_INVALID_OPERATION, kES3Required);
return false; return false;
} }
...@@ -4075,7 +4067,7 @@ bool ValidateTexStorage2D(Context *context, ...@@ -4075,7 +4067,7 @@ bool ValidateTexStorage2D(Context *context,
{ {
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES3Required); context->validationError(GL_INVALID_OPERATION, kES3Required);
return false; return false;
} }
...@@ -4098,7 +4090,7 @@ bool ValidateTexStorage3D(Context *context, ...@@ -4098,7 +4090,7 @@ bool ValidateTexStorage3D(Context *context,
{ {
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES3Required); context->validationError(GL_INVALID_OPERATION, kES3Required);
return false; return false;
} }
...@@ -4136,7 +4128,7 @@ bool ValidateGetSamplerParameterIivOES(Context *context, ...@@ -4136,7 +4128,7 @@ bool ValidateGetSamplerParameterIivOES(Context *context,
{ {
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES3Required); context->validationError(GL_INVALID_OPERATION, kES3Required);
return false; return false;
} }
return ValidateGetSamplerParameterBase(context, sampler, pname, nullptr); return ValidateGetSamplerParameterBase(context, sampler, pname, nullptr);
...@@ -4149,7 +4141,7 @@ bool ValidateGetSamplerParameterIuivOES(Context *context, ...@@ -4149,7 +4141,7 @@ bool ValidateGetSamplerParameterIuivOES(Context *context,
{ {
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES3Required); context->validationError(GL_INVALID_OPERATION, kES3Required);
return false; return false;
} }
return ValidateGetSamplerParameterBase(context, sampler, pname, nullptr); return ValidateGetSamplerParameterBase(context, sampler, pname, nullptr);
...@@ -4185,7 +4177,7 @@ bool ValidateSamplerParameterIivOES(Context *context, ...@@ -4185,7 +4177,7 @@ bool ValidateSamplerParameterIivOES(Context *context,
{ {
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES3Required); context->validationError(GL_INVALID_OPERATION, kES3Required);
return false; return false;
} }
return ValidateSamplerParameterBase(context, sampler, pname, -1, true, params); return ValidateSamplerParameterBase(context, sampler, pname, -1, true, params);
...@@ -4198,7 +4190,7 @@ bool ValidateSamplerParameterIuivOES(Context *context, ...@@ -4198,7 +4190,7 @@ bool ValidateSamplerParameterIuivOES(Context *context,
{ {
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES3Required); context->validationError(GL_INVALID_OPERATION, kES3Required);
return false; return false;
} }
return ValidateSamplerParameterBase(context, sampler, pname, -1, true, params); return ValidateSamplerParameterBase(context, sampler, pname, -1, true, params);
...@@ -4233,12 +4225,12 @@ bool ValidateBindFragDataLocationIndexedEXT(Context *context, ...@@ -4233,12 +4225,12 @@ bool ValidateBindFragDataLocationIndexedEXT(Context *context,
{ {
if (!context->getExtensions().blendFuncExtended) if (!context->getExtensions().blendFuncExtended)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorExtensionNotEnabled); context->validationError(GL_INVALID_OPERATION, kExtensionNotEnabled);
return false; return false;
} }
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES3Required); context->validationError(GL_INVALID_OPERATION, kES3Required);
return false; return false;
} }
if (index < 0 || index > 1) if (index < 0 || index > 1)
...@@ -4246,7 +4238,7 @@ bool ValidateBindFragDataLocationIndexedEXT(Context *context, ...@@ -4246,7 +4238,7 @@ bool ValidateBindFragDataLocationIndexedEXT(Context *context,
// This error is not explicitly specified but the spec does say that "<index> may be zero or // This error is not explicitly specified but the spec does say that "<index> may be zero or
// one to specify that the color be used as either the first or second color input to the // one to specify that the color be used as either the first or second color input to the
// blend equation, respectively" // blend equation, respectively"
context->validationError(GL_INVALID_VALUE, kErrorFragDataBindingIndexOutOfRange); context->validationError(GL_INVALID_VALUE, kFragDataBindingIndexOutOfRange);
return false; return false;
} }
if (index == 1) if (index == 1)
...@@ -4254,7 +4246,7 @@ bool ValidateBindFragDataLocationIndexedEXT(Context *context, ...@@ -4254,7 +4246,7 @@ bool ValidateBindFragDataLocationIndexedEXT(Context *context,
if (colorNumber >= context->getExtensions().maxDualSourceDrawBuffers) if (colorNumber >= context->getExtensions().maxDualSourceDrawBuffers)
{ {
context->validationError(GL_INVALID_VALUE, context->validationError(GL_INVALID_VALUE,
kErrorColorNumberGreaterThanMaxDualSourceDrawBuffers); kColorNumberGreaterThanMaxDualSourceDrawBuffers);
return false; return false;
} }
} }
...@@ -4262,7 +4254,7 @@ bool ValidateBindFragDataLocationIndexedEXT(Context *context, ...@@ -4262,7 +4254,7 @@ bool ValidateBindFragDataLocationIndexedEXT(Context *context,
{ {
if (colorNumber >= context->getCaps().maxDrawBuffers) if (colorNumber >= context->getCaps().maxDrawBuffers)
{ {
context->validationError(GL_INVALID_VALUE, kErrorColorNumberGreaterThanMaxDrawBuffers); context->validationError(GL_INVALID_VALUE, kColorNumberGreaterThanMaxDrawBuffers);
return false; return false;
} }
} }
...@@ -4286,12 +4278,12 @@ bool ValidateGetFragDataIndexEXT(Context *context, GLuint program, const char *n ...@@ -4286,12 +4278,12 @@ bool ValidateGetFragDataIndexEXT(Context *context, GLuint program, const char *n
{ {
if (!context->getExtensions().blendFuncExtended) if (!context->getExtensions().blendFuncExtended)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorExtensionNotEnabled); context->validationError(GL_INVALID_OPERATION, kExtensionNotEnabled);
return false; return false;
} }
if (context->getClientMajorVersion() < 3) if (context->getClientMajorVersion() < 3)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES3Required); context->validationError(GL_INVALID_OPERATION, kES3Required);
return false; return false;
} }
Program *programObject = GetValidProgram(context, program); Program *programObject = GetValidProgram(context, program);
...@@ -4301,7 +4293,7 @@ bool ValidateGetFragDataIndexEXT(Context *context, GLuint program, const char *n ...@@ -4301,7 +4293,7 @@ bool ValidateGetFragDataIndexEXT(Context *context, GLuint program, const char *n
} }
if (!programObject->isLinked()) if (!programObject->isLinked())
{ {
context->validationError(GL_INVALID_OPERATION, kErrorProgramNotLinked); context->validationError(GL_INVALID_OPERATION, kProgramNotLinked);
return false; return false;
} }
return true; return true;
...@@ -4317,8 +4309,7 @@ bool ValidateTexStorage2DMultisampleANGLE(Context *context, ...@@ -4317,8 +4309,7 @@ bool ValidateTexStorage2DMultisampleANGLE(Context *context,
{ {
if (!context->getExtensions().textureMultisample) if (!context->getExtensions().textureMultisample)
{ {
context->validationError(GL_INVALID_OPERATION, context->validationError(GL_INVALID_OPERATION, kMultisampleTextureExtensionOrES31Required);
kErrorMultisampleTextureExtensionOrES31Required);
return false; return false;
} }
...@@ -4334,8 +4325,7 @@ bool ValidateGetTexLevelParameterfvANGLE(Context *context, ...@@ -4334,8 +4325,7 @@ bool ValidateGetTexLevelParameterfvANGLE(Context *context,
{ {
if (!context->getExtensions().textureMultisample) if (!context->getExtensions().textureMultisample)
{ {
context->validationError(GL_INVALID_OPERATION, context->validationError(GL_INVALID_OPERATION, kMultisampleTextureExtensionOrES31Required);
kErrorMultisampleTextureExtensionOrES31Required);
return false; return false;
} }
...@@ -4350,8 +4340,7 @@ bool ValidateGetTexLevelParameterivANGLE(Context *context, ...@@ -4350,8 +4340,7 @@ bool ValidateGetTexLevelParameterivANGLE(Context *context,
{ {
if (!context->getExtensions().textureMultisample) if (!context->getExtensions().textureMultisample)
{ {
context->validationError(GL_INVALID_OPERATION, context->validationError(GL_INVALID_OPERATION, kMultisampleTextureExtensionOrES31Required);
kErrorMultisampleTextureExtensionOrES31Required);
return false; return false;
} }
......
...@@ -22,6 +22,7 @@ using namespace angle; ...@@ -22,6 +22,7 @@ using namespace angle;
namespace gl namespace gl
{ {
using namespace err;
namespace namespace
{ {
...@@ -304,7 +305,7 @@ bool ValidateProgramUniform(Context *context, ...@@ -304,7 +305,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))
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES31Required); context->validationError(GL_INVALID_OPERATION, kES31Required);
return false; return false;
} }
...@@ -324,7 +325,7 @@ bool ValidateProgramUniformMatrix(Context *context, ...@@ -324,7 +325,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))
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES31Required); context->validationError(GL_INVALID_OPERATION, kES31Required);
return false; return false;
} }
...@@ -343,14 +344,14 @@ bool ValidateVertexAttribFormatCommon(Context *context, ...@@ -343,14 +344,14 @@ bool ValidateVertexAttribFormatCommon(Context *context,
{ {
if (context->getClientVersion() < ES_3_1) if (context->getClientVersion() < ES_3_1)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES31Required); context->validationError(GL_INVALID_OPERATION, kES31Required);
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->validationError(GL_INVALID_VALUE, kErrorRelativeOffsetTooLarge); context->validationError(GL_INVALID_VALUE, kRelativeOffsetTooLarge);
return false; return false;
} }
...@@ -358,7 +359,7 @@ bool ValidateVertexAttribFormatCommon(Context *context, ...@@ -358,7 +359,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->validationError(GL_INVALID_OPERATION, kErrorDefaultVertexArray); context->validationError(GL_INVALID_OPERATION, kDefaultVertexArray);
return false; return false;
} }
...@@ -371,7 +372,7 @@ bool ValidateGetBooleani_v(Context *context, GLenum target, GLuint index, GLbool ...@@ -371,7 +372,7 @@ bool ValidateGetBooleani_v(Context *context, GLenum target, GLuint index, GLbool
{ {
if (context->getClientVersion() < ES_3_1) if (context->getClientVersion() < ES_3_1)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES31Required); context->validationError(GL_INVALID_OPERATION, kES31Required);
return false; return false;
} }
...@@ -392,7 +393,7 @@ bool ValidateGetBooleani_vRobustANGLE(Context *context, ...@@ -392,7 +393,7 @@ bool ValidateGetBooleani_vRobustANGLE(Context *context,
{ {
if (context->getClientVersion() < ES_3_1) if (context->getClientVersion() < ES_3_1)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES31Required); context->validationError(GL_INVALID_OPERATION, kES31Required);
return false; return false;
} }
...@@ -421,7 +422,7 @@ bool ValidateDrawIndirectBase(Context *context, PrimitiveMode mode, const void * ...@@ -421,7 +422,7 @@ bool ValidateDrawIndirectBase(Context *context, PrimitiveMode mode, const void *
{ {
if (context->getClientVersion() < ES_3_1) if (context->getClientVersion() < ES_3_1)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES31Required); context->validationError(GL_INVALID_OPERATION, kES31Required);
return false; return false;
} }
...@@ -437,14 +438,14 @@ bool ValidateDrawIndirectBase(Context *context, PrimitiveMode mode, const void * ...@@ -437,14 +438,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->validationError(GL_INVALID_OPERATION, kErrorDefaultVertexArray); context->validationError(GL_INVALID_OPERATION, kDefaultVertexArray);
return false; return false;
} }
Buffer *drawIndirectBuffer = state.getTargetBuffer(BufferBinding::DrawIndirect); Buffer *drawIndirectBuffer = state.getTargetBuffer(BufferBinding::DrawIndirect);
if (!drawIndirectBuffer) if (!drawIndirectBuffer)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorDrawIndirectBufferNotBound); context->validationError(GL_INVALID_OPERATION, kDrawIndirectBufferNotBound);
return false; return false;
} }
...@@ -453,7 +454,7 @@ bool ValidateDrawIndirectBase(Context *context, PrimitiveMode mode, const void * ...@@ -453,7 +454,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->validationError(GL_INVALID_VALUE, kErrorInvalidIndirectOffset); context->validationError(GL_INVALID_VALUE, kInvalidIndirectOffset);
return false; return false;
} }
...@@ -464,7 +465,7 @@ bool ValidateDrawIndirectBase(Context *context, PrimitiveMode mode, const void * ...@@ -464,7 +465,7 @@ bool ValidateDrawIndirectBase(Context *context, PrimitiveMode mode, const void *
ASSERT(drawFramebuffer != nullptr); ASSERT(drawFramebuffer != nullptr);
if (drawFramebuffer->getNumViews() > 1) if (drawFramebuffer->getNumViews() > 1)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorMultiviewActive); context->validationError(GL_INVALID_OPERATION, kMultiviewActive);
return false; return false;
} }
...@@ -485,8 +486,7 @@ bool ValidateDrawArraysIndirect(Context *context, PrimitiveMode mode, const void ...@@ -485,8 +486,7 @@ bool ValidateDrawArraysIndirect(Context *context, PrimitiveMode mode, const void
if (!ValidateTransformFeedbackPrimitiveMode( if (!ValidateTransformFeedbackPrimitiveMode(
context, curTransformFeedback->getPrimitiveMode(), mode)) context, curTransformFeedback->getPrimitiveMode(), mode))
{ {
context->validationError(GL_INVALID_OPERATION, context->validationError(GL_INVALID_OPERATION, kInvalidDrawModeTransformFeedback);
kErrorInvalidDrawModeTransformFeedback);
return false; return false;
} }
} }
...@@ -495,7 +495,7 @@ bool ValidateDrawArraysIndirect(Context *context, PrimitiveMode mode, const void ...@@ -495,7 +495,7 @@ 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.
context->validationError(GL_INVALID_OPERATION, context->validationError(GL_INVALID_OPERATION,
kErrorUnsupportedDrawModeForTransformFeedback); kUnsupportedDrawModeForTransformFeedback);
return false; return false;
} }
} }
...@@ -511,7 +511,7 @@ bool ValidateDrawArraysIndirect(Context *context, PrimitiveMode mode, const void ...@@ -511,7 +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->validationError(GL_INVALID_OPERATION, kErrorParamOverflow); context->validationError(GL_INVALID_OPERATION, kParamOverflow);
return false; return false;
} }
...@@ -533,7 +533,7 @@ bool ValidateDrawElementsIndirect(Context *context, ...@@ -533,7 +533,7 @@ bool ValidateDrawElementsIndirect(Context *context,
Buffer *elementArrayBuffer = vao->getElementArrayBuffer(); Buffer *elementArrayBuffer = vao->getElementArrayBuffer();
if (!elementArrayBuffer) if (!elementArrayBuffer)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorMustHaveElementArrayBinding); context->validationError(GL_INVALID_OPERATION, kMustHaveElementArrayBinding);
return false; return false;
} }
...@@ -676,7 +676,7 @@ bool ValidateProgramUniform1iv(Context *context, ...@@ -676,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))
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES31Required); context->validationError(GL_INVALID_OPERATION, kES31Required);
return false; return false;
} }
...@@ -892,7 +892,7 @@ bool ValidateGetTexLevelParameterfv(Context *context, ...@@ -892,7 +892,7 @@ bool ValidateGetTexLevelParameterfv(Context *context,
{ {
if (context->getClientVersion() < ES_3_1) if (context->getClientVersion() < ES_3_1)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES31Required); context->validationError(GL_INVALID_OPERATION, kES31Required);
return false; return false;
} }
...@@ -919,7 +919,7 @@ bool ValidateGetTexLevelParameteriv(Context *context, ...@@ -919,7 +919,7 @@ bool ValidateGetTexLevelParameteriv(Context *context,
{ {
if (context->getClientVersion() < ES_3_1) if (context->getClientVersion() < ES_3_1)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES31Required); context->validationError(GL_INVALID_OPERATION, kES31Required);
return false; return false;
} }
...@@ -948,7 +948,7 @@ bool ValidateTexStorage2DMultisample(Context *context, ...@@ -948,7 +948,7 @@ bool ValidateTexStorage2DMultisample(Context *context,
{ {
if (context->getClientVersion() < ES_3_1) if (context->getClientVersion() < ES_3_1)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES31Required); context->validationError(GL_INVALID_OPERATION, kES31Required);
return false; return false;
} }
...@@ -960,13 +960,13 @@ bool ValidateGetMultisamplefv(Context *context, GLenum pname, GLuint index, GLfl ...@@ -960,13 +960,13 @@ bool ValidateGetMultisamplefv(Context *context, GLenum pname, GLuint index, GLfl
{ {
if (context->getClientVersion() < ES_3_1) if (context->getClientVersion() < ES_3_1)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES31Required); context->validationError(GL_INVALID_OPERATION, kES31Required);
return false; return false;
} }
if (pname != GL_SAMPLE_POSITION) if (pname != GL_SAMPLE_POSITION)
{ {
context->validationError(GL_INVALID_ENUM, kErrorInvalidPname); context->validationError(GL_INVALID_ENUM, kInvalidPname);
return false; return false;
} }
...@@ -975,7 +975,7 @@ bool ValidateGetMultisamplefv(Context *context, GLenum pname, GLuint index, GLfl ...@@ -975,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->validationError(GL_INVALID_VALUE, kErrorIndexExceedsSamples); context->validationError(GL_INVALID_VALUE, kIndexExceedsSamples);
return false; return false;
} }
...@@ -997,13 +997,13 @@ bool ValidateFramebufferParameteri(Context *context, GLenum target, GLenum pname ...@@ -997,13 +997,13 @@ bool ValidateFramebufferParameteri(Context *context, GLenum target, GLenum pname
{ {
if (context->getClientVersion() < ES_3_1) if (context->getClientVersion() < ES_3_1)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES31Required); context->validationError(GL_INVALID_OPERATION, kES31Required);
return false; return false;
} }
if (!ValidFramebufferTarget(context, target)) if (!ValidFramebufferTarget(context, target))
{ {
context->validationError(GL_INVALID_ENUM, kErrorInvalidFramebufferTarget); context->validationError(GL_INVALID_ENUM, kInvalidFramebufferTarget);
return false; return false;
} }
...@@ -1053,20 +1053,20 @@ bool ValidateFramebufferParameteri(Context *context, GLenum target, GLenum pname ...@@ -1053,20 +1053,20 @@ bool ValidateFramebufferParameteri(Context *context, GLenum target, GLenum pname
{ {
if (!context->getExtensions().geometryShader) if (!context->getExtensions().geometryShader)
{ {
context->validationError(GL_INVALID_ENUM, kErrorGeometryShaderExtensionNotEnabled); context->validationError(GL_INVALID_ENUM, kGeometryShaderExtensionNotEnabled);
return false; return false;
} }
GLint maxLayers = context->getCaps().maxFramebufferLayers; GLint maxLayers = context->getCaps().maxFramebufferLayers;
if (param < 0 || param > maxLayers) if (param < 0 || param > maxLayers)
{ {
context->validationError(GL_INVALID_VALUE, kErrorInvalidFramebufferLayer); context->validationError(GL_INVALID_VALUE, kInvalidFramebufferLayer);
return false; return false;
} }
break; break;
} }
default: default:
{ {
context->validationError(GL_INVALID_ENUM, kErrorInvalidPname); context->validationError(GL_INVALID_ENUM, kInvalidPname);
return false; return false;
} }
} }
...@@ -1085,13 +1085,13 @@ bool ValidateGetFramebufferParameteriv(Context *context, GLenum target, GLenum p ...@@ -1085,13 +1085,13 @@ bool ValidateGetFramebufferParameteriv(Context *context, GLenum target, GLenum p
{ {
if (context->getClientVersion() < ES_3_1) if (context->getClientVersion() < ES_3_1)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES31Required); context->validationError(GL_INVALID_OPERATION, kES31Required);
return false; return false;
} }
if (!ValidFramebufferTarget(context, target)) if (!ValidFramebufferTarget(context, target))
{ {
context->validationError(GL_INVALID_ENUM, kErrorInvalidFramebufferTarget); context->validationError(GL_INVALID_ENUM, kInvalidFramebufferTarget);
return false; return false;
} }
...@@ -1105,12 +1105,12 @@ bool ValidateGetFramebufferParameteriv(Context *context, GLenum target, GLenum p ...@@ -1105,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)
{ {
context->validationError(GL_INVALID_ENUM, kErrorGeometryShaderExtensionNotEnabled); context->validationError(GL_INVALID_ENUM, kGeometryShaderExtensionNotEnabled);
return false; return false;
} }
break; break;
default: default:
context->validationError(GL_INVALID_ENUM, kErrorInvalidPname); context->validationError(GL_INVALID_ENUM, kInvalidPname);
return false; return false;
} }
...@@ -1143,7 +1143,7 @@ bool ValidateGetProgramResourceIndex(Context *context, ...@@ -1143,7 +1143,7 @@ bool ValidateGetProgramResourceIndex(Context *context,
{ {
if (context->getClientVersion() < ES_3_1) if (context->getClientVersion() < ES_3_1)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES31Required); context->validationError(GL_INVALID_OPERATION, kES31Required);
return false; return false;
} }
...@@ -1170,7 +1170,7 @@ bool ValidateBindVertexBuffer(Context *context, ...@@ -1170,7 +1170,7 @@ bool ValidateBindVertexBuffer(Context *context,
{ {
if (context->getClientVersion() < ES_3_1) if (context->getClientVersion() < ES_3_1)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES31Required); context->validationError(GL_INVALID_OPERATION, kES31Required);
return false; return false;
} }
...@@ -1190,7 +1190,7 @@ bool ValidateBindVertexBuffer(Context *context, ...@@ -1190,7 +1190,7 @@ bool ValidateBindVertexBuffer(Context *context,
if (offset < 0) if (offset < 0)
{ {
context->validationError(GL_INVALID_VALUE, kErrorNegativeOffset); context->validationError(GL_INVALID_VALUE, kNegativeOffset);
return false; return false;
} }
...@@ -1216,7 +1216,7 @@ bool ValidateVertexBindingDivisor(Context *context, GLuint bindingIndex, GLuint ...@@ -1216,7 +1216,7 @@ bool ValidateVertexBindingDivisor(Context *context, GLuint bindingIndex, GLuint
{ {
if (context->getClientVersion() < ES_3_1) if (context->getClientVersion() < ES_3_1)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES31Required); context->validationError(GL_INVALID_OPERATION, kES31Required);
return false; return false;
} }
...@@ -1263,7 +1263,7 @@ bool ValidateVertexAttribBinding(Context *context, GLuint attribIndex, GLuint bi ...@@ -1263,7 +1263,7 @@ bool ValidateVertexAttribBinding(Context *context, GLuint attribIndex, GLuint bi
{ {
if (context->getClientVersion() < ES_3_1) if (context->getClientVersion() < ES_3_1)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES31Required); context->validationError(GL_INVALID_OPERATION, kES31Required);
return false; return false;
} }
...@@ -1278,7 +1278,7 @@ bool ValidateVertexAttribBinding(Context *context, GLuint attribIndex, GLuint bi ...@@ -1278,7 +1278,7 @@ bool ValidateVertexAttribBinding(Context *context, GLuint attribIndex, GLuint bi
const Caps &caps = context->getCaps(); const Caps &caps = context->getCaps();
if (attribIndex >= caps.maxVertexAttributes) if (attribIndex >= caps.maxVertexAttributes)
{ {
context->validationError(GL_INVALID_VALUE, kErrorIndexExceedsMaxVertexAttribute); context->validationError(GL_INVALID_VALUE, kIndexExceedsMaxVertexAttribute);
return false; return false;
} }
...@@ -1302,7 +1302,7 @@ bool ValidateGetProgramResourceName(Context *context, ...@@ -1302,7 +1302,7 @@ bool ValidateGetProgramResourceName(Context *context,
{ {
if (context->getClientVersion() < ES_3_1) if (context->getClientVersion() < ES_3_1)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES31Required); context->validationError(GL_INVALID_OPERATION, kES31Required);
return false; return false;
} }
...@@ -1326,7 +1326,7 @@ bool ValidateGetProgramResourceName(Context *context, ...@@ -1326,7 +1326,7 @@ bool ValidateGetProgramResourceName(Context *context,
if (bufSize < 0) if (bufSize < 0)
{ {
context->validationError(GL_INVALID_VALUE, kErrorNegativeBufferSize); context->validationError(GL_INVALID_VALUE, kNegativeBufferSize);
return false; return false;
} }
...@@ -1340,7 +1340,7 @@ bool ValidateDispatchCompute(Context *context, ...@@ -1340,7 +1340,7 @@ bool ValidateDispatchCompute(Context *context,
{ {
if (context->getClientVersion() < ES_3_1) if (context->getClientVersion() < ES_3_1)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES31Required); context->validationError(GL_INVALID_OPERATION, kES31Required);
return false; return false;
} }
...@@ -1349,7 +1349,7 @@ bool ValidateDispatchCompute(Context *context, ...@@ -1349,7 +1349,7 @@ bool ValidateDispatchCompute(Context *context,
if (program == nullptr || !program->hasLinkedShaderStage(ShaderType::Compute)) if (program == nullptr || !program->hasLinkedShaderStage(ShaderType::Compute))
{ {
context->validationError(GL_INVALID_OPERATION, kErrorNoActiveProgramWithComputeShader); context->validationError(GL_INVALID_OPERATION, kNoActiveProgramWithComputeShader);
return false; return false;
} }
...@@ -1383,7 +1383,7 @@ bool ValidateDispatchComputeIndirect(Context *context, GLintptr indirect) ...@@ -1383,7 +1383,7 @@ bool ValidateDispatchComputeIndirect(Context *context, GLintptr indirect)
{ {
if (context->getClientVersion() < ES_3_1) if (context->getClientVersion() < ES_3_1)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES31Required); context->validationError(GL_INVALID_OPERATION, kES31Required);
return false; return false;
} }
...@@ -1392,26 +1392,26 @@ bool ValidateDispatchComputeIndirect(Context *context, GLintptr indirect) ...@@ -1392,26 +1392,26 @@ bool ValidateDispatchComputeIndirect(Context *context, GLintptr indirect)
if (program == nullptr || !program->hasLinkedShaderStage(ShaderType::Compute)) if (program == nullptr || !program->hasLinkedShaderStage(ShaderType::Compute))
{ {
context->validationError(GL_INVALID_OPERATION, kErrorNoActiveProgramWithComputeShader); context->validationError(GL_INVALID_OPERATION, kNoActiveProgramWithComputeShader);
return false; return false;
} }
if (indirect < 0) if (indirect < 0)
{ {
context->validationError(GL_INVALID_VALUE, kErrorNegativeOffset); context->validationError(GL_INVALID_VALUE, kNegativeOffset);
return false; return false;
} }
if ((indirect & (sizeof(GLuint) - 1)) != 0) if ((indirect & (sizeof(GLuint) - 1)) != 0)
{ {
context->validationError(GL_INVALID_VALUE, kErrorOffsetMustBeMultipleOfUint); context->validationError(GL_INVALID_VALUE, kOffsetMustBeMultipleOfUint);
return false; return false;
} }
Buffer *dispatchIndirectBuffer = state.getTargetBuffer(BufferBinding::DispatchIndirect); Buffer *dispatchIndirectBuffer = state.getTargetBuffer(BufferBinding::DispatchIndirect);
if (!dispatchIndirectBuffer) if (!dispatchIndirectBuffer)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorDispatchIndirectBufferNotBound); context->validationError(GL_INVALID_OPERATION, kDispatchIndirectBufferNotBound);
return false; return false;
} }
...@@ -1420,7 +1420,7 @@ bool ValidateDispatchComputeIndirect(Context *context, GLintptr indirect) ...@@ -1420,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()))
{ {
context->validationError(GL_INVALID_OPERATION, kErrorInsufficientBufferSize); context->validationError(GL_INVALID_OPERATION, kInsufficientBufferSize);
return false; return false;
} }
...@@ -1513,7 +1513,7 @@ bool ValidateGetProgramResourceLocation(Context *context, ...@@ -1513,7 +1513,7 @@ bool ValidateGetProgramResourceLocation(Context *context,
{ {
if (context->getClientVersion() < ES_3_1) if (context->getClientVersion() < ES_3_1)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES31Required); context->validationError(GL_INVALID_OPERATION, kES31Required);
return false; return false;
} }
...@@ -1549,7 +1549,7 @@ bool ValidateGetProgramResourceiv(Context *context, ...@@ -1549,7 +1549,7 @@ bool ValidateGetProgramResourceiv(Context *context,
{ {
if (context->getClientVersion() < ES_3_1) if (context->getClientVersion() < ES_3_1)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES31Required); context->validationError(GL_INVALID_OPERATION, kES31Required);
return false; return false;
} }
...@@ -1602,7 +1602,7 @@ bool ValidateGetProgramInterfaceiv(Context *context, ...@@ -1602,7 +1602,7 @@ bool ValidateGetProgramInterfaceiv(Context *context,
{ {
if (context->getClientVersion() < ES_3_1) if (context->getClientVersion() < ES_3_1)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES31Required); context->validationError(GL_INVALID_OPERATION, kES31Required);
return false; return false;
} }
...@@ -1673,7 +1673,7 @@ static bool ValidateGenOrDeleteES31(Context *context, GLint n) ...@@ -1673,7 +1673,7 @@ static bool ValidateGenOrDeleteES31(Context *context, GLint n)
{ {
if (context->getClientVersion() < ES_3_1) if (context->getClientVersion() < ES_3_1)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES31Required); context->validationError(GL_INVALID_OPERATION, kES31Required);
return false; return false;
} }
...@@ -1694,13 +1694,13 @@ bool ValidateBindProgramPipeline(Context *context, GLuint pipeline) ...@@ -1694,13 +1694,13 @@ bool ValidateBindProgramPipeline(Context *context, GLuint pipeline)
{ {
if (context->getClientVersion() < ES_3_1) if (context->getClientVersion() < ES_3_1)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES31Required); context->validationError(GL_INVALID_OPERATION, kES31Required);
return false; return false;
} }
if (!context->isProgramPipelineGenerated(pipeline)) if (!context->isProgramPipelineGenerated(pipeline))
{ {
context->validationError(GL_INVALID_OPERATION, kErrorObjectNotGenerated); context->validationError(GL_INVALID_OPERATION, kObjectNotGenerated);
return false; return false;
} }
...@@ -1711,7 +1711,7 @@ bool ValidateIsProgramPipeline(Context *context, GLuint pipeline) ...@@ -1711,7 +1711,7 @@ bool ValidateIsProgramPipeline(Context *context, GLuint pipeline)
{ {
if (context->getClientVersion() < ES_3_1) if (context->getClientVersion() < ES_3_1)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES31Required); context->validationError(GL_INVALID_OPERATION, kES31Required);
return false; return false;
} }
...@@ -1765,7 +1765,7 @@ bool ValidateMemoryBarrier(Context *context, GLbitfield barriers) ...@@ -1765,7 +1765,7 @@ bool ValidateMemoryBarrier(Context *context, GLbitfield barriers)
{ {
if (context->getClientVersion() < ES_3_1) if (context->getClientVersion() < ES_3_1)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES31Required); context->validationError(GL_INVALID_OPERATION, kES31Required);
return false; return false;
} }
...@@ -1782,7 +1782,7 @@ bool ValidateMemoryBarrier(Context *context, GLbitfield barriers) ...@@ -1782,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)
{ {
context->validationError(GL_INVALID_VALUE, kErrorInvalidMemoryBarrierBit); context->validationError(GL_INVALID_VALUE, kInvalidMemoryBarrierBit);
return false; return false;
} }
...@@ -1793,7 +1793,7 @@ bool ValidateMemoryBarrierByRegion(Context *context, GLbitfield barriers) ...@@ -1793,7 +1793,7 @@ bool ValidateMemoryBarrierByRegion(Context *context, GLbitfield barriers)
{ {
if (context->getClientVersion() < ES_3_1) if (context->getClientVersion() < ES_3_1)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES31Required); context->validationError(GL_INVALID_OPERATION, kES31Required);
return false; return false;
} }
...@@ -1808,7 +1808,7 @@ bool ValidateMemoryBarrierByRegion(Context *context, GLbitfield barriers) ...@@ -1808,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)
{ {
context->validationError(GL_INVALID_VALUE, kErrorInvalidMemoryBarrierBit); context->validationError(GL_INVALID_VALUE, kInvalidMemoryBarrierBit);
return false; return false;
} }
...@@ -1819,13 +1819,13 @@ bool ValidateSampleMaski(Context *context, GLuint maskNumber, GLbitfield mask) ...@@ -1819,13 +1819,13 @@ bool ValidateSampleMaski(Context *context, GLuint maskNumber, GLbitfield mask)
{ {
if (context->getClientVersion() < ES_3_1) if (context->getClientVersion() < ES_3_1)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES31Required); context->validationError(GL_INVALID_OPERATION, kES31Required);
return false; return false;
} }
if (maskNumber >= context->getCaps().maxSampleMaskWords) if (maskNumber >= context->getCaps().maxSampleMaskWords)
{ {
context->validationError(GL_INVALID_VALUE, kErrorInvalidSampleMaskNumber); context->validationError(GL_INVALID_VALUE, kInvalidSampleMaskNumber);
return false; return false;
} }
...@@ -1840,7 +1840,7 @@ bool ValidateFramebufferTextureEXT(Context *context, ...@@ -1840,7 +1840,7 @@ bool ValidateFramebufferTextureEXT(Context *context,
{ {
if (!context->getExtensions().geometryShader) if (!context->getExtensions().geometryShader)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorGeometryShaderExtensionNotEnabled); context->validationError(GL_INVALID_OPERATION, kGeometryShaderExtensionNotEnabled);
return false; return false;
} }
...@@ -1860,13 +1860,13 @@ bool ValidateFramebufferTextureEXT(Context *context, ...@@ -1860,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)
{ {
context->validationError(GL_INVALID_VALUE, kErrorInvalidTextureName); context->validationError(GL_INVALID_VALUE, kInvalidTextureName);
return false; return false;
} }
if (!ValidMipLevel(context, tex->getType(), level)) if (!ValidMipLevel(context, tex->getType(), level))
{ {
context->validationError(GL_INVALID_VALUE, kErrorInvalidMipLevel); context->validationError(GL_INVALID_VALUE, kInvalidMipLevel);
return false; return false;
} }
} }
...@@ -1891,19 +1891,19 @@ bool ValidateTexStorage3DMultisampleOES(Context *context, ...@@ -1891,19 +1891,19 @@ bool ValidateTexStorage3DMultisampleOES(Context *context,
{ {
if (!context->getExtensions().textureStorageMultisample2DArray) if (!context->getExtensions().textureStorageMultisample2DArray)
{ {
context->validationError(GL_INVALID_ENUM, kErrorMultisampleArrayExtensionRequired); context->validationError(GL_INVALID_ENUM, kMultisampleArrayExtensionRequired);
return false; return false;
} }
if (target != TextureType::_2DMultisampleArray) if (target != TextureType::_2DMultisampleArray)
{ {
context->validationError(GL_INVALID_ENUM, kErrorTargetMustBeTexture2DMultisampleArrayOES); context->validationError(GL_INVALID_ENUM, kTargetMustBeTexture2DMultisampleArrayOES);
return false; return false;
} }
if (width < 1 || height < 1 || depth < 1) if (width < 1 || height < 1 || depth < 1)
{ {
context->validationError(GL_INVALID_VALUE, kErrorNegativeSize); context->validationError(GL_INVALID_VALUE, kNegativeSize);
return false; return false;
} }
...@@ -1918,17 +1918,17 @@ bool ValidateGetProgramResourceLocationIndexEXT(Context *context, ...@@ -1918,17 +1918,17 @@ bool ValidateGetProgramResourceLocationIndexEXT(Context *context,
{ {
if (!context->getExtensions().blendFuncExtended) if (!context->getExtensions().blendFuncExtended)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorExtensionNotEnabled); context->validationError(GL_INVALID_OPERATION, kExtensionNotEnabled);
return false; return false;
} }
if (context->getClientVersion() < ES_3_1) if (context->getClientVersion() < ES_3_1)
{ {
context->validationError(GL_INVALID_OPERATION, kErrorES31Required); context->validationError(GL_INVALID_OPERATION, kES31Required);
return false; return false;
} }
if (programInterface != GL_PROGRAM_OUTPUT) if (programInterface != GL_PROGRAM_OUTPUT)
{ {
context->validationError(GL_INVALID_ENUM, kErrorProgramInterfaceMustBeProgramOutput); context->validationError(GL_INVALID_ENUM, kProgramInterfaceMustBeProgramOutput);
return false; return false;
} }
Program *programObject = GetValidProgram(context, program); Program *programObject = GetValidProgram(context, program);
...@@ -1938,7 +1938,7 @@ bool ValidateGetProgramResourceLocationIndexEXT(Context *context, ...@@ -1938,7 +1938,7 @@ bool ValidateGetProgramResourceLocationIndexEXT(Context *context,
} }
if (!programObject->isLinked()) if (!programObject->isLinked())
{ {
context->validationError(GL_INVALID_OPERATION, kErrorProgramNotLinked); context->validationError(GL_INVALID_OPERATION, kProgramNotLinked);
return false; return false;
} }
return true; return true;
......
...@@ -87,7 +87,7 @@ TEST_P(ErrorMessagesTest, ErrorMessages) ...@@ -87,7 +87,7 @@ TEST_P(ErrorMessagesTest, ErrorMessages)
constexpr GLenum type = GL_DEBUG_TYPE_ERROR; constexpr GLenum type = GL_DEBUG_TYPE_ERROR;
constexpr GLenum severity = GL_DEBUG_SEVERITY_HIGH; constexpr GLenum severity = GL_DEBUG_SEVERITY_HIGH;
constexpr GLuint id1 = 1282; constexpr GLuint id1 = 1282;
const std::string message1 = gl::kErrorWebglBindAttribLocationReservedPrefix; const std::string message1 = gl::err::kWebglBindAttribLocationReservedPrefix;
Message expectedMessage; Message expectedMessage;
GLint numMessages = 0; GLint numMessages = 0;
......
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