Hash :
ddc4d33a
Author :
Date :
2019-05-01T15:11:46
Remove several underused platform configs. * Removes D3D11 Warp and Reference configs from tests. * Removes several permutations of OpenGL back-end specific configs. * Removes FL 9_3 since it is no longer supported. * Removes present path "Copy" since it's redundant with normal D3D11. Reduces number of configs from over 60 to 25. Bug: angleproject:3393 Change-Id: Ia5a23de3c4865b17ee50673a4066757b901a4b5a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1574675 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116
//
// Copyright 2015 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// BindGeneratesResourceTest.cpp : Tests of the GL_CHROMIUM_bind_generates_resource extension.
#include "test_utils/ANGLETest.h"
namespace angle
{
class ContextLostTest : public ANGLETest
{
protected:
ContextLostTest() { setContextResetStrategy(EGL_LOSE_CONTEXT_ON_RESET_EXT); }
};
// GL_CHROMIUM_lose_context is implemented in the frontend
TEST_P(ContextLostTest, ExtensionStringExposed)
{
EXPECT_TRUE(EnsureGLExtensionEnabled("GL_CHROMIUM_lose_context"));
}
// Use GL_CHROMIUM_lose_context to lose a context and verify
TEST_P(ContextLostTest, BasicUsage)
{
ANGLE_SKIP_TEST_IF(!EnsureGLExtensionEnabled("GL_CHROMIUM_lose_context"));
ANGLE_SKIP_TEST_IF(!EnsureGLExtensionEnabled("GL_EXT_robustness"));
glLoseContextCHROMIUM(GL_GUILTY_CONTEXT_RESET, GL_INNOCENT_CONTEXT_RESET);
EXPECT_GL_NO_ERROR();
EXPECT_GLENUM_EQ(glGetGraphicsResetStatusEXT(), GL_GUILTY_CONTEXT_RESET);
glBindTexture(GL_TEXTURE_2D, 0);
EXPECT_GL_ERROR(GL_OUT_OF_MEMORY);
}
// When context is lost, polling queries such as glGetSynciv with GL_SYNC_STATUS should always
// return GL_SIGNALED
TEST_P(ContextLostTest, PollingQuery)
{
ANGLE_SKIP_TEST_IF(!EnsureGLExtensionEnabled("GL_CHROMIUM_lose_context"));
ANGLE_SKIP_TEST_IF(getClientMajorVersion() < 3);
GLsync sync = glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
EXPECT_GL_NO_ERROR();
glLoseContextCHROMIUM(GL_GUILTY_CONTEXT_RESET, GL_INNOCENT_CONTEXT_RESET);
EXPECT_GL_NO_ERROR();
GLint syncStatus = 0;
glGetSynciv(sync, GL_SYNC_STATUS, 1, nullptr, &syncStatus);
EXPECT_GL_ERROR(GL_CONTEXT_LOST);
EXPECT_GLENUM_EQ(syncStatus, GL_SIGNALED);
// Check that the query fails and the result is unmodified for other queries
GLint syncCondition = 0xBADF00D;
glGetSynciv(sync, GL_SYNC_CONDITION, 1, nullptr, &syncCondition);
EXPECT_GL_ERROR(GL_CONTEXT_LOST);
EXPECT_GLENUM_EQ(syncCondition, 0xBADF00D);
}
// When context is lost, polling queries such as glGetSynciv with GL_SYNC_STATUS should always
// return GL_SIGNALED
TEST_P(ContextLostTest, ParallelCompileReadyQuery)
{
ANGLE_SKIP_TEST_IF(!EnsureGLExtensionEnabled("GL_CHROMIUM_lose_context"));
ANGLE_SKIP_TEST_IF(!EnsureGLExtensionEnabled("GL_KHR_parallel_shader_compile"));
GLuint vs = CompileShader(GL_VERTEX_SHADER, essl1_shaders::vs::Simple());
GLuint fs = CompileShader(GL_FRAGMENT_SHADER, essl1_shaders::fs::UniformColor());
GLuint program = glCreateProgram();
glAttachShader(program, vs);
glAttachShader(program, fs);
glLinkProgram(program);
EXPECT_GL_NO_ERROR();
glLoseContextCHROMIUM(GL_GUILTY_CONTEXT_RESET, GL_INNOCENT_CONTEXT_RESET);
EXPECT_GL_NO_ERROR();
GLint shaderCompletionStatus = 0;
glGetShaderiv(vs, GL_COMPLETION_STATUS_KHR, &shaderCompletionStatus);
EXPECT_GL_ERROR(GL_CONTEXT_LOST);
EXPECT_GLENUM_EQ(shaderCompletionStatus, GL_TRUE);
GLint programCompletionStatus = 0;
glGetProgramiv(program, GL_COMPLETION_STATUS_KHR, &programCompletionStatus);
EXPECT_GL_ERROR(GL_CONTEXT_LOST);
EXPECT_GLENUM_EQ(programCompletionStatus, GL_TRUE);
// Check that the query fails and the result is unmodified for other queries
GLint shaderType = 0xBADF00D;
glGetShaderiv(vs, GL_SHADER_TYPE, &shaderType);
EXPECT_GL_ERROR(GL_CONTEXT_LOST);
EXPECT_GLENUM_EQ(shaderType, 0xBADF00D);
GLint linkStatus = 0xBADF00D;
glGetProgramiv(program, GL_LINK_STATUS, &linkStatus);
EXPECT_GL_ERROR(GL_CONTEXT_LOST);
EXPECT_GLENUM_EQ(linkStatus, 0xBADF00D);
}
// Use this to select which configurations (e.g. which renderer, which GLES major version) these
// tests should be run against.
ANGLE_INSTANTIATE_TEST(ContextLostTest,
ES2_NULL(),
ES2_D3D9(),
ES2_D3D11(),
ES3_D3D11(),
ES2_VULKAN(),
ES3_VULKAN());
} // namespace angle