Commit e3688d27 by Yuly Novikov Committed by Commit Bot

Revert "Add NPOT validation to copyTextureCHROMIUM"

This reverts commit 2202680c. Reason for revert: ASAN found error https://ci.chromium.org/buildbot/chromium.gpu.fyi/Mac%20FYI%20GPU%20ASAN%20Release/210 Original change's description: > Add NPOT validation to copyTextureCHROMIUM > > copyTextureCHROMIUM should generate INVALID_VALUE when using a NPOT > texture and level not equal to zero, so we should add > validation to catch this case. > > BUG=angleproject:2380 > > Change-Id: I0ea50a981e4d8f10f5913969f6b629617b57aa15 > Reviewed-on: https://chromium-review.googlesource.com/951713 > Commit-Queue: Geoff Lang <geofflang@chromium.org> > Reviewed-by: Geoff Lang <geofflang@chromium.org> TBR=geofflang@chromium.org,jmadill@chromium.org,brandon1.jones@intel.com Change-Id: I04dcbd5e1d97b1bd968b26a06e4d3e4d175be0d8 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: angleproject:2380 Reviewed-on: https://chromium-review.googlesource.com/953343Reviewed-by: 's avatarYuly Novikov <ynovikov@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
parent da6dd738
...@@ -371,19 +371,13 @@ bool IsValidCopyTextureDestinationLevel(Context *context, ...@@ -371,19 +371,13 @@ bool IsValidCopyTextureDestinationLevel(Context *context,
TextureType type, TextureType type,
GLint level, GLint level,
GLsizei width, GLsizei width,
GLsizei height, GLsizei height)
bool isSubImage)
{ {
if (!ValidMipLevel(context, type, level)) if (!ValidMipLevel(context, type, level))
{ {
return false; return false;
} }
if (!ValidImageSizeParameters(context, type, level, width, height, 1, isSubImage))
{
return false;
}
const Caps &caps = context->getCaps(); const Caps &caps = context->getCaps();
switch (type) switch (type)
{ {
...@@ -3922,7 +3916,7 @@ bool ValidateCopyTextureCHROMIUM(Context *context, ...@@ -3922,7 +3916,7 @@ bool ValidateCopyTextureCHROMIUM(Context *context,
} }
if (!IsValidCopyTextureDestinationLevel(context, dest->getType(), destLevel, sourceWidth, if (!IsValidCopyTextureDestinationLevel(context, dest->getType(), destLevel, sourceWidth,
sourceHeight, false)) sourceHeight))
{ {
ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidMipLevel); ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidMipLevel);
return false; return false;
...@@ -4050,8 +4044,7 @@ bool ValidateCopySubTextureCHROMIUM(Context *context, ...@@ -4050,8 +4044,7 @@ bool ValidateCopySubTextureCHROMIUM(Context *context,
return false; return false;
} }
if (!IsValidCopyTextureDestinationLevel(context, dest->getType(), destLevel, width, height, if (!IsValidCopyTextureDestinationLevel(context, dest->getType(), destLevel, width, height))
true))
{ {
context->handleError(InvalidValue() << "Destination texture level is not valid."); context->handleError(InvalidValue() << "Destination texture level is not valid.");
return false; return false;
......
...@@ -132,12 +132,6 @@ class CopyTextureTestDest : public CopyTextureTest ...@@ -132,12 +132,6 @@ class CopyTextureTestDest : public CopyTextureTest
{ {
}; };
class CopyTextureTestWebGL : public CopyTextureTest
{
protected:
CopyTextureTestWebGL() : CopyTextureTest() { setWebGLCompatibilityEnabled(true); }
};
class CopyTextureTestES3 : public CopyTextureTest class CopyTextureTestES3 : public CopyTextureTest
{ {
}; };
...@@ -1185,35 +1179,6 @@ TEST_P(CopyTextureTestDest, AlphaCopyWithRGB) ...@@ -1185,35 +1179,6 @@ TEST_P(CopyTextureTestDest, AlphaCopyWithRGB)
EXPECT_PIXEL_COLOR_EQ(0, 0, expectedPixels); EXPECT_PIXEL_COLOR_EQ(0, 0, expectedPixels);
} }
// Test to ensure that CopyTexture will fail with a non-zero level and NPOT texture in WebGL
TEST_P(CopyTextureTestWebGL, NPOT)
{
if (extensionRequestable("GL_CHROMIUM_copy_texture"))
{
glRequestExtensionANGLE("GL_CHROMIUM_copy_texture");
}
ANGLE_SKIP_TEST_IF(!extensionEnabled("GL_CHROMIUM_copy_texture"));
GLColor pixels = GLColor::red;
glBindTexture(GL_TEXTURE_2D, mTextures[0]);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 10, 10, 0, GL_RGBA, GL_UNSIGNED_BYTE, &pixels);
// Do a basic copy to make sure things work
glCopyTextureCHROMIUM(mTextures[0], 0, GL_TEXTURE_2D, mTextures[1], 0, GL_RGBA,
GL_UNSIGNED_BYTE, false, false, false);
EXPECT_GL_NO_ERROR();
EXPECT_PIXEL_COLOR_EQ(0, 0, pixels);
// Do the same operation with destLevel 1, which should fail
glCopyTextureCHROMIUM(mTextures[0], 0, GL_TEXTURE_2D, mTextures[1], 1, GL_RGBA,
GL_UNSIGNED_BYTE, false, false, false);
EXPECT_GL_ERROR(GL_INVALID_VALUE);
}
// Test the newly added ES3 unorm formats // Test the newly added ES3 unorm formats
TEST_P(CopyTextureTestES3, ES3UnormFormats) TEST_P(CopyTextureTestES3, ES3UnormFormats)
{ {
...@@ -1559,7 +1524,6 @@ TEST_P(CopyTextureTestES3, ES3UintFormats) ...@@ -1559,7 +1524,6 @@ TEST_P(CopyTextureTestES3, ES3UintFormats)
// Use this to select which configurations (e.g. which renderer, which GLES major version) these // Use this to select which configurations (e.g. which renderer, which GLES major version) these
// tests should be run against. // tests should be run against.
ANGLE_INSTANTIATE_TEST(CopyTextureTest, ES2_D3D9(), ES2_D3D11(), ES2_OPENGL(), ES2_OPENGLES()); ANGLE_INSTANTIATE_TEST(CopyTextureTest, ES2_D3D9(), ES2_D3D11(), ES2_OPENGL(), ES2_OPENGLES());
ANGLE_INSTANTIATE_TEST(CopyTextureTestWebGL, ES2_D3D9(), ES2_D3D11(), ES2_OPENGL(), ES2_OPENGLES());
ANGLE_INSTANTIATE_TEST(CopyTextureTestDest, ES2_D3D11()); ANGLE_INSTANTIATE_TEST(CopyTextureTestDest, ES2_D3D11());
ANGLE_INSTANTIATE_TEST(CopyTextureTestES3, ES3_D3D11(), ES3_OPENGL(), ES3_OPENGLES()); ANGLE_INSTANTIATE_TEST(CopyTextureTestES3, ES3_D3D11(), ES3_OPENGL(), ES3_OPENGLES());
......
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