Commit 53a2da13 by Olli Etuaho

Test drawing with a shader with two different sampler types

This adds some test coverage that's missing from dEQP. The test uses two different samplers in a shader, a cube map sampler and a 2D texture sampler, adds the sampling results together and checks if the result is correct. BUG=angleproject:1261 TEST=angle_end2end_tests Change-Id: If21e24c964fc208b5d1ccd446834dabf13194944 Reviewed-on: https://chromium-review.googlesource.com/321621Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarZhenyao Mo <zmo@chromium.org> Tested-by: 's avatarOlli Etuaho <oetuaho@nvidia.com>
parent 4a8329f2
...@@ -444,6 +444,38 @@ TEST_P(TextureCubeTest, CubeMapBug) ...@@ -444,6 +444,38 @@ TEST_P(TextureCubeTest, CubeMapBug)
EXPECT_GL_NO_ERROR(); EXPECT_GL_NO_ERROR();
} }
// Test drawing with two texture types accessed from the same shader and check that the result of
// drawing is correct.
TEST_P(TextureCubeTest, CubeMapDraw)
{
GLubyte texData[4];
texData[0] = 0;
texData[1] = 60;
texData[2] = 0;
texData[3] = 255;
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, mTexture2D);
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, texData);
glActiveTexture(GL_TEXTURE1);
glBindTexture(GL_TEXTURE_CUBE_MAP, mTextureCube);
texData[1] = 120;
glTexSubImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X, 0, 0, 0, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE,
texData);
EXPECT_GL_ERROR(GL_NO_ERROR);
glUseProgram(mProgram);
glUniform1i(mTexture2DUniformLocation, 0);
glUniform1i(mTextureCubeUniformLocation, 1);
drawQuad(mProgram, "position", 0.5f);
EXPECT_GL_NO_ERROR();
int px = getWindowWidth() - 1;
int py = 0;
EXPECT_PIXEL_NEAR(px, py, 0, 180, 0, 255, 2);
}
// Copy of a test in conformance/textures/texture-mips, to test generate mipmaps // Copy of a test in conformance/textures/texture-mips, to test generate mipmaps
TEST_P(Texture2DTestWithDrawScale, MipmapsTwice) TEST_P(Texture2DTestWithDrawScale, MipmapsTwice)
{ {
......
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