Hash :
be9e8e7b
Author :
Date :
2022-12-14T14:13:39
Add EGL_ANGLE_wait_until_work_scheduled extension We're changing eglReleaseTexImage so it calls flushCommandBuffer(mtl::NoWait) instead of flushCommandBuffer(mtl::WaitUntilScheduled) and then adding an extension to allow us to WaitUntilScheduled. This is because Chrome calls eglReleaseTexImage for every canvas and having it WaitUntilScheduled per call is very slow. So instead we'll call eglWaitUntilWorkScheduledANGLE once which will effectively wait just once. Bug: angleproject:7890 Change-Id: I87bc9f9a1a7f4a0f99d93736cc3083799e76afeb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4109311 Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Gregg Tavares <gman@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
//
// 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.
//
// EGLPowerPreferenceTest.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());