Hash :
f176027f
Author :
Date :
2023-03-31T13:37:03
CGL: implement EGL_ANGLE_wait_until_work_scheduled It is as important to wait until scheduled in CGL, as it is in Metal. CGL waits until scheduled when glFlush() is called. Fixed: angleproject:8112 Change-Id: Id4a9e87804c6df1828b35cfd30c8427314820e52 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4386400 Commit-Queue: Kenneth Russell <kbr@chromium.org> Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com> Reviewed-by: Kenneth Russell <kbr@chromium.org>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
//
// Copyright 2022 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// EGLWaitUntilWorkScheduledTest.cpp:
// Checks the implementation of EGL_ANGLE_wait_until_work_scheduled.
//
#include <gtest/gtest.h>
#include <tuple>
#include "common/debug.h"
#include "common/string_utils.h"
#include "gpu_info_util/SystemInfo.h"
#include "test_utils/ANGLETest.h"
#include "test_utils/angle_test_platform.h"
#include "test_utils/system_info_util.h"
#include "util/OSWindow.h"
using namespace angle;
class EGLWaitUntilWorkScheduledTest : public ANGLETest<>
{
public:
void testSetUp() override { (void)GetSystemInfo(&mSystemInfo); }
protected:
EGLDisplay getDisplay() const { return getEGLWindow()->getDisplay(); }
SystemInfo mSystemInfo;
};
// Test if EGL_ANGLE_wait_until_work_scheduled is enabled that we can call
// eglWaitUntilWorkScheduledANGLE.
TEST_P(EGLWaitUntilWorkScheduledTest, WaitUntilWorkScheduled)
{
ANGLE_SKIP_TEST_IF(
!IsEGLDisplayExtensionEnabled(getDisplay(), "EGL_ANGLE_wait_until_work_scheduled"));
// We're not checking anything except that the function can be called.
eglWaitUntilWorkScheduledANGLE(getDisplay());
}
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(EGLWaitUntilWorkScheduledTest);
ANGLE_INSTANTIATE_TEST(EGLWaitUntilWorkScheduledTest,
ES2_METAL(),
ES3_METAL(),
ES2_OPENGL(),
ES3_OPENGL());