Commit ebf00703 by James Darpinian Committed by Commit Bot

angle_end2end_tests passes on iOS!

Miscellaneous test skips and fixes for iOS. Bug: angleproject:5417 Bug: angleproject:5491 Change-Id: Id0785e6243949fc756e4d7923dbbe77a411052f3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2606656Reviewed-by: 's avatarShahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: 's avatarKenneth Russell <kbr@chromium.org> Commit-Queue: James Darpinian <jdarpinian@chromium.org>
parent 2762641a
......@@ -21,8 +21,12 @@ typedef void *EAGLContextObj;
struct __IOSurface;
typedef __IOSurface *IOSurfaceRef;
// WebKit's build process requires that every Objective-C class name has the prefix "Web".
@class WebSwapLayerEAGL;
// WebKit's build process requires that every Objective-C class name has the prefix "Web" to avoid
// clobbering user-created Objective-C classes.
#if defined(PREFIX_OBJECTIVE_C_CLASSES_WITH_WEB_FOR_WEBKIT)
# define SwapLayerEAGL WebSwapLayerEAGL
#endif
@class SwapLayerEAGL;
namespace rx
{
......@@ -91,7 +95,7 @@ class WindowSurfaceEAGL : public SurfaceGL
const gl::FramebufferState &state) override;
private:
WebSwapLayerEAGL *mSwapLayer;
SwapLayerEAGL *mSwapLayer;
SharedSwapState mSwapState;
uint64_t mCurrentSwapId;
......
......@@ -33,7 +33,7 @@
# endif
@interface WebSwapLayerEAGL : CAEAGLLayer {
@interface SwapLayerEAGL : CAEAGLLayer {
EAGLContextObj mDisplayContext;
bool initialized;
......@@ -47,7 +47,7 @@
withFunctions:(const rx::FunctionsGL *)functions;
@end
@implementation WebSwapLayerEAGL
@implementation SwapLayerEAGL
- (id)initWithSharedState:(rx::SharedSwapState *)swapState
withContext:(EAGLContextObj)displayContext
withFunctions:(const rx::FunctionsGL *)functions
......@@ -182,9 +182,9 @@ egl::Error WindowSurfaceEAGL::initialize(const egl::Display *display)
mSwapState.lastRendered = &mSwapState.textures[1];
mSwapState.beingPresented = &mSwapState.textures[2];
mSwapLayer = [[WebSwapLayerEAGL alloc] initWithSharedState:&mSwapState
withContext:mContext
withFunctions:mFunctions];
mSwapLayer = [[SwapLayerEAGL alloc] initWithSharedState:&mSwapState
withContext:mContext
withFunctions:mFunctions];
[mLayer addSublayer:mSwapLayer];
[mSwapLayer setContentsScale:[mLayer contentsScale]];
......
......@@ -196,6 +196,10 @@ TEST_P(BlendMinMaxTest, RGBA16F)
// http://anglebug.com/4185
ANGLE_SKIP_TEST_IF(IsMetal());
// TODO(anglebug.com/5491) Context.cpp disallows GL_EXT_color_buffer_half_float on iOS because
// it doesn't support GL_EXT_color_buffer_float.
ANGLE_SKIP_TEST_IF(IsIOS() && IsOpenGLES());
runTest(GL_RGBA16F, GL_FLOAT);
}
......
......@@ -993,6 +993,9 @@ TEST_P(ClearTestES3, MaskedClearHeterogeneousAttachments)
// http://anglebug.com/4855
ANGLE_SKIP_TEST_IF(IsWindows() && IsIntel() && IsVulkan());
// TODO(anglebug.com/5491)
ANGLE_SKIP_TEST_IF(IsIOS() && IsOpenGLES());
constexpr uint32_t kSize = 16;
constexpr uint32_t kAttachmentCount = 3;
constexpr float kDepthClearValue = 0.256f;
......@@ -1115,6 +1118,9 @@ TEST_P(ClearTestES3, ScissoredClearHeterogeneousAttachments)
// http://anglebug.com/5237
ANGLE_SKIP_TEST_IF(IsWindows7() && IsD3D11() && IsNVIDIA());
// TODO(anglebug.com/5491)
ANGLE_SKIP_TEST_IF(IsIOS() && IsOpenGLES());
constexpr uint32_t kSize = 16;
constexpr uint32_t kHalfSize = kSize / 2;
constexpr uint32_t kAttachmentCount = 3;
......
......@@ -1001,6 +1001,9 @@ TEST_P(CopyTexImageTestES3, 3DSubImageDrawMismatchedTextureTypes)
// TODO(anglebug.com/3801)
ANGLE_SKIP_TEST_IF(IsWindows() && IsD3D11());
// TODO(anglebug.com/5491)
ANGLE_SKIP_TEST_IF(IsIOS() && IsOpenGLES());
GLFramebuffer fbo;
glBindFramebuffer(GL_FRAMEBUFFER, fbo);
......
......@@ -1150,6 +1150,10 @@ TEST_P(TinyDepthStencilWorkaroundTest, DepthTexturesStick)
// http://anglebug.com/4092
ANGLE_SKIP_TEST_IF((IsAndroid() && IsOpenGLES()) || (IsLinux() && IsVulkan()));
ANGLE_SKIP_TEST_IF(isSwiftshader());
// TODO(anglebug.com/5491)
ANGLE_SKIP_TEST_IF(IsIOS() && IsOpenGLES());
constexpr char kDrawVS[] =
"#version 100\n"
"attribute vec3 vertex;\n"
......
......@@ -828,6 +828,8 @@ TEST_P(GLSLTest_ES3, GLVertexIDIntegerTextureDrawArrays)
ANGLE_SKIP_TEST_IF(IsMetal());
// TODO(anglebug.com/5360): Failing on ARM-based Apple DTKs.
ANGLE_SKIP_TEST_IF(IsOSX() && IsARM64() && IsDesktopOpenGL());
// TODO(anglebug.com/5491): Failing on iOS, probably related to the ARM Mac failure above.
ANGLE_SKIP_TEST_IF(IsIOS() && IsOpenGLES());
// Have to set a large point size because the window size is much larger than the texture
constexpr char kVS[] = R"(#version 300 es
flat out highp int vVertexID;
......@@ -2878,6 +2880,9 @@ TEST_P(GLSLTest, VaryingMatrixArray)
// Test that using a centroid varying matrix array is supported.
TEST_P(GLSLTest_ES3, CentroidVaryingMatrixArray)
{
// TODO(anglebug.com/5491): Skipping initial failures so we can set up a passing iOS test bot.
ANGLE_SKIP_TEST_IF(IsIOS() && IsOpenGLES());
constexpr char kVS[] =
"#version 300 es\n"
"uniform vec2 u_a1;\n"
......@@ -4882,7 +4887,7 @@ TEST_P(GLSLTest, StructsWithSameMembersDisambiguatedByName)
TEST_P(GLSLTest, InactiveVaryingInVertexActiveInFragment)
{
// http://anglebug.com/4820
ANGLE_SKIP_TEST_IF(IsOSX() && IsOpenGL());
ANGLE_SKIP_TEST_IF((IsOSX() && IsOpenGL()) || (IsIOS() && IsOpenGLES()));
constexpr char kVS[] =
"attribute vec4 inputAttribute;\n"
......@@ -5016,6 +5021,9 @@ TEST_P(WebGL2GLSLTest, VaryingStructNotInitializedInVertexShader)
//
// http://anglebug.com/3413
ANGLE_SKIP_TEST_IF(IsDesktopOpenGL() && (IsOSX() || (IsWindows() && !IsNVIDIA())));
// TODO(anglebug.com/5491): iOS thinks that the precision qualifiers don't match on the
// struct member. Not sure if it's being overly strict.
ANGLE_SKIP_TEST_IF(IsIOS() && IsOpenGLES());
constexpr char kVS[] =
"#version 300 es\n"
......@@ -5047,6 +5055,9 @@ TEST_P(WebGL2GLSLTest, VaryingStructNotInitializedInVertexShader)
// Test that a varying struct that gets used in the fragment shader works.
TEST_P(GLSLTest_ES3, VaryingStructUsedInFragmentShader)
{
// TODO(anglebug.com/5491): iOS thinks that the precision qualifiers don't match on the
// struct member. Not sure if it's being overly strict.
ANGLE_SKIP_TEST_IF(IsIOS() && IsOpenGLES());
constexpr char kVS[] =
"#version 300 es\n"
"in vec4 inputAttribute;\n"
......@@ -5168,6 +5179,9 @@ TEST_P(GLSLTest_ES3, ComplexVaryingStructsUsedInFragmentShader)
//
// http://anglebug.com/3220
ANGLE_SKIP_TEST_IF(IsVulkan() && IsAndroid());
// TODO(anglebug.com/5491): iOS thinks that the precision qualifiers don't match on the
// struct members. Not sure if it's being overly strict.
ANGLE_SKIP_TEST_IF(IsIOS() && IsOpenGLES());
constexpr char kVS[] =
"#version 300 es\n"
......@@ -6222,6 +6236,9 @@ void main()
// Test that a varying struct that's defined as a part of the declaration is handled correctly.
TEST_P(GLSLTest_ES3, VaryingStructWithInlineDefinition)
{
// TODO(anglebug.com/5491): iOS thinks that the precision qualifiers don't match on the
// struct member. Not sure if it's being overly strict.
ANGLE_SKIP_TEST_IF(IsIOS() && IsOpenGLES());
constexpr char kVS[] = R"(#version 300 es
in vec4 inputAttribute;
......
......@@ -1959,6 +1959,9 @@ TEST_P(MipmapTestES3, BaseLevelTextureBug)
// TODO(anglebug.com/5360): Failing on ARM-based Apple DTKs.
ANGLE_SKIP_TEST_IF(IsOSX() && IsARM64() && IsDesktopOpenGL());
// TODO(anglebug.com/5491)
ANGLE_SKIP_TEST_IF(IsIOS() && IsOpenGLES());
std::vector<GLColor> texDataRed(2u * 2u, GLColor::red);
glBindTexture(GL_TEXTURE_2D, mTexture);
......
......@@ -111,6 +111,9 @@ void main()
float expect1,
float expect2)
{
// TODO(anglebug.com/5491) iOS doesn't support float32 framebuffers.
ANGLE_SKIP_TEST_IF(IsIOS() && IsOpenGLES());
GLint vec2Location = glGetUniformLocation(program, "v");
glUseProgram(program);
......
......@@ -487,6 +487,9 @@ TEST_P(PointSpritesTest, PointSizeAboveMaxIsClamped)
// http://anglebug.com/4135
ANGLE_SKIP_TEST_IF(IsMetal());
// TODO(anglebug.com/5491)
ANGLE_SKIP_TEST_IF(IsIOS() && IsOpenGLES());
GLfloat pointSizeRange[2] = {};
glGetFloatv(GL_ALIASED_POINT_SIZE_RANGE, pointSizeRange);
GLfloat maxPointSize = pointSizeRange[1];
......
......@@ -125,11 +125,11 @@ TEST_P(ProvokingVertexTest, FlatTriangle)
drawQuad(mProgram, "position", 0.5f);
GLint pixelValue = 0;
glReadPixels(0, 0, 1, 1, GL_RED_INTEGER, GL_INT, &pixelValue);
GLint pixelValue[4] = {0};
glReadPixels(0, 0, 1, 1, GL_RGBA_INTEGER, GL_INT, &pixelValue);
ASSERT_GL_NO_ERROR();
EXPECT_EQ(vertexData[2], pixelValue);
EXPECT_EQ(vertexData[2], pixelValue[0]);
}
// Ensure that any provoking vertex shenanigans still gives correct vertex streams.
......@@ -159,11 +159,11 @@ TEST_P(ProvokingVertexTest, FlatTriWithTransformFeedback)
glEndTransformFeedback();
glUseProgram(0);
GLint pixelValue = 0;
glReadPixels(0, 0, 1, 1, GL_RED_INTEGER, GL_INT, &pixelValue);
GLint pixelValue[4] = {0};
glReadPixels(0, 0, 1, 1, GL_RGBA_INTEGER, GL_INT, &pixelValue);
ASSERT_GL_NO_ERROR();
EXPECT_EQ(vertexData[2], pixelValue);
EXPECT_EQ(vertexData[2], pixelValue[0]);
void *mapPointer =
glMapBufferRange(GL_TRANSFORM_FEEDBACK_BUFFER, 0, sizeof(int) * 6, GL_MAP_READ_BIT);
......@@ -195,11 +195,11 @@ TEST_P(ProvokingVertexTest, FlatLine)
glUseProgram(mProgram);
glDrawArrays(GL_LINES, 0, 2);
GLint pixelValue = 0;
glReadPixels(0, 0, 1, 1, GL_RED_INTEGER, GL_INT, &pixelValue);
GLint pixelValue[4] = {0};
glReadPixels(0, 0, 1, 1, GL_RGBA_INTEGER, GL_INT, &pixelValue);
ASSERT_GL_NO_ERROR();
EXPECT_EQ(vertexData[1], pixelValue);
EXPECT_EQ(vertexData[1], pixelValue[0]);
}
// Test drawing a simple triangle strip with flat shading, and different valued vertices.
......@@ -218,8 +218,8 @@ TEST_P(ProvokingVertexTest, FlatTriStrip)
glUseProgram(mProgram);
glDrawArrays(GL_TRIANGLE_STRIP, 0, 6);
std::vector<GLint> pixelBuffer(getWindowWidth() * getWindowHeight(), 0);
glReadPixels(0, 0, getWindowWidth(), getWindowHeight(), GL_RED_INTEGER, GL_INT,
std::vector<GLint> pixelBuffer(getWindowWidth() * getWindowHeight() * 4, 0);
glReadPixels(0, 0, getWindowWidth(), getWindowHeight(), GL_RGBA_INTEGER, GL_INT,
&pixelBuffer[0]);
ASSERT_GL_NO_ERROR();
......@@ -241,7 +241,7 @@ TEST_P(ProvokingVertexTest, FlatTriStrip)
unsigned int provokingVertexIndex = triIndex + 2;
EXPECT_EQ(vertexData[provokingVertexIndex], pixelBuffer[pixelIndex]);
EXPECT_EQ(vertexData[provokingVertexIndex], pixelBuffer[pixelIndex * 4]);
}
}
......@@ -267,8 +267,8 @@ TEST_P(ProvokingVertexTest, FlatTriStripPrimitiveRestart)
glUseProgram(mProgram);
glDrawElements(GL_TRIANGLE_STRIP, 12, GL_UNSIGNED_INT, indexData);
std::vector<GLint> pixelBuffer(getWindowWidth() * getWindowHeight(), 0);
glReadPixels(0, 0, getWindowWidth(), getWindowHeight(), GL_RED_INTEGER, GL_INT,
std::vector<GLint> pixelBuffer(getWindowWidth() * getWindowHeight() * 4, 0);
glReadPixels(0, 0, getWindowWidth(), getWindowHeight(), GL_RGBA_INTEGER, GL_INT,
&pixelBuffer[0]);
ASSERT_GL_NO_ERROR();
......@@ -297,7 +297,7 @@ TEST_P(ProvokingVertexTest, FlatTriStripPrimitiveRestart)
unsigned int provokingVertexIndex = triIndex + 2;
EXPECT_EQ(vertexData[provokingVertexIndex], pixelBuffer[pixelIndex]);
EXPECT_EQ(vertexData[provokingVertexIndex], pixelBuffer[pixelIndex * 4]);
}
}
......@@ -322,11 +322,11 @@ TEST_P(ProvokingVertexTest, ANGLEProvokingVertex)
glClearBufferiv(GL_COLOR, 0, zero);
glDrawArrays(GL_TRIANGLES, 0, 3);
int32_t pixelValue = 0;
glReadPixels(0, 0, 1, 1, GL_RED_INTEGER, GL_INT, &pixelValue);
int32_t pixelValue[4] = {0};
glReadPixels(0, 0, 1, 1, GL_RGBA_INTEGER, GL_INT, &pixelValue);
ASSERT_GL_NO_ERROR();
EXPECT_EQ(vertexData[id], pixelValue);
EXPECT_EQ(vertexData[id], pixelValue[0]);
};
fnExpectId(2);
......
......@@ -1116,6 +1116,8 @@ TEST_P(RobustResourceInitTestES3, TextureInit_UIntRGB8)
ANGLE_SKIP_TEST_IF(!hasGLExtension());
// http://anglebug.com/5398
ANGLE_SKIP_TEST_IF(IsAMD() && IsD3D11());
// TODO(anglebug.com/5491) iOS doesn't like to read this format as UNSIGNED_BYTE.
ANGLE_SKIP_TEST_IF(IsIOS() && IsOpenGLES());
testIntegerTextureInit<uint8_t>("u", GL_RGBA8UI, GL_RGB8UI, GL_UNSIGNED_BYTE);
}
......@@ -1131,6 +1133,8 @@ TEST_P(RobustResourceInitTestES3, TextureInit_IntRGB8)
ANGLE_SKIP_TEST_IF(!hasGLExtension());
// http://anglebug.com/5398
ANGLE_SKIP_TEST_IF(IsAMD() && IsD3D11());
// TODO(stianglebug.com/5491) iOS doesn't like to read this format as BYTE.
ANGLE_SKIP_TEST_IF(IsIOS() && IsOpenGLES());
testIntegerTextureInit<int8_t>("i", GL_RGBA8I, GL_RGB8I, GL_BYTE);
}
......
......@@ -76,6 +76,10 @@ void main()
}
)";
// iOS chokes on the "smooth" qualifier.
// TODO(anglebug.com/5491): Add shader compiler workaround that omits "smooth".
ANGLE_SKIP_TEST_IF(IsIOS() && IsOpenGLES());
ANGLE_GL_PROGRAM(program, vertSrc, fragSrc);
glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
......
......@@ -1091,6 +1091,9 @@ TEST_P(StateChangeTestES3, SamplerMetadataUpdateOnSetProgram)
{
// http://anglebug.com/4092
ANGLE_SKIP_TEST_IF(IsAndroid() && IsOpenGLES());
// TODO(anglebug.com/5491) Appears as though there's something wrong with textureSize on iOS
// unrelated to switching programs.
ANGLE_SKIP_TEST_IF(IsIOS() && IsOpenGLES());
GLVertexArray vertexArray;
glBindVertexArray(vertexArray);
......@@ -4167,7 +4170,7 @@ class RobustBufferAccessWebGL2ValidationStateChangeTest : public WebGL2Validatio
RobustBufferAccessWebGL2ValidationStateChangeTest()
{
// SwS/OSX GL do not support robustness. Mali does not support it.
if (!isSwiftshader() && !IsOSX() && !IsARM())
if (!isSwiftshader() && !IsOSX() && !IsIOS() && !IsARM())
{
setRobustAccess(true);
}
......@@ -5917,6 +5920,9 @@ TEST_P(RobustBufferAccessWebGL2ValidationStateChangeTest, BindZeroSizeBufferThen
// Mali does not support robustness now.
ANGLE_SKIP_TEST_IF(IsARM());
// TODO(anglebug.com/5491)
ANGLE_SKIP_TEST_IF(IsIOS() && IsOpenGLES());
std::vector<GLubyte> data(48, 1);
ANGLE_GL_PROGRAM(program, essl1_shaders::vs::Passthrough(), essl1_shaders::fs::Red());
......
......@@ -1602,14 +1602,12 @@ TEST_P(UniformBufferTest, SizeOverMaxBlockSize)
// Compile uniform buffer with large array member.
TEST_P(UniformBufferTest, LargeArrayOfStructs)
{
constexpr char kVertexShader[] = R"(#version 300 es
constexpr char kVertexShader[] = R"(
struct InstancingData
{
mat4 transformation;
};
#define MAX_INSTANCE_COUNT 800
layout(std140) uniform InstanceBlock
{
InstancingData instances[MAX_INSTANCE_COUNT];
......@@ -1628,7 +1626,13 @@ TEST_P(UniformBufferTest, LargeArrayOfStructs)
outFragColor = vec4(0.0);
})";
ANGLE_GL_PROGRAM(program, kVertexShader, kFragmentShader);
int maxUniformBlockSize;
glGetIntegerv(GL_MAX_UNIFORM_BLOCK_SIZE, &maxUniformBlockSize);
std::string vs = "#version 300 es\n#define MAX_INSTANCE_COUNT " +
std::to_string(std::min(800, maxUniformBlockSize / 64)) + kVertexShader;
ANGLE_GL_PROGRAM(program, vs.c_str(), kFragmentShader);
// Add a draw call for the sake of the Vulkan backend that currently really builds shaders at
// draw time.
drawQuad(program.get(), essl3_shaders::PositionAttrib(), 0.5f);
......
......@@ -3142,6 +3142,9 @@ TEST_P(VertexAttributeTest, AliasingVectorAttribLocations)
// http://anglebug.com/3467
ANGLE_SKIP_TEST_IF(IsD3D());
// TODO(anglebug.com/5491): iOS GLSL compiler rejects attribute aliasing.
ANGLE_SKIP_TEST_IF(IsIOS() && IsOpenGLES());
constexpr char kVS[] = R"(attribute vec4 position;
// 4 aliasing attributes
attribute float attr0f;
......@@ -3299,6 +3302,9 @@ TEST_P(VertexAttributeTest, AliasingMatrixAttribLocations)
// http://anglebug.com/3467
ANGLE_SKIP_TEST_IF(IsD3D());
// TODO(anglebug.com/5491): iOS GLSL compiler rejects attribute aliasing.
ANGLE_SKIP_TEST_IF(IsIOS() && IsOpenGLES());
constexpr char kVS[] = R"(attribute vec4 position;
// attributes aliasing location 0 and above
attribute float attr0f;
......@@ -3531,6 +3537,9 @@ TEST_P(VertexAttributeTest, AliasingVectorAttribLocationsDifferingPrecisions)
// http://anglebug.com/3467
ANGLE_SKIP_TEST_IF(IsD3D());
// TODO(anglebug.com/5491): iOS GLSL compiler rejects attribute aliasing.
ANGLE_SKIP_TEST_IF(IsIOS() && IsOpenGLES());
constexpr char kVS[] = R"(attribute vec4 position;
// aliasing attributes.
attribute mediump vec2 attr0v2;
......
......@@ -4723,11 +4723,10 @@ void main()
// extensions have been enabled
TEST_P(WebGLCompatibilityTest, GenerateMipmapUnsizedFloatingPointTexture)
{
if (IsGLExtensionRequestable("GL_OES_texture_float"))
{
glRequestExtensionANGLE("GL_OES_texture_float");
}
glRequestExtensionANGLE("GL_OES_texture_float");
glRequestExtensionANGLE("GL_CHROMIUM_color_buffer_float_rgba");
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled("GL_OES_texture_float"));
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled("GL_CHROMIUM_color_buffer_float_rgba"));
GLTexture texture;
glBindTexture(GL_TEXTURE_2D, texture);
......
......@@ -22,6 +22,7 @@ static CALayer *rootLayer()
bool IOSWindow::initializeImpl(const std::string &name, int width, int height)
{
resize(width, height);
return true;
}
......
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