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 @@
namespace rx
{
DisplayGL::DisplayGL(const egl::DisplayState &state)
: DisplayImpl(state), mRendererDescription(""), mVendorString(""), mVersionString("")
{}
DisplayGL::DisplayGL(const egl::DisplayState &state) : DisplayImpl(state) {}
DisplayGL::~DisplayGL() {}
......@@ -104,36 +102,17 @@ egl::Error DisplayGL::makeCurrentSurfaceless(gl::Context *context)
std::string DisplayGL::getRendererDescription()
{
if (mRendererDescription.empty())
{
mRendererDescription = GetRendererString(getRenderer()->getFunctions());
}
return mRendererDescription;
return GetRendererString(getRenderer()->getFunctions());
}
std::string DisplayGL::getVendorString()
{
if (mVendorString.empty())
{
mVendorString = GetVendorString(getRenderer()->getFunctions());
}
return mVendorString;
return GetVendorString(getRenderer()->getFunctions());
}
std::string DisplayGL::getVersionString()
{
if (mVersionString.empty())
{
mVersionString = GetVersionString(getRenderer()->getFunctions());
}
return mVersionString;
}
void DisplayGL::resetCachedGLStrings()
{
mRendererDescription = "";
mVendorString = "";
mVersionString = "";
return GetVersionString(getRenderer()->getFunctions());
}
} // namespace rx
......@@ -56,17 +56,11 @@ class DisplayGL : public DisplayImpl
std::string getVendorString() override;
std::string getVersionString() override;
void resetCachedGLStrings();
protected:
void generateExtensions(egl::DisplayExtensions *outExtensions) const override;
private:
virtual egl::Error makeCurrentSurfaceless(gl::Context *context);
std::string mRendererDescription;
std::string mVendorString;
std::string mVersionString;
};
} // namespace rx
......
......@@ -658,8 +658,6 @@ egl::Error DisplayCGL::handleGPUSwitch()
CGLSetCurrentContext(mContext);
onStateChange(angle::SubjectMessage::SubjectChanged);
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