Cache gl::Data in Context to speed up validation.
This avoids creating a new Data object and copying it around.
Gives a noticable performance increase in the benchmark which
tests validation-only draw calls. Gives about a 8% increase
in the benchmark.
BUG=angleproject:959
Change-Id: Id3a7459753b1b466a06da89f3f8b03b2c2c7a5c1
Reviewed-on: https://chromium-review.googlesource.com/267752
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Brandon Jones <bajones@chromium.org>
diff --git a/src/libANGLE/Context.cpp b/src/libANGLE/Context.cpp
index a79cf2d..d944f8b 100644
--- a/src/libANGLE/Context.cpp
+++ b/src/libANGLE/Context.cpp
@@ -37,7 +37,8 @@
{
Context::Context(const egl::Config *config, int clientVersion, const Context *shareContext, rx::Renderer *renderer, bool notifyResets, bool robustAccess)
- : mRenderer(renderer)
+ : mRenderer(renderer),
+ mData(clientVersion, mState, mCaps, mTextureCaps, mExtensions, nullptr)
{
ASSERT(robustAccess == false); // Unimplemented
@@ -62,6 +63,8 @@
mResourceManager = new ResourceManager(mRenderer);
}
+ mData.resourceManager = mResourceManager;
+
// [OpenGL ES 2.0.24] section 3.7 page 83:
// In the initial state, TEXTURE_2D and TEXTURE_CUBE_MAP have twodimensional
// and cube map texture state vectors respectively associated with them.
@@ -1578,9 +1581,4 @@
}
}
-Data Context::getData() const
-{
- return Data(mClientVersion, mState, mCaps, mTextureCaps, mExtensions, mResourceManager);
-}
-
}