Use Resource IDs in RefCountObject.

This lets us use strongly typed IDs pretty much everywhere. Only one or
two additional places still use GLuint IDs. Mostly for external queries
and for Framebuffer Attachments.

With some clever type reflection helpers lets us define a single
template function for handling operator== and != for resource IDs.

Refactor in preparation for more Capture/Replay work.

Bug: angleproject:3611
Change-Id: I1c0c848e89eb8a4b769714d57686f816daf01634
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1815550
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Tobin Ehlis <tobine@google.com>
diff --git a/src/libANGLE/validationES2.cpp b/src/libANGLE/validationES2.cpp
index 3b8eebd..afab5ee 100644
--- a/src/libANGLE/validationES2.cpp
+++ b/src/libANGLE/validationES2.cpp
@@ -2039,7 +2039,7 @@
     }
 
     gl::Texture *texture = context->getTextureByType(target);
-    if (!texture || texture->id() == 0)
+    if (!texture || texture->id().value == 0)
     {
         context->validationError(GL_INVALID_OPERATION, kMissingTexture);
         return false;