Commit 4d161bad by Shannon Woods

Amends CopyTexImage validation to conform to new language in the ES 3.0.3 spec.

bug=angle:582 Also performs format checks for non-subimage copies, and permits unsized format textures as destination for the copy. Change-Id: Id647bb968416fbd35e1c70e5da21c81367e08f07 Reviewed-on: https://chromium-review.googlesource.com/189431Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Tested-by: 's avatarShannon Woods <shannonwoods@chromium.org>
parent 3e29695d
...@@ -50,7 +50,7 @@ bool IsValidFormat(GLenum format, GLuint clientVersion); ...@@ -50,7 +50,7 @@ bool IsValidFormat(GLenum format, GLuint clientVersion);
bool IsValidType(GLenum type, GLuint clientVersion); bool IsValidType(GLenum type, GLuint clientVersion);
bool IsValidFormatCombination(GLenum internalFormat, GLenum format, GLenum type, GLuint clientVersion); bool IsValidFormatCombination(GLenum internalFormat, GLenum format, GLenum type, GLuint clientVersion);
bool IsValidCopyTexImageCombination(GLenum textureInternalFormat, GLenum frameBufferInternalFormat, GLuint clientVersion); bool IsValidCopyTexImageCombination(GLenum textureInternalFormat, GLenum frameBufferInternalFormat, GLuint readBufferHandle, GLuint clientVersion);
bool IsSizedInternalFormat(GLenum internalFormat, GLuint clientVersion); bool IsSizedInternalFormat(GLenum internalFormat, GLuint clientVersion);
GLenum GetSizedInternalFormat(GLenum format, GLenum type, GLuint clientVersion); GLenum GetSizedInternalFormat(GLenum format, GLenum type, GLuint clientVersion);
...@@ -66,6 +66,7 @@ GLuint GetStencilBits(GLenum internalFormat, GLuint clientVersion); ...@@ -66,6 +66,7 @@ GLuint GetStencilBits(GLenum internalFormat, GLuint clientVersion);
GLuint GetTypeBytes(GLenum type); GLuint GetTypeBytes(GLenum type);
bool IsSpecialInterpretationType(GLenum type); bool IsSpecialInterpretationType(GLenum type);
bool IsFloatOrFixedComponentType(GLenum type);
GLenum GetFormat(GLenum internalFormat, GLuint clientVersion); GLenum GetFormat(GLenum internalFormat, GLuint clientVersion);
GLenum GetType(GLenum internalFormat, GLuint clientVersion); GLenum GetType(GLenum internalFormat, GLuint clientVersion);
......
...@@ -435,12 +435,21 @@ bool ValidateES3CopyTexImageParameters(gl::Context *context, GLenum target, GLin ...@@ -435,12 +435,21 @@ bool ValidateES3CopyTexImageParameters(gl::Context *context, GLenum target, GLin
return gl::error(GL_INVALID_VALUE, false); return gl::error(GL_INVALID_VALUE, false);
} }
if (!gl::IsValidCopyTexImageCombination(textureInternalFormat, colorbufferInternalFormat, if (!gl::IsValidCopyTexImageCombination(textureInternalFormat, colorbufferInternalFormat, context->getReadFramebufferHandle(),
context->getClientVersion())) context->getClientVersion()))
{ {
return gl::error(GL_INVALID_OPERATION, false); return gl::error(GL_INVALID_OPERATION, false);
} }
} }
else
{
if (!gl::IsValidCopyTexImageCombination(internalformat, colorbufferInternalFormat, context->getReadFramebufferHandle(),
context->getClientVersion()))
{
return gl::error(GL_INVALID_OPERATION, false);
}
}
// If width or height is zero, it is a no-op. Return false without setting an error. // If width or height is zero, it is a no-op. Return false without setting an error.
return (width > 0 && height > 0); return (width > 0 && height > 0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment