Commit c52f6f1a by Geoff Lang Committed by Commit Bot

Implement remaining robust TexImage entry points.

BUG=angleproject:1354 Change-Id: Ied04fa28387f3bef9f2bead7b60878b1a353c8bd Reviewed-on: https://chromium-review.googlesource.com/399039 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: 's avatarCorentin Wallez <cwallez@chromium.org>
parent 2186c385
......@@ -2043,6 +2043,36 @@ bool ValidateTexSubImage2D(Context *context,
pixels);
}
bool ValidateTexSubImage2DRobustANGLE(Context *context,
GLenum target,
GLint level,
GLint xoffset,
GLint yoffset,
GLsizei width,
GLsizei height,
GLenum format,
GLenum type,
GLsizei bufSize,
const GLvoid *pixels)
{
if (!ValidateRobustEntryPoint(context, bufSize))
{
return false;
}
if (context->getClientMajorVersion() < 3)
{
return ValidateES2TexImageParameters(context, target, level, GL_NONE, false, true, xoffset,
yoffset, width, height, 0, format, type, bufSize,
pixels);
}
ASSERT(context->getClientMajorVersion() >= 3);
return ValidateES3TexImage2DParameters(context, target, level, GL_NONE, false, true, xoffset,
yoffset, 0, width, height, 1, 0, format, type, bufSize,
pixels);
}
bool ValidateCompressedTexImage2D(Context *context,
GLenum target,
GLint level,
......
......@@ -170,6 +170,17 @@ bool ValidateTexSubImage2D(Context *context,
GLenum format,
GLenum type,
const GLvoid *pixels);
bool ValidateTexSubImage2DRobustANGLE(Context *context,
GLenum target,
GLint level,
GLint xoffset,
GLint yoffset,
GLsizei width,
GLsizei height,
GLenum format,
GLenum type,
GLsizei bufSize,
const GLvoid *pixels);
bool ValidateCompressedTexImage2D(Context *context,
GLenum target,
GLint level,
......
......@@ -328,6 +328,7 @@ bool ValidateES3TexImage3DParameters(Context *context,
GLint border,
GLenum format,
GLenum type,
GLsizei bufSize,
const GLvoid *pixels)
{
if (!ValidTexture3DDestinationTarget(context, target))
......@@ -338,7 +339,7 @@ bool ValidateES3TexImage3DParameters(Context *context,
return ValidateES3TexImageParametersBase(context, target, level, internalformat, isCompressed,
isSubImage, xoffset, yoffset, zoffset, width, height,
depth, border, format, type, -1, pixels);
depth, border, format, type, bufSize, pixels);
}
struct EffectiveInternalFormatInfo
......@@ -1269,7 +1270,8 @@ bool ValidateCompressedTexImage3D(Context *context,
// validateES3TexImageFormat sets the error code if there is an error
if (!ValidateES3TexImage3DParameters(context, target, level, internalformat, true, false, 0, 0,
0, width, height, depth, border, GL_NONE, GL_NONE, data))
0, width, height, depth, border, GL_NONE, GL_NONE, -1,
data))
{
return false;
}
......@@ -1547,10 +1549,39 @@ bool ValidateTexImage3D(Context *context,
}
return ValidateES3TexImage3DParameters(context, target, level, internalformat, false, false, 0,
0, 0, width, height, depth, border, format, type,
0, 0, width, height, depth, border, format, type, -1,
pixels);
}
bool ValidateTexImage3DRobustANGLE(Context *context,
GLenum target,
GLint level,
GLint internalformat,
GLsizei width,
GLsizei height,
GLsizei depth,
GLint border,
GLenum format,
GLenum type,
GLsizei bufSize,
const GLvoid *pixels)
{
if (context->getClientMajorVersion() < 3)
{
context->handleError(Error(GL_INVALID_OPERATION));
return false;
}
if (!ValidateRobustEntryPoint(context, bufSize))
{
return false;
}
return ValidateES3TexImage3DParameters(context, target, level, internalformat, false, false, 0,
0, 0, width, height, depth, border, format, type,
bufSize, pixels);
}
bool ValidateTexSubImage3D(Context *context,
GLenum target,
GLint level,
......@@ -1572,7 +1603,37 @@ bool ValidateTexSubImage3D(Context *context,
return ValidateES3TexImage3DParameters(context, target, level, GL_NONE, false, true, xoffset,
yoffset, zoffset, width, height, depth, 0, format, type,
pixels);
-1, pixels);
}
bool ValidateTexSubImage3DRobustANGLE(Context *context,
GLenum target,
GLint level,
GLint xoffset,
GLint yoffset,
GLint zoffset,
GLsizei width,
GLsizei height,
GLsizei depth,
GLenum format,
GLenum type,
GLsizei bufSize,
const GLvoid *pixels)
{
if (context->getClientMajorVersion() < 3)
{
context->handleError(Error(GL_INVALID_OPERATION));
return false;
}
if (!ValidateRobustEntryPoint(context, bufSize))
{
return false;
}
return ValidateES3TexImage3DParameters(context, target, level, GL_NONE, false, true, xoffset,
yoffset, zoffset, width, height, depth, 0, format, type,
bufSize, pixels);
}
bool ValidateCompressedTexSubImage3D(Context *context,
......@@ -1615,7 +1676,7 @@ bool ValidateCompressedTexSubImage3D(Context *context,
}
return ValidateES3TexImage3DParameters(context, target, level, GL_NONE, true, true, 0, 0, 0,
width, height, depth, 0, GL_NONE, GL_NONE, data);
width, height, depth, 0, GL_NONE, GL_NONE, -1, data);
}
bool ValidateGenQueries(Context *context, GLint n, GLuint *)
......
......@@ -76,6 +76,7 @@ bool ValidateES3TexImage3DParameters(Context *context,
GLint border,
GLenum format,
GLenum type,
GLsizei bufSize,
const GLvoid *pixels);
bool ValidateES3CopyTexImageParametersBase(ValidationContext *context,
......@@ -252,6 +253,18 @@ bool ValidateTexImage3D(Context *context,
GLenum format,
GLenum type,
const GLvoid *pixels);
bool ValidateTexImage3DRobustANGLE(Context *context,
GLenum target,
GLint level,
GLint internalformat,
GLsizei width,
GLsizei height,
GLsizei depth,
GLint border,
GLenum format,
GLenum type,
GLsizei bufSize,
const GLvoid *pixels);
bool ValidateTexSubImage3D(Context *context,
GLenum target,
GLint level,
......@@ -264,6 +277,19 @@ bool ValidateTexSubImage3D(Context *context,
GLenum format,
GLenum type,
const GLvoid *pixels);
bool ValidateTexSubImage3DRobustANGLE(Context *context,
GLenum target,
GLint level,
GLint xoffset,
GLint yoffset,
GLint zoffset,
GLsizei width,
GLsizei height,
GLsizei depth,
GLenum format,
GLenum type,
GLsizei bufSize,
const GLvoid *pixels);
bool ValidateCompressedTexSubImage3D(Context *context,
GLenum target,
GLint level,
......
......@@ -2519,7 +2519,19 @@ ANGLE_EXPORT void GL_APIENTRY TexSubImage2DRobustANGLE(GLenum target,
"GLsizei width = %d, GLsizei height = %d, GLenum format = 0x%X, GLenum type = 0x%X, "
"GLsizei bufsize = %d, const GLvoid* pixels = 0x%0.8p)",
target, level, xoffset, yoffset, width, height, format, type, bufSize, pixels);
UNIMPLEMENTED();
Context *context = GetValidGlobalContext();
if (context)
{
if (!ValidateTexSubImage2DRobustANGLE(context, target, level, xoffset, yoffset, width,
height, format, type, bufSize, pixels))
{
return;
}
context->texSubImage2D(target, level, xoffset, yoffset, width, height, format, type,
pixels);
}
}
ANGLE_EXPORT void GL_APIENTRY TexImage3DRobustANGLE(GLenum target,
......@@ -2539,7 +2551,19 @@ ANGLE_EXPORT void GL_APIENTRY TexImage3DRobustANGLE(GLenum target,
"GLsizei height = %d, GLsizei depth = %d, GLint border = %d, GLenum format = 0x%X, "
"GLenum type = 0x%X, GLsizei bufsize = %d, const GLvoid* pixels = 0x%0.8p)",
target, level, internalformat, width, height, depth, border, format, type, bufSize, pixels);
UNIMPLEMENTED();
Context *context = GetValidGlobalContext();
if (context)
{
if (!ValidateTexImage3DRobustANGLE(context, target, level, internalformat, width, height,
depth, border, format, type, bufSize, pixels))
{
return;
}
context->texImage3D(target, level, internalformat, width, height, depth, border, format,
type, pixels);
}
}
ANGLE_EXPORT void GL_APIENTRY TexSubImage3DRobustANGLE(GLenum target,
......@@ -2555,6 +2579,26 @@ ANGLE_EXPORT void GL_APIENTRY TexSubImage3DRobustANGLE(GLenum target,
GLsizei bufSize,
const void *pixels)
{
EVENT(
"(GLenum target = 0x%X, GLint level = %d, GLint xoffset = %d, GLint yoffset = %d, "
"GLint zoffset = %d, GLsizei width = %d, GLsizei height = %d, GLsizei depth = %d, "
"GLenum format = 0x%X, GLenum type = 0x%X, GLsizei bufsize = %d, const GLvoid* pixels = "
"0x%0.8p)",
target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, bufSize,
pixels);
Context *context = GetValidGlobalContext();
if (context)
{
if (!ValidateTexSubImage3DRobustANGLE(context, target, level, xoffset, yoffset, zoffset,
width, height, depth, format, type, bufSize, pixels))
{
return;
}
context->texSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth,
format, type, pixels);
}
}
ANGLE_EXPORT void GL_APIENTRY
......
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