Commit 70022972 by Geoff Lang

Revert "Work around deprecated LUMA formats in the core profile."

Caused failures in the WebglConformance.conformance_textures_misc_copy_tex_image_2d_formats test on the ATI FYI waterfall bot. This reverts commit 61f51dc1. Change-Id: Iddea03d53ae2a9b639e36931f01c1e889e550af4 Reviewed-on: https://chromium-review.googlesource.com/294262Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Tested-by: 's avatarGeoff Lang <geofflang@chromium.org>
parent 1e949799
......@@ -19,16 +19,6 @@ class FunctionsGL;
class StateManagerGL;
struct WorkaroundsGL;
struct LUMAWorkaround
{
bool enabled;
GLenum sourceFormat;
GLenum workaroundFormat;
LUMAWorkaround();
LUMAWorkaround(bool enabled, GLenum sourceFormat, GLenum workaroundFormat);
};
class TextureGL : public TextureImpl
{
public:
......@@ -80,8 +70,6 @@ class TextureGL : public TextureImpl
const WorkaroundsGL &mWorkarounds;
StateManagerGL *mStateManager;
std::vector<LUMAWorkaround> mLUMAWorkaroundLevels;
mutable gl::SamplerState mAppliedSamplerState;
GLuint mTextureID;
};
......
......@@ -316,21 +316,6 @@ static GLenum GetNativeInternalFormat(const FunctionsGL *functions,
// Update the internal format to GL_RGBA.
result = GL_RGBA8;
}
if ((functions->profile & GL_CONTEXT_CORE_PROFILE_BIT) != 0)
{
// Work around deprecated luminance alpha formats in the OpenGL core profile by backing
// them with R or RG textures.
if (formatInfo.format == GL_LUMINANCE || formatInfo.format == GL_ALPHA)
{
result = gl::GetSizedInternalFormat(GL_RED, formatInfo.type);
}
if (formatInfo.format == GL_LUMINANCE_ALPHA)
{
result = gl::GetSizedInternalFormat(GL_RG, formatInfo.type);
}
}
}
else if (functions->isAtLeastGLES(gl::Version(3, 0)))
{
......@@ -359,21 +344,6 @@ static GLenum GetNativeFormat(const FunctionsGL *functions,
{
result = GL_RGBA;
}
if ((functions->profile & GL_CONTEXT_CORE_PROFILE_BIT) != 0)
{
// Work around deprecated luminance alpha formats in the OpenGL core profile by backing
// them with R or RG textures.
if (format == GL_LUMINANCE || format == GL_ALPHA)
{
result = GL_RED;
}
if (format == GL_LUMINANCE_ALPHA)
{
result = GL_RG;
}
}
}
return result;
......
......@@ -108,7 +108,8 @@ class SwizzleTest : public ANGLETest
{
glGenTextures(1, &mTexture);
glBindTexture(GL_TEXTURE_2D, mTexture);
glTexImage2D(GL_TEXTURE_2D, 0, internalFormat, 1, 1, 0, dataFormat, dataType, data);
glTexStorage2D(GL_TEXTURE_2D, 1, internalFormat, 1, 1);
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 1, 1, dataFormat, dataType, data);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
......@@ -267,48 +268,6 @@ TEST_P(SwizzleTest, D24_2D)
runTest2D();
}
TEST_P(SwizzleTest, L8_2D)
{
GLubyte data[] = { 0x77 };
init2DTexture(GL_LUMINANCE, GL_LUMINANCE, GL_UNSIGNED_BYTE, data);
runTest2D();
}
TEST_P(SwizzleTest, A8_2D)
{
GLubyte data[] = { 0x55 };
init2DTexture(GL_ALPHA, GL_ALPHA, GL_UNSIGNED_BYTE, data);
runTest2D();
}
TEST_P(SwizzleTest, LA8_2D)
{
GLubyte data[] = { 0x77, 0x66 };
init2DTexture(GL_LUMINANCE_ALPHA, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, data);
runTest2D();
}
TEST_P(SwizzleTest, L32F_2D)
{
GLfloat data[] = { 0.7f };
init2DTexture(GL_LUMINANCE, GL_LUMINANCE, GL_FLOAT, data);
runTest2D();
}
TEST_P(SwizzleTest, A32F_2D)
{
GLfloat data[] = { 0.4f, };
init2DTexture(GL_ALPHA, GL_ALPHA, GL_FLOAT, data);
runTest2D();
}
TEST_P(SwizzleTest, LA32F_2D)
{
GLfloat data[] = { 0.5f, 0.6f, };
init2DTexture(GL_LUMINANCE_ALPHA, GL_LUMINANCE_ALPHA, GL_FLOAT, data);
runTest2D();
}
#include "media/pixel.inl"
TEST_P(SwizzleTest, CompressedDXT_2D)
......
......@@ -105,6 +105,14 @@ class UnpackAlignmentTest : public ANGLETest
void testAlignment(int alignment, unsigned int offset, GLenum format, GLenum type)
{
// TODO(geofflang): Support LUMA formats in the core profile.
if (getPlatformRenderer() == EGL_PLATFORM_ANGLE_TYPE_OPENGL_ANGLE &&
(format == GL_LUMINANCE_ALPHA || format == GL_LUMINANCE || format == GL_ALPHA))
{
std::cout << "Test skipped on OpenGL with LUMA formats." << std::endl;
return;
}
static const unsigned int width = 7;
static const unsigned int height = 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