Commit 5ca5c65c by Geoff Lang Committed by Commit Bot

Pass offsets to base validation for CompressedSubTexImage3D.

BUG=angleproject:2216 Change-Id: I54716fe7ba08a19d5f4c3287701cffc650adb2d8 Reviewed-on: https://chromium-review.googlesource.com/742504 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent e1f3ad4d
......@@ -2026,8 +2026,9 @@ bool ValidateCompressedTexSubImage3D(Context *context,
return false;
}
return ValidateES3TexImage3DParameters(context, target, level, GL_NONE, true, true, 0, 0, 0,
width, height, depth, 0, format, GL_NONE, -1, data);
return ValidateES3TexImage3DParameters(context, target, level, GL_NONE, true, true, xoffset,
yoffset, zoffset, width, height, depth, 0, format,
GL_NONE, -1, data);
}
bool ValidateCompressedTexSubImage3DRobustANGLE(Context *context,
GLenum target,
......
......@@ -192,6 +192,15 @@ TEST_P(DXT1CompressedTextureTest, CompressedTexSubImageValidation)
glCompressedTexSubImage2D(GL_TEXTURE_2D, 0, 1, 3, pixel_1_width, pixel_1_height,
GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, pixel_1_size, pixel_1_data);
ASSERT_GL_ERROR(GL_INVALID_OPERATION);
// Set a sub image with a negative offset
glCompressedTexSubImage2D(GL_TEXTURE_2D, 0, -1, 0, 4, 4, GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, 8,
pixel_1_data);
ASSERT_GL_ERROR(GL_INVALID_VALUE);
glCompressedTexSubImage2D(GL_TEXTURE_2D, 0, 0, -1, 4, 4, GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, 8,
pixel_1_data);
ASSERT_GL_ERROR(GL_INVALID_VALUE);
}
// Test that it's not possible to call CopyTexSubImage2D on a compressed texture
......@@ -283,6 +292,32 @@ TEST_P(DXT1CompressedTextureTestES3, PBOCompressedTexImage)
EXPECT_GL_NO_ERROR();
}
// Test validation of glCompressedTexSubImage3D with DXT formats
TEST_P(DXT1CompressedTextureTestES3, CompressedTexSubImageValidation)
{
ANGLE_SKIP_TEST_IF(!extensionEnabled("GL_EXT_texture_compression_dxt1"));
GLTexture texture;
glBindTexture(GL_TEXTURE_2D_ARRAY, texture.get());
// Size mip 0 to a large size
glCompressedTexImage3D(GL_TEXTURE_2D_ARRAY, 0, GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, pixel_0_width,
pixel_0_height, 1, 0, pixel_0_size, nullptr);
ASSERT_GL_NO_ERROR();
// Set a sub image with a negative offset
glCompressedTexSubImage3D(GL_TEXTURE_2D_ARRAY, 0, -1, 0, 0, 4, 4, 1,
GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, 8, pixel_1_data);
ASSERT_GL_ERROR(GL_INVALID_VALUE);
glCompressedTexSubImage3D(GL_TEXTURE_2D_ARRAY, 0, 0, -1, 0, 4, 4, 1,
GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, 8, pixel_1_data);
ASSERT_GL_ERROR(GL_INVALID_VALUE);
glCompressedTexSubImage3D(GL_TEXTURE_2D_ARRAY, 0, 0, 0, -1, 4, 4, 1,
GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, 8, pixel_1_data);
ASSERT_GL_ERROR(GL_INVALID_VALUE);
}
TEST_P(DXT1CompressedTextureTestD3D11, PBOCompressedTexStorage)
{
......
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