Commit 859dcb88 by Geoff Lang

Revert "Add table entries for almost all the remaining GL texture formats."

Missing include of <limits> for linux. This reverts commit aa3a5fad. Change-Id: Iafebfbc6154b4fe3a94e3f8b91b5ff496631c1f1 Reviewed-on: https://chromium-review.googlesource.com/273134Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Tested-by: 's avatarGeoff Lang <geofflang@chromium.org>
parent db39e7f5
...@@ -1580,9 +1580,4 @@ void FunctionsGL::initialize() ...@@ -1580,9 +1580,4 @@ void FunctionsGL::initialize()
} }
} }
bool FunctionsGL::hasExtension(const std::string &ext) const
{
return std::find(extensions.begin(), extensions.end(), ext) != extensions.end();
}
} }
...@@ -31,7 +31,6 @@ class FunctionsGL ...@@ -31,7 +31,6 @@ class FunctionsGL
// Extensions // Extensions
std::vector<std::string> extensions; std::vector<std::string> extensions;
bool hasExtension(const std::string &ext) const;
// Entry Points // Entry Points
// 1.0 // 1.0
......
...@@ -21,31 +21,17 @@ namespace rx ...@@ -21,31 +21,17 @@ namespace rx
namespace nativegl namespace nativegl
{ {
struct SupportRequirement
{
SupportRequirement();
// Version that this format became supported without extensions
GLuint majorVersion;
GLuint minorVersion;
// Extensions that are required if the minimum version is not met
std::vector<std::string> versionExtensions;
// Extensions that are always required to support this format
std::vector<std::string> requiredExtensions;
};
struct InternalFormat struct InternalFormat
{ {
InternalFormat(); InternalFormat();
SupportRequirement texture; typedef bool(*SupportCheckFunction)(GLuint majorVersion, GLuint minorVersion,
SupportRequirement filter; const std::vector<std::string> &extensions);
SupportRequirement renderbuffer; SupportCheckFunction textureSupport;
SupportRequirement framebufferAttachment; SupportCheckFunction renderSupport;
SupportCheckFunction filterSupport;
}; };
const InternalFormat &GetInternalFormatInfo(GLenum internalFormat, bool es); const InternalFormat &GetInternalFormatInfo(GLenum internalFormat);
} }
......
...@@ -25,46 +25,14 @@ namespace rx ...@@ -25,46 +25,14 @@ namespace rx
namespace nativegl_gl namespace nativegl_gl
{ {
static bool MeetsRequirements(const FunctionsGL *functions, const nativegl::SupportRequirement &requirements)
{
for (const std::string &extension : requirements.requiredExtensions)
{
if (!functions->hasExtension(extension))
{
return false;
}
}
if (functions->majorVersion > requirements.majorVersion ||
(functions->majorVersion == requirements.majorVersion && functions->minorVersion >= requirements.minorVersion))
{
return true;
}
else if (!requirements.versionExtensions.empty())
{
for (const std::string &extension : requirements.versionExtensions)
{
if (!functions->hasExtension(extension))
{
return false;
}
}
return true;
}
else
{
return false;
}
}
static gl::TextureCaps GenerateTextureFormatCaps(const FunctionsGL *functions, GLenum internalFormat) static gl::TextureCaps GenerateTextureFormatCaps(const FunctionsGL *functions, GLenum internalFormat)
{ {
gl::TextureCaps textureCaps; gl::TextureCaps textureCaps;
const nativegl::InternalFormat &formatInfo = nativegl::GetInternalFormatInfo(internalFormat, functions->openGLES); const nativegl::InternalFormat &formatInfo = nativegl::GetInternalFormatInfo(internalFormat);
textureCaps.texturable = MeetsRequirements(functions, formatInfo.texture); textureCaps.texturable = formatInfo.textureSupport(functions->majorVersion, functions->minorVersion, functions->extensions);
textureCaps.filterable = textureCaps.texturable && MeetsRequirements(functions, formatInfo.filter); textureCaps.renderable = formatInfo.renderSupport(functions->majorVersion, functions->minorVersion, functions->extensions);
textureCaps.renderable = MeetsRequirements(functions, formatInfo.framebufferAttachment); textureCaps.filterable = formatInfo.filterSupport(functions->majorVersion, functions->minorVersion, functions->extensions);
// glGetInternalformativ is not available until version 4.2 but may be available through the 3.0 // glGetInternalformativ is not available until version 4.2 but may be available through the 3.0
// extension GL_ARB_internalformat_query // extension GL_ARB_internalformat_query
......
...@@ -36,7 +36,7 @@ class BlendMinMaxTest : public ANGLETest ...@@ -36,7 +36,7 @@ class BlendMinMaxTest : public ANGLETest
return blendMin ? std::min<GLubyte>(curAsUbyte, prevColor) : std::max<GLubyte>(curAsUbyte, prevColor); return blendMin ? std::min<GLubyte>(curAsUbyte, prevColor) : std::max<GLubyte>(curAsUbyte, prevColor);
} }
void runTest(GLenum colorFormat) void runTest()
{ {
if (getClientVersion() < 3 && !extensionEnabled("GL_EXT_blend_minmax")) if (getClientVersion() < 3 && !extensionEnabled("GL_EXT_blend_minmax"))
{ {
...@@ -44,8 +44,6 @@ class BlendMinMaxTest : public ANGLETest ...@@ -44,8 +44,6 @@ class BlendMinMaxTest : public ANGLETest
return; return;
} }
SetUpFramebuffer(colorFormat);
const size_t colorCount = 1024; const size_t colorCount = 1024;
Color colors[colorCount]; Color colors[colorCount];
for (size_t i = 0; i < colorCount; i++) for (size_t i = 0; i < colorCount; i++)
...@@ -154,7 +152,8 @@ class BlendMinMaxTest : public ANGLETest ...@@ -154,7 +152,8 @@ class BlendMinMaxTest : public ANGLETest
TEST_P(BlendMinMaxTest, RGBA8) TEST_P(BlendMinMaxTest, RGBA8)
{ {
runTest(GL_RGBA8); SetUpFramebuffer(GL_RGBA8);
runTest();
} }
TEST_P(BlendMinMaxTest, RGBA32f) TEST_P(BlendMinMaxTest, RGBA32f)
...@@ -165,7 +164,8 @@ TEST_P(BlendMinMaxTest, RGBA32f) ...@@ -165,7 +164,8 @@ TEST_P(BlendMinMaxTest, RGBA32f)
return; return;
} }
runTest(GL_RGBA32F); SetUpFramebuffer(GL_RGBA32F);
runTest();
} }
TEST_P(BlendMinMaxTest, RGBA16F) TEST_P(BlendMinMaxTest, RGBA16F)
...@@ -176,7 +176,8 @@ TEST_P(BlendMinMaxTest, RGBA16F) ...@@ -176,7 +176,8 @@ TEST_P(BlendMinMaxTest, RGBA16F)
return; return;
} }
runTest(GL_RGBA16F); SetUpFramebuffer(GL_RGBA16F);
runTest();
} }
// 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.
......
...@@ -129,4 +129,4 @@ TEST_P(CubeMapTextureTest, RenderToFacesConsecutively) ...@@ -129,4 +129,4 @@ TEST_P(CubeMapTextureTest, RenderToFacesConsecutively)
} }
// 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_INSTANTIATE_TEST(CubeMapTextureTest, ES2_D3D11(), ES2_D3D11_FL9_3(), ES2_OPENGL(), ES3_OPENGL()); ANGLE_INSTANTIATE_TEST(CubeMapTextureTest, ES2_D3D11(), ES2_D3D11_FL9_3());
...@@ -174,15 +174,9 @@ TEST_P(DepthStencilFormatsTestES3, DrawWithDepthStencil) ...@@ -174,15 +174,9 @@ TEST_P(DepthStencilFormatsTestES3, DrawWithDepthStencil)
ASSERT_GL_NO_ERROR(); ASSERT_GL_NO_ERROR();
GLubyte pixel[4]; EXPECT_PIXEL_NEAR(0, 0, 255, 0, 0, 255, 2.0);
glReadPixels(0, 0, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, &pixel);
// Only require the red and alpha channels have the correct values, the depth texture extensions
// leave the green and blue channels undefined
ASSERT_NEAR(255, pixel[0], 2.0);
ASSERT_EQ(255, pixel[3]);
} }
// 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_INSTANTIATE_TEST(DepthStencilFormatsTest, ES2_D3D9(), ES2_D3D11(), ES2_OPENGL()); ANGLE_INSTANTIATE_TEST(DepthStencilFormatsTest, ES2_D3D9(), ES2_D3D11());
ANGLE_INSTANTIATE_TEST(DepthStencilFormatsTestES3, ES3_D3D11(), ES3_OPENGL()); ANGLE_INSTANTIATE_TEST(DepthStencilFormatsTestES3, ES3_D3D11());
...@@ -142,34 +142,16 @@ TEST_P(FramebufferFormatsTest, RGB565) ...@@ -142,34 +142,16 @@ TEST_P(FramebufferFormatsTest, RGB565)
TEST_P(FramebufferFormatsTest, RGB8) TEST_P(FramebufferFormatsTest, RGB8)
{ {
if (getClientVersion() < 3 && !extensionEnabled("GL_OES_rgb8_rgba8"))
{
std::cout << "Test skipped due to missing ES3 or GL_OES_rgb8_rgba8." << std::endl;
return;
}
testTextureFormat(GL_RGB8_OES, 8, 8, 8, 0); testTextureFormat(GL_RGB8_OES, 8, 8, 8, 0);
} }
TEST_P(FramebufferFormatsTest, BGRA8) TEST_P(FramebufferFormatsTest, BGRA8)
{ {
if (!extensionEnabled("GL_EXT_texture_format_BGRA8888"))
{
std::cout << "Test skipped due to missing GL_EXT_texture_format_BGRA8888." << std::endl;
return;
}
testTextureFormat(GL_BGRA8_EXT, 8, 8, 8, 8); testTextureFormat(GL_BGRA8_EXT, 8, 8, 8, 8);
} }
TEST_P(FramebufferFormatsTest, RGBA8) TEST_P(FramebufferFormatsTest, RGBA8)
{ {
if (getClientVersion() < 3 && !extensionEnabled("GL_OES_rgb8_rgba8"))
{
std::cout << "Test skipped due to missing ES3 or GL_OES_rgb8_rgba8." << std::endl;
return;
}
testTextureFormat(GL_RGBA8_OES, 8, 8, 8, 8); testTextureFormat(GL_RGBA8_OES, 8, 8, 8, 8);
} }
...@@ -185,12 +167,6 @@ TEST_P(FramebufferFormatsTest, RenderbufferMultisample_DEPTH24) ...@@ -185,12 +167,6 @@ TEST_P(FramebufferFormatsTest, RenderbufferMultisample_DEPTH24)
TEST_P(FramebufferFormatsTest, RenderbufferMultisample_DEPTH32F) TEST_P(FramebufferFormatsTest, RenderbufferMultisample_DEPTH32F)
{ {
if (getClientVersion() < 3)
{
std::cout << "Test skipped due to missing ES3." << std::endl;
return;
}
testRenderbufferMultisampleFormat(3, GL_DEPTH_ATTACHMENT, GL_DEPTH_COMPONENT32F); testRenderbufferMultisampleFormat(3, GL_DEPTH_ATTACHMENT, GL_DEPTH_COMPONENT32F);
} }
...@@ -201,26 +177,13 @@ TEST_P(FramebufferFormatsTest, RenderbufferMultisample_DEPTH24_STENCIL8) ...@@ -201,26 +177,13 @@ TEST_P(FramebufferFormatsTest, RenderbufferMultisample_DEPTH24_STENCIL8)
TEST_P(FramebufferFormatsTest, RenderbufferMultisample_DEPTH32F_STENCIL8) TEST_P(FramebufferFormatsTest, RenderbufferMultisample_DEPTH32F_STENCIL8)
{ {
if (getClientVersion() < 3)
{
std::cout << "Test skipped due to missing ES3." << std::endl;
return;
}
testRenderbufferMultisampleFormat(3, GL_DEPTH_STENCIL_ATTACHMENT, GL_DEPTH32F_STENCIL8); testRenderbufferMultisampleFormat(3, GL_DEPTH_STENCIL_ATTACHMENT, GL_DEPTH32F_STENCIL8);
} }
TEST_P(FramebufferFormatsTest, RenderbufferMultisample_STENCIL_INDEX8) TEST_P(FramebufferFormatsTest, RenderbufferMultisample_STENCIL_INDEX8)
{ {
// TODO(geofflang): Figure out how to support GLSTENCIL_INDEX8 on desktop GL
if (GetParam().mEGLPlatformParameters.renderer == EGL_PLATFORM_ANGLE_TYPE_OPENGL_ANGLE)
{
std::cout << "Test skipped on Desktop OpenGL." << std::endl;
return;
}
testRenderbufferMultisampleFormat(2, GL_STENCIL_ATTACHMENT, GL_STENCIL_INDEX8); testRenderbufferMultisampleFormat(2, GL_STENCIL_ATTACHMENT, GL_STENCIL_INDEX8);
} }
// 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_INSTANTIATE_TEST(FramebufferFormatsTest, ES2_D3D9(), ES2_D3D11(), ES3_D3D11(), ES2_OPENGL(), ES3_OPENGL()); ANGLE_INSTANTIATE_TEST(FramebufferFormatsTest, ES2_D3D9(), ES2_D3D11(), ES3_D3D11());
...@@ -163,4 +163,4 @@ TEST_P(IncompleteTextureTest, UpdateTexture) ...@@ -163,4 +163,4 @@ TEST_P(IncompleteTextureTest, UpdateTexture)
} }
// 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_INSTANTIATE_TEST(IncompleteTextureTest, ES2_D3D9(), ES2_D3D11(), ES2_OPENGL()); ANGLE_INSTANTIATE_TEST(IncompleteTextureTest, ES2_D3D9(), ES2_D3D11());
...@@ -216,6 +216,6 @@ TEST_P(IndexedPointsTestUInt, UnsignedIntOffset3) ...@@ -216,6 +216,6 @@ TEST_P(IndexedPointsTestUInt, UnsignedIntOffset3)
runTest(3); runTest(3);
} }
ANGLE_INSTANTIATE_TEST(IndexedPointsTestUByte, ES2_D3D11(), ES2_OPENGL()); ANGLE_INSTANTIATE_TEST(IndexedPointsTestUByte, ES2_D3D11());
ANGLE_INSTANTIATE_TEST(IndexedPointsTestUShort, ES2_D3D11(), ES2_OPENGL()); ANGLE_INSTANTIATE_TEST(IndexedPointsTestUShort, ES2_D3D11());
ANGLE_INSTANTIATE_TEST(IndexedPointsTestUInt, ES2_D3D11(), ES2_OPENGL()); ANGLE_INSTANTIATE_TEST(IndexedPointsTestUInt, ES2_D3D11());
...@@ -28,16 +28,20 @@ class LineLoopTest : public ANGLETest ...@@ -28,16 +28,20 @@ class LineLoopTest : public ANGLETest
const std::string vsSource = SHADER_SOURCE const std::string vsSource = SHADER_SOURCE
( (
attribute highp vec4 position; attribute highp vec4 position;
attribute highp vec4 in_color;
varying highp vec4 color;
void main(void) void main(void)
{ {
gl_Position = position; gl_Position = position;
color = in_color;
} }
); );
const std::string fsSource = SHADER_SOURCE const std::string fsSource = SHADER_SOURCE
( (
uniform highp vec4 color; varying highp vec4 color;
void main(void) void main(void)
{ {
gl_FragColor = color; gl_FragColor = color;
...@@ -51,7 +55,7 @@ class LineLoopTest : public ANGLETest ...@@ -51,7 +55,7 @@ class LineLoopTest : public ANGLETest
} }
mPositionLocation = glGetAttribLocation(mProgram, "position"); mPositionLocation = glGetAttribLocation(mProgram, "position");
mColorLocation = glGetUniformLocation(mProgram, "in_color"); mColorLocation = glGetAttribLocation(mProgram, "in_color");
glBlendFunc(GL_ONE, GL_ONE); glBlendFunc(GL_ONE, GL_ONE);
glEnable(GL_BLEND); glEnable(GL_BLEND);
...@@ -201,4 +205,4 @@ TEST_P(LineLoopTest, LineLoopUIntIndexBuffer) ...@@ -201,4 +205,4 @@ TEST_P(LineLoopTest, LineLoopUIntIndexBuffer)
} }
// 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_INSTANTIATE_TEST(LineLoopTest, ES2_D3D9(), ES2_D3D11(), ES2_OPENGL()); ANGLE_INSTANTIATE_TEST(LineLoopTest, ES2_D3D9(), ES2_D3D11());
...@@ -274,7 +274,6 @@ TEST_P(SwizzleTest, CompressedDXT_2D) ...@@ -274,7 +274,6 @@ TEST_P(SwizzleTest, CompressedDXT_2D)
{ {
if (!extensionEnabled("GL_EXT_texture_compression_dxt1")) if (!extensionEnabled("GL_EXT_texture_compression_dxt1"))
{ {
std::cout << "Test skipped due to missing GL_EXT_texture_compression_dxt1." << std::endl;
return; return;
} }
...@@ -283,6 +282,6 @@ TEST_P(SwizzleTest, CompressedDXT_2D) ...@@ -283,6 +282,6 @@ TEST_P(SwizzleTest, CompressedDXT_2D)
} }
// 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_INSTANTIATE_TEST(SwizzleTest, ES3_D3D11(), ES3_OPENGL()); ANGLE_INSTANTIATE_TEST(SwizzleTest, ES3_D3D11());
} // namespace } // namespace
...@@ -610,6 +610,6 @@ TEST_P(TextureTest, TextureNPOT_GL_ALPHA_UBYTE) ...@@ -610,6 +610,6 @@ TEST_P(TextureTest, TextureNPOT_GL_ALPHA_UBYTE)
} }
// 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_INSTANTIATE_TEST(TextureTest, ES2_D3D9(), ES2_D3D11(), ES2_D3D11_FL9_3(), ES2_OPENGL()); ANGLE_INSTANTIATE_TEST(TextureTest, ES2_D3D9(), ES2_D3D11(), ES2_D3D11_FL9_3());
} // namespace } // namespace
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