Use BufferID in place of GLuint handles.
Introduces enable_if handling for "FromGL". Avoids the use of any macro
code to handle resource id casting.
Bug: angleproject:3611
Change-Id: I1a6d10c3c9cc6ba0dc072bad1d62c33551f05d87
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1736127
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Tim Van Patten <timvp@google.com>
diff --git a/src/libANGLE/validationES2.cpp b/src/libANGLE/validationES2.cpp
index 19aa376..33e5834 100644
--- a/src/libANGLE/validationES2.cpp
+++ b/src/libANGLE/validationES2.cpp
@@ -2372,7 +2372,7 @@
switch (identifier)
{
case GL_BUFFER:
- if (context->getBuffer(name) == nullptr)
+ if (context->getBuffer({name}) == nullptr)
{
context->validationError(GL_INVALID_VALUE, kInvalidBufferName);
return false;
@@ -3431,7 +3431,7 @@
bool ValidateSignalSemaphoreEXT(Context *context,
GLuint semaphore,
GLuint numBufferBarriers,
- const GLuint *buffers,
+ const BufferID *buffers,
GLuint numTextureBarriers,
const GLuint *textures,
const GLenum *dstLayouts)
@@ -3457,7 +3457,7 @@
bool ValidateWaitSemaphoreEXT(Context *context,
GLuint semaphore,
GLuint numBufferBarriers,
- const GLuint *buffers,
+ const BufferID *buffers,
GLuint numTextureBarriers,
const GLuint *textures,
const GLenum *srcLayouts)
@@ -5706,7 +5706,7 @@
return true;
}
-bool ValidateIsBuffer(Context *context, GLuint buffer)
+bool ValidateIsBuffer(Context *context, BufferID buffer)
{
return true;
}
@@ -6220,7 +6220,7 @@
height);
}
-bool ValidateDeleteBuffers(Context *context, GLint n, const GLuint *)
+bool ValidateDeleteBuffers(Context *context, GLint n, const BufferID *buffers)
{
return ValidateGenOrDelete(context, n);
}
@@ -6476,7 +6476,7 @@
return true;
}
-bool ValidateGenBuffers(Context *context, GLint n, GLuint *)
+bool ValidateGenBuffers(Context *context, GLint n, BufferID *buffers)
{
return ValidateGenOrDelete(context, n);
}