Commit 610640fa by Jamie Madill Committed by Commit Bot

Don't use gl::Error in validation.

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