D3D11: Make several format tables constexpr.

This should guarantee the best memory access patterns.
It introduces some indirections for some format queries,
but most of these should be direct array lookups, or used
infrequently. We can optimize this later if necessary.

BUG=angleproject:1389

Change-Id: I5e2c8c530a07798494afd3ea36b6164d7564c02c
Reviewed-on: https://chromium-review.googlesource.com/403314
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
diff --git a/src/libANGLE/renderer/renderer_utils.h b/src/libANGLE/renderer/renderer_utils.h
index e087030..440548e 100644
--- a/src/libANGLE/renderer/renderer_utils.h
+++ b/src/libANGLE/renderer/renderer_utils.h
@@ -44,7 +44,27 @@
 typedef void (*ColorWriteFunction)(const uint8_t *source, uint8_t *dest);
 typedef void (*ColorCopyFunction)(const uint8_t *source, uint8_t *dest);
 
-typedef std::map<gl::FormatType, ColorCopyFunction> FastCopyFunctionMap;
+class FastCopyFunctionMap
+{
+  public:
+    struct Entry
+    {
+        GLenum format;
+        GLenum type;
+        ColorCopyFunction func;
+    };
+
+    constexpr FastCopyFunctionMap() : FastCopyFunctionMap(nullptr, 0) {}
+
+    constexpr FastCopyFunctionMap(const Entry *data, size_t size) : mSize(size), mData(data) {}
+
+    bool has(const gl::FormatType &formatType) const;
+    ColorCopyFunction get(const gl::FormatType &formatType) const;
+
+  private:
+    size_t mSize;
+    const Entry *mData;
+};
 
 struct PackPixelsParams
 {