D3D11: Enable dirty bits for Framebuffer11.
This patch works using a notification scheme - whenever a Texture or
Renderbuffer changes in such a way as to recreate its RenderTarget, we
pass a signal to the Framebuffer to invalidate some internal state.
Everything is entirely tracked in the Renderer11 layer, and the GL
layer is left untouched.
A RenderTarget11 now tracks points to which it is bound, and the
Framebuffer11 is mostly responsible for managing those links.
The three locations where we notify a Framebuffer when its bound
RenderTargets might be dirty are:
1) RenderTarget11::~RenderTarget
2) EGLImageD3D::copyToLocalRendertarget
3) TextureStorage11_2D::useLevelZeroWorkaroundTexture
This patch gives about a 10% score increase in the D3D11 draw call
benchmark on my system.
BUG=angleproject:1260
Change-Id: Ide38aeadff4a2681bf5bd685e8ca3c9e2612a380
Reviewed-on: https://chromium-review.googlesource.com/327255
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
diff --git a/src/tests/test_utils/ANGLETest.cpp b/src/tests/test_utils/ANGLETest.cpp
index 74969f9..b1fb777 100644
--- a/src/tests/test_utils/ANGLETest.cpp
+++ b/src/tests/test_utils/ANGLETest.cpp
@@ -15,6 +15,14 @@
namespace angle
{
+namespace
+{
+float ColorNorm(GLubyte channelValue)
+{
+ return static_cast<float>(channelValue) / 255.0f;
+}
+} // anonymous namespace
+
GLColor::GLColor() : R(0), G(0), B(0), A(0)
{
}
@@ -28,6 +36,11 @@
memcpy(&R, &colorValue, sizeof(GLuint));
}
+Vector4 GLColor::toNormalizedVector() const
+{
+ return Vector4(ColorNorm(R), ColorNorm(G), ColorNorm(B), ColorNorm(A));
+}
+
GLColor ReadColor(GLint x, GLint y)
{
GLColor actual;