D3D11: Refactor dependent Framebuffer state changes.

Previously, when a state change would cause a Texture to
recreate its storage specific to D3D11, we would use a
dependent notification from RenderTarget11 to Framebuffer11
to re-check internal dirty bits. In this new method, we
instead set dirty bits on the gl::Frambuffer directly. This
also means we use fewer internal objects for these
notifications, because we share the same structures between
the D3D11 back-end notifications and the top-level notifications
we use for Robust init and Framebuffer completeness.

This also allows us to get rid of one "if" that we check on
every draw call in D3D11.

This also introduces a dirty bits guard concept - a shadow
set of dirty bits that is checked in dependent state changes
to ensure that extra bits aren't set inside syncState.

This also implements Framebuffer dirty bits for the D3D9
back-end. This has the side effect of cleaning up the
"null colorbuffer" D3D9 workaround.

Bug: angleproject:2372
Change-Id: Ie346d39030f4f6df583d735685b0babea4e745a8
Reviewed-on: https://chromium-review.googlesource.com/936691
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
diff --git a/src/libANGLE/Framebuffer.h b/src/libANGLE/Framebuffer.h
index e7fe890..d512fdf 100644
--- a/src/libANGLE/Framebuffer.h
+++ b/src/libANGLE/Framebuffer.h
@@ -391,6 +391,10 @@
 
     DirtyBits mDirtyBits;
 
+    // The dirty bits guard is checked when we get a dependent state change message. We verify that
+    // we don't set a dirty bit that isn't already set, when inside the dirty bits syncState.
+    Optional<DirtyBits> mDirtyBitsGuard;
+
     // A cache of attached textures for quick validation of feedback loops.
     mutable Optional<std::set<const FramebufferAttachmentObject *>> mAttachedTextures;
 };