Commit 78a51911 by Jonah Ryan-Davis Committed by Commit Bot

Clean up and expose frontend features to egl.

gl::Workarounds was used to hold frontend features. Change ownership of this struct from Context to Display, so it can be exposed to egl. Also rename to features and clean up for consistency. Bug: angleproject:1621 Change-Id: I82e98e53873abb7a402c93e60f8a662a7263e0d5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1655772 Commit-Queue: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org>
parent 94eb189b
...@@ -39,7 +39,6 @@ ...@@ -39,7 +39,6 @@
#include "libANGLE/Texture.h" #include "libANGLE/Texture.h"
#include "libANGLE/TransformFeedback.h" #include "libANGLE/TransformFeedback.h"
#include "libANGLE/VertexArray.h" #include "libANGLE/VertexArray.h"
#include "libANGLE/Workarounds.h"
#include "libANGLE/formatutils.h" #include "libANGLE/formatutils.h"
#include "libANGLE/queryconversions.h" #include "libANGLE/queryconversions.h"
#include "libANGLE/queryutils.h" #include "libANGLE/queryutils.h"
...@@ -337,7 +336,12 @@ void Context::initialize() ...@@ -337,7 +336,12 @@ void Context::initialize()
mImplementation->setMemoryProgramCache(mMemoryProgramCache); mImplementation->setMemoryProgramCache(mMemoryProgramCache);
initCaps(); initCaps();
initWorkarounds();
if (mDisplay->getFrontendFeatures().syncFramebufferBindingsOnTexImage.enabled)
{
mTexImageDirtyBits.set(State::DIRTY_BIT_READ_FRAMEBUFFER_BINDING);
mTexImageDirtyBits.set(State::DIRTY_BIT_DRAW_FRAMEBUFFER_BINDING);
}
mState.initialize(this); mState.initialize(this);
...@@ -3475,24 +3479,6 @@ void Context::updateCaps() ...@@ -3475,24 +3479,6 @@ void Context::updateCaps()
mStateCache.initialize(this); mStateCache.initialize(this);
} }
void Context::initWorkarounds()
{
// Apply back-end workarounds.
mImplementation->applyNativeWorkarounds(&mWorkarounds);
// Lose the context upon out of memory error if the application is
// expecting to watch for those events.
mWorkarounds.loseContextOnOutOfMemory.enabled =
(mResetStrategy == GL_LOSE_CONTEXT_ON_RESET_EXT);
if (mWorkarounds.syncFramebufferBindingsOnTexImage.enabled)
{
// Update the Framebuffer bindings on TexImage to work around an Intel bug.
mTexImageDirtyBits.set(State::DIRTY_BIT_READ_FRAMEBUFFER_BINDING);
mTexImageDirtyBits.set(State::DIRTY_BIT_DRAW_FRAMEBUFFER_BINDING);
}
}
bool Context::noopDrawInstanced(PrimitiveMode mode, GLsizei count, GLsizei instanceCount) bool Context::noopDrawInstanced(PrimitiveMode mode, GLsizei count, GLsizei instanceCount)
{ {
return (instanceCount == 0) || noopDraw(mode, count); return (instanceCount == 0) || noopDraw(mode, count);
...@@ -5064,11 +5050,6 @@ void Context::attachShader(GLuint program, GLuint shader) ...@@ -5064,11 +5050,6 @@ void Context::attachShader(GLuint program, GLuint shader)
programObject->attachShader(shaderObject); programObject->attachShader(shaderObject);
} }
const Workarounds &Context::getWorkarounds() const
{
return mWorkarounds;
}
void Context::copyBufferSubData(BufferBinding readTarget, void Context::copyBufferSubData(BufferBinding readTarget,
BufferBinding writeTarget, BufferBinding writeTarget,
GLintptr readOffset, GLintptr readOffset,
...@@ -8126,6 +8107,11 @@ Shader *Context::getShader(GLuint handle) const ...@@ -8126,6 +8107,11 @@ Shader *Context::getShader(GLuint handle) const
return mState.mShaderProgramManager->getShader(handle); return mState.mShaderProgramManager->getShader(handle);
} }
const FrontendFeatures &Context::getFrontendFeatures() const
{
return mDisplay->getFrontendFeatures();
}
bool Context::isRenderbufferGenerated(GLuint renderbuffer) const bool Context::isRenderbufferGenerated(GLuint renderbuffer) const
{ {
return mState.mRenderbufferManager->isHandleGenerated(renderbuffer); return mState.mRenderbufferManager->isHandleGenerated(renderbuffer);
...@@ -8333,7 +8319,8 @@ void ErrorSet::handleError(GLenum errorCode, ...@@ -8333,7 +8319,8 @@ void ErrorSet::handleError(GLenum errorCode,
unsigned int line) unsigned int line)
{ {
if (errorCode == GL_OUT_OF_MEMORY && if (errorCode == GL_OUT_OF_MEMORY &&
mContext->getWorkarounds().loseContextOnOutOfMemory.enabled) mContext->getGraphicsResetStrategy() == GL_LOSE_CONTEXT_ON_RESET_EXT &&
mContext->getDisplay()->getFrontendFeatures().loseContextOnOutOfMemory.enabled)
{ {
mContext->markContextLost(GraphicsResetStatus::UnknownContextReset); mContext->markContextLost(GraphicsResetStatus::UnknownContextReset);
} }
......
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
#include "libANGLE/ResourceMap.h" #include "libANGLE/ResourceMap.h"
#include "libANGLE/State.h" #include "libANGLE/State.h"
#include "libANGLE/VertexAttribute.h" #include "libANGLE/VertexAttribute.h"
#include "libANGLE/Workarounds.h"
#include "libANGLE/WorkerThread.h" #include "libANGLE/WorkerThread.h"
#include "libANGLE/angletypes.h" #include "libANGLE/angletypes.h"
...@@ -51,6 +50,7 @@ class Buffer; ...@@ -51,6 +50,7 @@ class Buffer;
class Compiler; class Compiler;
class FenceNV; class FenceNV;
class Framebuffer; class Framebuffer;
struct FrontendFeatures;
class GLES1Renderer; class GLES1Renderer;
class MemoryProgramCache; class MemoryProgramCache;
class MemoryObject; class MemoryObject;
...@@ -1772,6 +1772,7 @@ class Context final : public egl::LabeledObject, angle::NonCopyable, public angl ...@@ -1772,6 +1772,7 @@ class Context final : public egl::LabeledObject, angle::NonCopyable, public angl
bool isContextLost() const { return mContextLost; } bool isContextLost() const { return mContextLost; }
GLenum getGraphicsResetStatus(); GLenum getGraphicsResetStatus();
GLenum getGraphicsResetStrategy() const { return mResetStrategy; }
bool isResetNotificationEnabled(); bool isResetNotificationEnabled();
const egl::Config *getConfig() const; const egl::Config *getConfig() const;
...@@ -1788,7 +1789,6 @@ class Context final : public egl::LabeledObject, angle::NonCopyable, public angl ...@@ -1788,7 +1789,6 @@ class Context final : public egl::LabeledObject, angle::NonCopyable, public angl
size_t getRequestableExtensionStringCount() const; size_t getRequestableExtensionStringCount() const;
rx::ContextImpl *getImplementation() const { return mImplementation.get(); } rx::ContextImpl *getImplementation() const { return mImplementation.get(); }
const Workarounds &getWorkarounds() const;
ANGLE_NO_DISCARD bool getScratchBuffer(size_t requestedSizeBytes, ANGLE_NO_DISCARD bool getScratchBuffer(size_t requestedSizeBytes,
angle::MemoryBuffer **scratchBufferOut) const; angle::MemoryBuffer **scratchBufferOut) const;
...@@ -1885,6 +1885,8 @@ class Context final : public egl::LabeledObject, angle::NonCopyable, public angl ...@@ -1885,6 +1885,8 @@ class Context final : public egl::LabeledObject, angle::NonCopyable, public angl
bool isBufferAccessValidationEnabled() const { return mBufferAccessValidationEnabled; } bool isBufferAccessValidationEnabled() const { return mBufferAccessValidationEnabled; }
const FrontendFeatures &getFrontendFeatures() const;
private: private:
void initialize(); void initialize();
...@@ -1930,7 +1932,6 @@ class Context final : public egl::LabeledObject, angle::NonCopyable, public angl ...@@ -1930,7 +1932,6 @@ class Context final : public egl::LabeledObject, angle::NonCopyable, public angl
Extensions generateSupportedExtensions() const; Extensions generateSupportedExtensions() const;
void initCaps(); void initCaps();
void updateCaps(); void updateCaps();
void initWorkarounds();
gl::LabeledObject *getLabeledObject(GLenum identifier, GLuint name) const; gl::LabeledObject *getLabeledObject(GLenum identifier, GLuint name) const;
gl::LabeledObject *getLabeledObjectFromPtr(const void *ptr) const; gl::LabeledObject *getLabeledObjectFromPtr(const void *ptr) const;
...@@ -2020,8 +2021,6 @@ class Context final : public egl::LabeledObject, angle::NonCopyable, public angl ...@@ -2020,8 +2021,6 @@ class Context final : public egl::LabeledObject, angle::NonCopyable, public angl
State::DirtyObjects mComputeDirtyObjects; State::DirtyObjects mComputeDirtyObjects;
State::DirtyObjects mCopyImageDirtyObjects; State::DirtyObjects mCopyImageDirtyObjects;
Workarounds mWorkarounds;
// Binding to container objects that use dependent state updates. // Binding to container objects that use dependent state updates.
angle::ObserverBinding mVertexArrayObserverBinding; angle::ObserverBinding mVertexArrayObserverBinding;
angle::ObserverBinding mDrawFramebufferObserverBinding; angle::ObserverBinding mDrawFramebufferObserverBinding;
......
...@@ -564,7 +564,10 @@ Error Display::initialize() ...@@ -564,7 +564,10 @@ Error Display::initialize()
config.second.renderableType |= EGL_OPENGL_ES_BIT; config.second.renderableType |= EGL_OPENGL_ES_BIT;
} }
initializeFrontendFeatures();
mFeatures.clear(); mFeatures.clear();
mFrontendFeatures.populateFeatureList(&mFeatures);
mImplementation->populateFeatureList(&mFeatures); mImplementation->populateFeatureList(&mFeatures);
initDisplayExtensions(); initDisplayExtensions();
...@@ -1341,6 +1344,16 @@ void Display::initVendorString() ...@@ -1341,6 +1344,16 @@ void Display::initVendorString()
mVendorString = mImplementation->getVendorString(); mVendorString = mImplementation->getVendorString();
} }
void Display::initializeFrontendFeatures()
{
// Enable on all Impls
mFrontendFeatures.loseContextOnOutOfMemory.enabled = true;
mImplementation->initializeFrontendFeatures(&mFrontendFeatures);
rx::OverrideFeaturesWithDisplayState(&mFrontendFeatures, mState);
}
const DisplayExtensions &Display::getExtensions() const const DisplayExtensions &Display::getExtensions() const
{ {
return mDisplayExtensions; return mDisplayExtensions;
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include "libANGLE/Config.h" #include "libANGLE/Config.h"
#include "libANGLE/Debug.h" #include "libANGLE/Debug.h"
#include "libANGLE/Error.h" #include "libANGLE/Error.h"
#include "libANGLE/FrontendFeatures.h"
#include "libANGLE/LoggingAnnotator.h" #include "libANGLE/LoggingAnnotator.h"
#include "libANGLE/MemoryProgramCache.h" #include "libANGLE/MemoryProgramCache.h"
#include "libANGLE/Version.h" #include "libANGLE/Version.h"
...@@ -193,6 +194,8 @@ class Display final : public LabeledObject, angle::NonCopyable ...@@ -193,6 +194,8 @@ class Display final : public LabeledObject, angle::NonCopyable
typedef std::set<gl::Context *> ContextSet; typedef std::set<gl::Context *> ContextSet;
const ContextSet &getContextSet() { return mContextSet; } const ContextSet &getContextSet() { return mContextSet; }
const gl::FrontendFeatures &getFrontendFeatures() { return mFrontendFeatures; }
const angle::FeatureList &getFeatures() const { return mFeatures; } const angle::FeatureList &getFeatures() const { return mFeatures; }
const char *queryStringi(const EGLint name, const EGLint index); const char *queryStringi(const EGLint name, const EGLint index);
...@@ -208,6 +211,7 @@ class Display final : public LabeledObject, angle::NonCopyable ...@@ -208,6 +211,7 @@ class Display final : public LabeledObject, angle::NonCopyable
void initDisplayExtensions(); void initDisplayExtensions();
void initVendorString(); void initVendorString();
void initializeFrontendFeatures();
DisplayState mState; DisplayState mState;
rx::DisplayImpl *mImplementation; rx::DisplayImpl *mImplementation;
...@@ -247,6 +251,8 @@ class Display final : public LabeledObject, angle::NonCopyable ...@@ -247,6 +251,8 @@ class Display final : public LabeledObject, angle::NonCopyable
gl::MemoryProgramCache mMemoryProgramCache; gl::MemoryProgramCache mMemoryProgramCache;
size_t mGlobalTextureShareGroupUsers; size_t mGlobalTextureShareGroupUsers;
gl::FrontendFeatures mFrontendFeatures;
angle::FeatureList mFeatures; angle::FeatureList mFeatures;
}; };
......
...@@ -15,10 +15,10 @@ ...@@ -15,10 +15,10 @@
namespace gl namespace gl
{ {
struct Workarounds : angle::FeatureSetBase struct FrontendFeatures : angle::FeatureSetBase
{ {
Workarounds(); FrontendFeatures();
~Workarounds(); ~FrontendFeatures();
// Force the context to be lost (via KHR_robustness) if a GL_OUT_OF_MEMORY error occurs. The // Force the context to be lost (via KHR_robustness) if a GL_OUT_OF_MEMORY error occurs. The
// driver may be in an inconsistent state if this happens, and some users of ANGLE rely on this // driver may be in an inconsistent state if this happens, and some users of ANGLE rely on this
...@@ -46,8 +46,8 @@ struct Workarounds : angle::FeatureSetBase ...@@ -46,8 +46,8 @@ struct Workarounds : angle::FeatureSetBase
&members}; &members};
}; };
inline Workarounds::Workarounds() = default; inline FrontendFeatures::FrontendFeatures() = default;
inline Workarounds::~Workarounds() = default; inline FrontendFeatures::~FrontendFeatures() = default;
} // namespace gl } // namespace gl
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include "common/version.h" #include "common/version.h"
#include "compiler/translator/blocklayout.h" #include "compiler/translator/blocklayout.h"
#include "libANGLE/Context.h" #include "libANGLE/Context.h"
#include "libANGLE/FrontendFeatures.h"
#include "libANGLE/MemoryProgramCache.h" #include "libANGLE/MemoryProgramCache.h"
#include "libANGLE/ProgramLinkedResources.h" #include "libANGLE/ProgramLinkedResources.h"
#include "libANGLE/ResourceManager.h" #include "libANGLE/ResourceManager.h"
...@@ -1481,7 +1482,7 @@ void Program::resolveLinkImpl(const Context *context) ...@@ -1481,7 +1482,7 @@ void Program::resolveLinkImpl(const Context *context)
// Save to the program cache. // Save to the program cache.
auto *cache = linkingState->context->getMemoryProgramCache(); auto *cache = linkingState->context->getMemoryProgramCache();
if (cache && (mState.mLinkedTransformFeedbackVaryings.empty() || if (cache && (mState.mLinkedTransformFeedbackVaryings.empty() ||
!linkingState->context->getWorkarounds() !linkingState->context->getFrontendFeatures()
.disableProgramCachingForTransformFeedback.enabled)) .disableProgramCachingForTransformFeedback.enabled))
{ {
cache->putProgram(linkingState->programHash, linkingState->context, this); cache->putProgram(linkingState->programHash, linkingState->context, this);
...@@ -4461,7 +4462,7 @@ void Program::serialize(const Context *context, angle::MemoryBuffer *binaryOut) ...@@ -4461,7 +4462,7 @@ void Program::serialize(const Context *context, angle::MemoryBuffer *binaryOut)
// Warn the app layer if saving a binary with unsupported transform feedback. // Warn the app layer if saving a binary with unsupported transform feedback.
if (!mState.getLinkedTransformFeedbackVaryings().empty() && if (!mState.getLinkedTransformFeedbackVaryings().empty() &&
context->getWorkarounds().disableProgramCachingForTransformFeedback.enabled) context->getFrontendFeatures().disableProgramCachingForTransformFeedback.enabled)
{ {
WARN() << "Saving program binary with transform feedback, which is not supported on this " WARN() << "Saving program binary with transform feedback, which is not supported on this "
"driver."; "driver.";
...@@ -4680,7 +4681,7 @@ angle::Result Program::deserialize(const Context *context, ...@@ -4680,7 +4681,7 @@ angle::Result Program::deserialize(const Context *context,
// Reject programs that use transform feedback varyings if the hardware cannot support them. // Reject programs that use transform feedback varyings if the hardware cannot support them.
if (transformFeedbackVaryingCount > 0 && if (transformFeedbackVaryingCount > 0 &&
context->getWorkarounds().disableProgramCachingForTransformFeedback.enabled) context->getFrontendFeatures().disableProgramCachingForTransformFeedback.enabled)
{ {
infoLog << "Current driver does not support transform feedback in binary programs."; infoLog << "Current driver does not support transform feedback in binary programs.";
return angle::Result::Incomplete; return angle::Result::Incomplete;
......
...@@ -179,8 +179,6 @@ class ContextImpl : public GLImplFactory ...@@ -179,8 +179,6 @@ class ContextImpl : public GLImplFactory
virtual const gl::Extensions &getNativeExtensions() const = 0; virtual const gl::Extensions &getNativeExtensions() const = 0;
virtual const gl::Limitations &getNativeLimitations() const = 0; virtual const gl::Limitations &getNativeLimitations() const = 0;
virtual void applyNativeWorkarounds(gl::Workarounds *workarounds) const {}
virtual angle::Result dispatchCompute(const gl::Context *context, virtual angle::Result dispatchCompute(const gl::Context *context,
GLuint numGroupsX, GLuint numGroupsX,
GLuint numGroupsY, GLuint numGroupsY,
......
...@@ -36,6 +36,7 @@ class Thread; ...@@ -36,6 +36,7 @@ class Thread;
namespace gl namespace gl
{ {
class Context; class Context;
struct FrontendFeatures;
} }
namespace rx namespace rx
...@@ -90,6 +91,8 @@ class DisplayImpl : public EGLImplFactory ...@@ -90,6 +91,8 @@ class DisplayImpl : public EGLImplFactory
void setBlobCache(egl::BlobCache *blobCache) { mBlobCache = blobCache; } void setBlobCache(egl::BlobCache *blobCache) { mBlobCache = blobCache; }
egl::BlobCache *getBlobCache() const { return mBlobCache; } egl::BlobCache *getBlobCache() const { return mBlobCache; }
virtual void initializeFrontendFeatures(gl::FrontendFeatures *features) const {}
virtual void populateFeatureList(angle::FeatureList *features) = 0; virtual void populateFeatureList(angle::FeatureList *features) = 0;
const egl::DisplayState &getState() const { return mState; } const egl::DisplayState &getState() const { return mState; }
......
...@@ -571,11 +571,6 @@ const gl::Limitations &ContextGL::getNativeLimitations() const ...@@ -571,11 +571,6 @@ const gl::Limitations &ContextGL::getNativeLimitations() const
return mRenderer->getNativeLimitations(); return mRenderer->getNativeLimitations();
} }
void ContextGL::applyNativeWorkarounds(gl::Workarounds *workarounds) const
{
return mRenderer->applyNativeWorkarounds(workarounds);
}
StateManagerGL *ContextGL::getStateManager() StateManagerGL *ContextGL::getStateManager()
{ {
return mRenderer->getStateManager(); return mRenderer->getStateManager();
......
...@@ -216,8 +216,6 @@ class ContextGL : public ContextImpl ...@@ -216,8 +216,6 @@ class ContextGL : public ContextImpl
const gl::Extensions &getNativeExtensions() const override; const gl::Extensions &getNativeExtensions() const override;
const gl::Limitations &getNativeLimitations() const override; const gl::Limitations &getNativeLimitations() const override;
void applyNativeWorkarounds(gl::Workarounds *workarounds) const override;
// Handle helpers // Handle helpers
ANGLE_INLINE const FunctionsGL *getFunctions() const { return mRenderer->getFunctions(); } ANGLE_INLINE const FunctionsGL *getFunctions() const { return mRenderer->getFunctions(); }
......
...@@ -557,10 +557,10 @@ MultiviewImplementationTypeGL RendererGL::getMultiviewImplementationType() const ...@@ -557,10 +557,10 @@ MultiviewImplementationTypeGL RendererGL::getMultiviewImplementationType() const
return mMultiviewImplementationType; return mMultiviewImplementationType;
} }
void RendererGL::applyNativeWorkarounds(gl::Workarounds *workarounds) const void RendererGL::initializeFrontendFeatures(gl::FrontendFeatures *features) const
{ {
ensureCapsInitialized(); ensureCapsInitialized();
nativegl_gl::ApplyWorkarounds(mFunctions.get(), workarounds); nativegl_gl::InitializeFrontendFeatures(mFunctions.get(), features);
} }
angle::Result RendererGL::dispatchCompute(const gl::Context *context, angle::Result RendererGL::dispatchCompute(const gl::Context *context,
......
...@@ -24,7 +24,7 @@ namespace gl ...@@ -24,7 +24,7 @@ namespace gl
struct IndexRange; struct IndexRange;
class Path; class Path;
class State; class State;
struct Workarounds; struct FrontendFeatures;
} // namespace gl } // namespace gl
namespace egl namespace egl
...@@ -170,7 +170,7 @@ class RendererGL : angle::NonCopyable ...@@ -170,7 +170,7 @@ class RendererGL : angle::NonCopyable
const gl::TextureCapsMap &getNativeTextureCaps() const; const gl::TextureCapsMap &getNativeTextureCaps() const;
const gl::Extensions &getNativeExtensions() const; const gl::Extensions &getNativeExtensions() const;
const gl::Limitations &getNativeLimitations() const; const gl::Limitations &getNativeLimitations() const;
void applyNativeWorkarounds(gl::Workarounds *workarounds) const; void initializeFrontendFeatures(gl::FrontendFeatures *features) const;
angle::Result dispatchCompute(const gl::Context *context, angle::Result dispatchCompute(const gl::Context *context,
GLuint numGroupsX, GLuint numGroupsX,
......
...@@ -74,6 +74,8 @@ class DisplayCGL : public DisplayGL ...@@ -74,6 +74,8 @@ class DisplayCGL : public DisplayGL
WorkerContext *createWorkerContext(std::string *infoLog); WorkerContext *createWorkerContext(std::string *infoLog);
void initializeFrontendFeatures(gl::FrontendFeatures *features) const override;
void populateFeatureList(angle::FeatureList *features) override; void populateFeatureList(angle::FeatureList *features) override;
// Support for dual-GPU MacBook Pros. If the context was created // Support for dual-GPU MacBook Pros. If the context was created
......
...@@ -427,6 +427,11 @@ void DisplayCGL::unreferenceDiscreteGPU() ...@@ -427,6 +427,11 @@ void DisplayCGL::unreferenceDiscreteGPU()
} }
} }
void DisplayCGL::initializeFrontendFeatures(gl::FrontendFeatures *features) const
{
mRenderer->initializeFrontendFeatures(features);
}
void DisplayCGL::populateFeatureList(angle::FeatureList *features) void DisplayCGL::populateFeatureList(angle::FeatureList *features)
{ {
mRenderer->getWorkarounds().populateFeatureList(features); mRenderer->getWorkarounds().populateFeatureList(features);
......
...@@ -690,6 +690,11 @@ WorkerContext *DisplayAndroid::createWorkerContext(std::string *infoLog, ...@@ -690,6 +690,11 @@ WorkerContext *DisplayAndroid::createWorkerContext(std::string *infoLog,
return new WorkerContextAndroid(context, mEGL, mDummyPbuffer); return new WorkerContextAndroid(context, mEGL, mDummyPbuffer);
} }
void DisplayAndroid::initializeFrontendFeatures(gl::FrontendFeatures *features) const
{
mRenderer->initializeFrontendFeatures(features);
}
void DisplayAndroid::populateFeatureList(angle::FeatureList *features) void DisplayAndroid::populateFeatureList(angle::FeatureList *features)
{ {
mRenderer->getWorkarounds().populateFeatureList(features); mRenderer->getWorkarounds().populateFeatureList(features);
......
...@@ -82,6 +82,8 @@ class DisplayAndroid : public DisplayEGL ...@@ -82,6 +82,8 @@ class DisplayAndroid : public DisplayEGL
EGLContext sharedContext, EGLContext sharedContext,
const native_egl::AttributeVector workerAttribs) override; const native_egl::AttributeVector workerAttribs) override;
void initializeFrontendFeatures(gl::FrontendFeatures *features) const override;
void populateFeatureList(angle::FeatureList *features) override; void populateFeatureList(angle::FeatureList *features) override;
private: private:
......
...@@ -1073,6 +1073,11 @@ WorkerContext *DisplayOzone::createWorkerContext(std::string *infoLog, ...@@ -1073,6 +1073,11 @@ WorkerContext *DisplayOzone::createWorkerContext(std::string *infoLog,
return new WorkerContextOzone(context, mEGL); return new WorkerContextOzone(context, mEGL);
} }
void DisplayOzone::initializeFrontendFeatures(gl::FrontendFeatures *features) const
{
mRenderer->initializeFrontendFeatures(features);
}
void DisplayOzone::populateFeatureList(angle::FeatureList *features) void DisplayOzone::populateFeatureList(angle::FeatureList *features)
{ {
mRenderer->getWorkarounds().populateFeatureList(features); mRenderer->getWorkarounds().populateFeatureList(features);
......
...@@ -160,6 +160,8 @@ class DisplayOzone final : public DisplayEGL ...@@ -160,6 +160,8 @@ class DisplayOzone final : public DisplayEGL
EGLContext sharedContext, EGLContext sharedContext,
const native_egl::AttributeVector workerAttribs) override; const native_egl::AttributeVector workerAttribs) override;
void initializeFrontendFeatures(gl::FrontendFeatures *features) const override;
void populateFeatureList(angle::FeatureList *features) override; void populateFeatureList(angle::FeatureList *features) override;
private: private:
......
...@@ -991,6 +991,11 @@ WorkerContext *DisplayGLX::createWorkerContext(std::string *infoLog) ...@@ -991,6 +991,11 @@ WorkerContext *DisplayGLX::createWorkerContext(std::string *infoLog)
return new WorkerContextGLX(context, &mGLX, workerPbuffer); return new WorkerContextGLX(context, &mGLX, workerPbuffer);
} }
void DisplayGLX::initializeFrontendFeatures(gl::FrontendFeatures *features) const
{
mRenderer->initializeFrontendFeatures(features);
}
void DisplayGLX::populateFeatureList(angle::FeatureList *features) void DisplayGLX::populateFeatureList(angle::FeatureList *features)
{ {
mRenderer->getWorkarounds().populateFeatureList(features); mRenderer->getWorkarounds().populateFeatureList(features);
......
...@@ -100,6 +100,8 @@ class DisplayGLX : public DisplayGL ...@@ -100,6 +100,8 @@ class DisplayGLX : public DisplayGL
WorkerContext *createWorkerContext(std::string *infoLog); WorkerContext *createWorkerContext(std::string *infoLog);
void initializeFrontendFeatures(gl::FrontendFeatures *features) const override;
void populateFeatureList(angle::FeatureList *features) override; void populateFeatureList(angle::FeatureList *features) override;
private: private:
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
#include "libANGLE/Buffer.h" #include "libANGLE/Buffer.h"
#include "libANGLE/Caps.h" #include "libANGLE/Caps.h"
#include "libANGLE/Context.h" #include "libANGLE/Context.h"
#include "libANGLE/Workarounds.h" #include "libANGLE/FrontendFeatures.h"
#include "libANGLE/formatutils.h" #include "libANGLE/formatutils.h"
#include "libANGLE/queryconversions.h" #include "libANGLE/queryconversions.h"
#include "libANGLE/renderer/gl/ContextGL.h" #include "libANGLE/renderer/gl/ContextGL.h"
...@@ -1477,13 +1477,12 @@ void GenerateWorkarounds(const FunctionsGL *functions, WorkaroundsGL *workaround ...@@ -1477,13 +1477,12 @@ void GenerateWorkarounds(const FunctionsGL *functions, WorkaroundsGL *workaround
(IsWindows() && (IsIntel(vendor) || IsAMD(vendor))) || (IsLinux() && IsNvidia(vendor)); (IsWindows() && (IsIntel(vendor) || IsAMD(vendor))) || (IsLinux() && IsNvidia(vendor));
} }
void ApplyWorkarounds(const FunctionsGL *functions, gl::Workarounds *workarounds) void InitializeFrontendFeatures(const FunctionsGL *functions, gl::FrontendFeatures *features)
{ {
VendorID vendor = GetVendorID(functions); VendorID vendor = GetVendorID(functions);
workarounds->disableProgramCachingForTransformFeedback.enabled = features->disableProgramCachingForTransformFeedback.enabled = IsAndroid() && IsQualcomm(vendor);
IsAndroid() && IsQualcomm(vendor); features->syncFramebufferBindingsOnTexImage.enabled = IsWindows() && IsIntel(vendor);
workarounds->syncFramebufferBindingsOnTexImage.enabled = IsWindows() && IsIntel(vendor);
} }
} // namespace nativegl_gl } // namespace nativegl_gl
......
...@@ -25,7 +25,7 @@ struct Caps; ...@@ -25,7 +25,7 @@ struct Caps;
class TextureCapsMap; class TextureCapsMap;
struct Extensions; struct Extensions;
struct Version; struct Version;
struct Workarounds; struct FrontendFeatures;
} // namespace gl } // namespace gl
namespace rx namespace rx
...@@ -63,7 +63,7 @@ void GenerateCaps(const FunctionsGL *functions, ...@@ -63,7 +63,7 @@ void GenerateCaps(const FunctionsGL *functions,
MultiviewImplementationTypeGL *multiviewImplementationType); MultiviewImplementationTypeGL *multiviewImplementationType);
void GenerateWorkarounds(const FunctionsGL *functions, WorkaroundsGL *workarounds); void GenerateWorkarounds(const FunctionsGL *functions, WorkaroundsGL *workarounds);
void ApplyWorkarounds(const FunctionsGL *functions, gl::Workarounds *workarounds); void InitializeFrontendFeatures(const FunctionsGL *functions, gl::FrontendFeatures *features);
} // namespace nativegl_gl } // namespace nativegl_gl
namespace nativegl namespace nativegl
......
...@@ -1058,6 +1058,11 @@ WorkerContext *DisplayWGL::createWorkerContext(std::string *infoLog, ...@@ -1058,6 +1058,11 @@ WorkerContext *DisplayWGL::createWorkerContext(std::string *infoLog,
return new WorkerContextWGL(mFunctionsWGL, workerPbuffer, workerDeviceContext, workerContext); return new WorkerContextWGL(mFunctionsWGL, workerPbuffer, workerDeviceContext, workerContext);
} }
void DisplayWGL::initializeFrontendFeatures(gl::FrontendFeatures *features) const
{
mRenderer->initializeFrontendFeatures(features);
}
void DisplayWGL::populateFeatureList(angle::FeatureList *features) void DisplayWGL::populateFeatureList(angle::FeatureList *features)
{ {
mRenderer->getWorkarounds().populateFeatureList(features); mRenderer->getWorkarounds().populateFeatureList(features);
......
...@@ -85,6 +85,8 @@ class DisplayWGL : public DisplayGL ...@@ -85,6 +85,8 @@ class DisplayWGL : public DisplayGL
HGLRC sharedContext, HGLRC sharedContext,
const std::vector<int> &workerContextAttribs); const std::vector<int> &workerContextAttribs);
void initializeFrontendFeatures(gl::FrontendFeatures *features) const override;
void populateFeatureList(angle::FeatureList *features) override; void populateFeatureList(angle::FeatureList *features) override;
private: private:
......
...@@ -198,6 +198,7 @@ libangle_sources = [ ...@@ -198,6 +198,7 @@ libangle_sources = [
"src/libANGLE/Framebuffer.h", "src/libANGLE/Framebuffer.h",
"src/libANGLE/FramebufferAttachment.cpp", "src/libANGLE/FramebufferAttachment.cpp",
"src/libANGLE/FramebufferAttachment.h", "src/libANGLE/FramebufferAttachment.h",
"src/libANGLE/FrontendFeatures.h",
"src/libANGLE/GLES1Renderer.cpp", "src/libANGLE/GLES1Renderer.cpp",
"src/libANGLE/GLES1Renderer.h", "src/libANGLE/GLES1Renderer.h",
"src/libANGLE/GLES1Shaders.inc", "src/libANGLE/GLES1Shaders.inc",
...@@ -268,7 +269,6 @@ libangle_sources = [ ...@@ -268,7 +269,6 @@ libangle_sources = [
"src/libANGLE/VertexAttribute.cpp", "src/libANGLE/VertexAttribute.cpp",
"src/libANGLE/VertexAttribute.h", "src/libANGLE/VertexAttribute.h",
"src/libANGLE/VertexAttribute.inc", "src/libANGLE/VertexAttribute.inc",
"src/libANGLE/Workarounds.h",
"src/libANGLE/WorkerThread.cpp", "src/libANGLE/WorkerThread.cpp",
"src/libANGLE/WorkerThread.h", "src/libANGLE/WorkerThread.h",
"src/libANGLE/angletypes.cpp", "src/libANGLE/angletypes.cpp",
......
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