Commit 3c43b4d1 by Jiawei Shao Committed by Commit Bot

Fix incorrect conversion in ConvertToGLint

This patch fixes a bug in function ConvertToGLint. This function should convert ParamType into GLint instead of GLenum. This patch can fix the bug that no errors are generated when trying to set negative base level or max level by glTexParameteri because ConvertToGLint always incorrectly converts a negative integer into an unsigned integer in ValidateTexParameterBase. BUG=angleproject:2371 TEST=angle_end2end_tests dEQP-GLES31.functional.debug.negative_coverage.get_error.texture.texparameter* Change-Id: Id5baf3430ae574a083bcc40a7a8f7db1cb2d07ed Reviewed-on: https://chromium-review.googlesource.com/933923Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarJiajia Qin <jiajia.qin@intel.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent 20c46284
......@@ -82,7 +82,7 @@ GLenum ConvertToGLenum(ParamType param)
}
template <typename ParamType>
GLenum ConvertToGLint(ParamType param)
GLint ConvertToGLint(ParamType param)
{
return CastQueryValueTo<GLint>(GL_NONE, param);
}
......
......@@ -79,9 +79,6 @@
1442 D3D11 : dEQP-GLES31.functional.layout_binding.ssbo.* = FAIL
1442 D3D11 : dEQP-GLES31.functional.compute* = FAIL
1442 D3D11 : dEQP-GLES31.functional.atomic_counter.* = FAIL
1442 D3D11 : dEQP-GLES31.functional.debug.negative_coverage.callbacks.texture.texparameter* = SKIP
1442 D3D11 : dEQP-GLES31.functional.debug.negative_coverage.get_error.texture.texparameter* = SKIP
1442 D3D11 : dEQP-GLES31.functional.debug.negative_coverage.log.texture.texparameter* = SKIP
1442 D3D11 : dEQP-GLES31.functional.debug.async.case_4_log = SKIP
1442 D3D11 : dEQP-GLES31.functional.debug.async.case_5_callback = SKIP
1442 D3D11 : dEQP-GLES31.functional.debug.error_filters.case_2 = SKIP
......@@ -1219,10 +1216,6 @@
1442 OPENGL D3D11 : dEQP-GLES31.functional.debug.negative_coverage.get_error.texture.copyteximage2d_max_width_height = FAIL
1442 OPENGL D3D11 : dEQP-GLES31.functional.debug.negative_coverage.get_error.texture.copytexsubimage2d_invalid_offset = FAIL
1442 OPENGL D3D11 : dEQP-GLES31.functional.debug.negative_coverage.get_error.texture.copytexsubimage2d_texture_internalformat = FAIL
1442 OPENGL D3D11 : dEQP-GLES31.functional.debug.negative_coverage.get_error.texture.texparameteri = FAIL
1442 OPENGL D3D11 : dEQP-GLES31.functional.debug.negative_coverage.get_error.texture.texparameterf = FAIL
1442 OPENGL D3D11 : dEQP-GLES31.functional.debug.negative_coverage.get_error.texture.texparameteriv = FAIL
1442 OPENGL D3D11 : dEQP-GLES31.functional.debug.negative_coverage.get_error.texture.texparameterfv = FAIL
1442 OPENGL D3D11 : dEQP-GLES31.functional.debug.negative_coverage.get_error.texture.compressedtexsubimage2d = FAIL
1442 OPENGL D3D11 : dEQP-GLES31.functional.debug.negative_coverage.get_error.texture.compressedtexsubimage2d_invalid_size = FAIL
1442 OPENGL D3D11 : dEQP-GLES31.functional.debug.negative_coverage.get_error.texture.texsubimage3d_neg_level = FAIL
......
......@@ -3655,6 +3655,21 @@ TEST_P(TextureCubeTestES3, SpecifyAndSampleFromBaseLevel1)
EXPECT_PIXEL_COLOR_EQ(0, 0, angle::GLColor::white);
}
// Verify that using negative texture base level and max level generates GL_INVALID_VALUE.
TEST_P(Texture2DTestES3, NegativeTextureBaseLevelAndMaxLevel)
{
GLuint texture = create2DTexture();
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, -1);
EXPECT_GL_ERROR(GL_INVALID_VALUE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, -1);
EXPECT_GL_ERROR(GL_INVALID_VALUE);
glDeleteTextures(1, &texture);
EXPECT_GL_NO_ERROR();
}
// Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against.
// TODO(oetuaho): Enable all below tests on OpenGL. Requires a fix for ANGLE bug 1278.
ANGLE_INSTANTIATE_TEST(Texture2DTest,
......
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