Revert "Load entry points dynamically in tests and samples."
This reverts commit 03923558a7103827ffec6a4d2a1453ed91f01c6f.
Reason for revert: fails compilation on Android, ChromeOS and Fuchsia during roll https://chromium-review.googlesource.com/c/chromium/src/+/1392624
Original change's description:
> Load entry points dynamically in tests and samples.
>
> This CL adds a dynamic loader generator based on XML files. It also
> refactors the entry point generation script to move the XML parsing
> into a helper class.
>
> Additionally this includes a new GLES 1.0 base header. The new
> header allows for function pointer types and hiding prototypes.
>
> All tests and samples now load ANGLE dynamically. In the future this
> will be extended to load entry points from the driver directly when
> possible. This will allow us to perform more accurate A/B testing.
>
> The new build configuration leads to some tests having more warnings
> applied. The CL includes fixes for the new warnings.
>
> Bug: angleproject:2995
> Change-Id: I6726d4163f7a6e54d2482f094c0a952f59702a05
> Reviewed-on: https://chromium-review.googlesource.com/c/1359516
> Commit-Queue: Jamie Madill <jmadill@chromium.org>
> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
TBR=ynovikov@chromium.org,jmadill@chromium.org,syoussefi@chromium.org
Change-Id: I902bec2d733c2b879be29c02ab52a0b7d4eaa077
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: angleproject:2995
Reviewed-on: https://chromium-review.googlesource.com/c/1392381
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
diff --git a/src/common/mathutil_unittest.cpp b/src/common/mathutil_unittest.cpp
index 3c3f11d..8640763 100644
--- a/src/common/mathutil_unittest.cpp
+++ b/src/common/mathutil_unittest.cpp
@@ -259,9 +259,9 @@
EXPECT_EQ(10, gl::BitCount(0x17103121u));
#if defined(ANGLE_IS_64_BIT_CPU)
- EXPECT_EQ(0, gl::BitCount(static_cast<uint64_t>(0ull)));
- EXPECT_EQ(32, gl::BitCount(static_cast<uint64_t>(0xFFFFFFFFull)));
- EXPECT_EQ(10, gl::BitCount(static_cast<uint64_t>(0x17103121ull)));
+ EXPECT_EQ(0, gl::BitCount(0ull));
+ EXPECT_EQ(32, gl::BitCount(0xFFFFFFFFull));
+ EXPECT_EQ(10, gl::BitCount(0x17103121ull));
#endif // defined(ANGLE_IS_64_BIT_CPU)
}
@@ -273,9 +273,9 @@
EXPECT_EQ(31ul, gl::ScanForward(0x80000000u));
#if defined(ANGLE_IS_64_BIT_CPU)
- EXPECT_EQ(0ul, gl::ScanForward(static_cast<uint64_t>(1ull)));
- EXPECT_EQ(16ul, gl::ScanForward(static_cast<uint64_t>(0x80010000ull)));
- EXPECT_EQ(31ul, gl::ScanForward(static_cast<uint64_t>(0x80000000ull)));
+ EXPECT_EQ(0ul, gl::ScanForward(1ull));
+ EXPECT_EQ(16ul, gl::ScanForward(0x80010000ull));
+ EXPECT_EQ(31ul, gl::ScanForward(0x80000000ull));
#endif // defined(ANGLE_IS_64_BIT_CPU)
}
diff --git a/src/common/system_utils.h b/src/common/system_utils.h
index 2c5c6c6..142ef9f 100644
--- a/src/common/system_utils.h
+++ b/src/common/system_utils.h
@@ -30,12 +30,6 @@
public:
virtual ~Library() {}
virtual void *getSymbol(const char *symbolName) = 0;
-
- template <typename FuncT>
- void getAs(const char *symbolName, FuncT *funcOut)
- {
- *funcOut = reinterpret_cast<FuncT>(getSymbol(symbolName));
- }
};
Library *OpenSharedLibrary(const char *libraryName);
diff --git a/src/common/utilities.h b/src/common/utilities.h
index bc924ae..512e05d 100644
--- a/src/common/utilities.h
+++ b/src/common/utilities.h
@@ -15,7 +15,6 @@
#include <math.h>
#include <string>
#include <vector>
-
#include "angle_gl.h"
#include "common/PackedEnums.h"
diff --git a/src/compiler/translator/ShaderStorageBlockFunctionHLSL.cpp b/src/compiler/translator/ShaderStorageBlockFunctionHLSL.cpp
index 60535fe..a91b1d9 100644
--- a/src/compiler/translator/ShaderStorageBlockFunctionHLSL.cpp
+++ b/src/compiler/translator/ShaderStorageBlockFunctionHLSL.cpp
@@ -305,7 +305,7 @@
}
ssboFunction.functionName += ssboFunction.typeString;
- ssboFunction.type = type;
+ ssboFunction.type = type;
if (swizzleNode != nullptr)
{
ssboFunction.swizzleOffsets = swizzleNode->getSwizzleOffsets();
diff --git a/src/libGLESv2.gni b/src/libGLESv2.gni
index 63baef4..436e22e 100644
--- a/src/libGLESv2.gni
+++ b/src/libGLESv2.gni
@@ -94,25 +94,18 @@
"src/image_util/loadimage.inl",
"src/image_util/loadimage_etc.cpp",
]
-
libangle_gpu_info_util_sources = [
"src/gpu_info_util/SystemInfo.cpp",
"src/gpu_info_util/SystemInfo.h",
"src/gpu_info_util/SystemInfo_internal.h",
]
-
libangle_gpu_info_util_win_sources = [ "src/gpu_info_util/SystemInfo_win.cpp" ]
-
libangle_gpu_info_util_linux_sources =
[ "src/gpu_info_util/SystemInfo_linux.cpp" ]
-
libangle_gpu_info_util_libpci_sources =
[ "src/gpu_info_util/SystemInfo_libpci.cpp" ]
-
libangle_gpu_info_util_x11_sources = [ "src/gpu_info_util/SystemInfo_x11.cpp" ]
-
libangle_gpu_info_util_mac_sources = [ "src/gpu_info_util/SystemInfo_mac.mm" ]
-
libangle_includes = [
"include/angle_gl.h",
"include/export.h",
@@ -143,7 +136,6 @@
"include/platform/Platform.h",
"include/platform/WorkaroundsD3D.h",
]
-
libangle_sources = [
"src/common/event_tracer.cpp",
"src/common/event_tracer.h",
@@ -327,7 +319,6 @@
"src/libANGLE/validationESEXT.h",
"src/third_party/trace_event/trace_event.h",
]
-
libangle_d3d_shared_sources = [
"src/libANGLE/renderer/d3d/BufferD3D.cpp",
"src/libANGLE/renderer/d3d/BufferD3D.h",
@@ -380,7 +371,6 @@
"src/libANGLE/renderer/d3d/VertexDataManager.cpp",
"src/libANGLE/renderer/d3d/VertexDataManager.h",
]
-
libangle_d3d9_sources = [
"src/libANGLE/renderer/d3d/d3d9/Blit9.cpp",
"src/libANGLE/renderer/d3d/d3d9/Blit9.h",
@@ -434,7 +424,6 @@
"src/libANGLE/renderer/d3d/d3d9/VertexDeclarationCache.cpp",
"src/libANGLE/renderer/d3d/d3d9/VertexDeclarationCache.h",
]
-
libangle_d3d11_sources = [
"src/libANGLE/renderer/d3d/d3d11/Blit11.cpp",
"src/libANGLE/renderer/d3d/d3d11/Blit11.h",
@@ -557,7 +546,6 @@
"src/libANGLE/renderer/d3d/d3d11/VertexBuffer11.cpp",
"src/libANGLE/renderer/d3d/d3d11/VertexBuffer11.h",
]
-
libangle_d3d11_win32_sources = [
"src/libANGLE/renderer/d3d/d3d11/win32/NativeWindow11Win32.cpp",
"src/libANGLE/renderer/d3d/d3d11/win32/NativeWindow11Win32.h",
@@ -566,7 +554,6 @@
"src/third_party/systeminfo/SystemInfo.cpp",
"src/third_party/systeminfo/SystemInfo.h",
]
-
libangle_d3d11_winrt_sources = [
"src/libANGLE/renderer/d3d/d3d11/winrt/CoreWindowNativeWindow.cpp",
"src/libANGLE/renderer/d3d/d3d11/winrt/CoreWindowNativeWindow.h",
@@ -577,7 +564,6 @@
"src/libANGLE/renderer/d3d/d3d11/winrt/SwapChainPanelNativeWindow.cpp",
"src/libANGLE/renderer/d3d/d3d11/winrt/SwapChainPanelNativeWindow.h",
]
-
libangle_gl_sources = [
"src/libANGLE/renderer/gl/BlitGL.cpp",
"src/libANGLE/renderer/gl/BlitGL.h",
@@ -637,12 +623,10 @@
"src/libANGLE/renderer/gl/renderergl_utils.cpp",
"src/libANGLE/renderer/gl/renderergl_utils.h",
]
-
libangle_gl_null_sources = [
"src/libANGLE/renderer/gl/null_functions.cpp",
"src/libANGLE/renderer/gl/null_functions.h",
]
-
libangle_gl_wgl_sources = [
"src/libANGLE/renderer/gl/wgl/ContextWGL.cpp",
"src/libANGLE/renderer/gl/wgl/ContextWGL.h",
@@ -666,7 +650,6 @@
"src/libANGLE/renderer/gl/wgl/wgl_utils.h",
"src/third_party/khronos/GL/wglext.h",
]
-
libangle_gl_glx_sources = [
"src/libANGLE/renderer/gl/glx/DisplayGLX.cpp",
"src/libANGLE/renderer/gl/glx/DisplayGLX.h",
@@ -680,7 +663,6 @@
"src/libANGLE/renderer/gl/glx/functionsglx_typedefs.h",
"src/libANGLE/renderer/gl/glx/platform_glx.h",
]
-
libangle_gl_egl_sources = [
"src/libANGLE/renderer/gl/egl/ContextEGL.cpp",
"src/libANGLE/renderer/gl/egl/ContextEGL.h",
@@ -707,14 +689,12 @@
"src/libANGLE/renderer/gl/egl/FunctionsEGLDL.cpp",
"src/libANGLE/renderer/gl/egl/FunctionsEGLDL.h",
]
-
libangle_gl_ozone_sources = [
"src/libANGLE/renderer/gl/egl/ozone/DisplayOzone.cpp",
"src/libANGLE/renderer/gl/egl/ozone/DisplayOzone.h",
"src/libANGLE/renderer/gl/egl/ozone/SurfaceOzone.cpp",
"src/libANGLE/renderer/gl/egl/ozone/SurfaceOzone.h",
]
-
libangle_gl_egl_android_sources = [
"src/libANGLE/renderer/gl/egl/android/android_util.cpp",
"src/libANGLE/renderer/gl/egl/android/android_util.h",
@@ -723,7 +703,6 @@
"src/libANGLE/renderer/gl/egl/android/NativeBufferImageSiblingAndroid.cpp",
"src/libANGLE/renderer/gl/egl/android/NativeBufferImageSiblingAndroid.h",
]
-
libangle_gl_cgl_sources = [
"src/libANGLE/renderer/gl/cgl/DisplayCGL.mm",
"src/libANGLE/renderer/gl/cgl/DisplayCGL.h",
@@ -734,7 +713,6 @@
"src/libANGLE/renderer/gl/cgl/WindowSurfaceCGL.mm",
"src/libANGLE/renderer/gl/cgl/WindowSurfaceCGL.h",
]
-
libangle_vulkan_sources = [
"src/libANGLE/renderer/vulkan/BufferVk.cpp",
"src/libANGLE/renderer/vulkan/BufferVk.h",
@@ -799,28 +777,24 @@
"src/libANGLE/renderer/vulkan/vk_utils.cpp",
"src/libANGLE/renderer/vulkan/vk_utils.h",
]
-
libangle_vulkan_android_sources = [
"src/libANGLE/renderer/vulkan/android/DisplayVkAndroid.cpp",
"src/libANGLE/renderer/vulkan/android/DisplayVkAndroid.h",
"src/libANGLE/renderer/vulkan/android/WindowSurfaceVkAndroid.cpp",
"src/libANGLE/renderer/vulkan/android/WindowSurfaceVkAndroid.h",
]
-
libangle_vulkan_win32_sources = [
"src/libANGLE/renderer/vulkan/win32/DisplayVkWin32.cpp",
"src/libANGLE/renderer/vulkan/win32/DisplayVkWin32.h",
"src/libANGLE/renderer/vulkan/win32/WindowSurfaceVkWin32.cpp",
"src/libANGLE/renderer/vulkan/win32/WindowSurfaceVkWin32.h",
]
-
libangle_vulkan_xcb_sources = [
"src/libANGLE/renderer/vulkan/xcb/DisplayVkXcb.cpp",
"src/libANGLE/renderer/vulkan/xcb/DisplayVkXcb.h",
"src/libANGLE/renderer/vulkan/xcb/WindowSurfaceVkXcb.cpp",
"src/libANGLE/renderer/vulkan/xcb/WindowSurfaceVkXcb.h",
]
-
libangle_null_sources = [
"src/libANGLE/renderer/null/BufferNULL.cpp",
"src/libANGLE/renderer/null/BufferNULL.h",
@@ -863,7 +837,6 @@
"src/libANGLE/renderer/null/VertexArrayNULL.cpp",
"src/libANGLE/renderer/null/VertexArrayNULL.h",
]
-
libglesv2_sources = [
"src/common/angleutils.h",
"src/common/debug.h",
@@ -891,14 +864,12 @@
"src/libGLESv2/proc_table_autogen.cpp",
"src/libGLESv2/resource.h",
]
-
libglesv1_cm_sources = [
"src/libGLESv1_CM/libGLESv1_CM.cpp",
"src/libGLESv1_CM/libGLESv1_CM.def",
"src/libGLESv1_CM/libGLESv1_CM.rc",
"src/libGLESv1_CM/resource.h",
]
-
libegl_sources = [
"src/libEGL/libEGL.cpp",
"src/libEGL/libEGL.rc",
diff --git a/src/libGLESv2/proc_table_autogen.cpp b/src/libGLESv2/proc_table_autogen.cpp
index 06bca1b..b62fe6a 100644
--- a/src/libGLESv2/proc_table_autogen.cpp
+++ b/src/libGLESv2/proc_table_autogen.cpp
@@ -135,14 +135,6 @@
{"glBindBufferContextANGLE", P(gl::BindBufferContextANGLE)},
{"glBindBufferRange", P(gl::BindBufferRange)},
{"glBindBufferRangeContextANGLE", P(gl::BindBufferRangeContextANGLE)},
- {"glBindFragDataLocationEXT", P(gl::BindFragDataLocationEXT)},
- {"glBindFragDataLocationEXTContextANGLE", P(gl::BindFragDataLocationEXTContextANGLE)},
- {"glBindFragDataLocationIndexedEXT", P(gl::BindFragDataLocationIndexedEXT)},
- {"glBindFragDataLocationIndexedEXTContextANGLE",
- P(gl::BindFragDataLocationIndexedEXTContextANGLE)},
- {"glBindFragmentInputLocationCHROMIUM", P(gl::BindFragmentInputLocationCHROMIUM)},
- {"glBindFragmentInputLocationCHROMIUMContextANGLE",
- P(gl::BindFragmentInputLocationCHROMIUMContextANGLE)},
{"glBindFramebuffer", P(gl::BindFramebuffer)},
{"glBindFramebufferContextANGLE", P(gl::BindFramebufferContextANGLE)},
{"glBindImageTexture", P(gl::BindImageTexture)},
@@ -264,18 +256,6 @@
{"glCopyTexture3DANGLEContextANGLE", P(gl::CopyTexture3DANGLEContextANGLE)},
{"glCopyTextureCHROMIUM", P(gl::CopyTextureCHROMIUM)},
{"glCopyTextureCHROMIUMContextANGLE", P(gl::CopyTextureCHROMIUMContextANGLE)},
- {"glCoverFillPathCHROMIUM", P(gl::CoverFillPathCHROMIUM)},
- {"glCoverFillPathCHROMIUMContextANGLE", P(gl::CoverFillPathCHROMIUMContextANGLE)},
- {"glCoverFillPathInstancedCHROMIUM", P(gl::CoverFillPathInstancedCHROMIUM)},
- {"glCoverFillPathInstancedCHROMIUMContextANGLE",
- P(gl::CoverFillPathInstancedCHROMIUMContextANGLE)},
- {"glCoverStrokePathCHROMIUM", P(gl::CoverStrokePathCHROMIUM)},
- {"glCoverStrokePathCHROMIUMContextANGLE", P(gl::CoverStrokePathCHROMIUMContextANGLE)},
- {"glCoverStrokePathInstancedCHROMIUM", P(gl::CoverStrokePathInstancedCHROMIUM)},
- {"glCoverStrokePathInstancedCHROMIUMContextANGLE",
- P(gl::CoverStrokePathInstancedCHROMIUMContextANGLE)},
- {"glCoverageModulationCHROMIUM", P(gl::CoverageModulationCHROMIUM)},
- {"glCoverageModulationCHROMIUMContextANGLE", P(gl::CoverageModulationCHROMIUMContextANGLE)},
{"glCreateProgram", P(gl::CreateProgram)},
{"glCreateProgramContextANGLE", P(gl::CreateProgramContextANGLE)},
{"glCreateShader", P(gl::CreateShader)},
@@ -298,8 +278,6 @@
{"glDeleteFencesNVContextANGLE", P(gl::DeleteFencesNVContextANGLE)},
{"glDeleteFramebuffers", P(gl::DeleteFramebuffers)},
{"glDeleteFramebuffersContextANGLE", P(gl::DeleteFramebuffersContextANGLE)},
- {"glDeletePathsCHROMIUM", P(gl::DeletePathsCHROMIUM)},
- {"glDeletePathsCHROMIUMContextANGLE", P(gl::DeletePathsCHROMIUMContextANGLE)},
{"glDeleteProgram", P(gl::DeleteProgram)},
{"glDeleteProgramContextANGLE", P(gl::DeleteProgramContextANGLE)},
{"glDeleteProgramPipelines", P(gl::DeleteProgramPipelines)},
@@ -450,8 +428,6 @@
{"glGenFencesNVContextANGLE", P(gl::GenFencesNVContextANGLE)},
{"glGenFramebuffers", P(gl::GenFramebuffers)},
{"glGenFramebuffersContextANGLE", P(gl::GenFramebuffersContextANGLE)},
- {"glGenPathsCHROMIUM", P(gl::GenPathsCHROMIUM)},
- {"glGenPathsCHROMIUMContextANGLE", P(gl::GenPathsCHROMIUMContextANGLE)},
{"glGenProgramPipelines", P(gl::GenProgramPipelines)},
{"glGenProgramPipelinesContextANGLE", P(gl::GenProgramPipelinesContextANGLE)},
{"glGenQueries", P(gl::GenQueries)},
@@ -529,8 +505,6 @@
{"glGetFloatvContextANGLE", P(gl::GetFloatvContextANGLE)},
{"glGetFloatvRobustANGLE", P(gl::GetFloatvRobustANGLE)},
{"glGetFloatvRobustANGLEContextANGLE", P(gl::GetFloatvRobustANGLEContextANGLE)},
- {"glGetFragDataIndexEXT", P(gl::GetFragDataIndexEXT)},
- {"glGetFragDataIndexEXTContextANGLE", P(gl::GetFragDataIndexEXTContextANGLE)},
{"glGetFragDataLocation", P(gl::GetFragDataLocation)},
{"glGetFragDataLocationContextANGLE", P(gl::GetFragDataLocationContextANGLE)},
{"glGetFramebufferAttachmentParameteriv", P(gl::GetFramebufferAttachmentParameteriv)},
@@ -586,10 +560,6 @@
{"glGetObjectLabelKHRContextANGLE", P(gl::GetObjectLabelKHRContextANGLE)},
{"glGetObjectPtrLabelKHR", P(gl::GetObjectPtrLabelKHR)},
{"glGetObjectPtrLabelKHRContextANGLE", P(gl::GetObjectPtrLabelKHRContextANGLE)},
- {"glGetPathParameterfvCHROMIUM", P(gl::GetPathParameterfvCHROMIUM)},
- {"glGetPathParameterfvCHROMIUMContextANGLE", P(gl::GetPathParameterfvCHROMIUMContextANGLE)},
- {"glGetPathParameterivCHROMIUM", P(gl::GetPathParameterivCHROMIUM)},
- {"glGetPathParameterivCHROMIUMContextANGLE", P(gl::GetPathParameterivCHROMIUMContextANGLE)},
{"glGetPointerv", P(gl::GetPointerv)},
{"glGetPointervContextANGLE", P(gl::GetPointervContextANGLE)},
{"glGetPointervKHR", P(gl::GetPointervKHR)},
@@ -616,9 +586,6 @@
{"glGetProgramResourceIndexContextANGLE", P(gl::GetProgramResourceIndexContextANGLE)},
{"glGetProgramResourceLocation", P(gl::GetProgramResourceLocation)},
{"glGetProgramResourceLocationContextANGLE", P(gl::GetProgramResourceLocationContextANGLE)},
- {"glGetProgramResourceLocationIndexEXT", P(gl::GetProgramResourceLocationIndexEXT)},
- {"glGetProgramResourceLocationIndexEXTContextANGLE",
- P(gl::GetProgramResourceLocationIndexEXTContextANGLE)},
{"glGetProgramResourceName", P(gl::GetProgramResourceName)},
{"glGetProgramResourceNameContextANGLE", P(gl::GetProgramResourceNameContextANGLE)},
{"glGetProgramResourceiv", P(gl::GetProgramResourceiv)},
@@ -806,8 +773,6 @@
{"glIsFenceNVContextANGLE", P(gl::IsFenceNVContextANGLE)},
{"glIsFramebuffer", P(gl::IsFramebuffer)},
{"glIsFramebufferContextANGLE", P(gl::IsFramebufferContextANGLE)},
- {"glIsPathCHROMIUM", P(gl::IsPathCHROMIUM)},
- {"glIsPathCHROMIUMContextANGLE", P(gl::IsPathCHROMIUMContextANGLE)},
{"glIsProgram", P(gl::IsProgram)},
{"glIsProgramContextANGLE", P(gl::IsProgramContextANGLE)},
{"glIsProgramPipeline", P(gl::IsProgramPipeline)},
@@ -881,10 +846,6 @@
{"glMaterialxvContextANGLE", P(gl::MaterialxvContextANGLE)},
{"glMatrixIndexPointerOES", P(gl::MatrixIndexPointerOES)},
{"glMatrixIndexPointerOESContextANGLE", P(gl::MatrixIndexPointerOESContextANGLE)},
- {"glMatrixLoadIdentityCHROMIUM", P(gl::MatrixLoadIdentityCHROMIUM)},
- {"glMatrixLoadIdentityCHROMIUMContextANGLE", P(gl::MatrixLoadIdentityCHROMIUMContextANGLE)},
- {"glMatrixLoadfCHROMIUM", P(gl::MatrixLoadfCHROMIUM)},
- {"glMatrixLoadfCHROMIUMContextANGLE", P(gl::MatrixLoadfCHROMIUMContextANGLE)},
{"glMatrixMode", P(gl::MatrixMode)},
{"glMatrixModeContextANGLE", P(gl::MatrixModeContextANGLE)},
{"glMaxShaderCompilerThreadsKHR", P(gl::MaxShaderCompilerThreadsKHR)},
@@ -925,14 +886,6 @@
{"glOrthofContextANGLE", P(gl::OrthofContextANGLE)},
{"glOrthox", P(gl::Orthox)},
{"glOrthoxContextANGLE", P(gl::OrthoxContextANGLE)},
- {"glPathCommandsCHROMIUM", P(gl::PathCommandsCHROMIUM)},
- {"glPathCommandsCHROMIUMContextANGLE", P(gl::PathCommandsCHROMIUMContextANGLE)},
- {"glPathParameterfCHROMIUM", P(gl::PathParameterfCHROMIUM)},
- {"glPathParameterfCHROMIUMContextANGLE", P(gl::PathParameterfCHROMIUMContextANGLE)},
- {"glPathParameteriCHROMIUM", P(gl::PathParameteriCHROMIUM)},
- {"glPathParameteriCHROMIUMContextANGLE", P(gl::PathParameteriCHROMIUMContextANGLE)},
- {"glPathStencilFuncCHROMIUM", P(gl::PathStencilFuncCHROMIUM)},
- {"glPathStencilFuncCHROMIUMContextANGLE", P(gl::PathStencilFuncCHROMIUMContextANGLE)},
{"glPauseTransformFeedback", P(gl::PauseTransformFeedback)},
{"glPauseTransformFeedbackContextANGLE", P(gl::PauseTransformFeedbackContextANGLE)},
{"glPixelStorei", P(gl::PixelStorei)},
@@ -967,9 +920,6 @@
{"glProgramBinaryOESContextANGLE", P(gl::ProgramBinaryOESContextANGLE)},
{"glProgramParameteri", P(gl::ProgramParameteri)},
{"glProgramParameteriContextANGLE", P(gl::ProgramParameteriContextANGLE)},
- {"glProgramPathFragmentInputGenCHROMIUM", P(gl::ProgramPathFragmentInputGenCHROMIUM)},
- {"glProgramPathFragmentInputGenCHROMIUMContextANGLE",
- P(gl::ProgramPathFragmentInputGenCHROMIUMContextANGLE)},
{"glProgramUniform1f", P(gl::ProgramUniform1f)},
{"glProgramUniform1fContextANGLE", P(gl::ProgramUniform1fContextANGLE)},
{"glProgramUniform1fv", P(gl::ProgramUniform1fv)},
@@ -1120,11 +1070,6 @@
{"glShaderBinaryContextANGLE", P(gl::ShaderBinaryContextANGLE)},
{"glShaderSource", P(gl::ShaderSource)},
{"glShaderSourceContextANGLE", P(gl::ShaderSourceContextANGLE)},
- {"glStencilFillPathCHROMIUM", P(gl::StencilFillPathCHROMIUM)},
- {"glStencilFillPathCHROMIUMContextANGLE", P(gl::StencilFillPathCHROMIUMContextANGLE)},
- {"glStencilFillPathInstancedCHROMIUM", P(gl::StencilFillPathInstancedCHROMIUM)},
- {"glStencilFillPathInstancedCHROMIUMContextANGLE",
- P(gl::StencilFillPathInstancedCHROMIUMContextANGLE)},
{"glStencilFunc", P(gl::StencilFunc)},
{"glStencilFuncContextANGLE", P(gl::StencilFuncContextANGLE)},
{"glStencilFuncSeparate", P(gl::StencilFuncSeparate)},
@@ -1137,25 +1082,6 @@
{"glStencilOpContextANGLE", P(gl::StencilOpContextANGLE)},
{"glStencilOpSeparate", P(gl::StencilOpSeparate)},
{"glStencilOpSeparateContextANGLE", P(gl::StencilOpSeparateContextANGLE)},
- {"glStencilStrokePathCHROMIUM", P(gl::StencilStrokePathCHROMIUM)},
- {"glStencilStrokePathCHROMIUMContextANGLE", P(gl::StencilStrokePathCHROMIUMContextANGLE)},
- {"glStencilStrokePathInstancedCHROMIUM", P(gl::StencilStrokePathInstancedCHROMIUM)},
- {"glStencilStrokePathInstancedCHROMIUMContextANGLE",
- P(gl::StencilStrokePathInstancedCHROMIUMContextANGLE)},
- {"glStencilThenCoverFillPathCHROMIUM", P(gl::StencilThenCoverFillPathCHROMIUM)},
- {"glStencilThenCoverFillPathCHROMIUMContextANGLE",
- P(gl::StencilThenCoverFillPathCHROMIUMContextANGLE)},
- {"glStencilThenCoverFillPathInstancedCHROMIUM",
- P(gl::StencilThenCoverFillPathInstancedCHROMIUM)},
- {"glStencilThenCoverFillPathInstancedCHROMIUMContextANGLE",
- P(gl::StencilThenCoverFillPathInstancedCHROMIUMContextANGLE)},
- {"glStencilThenCoverStrokePathCHROMIUM", P(gl::StencilThenCoverStrokePathCHROMIUM)},
- {"glStencilThenCoverStrokePathCHROMIUMContextANGLE",
- P(gl::StencilThenCoverStrokePathCHROMIUMContextANGLE)},
- {"glStencilThenCoverStrokePathInstancedCHROMIUM",
- P(gl::StencilThenCoverStrokePathInstancedCHROMIUM)},
- {"glStencilThenCoverStrokePathInstancedCHROMIUMContextANGLE",
- P(gl::StencilThenCoverStrokePathInstancedCHROMIUMContextANGLE)},
{"glTestFenceNV", P(gl::TestFenceNV)},
{"glTestFenceNVContextANGLE", P(gl::TestFenceNVContextANGLE)},
{"glTexCoordPointer", P(gl::TexCoordPointer)},
@@ -1361,5 +1287,5 @@
{"glWeightPointerOES", P(gl::WeightPointerOES)},
{"glWeightPointerOESContextANGLE", P(gl::WeightPointerOESContextANGLE)}};
-size_t g_numProcs = 1277;
+size_t g_numProcs = 1217;
} // namespace egl
diff --git a/src/libGLESv2/proc_table_data.json b/src/libGLESv2/proc_table_data.json
index 2de6469..8b37a76 100644
--- a/src/libGLESv2/proc_table_data.json
+++ b/src/libGLESv2/proc_table_data.json
@@ -343,45 +343,6 @@
"glGetTranslatedShaderSourceANGLE"
],
- "GL_CHROMIUM_framebuffer_mixed_samples": [
- "glMatrixLoadfCHROMIUM",
- "glMatrixLoadIdentityCHROMIUM",
- "glCoverageModulationCHROMIUM"
- ],
-
- "GL_CHROMIUM_path_rendering": [
- "glGenPathsCHROMIUM",
- "glDeletePathsCHROMIUM",
- "glIsPathCHROMIUM",
- "glPathCommandsCHROMIUM",
- "glPathParameterfCHROMIUM",
- "glPathParameteriCHROMIUM",
- "glGetPathParameterfvCHROMIUM",
- "glGetPathParameterivCHROMIUM",
- "glPathStencilFuncCHROMIUM",
- "glStencilFillPathCHROMIUM",
- "glStencilStrokePathCHROMIUM",
- "glCoverFillPathCHROMIUM",
- "glCoverStrokePathCHROMIUM",
- "glStencilThenCoverFillPathCHROMIUM",
- "glStencilThenCoverStrokePathCHROMIUM",
- "glCoverFillPathInstancedCHROMIUM",
- "glCoverStrokePathInstancedCHROMIUM",
- "glStencilFillPathInstancedCHROMIUM",
- "glStencilStrokePathInstancedCHROMIUM",
- "glStencilThenCoverFillPathInstancedCHROMIUM",
- "glStencilThenCoverStrokePathInstancedCHROMIUM",
- "glBindFragmentInputLocationCHROMIUM",
- "glProgramPathFragmentInputGenCHROMIUM"
- ],
-
- "GL_EXT_blend_func_extended": [
- "glBindFragDataLocationIndexedEXT",
- "glBindFragDataLocationEXT",
- "glGetProgramResourceLocationIndexEXT",
- "glGetFragDataIndexEXT"
- ],
-
"GL_EXT_texture_storage": [
"glTexStorage2DEXT",
"glTexStorage3DEXT"
diff --git a/src/tests/BUILD.gn b/src/tests/BUILD.gn
index e2c8cde..648d2ac 100644
--- a/src/tests/BUILD.gn
+++ b/src/tests/BUILD.gn
@@ -87,53 +87,6 @@
}
}
-source_set("angle_unittests_main") {
- testonly = true
- public_deps = googletest_deps + [ angle_root + ":includes" ]
- public_configs = [ angle_root + ":internal_config" ]
-
- if (build_with_chromium) {
- sources = [
- "//gpu/angle_unittest_main.cc",
- ]
- } else {
- sources = [
- "angle_unittests_main.cpp",
- ]
- }
-}
-
-# Ideally we would rename this. But not be worth the hassle.
-source_set("angle_end2end_tests_main") {
- testonly = true
- public_deps = googletest_deps
-
- if (build_with_chromium) {
- sources = [
- "//gpu/angle_end2end_tests_main.cc",
- ]
- } else {
- sources = [
- "angle_end2end_tests_main.cpp",
- ]
- }
-}
-
-source_set("angle_perftests_main") {
- testonly = true
- public_deps = googletest_deps
-
- if (build_with_chromium) {
- sources = [
- "//gpu/angle_perftests_main.cc",
- ]
- } else {
- sources = [
- "angle_perftests_main.cpp",
- ]
- }
-}
-
# This config adds build-ids to the associated library.
# -Wl is a special option that indicates that clang should pass the associated
# option --build-id to the linker. This will cause a build-id section to be added
@@ -155,6 +108,12 @@
defines = [ "ANGLE_ENABLE_HLSL" ]
}
+ if (build_with_chromium) {
+ sources += [ "//gpu/angle_unittest_main.cc" ]
+ } else {
+ sources += [ "angle_unittests_main.cpp" ]
+ }
+
if (is_linux && !is_component_build) {
# Set rpath to find shared libs in a non-component build.
configs += [ "//build/config/gcc:rpath_for_built_shared_libraries" ]
@@ -165,7 +124,6 @@
angle_root + ":preprocessor",
angle_root + ":translator",
angle_root + ":libfeature_support${angle_libs_suffix}",
- ":angle_unittests_main",
]
}
@@ -197,7 +155,14 @@
sources += angle_end2end_tests_x11_sources
}
+ if (build_with_chromium) {
+ sources += [ "//gpu/angle_end2end_tests_main.cc" ]
+ } else {
+ sources += [ "angle_end2end_tests_main.cpp" ]
+ }
+
configs += [
+ angle_root + ":gl_prototypes",
angle_root + ":internal_config",
angle_root + ":libANGLE_config",
angle_root + ":library_name_config",
@@ -208,18 +173,15 @@
configs += [ "//build/config/gcc:rpath_for_built_shared_libraries" ]
}
- deps = [
- angle_root + ":angle_image_util",
- angle_root + ":angle_util",
- angle_root + ":angle_util_loader_headers",
- ":angle_end2end_tests_main",
- ]
-
- data_deps = [
- angle_root + ":libEGL${angle_libs_suffix}",
- angle_root + ":libGLESv1_CM${angle_libs_suffix}",
- angle_root + ":libGLESv2${angle_libs_suffix}",
- ]
+ deps = googletest_deps + [
+ angle_root + ":angle_image_util",
+ angle_root + ":angle_util",
+ angle_root + ":libEGL${angle_libs_suffix}",
+ angle_root + ":libGLESv1_CM${angle_libs_suffix}",
+ angle_root + ":libGLESv2${angle_libs_suffix}",
+ angle_root + ":preprocessor",
+ angle_root + ":translator",
+ ]
}
import("angle_white_box_tests.gni")
@@ -237,15 +199,23 @@
sources += angle_white_box_tests_win_sources
}
+ # Share the same main file as end2end_tests.
+ # TODO(jmadill): Probably should rename this if we're sharing.
+ if (build_with_chromium) {
+ sources += [ "//gpu/angle_end2end_tests_main.cc" ]
+ } else {
+ sources += [ "angle_end2end_tests_main.cpp" ]
+ }
+
if (angle_enable_vulkan) {
sources += [ "gl_tests/VulkanFormatTablesTest.cpp" ]
sources += [ "gl_tests/VulkanUniformUpdatesTest.cpp" ]
}
configs += [
+ angle_root + ":gl_prototypes",
angle_root + ":internal_config",
angle_root + ":libANGLE_config",
- angle_root + ":library_name_config",
]
if (is_linux && !is_component_build) {
@@ -253,15 +223,14 @@
configs += [ "//build/config/gcc:rpath_for_built_shared_libraries" ]
}
- deps = [
- angle_root + ":angle_util_static",
- angle_root + ":libANGLE",
- angle_root + ":libEGL_static",
- angle_root + ":libGLESv2_static",
- angle_root + ":preprocessor",
- angle_root + ":translator",
- ":angle_end2end_tests_main",
- ]
+ deps = googletest_deps + [
+ angle_root + ":angle_util_static",
+ angle_root + ":libANGLE",
+ angle_root + ":libEGL_static",
+ angle_root + ":libGLESv2_static",
+ angle_root + ":preprocessor",
+ angle_root + ":translator",
+ ]
}
}
@@ -277,14 +246,13 @@
sources = angle_white_box_perf_tests_sources
- deps = [
- angle_root + ":angle_util_static",
- angle_root + ":libANGLE",
- angle_root + ":libEGL_static",
- angle_root + ":libGLESv2_static",
- angle_root + "/third_party/jsoncpp:jsoncpp",
- ":angle_perftests_main",
- ]
+ deps = googletest_deps + [
+ angle_root + ":angle_util_static",
+ angle_root + ":libANGLE",
+ angle_root + ":libEGL_static",
+ angle_root + ":libGLESv2_static",
+ angle_root + "/third_party/jsoncpp:jsoncpp",
+ ]
if (is_android) {
use_native_activity = true
@@ -301,10 +269,16 @@
public_configs = [ "$angle_root/third_party/glslang:glslang_config" ]
}
+ if (build_with_chromium) {
+ sources += [ "//gpu/angle_perftests_main.cc" ]
+ } else {
+ sources += [ "angle_perftests_main.cpp" ]
+ }
+
configs += [
angle_root + ":internal_config",
+ angle_root + ":gl_prototypes",
angle_root + ":libANGLE_config",
- angle_root + ":library_name_config",
]
if (is_linux && !is_component_build) {
@@ -322,29 +296,29 @@
sources = angle_perf_tests_sources
- deps = [
- angle_root + "/third_party/jsoncpp:jsoncpp",
- angle_root + ":angle_common",
- angle_root + ":angle_system_utils",
- angle_root + ":angle_util",
- angle_root + ":angle_util_loader_headers",
- ":angle_perftests_main",
- ]
-
- data_deps = [
- angle_root + ":libEGL${angle_libs_suffix}",
- angle_root + ":libGLESv2${angle_libs_suffix}",
- ]
+ deps = googletest_deps + [
+ angle_root + ":angle_common",
+ angle_root + ":angle_util_static",
+ angle_root + ":libEGL${angle_libs_suffix}",
+ angle_root + ":libGLESv2${angle_libs_suffix}",
+ angle_root + "/third_party/jsoncpp:jsoncpp",
+ ]
if (is_android) {
use_native_activity = true
configs -= [ "//build/config/android:hide_all_but_jni" ]
}
+ if (build_with_chromium) {
+ sources += [ "//gpu/angle_perftests_main.cc" ]
+ } else {
+ sources += [ "angle_perftests_main.cpp" ]
+ }
+
configs += [
angle_root + ":internal_config",
+ angle_root + ":gl_prototypes",
angle_root + ":libANGLE_config",
- angle_root + ":library_name_config",
]
if (is_linux && !is_component_build) {
@@ -376,6 +350,7 @@
"COMMON",
"CONFORM_ALTERNATE_MAIN",
"NULLWS",
+ "GL_GLEXT_PROTOTYPES",
]
cflags = []
@@ -395,29 +370,8 @@
}
}
- source_set("angle_gles1_conformance_no_gtest") {
- configs += [
- ":angle_gles1_conform_support",
- angle_root + ":internal_config",
- ]
-
- public_configs = [
- angle_root + ":angle_util_config",
- angle_root + ":gl_prototypes",
- angle_root + ":angle_static",
- ]
-
- testonly = true
-
- deps = [
- angle_root + ":angle_common",
- angle_root + ":angle_util_static",
- angle_root + ":libEGL_static",
- angle_root + ":libGLESv1_CM_static",
- angle_root + ":libGLESv2_static",
- angle_root + ":preprocessor",
- angle_root + ":translator",
- ]
+ static_library("angle_gles1_conformance_no_gtest") {
+ configs += [ ":angle_gles1_conform_support" ]
sources = [
"$gles1_conform_root/conform/conform/apfunc.c",
@@ -546,17 +500,18 @@
}
test("angle_gles1_conformance_tests") {
- testonly = true
+ deps = googletest_deps + [
+ ":angle_gles1_conformance_no_gtest",
+ angle_root + ":angle_common",
+ angle_root + ":angle_util",
+ angle_root + ":libEGL${angle_libs_suffix}",
+ angle_root + ":libGLESv1_CM${angle_libs_suffix}",
+ angle_root + ":libGLESv2${angle_libs_suffix}",
+ angle_root + ":preprocessor",
+ angle_root + ":translator",
+ ]
- deps = [
- ":angle_end2end_tests_main",
- ":angle_gles1_conformance_no_gtest",
- ]
-
- include_dirs = [
- "../../src/tests",
- angle_root,
- ]
+ include_dirs = [ "../../src/tests" ]
sources = [
"gles1_conformance_tests/ConformanceTests.cpp",
@@ -572,8 +527,14 @@
configs += [
angle_root + ":internal_config",
angle_root + ":libANGLE_config",
- angle_root + ":library_name_config",
+ angle_root + ":gl_prototypes",
]
+
+ if (build_with_chromium) {
+ sources += [ "//gpu/angle_end2end_tests_main.cc" ]
+ } else {
+ sources += [ "angle_end2end_tests_main.cpp" ]
+ }
}
}
@@ -584,21 +545,6 @@
if (build_angle_deqp_tests) {
import("deqp.gni")
- source_set("angle_deqp_tests_main") {
- testonly = true
- public_deps = googletest_deps
-
- if (build_with_chromium) {
- sources = [
- "//gpu/angle_deqp_tests_main.cc",
- ]
- } else {
- sources = [
- "deqp_support/angle_deqp_gtest_main.cpp",
- ]
- }
- }
-
config("angle_deqp_support") {
include_dirs = deqp_include_dirs
if (is_win && !is_clang) {
@@ -744,11 +690,10 @@
source_set("angle_deqp_gtest_support") {
testonly = true
- public_deps = [
- angle_root + ":angle_common",
- angle_root + ":angle_util",
- ":angle_deqp_tests_main",
- ]
+ public_deps = googletest_deps + [
+ angle_root + ":angle_common",
+ angle_root + ":angle_util",
+ ]
public_configs = [ ":angle_deqp_gtest_support_config" ]
@@ -758,6 +703,12 @@
libs = [ "Cocoa.framework" ]
}
+ if (build_with_chromium) {
+ sources += [ "//gpu/angle_deqp_tests_main.cc" ]
+ } else {
+ sources += [ "deqp_support/angle_deqp_gtest_main.cpp" ]
+ }
+
if (!is_android) {
public_deps += [ angle_root + ":angle_gpu_info_util" ]
}
diff --git a/src/tests/deqp_support/angle_deqp_gtest.cpp b/src/tests/deqp_support/angle_deqp_gtest.cpp
index a515469..e3b10a2 100644
--- a/src/tests/deqp_support/angle_deqp_gtest.cpp
+++ b/src/tests/deqp_support/angle_deqp_gtest.cpp
@@ -21,7 +21,7 @@
#include "common/string_utils.h"
#include "gpu_test_expectations_parser.h"
#include "platform/Platform.h"
-#include "util/system_utils.h"
+#include "system_utils.h"
namespace
{
diff --git a/src/tests/deqp_support/angle_deqp_libtester_main.cpp b/src/tests/deqp_support/angle_deqp_libtester_main.cpp
index b792e6a..526735d 100644
--- a/src/tests/deqp_support/angle_deqp_libtester_main.cpp
+++ b/src/tests/deqp_support/angle_deqp_libtester_main.cpp
@@ -13,6 +13,7 @@
#include "deMath.h"
#include "deUniquePtr.hpp"
#include "platform/Platform.h"
+#include "system_utils.h"
#include "tcuApp.hpp"
#include "tcuCommandLine.hpp"
#include "tcuDefs.hpp"
@@ -20,7 +21,6 @@
#include "tcuRandomOrderExecutor.h"
#include "tcuResource.hpp"
#include "tcuTestLog.hpp"
-#include "util/system_utils.h"
#if (DE_OS == DE_OS_WIN32)
# include <Windows.h>
diff --git a/src/tests/deqp_support/tcuANGLENativeDisplayFactory.cpp b/src/tests/deqp_support/tcuANGLENativeDisplayFactory.cpp
index 232bc02..ab788fe 100644
--- a/src/tests/deqp_support/tcuANGLENativeDisplayFactory.cpp
+++ b/src/tests/deqp_support/tcuANGLENativeDisplayFactory.cpp
@@ -25,13 +25,13 @@
#include <EGL/egl.h>
#include <EGL/eglext.h>
+#include "OSPixmap.h"
+#include "OSWindow.h"
#include "deClock.h"
#include "deMemory.h"
#include "egluDefs.hpp"
#include "eglwLibrary.hpp"
#include "tcuTexture.hpp"
-#include "util/OSPixmap.h"
-#include "util/OSWindow.h"
// clang-format off
#if (DE_OS == DE_OS_WIN32)
diff --git a/src/tests/deqp_support/tcuANGLEPlatform.cpp b/src/tests/deqp_support/tcuANGLEPlatform.cpp
index 6b4a25b..ca2c6e1 100644
--- a/src/tests/deqp_support/tcuANGLEPlatform.cpp
+++ b/src/tests/deqp_support/tcuANGLEPlatform.cpp
@@ -24,9 +24,9 @@
#include <EGL/eglext.h>
#include "egluGLContextFactory.hpp"
+#include "system_utils.h"
#include "tcuANGLENativeDisplayFactory.h"
#include "tcuNullContextFactory.hpp"
-#include "util/system_utils.h"
static_assert(EGL_DONT_CARE == -1, "Unexpected value for EGL_DONT_CARE");
diff --git a/src/tests/egl_tests/EGLBlobCacheTest.cpp b/src/tests/egl_tests/EGLBlobCacheTest.cpp
index cd8b478..24e28f0 100644
--- a/src/tests/egl_tests/EGLBlobCacheTest.cpp
+++ b/src/tests/egl_tests/EGLBlobCacheTest.cpp
@@ -8,11 +8,9 @@
#include <map>
#include <vector>
-
#include "common/angleutils.h"
#include "test_utils/ANGLETest.h"
#include "test_utils/gl_raii.h"
-#include "util/EGLWindow.h"
using namespace angle;
diff --git a/src/tests/egl_tests/EGLContextCompatibilityTest.cpp b/src/tests/egl_tests/EGLContextCompatibilityTest.cpp
index 27535d1..6da1e65 100644
--- a/src/tests/egl_tests/EGLContextCompatibilityTest.cpp
+++ b/src/tests/egl_tests/EGLContextCompatibilityTest.cpp
@@ -10,11 +10,13 @@
// rendering works, otherwise it checks an error is generated one MakeCurrent.
#include <gtest/gtest.h>
+#include <EGL/egl.h>
+#include <EGL/eglext.h>
#include <vector>
+#include "OSWindow.h"
#include "test_utils/ANGLETest.h"
#include "test_utils/angle_test_configs.h"
-#include "util/OSWindow.h"
using namespace angle;
@@ -24,16 +26,16 @@
const EGLint contextAttribs[] = {EGL_CONTEXT_CLIENT_VERSION, 2, EGL_NONE};
}
-class EGLContextCompatibilityTest : public EGLTest,
- public testing::WithParamInterface<PlatformParameters>
+class EGLContextCompatibilityTest : public ANGLETest
{
public:
EGLContextCompatibilityTest() : mDisplay(0) {}
void SetUp() override
{
- EGLTest::SetUp();
-
+ PFNEGLGETPLATFORMDISPLAYEXTPROC eglGetPlatformDisplayEXT =
+ reinterpret_cast<PFNEGLGETPLATFORMDISPLAYEXTPROC>(
+ eglGetProcAddress("eglGetPlatformDisplayEXT"));
ASSERT_TRUE(eglGetPlatformDisplayEXT != nullptr);
EGLint dispattrs[] = {EGL_PLATFORM_ANGLE_TYPE_ANGLE, GetParam().getRenderer(), EGL_NONE};
@@ -98,7 +100,7 @@
EGLint colorComponentType1 = EGL_COLOR_COMPONENT_TYPE_FIXED_EXT;
EGLint colorComponentType2 = EGL_COLOR_COMPONENT_TYPE_FIXED_EXT;
- if (IsDisplayExtensionEnabled(mDisplay, "EGL_EXT_pixel_format_float"))
+ if (eglDisplayExtensionEnabled(mDisplay, "EGL_EXT_pixel_format_float"))
{
eglGetConfigAttrib(mDisplay, c1, EGL_COLOR_COMPONENT_TYPE_EXT, &colorComponentType1);
eglGetConfigAttrib(mDisplay, c2, EGL_COLOR_COMPONENT_TYPE_EXT, &colorComponentType2);
@@ -192,7 +194,7 @@
ASSERT_GL_NO_ERROR();
EGLint surfaceCompontentType = EGL_COLOR_COMPONENT_TYPE_FIXED_EXT;
- if (IsDisplayExtensionEnabled(mDisplay, "EGL_EXT_pixel_format_float"))
+ if (eglDisplayExtensionEnabled(mDisplay, "EGL_EXT_pixel_format_float"))
{
eglGetConfigAttrib(mDisplay, surfaceConfig, EGL_COLOR_COMPONENT_TYPE_EXT,
&surfaceCompontentType);
@@ -361,4 +363,4 @@
ES2_OPENGL(),
ES2_OPENGLES(),
ES2_VULKAN());
-#endif // defined(NDEBUG)
\ No newline at end of file
+#endif
diff --git a/src/tests/egl_tests/EGLContextSharingTest.cpp b/src/tests/egl_tests/EGLContextSharingTest.cpp
index 854c215..7bcde68 100644
--- a/src/tests/egl_tests/EGLContextSharingTest.cpp
+++ b/src/tests/egl_tests/EGLContextSharingTest.cpp
@@ -8,9 +8,11 @@
#include <gtest/gtest.h>
+#include <EGL/egl.h>
+#include <EGL/eglext.h>
+
#include "test_utils/ANGLETest.h"
#include "test_utils/angle_test_configs.h"
-#include "util/EGLWindow.h"
using namespace angle;
diff --git a/src/tests/egl_tests/EGLDebugTest.cpp b/src/tests/egl_tests/EGLDebugTest.cpp
index 07eeee3..7dcb196 100644
--- a/src/tests/egl_tests/EGLDebugTest.cpp
+++ b/src/tests/egl_tests/EGLDebugTest.cpp
@@ -8,9 +8,11 @@
#include <gtest/gtest.h>
+#include <EGL/egl.h>
+#include <EGL/eglext.h>
+
#include "test_utils/ANGLETest.h"
#include "test_utils/angle_test_configs.h"
-#include "util/EGLWindow.h"
namespace angle
{
diff --git a/src/tests/egl_tests/EGLDeviceTest.cpp b/src/tests/egl_tests/EGLDeviceTest.cpp
index 29e1cc4..7cc585c 100644
--- a/src/tests/egl_tests/EGLDeviceTest.cpp
+++ b/src/tests/egl_tests/EGLDeviceTest.cpp
@@ -14,15 +14,13 @@
#include <d3d11.h>
+#include "OSWindow.h"
+#include "com_utils.h"
#include "test_utils/ANGLETest.h"
-#include "util/EGLWindow.h"
-#include "util/OSWindow.h"
-#include "util/com_utils.h"
-#include "util/gles_loader_autogen.h"
using namespace angle;
-class EGLDeviceCreationTest : public EGLTest
+class EGLDeviceCreationTest : public testing::Test
{
protected:
EGLDeviceCreationTest()
@@ -41,8 +39,6 @@
void SetUp() override
{
- EGLTest::SetUp();
-
mD3D11Module = LoadLibrary(TEXT("d3d11.dll"));
if (mD3D11Module == nullptr)
{
@@ -233,8 +229,13 @@
CreateD3D11Device();
+ PFNEGLCREATEDEVICEANGLEPROC createDeviceANGLE =
+ (PFNEGLCREATEDEVICEANGLEPROC)eglGetProcAddress("eglCreateDeviceANGLE");
+ PFNEGLRELEASEDEVICEANGLEPROC releaseDeviceANGLE =
+ (PFNEGLRELEASEDEVICEANGLEPROC)eglGetProcAddress("eglReleaseDeviceANGLE");
+
EGLDeviceEXT eglDevice =
- eglCreateDeviceANGLE(EGL_D3D11_DEVICE_ANGLE, reinterpret_cast<void *>(mDevice), nullptr);
+ createDeviceANGLE(EGL_D3D11_DEVICE_ANGLE, reinterpret_cast<void *>(mDevice), nullptr);
ASSERT_NE(EGL_NO_DEVICE_EXT, eglDevice);
ASSERT_EGL_SUCCESS();
@@ -245,7 +246,7 @@
ID3D11Device *queriedDevice = reinterpret_cast<ID3D11Device *>(deviceAttrib);
ASSERT_EQ(mFeatureLevel, queriedDevice->GetFeatureLevel());
- eglReleaseDeviceANGLE(eglDevice);
+ releaseDeviceANGLE(eglDevice);
}
// Test that creating a EGLDeviceEXT from D3D11 device works, and can be used for rendering
@@ -448,6 +449,9 @@
protected:
EGLDeviceQueryTest()
{
+ mQueryDisplayAttribEXT = nullptr;
+ mQueryDeviceAttribEXT = nullptr;
+ mQueryDeviceStringEXT = nullptr;
}
void SetUp() override
@@ -456,20 +460,29 @@
const char *extensionString =
static_cast<const char *>(eglQueryString(getEGLWindow()->getDisplay(), EGL_EXTENSIONS));
+ if (strstr(extensionString, "EGL_EXT_device_query"))
+ {
+ mQueryDisplayAttribEXT =
+ (PFNEGLQUERYDISPLAYATTRIBEXTPROC)eglGetProcAddress("eglQueryDisplayAttribEXT");
+ mQueryDeviceAttribEXT =
+ (PFNEGLQUERYDEVICEATTRIBEXTPROC)eglGetProcAddress("eglQueryDeviceAttribEXT");
+ mQueryDeviceStringEXT =
+ (PFNEGLQUERYDEVICESTRINGEXTPROC)eglGetProcAddress("eglQueryDeviceStringEXT");
+ }
- if (!eglQueryDeviceStringEXT)
+ if (!mQueryDeviceStringEXT)
{
FAIL() << "ANGLE extension EGL_EXT_device_query export eglQueryDeviceStringEXT was not "
"found";
}
- if (!eglQueryDisplayAttribEXT)
+ if (!mQueryDisplayAttribEXT)
{
FAIL() << "ANGLE extension EGL_EXT_device_query export eglQueryDisplayAttribEXT was "
"not found";
}
- if (!eglQueryDeviceAttribEXT)
+ if (!mQueryDeviceAttribEXT)
{
FAIL() << "ANGLE extension EGL_EXT_device_query export eglQueryDeviceAttribEXT was not "
"found";
@@ -477,14 +490,20 @@
EGLAttrib angleDevice = 0;
EXPECT_EGL_TRUE(
- eglQueryDisplayAttribEXT(getEGLWindow()->getDisplay(), EGL_DEVICE_EXT, &angleDevice));
+ mQueryDisplayAttribEXT(getEGLWindow()->getDisplay(), EGL_DEVICE_EXT, &angleDevice));
extensionString = static_cast<const char *>(
- eglQueryDeviceStringEXT(reinterpret_cast<EGLDeviceEXT>(angleDevice), EGL_EXTENSIONS));
+ mQueryDeviceStringEXT(reinterpret_cast<EGLDeviceEXT>(angleDevice), EGL_EXTENSIONS));
if (strstr(extensionString, "EGL_ANGLE_device_d3d") == nullptr)
{
FAIL() << "ANGLE extension EGL_ANGLE_device_d3d was not found";
}
}
+
+ void TearDown() override { ANGLETest::TearDown(); }
+
+ PFNEGLQUERYDISPLAYATTRIBEXTPROC mQueryDisplayAttribEXT;
+ PFNEGLQUERYDEVICEATTRIBEXTPROC mQueryDeviceAttribEXT;
+ PFNEGLQUERYDEVICESTRINGEXTPROC mQueryDeviceStringEXT;
};
// This test attempts to obtain a D3D11 device and a D3D9 device using the eglQueryDeviceAttribEXT
@@ -498,9 +517,9 @@
if (getPlatformRenderer() == EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE)
{
EXPECT_EGL_TRUE(
- eglQueryDisplayAttribEXT(getEGLWindow()->getDisplay(), EGL_DEVICE_EXT, &angleDevice));
- EXPECT_EGL_TRUE(eglQueryDeviceAttribEXT(reinterpret_cast<EGLDeviceEXT>(angleDevice),
- EGL_D3D11_DEVICE_ANGLE, &device));
+ mQueryDisplayAttribEXT(getEGLWindow()->getDisplay(), EGL_DEVICE_EXT, &angleDevice));
+ EXPECT_EGL_TRUE(mQueryDeviceAttribEXT(reinterpret_cast<EGLDeviceEXT>(angleDevice),
+ EGL_D3D11_DEVICE_ANGLE, &device));
ID3D11Device *d3d11Device = reinterpret_cast<ID3D11Device *>(device);
IDXGIDevice *dxgiDevice = DynamicCastComObject<IDXGIDevice>(d3d11Device);
EXPECT_TRUE(dxgiDevice != nullptr);
@@ -510,9 +529,9 @@
if (getPlatformRenderer() == EGL_PLATFORM_ANGLE_TYPE_D3D9_ANGLE)
{
EXPECT_EGL_TRUE(
- eglQueryDisplayAttribEXT(getEGLWindow()->getDisplay(), EGL_DEVICE_EXT, &angleDevice));
- EXPECT_EGL_TRUE(eglQueryDeviceAttribEXT(reinterpret_cast<EGLDeviceEXT>(angleDevice),
- EGL_D3D9_DEVICE_ANGLE, &device));
+ mQueryDisplayAttribEXT(getEGLWindow()->getDisplay(), EGL_DEVICE_EXT, &angleDevice));
+ EXPECT_EGL_TRUE(mQueryDeviceAttribEXT(reinterpret_cast<EGLDeviceEXT>(angleDevice),
+ EGL_D3D9_DEVICE_ANGLE, &device));
IDirect3DDevice9 *d3d9Device = reinterpret_cast<IDirect3DDevice9 *>(device);
IDirect3D9 *d3d9 = nullptr;
EXPECT_EQ(S_OK, d3d9Device->GetDirect3D(&d3d9));
@@ -532,17 +551,17 @@
if (getPlatformRenderer() == EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE)
{
EXPECT_EGL_TRUE(
- eglQueryDisplayAttribEXT(getEGLWindow()->getDisplay(), EGL_DEVICE_EXT, &angleDevice));
- EXPECT_EGL_FALSE(eglQueryDeviceAttribEXT(reinterpret_cast<EGLDeviceEXT>(angleDevice),
- EGL_D3D9_DEVICE_ANGLE, &device));
+ mQueryDisplayAttribEXT(getEGLWindow()->getDisplay(), EGL_DEVICE_EXT, &angleDevice));
+ EXPECT_EGL_FALSE(mQueryDeviceAttribEXT(reinterpret_cast<EGLDeviceEXT>(angleDevice),
+ EGL_D3D9_DEVICE_ANGLE, &device));
}
if (getPlatformRenderer() == EGL_PLATFORM_ANGLE_TYPE_D3D9_ANGLE)
{
EXPECT_EGL_TRUE(
- eglQueryDisplayAttribEXT(getEGLWindow()->getDisplay(), EGL_DEVICE_EXT, &angleDevice));
- EXPECT_EGL_FALSE(eglQueryDeviceAttribEXT(reinterpret_cast<EGLDeviceEXT>(angleDevice),
- EGL_D3D11_DEVICE_ANGLE, &device));
+ mQueryDisplayAttribEXT(getEGLWindow()->getDisplay(), EGL_DEVICE_EXT, &angleDevice));
+ EXPECT_EGL_FALSE(mQueryDeviceAttribEXT(reinterpret_cast<EGLDeviceEXT>(angleDevice),
+ EGL_D3D11_DEVICE_ANGLE, &device));
}
}
@@ -551,7 +570,7 @@
// - extracting the EGLDeviceEXT from the EGLDisplay
// - calling getPlatformDisplayEXT with this EGLDeviceEXT
// results in the same EGLDisplay being returned from getPlatformDisplayEXT both times
-TEST_P(EGLDeviceQueryTest, GetPlatformDisplayDeviceReuse)
+TEST_P(EGLDeviceQueryTest, getPlatformDisplayDeviceReuse)
{
EGLAttrib eglDevice = 0;
EXPECT_EGL_TRUE(
diff --git a/src/tests/egl_tests/EGLDirectCompositionTest.cpp b/src/tests/egl_tests/EGLDirectCompositionTest.cpp
index 9df0a69..da69fe9 100644
--- a/src/tests/egl_tests/EGLDirectCompositionTest.cpp
+++ b/src/tests/egl_tests/EGLDirectCompositionTest.cpp
@@ -7,6 +7,8 @@
// EGLDirectCompositionTest.cpp:
// Tests pertaining to DirectComposition and WindowsUIComposition.
+#include <EGL/egl.h>
+#include <EGL/eglext.h>
#include <d3d11.h>
#include "test_utils/ANGLETest.h"
@@ -19,10 +21,10 @@
#include <wrl.h>
#include <memory>
+#include "OSWindow.h"
+#include "com_utils.h"
#include "libANGLE/renderer/d3d/d3d11/converged/CompositorNativeWindow11.h"
#include "test_utils/ANGLETest.h"
-#include "util/OSWindow.h"
-#include "util/com_utils.h"
using namespace angle;
using namespace ABI::Windows::System;
diff --git a/src/tests/egl_tests/EGLIOSurfaceClientBufferTest.cpp b/src/tests/egl_tests/EGLIOSurfaceClientBufferTest.cpp
index 3984067..ce459fe 100644
--- a/src/tests/egl_tests/EGLIOSurfaceClientBufferTest.cpp
+++ b/src/tests/egl_tests/EGLIOSurfaceClientBufferTest.cpp
@@ -10,7 +10,6 @@
#include "common/mathutil.h"
#include "test_utils/gl_raii.h"
-#include "util/EGLWindow.h"
#include <CoreFoundation/CoreFoundation.h>
#include <IOSurface/IOSurface.h>
diff --git a/src/tests/egl_tests/EGLPresentPathD3D11Test.cpp b/src/tests/egl_tests/EGLPresentPathD3D11Test.cpp
index 988b498..b234d58 100644
--- a/src/tests/egl_tests/EGLPresentPathD3D11Test.cpp
+++ b/src/tests/egl_tests/EGLPresentPathD3D11Test.cpp
@@ -8,13 +8,12 @@
#include <d3d11.h>
#include <cstdint>
-
-#include "util/OSWindow.h"
-#include "util/com_utils.h"
+#include "OSWindow.h"
+#include "com_utils.h"
using namespace angle;
-class EGLPresentPathD3D11 : public EGLTest, public testing::WithParamInterface<PlatformParameters>
+class EGLPresentPathD3D11 : public testing::TestWithParam<PlatformParameters>
{
protected:
EGLPresentPathD3D11()
@@ -29,8 +28,6 @@
void SetUp() override
{
- EGLTest::SetUp();
-
mOSWindow = CreateOSWindow();
mWindowWidth = 64;
mOSWindow->initialize("EGLPresentPathD3D11", mWindowWidth, mWindowWidth);
@@ -40,6 +37,15 @@
{
int clientVersion = GetParam().majorVersion;
+ const char *extensionString =
+ static_cast<const char *>(eglQueryString(EGL_NO_DISPLAY, EGL_EXTENSIONS));
+ ASSERT_NE(nullptr, strstr(extensionString, "EGL_ANGLE_experimental_present_path"));
+
+ PFNEGLGETPLATFORMDISPLAYEXTPROC eglGetPlatformDisplayEXT =
+ reinterpret_cast<PFNEGLGETPLATFORMDISPLAYEXTPROC>(
+ eglGetProcAddress("eglGetPlatformDisplayEXT"));
+ ASSERT_NE(nullptr, eglGetPlatformDisplayEXT);
+
// Set up EGL Display
EGLint displayAttribs[] = {EGL_PLATFORM_ANGLE_TYPE_ANGLE,
GetParam().getRenderer(),
diff --git a/src/tests/egl_tests/EGLProgramCacheControlTest.cpp b/src/tests/egl_tests/EGLProgramCacheControlTest.cpp
index 17bafac..45f46fa 100644
--- a/src/tests/egl_tests/EGLProgramCacheControlTest.cpp
+++ b/src/tests/egl_tests/EGLProgramCacheControlTest.cpp
@@ -9,7 +9,6 @@
#include "common/angleutils.h"
#include "test_utils/ANGLETest.h"
#include "test_utils/gl_raii.h"
-#include "util/EGLWindow.h"
using namespace angle;
diff --git a/src/tests/egl_tests/EGLQueryContextTest.cpp b/src/tests/egl_tests/EGLQueryContextTest.cpp
index 601ab84..f030604 100644
--- a/src/tests/egl_tests/EGLQueryContextTest.cpp
+++ b/src/tests/egl_tests/EGLQueryContextTest.cpp
@@ -6,19 +6,25 @@
#include <gtest/gtest.h>
-#include "test_utils/ANGLETest.h"
+#include <EGL/egl.h>
+#include <EGL/eglext.h>
+
+#include "test_utils/angle_test_configs.h"
using namespace angle;
-class EGLQueryContextTest : public EGLTest, public testing::WithParamInterface<PlatformParameters>
+class EGLQueryContextTest : public testing::TestWithParam<PlatformParameters>
{
public:
void SetUp() override
{
- EGLTest::SetUp();
-
int clientVersion = GetParam().majorVersion;
+ PFNEGLGETPLATFORMDISPLAYEXTPROC eglGetPlatformDisplayEXT =
+ reinterpret_cast<PFNEGLGETPLATFORMDISPLAYEXTPROC>(
+ eglGetProcAddress("eglGetPlatformDisplayEXT"));
+ EXPECT_TRUE(eglGetPlatformDisplayEXT != nullptr);
+
EGLint dispattrs[] = {EGL_PLATFORM_ANGLE_TYPE_ANGLE, GetParam().getRenderer(), EGL_NONE};
mDisplay = eglGetPlatformDisplayEXT(
EGL_PLATFORM_ANGLE_ANGLE, reinterpret_cast<void *>(EGL_DEFAULT_DISPLAY), dispattrs);
diff --git a/src/tests/egl_tests/EGLRobustnessTest.cpp b/src/tests/egl_tests/EGLRobustnessTest.cpp
index ffda16c..26215b8 100644
--- a/src/tests/egl_tests/EGLRobustnessTest.cpp
+++ b/src/tests/egl_tests/EGLRobustnessTest.cpp
@@ -8,23 +8,26 @@
#include <gtest/gtest.h>
+#include <EGL/egl.h>
+#include <EGL/eglext.h>
+
+#include "OSWindow.h"
#include "test_utils/ANGLETest.h"
-#include "util/OSWindow.h"
using namespace angle;
-class EGLRobustnessTest : public EGLTest,
- public ::testing::WithParamInterface<angle::PlatformParameters>
+class EGLRobustnessTest : public ::testing::TestWithParam<angle::PlatformParameters>
{
public:
void SetUp() override
{
- EGLTest::SetUp();
-
mOSWindow = CreateOSWindow();
mOSWindow->initialize("EGLRobustnessTest", 500, 500);
mOSWindow->setVisible(true);
+ auto eglGetPlatformDisplayEXT = reinterpret_cast<PFNEGLGETPLATFORMDISPLAYEXTPROC>(
+ eglGetProcAddress("eglGetPlatformDisplayEXT"));
+
const auto &platform = GetParam().eglParameters;
std::vector<EGLint> displayAttributes;
@@ -96,6 +99,10 @@
const char *extensionString = reinterpret_cast<const char *>(glGetString(GL_EXTENSIONS));
ASSERT_NE(nullptr, strstr(extensionString, "GL_ANGLE_instanced_arrays"));
+
+ mDrawElementsInstancedANGLE =
+ (PFNGLDRAWELEMENTSINSTANCEDANGLEPROC)eglGetProcAddress("glDrawElementsInstancedANGLE");
+ ASSERT_NE(nullptr, mDrawElementsInstancedANGLE);
}
void forceContextReset()
@@ -134,16 +141,17 @@
glViewport(0, 0, mOSWindow->getWidth(), mOSWindow->getHeight());
glClearColor(1.0, 0.0, 0.0, 1.0);
glClear(GL_COLOR_BUFFER_BIT);
- glDrawElementsInstancedANGLE(GL_TRIANGLES, kNumQuads * 6, GL_UNSIGNED_SHORT, indices.data(),
- 10000);
+ mDrawElementsInstancedANGLE(GL_TRIANGLES, kNumQuads * 6, GL_UNSIGNED_SHORT, indices.data(),
+ 10000);
glFinish();
}
protected:
- EGLDisplay mDisplay = EGL_NO_DISPLAY;
- EGLSurface mWindow = EGL_NO_SURFACE;
- bool mInitialized = false;
+ EGLDisplay mDisplay = EGL_NO_DISPLAY;
+ EGLSurface mWindow = EGL_NO_SURFACE;
+ bool mInitialized = false;
+ PFNGLDRAWELEMENTSINSTANCEDANGLEPROC mDrawElementsInstancedANGLE = nullptr;
private:
EGLContext mContext = EGL_NO_CONTEXT;
diff --git a/src/tests/egl_tests/EGLSanityCheckTest.cpp b/src/tests/egl_tests/EGLSanityCheckTest.cpp
index e47cbe8..5c19eb8 100644
--- a/src/tests/egl_tests/EGLSanityCheckTest.cpp
+++ b/src/tests/egl_tests/EGLSanityCheckTest.cpp
@@ -11,11 +11,8 @@
#include "test_utils/ANGLETest.h"
-class EGLSanityCheckTest : public EGLTest
-{};
-
// Checks the tests are running against ANGLE
-TEST_F(EGLSanityCheckTest, IsRunningOnANGLE)
+TEST(EGLSanityCheckTest, IsRunningOnANGLE)
{
const char *extensionString =
static_cast<const char *>(eglQueryString(EGL_NO_DISPLAY, EGL_EXTENSIONS));
@@ -23,13 +20,17 @@
}
// Checks that getting function pointer works
-TEST_F(EGLSanityCheckTest, HasGetPlatformDisplayEXT)
+TEST(EGLSanityCheckTest, HasGetPlatformDisplayEXT)
{
+ PFNEGLGETPLATFORMDISPLAYEXTPROC eglGetPlatformDisplayEXT =
+ reinterpret_cast<PFNEGLGETPLATFORMDISPLAYEXTPROC>(
+ eglGetProcAddress("eglGetPlatformDisplayEXT"));
+
ASSERT_NE(eglGetPlatformDisplayEXT, nullptr);
}
// Checks that calling GetProcAddress for a non-existant function fails.
-TEST_F(EGLSanityCheckTest, GetProcAddressNegativeTest)
+TEST(EGLSanityCheckTest, GetProcAddressNegativeTest)
{
auto check = eglGetProcAddress("WigglyWombats");
EXPECT_EQ(nullptr, check);
diff --git a/src/tests/egl_tests/EGLStreamTest.cpp b/src/tests/egl_tests/EGLStreamTest.cpp
index 3310be3..cfa27a4 100644
--- a/src/tests/egl_tests/EGLStreamTest.cpp
+++ b/src/tests/egl_tests/EGLStreamTest.cpp
@@ -11,11 +11,10 @@
#include <vector>
+#include "OSWindow.h"
#include "media/yuvtest.inl"
#include "test_utils/ANGLETest.h"
#include "test_utils/gl_raii.h"
-#include "util/EGLWindow.h"
-#include "util/OSWindow.h"
using namespace angle;
diff --git a/src/tests/egl_tests/EGLSurfaceTest.cpp b/src/tests/egl_tests/EGLSurfaceTest.cpp
index 875af46..9fc79a8 100644
--- a/src/tests/egl_tests/EGLSurfaceTest.cpp
+++ b/src/tests/egl_tests/EGLSurfaceTest.cpp
@@ -11,9 +11,8 @@
#include <vector>
+#include "OSWindow.h"
#include "test_utils/ANGLETest.h"
-#include "util/EGLWindow.h"
-#include "util/OSWindow.h"
#if defined(ANGLE_ENABLE_D3D11)
# define INITGUID
@@ -26,7 +25,7 @@
namespace
{
-class EGLSurfaceTest : public EGLTest
+class EGLSurfaceTest : public testing::Test
{
protected:
EGLSurfaceTest()
@@ -40,8 +39,6 @@
void SetUp() override
{
- EGLTest::SetUp();
-
mOSWindow = CreateOSWindow();
mOSWindow->initialize("EGLSurfaceTest", 64, 64);
}
diff --git a/src/tests/egl_tests/EGLSurfacelessContextTest.cpp b/src/tests/egl_tests/EGLSurfacelessContextTest.cpp
index e788fa6..ef42f1a 100644
--- a/src/tests/egl_tests/EGLSurfacelessContextTest.cpp
+++ b/src/tests/egl_tests/EGLSurfacelessContextTest.cpp
@@ -9,6 +9,9 @@
#include <gtest/gtest.h>
+#include <EGL/egl.h>
+#include <EGL/eglext.h>
+
#include "test_utils/ANGLETest.h"
#include "test_utils/angle_test_configs.h"
#include "test_utils/gl_raii.h"
@@ -25,7 +28,10 @@
void SetUp() override
{
- ANGLETest::SetUp();
+ PFNEGLGETPLATFORMDISPLAYEXTPROC eglGetPlatformDisplayEXT =
+ reinterpret_cast<PFNEGLGETPLATFORMDISPLAYEXTPROC>(
+ eglGetProcAddress("eglGetPlatformDisplayEXT"));
+ ASSERT_TRUE(eglGetPlatformDisplayEXT != nullptr);
EGLint dispattrs[] = {EGL_PLATFORM_ANGLE_TYPE_ANGLE, GetParam().getRenderer(), EGL_NONE};
mDisplay = eglGetPlatformDisplayEXT(
diff --git a/src/tests/egl_tests/EGLSyncControlTest.cpp b/src/tests/egl_tests/EGLSyncControlTest.cpp
index 33855b4..ef6cb04 100644
--- a/src/tests/egl_tests/EGLSyncControlTest.cpp
+++ b/src/tests/egl_tests/EGLSyncControlTest.cpp
@@ -7,11 +7,13 @@
// EGLSyncControlTest.cpp:
// Tests pertaining to eglGetSyncValuesCHROMIUM.
+#include <EGL/egl.h>
+#include <EGL/eglext.h>
#include <d3d11.h>
+#include "OSWindow.h"
+#include "com_utils.h"
#include "test_utils/ANGLETest.h"
-#include "util/OSWindow.h"
-#include "util/com_utils.h"
using namespace angle;
diff --git a/src/tests/egl_tests/EGLThreadTest.cpp b/src/tests/egl_tests/EGLThreadTest.cpp
index bf9d6f4..965f21a 100644
--- a/src/tests/egl_tests/EGLThreadTest.cpp
+++ b/src/tests/egl_tests/EGLThreadTest.cpp
@@ -5,14 +5,15 @@
//
// EGLThreadTest.h: Tests multi-threaded uses of EGL.
-#include <gtest/gtest.h>
-
-#include "test_utils/ANGLETest.h"
-#include "util/system_utils.h"
+#include "gtest/gtest.h"
+#include "system_utils.h"
#include <thread>
-class EGLThreadTest : public EGLTest
+#include <EGL/egl.h>
+#include <EGL/eglext.h>
+
+class EGLThreadTest : public testing::Test
{
public:
void threadingTest();
diff --git a/src/tests/egl_tests/EGLX11VisualTest.cpp b/src/tests/egl_tests/EGLX11VisualTest.cpp
index c6e3250..317df69 100644
--- a/src/tests/egl_tests/EGLX11VisualTest.cpp
+++ b/src/tests/egl_tests/EGLX11VisualTest.cpp
@@ -12,9 +12,9 @@
#include <EGL/eglext.h>
#include <X11/Xlib.h>
+#include "OSWindow.h"
#include "test_utils/ANGLETest.h"
-#include "util/OSWindow.h"
-#include "util/x11/X11Window.h"
+#include "x11/X11Window.h"
using namespace angle;
@@ -24,13 +24,14 @@
const EGLint contextAttribs[] = {EGL_CONTEXT_CLIENT_VERSION, 2, EGL_NONE};
}
-class EGLX11VisualHintTest : public EGLTest,
- public ::testing::WithParamInterface<angle::PlatformParameters>
+class EGLX11VisualHintTest : public ::testing::TestWithParam<angle::PlatformParameters>
{
public:
void SetUp() override
{
- EGLTest::SetUp();
+ mEglGetPlatformDisplayEXT = reinterpret_cast<PFNEGLGETPLATFORMDISPLAYEXTPROC>(
+ eglGetProcAddress("eglGetPlatformDisplayEXT"));
+
mDisplay = XOpenDisplay(nullptr);
}
@@ -67,11 +68,12 @@
}
}
- EXPECT_TRUE(false);
+ UNREACHABLE();
return -1;
}
protected:
+ PFNEGLGETPLATFORMDISPLAYEXTPROC mEglGetPlatformDisplayEXT;
Display *mDisplay;
};
@@ -82,7 +84,7 @@
auto attributes = getDisplayAttributes(gInvalidVisualId);
EGLDisplay display =
- eglGetPlatformDisplayEXT(EGL_PLATFORM_ANGLE_ANGLE, EGL_DEFAULT_DISPLAY, attributes.data());
+ mEglGetPlatformDisplayEXT(EGL_PLATFORM_ANGLE_ANGLE, EGL_DEFAULT_DISPLAY, attributes.data());
ASSERT_TRUE(display != EGL_NO_DISPLAY);
ASSERT_TRUE(EGL_FALSE == eglInitialize(display, nullptr, nullptr));
@@ -107,7 +109,7 @@
auto attributes = getDisplayAttributes(visualId);
EGLDisplay display =
- eglGetPlatformDisplayEXT(EGL_PLATFORM_ANGLE_ANGLE, EGL_DEFAULT_DISPLAY, attributes.data());
+ mEglGetPlatformDisplayEXT(EGL_PLATFORM_ANGLE_ANGLE, EGL_DEFAULT_DISPLAY, attributes.data());
ASSERT_NE(EGL_NO_DISPLAY, display);
ASSERT_TRUE(EGL_TRUE == eglInitialize(display, nullptr, nullptr));
@@ -180,7 +182,7 @@
auto attributes = getDisplayAttributes(visualId);
EGLDisplay display =
- eglGetPlatformDisplayEXT(EGL_PLATFORM_ANGLE_ANGLE, EGL_DEFAULT_DISPLAY, attributes.data());
+ mEglGetPlatformDisplayEXT(EGL_PLATFORM_ANGLE_ANGLE, EGL_DEFAULT_DISPLAY, attributes.data());
ASSERT_NE(EGL_NO_DISPLAY, display);
ASSERT_TRUE(EGL_TRUE == eglInitialize(display, nullptr, nullptr));
diff --git a/src/tests/gl_tests/AttributeLayoutTest.cpp b/src/tests/gl_tests/AttributeLayoutTest.cpp
index 1feceee..c21ae16 100644
--- a/src/tests/gl_tests/AttributeLayoutTest.cpp
+++ b/src/tests/gl_tests/AttributeLayoutTest.cpp
@@ -167,7 +167,7 @@
template <class T>
void Store(double value, void *dest)
{
- T v = static_cast<T>(value);
+ T v = value;
memcpy(dest, &v, sizeof(v));
}
diff --git a/src/tests/gl_tests/BindUniformLocationTest.cpp b/src/tests/gl_tests/BindUniformLocationTest.cpp
index 5a561c0..d6fab5e 100644
--- a/src/tests/gl_tests/BindUniformLocationTest.cpp
+++ b/src/tests/gl_tests/BindUniformLocationTest.cpp
@@ -29,6 +29,13 @@
setConfigAlphaBits(8);
}
+ void SetUp() override
+ {
+ ANGLETest::SetUp();
+ mBindUniformLocation = reinterpret_cast<PFNGLBINDUNIFORMLOCATIONCHROMIUMPROC>(
+ eglGetProcAddress("glBindUniformLocationCHROMIUM"));
+ }
+
void TearDown() override
{
if (mProgram != 0)
@@ -38,6 +45,11 @@
ANGLETest::TearDown();
}
+ typedef void(GL_APIENTRYP PFNGLBINDUNIFORMLOCATIONCHROMIUMPROC)(GLuint mProgram,
+ GLint location,
+ const GLchar *name);
+ PFNGLBINDUNIFORMLOCATIONCHROMIUMPROC mBindUniformLocation = nullptr;
+
GLuint mProgram = 0;
};
@@ -46,6 +58,8 @@
{
ANGLE_SKIP_TEST_IF(!extensionEnabled("GL_CHROMIUM_bind_uniform_location"));
+ ASSERT_NE(mBindUniformLocation, nullptr);
+
constexpr char kFS[] = R"(precision mediump float;
uniform vec4 u_colorC;
uniform vec4 u_colorB[2];
@@ -60,9 +74,9 @@
GLint colorCLocation = 5;
mProgram = CompileProgram(essl1_shaders::vs::Simple(), kFS, [&](GLuint program) {
- glBindUniformLocationCHROMIUM(program, colorALocation, "u_colorA");
- glBindUniformLocationCHROMIUM(program, colorBLocation, "u_colorB[0]");
- glBindUniformLocationCHROMIUM(program, colorCLocation, "u_colorC");
+ mBindUniformLocation(program, colorALocation, "u_colorA");
+ mBindUniformLocation(program, colorBLocation, "u_colorB[0]");
+ mBindUniformLocation(program, colorCLocation, "u_colorC");
});
ASSERT_NE(0u, mProgram);
@@ -87,6 +101,8 @@
{
ANGLE_SKIP_TEST_IF(!extensionEnabled("GL_CHROMIUM_bind_uniform_location"));
+ ASSERT_NE(mBindUniformLocation, nullptr);
+
constexpr char kFS[] = R"(precision mediump float;
uniform vec4 u_colorA;
uniform vec4 u_colorB[2];
@@ -101,9 +117,9 @@
GLint samplerLocation = 1;
mProgram = CompileProgram(essl1_shaders::vs::Simple(), kFS, [&](GLuint program) {
- glBindUniformLocationCHROMIUM(program, colorALocation, "u_colorA");
- glBindUniformLocationCHROMIUM(program, colorBLocation, "u_colorB[0]");
- glBindUniformLocationCHROMIUM(program, samplerLocation, "u_sampler");
+ mBindUniformLocation(program, colorALocation, "u_colorA");
+ mBindUniformLocation(program, colorBLocation, "u_colorB[0]");
+ mBindUniformLocation(program, samplerLocation, "u_sampler");
});
ASSERT_NE(0u, mProgram);
@@ -136,6 +152,8 @@
{
ANGLE_SKIP_TEST_IF(!extensionEnabled("GL_CHROMIUM_bind_uniform_location"));
+ ASSERT_NE(nullptr, mBindUniformLocation);
+
constexpr char kFS[] =
R"(precision mediump float;
uniform vec4 u_colorA;
@@ -157,16 +175,16 @@
glAttachShader(mProgram, fs);
glDeleteShader(fs);
- glBindUniformLocationCHROMIUM(mProgram, colorALocation, "u_colorA");
+ mBindUniformLocation(mProgram, colorALocation, "u_colorA");
// Bind u_colorB to location a, causing conflicts, link should fail.
- glBindUniformLocationCHROMIUM(mProgram, colorALocation, "u_colorB");
+ mBindUniformLocation(mProgram, colorALocation, "u_colorB");
glLinkProgram(mProgram);
GLint linked = 0;
glGetProgramiv(mProgram, GL_LINK_STATUS, &linked);
ASSERT_EQ(0, linked);
// Bind u_colorB to location b, no conflicts, link should succeed.
- glBindUniformLocationCHROMIUM(mProgram, colorBLocation, "u_colorB");
+ mBindUniformLocation(mProgram, colorBLocation, "u_colorB");
glLinkProgram(mProgram);
linked = 0;
glGetProgramiv(mProgram, GL_LINK_STATUS, &linked);
@@ -178,6 +196,8 @@
{
ANGLE_SKIP_TEST_IF(!extensionEnabled("GL_CHROMIUM_bind_uniform_location"));
+ ASSERT_NE(nullptr, mBindUniformLocation);
+
constexpr char kVS[] =
R"(attribute vec4 a_position;
attribute vec2 a_texCoord;
@@ -224,12 +244,12 @@
int colorCLocation = counter++;
mProgram = CompileProgram(kVS, kFS, [&](GLuint program) {
- glBindUniformLocationCHROMIUM(program, matrixLocation, "matrix");
- glBindUniformLocationCHROMIUM(program, colorALocation, "color_a");
- glBindUniformLocationCHROMIUM(program, colorBLocation, "color_b");
- glBindUniformLocationCHROMIUM(program, alphaLocation, "alpha");
- glBindUniformLocationCHROMIUM(program, multiplierLocation, "multiplier");
- glBindUniformLocationCHROMIUM(program, colorCLocation, "color_c");
+ mBindUniformLocation(program, matrixLocation, "matrix");
+ mBindUniformLocation(program, colorALocation, "color_a");
+ mBindUniformLocation(program, colorBLocation, "color_b");
+ mBindUniformLocation(program, alphaLocation, "alpha");
+ mBindUniformLocation(program, multiplierLocation, "multiplier");
+ mBindUniformLocation(program, colorCLocation, "color_c");
});
ASSERT_NE(0u, mProgram);
@@ -267,7 +287,7 @@
{
ANGLE_SKIP_TEST_IF(!extensionEnabled("GL_CHROMIUM_bind_uniform_location"));
- ASSERT_NE(nullptr, glBindUniformLocationCHROMIUM);
+ ASSERT_NE(nullptr, mBindUniformLocation);
constexpr char kFS[] = R"(precision mediump float;
uniform vec4 u_colorA;
@@ -283,10 +303,10 @@
const GLint unboundLocation = 6;
mProgram = CompileProgram(essl1_shaders::vs::Simple(), kFS, [&](GLuint program) {
- glBindUniformLocationCHROMIUM(program, colorULocation, "u_colorU");
+ mBindUniformLocation(program, colorULocation, "u_colorU");
// The non-existing uniform should behave like existing, but optimized away
// uniform.
- glBindUniformLocationCHROMIUM(program, nonexistingLocation, "nonexisting");
+ mBindUniformLocation(program, nonexistingLocation, "nonexisting");
// Let A and C be assigned automatic locations.
});
ASSERT_NE(0u, mProgram);
@@ -351,6 +371,8 @@
{
ANGLE_SKIP_TEST_IF(!extensionEnabled("GL_CHROMIUM_bind_uniform_location"));
+ ASSERT_NE(nullptr, mBindUniformLocation);
+
constexpr char kFS[] =
R"(uniform sampler2D tex;
void main()
@@ -361,7 +383,7 @@
const GLuint texLocation = 54;
mProgram = CompileProgram(essl1_shaders::vs::Simple(), kFS, [&](GLuint program) {
- glBindUniformLocationCHROMIUM(program, texLocation, "tex");
+ mBindUniformLocation(program, texLocation, "tex");
});
ASSERT_NE(0u, mProgram);
@@ -376,6 +398,8 @@
{
ANGLE_SKIP_TEST_IF(!extensionEnabled("GL_CHROMIUM_bind_uniform_location"));
+ ASSERT_NE(nullptr, mBindUniformLocation);
+
constexpr char kFS[] =
R"(precision mediump float;
uniform vec4 a;
@@ -388,8 +412,8 @@
const GLuint location = 54;
mProgram = CompileProgram(essl1_shaders::vs::Zero(), kFS, [&](GLuint program) {
- glBindUniformLocationCHROMIUM(program, location, "a");
- glBindUniformLocationCHROMIUM(program, location, "b");
+ mBindUniformLocation(program, location, "a");
+ mBindUniformLocation(program, location, "b");
});
ASSERT_NE(0u, mProgram);
@@ -409,7 +433,7 @@
GLint uniformLocation)
{
mProgram = CompileProgram(vs, fs, [&](GLuint program) {
- glBindUniformLocationCHROMIUM(program, uniformLocation, uniformName);
+ mBindUniformLocation(program, uniformLocation, uniformName);
});
}
};
diff --git a/src/tests/gl_tests/BlendFuncExtendedTest.cpp b/src/tests/gl_tests/BlendFuncExtendedTest.cpp
index 940facf..90a2b1c 100644
--- a/src/tests/gl_tests/BlendFuncExtendedTest.cpp
+++ b/src/tests/gl_tests/BlendFuncExtendedTest.cpp
@@ -8,7 +8,7 @@
#include "test_utils/ANGLETest.h"
-#include "util/shader_utils.h"
+#include "shader_utils.h"
#include <algorithm>
#include <cmath>
diff --git a/src/tests/gl_tests/BufferDataTest.cpp b/src/tests/gl_tests/BufferDataTest.cpp
index 4f3651c..6515e93 100644
--- a/src/tests/gl_tests/BufferDataTest.cpp
+++ b/src/tests/gl_tests/BufferDataTest.cpp
@@ -7,7 +7,7 @@
#include "test_utils/ANGLETest.h"
#include "test_utils/gl_raii.h"
-#include "util/random_utils.h"
+#include "random_utils.h"
#include <stdint.h>
@@ -208,7 +208,7 @@
EXPECT_PIXEL_COLOR_EQ(0, 0, GLColor::red);
// Set up color value so black is drawn
- std::fill(data.begin(), data.end(), 0.0f);
+ std::fill(data.begin(), data.end(), 0);
// Update the data, changing back to DYNAMIC mode.
glBufferData(GL_ARRAY_BUFFER, sizeof(GLfloat) * data.size(), data.data(), GL_DYNAMIC_DRAW);
diff --git a/src/tests/gl_tests/ClearTest.cpp b/src/tests/gl_tests/ClearTest.cpp
index 152abba..b42b8ab 100644
--- a/src/tests/gl_tests/ClearTest.cpp
+++ b/src/tests/gl_tests/ClearTest.cpp
@@ -7,9 +7,9 @@
#include "test_utils/ANGLETest.h"
#include "platform/FeaturesVk.h"
+#include "random_utils.h"
+#include "shader_utils.h"
#include "test_utils/gl_raii.h"
-#include "util/random_utils.h"
-#include "util/shader_utils.h"
using namespace angle;
diff --git a/src/tests/gl_tests/CopyTexture3DTest.cpp b/src/tests/gl_tests/CopyTexture3DTest.cpp
index cd3a5ad..47a68e6 100644
--- a/src/tests/gl_tests/CopyTexture3DTest.cpp
+++ b/src/tests/gl_tests/CopyTexture3DTest.cpp
@@ -175,7 +175,7 @@
renderType = GL_RGBA32F;
break;
default:
- ASSERT_TRUE(false);
+ UNREACHABLE();
}
glRenderbufferStorage(GL_RENDERBUFFER, renderType, 1, 1);
@@ -214,27 +214,19 @@
}
else if (renderType == GL_RGBA8UI)
{
- GLuint pixel[4] = {0};
+ GLint pixel[4] = {0};
glReadPixels(0, 0, 1, 1, GL_RGBA_INTEGER, GL_UNSIGNED_INT, pixel);
- EXPECT_COLOR_NEAR(
- expectedColor,
- GLColor(static_cast<GLubyte>(pixel[0]), static_cast<GLubyte>(pixel[1]),
- static_cast<GLubyte>(pixel[2]), static_cast<GLubyte>(pixel[3])),
- 0.2);
+ EXPECT_COLOR_NEAR(expectedColor, GLColor(pixel[0], pixel[1], pixel[2], pixel[3]), 0.2);
}
else if (renderType == GL_RGBA8I)
{
GLint pixel[4] = {0};
glReadPixels(0, 0, 1, 1, GL_RGBA_INTEGER, GL_INT, pixel);
- EXPECT_COLOR_NEAR(
- expectedColor,
- GLColor(static_cast<GLubyte>(pixel[0]), static_cast<GLubyte>(pixel[1]),
- static_cast<GLubyte>(pixel[2]), static_cast<GLubyte>(pixel[3])),
- 0.2);
+ EXPECT_COLOR_NEAR(expectedColor, GLColor(pixel[0], pixel[1], pixel[2], pixel[3]), 0.2);
}
else
{
- ASSERT_TRUE(false);
+ UNREACHABLE();
}
}
diff --git a/src/tests/gl_tests/D3D11EmulatedIndexedBufferTest.cpp b/src/tests/gl_tests/D3D11EmulatedIndexedBufferTest.cpp
index 7cc5e39..c26d755 100644
--- a/src/tests/gl_tests/D3D11EmulatedIndexedBufferTest.cpp
+++ b/src/tests/gl_tests/D3D11EmulatedIndexedBufferTest.cpp
@@ -16,7 +16,6 @@
#include "libANGLE/renderer/d3d/d3d11/Renderer11.h"
#include "test_utils/ANGLETest.h"
#include "test_utils/angle_test_instantiate.h"
-#include "util/EGLWindow.h"
using namespace angle;
diff --git a/src/tests/gl_tests/D3D11FormatTablesTest.cpp b/src/tests/gl_tests/D3D11FormatTablesTest.cpp
index ae34926..4562351 100644
--- a/src/tests/gl_tests/D3D11FormatTablesTest.cpp
+++ b/src/tests/gl_tests/D3D11FormatTablesTest.cpp
@@ -18,7 +18,6 @@
#include "libANGLE/renderer/d3d/d3d11/texture_format_table.h"
#include "test_utils/ANGLETest.h"
#include "test_utils/angle_test_instantiate.h"
-#include "util/EGLWindow.h"
using namespace angle;
diff --git a/src/tests/gl_tests/D3D11InputLayoutCacheTest.cpp b/src/tests/gl_tests/D3D11InputLayoutCacheTest.cpp
index bca7830..3db4740 100644
--- a/src/tests/gl_tests/D3D11InputLayoutCacheTest.cpp
+++ b/src/tests/gl_tests/D3D11InputLayoutCacheTest.cpp
@@ -14,7 +14,6 @@
#include "libANGLE/renderer/d3d/d3d11/Renderer11.h"
#include "test_utils/ANGLETest.h"
#include "test_utils/angle_test_instantiate.h"
-#include "util/EGLWindow.h"
using namespace angle;
diff --git a/src/tests/gl_tests/D3DTextureTest.cpp b/src/tests/gl_tests/D3DTextureTest.cpp
index 55f2ac6..b91ddc6 100644
--- a/src/tests/gl_tests/D3DTextureTest.cpp
+++ b/src/tests/gl_tests/D3DTextureTest.cpp
@@ -12,8 +12,7 @@
#include <d3d11.h>
#include <windows.h>
-#include "util/EGLWindow.h"
-#include "util/com_utils.h"
+#include "com_utils.h"
namespace angle
{
@@ -157,7 +156,7 @@
EGLDisplay display = window->getDisplay();
EGLConfig config = window->getConfig();
- EXPECT_TRUE(mD3D11Device != nullptr);
+ ASSERT(mD3D11Device);
ID3D11Texture2D *texture = nullptr;
CD3D11_TEXTURE2D_DESC desc(format, static_cast<UINT>(width), static_cast<UINT>(height), 1,
1, bindFlags);
@@ -216,8 +215,8 @@
};
// Multisampled textures are not supported on D3D9.
- EXPECT_TRUE(sampleCount <= 1);
- EXPECT_TRUE(sampleQuality == 0);
+ ASSERT(sampleCount <= 1);
+ ASSERT(sampleQuality == 0);
IDirect3DTexture9 *texture = nullptr;
EXPECT_TRUE(SUCCEEDED(mD3D9Device->CreateTexture(
@@ -700,7 +699,7 @@
TEST_P(D3DTextureTest, UnnecessaryWidthHeightAttributes)
{
ANGLE_SKIP_TEST_IF(!valid() || !IsD3D11());
- ASSERT_TRUE(mD3D11Device != nullptr);
+ ASSERT(mD3D11Device);
ID3D11Texture2D *texture = nullptr;
CD3D11_TEXTURE2D_DESC desc(DXGI_FORMAT_R8G8B8A8_UNORM, 1, 1, 1, 1, D3D11_BIND_RENDER_TARGET);
desc.SampleDesc.Count = 1;
diff --git a/src/tests/gl_tests/DepthStencilFormatsTest.cpp b/src/tests/gl_tests/DepthStencilFormatsTest.cpp
index 50235c1..893369e 100644
--- a/src/tests/gl_tests/DepthStencilFormatsTest.cpp
+++ b/src/tests/gl_tests/DepthStencilFormatsTest.cpp
@@ -231,7 +231,7 @@
float viewport[2];
glGetFloatv(GL_MAX_VIEWPORT_DIMS, viewport);
- glViewport(0, 0, static_cast<GLsizei>(viewport[0]), static_cast<GLsizei>(viewport[1]));
+ glViewport(0, 0, viewport[0], viewport[1]);
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, fb);
drawQuad(program.get(), essl1_shaders::PositionAttrib(), 0.0f);
diff --git a/src/tests/gl_tests/ExplicitContextTest.cpp b/src/tests/gl_tests/ExplicitContextTest.cpp
index 1cb974f..d9ad46b 100644
--- a/src/tests/gl_tests/ExplicitContextTest.cpp
+++ b/src/tests/gl_tests/ExplicitContextTest.cpp
@@ -9,7 +9,6 @@
#include "test_utils/ANGLETest.h"
#include "test_utils/gl_raii.h"
-#include "util/EGLWindow.h"
namespace angle
{
@@ -53,9 +52,14 @@
EGLContext context = getEGLWindow()->getContext();
+ PFNGLCLEARCOLORCONTEXTANGLEPROC clearColor = reinterpret_cast<PFNGLCLEARCOLORCONTEXTANGLEPROC>(
+ eglGetProcAddress("glClearColorContextANGLE"));
+ PFNGLCLEARCONTEXTANGLEPROC clear =
+ reinterpret_cast<PFNGLCLEARCONTEXTANGLEPROC>(eglGetProcAddress("glClearContextANGLE"));
+
// Clear to green
- glClearColorContextANGLE(context, 1.0f, 0, 0, 1.0f);
- glClearContextANGLE(context, GL_COLOR_BUFFER_BIT);
+ clearColor(context, 1.0f, 0, 0, 1.0f);
+ clear(context, GL_COLOR_BUFFER_BIT);
// Check for green
EXPECT_PIXEL_EQ(0, 0, 255, 0, 0, 255);
diff --git a/src/tests/gl_tests/FramebufferMultiviewTest.cpp b/src/tests/gl_tests/FramebufferMultiviewTest.cpp
index 420b8ae..6108ad1 100644
--- a/src/tests/gl_tests/FramebufferMultiviewTest.cpp
+++ b/src/tests/gl_tests/FramebufferMultiviewTest.cpp
@@ -73,9 +73,7 @@
void initializeFBOs(size_t numColorBuffers, bool stencil, bool depth)
{
- ASSERT_TRUE(mColorTex.empty());
- ASSERT_EQ(0u, mDepthStencilTex);
- ASSERT_EQ(0u, mDepthTex);
+ ASSERT(mColorTex.empty() && mDepthStencilTex == 0u && mDepthTex == 0u);
const std::vector<GLenum> &drawBuffers = GetDrawBufferRange(numColorBuffers);
// Generate textures.
@@ -217,10 +215,8 @@
bool stencil,
bool depth)
{
- ASSERT_TRUE(mColorTex.empty());
- ASSERT_EQ(0u, mDepthStencilTex);
- ASSERT_EQ(0u, mDepthTex);
- ASSERT_LE(baseViewIndex + numViews, numLayers);
+ ASSERT(mColorTex.empty() && mDepthStencilTex == 0u && mDepthTex == 0u);
+ ASSERT(baseViewIndex + numViews <= numLayers);
// Generate textures.
mColorTex.resize(numColorAttachments);
@@ -278,7 +274,7 @@
GLColor getLayerColor(size_t layer, GLenum attachment, GLint x, GLint y)
{
- EXPECT_LT(layer, mNonMultiviewFBO.size());
+ ASSERT(layer < mNonMultiviewFBO.size());
glBindFramebuffer(GL_FRAMEBUFFER, mNonMultiviewFBO[layer]);
glReadBuffer(attachment);
return angle::ReadColor(x, y);
diff --git a/src/tests/gl_tests/GLSLTest.cpp b/src/tests/gl_tests/GLSLTest.cpp
index 6d35cb2..1905261 100644
--- a/src/tests/gl_tests/GLSLTest.cpp
+++ b/src/tests/gl_tests/GLSLTest.cpp
@@ -4713,8 +4713,7 @@
GLint uniLoc = glGetUniformLocation(program, "viewportSize");
ASSERT_NE(-1, uniLoc);
- glUniform2f(uniLoc, static_cast<GLfloat>(getWindowWidth()),
- static_cast<GLfloat>(getWindowHeight()));
+ glUniform2f(uniLoc, getWindowWidth(), getWindowHeight());
// Draw to backbuffer.
glDrawArrays(GL_POINTS, 0, 1);
@@ -4782,8 +4781,7 @@
GLint uniLoc = glGetUniformLocation(program, "viewportSize");
ASSERT_NE(-1, uniLoc);
- glUniform2f(uniLoc, static_cast<GLfloat>(getWindowWidth()),
- static_cast<GLfloat>(getWindowHeight()));
+ glUniform2f(uniLoc, getWindowWidth(), getWindowHeight());
// Draw to backbuffer.
drawQuad(program, essl1_shaders::PositionAttrib(), 0.5);
diff --git a/src/tests/gl_tests/GeometryShaderTest.cpp b/src/tests/gl_tests/GeometryShaderTest.cpp
index ed28041..ae3a32f 100644
--- a/src/tests/gl_tests/GeometryShaderTest.cpp
+++ b/src/tests/gl_tests/GeometryShaderTest.cpp
@@ -719,7 +719,7 @@
GLint max3DSize;
glGetIntegerv(GL_MAX_3D_TEXTURE_SIZE, &max3DSize);
- GLint max3DLevel = static_cast<GLint>(std::log2(max3DSize));
+ GLint max3DLevel = std::log2(max3DSize);
glFramebufferTextureEXT(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, tex, max3DLevel + 1);
EXPECT_GL_ERROR(GL_INVALID_VALUE);
}
diff --git a/src/tests/gl_tests/ImageTest.cpp b/src/tests/gl_tests/ImageTest.cpp
index a79a075..8c07e5d 100644
--- a/src/tests/gl_tests/ImageTest.cpp
+++ b/src/tests/gl_tests/ImageTest.cpp
@@ -8,7 +8,6 @@
//
#include "test_utils/ANGLETest.h"
-#include "util/EGLWindow.h"
namespace angle
{
diff --git a/src/tests/gl_tests/IndexBufferOffsetTest.cpp b/src/tests/gl_tests/IndexBufferOffsetTest.cpp
index 64dbf6e..8a1a348 100644
--- a/src/tests/gl_tests/IndexBufferOffsetTest.cpp
+++ b/src/tests/gl_tests/IndexBufferOffsetTest.cpp
@@ -6,8 +6,8 @@
// IndexBufferOffsetTest.cpp: Test glDrawElements with an offset and an index buffer
+#include "system_utils.h"
#include "test_utils/ANGLETest.h"
-#include "util/system_utils.h"
using namespace angle;
diff --git a/src/tests/gl_tests/InstancingTest.cpp b/src/tests/gl_tests/InstancingTest.cpp
index 1590b01..0a3f974 100644
--- a/src/tests/gl_tests/InstancingTest.cpp
+++ b/src/tests/gl_tests/InstancingTest.cpp
@@ -83,6 +83,7 @@
// The instance data array selects all the slices in order.
// 'lastDrawn' is the index (zero-based) of the last slice into which we draw.
const unsigned lastDrawn = (numInstance - 1) / divisor;
+ ASSERT(lastDrawn < kMaxDrawn);
const int instanceAttrib = attribZeroInstanced ? 0 : 1;
const int positionAttrib = attribZeroInstanced ? 1 : 0;
@@ -128,12 +129,11 @@
{
for (unsigned i = 0; i < kMaxDrawn; ++i)
{
- float y =
- -1.0f + static_cast<float>(kDrawSize) / 2.0f + static_cast<float>(i * kDrawSize);
- int iy = static_cast<int>((y + 1.0f) / 2.0f * getWindowHeight());
+ float y = -1.0 + kDrawSize / 2.0 + i * kDrawSize;
+ int iy = (y + 1.0) / 2.0 * getWindowHeight();
for (unsigned j = 0; j < 8; j += 2)
{
- int ix = static_cast<int>((kPointVertices[j] + 1.0f) / 2.0f * getWindowWidth());
+ int ix = (kPointVertices[j] + 1.0) / 2.0 * getWindowWidth();
EXPECT_PIXEL_COLOR_EQ(ix, iy, i <= lastDrawn ? GLColor::red : GLColor::blue);
}
}
@@ -305,6 +305,7 @@
const unsigned numInstance = 4;
const unsigned divisor = 1;
const unsigned lastDrawn = (numInstance - 1) / divisor;
+ ASSERT(lastDrawn < kMaxDrawn);
// Set the formats by VertexAttribFormat
glVertexAttribFormat(positionLoc, 2, GL_FLOAT, GL_FALSE, 0);
diff --git a/src/tests/gl_tests/MipmapTest.cpp b/src/tests/gl_tests/MipmapTest.cpp
index 9290f87..bc7ae8c 100644
--- a/src/tests/gl_tests/MipmapTest.cpp
+++ b/src/tests/gl_tests/MipmapTest.cpp
@@ -679,7 +679,7 @@
GLubyte *levels[] = {mLevelZeroBlueInitData.data(), mLevelOneGreenInitData.data(),
mLevelTwoRedInitData.data()};
- int maxLevel = 1 + static_cast<int>(floor(log2(std::max(getWindowWidth(), getWindowHeight()))));
+ int maxLevel = 1 + floor(log2(std::max(getWindowWidth(), getWindowHeight())));
for (int i = 0; i < maxLevel; i++)
{
diff --git a/src/tests/gl_tests/MultiDrawTest.cpp b/src/tests/gl_tests/MultiDrawTest.cpp
index 7dee086..ff0147f 100644
--- a/src/tests/gl_tests/MultiDrawTest.cpp
+++ b/src/tests/gl_tests/MultiDrawTest.cpp
@@ -28,9 +28,8 @@
};
constexpr std::array<uint32_t, 2> kTilePixelSize = {kWidth / kCountX, kHeight / kCountY};
constexpr std::array<GLfloat, 2> kQuadRadius = {0.25f * kTileSize[0], 0.25f * kTileSize[1]};
-constexpr std::array<uint32_t, 2> kPixelCheckSize = {
- static_cast<uint32_t>(kQuadRadius[0] * kWidth),
- static_cast<uint32_t>(kQuadRadius[1] * kHeight)};
+constexpr std::array<uint32_t, 2> kPixelCheckSize = {kQuadRadius[0] * kWidth,
+ kQuadRadius[1] * kHeight};
constexpr std::array<GLfloat, 2> getTileCenter(uint32_t x, uint32_t y)
{
@@ -240,7 +239,7 @@
{
if (getClientMajorVersion() <= 2)
{
- ASSERT_TRUE(extensionEnabled("GL_ANGLE_instanced_arrays"));
+ ASSERT(extensionEnabled("GL_ANGLE_instanced_arrays"));
glVertexAttribDivisorANGLE(location, divisor);
}
else
diff --git a/src/tests/gl_tests/MultithreadingTest.cpp b/src/tests/gl_tests/MultithreadingTest.cpp
index 6b637f9..c87f71f 100644
--- a/src/tests/gl_tests/MultithreadingTest.cpp
+++ b/src/tests/gl_tests/MultithreadingTest.cpp
@@ -8,7 +8,6 @@
#include "test_utils/ANGLETest.h"
#include "test_utils/gl_raii.h"
-#include "util/EGLWindow.h"
#include <mutex>
#include <thread>
diff --git a/src/tests/gl_tests/MultiviewDrawTest.cpp b/src/tests/gl_tests/MultiviewDrawTest.cpp
index 489e1e3..d297e94 100644
--- a/src/tests/gl_tests/MultiviewDrawTest.cpp
+++ b/src/tests/gl_tests/MultiviewDrawTest.cpp
@@ -43,8 +43,8 @@
mMultiviewLayout(multiviewLayout),
mSamples(samples)
{
- EXPECT_TRUE(multiviewLayout == GL_FRAMEBUFFER_MULTIVIEW_LAYERED_ANGLE ||
- multiviewLayout == GL_FRAMEBUFFER_MULTIVIEW_SIDE_BY_SIDE_ANGLE);
+ ASSERT(multiviewLayout == GL_FRAMEBUFFER_MULTIVIEW_LAYERED_ANGLE ||
+ multiviewLayout == GL_FRAMEBUFFER_MULTIVIEW_SIDE_BY_SIDE_ANGLE);
}
GLenum mMultiviewLayout;
int mSamples;
@@ -64,8 +64,7 @@
os << "_side_by_side";
break;
default:
- os << "_error";
- break;
+ UNREACHABLE();
}
if (params.mSamples > 0)
{
@@ -102,7 +101,7 @@
void updateFBOs(int viewWidth, int height, int numViews, int numLayers, int baseViewIndex)
{
- ASSERT_TRUE(numViews + baseViewIndex <= numLayers);
+ ASSERT(numViews + baseViewIndex <= numLayers);
freeFBOs();
@@ -152,7 +151,7 @@
}
break;
default:
- ASSERT_TRUE(false);
+ UNREACHABLE();
}
// Clear the buffers.
@@ -183,7 +182,7 @@
int numLayers = mReadFramebuffer.size();
if (mResolveFramebuffer.empty())
{
- ASSERT_TRUE(mResolveTexture == 0u);
+ ASSERT(mResolveTexture == 0u);
glGenTextures(1, &mResolveTexture);
CreateMultiviewBackingTextures(mMultiviewLayout, 0, mViewWidth, mViewHeight, numLayers,
mResolveTexture, 0u, 0u);
@@ -217,10 +216,10 @@
glBindFramebuffer(GL_READ_FRAMEBUFFER, mReadFramebuffer[0]);
return ReadColor(view * mViewWidth + x, y);
case GL_FRAMEBUFFER_MULTIVIEW_LAYERED_ANGLE:
- EXPECT_TRUE(static_cast<size_t>(view) < mReadFramebuffer.size());
+ ASSERT(static_cast<size_t>(view) < mReadFramebuffer.size());
if (mSamples > 0)
{
- EXPECT_TRUE(static_cast<size_t>(view) < mResolveFramebuffer.size());
+ ASSERT(static_cast<size_t>(view) < mResolveFramebuffer.size());
glBindFramebuffer(GL_READ_FRAMEBUFFER, mResolveFramebuffer[view]);
}
else
@@ -229,7 +228,7 @@
}
return ReadColor(x, y);
default:
- EXPECT_TRUE(false);
+ UNREACHABLE();
}
return GLColor(0, 0, 0, 0);
}
diff --git a/src/tests/gl_tests/OcclusionQueriesTest.cpp b/src/tests/gl_tests/OcclusionQueriesTest.cpp
index e40c41e..9a1515e 100644
--- a/src/tests/gl_tests/OcclusionQueriesTest.cpp
+++ b/src/tests/gl_tests/OcclusionQueriesTest.cpp
@@ -4,10 +4,9 @@
// found in the LICENSE file.
//
+#include "random_utils.h"
+#include "system_utils.h"
#include "test_utils/ANGLETest.h"
-#include "util/EGLWindow.h"
-#include "util/random_utils.h"
-#include "util/system_utils.h"
using namespace angle;
diff --git a/src/tests/gl_tests/ParallelShaderCompileTest.cpp b/src/tests/gl_tests/ParallelShaderCompileTest.cpp
index 17b0abc..1da63e4 100644
--- a/src/tests/gl_tests/ParallelShaderCompileTest.cpp
+++ b/src/tests/gl_tests/ParallelShaderCompileTest.cpp
@@ -8,7 +8,7 @@
#include "test_utils/ANGLETest.h"
-#include "util/random_utils.h"
+#include "random_utils.h"
using namespace angle;
@@ -190,8 +190,7 @@
constexpr int kTaskCount = 32;
for (int i = 0; i < kTaskCount; ++i)
{
- std::unique_ptr<ClearColorWithDraw> task(
- new ClearColorWithDraw(static_cast<GLubyte>(i * 255 / kTaskCount)));
+ std::unique_ptr<ClearColorWithDraw> task(new ClearColorWithDraw(i * 255 / kTaskCount));
bool isCompiling = task->compile();
ASSERT_TRUE(isCompiling);
compileTasks.push_back(std::move(task));
diff --git a/src/tests/gl_tests/PathRenderingTest.cpp b/src/tests/gl_tests/PathRenderingTest.cpp
index 6d6f287..8ece779 100644
--- a/src/tests/gl_tests/PathRenderingTest.cpp
+++ b/src/tests/gl_tests/PathRenderingTest.cpp
@@ -10,7 +10,7 @@
#include "test_utils/ANGLETest.h"
#include "common/angleutils.h"
-#include "util/shader_utils.h"
+#include "shader_utils.h"
#include <cmath>
#include <cstddef>
diff --git a/src/tests/gl_tests/PbufferTest.cpp b/src/tests/gl_tests/PbufferTest.cpp
index 387b8c4..48ccd6e 100644
--- a/src/tests/gl_tests/PbufferTest.cpp
+++ b/src/tests/gl_tests/PbufferTest.cpp
@@ -6,7 +6,6 @@
#include "test_utils/ANGLETest.h"
#include "test_utils/gl_raii.h"
-#include "util/EGLWindow.h"
using namespace angle;
diff --git a/src/tests/gl_tests/ProgramBinaryTest.cpp b/src/tests/gl_tests/ProgramBinaryTest.cpp
index 796a772..7bdfc8c 100644
--- a/src/tests/gl_tests/ProgramBinaryTest.cpp
+++ b/src/tests/gl_tests/ProgramBinaryTest.cpp
@@ -9,11 +9,11 @@
#include <stdint.h>
#include <memory>
+#include "EGLWindow.h"
+#include "OSWindow.h"
#include "common/string_utils.h"
#include "test_utils/angle_test_configs.h"
#include "test_utils/gl_raii.h"
-#include "util/EGLWindow.h"
-#include "util/OSWindow.h"
using namespace angle;
@@ -639,23 +639,19 @@
{
FAIL() << "Failed to create OS window";
}
-
- mEntryPointsLib.reset(angle::OpenSharedLibrary(ANGLE_EGL_LIBRARY_NAME));
}
EGLWindow *createAndInitEGLWindow(angle::PlatformParameters ¶m)
{
EGLWindow *eglWindow =
new EGLWindow(param.majorVersion, param.minorVersion, param.eglParameters);
- bool result = eglWindow->initializeGL(mOSWindow, mEntryPointsLib.get());
+ bool result = eglWindow->initializeGL(mOSWindow);
if (result == false)
{
SafeDelete(eglWindow);
eglWindow = nullptr;
}
- angle::LoadGLES(eglGetProcAddress);
-
return eglWindow;
}
@@ -710,7 +706,6 @@
}
OSWindow *mOSWindow = nullptr;
- std::unique_ptr<angle::Library> mEntryPointsLib;
};
// Tries to create a program binary using one set of platform params, then load it using a different
diff --git a/src/tests/gl_tests/ReadPixelsTest.cpp b/src/tests/gl_tests/ReadPixelsTest.cpp
index bc7abba..da93ccc 100644
--- a/src/tests/gl_tests/ReadPixelsTest.cpp
+++ b/src/tests/gl_tests/ReadPixelsTest.cpp
@@ -11,7 +11,7 @@
#include <array>
-#include "util/random_utils.h"
+#include "random_utils.h"
using namespace angle;
diff --git a/src/tests/gl_tests/RequestExtensionTest.cpp b/src/tests/gl_tests/RequestExtensionTest.cpp
index 93cfb51..335f110 100644
--- a/src/tests/gl_tests/RequestExtensionTest.cpp
+++ b/src/tests/gl_tests/RequestExtensionTest.cpp
@@ -10,8 +10,6 @@
#include "test_utils/ANGLETest.h"
-#include "util/EGLWindow.h"
-
namespace angle
{
diff --git a/src/tests/gl_tests/RobustBufferAccessBehaviorTest.cpp b/src/tests/gl_tests/RobustBufferAccessBehaviorTest.cpp
index e1ecb33..238ba3f 100644
--- a/src/tests/gl_tests/RobustBufferAccessBehaviorTest.cpp
+++ b/src/tests/gl_tests/RobustBufferAccessBehaviorTest.cpp
@@ -9,7 +9,6 @@
#include "test_utils/ANGLETest.h"
#include "test_utils/gl_raii.h"
-#include "util/EGLWindow.h"
#include <array>
diff --git a/src/tests/gl_tests/RobustClientMemoryTest.cpp b/src/tests/gl_tests/RobustClientMemoryTest.cpp
index 1505ffa..4ee56b8 100644
--- a/src/tests/gl_tests/RobustClientMemoryTest.cpp
+++ b/src/tests/gl_tests/RobustClientMemoryTest.cpp
@@ -28,6 +28,148 @@
setConfigAlphaBits(8);
}
+ void SetUp() override
+ {
+ ANGLETest::SetUp();
+
+ glGetBooleanvRobustANGLE = reinterpret_cast<PFNGLGETBOOLEANVROBUSTANGLE>(
+ eglGetProcAddress("glGetBooleanvRobustANGLE"));
+ glGetBufferParameterivRobustANGLE = reinterpret_cast<PFNGLGETBUFFERPARAMETERIVROBUSTANGLE>(
+ eglGetProcAddress("glGetBufferParameterivRobustANGLE"));
+ glGetFloatvRobustANGLE = reinterpret_cast<PFNGLGETFLOATVROBUSTANGLE>(
+ eglGetProcAddress("glGetFloatvRobustANGLE"));
+ glGetFramebufferAttachmentParameterivRobustANGLE =
+ reinterpret_cast<PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVROBUSTANGLE>(
+ eglGetProcAddress("glGetFramebufferAttachmentParameterivRobustANGLE"));
+ glGetIntegervRobustANGLE = reinterpret_cast<PFNGLGETINTEGERVROBUSTANGLE>(
+ eglGetProcAddress("glGetIntegervRobustANGLE"));
+ glGetProgramivRobustANGLE = reinterpret_cast<PFNGLGETPROGRAMIVROBUSTANGLE>(
+ eglGetProcAddress("glGetProgramivRobustANGLE"));
+ glGetRenderbufferParameterivRobustANGLE =
+ reinterpret_cast<PFNGLGETRENDERBUFFERPARAMETERIVROBUSTANGLE>(
+ eglGetProcAddress("glGetRenderbufferParameterivRobustANGLE"));
+ glGetShaderivRobustANGLE = reinterpret_cast<PFNGLGETSHADERIVROBUSTANGLE>(
+ eglGetProcAddress("glGetShaderivRobustANGLE"));
+ glGetTexParameterfvRobustANGLE = reinterpret_cast<PFNGLGETTEXPARAMETERFVROBUSTANGLE>(
+ eglGetProcAddress("glGetTexParameterfvRobustANGLE"));
+ glGetTexParameterivRobustANGLE = reinterpret_cast<PFNGLGETTEXPARAMETERIVROBUSTANGLE>(
+ eglGetProcAddress("glGetTexParameterivRobustANGLE"));
+ glGetUniformfvRobustANGLE = reinterpret_cast<PFNGLGETUNIFORMFVROBUSTANGLE>(
+ eglGetProcAddress("glGetUniformfvRobustANGLE"));
+ glGetUniformivRobustANGLE = reinterpret_cast<PFNGLGETUNIFORMIVROBUSTANGLE>(
+ eglGetProcAddress("glGetUniformivRobustANGLE"));
+ glGetVertexAttribfvRobustANGLE = reinterpret_cast<PFNGLGETVERTEXATTRIBFVROBUSTANGLE>(
+ eglGetProcAddress("glGetVertexAttribfvRobustANGLE"));
+ glGetVertexAttribivRobustANGLE = reinterpret_cast<PFNGLGETVERTEXATTRIBIVROBUSTANGLE>(
+ eglGetProcAddress("glGetVertexAttribivRobustANGLE"));
+ glGetVertexAttribPointervRobustANGLE =
+ reinterpret_cast<PFNGLGETVERTEXATTRIBPOINTERVROBUSTANGLE>(
+ eglGetProcAddress("glGetVertexAttribPointervRobustANGLE"));
+ glReadPixelsRobustANGLE = reinterpret_cast<PFNGLREADPIXELSROBUSTANGLE>(
+ eglGetProcAddress("glReadPixelsRobustANGLE"));
+ glTexImage2DRobustANGLE = reinterpret_cast<PFNGLTEXIMAGE2DROBUSTANGLE>(
+ eglGetProcAddress("glTexImage2DRobustANGLE"));
+ glTexParameterfvRobustANGLE = reinterpret_cast<PFNGLTEXPARAMETERFVROBUSTANGLE>(
+ eglGetProcAddress("glTexParameterfvRobustANGLE"));
+ glTexParameterivRobustANGLE = reinterpret_cast<PFNGLTEXPARAMETERIVROBUSTANGLE>(
+ eglGetProcAddress("glTexParameterivRobustANGLE"));
+ glTexSubImage2DRobustANGLE = reinterpret_cast<PFNGLTEXSUBIMAGE2DROBUSTANGLE>(
+ eglGetProcAddress("glTexSubImage2DRobustANGLE"));
+ glTexImage3DRobustANGLE = reinterpret_cast<PFNGLTEXIMAGE3DROBUSTANGLE>(
+ eglGetProcAddress("glTexImage3DRobustANGLE"));
+ glTexSubImage3DRobustANGLE = reinterpret_cast<PFNGLTEXSUBIMAGE3DROBUSTANGLE>(
+ eglGetProcAddress("glTexSubImage3DRobustANGLE"));
+ glGetQueryivRobustANGLE = reinterpret_cast<PFNGLGETQUERYIVROBUSTANGLE>(
+ eglGetProcAddress("glGetQueryivRobustANGLE"));
+ glGetQueryObjectuivRobustANGLE = reinterpret_cast<PFNGLGETQUERYOBJECTUIVROBUSTANGLE>(
+ eglGetProcAddress("glGetQueryObjectuivRobustANGLE"));
+ glGetBufferPointervRobustANGLE = reinterpret_cast<PFNGLGETBUFFERPOINTERVROBUSTANGLE>(
+ eglGetProcAddress("glGetBufferPointervRobustANGLE"));
+ glGetIntegeri_vRobustANGLE = reinterpret_cast<PFNGLGETINTEGERI_VROBUSTANGLE>(
+ eglGetProcAddress("glGetIntegeri_vRobustANGLE"));
+ glGetInternalformativRobustANGLE = reinterpret_cast<PFNGETINTERNALFORMATIVROBUSTANGLE>(
+ eglGetProcAddress("glGetInternalformativRobustANGLE"));
+ glGetVertexAttribIivRobustANGLE = reinterpret_cast<PFNGLGETVERTEXATTRIBIIVROBUSTANGLE>(
+ eglGetProcAddress("glGetVertexAttribIivRobustANGLE"));
+ glGetVertexAttribIuivRobustANGLE = reinterpret_cast<PFNGLGETVERTEXATTRIBIUIVROBUSTANGLE>(
+ eglGetProcAddress("glGetVertexAttribIuivRobustANGLE"));
+ glGetUniformuivRobustANGLE = reinterpret_cast<PFNGLGETUNIFORMUIVROBUSTANGLE>(
+ eglGetProcAddress("glGetUniformuivRobustANGLE"));
+ glGetActiveUniformBlockivRobustANGLE =
+ reinterpret_cast<PFNGLGETACTIVEUNIFORMBLOCKIVROBUSTANGLE>(
+ eglGetProcAddress("glGetActiveUniformBlockivRobustANGLE"));
+ glGetInteger64vRobustANGLE = reinterpret_cast<PFNGLGETINTEGER64VROBUSTANGLE>(
+ eglGetProcAddress("glGetInteger64vRobustANGLE"));
+ glGetInteger64i_vRobustANGLE = reinterpret_cast<PFNGLGETINTEGER64I_VROBUSTANGLE>(
+ eglGetProcAddress("glGetInteger64i_vRobustANGLE"));
+ glGetBufferParameteri64vRobustANGLE =
+ reinterpret_cast<PFNGLGETBUFFERPARAMETERI64VROBUSTANGLE>(
+ eglGetProcAddress("glGetBufferParameteri64vRobustANGLE"));
+ glSamplerParameterivRobustANGLE = reinterpret_cast<PFNGLSAMPLERPARAMETERIVROBUSTANGLE>(
+ eglGetProcAddress("glSamplerParameterivRobustANGLE"));
+ glSamplerParameterfvRobustANGLE = reinterpret_cast<PFNGLSAMPLERPARAMETERFVROBUSTANGLE>(
+ eglGetProcAddress("glSamplerParameterfvRobustANGLE"));
+ glGetSamplerParameterivRobustANGLE =
+ reinterpret_cast<PFNGLGETSAMPLERPARAMETERIVROBUSTANGLE>(
+ eglGetProcAddress("glGetSamplerParameterivRobustANGLE"));
+ glGetSamplerParameterfvRobustANGLE =
+ reinterpret_cast<PFNGLGETSAMPLERPARAMETERFVROBUSTANGLE>(
+ eglGetProcAddress("glGetSamplerParameterfvRobustANGLE"));
+ glGetFramebufferParameterivRobustANGLE =
+ reinterpret_cast<PFNGLGETFRAMEBUFFERPARAMETERIVROBUSTANGLE>(
+ eglGetProcAddress("glGetFramebufferParameterivRobustANGLE"));
+ glGetProgramInterfaceivRobustANGLE =
+ reinterpret_cast<PFNGLGETPROGRAMINTERFACEIVROBUSTANGLE>(
+ eglGetProcAddress("glGetProgramInterfaceivRobustANGLE"));
+ glGetBooleani_vRobustANGLE = reinterpret_cast<PFNGLGETBOOLEANI_VROBUSTANGLE>(
+ eglGetProcAddress("glGetBooleani_vRobustANGLE"));
+ glGetMultisamplefvRobustANGLE = reinterpret_cast<PFNGLGETMULTISAMPLEFVROBUSTANGLE>(
+ eglGetProcAddress("glGetMultisamplefvRobustANGLE"));
+ glGetTexLevelParameterivRobustANGLE =
+ reinterpret_cast<PFNGLGETTEXLEVELPARAMETERIVROBUSTANGLE>(
+ eglGetProcAddress("glGetTexLevelParameterivRobustANGLE"));
+ glGetTexLevelParameterfvRobustANGLE =
+ reinterpret_cast<PFNGLGETTEXLEVELPARAMETERFVROBUSTANGLE>(
+ eglGetProcAddress("glGetTexLevelParameterfvRobustANGLE"));
+ glGetPointervRobustANGLERobustANGLE =
+ reinterpret_cast<PFNGLGETPOINTERVROBUSTANGLEROBUSTANGLE>(
+ eglGetProcAddress("glGetPointervRobustANGLERobustANGLE"));
+ glReadnPixelsRobustANGLE = reinterpret_cast<PFNGLREADNPIXELSROBUSTANGLE>(
+ eglGetProcAddress("glReadnPixelsRobustANGLE"));
+ glGetnUniformfvRobustANGLE = reinterpret_cast<PFNGLGETNUNIFORMFVROBUSTANGLE>(
+ eglGetProcAddress("glGetnUniformfvRobustANGLE"));
+ glGetnUniformivRobustANGLE = reinterpret_cast<PFNGLGETNUNIFORMIVROBUSTANGLE>(
+ eglGetProcAddress("glGetnUniformivRobustANGLE"));
+ glGetnUniformuivRobustANGLE = reinterpret_cast<PFNGLGETNUNIFORMUIVROBUSTANGLE>(
+ eglGetProcAddress("glGetnUniformuivRobustANGLE"));
+ glTexParameterIivRobustANGLE = reinterpret_cast<PFNGLTEXPARAMETERIIVROBUSTANGLE>(
+ eglGetProcAddress("glTexParameterIivRobustANGLE"));
+ glTexParameterIuivRobustANGLE = reinterpret_cast<PFNGLTEXPARAMETERIUIVROBUSTANGLE>(
+ eglGetProcAddress("glTexParameterIuivRobustANGLE"));
+ glGetTexParameterIivRobustANGLE = reinterpret_cast<PFNGLGETTEXPARAMETERIIVROBUSTANGLE>(
+ eglGetProcAddress("glGetTexParameterIivRobustANGLE"));
+ glGetTexParameterIuivRobustANGLE = reinterpret_cast<PFNGLGETTEXPARAMETERIUIVROBUSTANGLE>(
+ eglGetProcAddress("glGetTexParameterIuivRobustANGLE"));
+ glSamplerParameterIivRobustANGLE = reinterpret_cast<PFNGLSAMPLERPARAMETERIIVROBUSTANGLE>(
+ eglGetProcAddress("glSamplerParameterIivRobustANGLE"));
+ glSamplerParameterIuivRobustANGLE = reinterpret_cast<PFNGLSAMPLERPARAMETERIUIVROBUSTANGLE>(
+ eglGetProcAddress("glSamplerParameterIuivRobustANGLE"));
+ glGetSamplerParameterIivRobustANGLE =
+ reinterpret_cast<PFNGLGETSAMPLERPARAMETERIIVROBUSTANGLE>(
+ eglGetProcAddress("glGetSamplerParameterIivRobustANGLE"));
+ glGetSamplerParameterIuivRobustANGLE =
+ reinterpret_cast<PFNGLGETSAMPLERPARAMETERIUIVROBUSTANGLE>(
+ eglGetProcAddress("glGetSamplerParameterIuivRobustANGLE"));
+ glGetQueryObjectivRobustANGLE = reinterpret_cast<PFNGLGETQUERYOBJECTIVROBUSTANGLE>(
+ eglGetProcAddress("glGetQueryObjectivRobustANGLE"));
+ glGetQueryObjecti64vRobustANGLE = reinterpret_cast<PFNGLGETQUERYOBJECTI64VROBUSTANGLE>(
+ eglGetProcAddress("glGetQueryObjecti64vRobustANGLE"));
+ glGetQueryObjectui64vRobustANGLE = reinterpret_cast<PFNGLGETQUERYOBJECTUI64VROBUSTANGLE>(
+ eglGetProcAddress("glGetQueryObjectui64vRobustANGLE"));
+ }
+
+ void TearDown() override { ANGLETest::TearDown(); }
+
bool extensionsPresent() const
{
if (!extensionEnabled("GL_ANGLE_robust_client_memory"))
@@ -38,6 +180,68 @@
return true;
}
+
+ PFNGLGETBOOLEANVROBUSTANGLE glGetBooleanvRobustANGLE = nullptr;
+ PFNGLGETBUFFERPARAMETERIVROBUSTANGLE glGetBufferParameterivRobustANGLE = nullptr;
+ PFNGLGETFLOATVROBUSTANGLE glGetFloatvRobustANGLE = nullptr;
+ PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVROBUSTANGLE
+ glGetFramebufferAttachmentParameterivRobustANGLE = nullptr;
+ PFNGLGETINTEGERVROBUSTANGLE glGetIntegervRobustANGLE = nullptr;
+ PFNGLGETPROGRAMIVROBUSTANGLE glGetProgramivRobustANGLE = nullptr;
+ PFNGLGETRENDERBUFFERPARAMETERIVROBUSTANGLE glGetRenderbufferParameterivRobustANGLE = nullptr;
+ PFNGLGETSHADERIVROBUSTANGLE glGetShaderivRobustANGLE = nullptr;
+ PFNGLGETTEXPARAMETERFVROBUSTANGLE glGetTexParameterfvRobustANGLE = nullptr;
+ PFNGLGETTEXPARAMETERIVROBUSTANGLE glGetTexParameterivRobustANGLE = nullptr;
+ PFNGLGETUNIFORMFVROBUSTANGLE glGetUniformfvRobustANGLE = nullptr;
+ PFNGLGETUNIFORMIVROBUSTANGLE glGetUniformivRobustANGLE = nullptr;
+ PFNGLGETVERTEXATTRIBFVROBUSTANGLE glGetVertexAttribfvRobustANGLE = nullptr;
+ PFNGLGETVERTEXATTRIBIVROBUSTANGLE glGetVertexAttribivRobustANGLE = nullptr;
+ PFNGLGETVERTEXATTRIBPOINTERVROBUSTANGLE glGetVertexAttribPointervRobustANGLE = nullptr;
+ PFNGLREADPIXELSROBUSTANGLE glReadPixelsRobustANGLE = nullptr;
+ PFNGLTEXIMAGE2DROBUSTANGLE glTexImage2DRobustANGLE = nullptr;
+ PFNGLTEXPARAMETERFVROBUSTANGLE glTexParameterfvRobustANGLE = nullptr;
+ PFNGLTEXPARAMETERIVROBUSTANGLE glTexParameterivRobustANGLE = nullptr;
+ PFNGLTEXSUBIMAGE2DROBUSTANGLE glTexSubImage2DRobustANGLE = nullptr;
+ PFNGLTEXIMAGE3DROBUSTANGLE glTexImage3DRobustANGLE = nullptr;
+ PFNGLTEXSUBIMAGE3DROBUSTANGLE glTexSubImage3DRobustANGLE = nullptr;
+ PFNGLGETQUERYIVROBUSTANGLE glGetQueryivRobustANGLE = nullptr;
+ PFNGLGETQUERYOBJECTUIVROBUSTANGLE glGetQueryObjectuivRobustANGLE = nullptr;
+ PFNGLGETBUFFERPOINTERVROBUSTANGLE glGetBufferPointervRobustANGLE = nullptr;
+ PFNGLGETINTEGERI_VROBUSTANGLE glGetIntegeri_vRobustANGLE = nullptr;
+ PFNGETINTERNALFORMATIVROBUSTANGLE glGetInternalformativRobustANGLE = nullptr;
+ PFNGLGETVERTEXATTRIBIIVROBUSTANGLE glGetVertexAttribIivRobustANGLE = nullptr;
+ PFNGLGETVERTEXATTRIBIUIVROBUSTANGLE glGetVertexAttribIuivRobustANGLE = nullptr;
+ PFNGLGETUNIFORMUIVROBUSTANGLE glGetUniformuivRobustANGLE = nullptr;
+ PFNGLGETACTIVEUNIFORMBLOCKIVROBUSTANGLE glGetActiveUniformBlockivRobustANGLE = nullptr;
+ PFNGLGETINTEGER64VROBUSTANGLE glGetInteger64vRobustANGLE = nullptr;
+ PFNGLGETINTEGER64I_VROBUSTANGLE glGetInteger64i_vRobustANGLE = nullptr;
+ PFNGLGETBUFFERPARAMETERI64VROBUSTANGLE glGetBufferParameteri64vRobustANGLE = nullptr;
+ PFNGLSAMPLERPARAMETERIVROBUSTANGLE glSamplerParameterivRobustANGLE = nullptr;
+ PFNGLSAMPLERPARAMETERFVROBUSTANGLE glSamplerParameterfvRobustANGLE = nullptr;
+ PFNGLGETSAMPLERPARAMETERIVROBUSTANGLE glGetSamplerParameterivRobustANGLE = nullptr;
+ PFNGLGETSAMPLERPARAMETERFVROBUSTANGLE glGetSamplerParameterfvRobustANGLE = nullptr;
+ PFNGLGETFRAMEBUFFERPARAMETERIVROBUSTANGLE glGetFramebufferParameterivRobustANGLE = nullptr;
+ PFNGLGETPROGRAMINTERFACEIVROBUSTANGLE glGetProgramInterfaceivRobustANGLE = nullptr;
+ PFNGLGETBOOLEANI_VROBUSTANGLE glGetBooleani_vRobustANGLE = nullptr;
+ PFNGLGETMULTISAMPLEFVROBUSTANGLE glGetMultisamplefvRobustANGLE = nullptr;
+ PFNGLGETTEXLEVELPARAMETERIVROBUSTANGLE glGetTexLevelParameterivRobustANGLE = nullptr;
+ PFNGLGETTEXLEVELPARAMETERFVROBUSTANGLE glGetTexLevelParameterfvRobustANGLE = nullptr;
+ PFNGLGETPOINTERVROBUSTANGLEROBUSTANGLE glGetPointervRobustANGLERobustANGLE = nullptr;
+ PFNGLREADNPIXELSROBUSTANGLE glReadnPixelsRobustANGLE = nullptr;
+ PFNGLGETNUNIFORMFVROBUSTANGLE glGetnUniformfvRobustANGLE = nullptr;
+ PFNGLGETNUNIFORMIVROBUSTANGLE glGetnUniformivRobustANGLE = nullptr;
+ PFNGLGETNUNIFORMUIVROBUSTANGLE glGetnUniformuivRobustANGLE = nullptr;
+ PFNGLTEXPARAMETERIIVROBUSTANGLE glTexParameterIivRobustANGLE = nullptr;
+ PFNGLTEXPARAMETERIUIVROBUSTANGLE glTexParameterIuivRobustANGLE = nullptr;
+ PFNGLGETTEXPARAMETERIIVROBUSTANGLE glGetTexParameterIivRobustANGLE = nullptr;
+ PFNGLGETTEXPARAMETERIUIVROBUSTANGLE glGetTexParameterIuivRobustANGLE = nullptr;
+ PFNGLSAMPLERPARAMETERIIVROBUSTANGLE glSamplerParameterIivRobustANGLE = nullptr;
+ PFNGLSAMPLERPARAMETERIUIVROBUSTANGLE glSamplerParameterIuivRobustANGLE = nullptr;
+ PFNGLGETSAMPLERPARAMETERIIVROBUSTANGLE glGetSamplerParameterIivRobustANGLE = nullptr;
+ PFNGLGETSAMPLERPARAMETERIUIVROBUSTANGLE glGetSamplerParameterIuivRobustANGLE = nullptr;
+ PFNGLGETQUERYOBJECTIVROBUSTANGLE glGetQueryObjectivRobustANGLE = nullptr;
+ PFNGLGETQUERYOBJECTI64VROBUSTANGLE glGetQueryObjecti64vRobustANGLE = nullptr;
+ PFNGLGETQUERYOBJECTUI64VROBUSTANGLE glGetQueryObjectui64vRobustANGLE = nullptr;
};
// Test basic usage and validation of glGetIntegervRobustANGLE
diff --git a/src/tests/gl_tests/RobustResourceInitTest.cpp b/src/tests/gl_tests/RobustResourceInitTest.cpp
index a5c5002..8231c0a 100644
--- a/src/tests/gl_tests/RobustResourceInitTest.cpp
+++ b/src/tests/gl_tests/RobustResourceInitTest.cpp
@@ -8,7 +8,6 @@
#include "test_utils/ANGLETest.h"
#include "test_utils/gl_raii.h"
-#include "util/EGLWindow.h"
namespace angle
{
@@ -1749,6 +1748,9 @@
{
ANGLE_SKIP_TEST_IF(!hasGLExtension());
+ const GLsizei kWidth = 128;
+ const GLsizei kHeight = 128;
+
GLTexture texture;
glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, texture);
glTexStorage2DMultisample(GL_TEXTURE_2D_MULTISAMPLE, 2, GL_RGBA8, kWidth, kHeight, false);
@@ -1788,6 +1790,8 @@
}
ANGLE_SKIP_TEST_IF(!extensionEnabled("GL_OES_texture_storage_multisample_2d_array"));
+ const GLsizei kWidth = 128;
+ const GLsizei kHeight = 128;
const GLsizei kLayers = 4;
GLTexture texture;
diff --git a/src/tests/gl_tests/SimpleOperationTest.cpp b/src/tests/gl_tests/SimpleOperationTest.cpp
index 0276212..09ccb1e 100644
--- a/src/tests/gl_tests/SimpleOperationTest.cpp
+++ b/src/tests/gl_tests/SimpleOperationTest.cpp
@@ -10,8 +10,8 @@
#include <vector>
+#include "random_utils.h"
#include "test_utils/gl_raii.h"
-#include "util/random_utils.h"
using namespace angle;
@@ -991,8 +991,7 @@
center *= 0.5f;
center += Vector2(0.5f);
center *= Vector2(getWindowWidth(), getWindowHeight());
- EXPECT_PIXEL_COLOR_EQ(static_cast<GLint>(center.x()), static_cast<GLint>(center.y()),
- colors[faceIndex][0]);
+ EXPECT_PIXEL_COLOR_EQ(center.x(), center.y(), colors[faceIndex][0]);
}
}
diff --git a/src/tests/gl_tests/TextureMultisampleTest.cpp b/src/tests/gl_tests/TextureMultisampleTest.cpp
index 51f31b0..d61ac3b 100644
--- a/src/tests/gl_tests/TextureMultisampleTest.cpp
+++ b/src/tests/gl_tests/TextureMultisampleTest.cpp
@@ -8,8 +8,8 @@
#include "test_utils/ANGLETest.h"
+#include "shader_utils.h"
#include "test_utils/gl_raii.h"
-#include "util/shader_utils.h"
using namespace angle;
diff --git a/src/tests/gl_tests/TextureTest.cpp b/src/tests/gl_tests/TextureTest.cpp
index dc65d7e..14464c9 100644
--- a/src/tests/gl_tests/TextureTest.cpp
+++ b/src/tests/gl_tests/TextureTest.cpp
@@ -3002,7 +3002,7 @@
})";
}
- const char *getFragmentShaderSource() override
+ const char *getFragmentShaderSource()
{
if (isUnsignedIntTest)
{
diff --git a/src/tests/gl_tests/TextureUploadFormatTest.cpp b/src/tests/gl_tests/TextureUploadFormatTest.cpp
index fe54ceb..c74f1d4 100644
--- a/src/tests/gl_tests/TextureUploadFormatTest.cpp
+++ b/src/tests/gl_tests/TextureUploadFormatTest.cpp
@@ -167,8 +167,7 @@
{
constexpr int eBias = (1 << (kEBits - 1)) - 1;
constexpr int mDiv = 1 << kMBits;
- float ret = powf(-1.0f, static_cast<float>(sVal)) *
- powf(2.0f, static_cast<float>(int(eVal) - eBias)) * (1.0f + float(mVal) / mDiv);
+ float ret = powf(-1, sVal) * powf(2, int(eVal) - eBias) * (1.0f + float(mVal) / mDiv);
return ret;
}
};
@@ -188,8 +187,8 @@
// GLES 3.0.5 p129
constexpr int eMax = 31; // max allowed biased exponent value
- const float twoToN = powf(2.0f, static_cast<float>(N));
- const float sharedExpMax = (twoToN - 1.0f) / twoToN * powf(2.0f, eMax - B);
+ const float twoToN = powf(2, N);
+ const float sharedExpMax = (twoToN - 1) / twoToN * powf(2, eMax - B);
const auto fnClampColor = [&](const float color) {
return std::max(0.0f, std::min(color, sharedExpMax));
@@ -204,12 +203,12 @@
const auto fnColorS = [&](const float colorC, const float exp) {
return floori(colorC / powf(2, exp - B - N) + 0.5f);
};
- const int maxS = fnColorS(maxC, static_cast<float>(expP));
+ const int maxS = fnColorS(maxC, expP);
const int expS = expP + ((maxS == (1 << N)) ? 1 : 0);
- const int redS = fnColorS(redC, static_cast<float>(expS));
- const int greenS = fnColorS(greenC, static_cast<float>(expS));
- const int blueS = fnColorS(blueC, static_cast<float>(expS));
+ const int redS = fnColorS(redC, expS);
+ const int greenS = fnColorS(greenC, expS);
+ const int blueS = fnColorS(blueC, expS);
// Pack as u32 EGBR.
uint32_t ret = expS & 0x1f;
@@ -238,12 +237,10 @@
// These are *not* IEEE-like UFloat14s.
// GLES 3.0.5 p165:
// red = redS*pow(2,expS-B-N)
- const auto fnToFloat = [&](const uint32_t x) {
- return x * powf(2.0f, static_cast<float>(int(expS) - B - N));
- };
- *out_red = fnToFloat(redS);
- *out_green = fnToFloat(greenS);
- *out_blue = fnToFloat(blueS);
+ const auto fnToFloat = [&](const uint32_t x) { return x * powf(2, int(expS) - B - N); };
+ *out_red = fnToFloat(redS);
+ *out_green = fnToFloat(greenS);
+ *out_blue = fnToFloat(blueS);
}
};
diff --git a/src/tests/gl_tests/TimerQueriesTest.cpp b/src/tests/gl_tests/TimerQueriesTest.cpp
index 458469d..a607397 100644
--- a/src/tests/gl_tests/TimerQueriesTest.cpp
+++ b/src/tests/gl_tests/TimerQueriesTest.cpp
@@ -7,10 +7,9 @@
// Various tests for EXT_disjoint_timer_query functionality and validation
//
+#include "random_utils.h"
+#include "system_utils.h"
#include "test_utils/ANGLETest.h"
-#include "util/EGLWindow.h"
-#include "util/random_utils.h"
-#include "util/system_utils.h"
using namespace angle;
diff --git a/src/tests/gl_tests/TransformFeedbackTest.cpp b/src/tests/gl_tests/TransformFeedbackTest.cpp
index ab19046..60ad8e0 100644
--- a/src/tests/gl_tests/TransformFeedbackTest.cpp
+++ b/src/tests/gl_tests/TransformFeedbackTest.cpp
@@ -4,10 +4,9 @@
// found in the LICENSE file.
//
+#include "random_utils.h"
#include "test_utils/ANGLETest.h"
#include "test_utils/gl_raii.h"
-#include "util/EGLWindow.h"
-#include "util/random_utils.h"
using namespace angle;
diff --git a/src/tests/gl_tests/VulkanFormatTablesTest.cpp b/src/tests/gl_tests/VulkanFormatTablesTest.cpp
index 06a6ea1..4f51d5b 100644
--- a/src/tests/gl_tests/VulkanFormatTablesTest.cpp
+++ b/src/tests/gl_tests/VulkanFormatTablesTest.cpp
@@ -19,7 +19,6 @@
#include "libANGLE/formatutils.h"
#include "libANGLE/renderer/vulkan/ContextVk.h"
#include "libANGLE/renderer/vulkan/RendererVk.h"
-#include "util/EGLWindow.h"
using namespace angle;
diff --git a/src/tests/gl_tests/VulkanUniformUpdatesTest.cpp b/src/tests/gl_tests/VulkanUniformUpdatesTest.cpp
index 30be1d2..d1c009e 100644
--- a/src/tests/gl_tests/VulkanUniformUpdatesTest.cpp
+++ b/src/tests/gl_tests/VulkanUniformUpdatesTest.cpp
@@ -19,7 +19,6 @@
#include "libANGLE/renderer/vulkan/ContextVk.h"
#include "libANGLE/renderer/vulkan/ProgramVk.h"
#include "test_utils/gl_raii.h"
-#include "util/EGLWindow.h"
using namespace angle;
diff --git a/src/tests/gl_tests/WebGLReadOutsideFramebufferTest.cpp b/src/tests/gl_tests/WebGLReadOutsideFramebufferTest.cpp
index 6997877..45f2c23 100644
--- a/src/tests/gl_tests/WebGLReadOutsideFramebufferTest.cpp
+++ b/src/tests/gl_tests/WebGLReadOutsideFramebufferTest.cpp
@@ -53,7 +53,7 @@
}
else
{
- ASSERT_TRUE(target == GL_TEXTURE_2D);
+ ASSERT(target == GL_TEXTURE_2D);
glTexImage2D(target, 0, GL_RGBA, mWidth, mHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE,
mData.data());
}
diff --git a/src/tests/gl_tests/gles1/AlphaFuncTest.cpp b/src/tests/gl_tests/gles1/AlphaFuncTest.cpp
index 693755f..8dd4ff5 100644
--- a/src/tests/gl_tests/gles1/AlphaFuncTest.cpp
+++ b/src/tests/gl_tests/gles1/AlphaFuncTest.cpp
@@ -9,7 +9,7 @@
#include "test_utils/ANGLETest.h"
#include "test_utils/gl_raii.h"
-#include "util/random_utils.h"
+#include "random_utils.h"
#include <stdint.h>
diff --git a/src/tests/gl_tests/gles1/ClientActiveTextureTest.cpp b/src/tests/gl_tests/gles1/ClientActiveTextureTest.cpp
index 948a27e..4010d08 100644
--- a/src/tests/gl_tests/gles1/ClientActiveTextureTest.cpp
+++ b/src/tests/gl_tests/gles1/ClientActiveTextureTest.cpp
@@ -9,7 +9,7 @@
#include "test_utils/ANGLETest.h"
#include "test_utils/gl_raii.h"
-#include "util/random_utils.h"
+#include "random_utils.h"
#include <stdint.h>
diff --git a/src/tests/gl_tests/gles1/ClipPlaneTest.cpp b/src/tests/gl_tests/gles1/ClipPlaneTest.cpp
index a77b6a5..d82f36b 100644
--- a/src/tests/gl_tests/gles1/ClipPlaneTest.cpp
+++ b/src/tests/gl_tests/gles1/ClipPlaneTest.cpp
@@ -9,7 +9,7 @@
#include "test_utils/ANGLETest.h"
#include "test_utils/gl_raii.h"
-#include "util/random_utils.h"
+#include "random_utils.h"
#include <stdint.h>
diff --git a/src/tests/gl_tests/gles1/CurrentColorTest.cpp b/src/tests/gl_tests/gles1/CurrentColorTest.cpp
index 0bf6dc2..25e52dd 100644
--- a/src/tests/gl_tests/gles1/CurrentColorTest.cpp
+++ b/src/tests/gl_tests/gles1/CurrentColorTest.cpp
@@ -9,7 +9,7 @@
#include "test_utils/ANGLETest.h"
#include "test_utils/gl_raii.h"
-#include "util/random_utils.h"
+#include "random_utils.h"
#include <stdint.h>
diff --git a/src/tests/gl_tests/gles1/CurrentNormalTest.cpp b/src/tests/gl_tests/gles1/CurrentNormalTest.cpp
index e442c54..2da4ba1 100644
--- a/src/tests/gl_tests/gles1/CurrentNormalTest.cpp
+++ b/src/tests/gl_tests/gles1/CurrentNormalTest.cpp
@@ -9,7 +9,7 @@
#include "test_utils/ANGLETest.h"
#include "test_utils/gl_raii.h"
-#include "util/random_utils.h"
+#include "random_utils.h"
#include "common/vector_utils.h"
diff --git a/src/tests/gl_tests/gles1/CurrentTextureCoordsTest.cpp b/src/tests/gl_tests/gles1/CurrentTextureCoordsTest.cpp
index 900e234..c753efb 100644
--- a/src/tests/gl_tests/gles1/CurrentTextureCoordsTest.cpp
+++ b/src/tests/gl_tests/gles1/CurrentTextureCoordsTest.cpp
@@ -7,10 +7,11 @@
// CurrentTextureCoordsTest.cpp: Tests basic usage of glMultiTexCoord4(f|x).
#include "test_utils/ANGLETest.h"
+#include "test_utils/gl_raii.h"
+
+#include "random_utils.h"
#include "common/vector_utils.h"
-#include "test_utils/gl_raii.h"
-#include "util/random_utils.h"
#include <array>
diff --git a/src/tests/gl_tests/gles1/FogTest.cpp b/src/tests/gl_tests/gles1/FogTest.cpp
index e147a09..c3d0207 100644
--- a/src/tests/gl_tests/gles1/FogTest.cpp
+++ b/src/tests/gl_tests/gles1/FogTest.cpp
@@ -9,7 +9,7 @@
#include "test_utils/ANGLETest.h"
#include "test_utils/gl_raii.h"
-#include "util/random_utils.h"
+#include "random_utils.h"
#include <stdint.h>
diff --git a/src/tests/gl_tests/gles1/LightsTest.cpp b/src/tests/gl_tests/gles1/LightsTest.cpp
index 6a31253..ef318b8 100644
--- a/src/tests/gl_tests/gles1/LightsTest.cpp
+++ b/src/tests/gl_tests/gles1/LightsTest.cpp
@@ -11,7 +11,7 @@
#include "common/matrix_utils.h"
#include "common/vector_utils.h"
-#include "util/random_utils.h"
+#include "random_utils.h"
#include <stdint.h>
diff --git a/src/tests/gl_tests/gles1/MaterialsTest.cpp b/src/tests/gl_tests/gles1/MaterialsTest.cpp
index c0ed07b..3eee292 100644
--- a/src/tests/gl_tests/gles1/MaterialsTest.cpp
+++ b/src/tests/gl_tests/gles1/MaterialsTest.cpp
@@ -9,7 +9,7 @@
#include "test_utils/ANGLETest.h"
#include "test_utils/gl_raii.h"
-#include "util/random_utils.h"
+#include "random_utils.h"
#include <stdint.h>
diff --git a/src/tests/gl_tests/gles1/MatrixBuiltinsTest.cpp b/src/tests/gl_tests/gles1/MatrixBuiltinsTest.cpp
index adf4c92..8798431 100644
--- a/src/tests/gl_tests/gles1/MatrixBuiltinsTest.cpp
+++ b/src/tests/gl_tests/gles1/MatrixBuiltinsTest.cpp
@@ -10,7 +10,7 @@
#include "test_utils/gl_raii.h"
#include "common/matrix_utils.h"
-#include "util/random_utils.h"
+#include "random_utils.h"
#include <stdint.h>
diff --git a/src/tests/gl_tests/gles1/MatrixLoadTest.cpp b/src/tests/gl_tests/gles1/MatrixLoadTest.cpp
index 39b6981..10a168a 100644
--- a/src/tests/gl_tests/gles1/MatrixLoadTest.cpp
+++ b/src/tests/gl_tests/gles1/MatrixLoadTest.cpp
@@ -10,7 +10,7 @@
#include "test_utils/gl_raii.h"
#include "common/matrix_utils.h"
-#include "util/random_utils.h"
+#include "random_utils.h"
#include <stdint.h>
diff --git a/src/tests/gl_tests/gles1/MatrixMultTest.cpp b/src/tests/gl_tests/gles1/MatrixMultTest.cpp
index 7e6a092..a464e06 100644
--- a/src/tests/gl_tests/gles1/MatrixMultTest.cpp
+++ b/src/tests/gl_tests/gles1/MatrixMultTest.cpp
@@ -10,7 +10,7 @@
#include "test_utils/gl_raii.h"
#include "common/matrix_utils.h"
-#include "util/random_utils.h"
+#include "random_utils.h"
#include <stdint.h>
diff --git a/src/tests/gl_tests/gles1/PointParameterTest.cpp b/src/tests/gl_tests/gles1/PointParameterTest.cpp
index 208d75d..1aa4b2b 100644
--- a/src/tests/gl_tests/gles1/PointParameterTest.cpp
+++ b/src/tests/gl_tests/gles1/PointParameterTest.cpp
@@ -9,7 +9,7 @@
#include "test_utils/ANGLETest.h"
#include "test_utils/gl_raii.h"
-#include "util/random_utils.h"
+#include "random_utils.h"
#include <stdint.h>
diff --git a/src/tests/gl_tests/gles1/ShadeModelTest.cpp b/src/tests/gl_tests/gles1/ShadeModelTest.cpp
index 711de47..46acfee 100644
--- a/src/tests/gl_tests/gles1/ShadeModelTest.cpp
+++ b/src/tests/gl_tests/gles1/ShadeModelTest.cpp
@@ -9,7 +9,7 @@
#include "test_utils/ANGLETest.h"
#include "test_utils/gl_raii.h"
-#include "util/random_utils.h"
+#include "random_utils.h"
#include <stdint.h>
diff --git a/src/tests/gl_tests/gles1/TextureEnvTest.cpp b/src/tests/gl_tests/gles1/TextureEnvTest.cpp
index 9e4fa8d..ca75c16 100644
--- a/src/tests/gl_tests/gles1/TextureEnvTest.cpp
+++ b/src/tests/gl_tests/gles1/TextureEnvTest.cpp
@@ -9,7 +9,7 @@
#include "test_utils/ANGLETest.h"
#include "test_utils/gl_raii.h"
-#include "util/random_utils.h"
+#include "random_utils.h"
#include <stdint.h>
diff --git a/src/tests/gl_tests/gles1/TextureParameterTest.cpp b/src/tests/gl_tests/gles1/TextureParameterTest.cpp
index c816295..4c03b8c 100644
--- a/src/tests/gl_tests/gles1/TextureParameterTest.cpp
+++ b/src/tests/gl_tests/gles1/TextureParameterTest.cpp
@@ -9,7 +9,7 @@
#include "test_utils/ANGLETest.h"
#include "test_utils/gl_raii.h"
-#include "util/random_utils.h"
+#include "random_utils.h"
#include <stdint.h>
diff --git a/src/tests/perf_tests/ANGLEPerfTest.cpp b/src/tests/perf_tests/ANGLEPerfTest.cpp
index 4e53310..825c1ea 100644
--- a/src/tests/perf_tests/ANGLEPerfTest.cpp
+++ b/src/tests/perf_tests/ANGLEPerfTest.cpp
@@ -74,6 +74,8 @@
static_assert(offsetof(TraceCategory, enabled) == 0,
"|enabled| must be the first field of the TraceCategory class.");
const TraceCategory *category = reinterpret_cast<const TraceCategory *>(categoryEnabledFlag);
+ ptrdiff_t categoryIndex = category - gTraceCategories;
+ ASSERT(categoryIndex >= 0 && static_cast<size_t>(categoryIndex) < ArraySize(gTraceCategories));
ANGLERenderTest *renderTest = static_cast<ANGLERenderTest *>(platform->context);
std::vector<TraceEvent> &buffer = renderTest->getTraceEventBuffer();
@@ -343,13 +345,7 @@
angle::StabilizeCPUForBenchmarking();
mOSWindow = CreateOSWindow();
-
- if (!mEGLWindow)
- {
- abortTest();
- return;
- }
-
+ ASSERT(mEGLWindow != nullptr);
mEGLWindow->setSwapInterval(0);
mPlatformMethods.overrideWorkaroundsD3D = OverrideWorkaroundsD3D;
@@ -369,21 +365,12 @@
return;
}
- // Load EGL library so we can initialize the display.
-#if defined(ANGLE_USE_UTIL_LOADER)
- mEntryPointsLib.reset(angle::OpenSharedLibrary(ANGLE_EGL_LIBRARY_NAME));
-#endif // defined(ANGLE_USE_UTIL_LOADER)
-
- if (!mEGLWindow->initializeGL(mOSWindow, mEntryPointsLib.get()))
+ if (!mEGLWindow->initializeGL(mOSWindow))
{
FAIL() << "Failed initializing EGLWindow";
return;
}
-#if defined(ANGLE_USE_UTIL_LOADER)
- angle::LoadGLES(eglGetProcAddress);
-#endif // defined(ANGLE_USE_UTIL_LOADER)
-
if (!areExtensionPrerequisitesFulfilled())
{
mSkipTest = true;
diff --git a/src/tests/perf_tests/ANGLEPerfTest.h b/src/tests/perf_tests/ANGLEPerfTest.h
index 8c52739..24215c1 100644
--- a/src/tests/perf_tests/ANGLEPerfTest.h
+++ b/src/tests/perf_tests/ANGLEPerfTest.h
@@ -15,13 +15,17 @@
#include <string>
#include <vector>
+#include <EGL/egl.h>
+#include <EGL/eglext.h>
+
+#include "EGLWindow.h"
+#include "OSWindow.h"
+#include "Timer.h"
+#include "common/angleutils.h"
+#include "common/debug.h"
#include "platform/Platform.h"
#include "test_utils/angle_test_configs.h"
#include "test_utils/angle_test_instantiate.h"
-#include "util/EGLWindow.h"
-#include "util/OSWindow.h"
-#include "util/Timer.h"
-#include "util/util_gl.h"
class Event;
@@ -104,8 +108,6 @@
struct RenderTestParams : public angle::PlatformParameters
{
- virtual ~RenderTestParams() {}
-
virtual std::string suffix() const;
EGLint windowWidth = 64;
@@ -158,9 +160,6 @@
// Trace event record that can be output.
std::vector<TraceEvent> mTraceEventBuffer;
-
- // Handle to the entry point binding library.
- std::unique_ptr<angle::Library> mEntryPointsLib;
};
#endif // PERF_TESTS_ANGLE_PERF_TEST_H_
diff --git a/src/tests/perf_tests/BindingPerf.cpp b/src/tests/perf_tests/BindingPerf.cpp
index 680ba5d..5df3d70 100644
--- a/src/tests/perf_tests/BindingPerf.cpp
+++ b/src/tests/perf_tests/BindingPerf.cpp
@@ -13,7 +13,9 @@
#include <random>
#include <sstream>
-#include "util/shader_utils.h"
+#include "shader_utils.h"
+
+#include "angle_gl.h"
namespace angle
{
@@ -67,8 +69,7 @@
strstr << "_allocated_at_initialization";
break;
default:
- strstr << "_err";
- break;
+ UNREACHABLE();
}
return strstr.str();
diff --git a/src/tests/perf_tests/BlitFramebufferPerf.cpp b/src/tests/perf_tests/BlitFramebufferPerf.cpp
index 47698f1..cf61b5c 100644
--- a/src/tests/perf_tests/BlitFramebufferPerf.cpp
+++ b/src/tests/perf_tests/BlitFramebufferPerf.cpp
@@ -10,8 +10,6 @@
#include "ANGLEPerfTest.h"
-#include "util/gles_loader_autogen.h"
-
namespace
{
constexpr unsigned int kIterationsPerStep = 5;
diff --git a/src/tests/perf_tests/DispatchComputePerf.cpp b/src/tests/perf_tests/DispatchComputePerf.cpp
index 167c1e3..5d2b287 100644
--- a/src/tests/perf_tests/DispatchComputePerf.cpp
+++ b/src/tests/perf_tests/DispatchComputePerf.cpp
@@ -8,7 +8,9 @@
//
#include "ANGLEPerfTest.h"
-#include "util/shader_utils.h"
+#include "shader_utils.h"
+
+#include "angle_gl.h"
namespace
{
diff --git a/src/tests/perf_tests/DynamicPromotionPerfTest.cpp b/src/tests/perf_tests/DynamicPromotionPerfTest.cpp
index 128082f..c007457 100644
--- a/src/tests/perf_tests/DynamicPromotionPerfTest.cpp
+++ b/src/tests/perf_tests/DynamicPromotionPerfTest.cpp
@@ -11,8 +11,8 @@
#include "ANGLEPerfTest.h"
#include "common/vector_utils.h"
-#include "util/random_utils.h"
-#include "util/shader_utils.h"
+#include "random_utils.h"
+#include "shader_utils.h"
using namespace angle;
diff --git a/src/tests/perf_tests/EGLInitializePerf.cpp b/src/tests/perf_tests/EGLInitializePerf.cpp
index f44baf2..25f85cb 100644
--- a/src/tests/perf_tests/EGLInitializePerf.cpp
+++ b/src/tests/perf_tests/EGLInitializePerf.cpp
@@ -8,10 +8,10 @@
//
#include "ANGLEPerfTest.h"
+#include "Timer.h"
#include "platform/Platform.h"
#include "test_utils/angle_test_configs.h"
#include "test_utils/angle_test_instantiate.h"
-#include "util/Timer.h"
using namespace testing;
diff --git a/src/tests/perf_tests/EGLMakeCurrentPerf.cpp b/src/tests/perf_tests/EGLMakeCurrentPerf.cpp
index f499262..8d5faaa 100644
--- a/src/tests/perf_tests/EGLMakeCurrentPerf.cpp
+++ b/src/tests/perf_tests/EGLMakeCurrentPerf.cpp
@@ -11,7 +11,6 @@
#include "platform/Platform.h"
#include "test_utils/angle_test_configs.h"
#include "test_utils/angle_test_instantiate.h"
-#include "util/system_utils.h"
#define ITERATIONS 20
@@ -35,11 +34,10 @@
EGLSurface mSurface;
EGLConfig mConfig;
std::array<EGLContext, 2> mContexts;
- std::unique_ptr<angle::Library> mEGLLibrary;
};
EGLMakeCurrentPerfTest::EGLMakeCurrentPerfTest()
- : ANGLEPerfTest("EGLMakeCurrent", "_run", ITERATIONS),
+ : ANGLEPerfTest("EGLMakeCurrent", "_run", 1),
mOSWindow(nullptr),
mDisplay(EGL_NO_DISPLAY),
mSurface(EGL_NO_SURFACE),
@@ -62,30 +60,9 @@
mOSWindow = CreateOSWindow();
mOSWindow->initialize("EGLMakeCurrent Test", 64, 64);
- mEGLLibrary.reset(angle::OpenSharedLibrary(ANGLE_EGL_LIBRARY_NAME));
-
- angle::LoadProc getProc =
- reinterpret_cast<angle::LoadProc>(mEGLLibrary->getSymbol("eglGetProcAddress"));
-
- if (!getProc)
- {
- abortTest();
- }
- else
- {
- angle::LoadEGL(getProc);
-
- if (!eglGetPlatformDisplayEXT)
- {
- abortTest();
- }
- else
- {
- mDisplay = eglGetPlatformDisplayEXT(
- EGL_PLATFORM_ANGLE_ANGLE, reinterpret_cast<void *>(mOSWindow->getNativeDisplay()),
- &displayAttributes[0]);
- }
- }
+ mDisplay = eglGetPlatformDisplayEXT(EGL_PLATFORM_ANGLE_ANGLE,
+ reinterpret_cast<void *>(mOSWindow->getNativeDisplay()),
+ &displayAttributes[0]);
}
void EGLMakeCurrentPerfTest::SetUp()
diff --git a/src/tests/perf_tests/InstancingPerf.cpp b/src/tests/perf_tests/InstancingPerf.cpp
index b6a45d2..82c2882 100644
--- a/src/tests/perf_tests/InstancingPerf.cpp
+++ b/src/tests/perf_tests/InstancingPerf.cpp
@@ -12,9 +12,9 @@
#include <cmath>
#include <sstream>
-#include "util/Matrix.h"
-#include "util/random_utils.h"
-#include "util/shader_utils.h"
+#include "Matrix.h"
+#include "random_utils.h"
+#include "shader_utils.h"
using namespace angle;
using namespace egl_platform;
@@ -276,6 +276,9 @@
// Animatino makes the test more interesting visually, but also eats up many CPU cycles.
if (params.animationEnabled)
{
+ // Not implemented for billboards.
+ ASSERT(params.instancingEnabled);
+
float time = static_cast<float>(mTimer->getElapsedTime());
for (size_t pointIndex = 0; pointIndex < mTranslateData.size(); ++pointIndex)
diff --git a/src/tests/perf_tests/InterleavedAttributeData.cpp b/src/tests/perf_tests/InterleavedAttributeData.cpp
index c780c0e..6e98011 100644
--- a/src/tests/perf_tests/InterleavedAttributeData.cpp
+++ b/src/tests/perf_tests/InterleavedAttributeData.cpp
@@ -10,7 +10,7 @@
#include <sstream>
#include "ANGLEPerfTest.h"
-#include "util/shader_utils.h"
+#include "shader_utils.h"
using namespace angle;
diff --git a/src/tests/perf_tests/LinkProgramPerfTest.cpp b/src/tests/perf_tests/LinkProgramPerfTest.cpp
index 78dafcf..bda7142 100644
--- a/src/tests/perf_tests/LinkProgramPerfTest.cpp
+++ b/src/tests/perf_tests/LinkProgramPerfTest.cpp
@@ -12,7 +12,7 @@
#include <array>
#include "common/vector_utils.h"
-#include "util/shader_utils.h"
+#include "shader_utils.h"
using namespace angle;
diff --git a/src/tests/perf_tests/MultiviewPerf.cpp b/src/tests/perf_tests/MultiviewPerf.cpp
index c61c882..92821ea 100644
--- a/src/tests/perf_tests/MultiviewPerf.cpp
+++ b/src/tests/perf_tests/MultiviewPerf.cpp
@@ -13,8 +13,8 @@
#include "ANGLEPerfTest.h"
#include "common/vector_utils.h"
#include "platform/WorkaroundsD3D.h"
+#include "shader_utils.h"
#include "test_utils/gl_raii.h"
-#include "util/shader_utils.h"
#include <string.h>
@@ -36,6 +36,7 @@
") in;\n";
;
}
+ ASSERT(shaderType == GL_FRAGMENT_SHADER);
return "#extension GL_OVR_multiview : require\n";
}
@@ -87,8 +88,7 @@
name += "_instanced_multiview_geometry_shader";
break;
default:
- name += "_error";
- break;
+ UNREACHABLE();
}
name += "_" + ToString(numViews) + "_views";
return name;
@@ -180,6 +180,7 @@
void MultiviewBenchmark::initializeBenchmark()
{
const MultiviewPerfParams *params = static_cast<const MultiviewPerfParams *>(&mTestParams);
+ ASSERT(params->windowWidth % params->numViews == 0);
glBindTexture(GL_TEXTURE_2D, mColorTexture);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, params->windowWidth, params->windowHeight, 0, GL_RGBA,
@@ -217,9 +218,8 @@
viewportOffsets.data());
break;
}
- case MultiviewOption::Unspecified:
- // implementation error.
- break;
+ default:
+ UNREACHABLE();
}
GLenum DrawBuffers[1] = {GL_COLOR_ATTACHMENT0};
@@ -252,9 +252,8 @@
glScissor(0, 0, viewWidth, viewHeight);
renderScene();
break;
- case MultiviewOption::Unspecified:
- // implementation error.
- break;
+ default:
+ UNREACHABLE();
}
ASSERT_GL_NO_ERROR();
diff --git a/src/tests/perf_tests/PointSprites.cpp b/src/tests/perf_tests/PointSprites.cpp
index a677996..6324d13 100644
--- a/src/tests/perf_tests/PointSprites.cpp
+++ b/src/tests/perf_tests/PointSprites.cpp
@@ -12,8 +12,8 @@
#include <iostream>
#include <sstream>
-#include "util/random_utils.h"
-#include "util/shader_utils.h"
+#include "random_utils.h"
+#include "shader_utils.h"
using namespace angle;
diff --git a/src/tests/perf_tests/TexSubImage.cpp b/src/tests/perf_tests/TexSubImage.cpp
index 427b699..42fb471 100644
--- a/src/tests/perf_tests/TexSubImage.cpp
+++ b/src/tests/perf_tests/TexSubImage.cpp
@@ -10,7 +10,7 @@
#include <sstream>
#include "ANGLEPerfTest.h"
-#include "util/shader_utils.h"
+#include "shader_utils.h"
using namespace angle;
diff --git a/src/tests/perf_tests/TextureSampling.cpp b/src/tests/perf_tests/TextureSampling.cpp
index 65d9266..a74b3a8 100644
--- a/src/tests/perf_tests/TextureSampling.cpp
+++ b/src/tests/perf_tests/TextureSampling.cpp
@@ -16,7 +16,7 @@
#include <random>
#include <sstream>
-#include "util/shader_utils.h"
+#include "shader_utils.h"
using namespace angle;
diff --git a/src/tests/perf_tests/TexturesPerf.cpp b/src/tests/perf_tests/TexturesPerf.cpp
index ca8b21f..75bbd5e 100644
--- a/src/tests/perf_tests/TexturesPerf.cpp
+++ b/src/tests/perf_tests/TexturesPerf.cpp
@@ -13,7 +13,7 @@
#include <random>
#include <sstream>
-#include "util/shader_utils.h"
+#include "shader_utils.h"
namespace angle
{
diff --git a/src/tests/perf_tests/UniformsPerf.cpp b/src/tests/perf_tests/UniformsPerf.cpp
index 9be0319..6c12cfb 100644
--- a/src/tests/perf_tests/UniformsPerf.cpp
+++ b/src/tests/perf_tests/UniformsPerf.cpp
@@ -14,8 +14,8 @@
#include <random>
#include <sstream>
-#include "util/Matrix.h"
-#include "util/shader_utils.h"
+#include "Matrix.h"
+#include "shader_utils.h"
using namespace angle;
@@ -90,6 +90,7 @@
}
else
{
+ ASSERT(dataType == DataType::MAT4);
strstr << "_matrix";
}
diff --git a/src/tests/perf_tests/VulkanPipelineCachePerf.cpp b/src/tests/perf_tests/VulkanPipelineCachePerf.cpp
index 10c60a0..efbe128 100644
--- a/src/tests/perf_tests/VulkanPipelineCachePerf.cpp
+++ b/src/tests/perf_tests/VulkanPipelineCachePerf.cpp
@@ -9,7 +9,7 @@
#include "ANGLEPerfTest.h"
#include "libANGLE/renderer/vulkan/vk_cache_utils.h"
-#include "util/random_utils.h"
+#include "random_utils.h"
using namespace rx;
diff --git a/src/tests/test_utils/ANGLETest.cpp b/src/tests/test_utils/ANGLETest.cpp
index c8c6e60..fd310a0 100644
--- a/src/tests/test_utils/ANGLETest.cpp
+++ b/src/tests/test_utils/ANGLETest.cpp
@@ -8,9 +8,8 @@
//
#include "ANGLETest.h"
-
-#include "util/EGLWindow.h"
-#include "util/OSWindow.h"
+#include "EGLWindow.h"
+#include "OSWindow.h"
namespace angle
{
@@ -361,8 +360,7 @@
mPlatformMethods.context = &mPlatformContext;
mEGLWindow->setPlatformMethods(&mPlatformMethods);
- if (!mEGLWindow->initializeDisplayAndSurface(mOSWindow,
- ANGLETestEnvironment::GetEntryPointsLib()))
+ if (!mEGLWindow->initializeDisplayAndSurface(mOSWindow))
{
FAIL() << "egl display or surface init failed.";
}
@@ -372,10 +370,6 @@
FAIL() << "GL Context init failed.";
}
-#if defined(ANGLE_USE_UTIL_LOADER)
- angle::LoadGLES(eglGetProcAddress);
-#endif // defined(ANGLE_USE_UTIL_LOADER)
-
if (needSwap)
{
// Swap the buffers so that the default framebuffer picks up the resize
@@ -1253,21 +1247,12 @@
OSWindow *ANGLETestBase::mOSWindow = nullptr;
Optional<EGLint> ANGLETestBase::mLastRendererType;
-std::unique_ptr<angle::Library> ANGLETestEnvironment::gEntryPointsLib;
-
void ANGLETestEnvironment::SetUp()
{
if (!ANGLETestBase::InitTestWindow())
{
FAIL() << "Failed to create ANGLE test window.";
}
-
-#if defined(ANGLE_USE_UTIL_LOADER)
- if (!gEntryPointsLib)
- {
- gEntryPointsLib.reset(angle::OpenSharedLibrary(ANGLE_EGL_LIBRARY_NAME));
- }
-#endif // defined(ANGLE_USE_UTIL_LOADER)
}
void ANGLETestEnvironment::TearDown()
@@ -1279,24 +1264,3 @@
{
testing::AddGlobalTestEnvironment(new ANGLETestEnvironment());
}
-
-EGLTest::EGLTest() = default;
-
-EGLTest::~EGLTest() = default;
-
-void EGLTest::SetUp()
-{
-#if defined(ANGLE_USE_UTIL_LOADER)
- PFNEGLGETPROCADDRESSPROC getProcAddress;
- ANGLETestEnvironment::GetEntryPointsLib()->getAs("eglGetProcAddress", &getProcAddress);
- ASSERT_NE(nullptr, getProcAddress);
-
- angle::LoadEGL(getProcAddress);
- angle::LoadGLES(getProcAddress);
-#endif // defined(ANGLE_USE_UTIL_LOADER)
-}
-
-bool IsDisplayExtensionEnabled(EGLDisplay display, const std::string &extName)
-{
- return CheckExtensionExists(eglQueryString(display, EGL_EXTENSIONS), extName);
-}
diff --git a/src/tests/test_utils/ANGLETest.h b/src/tests/test_utils/ANGLETest.h
index c53d80a..b359a35 100644
--- a/src/tests/test_utils/ANGLETest.h
+++ b/src/tests/test_utils/ANGLETest.h
@@ -14,13 +14,13 @@
#include <algorithm>
#include <array>
+#include "angle_gl.h"
#include "angle_test_configs.h"
#include "common/angleutils.h"
#include "common/vector_utils.h"
#include "platform/Platform.h"
-#include "util/shader_utils.h"
-#include "util/system_utils.h"
-#include "util/util_gl.h"
+#include "shader_utils.h"
+#include "system_utils.h"
#define ASSERT_GL_TRUE(a) ASSERT_EQ(static_cast<GLboolean>(GL_TRUE), (a))
#define ASSERT_GL_FALSE(a) ASSERT_EQ(static_cast<GLboolean>(GL_FALSE), (a))
@@ -436,22 +436,6 @@
public:
void SetUp() override;
void TearDown() override;
-
- static angle::Library *GetEntryPointsLib() { return gEntryPointsLib.get(); }
-
- private:
- // For loading entry points.
- static std::unique_ptr<angle::Library> gEntryPointsLib;
-};
-
-// This base fixture loads the EGL entry points.
-class EGLTest : public testing::Test
-{
- public:
- EGLTest();
- ~EGLTest();
-
- void SetUp() override;
};
// Driver vendors
@@ -485,8 +469,6 @@
bool IsDebug();
bool IsRelease();
-bool IsDisplayExtensionEnabled(EGLDisplay display, const std::string &extName);
-
// Note: git cl format messes up this formatting.
#define ANGLE_SKIP_TEST_IF(COND) \
do \
diff --git a/src/tests/test_utils/MultiviewTest.cpp b/src/tests/test_utils/MultiviewTest.cpp
index 81d477d..6d29e74 100644
--- a/src/tests/test_utils/MultiviewTest.cpp
+++ b/src/tests/test_utils/MultiviewTest.cpp
@@ -55,7 +55,7 @@
textureData.resize(viewWidth * height * numLayers * 4, 0u);
// Multisampling is only supported for layered framebuffers.
- ASSERT_TRUE((samples == 0) || multiviewLayout == GL_FRAMEBUFFER_MULTIVIEW_LAYERED_ANGLE);
+ ASSERT((samples == 0) || multiviewLayout == GL_FRAMEBUFFER_MULTIVIEW_LAYERED_ANGLE);
// We can't upload data to multisample textures, so we clear them using a temporary framebuffer
// instead. The current framebuffer binding is stored so we can restore it once we're done with
@@ -177,7 +177,7 @@
break;
}
default:
- ASSERT_TRUE(false);
+ UNREACHABLE();
}
ASSERT_GL_NO_ERROR();
@@ -193,7 +193,7 @@
GLuint depthTexture,
GLuint depthStencilTexture)
{
- ASSERT_TRUE(colorTexture != 0u);
+ ASSERT(colorTexture != 0u);
std::vector<GLuint> colorTextures(1, colorTexture);
CreateMultiviewBackingTextures(multiviewLayout, samples, viewWidth, height, numLayers,
colorTextures, depthTexture, depthStencilTexture);
@@ -208,8 +208,8 @@
GLuint depthTexture,
GLuint depthStencilTexture)
{
- ASSERT_TRUE(multiviewLayout == GL_FRAMEBUFFER_MULTIVIEW_LAYERED_ANGLE || (baseViewIndex == 0));
- ASSERT_TRUE(depthTexture == 0u || depthStencilTexture == 0u);
+ ASSERT(multiviewLayout == GL_FRAMEBUFFER_MULTIVIEW_LAYERED_ANGLE || (baseViewIndex == 0));
+ ASSERT(depthTexture == 0u || depthStencilTexture == 0u);
switch (multiviewLayout)
{
case GL_FRAMEBUFFER_MULTIVIEW_SIDE_BY_SIDE_ANGLE:
@@ -259,7 +259,7 @@
}
break;
default:
- ASSERT_TRUE(false);
+ UNREACHABLE();
}
}
@@ -272,7 +272,7 @@
GLuint depthTexture,
GLuint depthStencilTexture)
{
- ASSERT_TRUE(colorTexture != 0u);
+ ASSERT(colorTexture != 0u);
std::vector<GLuint> colorTextures(1, colorTexture);
AttachMultiviewTextures(target, multiviewLayout, viewWidth, numViews, baseViewIndex,
colorTextures, depthTexture, depthStencilTexture);
diff --git a/src/tests/test_utils/angle_test_configs.cpp b/src/tests/test_utils/angle_test_configs.cpp
index 68274ad..3cb2448 100644
--- a/src/tests/test_utils/angle_test_configs.cpp
+++ b/src/tests/test_utils/angle_test_configs.cpp
@@ -6,8 +6,6 @@
#include "test_utils/angle_test_configs.h"
-#include "util/util_gl.h"
-
namespace angle
{
@@ -111,7 +109,7 @@
break;
default:
- stream << "_ERR";
+ UNREACHABLE();
break;
}
@@ -130,7 +128,7 @@
break;
default:
- stream << "_ERR";
+ UNREACHABLE();
break;
}
diff --git a/src/tests/test_utils/angle_test_configs.h b/src/tests/test_utils/angle_test_configs.h
index b031197..554de13 100644
--- a/src/tests/test_utils/angle_test_configs.h
+++ b/src/tests/test_utils/angle_test_configs.h
@@ -17,9 +17,9 @@
#include <EGL/egl.h>
#include <EGL/eglext.h>
+#include "EGLWindow.h"
#include "GLSLANG/ShaderLang.h"
#include "angle_test_instantiate.h"
-#include "util/EGLPlatformParameters.h"
namespace angle
{
diff --git a/src/tests/test_utils/angle_test_instantiate.cpp b/src/tests/test_utils/angle_test_instantiate.cpp
index 241f21b..c4c0975 100644
--- a/src/tests/test_utils/angle_test_instantiate.cpp
+++ b/src/tests/test_utils/angle_test_instantiate.cpp
@@ -12,11 +12,9 @@
#include <iostream>
#include <map>
-#include "angle_gl.h"
+#include "EGLWindow.h"
+#include "OSWindow.h"
#include "test_utils/angle_test_configs.h"
-#include "util/EGLWindow.h"
-#include "util/OSWindow.h"
-#include "util/system_utils.h"
namespace angle
{
@@ -80,15 +78,9 @@
if (result)
{
- std::unique_ptr<angle::Library> eglLibrary;
-
-#if defined(ANGLE_USE_UTIL_LOADER)
- eglLibrary.reset(angle::OpenSharedLibrary(ANGLE_EGL_LIBRARY_NAME));
-#endif // defined(ANGLE_USE_UTIL_LOADER)
-
EGLWindow *eglWindow =
new EGLWindow(param.majorVersion, param.minorVersion, param.eglParameters);
- result = eglWindow->initializeGL(osWindow, eglLibrary.get());
+ result = eglWindow->initializeGL(osWindow);
eglWindow->destroyGL();
SafeDelete(eglWindow);
diff --git a/src/tests/test_utils/angle_test_instantiate.h b/src/tests/test_utils/angle_test_instantiate.h
index 3e983cc..67be2b9 100644
--- a/src/tests/test_utils/angle_test_instantiate.h
+++ b/src/tests/test_utils/angle_test_instantiate.h
@@ -12,6 +12,8 @@
#include <gtest/gtest.h>
+#include "common/debug.h"
+
namespace angle
{
diff --git a/src/tests/test_utils/draw_call_perf_utils.cpp b/src/tests/test_utils/draw_call_perf_utils.cpp
index 10300a1..a3f94f8 100644
--- a/src/tests/test_utils/draw_call_perf_utils.cpp
+++ b/src/tests/test_utils/draw_call_perf_utils.cpp
@@ -11,7 +11,7 @@
#include <vector>
-#include "util/shader_utils.h"
+#include "shader_utils.h"
namespace
{
diff --git a/src/tests/test_utils/draw_call_perf_utils.h b/src/tests/test_utils/draw_call_perf_utils.h
index 87d645e..5256b51 100644
--- a/src/tests/test_utils/draw_call_perf_utils.h
+++ b/src/tests/test_utils/draw_call_perf_utils.h
@@ -12,7 +12,7 @@
#include <stddef.h>
-#include "util/gles_loader_autogen.h"
+#include "angle_gl.h"
// Returns program ID. The program is left in use, no uniforms.
GLuint SetupSimpleDrawProgram();
diff --git a/src/tests/test_utils/gl_raii.h b/src/tests/test_utils/gl_raii.h
index a2e7d0e..afddcfb 100644
--- a/src/tests/test_utils/gl_raii.h
+++ b/src/tests/test_utils/gl_raii.h
@@ -11,7 +11,7 @@
#include <functional>
-#include "util/shader_utils.h"
+#include "angle_gl.h"
namespace angle
{
@@ -22,11 +22,12 @@
using GLGen = decltype(glGenBuffers);
using GLDelete = decltype(glDeleteBuffers);
+template <GLGen GenF, GLDelete DeleteF>
class GLWrapper : angle::NonCopyable
{
public:
- GLWrapper(GLGen *genFunc, GLDelete *deleteFunc) : mGenFunc(genFunc), mDeleteFunc(deleteFunc) {}
- ~GLWrapper() { (*mDeleteFunc)(1, &mHandle); }
+ GLWrapper() {}
+ ~GLWrapper() { DeleteF(1, &mHandle); }
// The move-constructor and move-assignment operators are necessary so that the data within a
// GLWrapper object can be relocated.
@@ -44,7 +45,7 @@
{
if (mHandle != 0u)
{
- (*mDeleteFunc)(1, &mHandle);
+ DeleteF(1, &mHandle);
mHandle = 0u;
}
}
@@ -53,7 +54,7 @@
{
if (!mHandle)
{
- (*mGenFunc)(1, &mHandle);
+ GenF(1, &mHandle);
}
return mHandle;
}
@@ -61,56 +62,18 @@
operator GLuint() { return get(); }
private:
- GLGen *mGenFunc;
- GLDelete *mDeleteFunc;
GLuint mHandle = 0u;
};
-class GLVertexArray : public GLWrapper
-{
- public:
- GLVertexArray() : GLWrapper(&glGenVertexArrays, &glDeleteVertexArrays) {}
-};
-class GLBuffer : public GLWrapper
-{
- public:
- GLBuffer() : GLWrapper(&glGenBuffers, &glDeleteBuffers) {}
-};
-class GLTexture : public GLWrapper
-{
- public:
- GLTexture() : GLWrapper(&glGenTextures, &glDeleteTextures) {}
-};
-class GLFramebuffer : public GLWrapper
-{
- public:
- GLFramebuffer() : GLWrapper(&glGenFramebuffers, &glDeleteFramebuffers) {}
-};
-class GLRenderbuffer : public GLWrapper
-{
- public:
- GLRenderbuffer() : GLWrapper(&glGenRenderbuffers, &glDeleteRenderbuffers) {}
-};
-class GLSampler : public GLWrapper
-{
- public:
- GLSampler() : GLWrapper(&glGenSamplers, &glDeleteSamplers) {}
-};
-class GLTransformFeedback : public GLWrapper
-{
- public:
- GLTransformFeedback() : GLWrapper(&glGenTransformFeedbacks, &glDeleteTransformFeedbacks) {}
-};
-class GLProgramPipeline : public GLWrapper
-{
- public:
- GLProgramPipeline() : GLWrapper(&glGenProgramPipelines, &glDeleteProgramPipelines) {}
-};
-class GLQueryEXT : public GLWrapper
-{
- public:
- GLQueryEXT() : GLWrapper(&glGenQueriesEXT, &glDeleteQueriesEXT) {}
-};
+using GLVertexArray = GLWrapper<glGenVertexArrays, glDeleteVertexArrays>;
+using GLBuffer = GLWrapper<glGenBuffers, glDeleteBuffers>;
+using GLTexture = GLWrapper<glGenTextures, glDeleteTextures>;
+using GLFramebuffer = GLWrapper<glGenFramebuffers, glDeleteFramebuffers>;
+using GLRenderbuffer = GLWrapper<glGenRenderbuffers, glDeleteRenderbuffers>;
+using GLSampler = GLWrapper<glGenSamplers, glDeleteSamplers>;
+using GLTransformFeedback = GLWrapper<glGenTransformFeedbacks, glDeleteTransformFeedbacks>;
+using GLProgramPipeline = GLWrapper<glGenProgramPipelines, glDeleteProgramPipelines>;
+using GLQueryEXT = GLWrapper<glGenQueriesEXT, glDeleteQueriesEXT>;
class GLShader : angle::NonCopyable
{
@@ -175,7 +138,11 @@
bool valid() const { return mHandle != 0; }
- GLuint get() { return mHandle; }
+ GLuint get()
+ {
+ ASSERT(valid());
+ return mHandle;
+ }
operator GLuint() { return get(); }