Commit eea095e1 by Austin Kinross Committed by Geoff Lang

Fix and reenable MipmapTests in release mode

Change-Id: Ia702abedc261d717c24152cb207ac80393ac864f Reviewed-on: https://chromium-review.googlesource.com/242980Reviewed-by: 's avatarGregoire Payen de La Garanderie <Gregory.Payen@imgtec.com> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Tested-by: 's avatarGeoff Lang <geofflang@chromium.org>
parent 482907eb
#include "ANGLETest.h" #include "ANGLETest.h"
// Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against. // Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against.
ANGLE_TYPED_TEST_CASE(MipmapTest, ES2_D3D9, ES2_D3D11, ES2_D3D11_FL9_3); // Note: we run these tests against 9_3 on WARP due to hardware driver issues on Win7
ANGLE_TYPED_TEST_CASE(MipmapTest, ES2_D3D9, ES2_D3D11, ES2_D3D11_FL9_3_WARP);
ANGLE_TYPED_TEST_CASE(MipmapTestES3, ES3_D3D11); ANGLE_TYPED_TEST_CASE(MipmapTestES3, ES3_D3D11);
template<typename T> template<typename T>
...@@ -467,7 +468,7 @@ TYPED_TEST(MipmapTest, DISABLED_ThreeLevelsInitData) ...@@ -467,7 +468,7 @@ TYPED_TEST(MipmapTest, DISABLED_ThreeLevelsInitData)
// To do this, D3D11 has to convert the TextureStorage into a renderable one. // To do this, D3D11 has to convert the TextureStorage into a renderable one.
// This test ensures that the conversion works correctly. // This test ensures that the conversion works correctly.
// In particular, on D3D11 Feature Level 9_3 it ensures that both the zero LOD workaround texture AND the 'normal' texture are copied during conversion. // In particular, on D3D11 Feature Level 9_3 it ensures that both the zero LOD workaround texture AND the 'normal' texture are copied during conversion.
TYPED_TEST(MipmapTest, DISABLED_GenerateMipmapFromInitDataThenRender) TYPED_TEST(MipmapTest, GenerateMipmapFromInitDataThenRender)
{ {
// Pass in initial data so the texture is blue. // Pass in initial data so the texture is blue.
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, getWindowWidth(), getWindowHeight(), 0, GL_RGB, GL_UNSIGNED_BYTE, mLevelZeroBlueInitData); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, getWindowWidth(), getWindowHeight(), 0, GL_RGB, GL_UNSIGNED_BYTE, mLevelZeroBlueInitData);
...@@ -522,7 +523,7 @@ TYPED_TEST(MipmapTest, DISABLED_GenerateMipmapFromInitDataThenRender) ...@@ -522,7 +523,7 @@ TYPED_TEST(MipmapTest, DISABLED_GenerateMipmapFromInitDataThenRender)
// This test ensures that mips are correctly generated from a rendered image. // This test ensures that mips are correctly generated from a rendered image.
// In particular, on D3D11 Feature Level 9_3, the clear call will be performed on the zero-level texture, rather than the mipped one. // In particular, on D3D11 Feature Level 9_3, the clear call will be performed on the zero-level texture, rather than the mipped one.
// The test ensures that the zero-level texture is correctly copied into the mipped texture before the mipmaps are generated. // The test ensures that the zero-level texture is correctly copied into the mipped texture before the mipmaps are generated.
TYPED_TEST(MipmapTest, DISABLED_GenerateMipmapFromRenderedImage) TYPED_TEST(MipmapTest, GenerateMipmapFromRenderedImage)
{ {
// Bind the offscreen framebuffer/texture. // Bind the offscreen framebuffer/texture.
glBindFramebuffer(GL_FRAMEBUFFER, mOffscreenFramebuffer); glBindFramebuffer(GL_FRAMEBUFFER, mOffscreenFramebuffer);
...@@ -553,7 +554,7 @@ TYPED_TEST(MipmapTest, DISABLED_GenerateMipmapFromRenderedImage) ...@@ -553,7 +554,7 @@ TYPED_TEST(MipmapTest, DISABLED_GenerateMipmapFromRenderedImage)
// Test to ensure that rendering to a mipmapped texture works, regardless of whether mipmaps are enabled or not. // Test to ensure that rendering to a mipmapped texture works, regardless of whether mipmaps are enabled or not.
// TODO: This test hits a texture rebind bug in the D3D11 renderer. Fix this. // TODO: This test hits a texture rebind bug in the D3D11 renderer. Fix this.
TYPED_TEST(MipmapTest, DISABLED_RenderOntoLevelZeroAfterGenerateMipmap) TYPED_TEST(MipmapTest, RenderOntoLevelZeroAfterGenerateMipmap)
{ {
// Bind the offscreen texture/framebuffer. // Bind the offscreen texture/framebuffer.
glBindFramebuffer(GL_FRAMEBUFFER, mOffscreenFramebuffer); glBindFramebuffer(GL_FRAMEBUFFER, mOffscreenFramebuffer);
...@@ -622,7 +623,7 @@ TYPED_TEST(MipmapTest, DISABLED_RenderOntoLevelZeroAfterGenerateMipmap) ...@@ -622,7 +623,7 @@ TYPED_TEST(MipmapTest, DISABLED_RenderOntoLevelZeroAfterGenerateMipmap)
// This test ensures that the level-zero workaround for TextureCubes (on D3D11 Feature Level 9_3) // This test ensures that the level-zero workaround for TextureCubes (on D3D11 Feature Level 9_3)
// works as expected. It tests enabling/disabling mipmaps, generating mipmaps, and rendering to level zero. // works as expected. It tests enabling/disabling mipmaps, generating mipmaps, and rendering to level zero.
TYPED_TEST(MipmapTest, DISABLED_TextureCubeGeneralLevelZero) TYPED_TEST(MipmapTest, TextureCubeGeneralLevelZero)
{ {
GLfloat vertexLocations[] = GLfloat vertexLocations[] =
{ {
...@@ -662,8 +663,6 @@ TYPED_TEST(MipmapTest, DISABLED_TextureCubeGeneralLevelZero) ...@@ -662,8 +663,6 @@ TYPED_TEST(MipmapTest, DISABLED_TextureCubeGeneralLevelZero)
EXPECT_PIXEL_EQ(0, 0, 0, 0, 255, 255); EXPECT_PIXEL_EQ(0, 0, 0, 0, 255, 255);
// Now clear the negative-Y face of the cube to red. // Now clear the negative-Y face of the cube to red.
GLuint mOffscreenFramebuffer;
glGenFramebuffers(0, &mOffscreenFramebuffer);
glBindFramebuffer(GL_FRAMEBUFFER, mOffscreenFramebuffer); glBindFramebuffer(GL_FRAMEBUFFER, mOffscreenFramebuffer);
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, mOffscreenTextureCube, 0); glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, mOffscreenTextureCube, 0);
ASSERT_EQ(glCheckFramebufferStatus(GL_FRAMEBUFFER), GL_FRAMEBUFFER_COMPLETE); ASSERT_EQ(glCheckFramebufferStatus(GL_FRAMEBUFFER), GL_FRAMEBUFFER_COMPLETE);
...@@ -698,7 +697,7 @@ TYPED_TEST(MipmapTest, DISABLED_TextureCubeGeneralLevelZero) ...@@ -698,7 +697,7 @@ TYPED_TEST(MipmapTest, DISABLED_TextureCubeGeneralLevelZero)
} }
// This test ensures that rendering to level-zero of a TextureCube works as expected. // This test ensures that rendering to level-zero of a TextureCube works as expected.
TYPED_TEST(MipmapTest, DISABLED_TextureCubeRenderToLevelZero) TYPED_TEST(MipmapTest, TextureCubeRenderToLevelZero)
{ {
GLfloat vertexLocations[] = GLfloat vertexLocations[] =
{ {
...@@ -724,8 +723,6 @@ TYPED_TEST(MipmapTest, DISABLED_TextureCubeRenderToLevelZero) ...@@ -724,8 +723,6 @@ TYPED_TEST(MipmapTest, DISABLED_TextureCubeRenderToLevelZero)
EXPECT_PIXEL_EQ(0, 0, 0, 0, 255, 255); EXPECT_PIXEL_EQ(0, 0, 0, 0, 255, 255);
// Now clear the negative-Y face of the cube to red. // Now clear the negative-Y face of the cube to red.
GLuint mOffscreenFramebuffer;
glGenFramebuffers(0, &mOffscreenFramebuffer);
glBindFramebuffer(GL_FRAMEBUFFER, mOffscreenFramebuffer); glBindFramebuffer(GL_FRAMEBUFFER, mOffscreenFramebuffer);
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, mOffscreenTextureCube, 0); glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, mOffscreenTextureCube, 0);
ASSERT_EQ(glCheckFramebufferStatus(GL_FRAMEBUFFER), GL_FRAMEBUFFER_COMPLETE); ASSERT_EQ(glCheckFramebufferStatus(GL_FRAMEBUFFER), GL_FRAMEBUFFER_COMPLETE);
...@@ -752,7 +749,7 @@ TYPED_TEST(MipmapTest, DISABLED_TextureCubeRenderToLevelZero) ...@@ -752,7 +749,7 @@ TYPED_TEST(MipmapTest, DISABLED_TextureCubeRenderToLevelZero)
// Creates a mipmapped 2D array texture with three layers, and calls ANGLE's GenerateMipmap. // Creates a mipmapped 2D array texture with three layers, and calls ANGLE's GenerateMipmap.
// Then tests if the mipmaps are rendered correctly for all three layers. // Then tests if the mipmaps are rendered correctly for all three layers.
TYPED_TEST(MipmapTestES3, DISABLED_MipmapsForTextureArray) TYPED_TEST(MipmapTestES3, MipmapsForTextureArray)
{ {
int px = getWindowWidth() / 2; int px = getWindowWidth() / 2;
int py = getWindowHeight() / 2; int py = getWindowHeight() / 2;
......
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