зеркало из https://github.com/AvaloniaUI/angle.git
Provide default implementation of rx::DisplayEGL
Will allow to use EGL instead of GLX on X11. Meant to be used on modern EGL so it requires the extensions EGL_KHR_no_config_context and EGL_KHR_surfaceless_context. This keeps the default implementation simple (no pBuffer fallback) Also provide simple WorkerContextEGL. Bug: angleproject:4328 Change-Id: I825c6998e4a3727a13e533ede3d9fb1820edc804 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2031699 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
This commit is contained in:
Родитель
77a5100d9a
Коммит
e82ab75a4c
|
@ -6,18 +6,60 @@
|
|||
|
||||
#include "libANGLE/renderer/gl/egl/ContextEGL.h"
|
||||
|
||||
#include "libANGLE/Context.h"
|
||||
#include "libANGLE/Display.h"
|
||||
#include "libANGLE/renderer/gl/egl/DisplayEGL.h"
|
||||
|
||||
namespace rx
|
||||
{
|
||||
ContextEGL::ContextEGL(const gl::State &state,
|
||||
gl::ErrorSet *errorSet,
|
||||
DisplayEGL *display,
|
||||
const gl::Context *shareContext,
|
||||
const std::shared_ptr<RendererEGL> &renderer)
|
||||
: ContextGL(state, errorSet, renderer), mRendererEGL(renderer)
|
||||
: ContextGL(state, errorSet, renderer),
|
||||
mDisplay(display),
|
||||
mShareContext(shareContext),
|
||||
mRendererEGL(renderer)
|
||||
{}
|
||||
|
||||
ContextEGL::~ContextEGL() {}
|
||||
|
||||
angle::Result ContextEGL::initialize()
|
||||
{
|
||||
ANGLE_TRY(ContextGL::initialize());
|
||||
|
||||
if (!mRendererEGL)
|
||||
{
|
||||
EGLContext nativeShareContext = EGL_NO_CONTEXT;
|
||||
if (mShareContext)
|
||||
{
|
||||
ContextEGL *shareContextEGL = GetImplAs<ContextEGL>(mShareContext);
|
||||
nativeShareContext = shareContextEGL->getContext();
|
||||
}
|
||||
|
||||
egl::Error error = mDisplay->createRenderer(nativeShareContext, &mRendererEGL);
|
||||
if (error.isError())
|
||||
{
|
||||
ERR() << "Failed to create a shared renderer: " << error.getMessage();
|
||||
return angle::Result::Stop;
|
||||
}
|
||||
|
||||
mRenderer = mRendererEGL;
|
||||
}
|
||||
|
||||
return angle::Result::Continue;
|
||||
}
|
||||
|
||||
EGLContext ContextEGL::getContext() const
|
||||
{
|
||||
ASSERT(mRendererEGL);
|
||||
return mRendererEGL->getContext();
|
||||
}
|
||||
|
||||
std::shared_ptr<RendererEGL> ContextEGL::getRenderer() const
|
||||
{
|
||||
return mRendererEGL;
|
||||
}
|
||||
|
||||
} // namespace rx
|
||||
|
|
|
@ -19,12 +19,20 @@ class ContextEGL : public ContextGL
|
|||
public:
|
||||
ContextEGL(const gl::State &state,
|
||||
gl::ErrorSet *errorSet,
|
||||
DisplayEGL *display,
|
||||
const gl::Context *shareContext,
|
||||
const std::shared_ptr<RendererEGL> &renderer);
|
||||
~ContextEGL() override;
|
||||
|
||||
angle::Result initialize() override;
|
||||
|
||||
EGLContext getContext() const;
|
||||
|
||||
std::shared_ptr<RendererEGL> getRenderer() const;
|
||||
|
||||
private:
|
||||
DisplayEGL *mDisplay;
|
||||
const gl::Context *mShareContext;
|
||||
std::shared_ptr<RendererEGL> mRendererEGL;
|
||||
};
|
||||
} // namespace rx
|
||||
|
|
|
@ -8,12 +8,95 @@
|
|||
|
||||
#include "libANGLE/renderer/gl/egl/DisplayEGL.h"
|
||||
|
||||
#include "common/debug.h"
|
||||
#include "libANGLE/Context.h"
|
||||
#include "libANGLE/Display.h"
|
||||
#include "libANGLE/Surface.h"
|
||||
#include "libANGLE/renderer/gl/ContextGL.h"
|
||||
#include "libANGLE/renderer/gl/RendererGL.h"
|
||||
#include "libANGLE/renderer/gl/egl/ContextEGL.h"
|
||||
#include "libANGLE/renderer/gl/egl/FunctionsEGLDL.h"
|
||||
#include "libANGLE/renderer/gl/egl/ImageEGL.h"
|
||||
#include "libANGLE/renderer/gl/egl/PbufferSurfaceEGL.h"
|
||||
#include "libANGLE/renderer/gl/egl/RendererEGL.h"
|
||||
#include "libANGLE/renderer/gl/egl/SyncEGL.h"
|
||||
#include "libANGLE/renderer/gl/egl/WindowSurfaceEGL.h"
|
||||
#include "libANGLE/renderer/gl/renderergl_utils.h"
|
||||
|
||||
namespace
|
||||
{
|
||||
|
||||
EGLint ESBitFromPlatformAttrib(const rx::FunctionsEGL *egl, const EGLAttrib platformAttrib)
|
||||
{
|
||||
EGLint esBit = EGL_NONE;
|
||||
switch (platformAttrib)
|
||||
{
|
||||
case EGL_PLATFORM_ANGLE_TYPE_OPENGL_ANGLE:
|
||||
{
|
||||
esBit = EGL_OPENGL_BIT;
|
||||
break;
|
||||
}
|
||||
|
||||
case EGL_PLATFORM_ANGLE_TYPE_OPENGLES_ANGLE:
|
||||
{
|
||||
static_assert(EGL_OPENGL_ES3_BIT == EGL_OPENGL_ES3_BIT_KHR,
|
||||
"Extension define must match core");
|
||||
|
||||
gl::Version eglVersion(egl->majorVersion, egl->minorVersion);
|
||||
esBit = (eglVersion >= gl::Version(1, 5) || egl->hasExtension("EGL_KHR_create_context"))
|
||||
? EGL_OPENGL_ES3_BIT
|
||||
: EGL_OPENGL_ES2_BIT;
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return esBit;
|
||||
}
|
||||
|
||||
class WorkerContextEGL final : public rx::WorkerContext
|
||||
{
|
||||
public:
|
||||
WorkerContextEGL(EGLContext context, rx::FunctionsEGL *functions, EGLSurface pbuffer);
|
||||
~WorkerContextEGL() override;
|
||||
|
||||
bool makeCurrent() override;
|
||||
void unmakeCurrent() override;
|
||||
|
||||
private:
|
||||
EGLContext mContext;
|
||||
rx::FunctionsEGL *mFunctions;
|
||||
EGLSurface mPbuffer;
|
||||
};
|
||||
|
||||
WorkerContextEGL::WorkerContextEGL(EGLContext context,
|
||||
rx::FunctionsEGL *functions,
|
||||
EGLSurface pbuffer)
|
||||
: mContext(context), mFunctions(functions), mPbuffer(pbuffer)
|
||||
{}
|
||||
|
||||
WorkerContextEGL::~WorkerContextEGL()
|
||||
{
|
||||
mFunctions->destroyContext(mContext);
|
||||
}
|
||||
|
||||
bool WorkerContextEGL::makeCurrent()
|
||||
{
|
||||
if (mFunctions->makeCurrent(mPbuffer, mContext) == EGL_FALSE)
|
||||
{
|
||||
ERR() << "Unable to make the EGL context current.";
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void WorkerContextEGL::unmakeCurrent()
|
||||
{
|
||||
mFunctions->makeCurrent(EGL_NO_SURFACE, EGL_NO_CONTEXT);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
namespace rx
|
||||
{
|
||||
|
@ -113,6 +196,96 @@ egl::Error DisplayEGL::initializeContext(EGLContext shareContext,
|
|||
return egl::Error(mEGL->getError(), "eglCreateContext failed");
|
||||
}
|
||||
|
||||
egl::Error DisplayEGL::initialize(egl::Display *display)
|
||||
{
|
||||
mDisplayAttributes = display->getAttributeMap();
|
||||
mEGL = new FunctionsEGLDL();
|
||||
|
||||
void *eglHandle =
|
||||
reinterpret_cast<void *>(mDisplayAttributes.get(EGL_PLATFORM_ANGLE_EGL_HANDLE_ANGLE, 0));
|
||||
ANGLE_TRY(mEGL->initialize(display->getNativeDisplayId(), "libEGL.so.1", eglHandle));
|
||||
|
||||
gl::Version eglVersion(mEGL->majorVersion, mEGL->minorVersion);
|
||||
if (eglVersion < gl::Version(1, 4))
|
||||
{
|
||||
return egl::EglNotInitialized() << "EGL >= 1.4 is required";
|
||||
}
|
||||
|
||||
// Only support modern EGL implementation to keep default implementation
|
||||
// simple.
|
||||
const char *necessaryExtensions[] = {
|
||||
"EGL_KHR_no_config_context",
|
||||
"EGL_KHR_surfaceless_context",
|
||||
};
|
||||
|
||||
for (const char *ext : necessaryExtensions)
|
||||
{
|
||||
if (!mEGL->hasExtension(ext))
|
||||
{
|
||||
return egl::EglNotInitialized() << "need " << ext;
|
||||
}
|
||||
}
|
||||
|
||||
const EGLAttrib platformAttrib = mDisplayAttributes.get(EGL_PLATFORM_ANGLE_TYPE_ANGLE, 0);
|
||||
EGLint esBit = ESBitFromPlatformAttrib(mEGL, platformAttrib);
|
||||
if (esBit == EGL_NONE)
|
||||
{
|
||||
return egl::EglNotInitialized() << "No matching ES Bit";
|
||||
}
|
||||
|
||||
std::vector<EGLint> configAttribListBase = {
|
||||
EGL_COLOR_BUFFER_TYPE, EGL_RGB_BUFFER, EGL_SURFACE_TYPE, EGL_WINDOW_BIT | EGL_PBUFFER_BIT,
|
||||
EGL_CONFIG_CAVEAT, EGL_NONE, EGL_CONFORMANT, esBit,
|
||||
EGL_RENDERABLE_TYPE, esBit, EGL_NONE};
|
||||
|
||||
mConfigAttribList = configAttribListBase;
|
||||
|
||||
EGLContext context = EGL_NO_CONTEXT;
|
||||
native_egl::AttributeVector attribs;
|
||||
ANGLE_TRY(initializeContext(EGL_NO_CONTEXT, mDisplayAttributes, &context, &attribs));
|
||||
|
||||
if (!mEGL->makeCurrent(EGL_NO_SURFACE, context))
|
||||
{
|
||||
return egl::EglNotInitialized() << "Could not make context current.";
|
||||
}
|
||||
|
||||
std::unique_ptr<FunctionsGL> functionsGL(mEGL->makeFunctionsGL());
|
||||
functionsGL->initialize(mDisplayAttributes);
|
||||
|
||||
mRenderer.reset(
|
||||
new RendererEGL(std::move(functionsGL), mDisplayAttributes, this, context, attribs));
|
||||
const gl::Version &maxVersion = mRenderer->getMaxSupportedESVersion();
|
||||
if (maxVersion < gl::Version(2, 0))
|
||||
{
|
||||
return egl::EglNotInitialized() << "OpenGL ES 2.0 is not supportable.";
|
||||
}
|
||||
|
||||
ANGLE_TRY(DisplayGL::initialize(display));
|
||||
|
||||
return egl::NoError();
|
||||
}
|
||||
|
||||
void DisplayEGL::terminate()
|
||||
{
|
||||
DisplayGL::terminate();
|
||||
|
||||
EGLBoolean success = mEGL->makeCurrent(EGL_NO_SURFACE, EGL_NO_CONTEXT);
|
||||
if (success == EGL_FALSE)
|
||||
{
|
||||
ERR() << "eglMakeCurrent error " << egl::Error(mEGL->getError());
|
||||
}
|
||||
|
||||
mRenderer.reset();
|
||||
|
||||
egl::Error result = mEGL->terminate();
|
||||
if (result.isError())
|
||||
{
|
||||
ERR() << "eglTerminate error " << result;
|
||||
}
|
||||
|
||||
SafeDelete(mEGL);
|
||||
}
|
||||
|
||||
SurfaceImpl *DisplayEGL::createWindowSurface(const egl::SurfaceState &state,
|
||||
EGLNativeWindowType window,
|
||||
const egl::AttributeMap &attribs)
|
||||
|
@ -159,6 +332,15 @@ SurfaceImpl *DisplayEGL::createPixmapSurface(const egl::SurfaceState &state,
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
ContextImpl *DisplayEGL::createContext(const gl::State &state,
|
||||
gl::ErrorSet *errorSet,
|
||||
const egl::Config *configuration,
|
||||
const gl::Context *shareContext,
|
||||
const egl::AttributeMap &attribs)
|
||||
{
|
||||
return new ContextEGL(state, errorSet, this, shareContext, nullptr);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void DisplayEGL::getConfigAttrib(EGLConfig config, EGLint attribute, T *value) const
|
||||
{
|
||||
|
@ -349,6 +531,37 @@ egl::Error DisplayEGL::waitNative(const gl::Context *context, EGLint engine)
|
|||
return egl::NoError();
|
||||
}
|
||||
|
||||
egl::Error DisplayEGL::makeCurrent(egl::Surface *drawSurface,
|
||||
egl::Surface *readSurface,
|
||||
gl::Context *context)
|
||||
{
|
||||
EGLSurface newSurface = EGL_NO_SURFACE;
|
||||
if (drawSurface)
|
||||
{
|
||||
SurfaceEGL *drawSurfaceEGL = GetImplAs<SurfaceEGL>(drawSurface);
|
||||
newSurface = drawSurfaceEGL->getSurface();
|
||||
}
|
||||
|
||||
EGLContext newContext = EGL_NO_CONTEXT;
|
||||
if (context)
|
||||
{
|
||||
ContextEGL *contextEGL = GetImplAs<ContextEGL>(context);
|
||||
if (!contextEGL->getRenderer() && contextEGL->initialize() != angle::Result::Continue)
|
||||
{
|
||||
return egl::Error(mEGL->getError(), "eglMakeCurrent failed");
|
||||
}
|
||||
|
||||
newContext = contextEGL->getContext();
|
||||
}
|
||||
|
||||
if (mEGL->makeCurrent(newSurface, newContext) == EGL_FALSE)
|
||||
{
|
||||
return egl::Error(mEGL->getError(), "eglMakeCurrent failed");
|
||||
}
|
||||
|
||||
return DisplayGL::makeCurrent(drawSurface, readSurface, context);
|
||||
}
|
||||
|
||||
gl::Version DisplayEGL::getMaxSupportedESVersion() const
|
||||
{
|
||||
return mRenderer->getMaxSupportedESVersion();
|
||||
|
@ -416,6 +629,8 @@ void DisplayEGL::generateExtensions(egl::DisplayExtensions *outExtensions) const
|
|||
|
||||
outExtensions->noConfigContext = mEGL->hasExtension("EGL_KHR_no_config_context");
|
||||
|
||||
outExtensions->surfacelessContext = mEGL->hasExtension("EGL_KHR_surfaceless_context");
|
||||
|
||||
outExtensions->framebufferTargetANDROID = mEGL->hasExtension("EGL_ANDROID_framebuffer_target");
|
||||
|
||||
DisplayGL::generateExtensions(outExtensions);
|
||||
|
@ -441,6 +656,41 @@ egl::Error DisplayEGL::makeCurrentSurfaceless(gl::Context *context)
|
|||
return egl::NoError();
|
||||
}
|
||||
|
||||
egl::Error DisplayEGL::createRenderer(EGLContext shareContext,
|
||||
std::shared_ptr<RendererEGL> *outRenderer)
|
||||
{
|
||||
EGLContext context = EGL_NO_CONTEXT;
|
||||
native_egl::AttributeVector attribs;
|
||||
ANGLE_TRY(initializeContext(shareContext, mDisplayAttributes, &context, &attribs));
|
||||
|
||||
if (mEGL->makeCurrent(EGL_NO_SURFACE, context) == EGL_FALSE)
|
||||
{
|
||||
return egl::EglNotInitialized()
|
||||
<< "eglMakeCurrent failed with " << egl::Error(mEGL->getError());
|
||||
}
|
||||
|
||||
std::unique_ptr<FunctionsGL> functionsGL(mEGL->makeFunctionsGL());
|
||||
functionsGL->initialize(mDisplayAttributes);
|
||||
|
||||
outRenderer->reset(
|
||||
new RendererEGL(std::move(functionsGL), mDisplayAttributes, this, context, attribs));
|
||||
|
||||
return egl::NoError();
|
||||
}
|
||||
|
||||
WorkerContext *DisplayEGL::createWorkerContext(std::string *infoLog,
|
||||
EGLContext sharedContext,
|
||||
const native_egl::AttributeVector workerAttribs)
|
||||
{
|
||||
EGLContext context = mEGL->createContext(mConfig, sharedContext, workerAttribs.data());
|
||||
if (context == EGL_NO_CONTEXT)
|
||||
{
|
||||
*infoLog += "Unable to create the EGL context.";
|
||||
return nullptr;
|
||||
}
|
||||
return new WorkerContextEGL(context, mEGL, EGL_NO_SURFACE);
|
||||
}
|
||||
|
||||
void DisplayEGL::initializeFrontendFeatures(angle::FrontendFeatures *features) const
|
||||
{
|
||||
mRenderer->initializeFrontendFeatures(features);
|
||||
|
|
|
@ -14,12 +14,12 @@
|
|||
#include <vector>
|
||||
|
||||
#include "libANGLE/renderer/gl/DisplayGL.h"
|
||||
#include "libANGLE/renderer/gl/egl/FunctionsEGL.h"
|
||||
#include "libANGLE/renderer/gl/egl/egl_utils.h"
|
||||
|
||||
namespace rx
|
||||
{
|
||||
|
||||
class FunctionsEGLDL;
|
||||
class RendererEGL;
|
||||
class WorkerContext;
|
||||
|
||||
|
@ -44,7 +44,13 @@ class DisplayEGL : public DisplayGL
|
|||
|
||||
virtual WorkerContext *createWorkerContext(std::string *infoLog,
|
||||
EGLContext sharedContext,
|
||||
const native_egl::AttributeVector workerAttribs) = 0;
|
||||
const native_egl::AttributeVector workerAttribs);
|
||||
|
||||
virtual egl::Error createRenderer(EGLContext shareContext,
|
||||
std::shared_ptr<RendererEGL> *outRenderer);
|
||||
|
||||
egl::Error initialize(egl::Display *display) override;
|
||||
void terminate() override;
|
||||
|
||||
SurfaceImpl *createWindowSurface(const egl::SurfaceState &state,
|
||||
EGLNativeWindowType window,
|
||||
|
@ -59,6 +65,12 @@ class DisplayEGL : public DisplayGL
|
|||
NativePixmapType nativePixmap,
|
||||
const egl::AttributeMap &attribs) override;
|
||||
|
||||
ContextImpl *createContext(const gl::State &state,
|
||||
gl::ErrorSet *errorSet,
|
||||
const egl::Config *configuration,
|
||||
const gl::Context *shareContext,
|
||||
const egl::AttributeMap &attribs) override;
|
||||
|
||||
egl::ConfigSet generateConfigs() override;
|
||||
|
||||
bool testDeviceLost() override;
|
||||
|
@ -71,6 +83,10 @@ 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::Surface *drawSurface,
|
||||
egl::Surface *readSurface,
|
||||
gl::Context *context) override;
|
||||
|
||||
gl::Version getMaxSupportedESVersion() const override;
|
||||
|
||||
void initializeFrontendFeatures(angle::FrontendFeatures *features) const override;
|
||||
|
@ -98,7 +114,7 @@ class DisplayEGL : public DisplayGL
|
|||
const U &defaultValue) const;
|
||||
|
||||
std::shared_ptr<RendererEGL> mRenderer;
|
||||
FunctionsEGL *mEGL;
|
||||
FunctionsEGLDL *mEGL;
|
||||
EGLConfig mConfig;
|
||||
egl::AttributeMap mDisplayAttributes;
|
||||
std::vector<EGLint> mConfigAttribList;
|
||||
|
|
|
@ -152,7 +152,7 @@ egl::Error DisplayAndroid::initialize(egl::Display *display)
|
|||
mConfig = configWithFormat;
|
||||
}
|
||||
|
||||
ANGLE_TRY(createRenderer(EGL_NO_CONTEXT, true, &mRenderer));
|
||||
ANGLE_TRY(createRendererHelper(EGL_NO_CONTEXT, true, &mRenderer));
|
||||
|
||||
const gl::Version &maxVersion = mRenderer->getMaxSupportedESVersion();
|
||||
if (maxVersion < gl::Version(2, 0))
|
||||
|
@ -210,27 +210,8 @@ ContextImpl *DisplayAndroid::createContext(const gl::State &state,
|
|||
{
|
||||
renderer = mRenderer;
|
||||
}
|
||||
else
|
||||
{
|
||||
EGLContext nativeShareContext = EGL_NO_CONTEXT;
|
||||
if (shareContext)
|
||||
{
|
||||
ContextEGL *shareContextEGL = GetImplAs<ContextEGL>(shareContext);
|
||||
nativeShareContext = shareContextEGL->getContext();
|
||||
}
|
||||
|
||||
// Create a new renderer for this context. It only needs to share with the user's requested
|
||||
// share context because there are no internal resources in DisplayAndroid that are shared
|
||||
// at the GL level.
|
||||
egl::Error error = createRenderer(nativeShareContext, false, &renderer);
|
||||
if (error.isError())
|
||||
{
|
||||
ERR() << "Failed to create a shared renderer: " << error.getMessage();
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
return new ContextEGL(state, errorSet, renderer);
|
||||
return new ContextEGL(state, errorSet, this, shareContext, renderer);
|
||||
}
|
||||
|
||||
bool DisplayAndroid::isValidNativeWindow(EGLNativeWindowType window) const
|
||||
|
@ -286,7 +267,11 @@ egl::Error DisplayAndroid::makeCurrent(egl::Surface *drawSurface,
|
|||
if (context)
|
||||
{
|
||||
ContextEGL *contextEGL = GetImplAs<ContextEGL>(context);
|
||||
newContext = contextEGL->getContext();
|
||||
if (!contextEGL->getRenderer() && contextEGL->initialize() != angle::Result::Continue)
|
||||
{
|
||||
return egl::Error(mEGL->getError(), "eglMakeCurrent failed");
|
||||
}
|
||||
newContext = contextEGL->getContext();
|
||||
}
|
||||
|
||||
// The context should never change when context virtualization is being used, even when a null
|
||||
|
@ -346,16 +331,16 @@ void DisplayAndroid::destroyNativeContext(EGLContext context)
|
|||
|
||||
void DisplayAndroid::generateExtensions(egl::DisplayExtensions *outExtensions) const
|
||||
{
|
||||
DisplayEGL::generateExtensions(outExtensions);
|
||||
|
||||
// Surfaceless can be support if the native driver supports it or we know that we are running on
|
||||
// a single thread (mVirtualizedContexts == true)
|
||||
outExtensions->surfacelessContext = mSupportsSurfaceless || mVirtualizedContexts;
|
||||
|
||||
DisplayEGL::generateExtensions(outExtensions);
|
||||
}
|
||||
|
||||
egl::Error DisplayAndroid::createRenderer(EGLContext shareContext,
|
||||
bool makeNewContextCurrent,
|
||||
std::shared_ptr<RendererEGL> *outRenderer)
|
||||
egl::Error DisplayAndroid::createRendererHelper(EGLContext shareContext,
|
||||
bool makeNewContextCurrent,
|
||||
std::shared_ptr<RendererEGL> *outRenderer)
|
||||
{
|
||||
EGLContext context = EGL_NO_CONTEXT;
|
||||
native_egl::AttributeVector attribs;
|
||||
|
@ -446,4 +431,10 @@ WorkerContext *DisplayAndroid::createWorkerContext(std::string *infoLog,
|
|||
return new WorkerContextAndroid(context, mEGL, mDummyPbuffer);
|
||||
}
|
||||
|
||||
egl::Error DisplayAndroid::createRenderer(EGLContext shareContext,
|
||||
std::shared_ptr<RendererEGL> *outRenderer)
|
||||
{
|
||||
return createRendererHelper(shareContext, false, outRenderer);
|
||||
}
|
||||
|
||||
} // namespace rx
|
||||
|
|
|
@ -57,12 +57,15 @@ class DisplayAndroid : public DisplayEGL
|
|||
EGLContext sharedContext,
|
||||
const native_egl::AttributeVector workerAttribs) override;
|
||||
|
||||
egl::Error createRenderer(EGLContext shareContext,
|
||||
std::shared_ptr<RendererEGL> *outRenderer) override;
|
||||
|
||||
private:
|
||||
void generateExtensions(egl::DisplayExtensions *outExtensions) const override;
|
||||
|
||||
egl::Error createRenderer(EGLContext shareContext,
|
||||
bool makeNewContextCurrent,
|
||||
std::shared_ptr<RendererEGL> *outRenderer);
|
||||
egl::Error createRendererHelper(EGLContext shareContext,
|
||||
bool makeNewContextCurrent,
|
||||
std::shared_ptr<RendererEGL> *outRenderer);
|
||||
|
||||
bool mVirtualizedContexts;
|
||||
|
||||
|
|
|
@ -917,7 +917,7 @@ ContextImpl *DisplayOzone::createContext(const gl::State &state,
|
|||
const egl::AttributeMap &attribs)
|
||||
{
|
||||
// All contexts on Ozone are virtualized and share the same renderer.
|
||||
return new ContextEGL(state, errorSet, mRenderer);
|
||||
return new ContextEGL(state, errorSet, this, shareContext, mRenderer);
|
||||
}
|
||||
|
||||
egl::ConfigSet DisplayOzone::generateConfigs()
|
||||
|
|
Загрузка…
Ссылка в новой задаче