Commit e281fbb0 by Shahbaz Youssefi Committed by Commit Bot

Revert "GL: Cache the results of glGetString"

This reverts commit 27906e9c. Reason for revert: Causes failures in mac_optional_gpu_tests_rel Original change's description: > GL: Cache the results of glGetString > > To reduce the amount of queries to the driver, we can cache the > results of glGetString. On Mac, we need to invalidate this cache > on GPU switch. > > Bug: chromium:1173672 > Change-Id: I039172068aec35034a87881a8804f52c080ce4ce > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2676882 > Commit-Queue: Jonah Ryan-Davis <jonahr@google.com> > Reviewed-by: Jamie Madill <jmadill@chromium.org> > Reviewed-by: Geoff Lang <geofflang@chromium.org> TBR=geofflang@chromium.org,jonahr@google.com,jmadill@chromium.org Change-Id: I5799c5d287dd01b946446bd66d4c89aef6756d3a Bug: chromium:1173672 Bug: angleproject:5639 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2690145Reviewed-by: 's avatarShahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
parent 62d4b9be
...@@ -22,9 +22,7 @@ ...@@ -22,9 +22,7 @@
namespace rx namespace rx
{ {
DisplayGL::DisplayGL(const egl::DisplayState &state) DisplayGL::DisplayGL(const egl::DisplayState &state) : DisplayImpl(state) {}
: DisplayImpl(state), mRendererDescription(""), mVendorString(""), mVersionString("")
{}
DisplayGL::~DisplayGL() {} DisplayGL::~DisplayGL() {}
...@@ -104,36 +102,17 @@ egl::Error DisplayGL::makeCurrentSurfaceless(gl::Context *context) ...@@ -104,36 +102,17 @@ egl::Error DisplayGL::makeCurrentSurfaceless(gl::Context *context)
std::string DisplayGL::getRendererDescription() std::string DisplayGL::getRendererDescription()
{ {
if (mRendererDescription.empty()) return GetRendererString(getRenderer()->getFunctions());
{
mRendererDescription = GetRendererString(getRenderer()->getFunctions());
}
return mRendererDescription;
} }
std::string DisplayGL::getVendorString() std::string DisplayGL::getVendorString()
{ {
if (mVendorString.empty()) return GetVendorString(getRenderer()->getFunctions());
{
mVendorString = GetVendorString(getRenderer()->getFunctions());
}
return mVendorString;
} }
std::string DisplayGL::getVersionString() std::string DisplayGL::getVersionString()
{ {
if (mVersionString.empty()) return GetVersionString(getRenderer()->getFunctions());
{
mVersionString = GetVersionString(getRenderer()->getFunctions());
}
return mVersionString;
}
void DisplayGL::resetCachedGLStrings()
{
mRendererDescription = "";
mVendorString = "";
mVersionString = "";
} }
} // namespace rx } // namespace rx
...@@ -56,17 +56,11 @@ class DisplayGL : public DisplayImpl ...@@ -56,17 +56,11 @@ class DisplayGL : public DisplayImpl
std::string getVendorString() override; std::string getVendorString() override;
std::string getVersionString() override; std::string getVersionString() override;
void resetCachedGLStrings();
protected: protected:
void generateExtensions(egl::DisplayExtensions *outExtensions) const override; void generateExtensions(egl::DisplayExtensions *outExtensions) const override;
private: private:
virtual egl::Error makeCurrentSurfaceless(gl::Context *context); virtual egl::Error makeCurrentSurfaceless(gl::Context *context);
std::string mRendererDescription;
std::string mVendorString;
std::string mVersionString;
}; };
} // namespace rx } // namespace rx
......
...@@ -658,8 +658,6 @@ egl::Error DisplayCGL::handleGPUSwitch() ...@@ -658,8 +658,6 @@ egl::Error DisplayCGL::handleGPUSwitch()
CGLSetCurrentContext(mContext); CGLSetCurrentContext(mContext);
onStateChange(angle::SubjectMessage::SubjectChanged); onStateChange(angle::SubjectMessage::SubjectChanged);
mCurrentGPUID = gpuID; mCurrentGPUID = gpuID;
// Dirty the cache of the GL strings because we are on a new driver
resetCachedGLStrings();
} }
} }
......
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