Commit da61c40e by Kai Ninomiya Committed by Commit Bot

Revert "Work-around test runner & DebugAnnotator"

This reverts commit e44c94d9. Reason for revert: Breaks build of DisplayGbm on ChromeOS: src/libANGLE/renderer/gl/egl/gbm/DisplayGbm.{h,cpp} First failing builds: https://ci.chromium.org/p/chromium/builders/ci/ChromeOS%20FYI%20Release%20%28amd64-generic%29/1608 https://ci.chromium.org/p/chromium/builders/ci/ChromeOS%20FYI%20Release%20%28kevin%29/2212 Original change's description: > Work-around test runner & DebugAnnotator > > Note: This precedes another CL that needs this change. > > DebugAnnotator uses a global variable. The test runner doesn't change > state between testing different back-ends. This works-around the > problem by setting the global variable when the context is switched. > > Because the GL back-end doesn't have its own DebugAnnotator sub-class, > add a Display* to DisplayImpl::makeCurrent(), so that > DisplayGL::makeCurrent() can install the front-end-Display's > DebugAnnotator. > > Note: the Vulkan back-end gets this fix even though the new > DebugAnnotatorVk class will be added in a follow-on CL. > > Bug: b/162068318 > Bug: b/169243237 > Bug: angleproject:5121 > Change-Id: I748e8a1fd09b72e07242ac7fb39154537dcce534 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2444095 > Reviewed-by: Ian Elliott <ianelliott@google.com> > Reviewed-by: Jamie Madill <jmadill@chromium.org> > Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com> > Commit-Queue: Ian Elliott <ianelliott@google.com> TBR=courtneygo@google.com,ianelliott@google.com,jmadill@chromium.org Change-Id: I99df2716951726ead24961dc3d27a7ec63aeda80 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: b/162068318 Bug: b/169243237 Bug: angleproject:5121 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2451420Reviewed-by: 's avatarKai Ninomiya <kainino@chromium.org> Commit-Queue: Kai Ninomiya <kainino@chromium.org>
parent a8d4457c
......@@ -786,7 +786,7 @@ Error Display::initialize()
mBlobCache.resize(1024 * 1024);
}
setGlobalDebugAnnotator();
gl::InitializeDebugAnnotations(&mAnnotator);
gl::InitializeDebugMutexIfNeeded();
......@@ -1258,7 +1258,7 @@ Error Display::makeCurrent(gl::Context *previousContext,
}
}
ANGLE_TRY(mImplementation->makeCurrent(this, drawSurface, readSurface, context));
ANGLE_TRY(mImplementation->makeCurrent(drawSurface, readSurface, context));
if (context != nullptr)
{
......
......@@ -258,10 +258,6 @@ class Display final : public LabeledObject,
std::mutex &getDisplayGlobalMutex() { return mDisplayGlobalMutex; }
std::mutex &getProgramCacheMutex() { return mProgramCacheMutex; }
// Installs LoggingAnnotator as the global DebugAnnotator, for back-ends that do not implement
// their own DebugAnnotator.
void setGlobalDebugAnnotator() { gl::InitializeDebugAnnotations(&mAnnotator); }
private:
Display(EGLenum platform, EGLNativeDisplayType displayId, Device *eglDevice);
......
......@@ -69,8 +69,7 @@ class DisplayImpl : public EGLImplFactory, public angle::Subject
virtual egl::Error initialize(egl::Display *display) = 0;
virtual void terminate() = 0;
virtual egl::Error makeCurrent(egl::Display *display,
egl::Surface *drawSurface,
virtual egl::Error makeCurrent(egl::Surface *drawSurface,
egl::Surface *readSurface,
gl::Context *context) = 0;
......
......@@ -240,15 +240,10 @@ ShareGroupImpl *DisplayD3D::createShareGroup()
return new ShareGroupD3D();
}
egl::Error DisplayD3D::makeCurrent(egl::Display *display,
egl::Surface *drawSurface,
egl::Error DisplayD3D::makeCurrent(egl::Surface *drawSurface,
egl::Surface *readSurface,
gl::Context *context)
{
// Ensure the appropriate global DebugAnnotator is used
ASSERT(mRenderer != nullptr);
mRenderer->setGlobalDebugAnnotator();
return egl::NoError();
}
......
......@@ -62,8 +62,7 @@ class DisplayD3D : public DisplayImpl, public d3d::Context
ShareGroupImpl *createShareGroup() override;
egl::Error makeCurrent(egl::Display *display,
egl::Surface *drawSurface,
egl::Error makeCurrent(egl::Surface *drawSurface,
egl::Surface *readSurface,
gl::Context *context) override;
......
......@@ -194,8 +194,6 @@ class RendererD3D : public BufferFactoryD3D
virtual int getMajorShaderModel() const = 0;
virtual void setGlobalDebugAnnotator() = 0;
const angle::FeaturesD3D &getFeatures() const;
// Pixel operations
......
......@@ -956,11 +956,6 @@ egl::Error Renderer11::initializeD3DDevice()
return egl::NoError();
}
void Renderer11::setGlobalDebugAnnotator()
{
gl::InitializeDebugAnnotations(&mAnnotator);
}
// do any one-time device initialization
// NOTE: this is also needed after a device lost/reset
// to reset the scene status and ensure the default states are reset.
......
......@@ -475,8 +475,6 @@ class Renderer11 : public RendererD3D
gl::TextureType type,
gl::Texture **textureOut) override;
void setGlobalDebugAnnotator() override;
private:
void generateCaps(gl::Caps *outCaps,
gl::TextureCapsMap *outTextureCaps,
......
......@@ -154,11 +154,6 @@ Renderer9::Renderer9(egl::Display *display) : RendererD3D(display), mStateManage
gl::InitializeDebugAnnotations(&mAnnotator);
}
void Renderer9::setGlobalDebugAnnotator()
{
gl::InitializeDebugAnnotations(&mAnnotator);
}
Renderer9::~Renderer9()
{
if (mDevice)
......
......@@ -405,8 +405,6 @@ class Renderer9 : public RendererD3D
angle::Result ensureVertexDataManagerInitialized(const gl::Context *context);
void setGlobalDebugAnnotator() override;
private:
angle::Result drawArraysImpl(const gl::Context *context,
gl::PrimitiveMode mode,
......
......@@ -55,15 +55,10 @@ ShareGroupImpl *DisplayGL::createShareGroup()
return new ShareGroupGL();
}
egl::Error DisplayGL::makeCurrent(egl::Display *display,
egl::Surface *drawSurface,
egl::Error DisplayGL::makeCurrent(egl::Surface *drawSurface,
egl::Surface *readSurface,
gl::Context *context)
{
// Ensure that the correct global DebugAnnotator is installed when the end2end tests change
// the ANGLE back-end (done frequently).
display->setGlobalDebugAnnotator();
if (!context)
{
return egl::NoError();
......
......@@ -43,8 +43,7 @@ class DisplayGL : public DisplayImpl
ShareGroupImpl *createShareGroup() override;
egl::Error makeCurrent(egl::Display *display,
egl::Surface *drawSurface,
egl::Error makeCurrent(egl::Surface *drawSurface,
egl::Surface *readSurface,
gl::Context *context) override;
......
......@@ -33,8 +33,7 @@ class DisplayCGL : public DisplayGL
egl::Error initialize(egl::Display *display) override;
void terminate() override;
egl::Error makeCurrent(egl::Display *display,
egl::Surface *drawSurface,
egl::Error makeCurrent(egl::Surface *drawSurface,
egl::Surface *readSurface,
gl::Context *context) override;
......
......@@ -235,8 +235,7 @@ void DisplayCGL::terminate()
}
}
egl::Error DisplayCGL::makeCurrent(egl::Display *display,
egl::Surface *drawSurface,
egl::Error DisplayCGL::makeCurrent(egl::Surface *drawSurface,
egl::Surface *readSurface,
gl::Context *context)
{
......@@ -253,7 +252,7 @@ egl::Error DisplayCGL::makeCurrent(egl::Display *display,
CGLSetCurrentContext(newContext);
mCurrentContexts[std::this_thread::get_id()] = newContext;
}
return DisplayGL::makeCurrent(display, drawSurface, readSurface, context);
return DisplayGL::makeCurrent(drawSurface, readSurface, context);
}
SurfaceImpl *DisplayCGL::createWindowSurface(const egl::SurfaceState &state,
......
......@@ -557,8 +557,7 @@ egl::Error DisplayEGL::waitNative(const gl::Context *context, EGLint engine)
return egl::NoError();
}
egl::Error DisplayEGL::makeCurrent(egl::Display *display,
egl::Surface *drawSurface,
egl::Error DisplayEGL::makeCurrent(egl::Surface *drawSurface,
egl::Surface *readSurface,
gl::Context *context)
{
......@@ -588,7 +587,7 @@ egl::Error DisplayEGL::makeCurrent(egl::Display *display,
currentContext.context = newContext;
}
return DisplayGL::makeCurrent(display, drawSurface, readSurface, context);
return DisplayGL::makeCurrent(drawSurface, readSurface, context);
}
gl::Version DisplayEGL::getMaxSupportedESVersion() const
......
......@@ -81,8 +81,7 @@ class DisplayEGL : public DisplayGL
egl::Error waitClient(const gl::Context *context) override;
egl::Error waitNative(const gl::Context *context, EGLint engine) override;
egl::Error makeCurrent(egl::Display *display,
egl::Surface *drawSurface,
egl::Error makeCurrent(egl::Surface *drawSurface,
egl::Surface *readSurface,
gl::Context *context) override;
......
......@@ -268,8 +268,7 @@ ExternalImageSiblingImpl *DisplayAndroid::createExternalImageSibling(
}
}
egl::Error DisplayAndroid::makeCurrent(egl::Display *display,
egl::Surface *drawSurface,
egl::Error DisplayAndroid::makeCurrent(egl::Surface *drawSurface,
egl::Surface *readSurface,
gl::Context *context)
{
......@@ -325,7 +324,7 @@ egl::Error DisplayAndroid::makeCurrent(egl::Display *display,
currentContext.context = newContext;
}
return DisplayGL::makeCurrent(display, drawSurface, readSurface, context);
return DisplayGL::makeCurrent(drawSurface, readSurface, context);
}
void DisplayAndroid::destroyNativeContext(EGLContext context)
......
......@@ -46,8 +46,7 @@ class DisplayAndroid : public DisplayEGL
EGLClientBuffer buffer,
const egl::AttributeMap &attribs) override;
egl::Error makeCurrent(egl::Display *display,
egl::Surface *drawSurface,
egl::Error makeCurrent(egl::Surface *drawSurface,
egl::Surface *readSurface,
gl::Context *context) override;
......
......@@ -377,8 +377,7 @@ void DisplayGLX::terminate()
}
}
egl::Error DisplayGLX::makeCurrent(egl::Display *display,
egl::Surface *drawSurface,
egl::Error DisplayGLX::makeCurrent(egl::Surface *drawSurface,
egl::Surface *readSurface,
gl::Context *context)
{
......@@ -403,7 +402,7 @@ egl::Error DisplayGLX::makeCurrent(egl::Display *display,
mCurrentDrawable = newDrawable;
}
return DisplayGL::makeCurrent(display, drawSurface, readSurface, context);
return DisplayGL::makeCurrent(drawSurface, readSurface, context);
}
SurfaceImpl *DisplayGLX::createWindowSurface(const egl::SurfaceState &state,
......
......@@ -35,8 +35,7 @@ class DisplayGLX : public DisplayGL
egl::Error initialize(egl::Display *display) override;
void terminate() override;
egl::Error makeCurrent(egl::Display *display,
egl::Surface *drawSurface,
egl::Error makeCurrent(egl::Surface *drawSurface,
egl::Surface *readSurface,
gl::Context *context) override;
......
......@@ -679,8 +679,7 @@ egl::Error DisplayWGL::waitNative(const gl::Context *context, EGLint engine)
return egl::NoError();
}
egl::Error DisplayWGL::makeCurrent(egl::Display *display,
egl::Surface *drawSurface,
egl::Error DisplayWGL::makeCurrent(egl::Surface *drawSurface,
egl::Surface *readSurface,
gl::Context *context)
{
......@@ -721,7 +720,7 @@ egl::Error DisplayWGL::makeCurrent(egl::Display *display,
currentContext.glrc = newContext;
}
return DisplayGL::makeCurrent(display, drawSurface, readSurface, context);
return DisplayGL::makeCurrent(drawSurface, readSurface, context);
}
egl::Error DisplayWGL::registerD3DDevice(IUnknown *device, HANDLE *outHandle)
......
......@@ -70,8 +70,7 @@ class DisplayWGL : public DisplayGL
egl::Error waitClient(const gl::Context *context) override;
egl::Error waitNative(const gl::Context *context, EGLint engine) override;
egl::Error makeCurrent(egl::Display *display,
egl::Surface *drawSurface,
egl::Error makeCurrent(egl::Surface *drawSurface,
egl::Surface *readSurface,
gl::Context *context) override;
......
......@@ -85,8 +85,7 @@ class DisplayMtl : public DisplayImpl
EGLSyncImpl *createSync(const egl::AttributeMap &attribs) override;
egl::Error makeCurrent(egl::Display *display,
egl::Surface *drawSurface,
egl::Error makeCurrent(egl::Surface *drawSurface,
egl::Surface *readSurface,
gl::Context *context) override;
......
......@@ -245,8 +245,7 @@ EGLSyncImpl *DisplayMtl::createSync(const egl::AttributeMap &attribs)
return nullptr;
}
egl::Error DisplayMtl::makeCurrent(egl::Display *display,
egl::Surface *drawSurface,
egl::Error DisplayMtl::makeCurrent(egl::Surface *drawSurface,
egl::Surface *readSurface,
gl::Context *context)
{
......
......@@ -36,8 +36,7 @@ void DisplayNULL::terminate()
mAllocationTracker.reset();
}
egl::Error DisplayNULL::makeCurrent(egl::Display *display,
egl::Surface *drawSurface,
egl::Error DisplayNULL::makeCurrent(egl::Surface *drawSurface,
egl::Surface *readSurface,
gl::Context *context)
{
......
......@@ -28,8 +28,7 @@ class DisplayNULL : public DisplayImpl
egl::Error initialize(egl::Display *display) override;
void terminate() override;
egl::Error makeCurrent(egl::Display *display,
egl::Surface *drawSurface,
egl::Error makeCurrent(egl::Surface *drawSurface,
egl::Surface *readSurface,
gl::Context *context) override;
......
......@@ -50,15 +50,10 @@ void DisplayVk::terminate()
mRenderer->onDestroy();
}
egl::Error DisplayVk::makeCurrent(egl::Display * /*display*/,
egl::Surface * /*drawSurface*/,
egl::Error DisplayVk::makeCurrent(egl::Surface * /*drawSurface*/,
egl::Surface * /*readSurface*/,
gl::Context * /*context*/)
{
// Ensure the appropriate global DebugAnnotator is used
ASSERT(mRenderer);
mRenderer->setGlobalDebugAnnotator();
return egl::NoError();
}
......
......@@ -48,8 +48,7 @@ class DisplayVk : public DisplayImpl, public vk::Context
egl::Error initialize(egl::Display *display) override;
void terminate() override;
egl::Error makeCurrent(egl::Display *display,
egl::Surface *drawSurface,
egl::Error makeCurrent(egl::Surface *drawSurface,
egl::Surface *readSurface,
gl::Context *context) override;
......
......@@ -902,8 +902,6 @@ angle::Result RendererVk::initialize(DisplayVk *displayVk,
// Initialize the format table.
mFormatTable.initialize(this, &mNativeTextureCaps, &mNativeCaps.compressedTextureFormats);
setGlobalDebugAnnotator();
if (getFeatures().enableCommandProcessingThread.enabled)
{
mCommandProcessorThread =
......@@ -2376,13 +2374,6 @@ void RendererVk::onCompletedSerial(Serial serial)
}
}
void RendererVk::setGlobalDebugAnnotator()
{
// TODO(ianelliott): Implement this method.
//
// https://issuetracker.google.com/issues/162068318
}
void RendererVk::reloadVolkIfNeeded() const
{
#if defined(ANGLE_SHARED_LIBVULKAN)
......
......@@ -272,8 +272,6 @@ class RendererVk : angle::NonCopyable
vk::ResourceSerialFactory &getResourceSerialFactory() { return mResourceSerialFactory; }
void setGlobalDebugAnnotator();
private:
angle::Result initializeDevice(DisplayVk *displayVk, uint32_t queueFamilyIndex);
void ensureCapsInitialized() const;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment