Commit 1ab73f0f by Jonah Ryan-Davis Committed by Commit Bot

Cleanup disable_program_binary workaround

This workaround should also clear the shader binary formats. Also, we can use this workaround when disabling program binaries for capture/replay. Bug: angleproject:5007 Change-Id: I57c78e2cc95e7148cb8a1e7fb9bf3ed958fa69c8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2404383 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent 90a9cf96
...@@ -170,9 +170,9 @@ struct FeatureSetBase ...@@ -170,9 +170,9 @@ struct FeatureSetBase
FeatureMap members = FeatureMap(); FeatureMap members = FeatureMap();
public: public:
void overrideFeatures(const std::vector<std::string> &feature_names, const bool enabled) void overrideFeatures(const std::vector<std::string> &featureNames, bool enabled)
{ {
for (const std::string &name : feature_names) for (const std::string &name : featureNames)
{ {
if (members.find(name) != members.end()) if (members.find(name) != members.end())
{ {
......
...@@ -3314,16 +3314,6 @@ void Context::initCaps() ...@@ -3314,16 +3314,6 @@ void Context::initCaps()
mState.mCaps.maxSmoothLineWidth = 1.0f; mState.mCaps.maxSmoothLineWidth = 1.0f;
} }
// If we're capturing application calls for replay, don't expose any binary formats to prevent
// traces from trying to use cached results
if (getFrameCapture()->enabled())
{
INFO() << "Limiting binary format support count to zero while FrameCapture enabled"
<< std::endl;
mState.mCaps.shaderBinaryFormats.clear();
mState.mCaps.programBinaryFormats.clear();
}
#if 0 #if 0
// This logging can generate a lot of spam in test suites that create many contexts // This logging can generate a lot of spam in test suites that create many contexts
# define ANGLE_LOG_LIMITED_CAP(cap, limit) \ # define ANGLE_LOG_LIMITED_CAP(cap, limit) \
...@@ -3440,10 +3430,20 @@ void Context::initCaps() ...@@ -3440,10 +3430,20 @@ void Context::initCaps()
} }
} }
// If we're capturing application calls for replay, don't expose any binary formats to prevent
// traces from trying to use cached results
if (getFrameCapture()->enabled())
{
INFO() << "Limiting binary format support count to zero while FrameCapture enabled"
<< std::endl;
mDisplay->overrideFrontendFeatures({"disable_program_binary"}, true);
}
// Disable support for OES_get_program_binary // Disable support for OES_get_program_binary
if (mDisplay->getFrontendFeatures().disableProgramBinary.enabled) if (mDisplay->getFrontendFeatures().disableProgramBinary.enabled)
{ {
mState.mExtensions.getProgramBinaryOES = false; mState.mExtensions.getProgramBinaryOES = false;
mState.mCaps.shaderBinaryFormats.clear();
mState.mCaps.programBinaryFormats.clear(); mState.mCaps.programBinaryFormats.clear();
} }
......
...@@ -1871,6 +1871,11 @@ EGLint Display::programCacheResize(EGLint limit, EGLenum mode) ...@@ -1871,6 +1871,11 @@ EGLint Display::programCacheResize(EGLint limit, EGLenum mode)
} }
} }
void Display::overrideFrontendFeatures(const std::vector<std::string> &featureNames, bool enabled)
{
mFrontendFeatures.overrideFeatures(featureNames, enabled);
}
const char *Display::queryStringi(const EGLint name, const EGLint index) const char *Display::queryStringi(const EGLint name, const EGLint index)
{ {
const char *result = nullptr; const char *result = nullptr;
......
...@@ -237,6 +237,7 @@ class Display final : public LabeledObject, ...@@ -237,6 +237,7 @@ class Display final : public LabeledObject,
const ContextSet &getContextSet() { return mContextSet; } const ContextSet &getContextSet() { return mContextSet; }
const angle::FrontendFeatures &getFrontendFeatures() { return mFrontendFeatures; } const angle::FrontendFeatures &getFrontendFeatures() { return mFrontendFeatures; }
void overrideFrontendFeatures(const std::vector<std::string> &featureNames, bool enabled);
const angle::FeatureList &getFeatures() const { return mFeatures; } const angle::FeatureList &getFeatures() const { return mFeatures; }
......
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