D3D11: Consolidate input layout application.
This merges all calls to IASetInputLayout to a single place in
StateManager11. This means we no longer have to invalidate the state
for D3D11, and can always lazily apply the input layout state.
Introduces a new ResourceSerial class to replace the uintptr_t and
DirtyPointer design.
BUG=angleproject:2052
Change-Id: I76b874218b754395f25a129967c769b1f8f82115
Reviewed-on: https://chromium-review.googlesource.com/523025
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
diff --git a/src/libANGLE/renderer/renderer_utils.h b/src/libANGLE/renderer/renderer_utils.h
index 803c8c2..a146d0f 100644
--- a/src/libANGLE/renderer/renderer_utils.h
+++ b/src/libANGLE/renderer/renderer_utils.h
@@ -12,6 +12,7 @@
#include <cstdint>
+#include <limits>
#include <map>
#include "libANGLE/angletypes.h"
@@ -30,6 +31,22 @@
namespace rx
{
+class ResourceSerial
+{
+ public:
+ constexpr ResourceSerial() : mValue(kDirty) {}
+ constexpr ResourceSerial(uintptr_t value) : mValue(value) {}
+ constexpr bool operator==(ResourceSerial other) const { return mValue == other.mValue; }
+ constexpr bool operator!=(ResourceSerial other) const { return mValue != other.mValue; }
+
+ void dirty() { mValue = kDirty; }
+
+ private:
+ constexpr static uintptr_t kDirty = std::numeric_limits<uintptr_t>::max();
+
+ uintptr_t mValue;
+};
+
using MipGenerationFunction = void (*)(size_t sourceWidth,
size_t sourceHeight,
size_t sourceDepth,