// GENERATED FILE - DO NOT EDIT.
// Generated by generate_entry_points.py using data from gl.xml and gl_angle_ext.xml.
//
// Copyright 2019 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// entry_points_gles_ext_autogen.cpp:
//   Defines the GLES extension entry points.

#include "libGLESv2/entry_points_gles_ext_autogen.h"

#include "libANGLE/Context.h"
#include "libANGLE/Context.inl.h"
#include "libANGLE/capture_gles_ext_autogen.h"
#include "libANGLE/entry_points_utils.h"
#include "libANGLE/validationESEXT.h"
#include "libGLESv2/global_state.h"

#include "libANGLE/capture_gles_1_0_autogen.h"
#include "libANGLE/capture_gles_2_0_autogen.h"
#include "libANGLE/capture_gles_3_0_autogen.h"
#include "libANGLE/capture_gles_3_1_autogen.h"
#include "libANGLE/validationES1.h"
#include "libANGLE/validationES2.h"
#include "libANGLE/validationES3.h"
#include "libANGLE/validationES31.h"

namespace gl
{

// GL_ANGLE_copy_texture_3d
void GL_APIENTRY CopyTexture3DANGLE(GLuint sourceId,
                                    GLint sourceLevel,
                                    GLenum destTarget,
                                    GLuint destId,
                                    GLint destLevel,
                                    GLint internalFormat,
                                    GLenum destType,
                                    GLboolean unpackFlipY,
                                    GLboolean unpackPremultiplyAlpha,
                                    GLboolean unpackUnmultiplyAlpha)
{
    EVENT(
        "(GLuint sourceId = %u, GLint sourceLevel = %d, GLenum destTarget = 0x%X, GLuint destId = "
        "%u, GLint destLevel = %d, GLint internalFormat = %d, GLenum destType = 0x%X, GLboolean "
        "unpackFlipY = %u, GLboolean unpackPremultiplyAlpha = %u, GLboolean unpackUnmultiplyAlpha "
        "= %u)",
        sourceId, sourceLevel, destTarget, destId, destLevel, internalFormat, destType, unpackFlipY,
        unpackPremultiplyAlpha, unpackUnmultiplyAlpha);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        TextureTarget destTargetPacked = FromGLenum<TextureTarget>(destTarget);
        bool isCallValid =
            (context->skipValidation() ||
             ValidateCopyTexture3DANGLE(context, sourceId, sourceLevel, destTargetPacked, destId,
                                        destLevel, internalFormat, destType, unpackFlipY,
                                        unpackPremultiplyAlpha, unpackUnmultiplyAlpha));
        if (isCallValid)
        {
            context->copyTexture3D(sourceId, sourceLevel, destTargetPacked, destId, destLevel,
                                   internalFormat, destType, unpackFlipY, unpackPremultiplyAlpha,
                                   unpackUnmultiplyAlpha);
        }
        ANGLE_CAPTURE(CopyTexture3DANGLE, isCallValid, context, sourceId, sourceLevel,
                      destTargetPacked, destId, destLevel, internalFormat, destType, unpackFlipY,
                      unpackPremultiplyAlpha, unpackUnmultiplyAlpha);
    }
}

void GL_APIENTRY CopySubTexture3DANGLE(GLuint sourceId,
                                       GLint sourceLevel,
                                       GLenum destTarget,
                                       GLuint destId,
                                       GLint destLevel,
                                       GLint xoffset,
                                       GLint yoffset,
                                       GLint zoffset,
                                       GLint x,
                                       GLint y,
                                       GLint z,
                                       GLint width,
                                       GLint height,
                                       GLint depth,
                                       GLboolean unpackFlipY,
                                       GLboolean unpackPremultiplyAlpha,
                                       GLboolean unpackUnmultiplyAlpha)
{
    EVENT(
        "(GLuint sourceId = %u, GLint sourceLevel = %d, GLenum destTarget = 0x%X, GLuint destId = "
        "%u, GLint destLevel = %d, GLint xoffset = %d, GLint yoffset = %d, GLint zoffset = %d, "
        "GLint x = %d, GLint y = %d, GLint z = %d, GLint width = %d, GLint height = %d, GLint "
        "depth = %d, GLboolean unpackFlipY = %u, GLboolean unpackPremultiplyAlpha = %u, GLboolean "
        "unpackUnmultiplyAlpha = %u)",
        sourceId, sourceLevel, destTarget, destId, destLevel, xoffset, yoffset, zoffset, x, y, z,
        width, height, depth, unpackFlipY, unpackPremultiplyAlpha, unpackUnmultiplyAlpha);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        TextureTarget destTargetPacked = FromGLenum<TextureTarget>(destTarget);
        bool isCallValid               = (context->skipValidation() ||
                            ValidateCopySubTexture3DANGLE(
                                context, sourceId, sourceLevel, destTargetPacked, destId, destLevel,
                                xoffset, yoffset, zoffset, x, y, z, width, height, depth,
                                unpackFlipY, unpackPremultiplyAlpha, unpackUnmultiplyAlpha));
        if (isCallValid)
        {
            context->copySubTexture3D(sourceId, sourceLevel, destTargetPacked, destId, destLevel,
                                      xoffset, yoffset, zoffset, x, y, z, width, height, depth,
                                      unpackFlipY, unpackPremultiplyAlpha, unpackUnmultiplyAlpha);
        }
        ANGLE_CAPTURE(CopySubTexture3DANGLE, isCallValid, context, sourceId, sourceLevel,
                      destTargetPacked, destId, destLevel, xoffset, yoffset, zoffset, x, y, z,
                      width, height, depth, unpackFlipY, unpackPremultiplyAlpha,
                      unpackUnmultiplyAlpha);
    }
}

// GL_ANGLE_framebuffer_blit
void GL_APIENTRY BlitFramebufferANGLE(GLint srcX0,
                                      GLint srcY0,
                                      GLint srcX1,
                                      GLint srcY1,
                                      GLint dstX0,
                                      GLint dstY0,
                                      GLint dstX1,
                                      GLint dstY1,
                                      GLbitfield mask,
                                      GLenum filter)
{
    EVENT(
        "(GLint srcX0 = %d, GLint srcY0 = %d, GLint srcX1 = %d, GLint srcY1 = %d, GLint dstX0 = "
        "%d, GLint dstY0 = %d, GLint dstX1 = %d, GLint dstY1 = %d, GLbitfield mask = 0x%X, GLenum "
        "filter = 0x%X)",
        srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid = (context->skipValidation() ||
                            ValidateBlitFramebufferANGLE(context, srcX0, srcY0, srcX1, srcY1, dstX0,
                                                         dstY0, dstX1, dstY1, mask, filter));
        if (isCallValid)
        {
            context->blitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask,
                                     filter);
        }
        ANGLE_CAPTURE(BlitFramebufferANGLE, isCallValid, context, srcX0, srcY0, srcX1, srcY1, dstX0,
                      dstY0, dstX1, dstY1, mask, filter);
    }
}

// GL_ANGLE_framebuffer_multisample
void GL_APIENTRY RenderbufferStorageMultisampleANGLE(GLenum target,
                                                     GLsizei samples,
                                                     GLenum internalformat,
                                                     GLsizei width,
                                                     GLsizei height)
{
    EVENT(
        "(GLenum target = 0x%X, GLsizei samples = %d, GLenum internalformat = 0x%X, GLsizei width "
        "= %d, GLsizei height = %d)",
        target, samples, internalformat, width, height);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid = (context->skipValidation() ||
                            ValidateRenderbufferStorageMultisampleANGLE(
                                context, target, samples, internalformat, width, height));
        if (isCallValid)
        {
            context->renderbufferStorageMultisample(target, samples, internalformat, width, height);
        }
        ANGLE_CAPTURE(RenderbufferStorageMultisampleANGLE, isCallValid, context, target, samples,
                      internalformat, width, height);
    }
}

// GL_ANGLE_instanced_arrays
void GL_APIENTRY DrawArraysInstancedANGLE(GLenum mode,
                                          GLint first,
                                          GLsizei count,
                                          GLsizei primcount)
{
    EVENT("(GLenum mode = 0x%X, GLint first = %d, GLsizei count = %d, GLsizei primcount = %d)",
          mode, first, count, primcount);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        PrimitiveMode modePacked = FromGLenum<PrimitiveMode>(mode);
        bool isCallValid =
            (context->skipValidation() ||
             ValidateDrawArraysInstancedANGLE(context, modePacked, first, count, primcount));
        if (isCallValid)
        {
            context->drawArraysInstanced(modePacked, first, count, primcount);
        }
        ANGLE_CAPTURE(DrawArraysInstancedANGLE, isCallValid, context, modePacked, first, count,
                      primcount);
    }
}

void GL_APIENTRY DrawElementsInstancedANGLE(GLenum mode,
                                            GLsizei count,
                                            GLenum type,
                                            const void *indices,
                                            GLsizei primcount)
{
    EVENT(
        "(GLenum mode = 0x%X, GLsizei count = %d, GLenum type = 0x%X, const void *indices = "
        "0x%016" PRIxPTR ", GLsizei primcount = %d)",
        mode, count, type, (uintptr_t)indices, primcount);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        PrimitiveMode modePacked    = FromGLenum<PrimitiveMode>(mode);
        DrawElementsType typePacked = FromGLenum<DrawElementsType>(type);
        bool isCallValid            = (context->skipValidation() ||
                            ValidateDrawElementsInstancedANGLE(context, modePacked, count,
                                                               typePacked, indices, primcount));
        if (isCallValid)
        {
            context->drawElementsInstanced(modePacked, count, typePacked, indices, primcount);
        }
        ANGLE_CAPTURE(DrawElementsInstancedANGLE, isCallValid, context, modePacked, count,
                      typePacked, indices, primcount);
    }
}

void GL_APIENTRY VertexAttribDivisorANGLE(GLuint index, GLuint divisor)
{
    EVENT("(GLuint index = %u, GLuint divisor = %u)", index, divisor);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid = (context->skipValidation() ||
                            ValidateVertexAttribDivisorANGLE(context, index, divisor));
        if (isCallValid)
        {
            context->vertexAttribDivisor(index, divisor);
        }
        ANGLE_CAPTURE(VertexAttribDivisorANGLE, isCallValid, context, index, divisor);
    }
}

// GL_ANGLE_multi_draw
void GL_APIENTRY MultiDrawArraysANGLE(GLenum mode,
                                      const GLint *firsts,
                                      const GLsizei *counts,
                                      GLsizei drawcount)
{
    EVENT("(GLenum mode = 0x%X, const GLint *firsts = 0x%016" PRIxPTR
          ", const GLsizei *counts = 0x%016" PRIxPTR ", GLsizei drawcount = %d)",
          mode, (uintptr_t)firsts, (uintptr_t)counts, drawcount);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        PrimitiveMode modePacked = FromGLenum<PrimitiveMode>(mode);
        bool isCallValid =
            (context->skipValidation() ||
             ValidateMultiDrawArraysANGLE(context, modePacked, firsts, counts, drawcount));
        if (isCallValid)
        {
            context->multiDrawArrays(modePacked, firsts, counts, drawcount);
        }
        ANGLE_CAPTURE(MultiDrawArraysANGLE, isCallValid, context, modePacked, firsts, counts,
                      drawcount);
    }
}

void GL_APIENTRY MultiDrawArraysInstancedANGLE(GLenum mode,
                                               const GLint *firsts,
                                               const GLsizei *counts,
                                               const GLsizei *instanceCounts,
                                               GLsizei drawcount)
{
    EVENT("(GLenum mode = 0x%X, const GLint *firsts = 0x%016" PRIxPTR
          ", const GLsizei *counts = 0x%016" PRIxPTR
          ", const GLsizei *instanceCounts = 0x%016" PRIxPTR ", GLsizei drawcount = %d)",
          mode, (uintptr_t)firsts, (uintptr_t)counts, (uintptr_t)instanceCounts, drawcount);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        PrimitiveMode modePacked = FromGLenum<PrimitiveMode>(mode);
        bool isCallValid         = (context->skipValidation() ||
                            ValidateMultiDrawArraysInstancedANGLE(
                                context, modePacked, firsts, counts, instanceCounts, drawcount));
        if (isCallValid)
        {
            context->multiDrawArraysInstanced(modePacked, firsts, counts, instanceCounts,
                                              drawcount);
        }
        ANGLE_CAPTURE(MultiDrawArraysInstancedANGLE, isCallValid, context, modePacked, firsts,
                      counts, instanceCounts, drawcount);
    }
}

void GL_APIENTRY MultiDrawElementsANGLE(GLenum mode,
                                        const GLsizei *counts,
                                        GLenum type,
                                        const GLvoid *const *indices,
                                        GLsizei drawcount)
{
    EVENT("(GLenum mode = 0x%X, const GLsizei *counts = 0x%016" PRIxPTR
          ", GLenum type = 0x%X, const GLvoid *const*indices = 0x%016" PRIxPTR
          ", GLsizei drawcount = %d)",
          mode, (uintptr_t)counts, type, (uintptr_t)indices, drawcount);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        PrimitiveMode modePacked    = FromGLenum<PrimitiveMode>(mode);
        DrawElementsType typePacked = FromGLenum<DrawElementsType>(type);
        bool isCallValid            = (context->skipValidation() ||
                            ValidateMultiDrawElementsANGLE(context, modePacked, counts, typePacked,
                                                           indices, drawcount));
        if (isCallValid)
        {
            context->multiDrawElements(modePacked, counts, typePacked, indices, drawcount);
        }
        ANGLE_CAPTURE(MultiDrawElementsANGLE, isCallValid, context, modePacked, counts, typePacked,
                      indices, drawcount);
    }
}

void GL_APIENTRY MultiDrawElementsInstancedANGLE(GLenum mode,
                                                 const GLsizei *counts,
                                                 GLenum type,
                                                 const GLvoid *const *indices,
                                                 const GLsizei *instanceCounts,
                                                 GLsizei drawcount)
{
    EVENT("(GLenum mode = 0x%X, const GLsizei *counts = 0x%016" PRIxPTR
          ", GLenum type = 0x%X, const GLvoid *const*indices = 0x%016" PRIxPTR
          ", const GLsizei*instanceCounts = 0x%016" PRIxPTR ", GLsizei drawcount = %d)",
          mode, (uintptr_t)counts, type, (uintptr_t)indices, (uintptr_t)instanceCounts, drawcount);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        PrimitiveMode modePacked    = FromGLenum<PrimitiveMode>(mode);
        DrawElementsType typePacked = FromGLenum<DrawElementsType>(type);
        bool isCallValid =
            (context->skipValidation() ||
             ValidateMultiDrawElementsInstancedANGLE(context, modePacked, counts, typePacked,
                                                     indices, instanceCounts, drawcount));
        if (isCallValid)
        {
            context->multiDrawElementsInstanced(modePacked, counts, typePacked, indices,
                                                instanceCounts, drawcount);
        }
        ANGLE_CAPTURE(MultiDrawElementsInstancedANGLE, isCallValid, context, modePacked, counts,
                      typePacked, indices, instanceCounts, drawcount);
    }
}

// GL_ANGLE_provoking_vertex
void GL_APIENTRY ProvokingVertexANGLE(GLenum mode)
{
    EVENT("(GLenum mode = 0x%X)", mode);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        ProvokingVertexConvention modePacked = FromGLenum<ProvokingVertexConvention>(mode);
        bool isCallValid =
            (context->skipValidation() || ValidateProvokingVertexANGLE(context, modePacked));
        if (isCallValid)
        {
            context->provokingVertex(modePacked);
        }
        ANGLE_CAPTURE(ProvokingVertexANGLE, isCallValid, context, modePacked);
    }
}

// GL_ANGLE_request_extension
void GL_APIENTRY RequestExtensionANGLE(const GLchar *name)
{
    EVENT("(const GLchar * name = 0x%016" PRIxPTR ")", (uintptr_t)name);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() || ValidateRequestExtensionANGLE(context, name));
        if (isCallValid)
        {
            context->requestExtension(name);
        }
        ANGLE_CAPTURE(RequestExtensionANGLE, isCallValid, context, name);
    }
}

// GL_ANGLE_robust_client_memory
void GL_APIENTRY GetBooleanvRobustANGLE(GLenum pname,
                                        GLsizei bufSize,
                                        GLsizei *length,
                                        GLboolean *params)
{
    EVENT("(GLenum pname = 0x%X, GLsizei bufSize = %d, GLsizei * length = 0x%016" PRIxPTR
          ", GLboolean * params = 0x%016" PRIxPTR ")",
          pname, bufSize, (uintptr_t)length, (uintptr_t)params);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() ||
             ValidateGetBooleanvRobustANGLE(context, pname, bufSize, length, params));
        if (isCallValid)
        {
            context->getBooleanvRobust(pname, bufSize, length, params);
        }
        ANGLE_CAPTURE(GetBooleanvRobustANGLE, isCallValid, context, pname, bufSize, length, params);
    }
}

void GL_APIENTRY GetBufferParameterivRobustANGLE(GLenum target,
                                                 GLenum pname,
                                                 GLsizei bufSize,
                                                 GLsizei *length,
                                                 GLint *params)
{
    EVENT(
        "(GLenum target = 0x%X, GLenum pname = 0x%X, GLsizei bufSize = %d, GLsizei * length = "
        "0x%016" PRIxPTR ", GLint * params = 0x%016" PRIxPTR ")",
        target, pname, bufSize, (uintptr_t)length, (uintptr_t)params);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        BufferBinding targetPacked = FromGLenum<BufferBinding>(target);
        bool isCallValid           = (context->skipValidation() ||
                            ValidateGetBufferParameterivRobustANGLE(context, targetPacked, pname,
                                                                    bufSize, length, params));
        if (isCallValid)
        {
            context->getBufferParameterivRobust(targetPacked, pname, bufSize, length, params);
        }
        ANGLE_CAPTURE(GetBufferParameterivRobustANGLE, isCallValid, context, targetPacked, pname,
                      bufSize, length, params);
    }
}

void GL_APIENTRY GetFloatvRobustANGLE(GLenum pname,
                                      GLsizei bufSize,
                                      GLsizei *length,
                                      GLfloat *params)
{
    EVENT("(GLenum pname = 0x%X, GLsizei bufSize = %d, GLsizei * length = 0x%016" PRIxPTR
          ", GLfloat * params = 0x%016" PRIxPTR ")",
          pname, bufSize, (uintptr_t)length, (uintptr_t)params);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid = (context->skipValidation() ||
                            ValidateGetFloatvRobustANGLE(context, pname, bufSize, length, params));
        if (isCallValid)
        {
            context->getFloatvRobust(pname, bufSize, length, params);
        }
        ANGLE_CAPTURE(GetFloatvRobustANGLE, isCallValid, context, pname, bufSize, length, params);
    }
}

void GL_APIENTRY GetFramebufferAttachmentParameterivRobustANGLE(GLenum target,
                                                                GLenum attachment,
                                                                GLenum pname,
                                                                GLsizei bufSize,
                                                                GLsizei *length,
                                                                GLint *params)
{
    EVENT(
        "(GLenum target = 0x%X, GLenum attachment = 0x%X, GLenum pname = 0x%X, GLsizei bufSize = "
        "%d, GLsizei * length = 0x%016" PRIxPTR ", GLint * params = 0x%016" PRIxPTR ")",
        target, attachment, pname, bufSize, (uintptr_t)length, (uintptr_t)params);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid = (context->skipValidation() ||
                            ValidateGetFramebufferAttachmentParameterivRobustANGLE(
                                context, target, attachment, pname, bufSize, length, params));
        if (isCallValid)
        {
            context->getFramebufferAttachmentParameterivRobust(target, attachment, pname, bufSize,
                                                               length, params);
        }
        ANGLE_CAPTURE(GetFramebufferAttachmentParameterivRobustANGLE, isCallValid, context, target,
                      attachment, pname, bufSize, length, params);
    }
}

void GL_APIENTRY GetIntegervRobustANGLE(GLenum pname, GLsizei bufSize, GLsizei *length, GLint *data)
{
    EVENT("(GLenum pname = 0x%X, GLsizei bufSize = %d, GLsizei * length = 0x%016" PRIxPTR
          ", GLint * data = 0x%016" PRIxPTR ")",
          pname, bufSize, (uintptr_t)length, (uintptr_t)data);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid = (context->skipValidation() ||
                            ValidateGetIntegervRobustANGLE(context, pname, bufSize, length, data));
        if (isCallValid)
        {
            context->getIntegervRobust(pname, bufSize, length, data);
        }
        ANGLE_CAPTURE(GetIntegervRobustANGLE, isCallValid, context, pname, bufSize, length, data);
    }
}

void GL_APIENTRY GetProgramivRobustANGLE(GLuint program,
                                         GLenum pname,
                                         GLsizei bufSize,
                                         GLsizei *length,
                                         GLint *params)
{
    EVENT(
        "(GLuint program = %u, GLenum pname = 0x%X, GLsizei bufSize = %d, GLsizei * length = "
        "0x%016" PRIxPTR ", GLint * params = 0x%016" PRIxPTR ")",
        program, pname, bufSize, (uintptr_t)length, (uintptr_t)params);

    Context *context = GetGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() ||
             ValidateGetProgramivRobustANGLE(context, program, pname, bufSize, length, params));
        if (isCallValid)
        {
            context->getProgramivRobust(program, pname, bufSize, length, params);
        }
        ANGLE_CAPTURE(GetProgramivRobustANGLE, isCallValid, context, program, pname, bufSize,
                      length, params);
    }
}

void GL_APIENTRY GetRenderbufferParameterivRobustANGLE(GLenum target,
                                                       GLenum pname,
                                                       GLsizei bufSize,
                                                       GLsizei *length,
                                                       GLint *params)
{
    EVENT(
        "(GLenum target = 0x%X, GLenum pname = 0x%X, GLsizei bufSize = %d, GLsizei * length = "
        "0x%016" PRIxPTR ", GLint * params = 0x%016" PRIxPTR ")",
        target, pname, bufSize, (uintptr_t)length, (uintptr_t)params);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() || ValidateGetRenderbufferParameterivRobustANGLE(
                                              context, target, pname, bufSize, length, params));
        if (isCallValid)
        {
            context->getRenderbufferParameterivRobust(target, pname, bufSize, length, params);
        }
        ANGLE_CAPTURE(GetRenderbufferParameterivRobustANGLE, isCallValid, context, target, pname,
                      bufSize, length, params);
    }
}

void GL_APIENTRY
GetShaderivRobustANGLE(GLuint shader, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *params)
{
    EVENT(
        "(GLuint shader = %u, GLenum pname = 0x%X, GLsizei bufSize = %d, GLsizei * length = "
        "0x%016" PRIxPTR ", GLint * params = 0x%016" PRIxPTR ")",
        shader, pname, bufSize, (uintptr_t)length, (uintptr_t)params);

    Context *context = GetGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() ||
             ValidateGetShaderivRobustANGLE(context, shader, pname, bufSize, length, params));
        if (isCallValid)
        {
            context->getShaderivRobust(shader, pname, bufSize, length, params);
        }
        ANGLE_CAPTURE(GetShaderivRobustANGLE, isCallValid, context, shader, pname, bufSize, length,
                      params);
    }
}

void GL_APIENTRY GetTexParameterfvRobustANGLE(GLenum target,
                                              GLenum pname,
                                              GLsizei bufSize,
                                              GLsizei *length,
                                              GLfloat *params)
{
    EVENT(
        "(GLenum target = 0x%X, GLenum pname = 0x%X, GLsizei bufSize = %d, GLsizei * length = "
        "0x%016" PRIxPTR ", GLfloat * params = 0x%016" PRIxPTR ")",
        target, pname, bufSize, (uintptr_t)length, (uintptr_t)params);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        TextureType targetPacked = FromGLenum<TextureType>(target);
        bool isCallValid         = (context->skipValidation() ||
                            ValidateGetTexParameterfvRobustANGLE(context, targetPacked, pname,
                                                                 bufSize, length, params));
        if (isCallValid)
        {
            context->getTexParameterfvRobust(targetPacked, pname, bufSize, length, params);
        }
        ANGLE_CAPTURE(GetTexParameterfvRobustANGLE, isCallValid, context, targetPacked, pname,
                      bufSize, length, params);
    }
}

void GL_APIENTRY GetTexParameterivRobustANGLE(GLenum target,
                                              GLenum pname,
                                              GLsizei bufSize,
                                              GLsizei *length,
                                              GLint *params)
{
    EVENT(
        "(GLenum target = 0x%X, GLenum pname = 0x%X, GLsizei bufSize = %d, GLsizei * length = "
        "0x%016" PRIxPTR ", GLint * params = 0x%016" PRIxPTR ")",
        target, pname, bufSize, (uintptr_t)length, (uintptr_t)params);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        TextureType targetPacked = FromGLenum<TextureType>(target);
        bool isCallValid         = (context->skipValidation() ||
                            ValidateGetTexParameterivRobustANGLE(context, targetPacked, pname,
                                                                 bufSize, length, params));
        if (isCallValid)
        {
            context->getTexParameterivRobust(targetPacked, pname, bufSize, length, params);
        }
        ANGLE_CAPTURE(GetTexParameterivRobustANGLE, isCallValid, context, targetPacked, pname,
                      bufSize, length, params);
    }
}

void GL_APIENTRY GetUniformfvRobustANGLE(GLuint program,
                                         GLint location,
                                         GLsizei bufSize,
                                         GLsizei *length,
                                         GLfloat *params)
{
    EVENT(
        "(GLuint program = %u, GLint location = %d, GLsizei bufSize = %d, GLsizei * length = "
        "0x%016" PRIxPTR ", GLfloat * params = 0x%016" PRIxPTR ")",
        program, location, bufSize, (uintptr_t)length, (uintptr_t)params);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() ||
             ValidateGetUniformfvRobustANGLE(context, program, location, bufSize, length, params));
        if (isCallValid)
        {
            context->getUniformfvRobust(program, location, bufSize, length, params);
        }
        ANGLE_CAPTURE(GetUniformfvRobustANGLE, isCallValid, context, program, location, bufSize,
                      length, params);
    }
}

void GL_APIENTRY GetUniformivRobustANGLE(GLuint program,
                                         GLint location,
                                         GLsizei bufSize,
                                         GLsizei *length,
                                         GLint *params)
{
    EVENT(
        "(GLuint program = %u, GLint location = %d, GLsizei bufSize = %d, GLsizei * length = "
        "0x%016" PRIxPTR ", GLint * params = 0x%016" PRIxPTR ")",
        program, location, bufSize, (uintptr_t)length, (uintptr_t)params);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() ||
             ValidateGetUniformivRobustANGLE(context, program, location, bufSize, length, params));
        if (isCallValid)
        {
            context->getUniformivRobust(program, location, bufSize, length, params);
        }
        ANGLE_CAPTURE(GetUniformivRobustANGLE, isCallValid, context, program, location, bufSize,
                      length, params);
    }
}

void GL_APIENTRY GetVertexAttribfvRobustANGLE(GLuint index,
                                              GLenum pname,
                                              GLsizei bufSize,
                                              GLsizei *length,
                                              GLfloat *params)
{
    EVENT(
        "(GLuint index = %u, GLenum pname = 0x%X, GLsizei bufSize = %d, GLsizei * length = "
        "0x%016" PRIxPTR ", GLfloat * params = 0x%016" PRIxPTR ")",
        index, pname, bufSize, (uintptr_t)length, (uintptr_t)params);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() ||
             ValidateGetVertexAttribfvRobustANGLE(context, index, pname, bufSize, length, params));
        if (isCallValid)
        {
            context->getVertexAttribfvRobust(index, pname, bufSize, length, params);
        }
        ANGLE_CAPTURE(GetVertexAttribfvRobustANGLE, isCallValid, context, index, pname, bufSize,
                      length, params);
    }
}

void GL_APIENTRY GetVertexAttribivRobustANGLE(GLuint index,
                                              GLenum pname,
                                              GLsizei bufSize,
                                              GLsizei *length,
                                              GLint *params)
{
    EVENT(
        "(GLuint index = %u, GLenum pname = 0x%X, GLsizei bufSize = %d, GLsizei * length = "
        "0x%016" PRIxPTR ", GLint * params = 0x%016" PRIxPTR ")",
        index, pname, bufSize, (uintptr_t)length, (uintptr_t)params);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() ||
             ValidateGetVertexAttribivRobustANGLE(context, index, pname, bufSize, length, params));
        if (isCallValid)
        {
            context->getVertexAttribivRobust(index, pname, bufSize, length, params);
        }
        ANGLE_CAPTURE(GetVertexAttribivRobustANGLE, isCallValid, context, index, pname, bufSize,
                      length, params);
    }
}

void GL_APIENTRY GetVertexAttribPointervRobustANGLE(GLuint index,
                                                    GLenum pname,
                                                    GLsizei bufSize,
                                                    GLsizei *length,
                                                    void **pointer)
{
    EVENT(
        "(GLuint index = %u, GLenum pname = 0x%X, GLsizei bufSize = %d, GLsizei * length = "
        "0x%016" PRIxPTR ", void ** pointer = 0x%016" PRIxPTR ")",
        index, pname, bufSize, (uintptr_t)length, (uintptr_t)pointer);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() || ValidateGetVertexAttribPointervRobustANGLE(
                                              context, index, pname, bufSize, length, pointer));
        if (isCallValid)
        {
            context->getVertexAttribPointervRobust(index, pname, bufSize, length, pointer);
        }
        ANGLE_CAPTURE(GetVertexAttribPointervRobustANGLE, isCallValid, context, index, pname,
                      bufSize, length, pointer);
    }
}

void GL_APIENTRY ReadPixelsRobustANGLE(GLint x,
                                       GLint y,
                                       GLsizei width,
                                       GLsizei height,
                                       GLenum format,
                                       GLenum type,
                                       GLsizei bufSize,
                                       GLsizei *length,
                                       GLsizei *columns,
                                       GLsizei *rows,
                                       void *pixels)
{
    EVENT(
        "(GLint x = %d, GLint y = %d, GLsizei width = %d, GLsizei height = %d, GLenum format = "
        "0x%X, GLenum type = 0x%X, GLsizei bufSize = %d, GLsizei * length = 0x%016" PRIxPTR
        ", GLsizei * columns = 0x%016" PRIxPTR ", GLsizei * rows = 0x%016" PRIxPTR
        ", void * pixels = 0x%016" PRIxPTR ")",
        x, y, width, height, format, type, bufSize, (uintptr_t)length, (uintptr_t)columns,
        (uintptr_t)rows, (uintptr_t)pixels);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() ||
             ValidateReadPixelsRobustANGLE(context, x, y, width, height, format, type, bufSize,
                                           length, columns, rows, pixels));
        if (isCallValid)
        {
            context->readPixelsRobust(x, y, width, height, format, type, bufSize, length, columns,
                                      rows, pixels);
        }
        ANGLE_CAPTURE(ReadPixelsRobustANGLE, isCallValid, context, x, y, width, height, format,
                      type, bufSize, length, columns, rows, pixels);
    }
}

void GL_APIENTRY TexImage2DRobustANGLE(GLenum target,
                                       GLint level,
                                       GLint internalformat,
                                       GLsizei width,
                                       GLsizei height,
                                       GLint border,
                                       GLenum format,
                                       GLenum type,
                                       GLsizei bufSize,
                                       const void *pixels)
{
    EVENT(
        "(GLenum target = 0x%X, GLint level = %d, GLint internalformat = %d, GLsizei width = %d, "
        "GLsizei height = %d, GLint border = %d, GLenum format = 0x%X, GLenum type = 0x%X, GLsizei "
        "bufSize = %d, const void * pixels = 0x%016" PRIxPTR ")",
        target, level, internalformat, width, height, border, format, type, bufSize,
        (uintptr_t)pixels);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        TextureTarget targetPacked = FromGLenum<TextureTarget>(target);
        bool isCallValid =
            (context->skipValidation() ||
             ValidateTexImage2DRobustANGLE(context, targetPacked, level, internalformat, width,
                                           height, border, format, type, bufSize, pixels));
        if (isCallValid)
        {
            context->texImage2DRobust(targetPacked, level, internalformat, width, height, border,
                                      format, type, bufSize, pixels);
        }
        ANGLE_CAPTURE(TexImage2DRobustANGLE, isCallValid, context, targetPacked, level,
                      internalformat, width, height, border, format, type, bufSize, pixels);
    }
}

void GL_APIENTRY TexParameterfvRobustANGLE(GLenum target,
                                           GLenum pname,
                                           GLsizei bufSize,
                                           const GLfloat *params)
{
    EVENT(
        "(GLenum target = 0x%X, GLenum pname = 0x%X, GLsizei bufSize = %d, const GLfloat * params "
        "= 0x%016" PRIxPTR ")",
        target, pname, bufSize, (uintptr_t)params);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        TextureType targetPacked = FromGLenum<TextureType>(target);
        bool isCallValid =
            (context->skipValidation() ||
             ValidateTexParameterfvRobustANGLE(context, targetPacked, pname, bufSize, params));
        if (isCallValid)
        {
            context->texParameterfvRobust(targetPacked, pname, bufSize, params);
        }
        ANGLE_CAPTURE(TexParameterfvRobustANGLE, isCallValid, context, targetPacked, pname, bufSize,
                      params);
    }
}

void GL_APIENTRY TexParameterivRobustANGLE(GLenum target,
                                           GLenum pname,
                                           GLsizei bufSize,
                                           const GLint *params)
{
    EVENT(
        "(GLenum target = 0x%X, GLenum pname = 0x%X, GLsizei bufSize = %d, const GLint * params = "
        "0x%016" PRIxPTR ")",
        target, pname, bufSize, (uintptr_t)params);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        TextureType targetPacked = FromGLenum<TextureType>(target);
        bool isCallValid =
            (context->skipValidation() ||
             ValidateTexParameterivRobustANGLE(context, targetPacked, pname, bufSize, params));
        if (isCallValid)
        {
            context->texParameterivRobust(targetPacked, pname, bufSize, params);
        }
        ANGLE_CAPTURE(TexParameterivRobustANGLE, isCallValid, context, targetPacked, pname, bufSize,
                      params);
    }
}

void GL_APIENTRY TexSubImage2DRobustANGLE(GLenum target,
                                          GLint level,
                                          GLint xoffset,
                                          GLint yoffset,
                                          GLsizei width,
                                          GLsizei height,
                                          GLenum format,
                                          GLenum type,
                                          GLsizei bufSize,
                                          const void *pixels)
{
    EVENT(
        "(GLenum target = 0x%X, GLint level = %d, GLint xoffset = %d, GLint yoffset = %d, GLsizei "
        "width = %d, GLsizei height = %d, GLenum format = 0x%X, GLenum type = 0x%X, GLsizei "
        "bufSize = %d, const void * pixels = 0x%016" PRIxPTR ")",
        target, level, xoffset, yoffset, width, height, format, type, bufSize, (uintptr_t)pixels);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        TextureTarget targetPacked = FromGLenum<TextureTarget>(target);
        bool isCallValid =
            (context->skipValidation() ||
             ValidateTexSubImage2DRobustANGLE(context, targetPacked, level, xoffset, yoffset, width,
                                              height, format, type, bufSize, pixels));
        if (isCallValid)
        {
            context->texSubImage2DRobust(targetPacked, level, xoffset, yoffset, width, height,
                                         format, type, bufSize, pixels);
        }
        ANGLE_CAPTURE(TexSubImage2DRobustANGLE, isCallValid, context, targetPacked, level, xoffset,
                      yoffset, width, height, format, type, bufSize, pixels);
    }
}

void GL_APIENTRY TexImage3DRobustANGLE(GLenum target,
                                       GLint level,
                                       GLint internalformat,
                                       GLsizei width,
                                       GLsizei height,
                                       GLsizei depth,
                                       GLint border,
                                       GLenum format,
                                       GLenum type,
                                       GLsizei bufSize,
                                       const void *pixels)
{
    EVENT(
        "(GLenum target = 0x%X, GLint level = %d, GLint internalformat = %d, GLsizei width = %d, "
        "GLsizei height = %d, GLsizei depth = %d, GLint border = %d, GLenum format = 0x%X, GLenum "
        "type = 0x%X, GLsizei bufSize = %d, const void * pixels = 0x%016" PRIxPTR ")",
        target, level, internalformat, width, height, depth, border, format, type, bufSize,
        (uintptr_t)pixels);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        TextureTarget targetPacked = FromGLenum<TextureTarget>(target);
        bool isCallValid =
            (context->skipValidation() ||
             ValidateTexImage3DRobustANGLE(context, targetPacked, level, internalformat, width,
                                           height, depth, border, format, type, bufSize, pixels));
        if (isCallValid)
        {
            context->texImage3DRobust(targetPacked, level, internalformat, width, height, depth,
                                      border, format, type, bufSize, pixels);
        }
        ANGLE_CAPTURE(TexImage3DRobustANGLE, isCallValid, context, targetPacked, level,
                      internalformat, width, height, depth, border, format, type, bufSize, pixels);
    }
}

void GL_APIENTRY TexSubImage3DRobustANGLE(GLenum target,
                                          GLint level,
                                          GLint xoffset,
                                          GLint yoffset,
                                          GLint zoffset,
                                          GLsizei width,
                                          GLsizei height,
                                          GLsizei depth,
                                          GLenum format,
                                          GLenum type,
                                          GLsizei bufSize,
                                          const void *pixels)
{
    EVENT(
        "(GLenum target = 0x%X, GLint level = %d, GLint xoffset = %d, GLint yoffset = %d, GLint "
        "zoffset = %d, GLsizei width = %d, GLsizei height = %d, GLsizei depth = %d, GLenum format "
        "= 0x%X, GLenum type = 0x%X, GLsizei bufSize = %d, const void * pixels = 0x%016" PRIxPTR
        ")",
        target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, bufSize,
        (uintptr_t)pixels);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        TextureTarget targetPacked = FromGLenum<TextureTarget>(target);
        bool isCallValid           = (context->skipValidation() ||
                            ValidateTexSubImage3DRobustANGLE(context, targetPacked, level, xoffset,
                                                             yoffset, zoffset, width, height, depth,
                                                             format, type, bufSize, pixels));
        if (isCallValid)
        {
            context->texSubImage3DRobust(targetPacked, level, xoffset, yoffset, zoffset, width,
                                         height, depth, format, type, bufSize, pixels);
        }
        ANGLE_CAPTURE(TexSubImage3DRobustANGLE, isCallValid, context, targetPacked, level, xoffset,
                      yoffset, zoffset, width, height, depth, format, type, bufSize, pixels);
    }
}

void GL_APIENTRY CompressedTexImage2DRobustANGLE(GLenum target,
                                                 GLint level,
                                                 GLenum internalformat,
                                                 GLsizei width,
                                                 GLsizei height,
                                                 GLint border,
                                                 GLsizei imageSize,
                                                 GLsizei dataSize,
                                                 const GLvoid *data)
{
    EVENT(
        "(GLenum target = 0x%X, GLint level = %d, GLenum internalformat = 0x%X, GLsizei width = "
        "%d, GLsizei height = %d, GLint border = %d, GLsizei imageSize = %d, GLsizei dataSize = "
        "%d, const GLvoid * data = 0x%016" PRIxPTR ")",
        target, level, internalformat, width, height, border, imageSize, dataSize, (uintptr_t)data);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        TextureTarget targetPacked = FromGLenum<TextureTarget>(target);
        bool isCallValid =
            (context->skipValidation() || ValidateCompressedTexImage2DRobustANGLE(
                                              context, targetPacked, level, internalformat, width,
                                              height, border, imageSize, dataSize, data));
        if (isCallValid)
        {
            context->compressedTexImage2DRobust(targetPacked, level, internalformat, width, height,
                                                border, imageSize, dataSize, data);
        }
        ANGLE_CAPTURE(CompressedTexImage2DRobustANGLE, isCallValid, context, targetPacked, level,
                      internalformat, width, height, border, imageSize, dataSize, data);
    }
}

void GL_APIENTRY CompressedTexSubImage2DRobustANGLE(GLenum target,
                                                    GLint level,
                                                    GLsizei xoffset,
                                                    GLsizei yoffset,
                                                    GLsizei width,
                                                    GLsizei height,
                                                    GLenum format,
                                                    GLsizei imageSize,
                                                    GLsizei dataSize,
                                                    const GLvoid *data)
{
    EVENT(
        "(GLenum target = 0x%X, GLint level = %d, GLsizei xoffset = %d, GLsizei yoffset = %d, "
        "GLsizei width = %d, GLsizei height = %d, GLenum format = 0x%X, GLsizei imageSize = %d, "
        "GLsizei dataSize = %d, const GLvoid * data = 0x%016" PRIxPTR ")",
        target, level, xoffset, yoffset, width, height, format, imageSize, dataSize,
        (uintptr_t)data);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        TextureTarget targetPacked = FromGLenum<TextureTarget>(target);
        bool isCallValid =
            (context->skipValidation() || ValidateCompressedTexSubImage2DRobustANGLE(
                                              context, targetPacked, level, xoffset, yoffset, width,
                                              height, format, imageSize, dataSize, data));
        if (isCallValid)
        {
            context->compressedTexSubImage2DRobust(targetPacked, level, xoffset, yoffset, width,
                                                   height, format, imageSize, dataSize, data);
        }
        ANGLE_CAPTURE(CompressedTexSubImage2DRobustANGLE, isCallValid, context, targetPacked, level,
                      xoffset, yoffset, width, height, format, imageSize, dataSize, data);
    }
}

void GL_APIENTRY CompressedTexImage3DRobustANGLE(GLenum target,
                                                 GLint level,
                                                 GLenum internalformat,
                                                 GLsizei width,
                                                 GLsizei height,
                                                 GLsizei depth,
                                                 GLint border,
                                                 GLsizei imageSize,
                                                 GLsizei dataSize,
                                                 const GLvoid *data)
{
    EVENT(
        "(GLenum target = 0x%X, GLint level = %d, GLenum internalformat = 0x%X, GLsizei width = "
        "%d, GLsizei height = %d, GLsizei depth = %d, GLint border = %d, GLsizei imageSize = %d, "
        "GLsizei dataSize = %d, const GLvoid * data = 0x%016" PRIxPTR ")",
        target, level, internalformat, width, height, depth, border, imageSize, dataSize,
        (uintptr_t)data);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        TextureTarget targetPacked = FromGLenum<TextureTarget>(target);
        bool isCallValid =
            (context->skipValidation() || ValidateCompressedTexImage3DRobustANGLE(
                                              context, targetPacked, level, internalformat, width,
                                              height, depth, border, imageSize, dataSize, data));
        if (isCallValid)
        {
            context->compressedTexImage3DRobust(targetPacked, level, internalformat, width, height,
                                                depth, border, imageSize, dataSize, data);
        }
        ANGLE_CAPTURE(CompressedTexImage3DRobustANGLE, isCallValid, context, targetPacked, level,
                      internalformat, width, height, depth, border, imageSize, dataSize, data);
    }
}

void GL_APIENTRY CompressedTexSubImage3DRobustANGLE(GLenum target,
                                                    GLint level,
                                                    GLint xoffset,
                                                    GLint yoffset,
                                                    GLint zoffset,
                                                    GLsizei width,
                                                    GLsizei height,
                                                    GLsizei depth,
                                                    GLenum format,
                                                    GLsizei imageSize,
                                                    GLsizei dataSize,
                                                    const GLvoid *data)
{
    EVENT(
        "(GLenum target = 0x%X, GLint level = %d, GLint xoffset = %d, GLint yoffset = %d, GLint "
        "zoffset = %d, GLsizei width = %d, GLsizei height = %d, GLsizei depth = %d, GLenum format "
        "= 0x%X, GLsizei imageSize = %d, GLsizei dataSize = %d, const GLvoid * data = "
        "0x%016" PRIxPTR ")",
        target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, dataSize,
        (uintptr_t)data);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        TextureTarget targetPacked = FromGLenum<TextureTarget>(target);
        bool isCallValid           = (context->skipValidation() ||
                            ValidateCompressedTexSubImage3DRobustANGLE(
                                context, targetPacked, level, xoffset, yoffset, zoffset, width,
                                height, depth, format, imageSize, dataSize, data));
        if (isCallValid)
        {
            context->compressedTexSubImage3DRobust(targetPacked, level, xoffset, yoffset, zoffset,
                                                   width, height, depth, format, imageSize,
                                                   dataSize, data);
        }
        ANGLE_CAPTURE(CompressedTexSubImage3DRobustANGLE, isCallValid, context, targetPacked, level,
                      xoffset, yoffset, zoffset, width, height, depth, format, imageSize, dataSize,
                      data);
    }
}

void GL_APIENTRY
GetQueryivRobustANGLE(GLenum target, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *params)
{
    EVENT(
        "(GLenum target = 0x%X, GLenum pname = 0x%X, GLsizei bufSize = %d, GLsizei * length = "
        "0x%016" PRIxPTR ", GLint * params = 0x%016" PRIxPTR ")",
        target, pname, bufSize, (uintptr_t)length, (uintptr_t)params);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        QueryType targetPacked = FromGLenum<QueryType>(target);
        bool isCallValid =
            (context->skipValidation() ||
             ValidateGetQueryivRobustANGLE(context, targetPacked, pname, bufSize, length, params));
        if (isCallValid)
        {
            context->getQueryivRobust(targetPacked, pname, bufSize, length, params);
        }
        ANGLE_CAPTURE(GetQueryivRobustANGLE, isCallValid, context, targetPacked, pname, bufSize,
                      length, params);
    }
}

void GL_APIENTRY GetQueryObjectuivRobustANGLE(GLuint id,
                                              GLenum pname,
                                              GLsizei bufSize,
                                              GLsizei *length,
                                              GLuint *params)
{
    EVENT(
        "(GLuint id = %u, GLenum pname = 0x%X, GLsizei bufSize = %d, GLsizei * length = "
        "0x%016" PRIxPTR ", GLuint * params = 0x%016" PRIxPTR ")",
        id, pname, bufSize, (uintptr_t)length, (uintptr_t)params);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() ||
             ValidateGetQueryObjectuivRobustANGLE(context, id, pname, bufSize, length, params));
        if (isCallValid)
        {
            context->getQueryObjectuivRobust(id, pname, bufSize, length, params);
        }
        ANGLE_CAPTURE(GetQueryObjectuivRobustANGLE, isCallValid, context, id, pname, bufSize,
                      length, params);
    }
}

void GL_APIENTRY GetBufferPointervRobustANGLE(GLenum target,
                                              GLenum pname,
                                              GLsizei bufSize,
                                              GLsizei *length,
                                              void **params)
{
    EVENT(
        "(GLenum target = 0x%X, GLenum pname = 0x%X, GLsizei bufSize = %d, GLsizei * length = "
        "0x%016" PRIxPTR ", void ** params = 0x%016" PRIxPTR ")",
        target, pname, bufSize, (uintptr_t)length, (uintptr_t)params);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        BufferBinding targetPacked = FromGLenum<BufferBinding>(target);
        bool isCallValid           = (context->skipValidation() ||
                            ValidateGetBufferPointervRobustANGLE(context, targetPacked, pname,
                                                                 bufSize, length, params));
        if (isCallValid)
        {
            context->getBufferPointervRobust(targetPacked, pname, bufSize, length, params);
        }
        ANGLE_CAPTURE(GetBufferPointervRobustANGLE, isCallValid, context, targetPacked, pname,
                      bufSize, length, params);
    }
}

void GL_APIENTRY
GetIntegeri_vRobustANGLE(GLenum target, GLuint index, GLsizei bufSize, GLsizei *length, GLint *data)
{
    EVENT(
        "(GLenum target = 0x%X, GLuint index = %u, GLsizei bufSize = %d, GLsizei * length = "
        "0x%016" PRIxPTR ", GLint * data = 0x%016" PRIxPTR ")",
        target, index, bufSize, (uintptr_t)length, (uintptr_t)data);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() ||
             ValidateGetIntegeri_vRobustANGLE(context, target, index, bufSize, length, data));
        if (isCallValid)
        {
            context->getIntegeri_vRobust(target, index, bufSize, length, data);
        }
        ANGLE_CAPTURE(GetIntegeri_vRobustANGLE, isCallValid, context, target, index, bufSize,
                      length, data);
    }
}

void GL_APIENTRY GetInternalformativRobustANGLE(GLenum target,
                                                GLenum internalformat,
                                                GLenum pname,
                                                GLsizei bufSize,
                                                GLsizei *length,
                                                GLint *params)
{
    EVENT(
        "(GLenum target = 0x%X, GLenum internalformat = 0x%X, GLenum pname = 0x%X, GLsizei bufSize "
        "= %d, GLsizei * length = 0x%016" PRIxPTR ", GLint * params = 0x%016" PRIxPTR ")",
        target, internalformat, pname, bufSize, (uintptr_t)length, (uintptr_t)params);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid = (context->skipValidation() ||
                            ValidateGetInternalformativRobustANGLE(context, target, internalformat,
                                                                   pname, bufSize, length, params));
        if (isCallValid)
        {
            context->getInternalformativRobust(target, internalformat, pname, bufSize, length,
                                               params);
        }
        ANGLE_CAPTURE(GetInternalformativRobustANGLE, isCallValid, context, target, internalformat,
                      pname, bufSize, length, params);
    }
}

void GL_APIENTRY GetVertexAttribIivRobustANGLE(GLuint index,
                                               GLenum pname,
                                               GLsizei bufSize,
                                               GLsizei *length,
                                               GLint *params)
{
    EVENT(
        "(GLuint index = %u, GLenum pname = 0x%X, GLsizei bufSize = %d, GLsizei * length = "
        "0x%016" PRIxPTR ", GLint * params = 0x%016" PRIxPTR ")",
        index, pname, bufSize, (uintptr_t)length, (uintptr_t)params);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() ||
             ValidateGetVertexAttribIivRobustANGLE(context, index, pname, bufSize, length, params));
        if (isCallValid)
        {
            context->getVertexAttribIivRobust(index, pname, bufSize, length, params);
        }
        ANGLE_CAPTURE(GetVertexAttribIivRobustANGLE, isCallValid, context, index, pname, bufSize,
                      length, params);
    }
}

void GL_APIENTRY GetVertexAttribIuivRobustANGLE(GLuint index,
                                                GLenum pname,
                                                GLsizei bufSize,
                                                GLsizei *length,
                                                GLuint *params)
{
    EVENT(
        "(GLuint index = %u, GLenum pname = 0x%X, GLsizei bufSize = %d, GLsizei * length = "
        "0x%016" PRIxPTR ", GLuint * params = 0x%016" PRIxPTR ")",
        index, pname, bufSize, (uintptr_t)length, (uintptr_t)params);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() || ValidateGetVertexAttribIuivRobustANGLE(
                                              context, index, pname, bufSize, length, params));
        if (isCallValid)
        {
            context->getVertexAttribIuivRobust(index, pname, bufSize, length, params);
        }
        ANGLE_CAPTURE(GetVertexAttribIuivRobustANGLE, isCallValid, context, index, pname, bufSize,
                      length, params);
    }
}

void GL_APIENTRY GetUniformuivRobustANGLE(GLuint program,
                                          GLint location,
                                          GLsizei bufSize,
                                          GLsizei *length,
                                          GLuint *params)
{
    EVENT(
        "(GLuint program = %u, GLint location = %d, GLsizei bufSize = %d, GLsizei * length = "
        "0x%016" PRIxPTR ", GLuint * params = 0x%016" PRIxPTR ")",
        program, location, bufSize, (uintptr_t)length, (uintptr_t)params);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() ||
             ValidateGetUniformuivRobustANGLE(context, program, location, bufSize, length, params));
        if (isCallValid)
        {
            context->getUniformuivRobust(program, location, bufSize, length, params);
        }
        ANGLE_CAPTURE(GetUniformuivRobustANGLE, isCallValid, context, program, location, bufSize,
                      length, params);
    }
}

void GL_APIENTRY GetActiveUniformBlockivRobustANGLE(GLuint program,
                                                    GLuint uniformBlockIndex,
                                                    GLenum pname,
                                                    GLsizei bufSize,
                                                    GLsizei *length,
                                                    GLint *params)
{
    EVENT(
        "(GLuint program = %u, GLuint uniformBlockIndex = %u, GLenum pname = 0x%X, GLsizei bufSize "
        "= %d, GLsizei * length = 0x%016" PRIxPTR ", GLint * params = 0x%016" PRIxPTR ")",
        program, uniformBlockIndex, pname, bufSize, (uintptr_t)length, (uintptr_t)params);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid = (context->skipValidation() || ValidateGetActiveUniformBlockivRobustANGLE(
                                                             context, program, uniformBlockIndex,
                                                             pname, bufSize, length, params));
        if (isCallValid)
        {
            context->getActiveUniformBlockivRobust(program, uniformBlockIndex, pname, bufSize,
                                                   length, params);
        }
        ANGLE_CAPTURE(GetActiveUniformBlockivRobustANGLE, isCallValid, context, program,
                      uniformBlockIndex, pname, bufSize, length, params);
    }
}

void GL_APIENTRY GetInteger64vRobustANGLE(GLenum pname,
                                          GLsizei bufSize,
                                          GLsizei *length,
                                          GLint64 *data)
{
    EVENT("(GLenum pname = 0x%X, GLsizei bufSize = %d, GLsizei * length = 0x%016" PRIxPTR
          ", GLint64 * data = 0x%016" PRIxPTR ")",
          pname, bufSize, (uintptr_t)length, (uintptr_t)data);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() ||
             ValidateGetInteger64vRobustANGLE(context, pname, bufSize, length, data));
        if (isCallValid)
        {
            context->getInteger64vRobust(pname, bufSize, length, data);
        }
        ANGLE_CAPTURE(GetInteger64vRobustANGLE, isCallValid, context, pname, bufSize, length, data);
    }
}

void GL_APIENTRY GetInteger64i_vRobustANGLE(GLenum target,
                                            GLuint index,
                                            GLsizei bufSize,
                                            GLsizei *length,
                                            GLint64 *data)
{
    EVENT(
        "(GLenum target = 0x%X, GLuint index = %u, GLsizei bufSize = %d, GLsizei * length = "
        "0x%016" PRIxPTR ", GLint64 * data = 0x%016" PRIxPTR ")",
        target, index, bufSize, (uintptr_t)length, (uintptr_t)data);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() ||
             ValidateGetInteger64i_vRobustANGLE(context, target, index, bufSize, length, data));
        if (isCallValid)
        {
            context->getInteger64i_vRobust(target, index, bufSize, length, data);
        }
        ANGLE_CAPTURE(GetInteger64i_vRobustANGLE, isCallValid, context, target, index, bufSize,
                      length, data);
    }
}

void GL_APIENTRY GetBufferParameteri64vRobustANGLE(GLenum target,
                                                   GLenum pname,
                                                   GLsizei bufSize,
                                                   GLsizei *length,
                                                   GLint64 *params)
{
    EVENT(
        "(GLenum target = 0x%X, GLenum pname = 0x%X, GLsizei bufSize = %d, GLsizei * length = "
        "0x%016" PRIxPTR ", GLint64 * params = 0x%016" PRIxPTR ")",
        target, pname, bufSize, (uintptr_t)length, (uintptr_t)params);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        BufferBinding targetPacked = FromGLenum<BufferBinding>(target);
        bool isCallValid           = (context->skipValidation() ||
                            ValidateGetBufferParameteri64vRobustANGLE(context, targetPacked, pname,
                                                                      bufSize, length, params));
        if (isCallValid)
        {
            context->getBufferParameteri64vRobust(targetPacked, pname, bufSize, length, params);
        }
        ANGLE_CAPTURE(GetBufferParameteri64vRobustANGLE, isCallValid, context, targetPacked, pname,
                      bufSize, length, params);
    }
}

void GL_APIENTRY SamplerParameterivRobustANGLE(GLuint sampler,
                                               GLuint pname,
                                               GLsizei bufSize,
                                               const GLint *param)
{
    EVENT(
        "(GLuint sampler = %u, GLuint pname = %u, GLsizei bufSize = %d, const GLint * param = "
        "0x%016" PRIxPTR ")",
        sampler, pname, bufSize, (uintptr_t)param);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() ||
             ValidateSamplerParameterivRobustANGLE(context, sampler, pname, bufSize, param));
        if (isCallValid)
        {
            context->samplerParameterivRobust(sampler, pname, bufSize, param);
        }
        ANGLE_CAPTURE(SamplerParameterivRobustANGLE, isCallValid, context, sampler, pname, bufSize,
                      param);
    }
}

void GL_APIENTRY SamplerParameterfvRobustANGLE(GLuint sampler,
                                               GLenum pname,
                                               GLsizei bufSize,
                                               const GLfloat *param)
{
    EVENT(
        "(GLuint sampler = %u, GLenum pname = 0x%X, GLsizei bufSize = %d, const GLfloat * param = "
        "0x%016" PRIxPTR ")",
        sampler, pname, bufSize, (uintptr_t)param);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() ||
             ValidateSamplerParameterfvRobustANGLE(context, sampler, pname, bufSize, param));
        if (isCallValid)
        {
            context->samplerParameterfvRobust(sampler, pname, bufSize, param);
        }
        ANGLE_CAPTURE(SamplerParameterfvRobustANGLE, isCallValid, context, sampler, pname, bufSize,
                      param);
    }
}

void GL_APIENTRY GetSamplerParameterivRobustANGLE(GLuint sampler,
                                                  GLenum pname,
                                                  GLsizei bufSize,
                                                  GLsizei *length,
                                                  GLint *params)
{
    EVENT(
        "(GLuint sampler = %u, GLenum pname = 0x%X, GLsizei bufSize = %d, GLsizei * length = "
        "0x%016" PRIxPTR ", GLint * params = 0x%016" PRIxPTR ")",
        sampler, pname, bufSize, (uintptr_t)length, (uintptr_t)params);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() || ValidateGetSamplerParameterivRobustANGLE(
                                              context, sampler, pname, bufSize, length, params));
        if (isCallValid)
        {
            context->getSamplerParameterivRobust(sampler, pname, bufSize, length, params);
        }
        ANGLE_CAPTURE(GetSamplerParameterivRobustANGLE, isCallValid, context, sampler, pname,
                      bufSize, length, params);
    }
}

void GL_APIENTRY GetSamplerParameterfvRobustANGLE(GLuint sampler,
                                                  GLenum pname,
                                                  GLsizei bufSize,
                                                  GLsizei *length,
                                                  GLfloat *params)
{
    EVENT(
        "(GLuint sampler = %u, GLenum pname = 0x%X, GLsizei bufSize = %d, GLsizei * length = "
        "0x%016" PRIxPTR ", GLfloat * params = 0x%016" PRIxPTR ")",
        sampler, pname, bufSize, (uintptr_t)length, (uintptr_t)params);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() || ValidateGetSamplerParameterfvRobustANGLE(
                                              context, sampler, pname, bufSize, length, params));
        if (isCallValid)
        {
            context->getSamplerParameterfvRobust(sampler, pname, bufSize, length, params);
        }
        ANGLE_CAPTURE(GetSamplerParameterfvRobustANGLE, isCallValid, context, sampler, pname,
                      bufSize, length, params);
    }
}

void GL_APIENTRY GetFramebufferParameterivRobustANGLE(GLuint sampler,
                                                      GLenum pname,
                                                      GLsizei bufSize,
                                                      GLsizei *length,
                                                      GLint *params)
{
    EVENT(
        "(GLuint sampler = %u, GLenum pname = 0x%X, GLsizei bufSize = %d, GLsizei * length = "
        "0x%016" PRIxPTR ", GLint * params = 0x%016" PRIxPTR ")",
        sampler, pname, bufSize, (uintptr_t)length, (uintptr_t)params);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() || ValidateGetFramebufferParameterivRobustANGLE(
                                              context, sampler, pname, bufSize, length, params));
        if (isCallValid)
        {
            context->getFramebufferParameterivRobust(sampler, pname, bufSize, length, params);
        }
        ANGLE_CAPTURE(GetFramebufferParameterivRobustANGLE, isCallValid, context, sampler, pname,
                      bufSize, length, params);
    }
}

void GL_APIENTRY GetProgramInterfaceivRobustANGLE(GLuint program,
                                                  GLenum programInterface,
                                                  GLenum pname,
                                                  GLsizei bufSize,
                                                  GLsizei *length,
                                                  GLint *params)
{
    EVENT(
        "(GLuint program = %u, GLenum programInterface = 0x%X, GLenum pname = 0x%X, GLsizei "
        "bufSize = %d, GLsizei * length = 0x%016" PRIxPTR ", GLint * params = 0x%016" PRIxPTR ")",
        program, programInterface, pname, bufSize, (uintptr_t)length, (uintptr_t)params);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid = (context->skipValidation() || ValidateGetProgramInterfaceivRobustANGLE(
                                                             context, program, programInterface,
                                                             pname, bufSize, length, params));
        if (isCallValid)
        {
            context->getProgramInterfaceivRobust(program, programInterface, pname, bufSize, length,
                                                 params);
        }
        ANGLE_CAPTURE(GetProgramInterfaceivRobustANGLE, isCallValid, context, program,
                      programInterface, pname, bufSize, length, params);
    }
}

void GL_APIENTRY GetBooleani_vRobustANGLE(GLenum target,
                                          GLuint index,
                                          GLsizei bufSize,
                                          GLsizei *length,
                                          GLboolean *data)
{
    EVENT(
        "(GLenum target = 0x%X, GLuint index = %u, GLsizei bufSize = %d, GLsizei * length = "
        "0x%016" PRIxPTR ", GLboolean * data = 0x%016" PRIxPTR ")",
        target, index, bufSize, (uintptr_t)length, (uintptr_t)data);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() ||
             ValidateGetBooleani_vRobustANGLE(context, target, index, bufSize, length, data));
        if (isCallValid)
        {
            context->getBooleani_vRobust(target, index, bufSize, length, data);
        }
        ANGLE_CAPTURE(GetBooleani_vRobustANGLE, isCallValid, context, target, index, bufSize,
                      length, data);
    }
}

void GL_APIENTRY GetMultisamplefvRobustANGLE(GLenum pname,
                                             GLuint index,
                                             GLsizei bufSize,
                                             GLsizei *length,
                                             GLfloat *val)
{
    EVENT(
        "(GLenum pname = 0x%X, GLuint index = %u, GLsizei bufSize = %d, GLsizei * length = "
        "0x%016" PRIxPTR ", GLfloat * val = 0x%016" PRIxPTR ")",
        pname, index, bufSize, (uintptr_t)length, (uintptr_t)val);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() ||
             ValidateGetMultisamplefvRobustANGLE(context, pname, index, bufSize, length, val));
        if (isCallValid)
        {
            context->getMultisamplefvRobust(pname, index, bufSize, length, val);
        }
        ANGLE_CAPTURE(GetMultisamplefvRobustANGLE, isCallValid, context, pname, index, bufSize,
                      length, val);
    }
}

void GL_APIENTRY GetTexLevelParameterivRobustANGLE(GLenum target,
                                                   GLint level,
                                                   GLenum pname,
                                                   GLsizei bufSize,
                                                   GLsizei *length,
                                                   GLint *params)
{
    EVENT(
        "(GLenum target = 0x%X, GLint level = %d, GLenum pname = 0x%X, GLsizei bufSize = %d, "
        "GLsizei * length = 0x%016" PRIxPTR ", GLint * params = 0x%016" PRIxPTR ")",
        target, level, pname, bufSize, (uintptr_t)length, (uintptr_t)params);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        TextureTarget targetPacked = FromGLenum<TextureTarget>(target);
        bool isCallValid           = (context->skipValidation() ||
                            ValidateGetTexLevelParameterivRobustANGLE(
                                context, targetPacked, level, pname, bufSize, length, params));
        if (isCallValid)
        {
            context->getTexLevelParameterivRobust(targetPacked, level, pname, bufSize, length,
                                                  params);
        }
        ANGLE_CAPTURE(GetTexLevelParameterivRobustANGLE, isCallValid, context, targetPacked, level,
                      pname, bufSize, length, params);
    }
}

void GL_APIENTRY GetTexLevelParameterfvRobustANGLE(GLenum target,
                                                   GLint level,
                                                   GLenum pname,
                                                   GLsizei bufSize,
                                                   GLsizei *length,
                                                   GLfloat *params)
{
    EVENT(
        "(GLenum target = 0x%X, GLint level = %d, GLenum pname = 0x%X, GLsizei bufSize = %d, "
        "GLsizei * length = 0x%016" PRIxPTR ", GLfloat * params = 0x%016" PRIxPTR ")",
        target, level, pname, bufSize, (uintptr_t)length, (uintptr_t)params);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        TextureTarget targetPacked = FromGLenum<TextureTarget>(target);
        bool isCallValid           = (context->skipValidation() ||
                            ValidateGetTexLevelParameterfvRobustANGLE(
                                context, targetPacked, level, pname, bufSize, length, params));
        if (isCallValid)
        {
            context->getTexLevelParameterfvRobust(targetPacked, level, pname, bufSize, length,
                                                  params);
        }
        ANGLE_CAPTURE(GetTexLevelParameterfvRobustANGLE, isCallValid, context, targetPacked, level,
                      pname, bufSize, length, params);
    }
}

void GL_APIENTRY GetPointervRobustANGLERobustANGLE(GLenum pname,
                                                   GLsizei bufSize,
                                                   GLsizei *length,
                                                   void **params)
{
    EVENT("(GLenum pname = 0x%X, GLsizei bufSize = %d, GLsizei * length = 0x%016" PRIxPTR
          ", void ** params = 0x%016" PRIxPTR ")",
          pname, bufSize, (uintptr_t)length, (uintptr_t)params);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() ||
             ValidateGetPointervRobustANGLERobustANGLE(context, pname, bufSize, length, params));
        if (isCallValid)
        {
            context->getPointervRobustANGLERobust(pname, bufSize, length, params);
        }
        ANGLE_CAPTURE(GetPointervRobustANGLERobustANGLE, isCallValid, context, pname, bufSize,
                      length, params);
    }
}

void GL_APIENTRY ReadnPixelsRobustANGLE(GLint x,
                                        GLint y,
                                        GLsizei width,
                                        GLsizei height,
                                        GLenum format,
                                        GLenum type,
                                        GLsizei bufSize,
                                        GLsizei *length,
                                        GLsizei *columns,
                                        GLsizei *rows,
                                        void *data)
{
    EVENT(
        "(GLint x = %d, GLint y = %d, GLsizei width = %d, GLsizei height = %d, GLenum format = "
        "0x%X, GLenum type = 0x%X, GLsizei bufSize = %d, GLsizei * length = 0x%016" PRIxPTR
        ", GLsizei * columns = 0x%016" PRIxPTR ", GLsizei * rows = 0x%016" PRIxPTR
        ", void * data = 0x%016" PRIxPTR ")",
        x, y, width, height, format, type, bufSize, (uintptr_t)length, (uintptr_t)columns,
        (uintptr_t)rows, (uintptr_t)data);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() ||
             ValidateReadnPixelsRobustANGLE(context, x, y, width, height, format, type, bufSize,
                                            length, columns, rows, data));
        if (isCallValid)
        {
            context->readnPixelsRobust(x, y, width, height, format, type, bufSize, length, columns,
                                       rows, data);
        }
        ANGLE_CAPTURE(ReadnPixelsRobustANGLE, isCallValid, context, x, y, width, height, format,
                      type, bufSize, length, columns, rows, data);
    }
}

void GL_APIENTRY GetnUniformfvRobustANGLE(GLuint program,
                                          GLint location,
                                          GLsizei bufSize,
                                          GLsizei *length,
                                          GLfloat *params)
{
    EVENT(
        "(GLuint program = %u, GLint location = %d, GLsizei bufSize = %d, GLsizei * length = "
        "0x%016" PRIxPTR ", GLfloat * params = 0x%016" PRIxPTR ")",
        program, location, bufSize, (uintptr_t)length, (uintptr_t)params);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() ||
             ValidateGetnUniformfvRobustANGLE(context, program, location, bufSize, length, params));
        if (isCallValid)
        {
            context->getnUniformfvRobust(program, location, bufSize, length, params);
        }
        ANGLE_CAPTURE(GetnUniformfvRobustANGLE, isCallValid, context, program, location, bufSize,
                      length, params);
    }
}

void GL_APIENTRY GetnUniformivRobustANGLE(GLuint program,
                                          GLint location,
                                          GLsizei bufSize,
                                          GLsizei *length,
                                          GLint *params)
{
    EVENT(
        "(GLuint program = %u, GLint location = %d, GLsizei bufSize = %d, GLsizei * length = "
        "0x%016" PRIxPTR ", GLint * params = 0x%016" PRIxPTR ")",
        program, location, bufSize, (uintptr_t)length, (uintptr_t)params);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() ||
             ValidateGetnUniformivRobustANGLE(context, program, location, bufSize, length, params));
        if (isCallValid)
        {
            context->getnUniformivRobust(program, location, bufSize, length, params);
        }
        ANGLE_CAPTURE(GetnUniformivRobustANGLE, isCallValid, context, program, location, bufSize,
                      length, params);
    }
}

void GL_APIENTRY GetnUniformuivRobustANGLE(GLuint program,
                                           GLint location,
                                           GLsizei bufSize,
                                           GLsizei *length,
                                           GLuint *params)
{
    EVENT(
        "(GLuint program = %u, GLint location = %d, GLsizei bufSize = %d, GLsizei * length = "
        "0x%016" PRIxPTR ", GLuint * params = 0x%016" PRIxPTR ")",
        program, location, bufSize, (uintptr_t)length, (uintptr_t)params);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() || ValidateGetnUniformuivRobustANGLE(
                                              context, program, location, bufSize, length, params));
        if (isCallValid)
        {
            context->getnUniformuivRobust(program, location, bufSize, length, params);
        }
        ANGLE_CAPTURE(GetnUniformuivRobustANGLE, isCallValid, context, program, location, bufSize,
                      length, params);
    }
}

void GL_APIENTRY TexParameterIivRobustANGLE(GLenum target,
                                            GLenum pname,
                                            GLsizei bufSize,
                                            const GLint *params)
{
    EVENT(
        "(GLenum target = 0x%X, GLenum pname = 0x%X, GLsizei bufSize = %d, const GLint * params = "
        "0x%016" PRIxPTR ")",
        target, pname, bufSize, (uintptr_t)params);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        TextureType targetPacked = FromGLenum<TextureType>(target);
        bool isCallValid =
            (context->skipValidation() ||
             ValidateTexParameterIivRobustANGLE(context, targetPacked, pname, bufSize, params));
        if (isCallValid)
        {
            context->texParameterIivRobust(targetPacked, pname, bufSize, params);
        }
        ANGLE_CAPTURE(TexParameterIivRobustANGLE, isCallValid, context, targetPacked, pname,
                      bufSize, params);
    }
}

void GL_APIENTRY TexParameterIuivRobustANGLE(GLenum target,
                                             GLenum pname,
                                             GLsizei bufSize,
                                             const GLuint *params)
{
    EVENT(
        "(GLenum target = 0x%X, GLenum pname = 0x%X, GLsizei bufSize = %d, const GLuint * params = "
        "0x%016" PRIxPTR ")",
        target, pname, bufSize, (uintptr_t)params);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        TextureType targetPacked = FromGLenum<TextureType>(target);
        bool isCallValid =
            (context->skipValidation() ||
             ValidateTexParameterIuivRobustANGLE(context, targetPacked, pname, bufSize, params));
        if (isCallValid)
        {
            context->texParameterIuivRobust(targetPacked, pname, bufSize, params);
        }
        ANGLE_CAPTURE(TexParameterIuivRobustANGLE, isCallValid, context, targetPacked, pname,
                      bufSize, params);
    }
}

void GL_APIENTRY GetTexParameterIivRobustANGLE(GLenum target,
                                               GLenum pname,
                                               GLsizei bufSize,
                                               GLsizei *length,
                                               GLint *params)
{
    EVENT(
        "(GLenum target = 0x%X, GLenum pname = 0x%X, GLsizei bufSize = %d, GLsizei * length = "
        "0x%016" PRIxPTR ", GLint * params = 0x%016" PRIxPTR ")",
        target, pname, bufSize, (uintptr_t)length, (uintptr_t)params);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        TextureType targetPacked = FromGLenum<TextureType>(target);
        bool isCallValid         = (context->skipValidation() ||
                            ValidateGetTexParameterIivRobustANGLE(context, targetPacked, pname,
                                                                  bufSize, length, params));
        if (isCallValid)
        {
            context->getTexParameterIivRobust(targetPacked, pname, bufSize, length, params);
        }
        ANGLE_CAPTURE(GetTexParameterIivRobustANGLE, isCallValid, context, targetPacked, pname,
                      bufSize, length, params);
    }
}

void GL_APIENTRY GetTexParameterIuivRobustANGLE(GLenum target,
                                                GLenum pname,
                                                GLsizei bufSize,
                                                GLsizei *length,
                                                GLuint *params)
{
    EVENT(
        "(GLenum target = 0x%X, GLenum pname = 0x%X, GLsizei bufSize = %d, GLsizei * length = "
        "0x%016" PRIxPTR ", GLuint * params = 0x%016" PRIxPTR ")",
        target, pname, bufSize, (uintptr_t)length, (uintptr_t)params);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        TextureType targetPacked = FromGLenum<TextureType>(target);
        bool isCallValid         = (context->skipValidation() ||
                            ValidateGetTexParameterIuivRobustANGLE(context, targetPacked, pname,
                                                                   bufSize, length, params));
        if (isCallValid)
        {
            context->getTexParameterIuivRobust(targetPacked, pname, bufSize, length, params);
        }
        ANGLE_CAPTURE(GetTexParameterIuivRobustANGLE, isCallValid, context, targetPacked, pname,
                      bufSize, length, params);
    }
}

void GL_APIENTRY SamplerParameterIivRobustANGLE(GLuint sampler,
                                                GLenum pname,
                                                GLsizei bufSize,
                                                const GLint *param)
{
    EVENT(
        "(GLuint sampler = %u, GLenum pname = 0x%X, GLsizei bufSize = %d, const GLint * param = "
        "0x%016" PRIxPTR ")",
        sampler, pname, bufSize, (uintptr_t)param);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() ||
             ValidateSamplerParameterIivRobustANGLE(context, sampler, pname, bufSize, param));
        if (isCallValid)
        {
            context->samplerParameterIivRobust(sampler, pname, bufSize, param);
        }
        ANGLE_CAPTURE(SamplerParameterIivRobustANGLE, isCallValid, context, sampler, pname, bufSize,
                      param);
    }
}

void GL_APIENTRY SamplerParameterIuivRobustANGLE(GLuint sampler,
                                                 GLenum pname,
                                                 GLsizei bufSize,
                                                 const GLuint *param)
{
    EVENT(
        "(GLuint sampler = %u, GLenum pname = 0x%X, GLsizei bufSize = %d, const GLuint * param = "
        "0x%016" PRIxPTR ")",
        sampler, pname, bufSize, (uintptr_t)param);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() ||
             ValidateSamplerParameterIuivRobustANGLE(context, sampler, pname, bufSize, param));
        if (isCallValid)
        {
            context->samplerParameterIuivRobust(sampler, pname, bufSize, param);
        }
        ANGLE_CAPTURE(SamplerParameterIuivRobustANGLE, isCallValid, context, sampler, pname,
                      bufSize, param);
    }
}

void GL_APIENTRY GetSamplerParameterIivRobustANGLE(GLuint sampler,
                                                   GLenum pname,
                                                   GLsizei bufSize,
                                                   GLsizei *length,
                                                   GLint *params)
{
    EVENT(
        "(GLuint sampler = %u, GLenum pname = 0x%X, GLsizei bufSize = %d, GLsizei * length = "
        "0x%016" PRIxPTR ", GLint * params = 0x%016" PRIxPTR ")",
        sampler, pname, bufSize, (uintptr_t)length, (uintptr_t)params);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() || ValidateGetSamplerParameterIivRobustANGLE(
                                              context, sampler, pname, bufSize, length, params));
        if (isCallValid)
        {
            context->getSamplerParameterIivRobust(sampler, pname, bufSize, length, params);
        }
        ANGLE_CAPTURE(GetSamplerParameterIivRobustANGLE, isCallValid, context, sampler, pname,
                      bufSize, length, params);
    }
}

void GL_APIENTRY GetSamplerParameterIuivRobustANGLE(GLuint sampler,
                                                    GLenum pname,
                                                    GLsizei bufSize,
                                                    GLsizei *length,
                                                    GLuint *params)
{
    EVENT(
        "(GLuint sampler = %u, GLenum pname = 0x%X, GLsizei bufSize = %d, GLsizei * length = "
        "0x%016" PRIxPTR ", GLuint * params = 0x%016" PRIxPTR ")",
        sampler, pname, bufSize, (uintptr_t)length, (uintptr_t)params);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() || ValidateGetSamplerParameterIuivRobustANGLE(
                                              context, sampler, pname, bufSize, length, params));
        if (isCallValid)
        {
            context->getSamplerParameterIuivRobust(sampler, pname, bufSize, length, params);
        }
        ANGLE_CAPTURE(GetSamplerParameterIuivRobustANGLE, isCallValid, context, sampler, pname,
                      bufSize, length, params);
    }
}

void GL_APIENTRY GetQueryObjectivRobustANGLE(GLuint id,
                                             GLenum pname,
                                             GLsizei bufSize,
                                             GLsizei *length,
                                             GLint *params)
{
    EVENT(
        "(GLuint id = %u, GLenum pname = 0x%X, GLsizei bufSize = %d, GLsizei * length = "
        "0x%016" PRIxPTR ", GLint * params = 0x%016" PRIxPTR ")",
        id, pname, bufSize, (uintptr_t)length, (uintptr_t)params);

    Context *context = GetGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() ||
             ValidateGetQueryObjectivRobustANGLE(context, id, pname, bufSize, length, params));
        if (isCallValid)
        {
            context->getQueryObjectivRobust(id, pname, bufSize, length, params);
        }
        ANGLE_CAPTURE(GetQueryObjectivRobustANGLE, isCallValid, context, id, pname, bufSize, length,
                      params);
    }
}

void GL_APIENTRY GetQueryObjecti64vRobustANGLE(GLuint id,
                                               GLenum pname,
                                               GLsizei bufSize,
                                               GLsizei *length,
                                               GLint64 *params)
{
    EVENT(
        "(GLuint id = %u, GLenum pname = 0x%X, GLsizei bufSize = %d, GLsizei * length = "
        "0x%016" PRIxPTR ", GLint64 * params = 0x%016" PRIxPTR ")",
        id, pname, bufSize, (uintptr_t)length, (uintptr_t)params);

    Context *context = GetGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() ||
             ValidateGetQueryObjecti64vRobustANGLE(context, id, pname, bufSize, length, params));
        if (isCallValid)
        {
            context->getQueryObjecti64vRobust(id, pname, bufSize, length, params);
        }
        ANGLE_CAPTURE(GetQueryObjecti64vRobustANGLE, isCallValid, context, id, pname, bufSize,
                      length, params);
    }
}

void GL_APIENTRY GetQueryObjectui64vRobustANGLE(GLuint id,
                                                GLenum pname,
                                                GLsizei bufSize,
                                                GLsizei *length,
                                                GLuint64 *params)
{
    EVENT(
        "(GLuint id = %u, GLenum pname = 0x%X, GLsizei bufSize = %d, GLsizei * length = "
        "0x%016" PRIxPTR ", GLuint64 * params = 0x%016" PRIxPTR ")",
        id, pname, bufSize, (uintptr_t)length, (uintptr_t)params);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() ||
             ValidateGetQueryObjectui64vRobustANGLE(context, id, pname, bufSize, length, params));
        if (isCallValid)
        {
            context->getQueryObjectui64vRobust(id, pname, bufSize, length, params);
        }
        ANGLE_CAPTURE(GetQueryObjectui64vRobustANGLE, isCallValid, context, id, pname, bufSize,
                      length, params);
    }
}

// GL_ANGLE_texture_external_update
void GL_APIENTRY TexImage2DExternalANGLE(GLenum target,
                                         GLint level,
                                         GLint internalformat,
                                         GLsizei width,
                                         GLsizei height,
                                         GLint border,
                                         GLenum format,
                                         GLenum type)
{
    EVENT(
        "(GLenum target = 0x%X, GLint level = %d, GLint internalformat = %d, GLsizei width = %d, "
        "GLsizei height = %d, GLint border = %d, GLenum format = 0x%X, GLenum type = 0x%X)",
        target, level, internalformat, width, height, border, format, type);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        TextureTarget targetPacked = FromGLenum<TextureTarget>(target);
        bool isCallValid =
            (context->skipValidation() ||
             ValidateTexImage2DExternalANGLE(context, targetPacked, level, internalformat, width,
                                             height, border, format, type));
        if (isCallValid)
        {
            context->texImage2DExternal(targetPacked, level, internalformat, width, height, border,
                                        format, type);
        }
        ANGLE_CAPTURE(TexImage2DExternalANGLE, isCallValid, context, targetPacked, level,
                      internalformat, width, height, border, format, type);
    }
}

void GL_APIENTRY InvalidateTextureANGLE(GLenum target)
{
    EVENT("(GLenum target = 0x%X)", target);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        TextureType targetPacked = FromGLenum<TextureType>(target);
        bool isCallValid =
            (context->skipValidation() || ValidateInvalidateTextureANGLE(context, targetPacked));
        if (isCallValid)
        {
            context->invalidateTexture(targetPacked);
        }
        ANGLE_CAPTURE(InvalidateTextureANGLE, isCallValid, context, targetPacked);
    }
}

// GL_ANGLE_texture_multisample
void GL_APIENTRY TexStorage2DMultisampleANGLE(GLenum target,
                                              GLsizei samples,
                                              GLenum internalformat,
                                              GLsizei width,
                                              GLsizei height,
                                              GLboolean fixedsamplelocations)
{
    EVENT(
        "(GLenum target = 0x%X, GLsizei samples = %d, GLenum internalformat = 0x%X, GLsizei width "
        "= %d, GLsizei height = %d, GLboolean fixedsamplelocations = %u)",
        target, samples, internalformat, width, height, fixedsamplelocations);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        TextureType targetPacked = FromGLenum<TextureType>(target);
        bool isCallValid =
            (context->skipValidation() ||
             ValidateTexStorage2DMultisampleANGLE(context, targetPacked, samples, internalformat,
                                                  width, height, fixedsamplelocations));
        if (isCallValid)
        {
            context->texStorage2DMultisample(targetPacked, samples, internalformat, width, height,
                                             fixedsamplelocations);
        }
        ANGLE_CAPTURE(TexStorage2DMultisampleANGLE, isCallValid, context, targetPacked, samples,
                      internalformat, width, height, fixedsamplelocations);
    }
}

void GL_APIENTRY GetTexLevelParameterivANGLE(GLenum target,
                                             GLint level,
                                             GLenum pname,
                                             GLint *params)
{
    EVENT(
        "(GLenum target = 0x%X, GLint level = %d, GLenum pname = 0x%X, GLint * params = "
        "0x%016" PRIxPTR ")",
        target, level, pname, (uintptr_t)params);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        TextureTarget targetPacked = FromGLenum<TextureTarget>(target);
        bool isCallValid =
            (context->skipValidation() ||
             ValidateGetTexLevelParameterivANGLE(context, targetPacked, level, pname, params));
        if (isCallValid)
        {
            context->getTexLevelParameteriv(targetPacked, level, pname, params);
        }
        ANGLE_CAPTURE(GetTexLevelParameterivANGLE, isCallValid, context, targetPacked, level, pname,
                      params);
    }
}

void GL_APIENTRY GetTexLevelParameterfvANGLE(GLenum target,
                                             GLint level,
                                             GLenum pname,
                                             GLfloat *params)
{
    EVENT(
        "(GLenum target = 0x%X, GLint level = %d, GLenum pname = 0x%X, GLfloat * params = "
        "0x%016" PRIxPTR ")",
        target, level, pname, (uintptr_t)params);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        TextureTarget targetPacked = FromGLenum<TextureTarget>(target);
        bool isCallValid =
            (context->skipValidation() ||
             ValidateGetTexLevelParameterfvANGLE(context, targetPacked, level, pname, params));
        if (isCallValid)
        {
            context->getTexLevelParameterfv(targetPacked, level, pname, params);
        }
        ANGLE_CAPTURE(GetTexLevelParameterfvANGLE, isCallValid, context, targetPacked, level, pname,
                      params);
    }
}

void GL_APIENTRY GetMultisamplefvANGLE(GLenum pname, GLuint index, GLfloat *val)
{
    EVENT("(GLenum pname = 0x%X, GLuint index = %u, GLfloat * val = 0x%016" PRIxPTR ")", pname,
          index, (uintptr_t)val);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid = (context->skipValidation() ||
                            ValidateGetMultisamplefvANGLE(context, pname, index, val));
        if (isCallValid)
        {
            context->getMultisamplefv(pname, index, val);
        }
        ANGLE_CAPTURE(GetMultisamplefvANGLE, isCallValid, context, pname, index, val);
    }
}

void GL_APIENTRY SampleMaskiANGLE(GLuint maskNumber, GLbitfield mask)
{
    EVENT("(GLuint maskNumber = %u, GLbitfield mask = 0x%X)", maskNumber, mask);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() || ValidateSampleMaskiANGLE(context, maskNumber, mask));
        if (isCallValid)
        {
            context->sampleMaski(maskNumber, mask);
        }
        ANGLE_CAPTURE(SampleMaskiANGLE, isCallValid, context, maskNumber, mask);
    }
}

// GL_ANGLE_translated_shader_source
void GL_APIENTRY GetTranslatedShaderSourceANGLE(GLuint shader,
                                                GLsizei bufsize,
                                                GLsizei *length,
                                                GLchar *source)
{
    EVENT("(GLuint shader = %u, GLsizei bufsize = %d, GLsizei *length = 0x%016" PRIxPTR
          ", GLchar *source = 0x%016" PRIxPTR ")",
          shader, bufsize, (uintptr_t)length, (uintptr_t)source);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() ||
             ValidateGetTranslatedShaderSourceANGLE(context, shader, bufsize, length, source));
        if (isCallValid)
        {
            context->getTranslatedShaderSource(shader, bufsize, length, source);
        }
        ANGLE_CAPTURE(GetTranslatedShaderSourceANGLE, isCallValid, context, shader, bufsize, length,
                      source);
    }
}

// GL_CHROMIUM_bind_uniform_location
void GL_APIENTRY BindUniformLocationCHROMIUM(GLuint program, GLint location, const GLchar *name)
{
    EVENT("(GLuint program = %u, GLint location = %d, const GLchar* name = 0x%016" PRIxPTR ")",
          program, location, (uintptr_t)name);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid = (context->skipValidation() ||
                            ValidateBindUniformLocationCHROMIUM(context, program, location, name));
        if (isCallValid)
        {
            context->bindUniformLocation(program, location, name);
        }
        ANGLE_CAPTURE(BindUniformLocationCHROMIUM, isCallValid, context, program, location, name);
    }
}

// GL_CHROMIUM_copy_compressed_texture
void GL_APIENTRY CompressedCopyTextureCHROMIUM(GLuint sourceId, GLuint destId)
{
    EVENT("(GLuint sourceId = %u, GLuint destId = %u)", sourceId, destId);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid = (context->skipValidation() ||
                            ValidateCompressedCopyTextureCHROMIUM(context, sourceId, destId));
        if (isCallValid)
        {
            context->compressedCopyTexture(sourceId, destId);
        }
        ANGLE_CAPTURE(CompressedCopyTextureCHROMIUM, isCallValid, context, sourceId, destId);
    }
}

// GL_CHROMIUM_copy_texture
void GL_APIENTRY CopyTextureCHROMIUM(GLuint sourceId,
                                     GLint sourceLevel,
                                     GLenum destTarget,
                                     GLuint destId,
                                     GLint destLevel,
                                     GLint internalFormat,
                                     GLenum destType,
                                     GLboolean unpackFlipY,
                                     GLboolean unpackPremultiplyAlpha,
                                     GLboolean unpackUnmultiplyAlpha)
{
    EVENT(
        "(GLuint sourceId = %u, GLint sourceLevel = %d, GLenum destTarget = 0x%X, GLuint destId = "
        "%u, GLint destLevel = %d, GLint internalFormat = %d, GLenum destType = 0x%X, GLboolean "
        "unpackFlipY = %u, GLboolean unpackPremultiplyAlpha = %u, GLboolean unpackUnmultiplyAlpha "
        "= %u)",
        sourceId, sourceLevel, destTarget, destId, destLevel, internalFormat, destType, unpackFlipY,
        unpackPremultiplyAlpha, unpackUnmultiplyAlpha);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        TextureTarget destTargetPacked = FromGLenum<TextureTarget>(destTarget);
        bool isCallValid =
            (context->skipValidation() ||
             ValidateCopyTextureCHROMIUM(context, sourceId, sourceLevel, destTargetPacked, destId,
                                         destLevel, internalFormat, destType, unpackFlipY,
                                         unpackPremultiplyAlpha, unpackUnmultiplyAlpha));
        if (isCallValid)
        {
            context->copyTexture(sourceId, sourceLevel, destTargetPacked, destId, destLevel,
                                 internalFormat, destType, unpackFlipY, unpackPremultiplyAlpha,
                                 unpackUnmultiplyAlpha);
        }
        ANGLE_CAPTURE(CopyTextureCHROMIUM, isCallValid, context, sourceId, sourceLevel,
                      destTargetPacked, destId, destLevel, internalFormat, destType, unpackFlipY,
                      unpackPremultiplyAlpha, unpackUnmultiplyAlpha);
    }
}

void GL_APIENTRY CopySubTextureCHROMIUM(GLuint sourceId,
                                        GLint sourceLevel,
                                        GLenum destTarget,
                                        GLuint destId,
                                        GLint destLevel,
                                        GLint xoffset,
                                        GLint yoffset,
                                        GLint x,
                                        GLint y,
                                        GLint width,
                                        GLint height,
                                        GLboolean unpackFlipY,
                                        GLboolean unpackPremultiplyAlpha,
                                        GLboolean unpackUnmultiplyAlpha)
{
    EVENT(
        "(GLuint sourceId = %u, GLint sourceLevel = %d, GLenum destTarget = 0x%X, GLuint destId = "
        "%u, GLint destLevel = %d, GLint xoffset = %d, GLint yoffset = %d, GLint x = %d, GLint y = "
        "%d, GLint width = %d, GLint height = %d, GLboolean unpackFlipY = %u, GLboolean "
        "unpackPremultiplyAlpha = %u, GLboolean unpackUnmultiplyAlpha = %u)",
        sourceId, sourceLevel, destTarget, destId, destLevel, xoffset, yoffset, x, y, width, height,
        unpackFlipY, unpackPremultiplyAlpha, unpackUnmultiplyAlpha);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        TextureTarget destTargetPacked = FromGLenum<TextureTarget>(destTarget);
        bool isCallValid               = (context->skipValidation() ||
                            ValidateCopySubTextureCHROMIUM(
                                context, sourceId, sourceLevel, destTargetPacked, destId, destLevel,
                                xoffset, yoffset, x, y, width, height, unpackFlipY,
                                unpackPremultiplyAlpha, unpackUnmultiplyAlpha));
        if (isCallValid)
        {
            context->copySubTexture(sourceId, sourceLevel, destTargetPacked, destId, destLevel,
                                    xoffset, yoffset, x, y, width, height, unpackFlipY,
                                    unpackPremultiplyAlpha, unpackUnmultiplyAlpha);
        }
        ANGLE_CAPTURE(CopySubTextureCHROMIUM, isCallValid, context, sourceId, sourceLevel,
                      destTargetPacked, destId, destLevel, xoffset, yoffset, x, y, width, height,
                      unpackFlipY, unpackPremultiplyAlpha, unpackUnmultiplyAlpha);
    }
}

// GL_CHROMIUM_framebuffer_mixed_samples
void GL_APIENTRY CoverageModulationCHROMIUM(GLenum components)
{
    EVENT("(GLenum components = 0x%X)", components);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() || ValidateCoverageModulationCHROMIUM(context, components));
        if (isCallValid)
        {
            context->coverageModulation(components);
        }
        ANGLE_CAPTURE(CoverageModulationCHROMIUM, isCallValid, context, components);
    }
}

void GL_APIENTRY MatrixLoadfCHROMIUM(GLenum matrixMode, const GLfloat *matrix)
{
    EVENT("(GLenum matrixMode = 0x%X, const GLfloat * matrix = 0x%016" PRIxPTR ")", matrixMode,
          (uintptr_t)matrix);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() || ValidateMatrixLoadfCHROMIUM(context, matrixMode, matrix));
        if (isCallValid)
        {
            context->matrixLoadf(matrixMode, matrix);
        }
        ANGLE_CAPTURE(MatrixLoadfCHROMIUM, isCallValid, context, matrixMode, matrix);
    }
}

void GL_APIENTRY MatrixLoadIdentityCHROMIUM(GLenum matrixMode)
{
    EVENT("(GLenum matrixMode = 0x%X)", matrixMode);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() || ValidateMatrixLoadIdentityCHROMIUM(context, matrixMode));
        if (isCallValid)
        {
            context->matrixLoadIdentity(matrixMode);
        }
        ANGLE_CAPTURE(MatrixLoadIdentityCHROMIUM, isCallValid, context, matrixMode);
    }
}

// GL_CHROMIUM_lose_context
void GL_APIENTRY LoseContextCHROMIUM(GLenum current, GLenum other)
{
    EVENT("(GLenum current = 0x%X, GLenum other = 0x%X)", current, other);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        GraphicsResetStatus currentPacked = FromGLenum<GraphicsResetStatus>(current);
        GraphicsResetStatus otherPacked   = FromGLenum<GraphicsResetStatus>(other);
        bool isCallValid                  = (context->skipValidation() ||
                            ValidateLoseContextCHROMIUM(context, currentPacked, otherPacked));
        if (isCallValid)
        {
            context->loseContext(currentPacked, otherPacked);
        }
        ANGLE_CAPTURE(LoseContextCHROMIUM, isCallValid, context, currentPacked, otherPacked);
    }
}

// GL_CHROMIUM_path_rendering
GLuint GL_APIENTRY GenPathsCHROMIUM(GLsizei range)
{
    EVENT("(GLsizei range = %d)", range);

    Context *context = GetValidGlobalContext();
    GLuint returnValue;
    if (context)
    {
        bool isCallValid = (context->skipValidation() || ValidateGenPathsCHROMIUM(context, range));
        if (isCallValid)
        {
            returnValue = context->genPaths(range);
        }
        else
        {
            returnValue = GetDefaultReturnValue<EntryPoint::GenPathsCHROMIUM, GLuint>();
        }
        ANGLE_CAPTURE(GenPathsCHROMIUM, isCallValid, context, range, returnValue);
    }
    else
    {
        returnValue = GetDefaultReturnValue<EntryPoint::GenPathsCHROMIUM, GLuint>();
    }
    return returnValue;
}

void GL_APIENTRY DeletePathsCHROMIUM(GLuint first, GLsizei range)
{
    EVENT("(GLuint first = %u, GLsizei range = %d)", first, range);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() || ValidateDeletePathsCHROMIUM(context, first, range));
        if (isCallValid)
        {
            context->deletePaths(first, range);
        }
        ANGLE_CAPTURE(DeletePathsCHROMIUM, isCallValid, context, first, range);
    }
}

GLboolean GL_APIENTRY IsPathCHROMIUM(GLuint path)
{
    EVENT("(GLuint path = %u)", path);

    Context *context = GetValidGlobalContext();
    GLboolean returnValue;
    if (context)
    {
        bool isCallValid = (context->skipValidation() || ValidateIsPathCHROMIUM(context, path));
        if (isCallValid)
        {
            returnValue = context->isPath(path);
        }
        else
        {
            returnValue = GetDefaultReturnValue<EntryPoint::IsPathCHROMIUM, GLboolean>();
        }
        ANGLE_CAPTURE(IsPathCHROMIUM, isCallValid, context, path, returnValue);
    }
    else
    {
        returnValue = GetDefaultReturnValue<EntryPoint::IsPathCHROMIUM, GLboolean>();
    }
    return returnValue;
}

void GL_APIENTRY PathCommandsCHROMIUM(GLuint path,
                                      GLsizei numCommands,
                                      const GLubyte *commands,
                                      GLsizei numCoords,
                                      GLenum coordType,
                                      const void *coords)
{
    EVENT("(GLuint path = %u, GLsizei numCommands = %d, const GLubyte * commands = 0x%016" PRIxPTR
          ", GLsizei numCoords = %d, GLenum coordType = 0x%X, const void* coords = 0x%016" PRIxPTR
          ")",
          path, numCommands, (uintptr_t)commands, numCoords, coordType, (uintptr_t)coords);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid = (context->skipValidation() ||
                            ValidatePathCommandsCHROMIUM(context, path, numCommands, commands,
                                                         numCoords, coordType, coords));
        if (isCallValid)
        {
            context->pathCommands(path, numCommands, commands, numCoords, coordType, coords);
        }
        ANGLE_CAPTURE(PathCommandsCHROMIUM, isCallValid, context, path, numCommands, commands,
                      numCoords, coordType, coords);
    }
}

void GL_APIENTRY PathParameterfCHROMIUM(GLuint path, GLenum pname, GLfloat value)
{
    EVENT("(GLuint path = %u, GLenum pname = 0x%X, GLfloat value = %f)", path, pname, value);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid = (context->skipValidation() ||
                            ValidatePathParameterfCHROMIUM(context, path, pname, value));
        if (isCallValid)
        {
            context->pathParameterf(path, pname, value);
        }
        ANGLE_CAPTURE(PathParameterfCHROMIUM, isCallValid, context, path, pname, value);
    }
}

void GL_APIENTRY PathParameteriCHROMIUM(GLuint path, GLenum pname, GLint value)
{
    EVENT("(GLuint path = %u, GLenum pname = 0x%X, GLint value = %d)", path, pname, value);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid = (context->skipValidation() ||
                            ValidatePathParameteriCHROMIUM(context, path, pname, value));
        if (isCallValid)
        {
            context->pathParameteri(path, pname, value);
        }
        ANGLE_CAPTURE(PathParameteriCHROMIUM, isCallValid, context, path, pname, value);
    }
}

void GL_APIENTRY GetPathParameterfvCHROMIUM(GLuint path, GLenum pname, GLfloat *value)
{
    EVENT("(GLuint path = %u, GLenum pname = 0x%X, GLfloat * value = 0x%016" PRIxPTR ")", path,
          pname, (uintptr_t)value);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid = (context->skipValidation() ||
                            ValidateGetPathParameterfvCHROMIUM(context, path, pname, value));
        if (isCallValid)
        {
            context->getPathParameterfv(path, pname, value);
        }
        ANGLE_CAPTURE(GetPathParameterfvCHROMIUM, isCallValid, context, path, pname, value);
    }
}

void GL_APIENTRY GetPathParameterivCHROMIUM(GLuint path, GLenum pname, GLint *value)
{
    EVENT("(GLuint path = %u, GLenum pname = 0x%X, GLint * value = 0x%016" PRIxPTR ")", path, pname,
          (uintptr_t)value);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid = (context->skipValidation() ||
                            ValidateGetPathParameterivCHROMIUM(context, path, pname, value));
        if (isCallValid)
        {
            context->getPathParameteriv(path, pname, value);
        }
        ANGLE_CAPTURE(GetPathParameterivCHROMIUM, isCallValid, context, path, pname, value);
    }
}

void GL_APIENTRY PathStencilFuncCHROMIUM(GLenum func, GLint ref, GLuint mask)
{
    EVENT("(GLenum func = 0x%X, GLint ref = %d, GLuint mask = %u)", func, ref, mask);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid = (context->skipValidation() ||
                            ValidatePathStencilFuncCHROMIUM(context, func, ref, mask));
        if (isCallValid)
        {
            context->pathStencilFunc(func, ref, mask);
        }
        ANGLE_CAPTURE(PathStencilFuncCHROMIUM, isCallValid, context, func, ref, mask);
    }
}

void GL_APIENTRY StencilFillPathCHROMIUM(GLuint path, GLenum fillMode, GLuint mask)
{
    EVENT("(GLuint path = %u, GLenum fillMode = 0x%X, GLuint mask = %u)", path, fillMode, mask);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid = (context->skipValidation() ||
                            ValidateStencilFillPathCHROMIUM(context, path, fillMode, mask));
        if (isCallValid)
        {
            context->stencilFillPath(path, fillMode, mask);
        }
        ANGLE_CAPTURE(StencilFillPathCHROMIUM, isCallValid, context, path, fillMode, mask);
    }
}

void GL_APIENTRY StencilStrokePathCHROMIUM(GLuint path, GLint reference, GLuint mask)
{
    EVENT("(GLuint path = %u, GLint reference = %d, GLuint mask = %u)", path, reference, mask);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid = (context->skipValidation() ||
                            ValidateStencilStrokePathCHROMIUM(context, path, reference, mask));
        if (isCallValid)
        {
            context->stencilStrokePath(path, reference, mask);
        }
        ANGLE_CAPTURE(StencilStrokePathCHROMIUM, isCallValid, context, path, reference, mask);
    }
}

void GL_APIENTRY CoverFillPathCHROMIUM(GLuint path, GLenum coverMode)
{
    EVENT("(GLuint path = %u, GLenum coverMode = 0x%X)", path, coverMode);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() || ValidateCoverFillPathCHROMIUM(context, path, coverMode));
        if (isCallValid)
        {
            context->coverFillPath(path, coverMode);
        }
        ANGLE_CAPTURE(CoverFillPathCHROMIUM, isCallValid, context, path, coverMode);
    }
}

void GL_APIENTRY CoverStrokePathCHROMIUM(GLuint path, GLenum coverMode)
{
    EVENT("(GLuint path = %u, GLenum coverMode = 0x%X)", path, coverMode);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid = (context->skipValidation() ||
                            ValidateCoverStrokePathCHROMIUM(context, path, coverMode));
        if (isCallValid)
        {
            context->coverStrokePath(path, coverMode);
        }
        ANGLE_CAPTURE(CoverStrokePathCHROMIUM, isCallValid, context, path, coverMode);
    }
}

void GL_APIENTRY StencilThenCoverFillPathCHROMIUM(GLuint path,
                                                  GLenum fillMode,
                                                  GLuint mask,
                                                  GLenum coverMode)
{
    EVENT("(GLuint path = %u, GLenum fillMode = 0x%X, GLuint mask = %u, GLenum coverMode = 0x%X)",
          path, fillMode, mask, coverMode);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() ||
             ValidateStencilThenCoverFillPathCHROMIUM(context, path, fillMode, mask, coverMode));
        if (isCallValid)
        {
            context->stencilThenCoverFillPath(path, fillMode, mask, coverMode);
        }
        ANGLE_CAPTURE(StencilThenCoverFillPathCHROMIUM, isCallValid, context, path, fillMode, mask,
                      coverMode);
    }
}

void GL_APIENTRY StencilThenCoverStrokePathCHROMIUM(GLuint path,
                                                    GLint reference,
                                                    GLuint mask,
                                                    GLenum coverMode)
{
    EVENT("(GLuint path = %u, GLint reference = %d, GLuint mask = %u, GLenum coverMode = 0x%X)",
          path, reference, mask, coverMode);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() ||
             ValidateStencilThenCoverStrokePathCHROMIUM(context, path, reference, mask, coverMode));
        if (isCallValid)
        {
            context->stencilThenCoverStrokePath(path, reference, mask, coverMode);
        }
        ANGLE_CAPTURE(StencilThenCoverStrokePathCHROMIUM, isCallValid, context, path, reference,
                      mask, coverMode);
    }
}

void GL_APIENTRY CoverFillPathInstancedCHROMIUM(GLsizei numPath,
                                                GLenum pathNameType,
                                                const void *paths,
                                                GLuint pathBase,
                                                GLenum coverMode,
                                                GLenum transformType,
                                                const GLfloat *transformValues)
{
    EVENT("(GLsizei numPath = %d, GLenum pathNameType = 0x%X, const void * paths = 0x%016" PRIxPTR
          ", GLuint pathBase = %u, GLenum coverMode = 0x%X, GLenum transformType = 0x%X, const "
          "GLfloat * transformValues = 0x%016" PRIxPTR ")",
          numPath, pathNameType, (uintptr_t)paths, pathBase, coverMode, transformType,
          (uintptr_t)transformValues);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() ||
             ValidateCoverFillPathInstancedCHROMIUM(context, numPath, pathNameType, paths, pathBase,
                                                    coverMode, transformType, transformValues));
        if (isCallValid)
        {
            context->coverFillPathInstanced(numPath, pathNameType, paths, pathBase, coverMode,
                                            transformType, transformValues);
        }
        ANGLE_CAPTURE(CoverFillPathInstancedCHROMIUM, isCallValid, context, numPath, pathNameType,
                      paths, pathBase, coverMode, transformType, transformValues);
    }
}

void GL_APIENTRY CoverStrokePathInstancedCHROMIUM(GLsizei numPath,
                                                  GLenum pathNameType,
                                                  const void *paths,
                                                  GLuint pathBase,
                                                  GLenum coverMode,
                                                  GLenum transformType,
                                                  const GLfloat *transformValues)
{
    EVENT("(GLsizei numPath = %d, GLenum pathNameType = 0x%X, const void * paths = 0x%016" PRIxPTR
          ", GLuint pathBase = %u, GLenum coverMode = 0x%X, GLenum transformType = 0x%X, const "
          "GLfloat * transformValues = 0x%016" PRIxPTR ")",
          numPath, pathNameType, (uintptr_t)paths, pathBase, coverMode, transformType,
          (uintptr_t)transformValues);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() || ValidateCoverStrokePathInstancedCHROMIUM(
                                              context, numPath, pathNameType, paths, pathBase,
                                              coverMode, transformType, transformValues));
        if (isCallValid)
        {
            context->coverStrokePathInstanced(numPath, pathNameType, paths, pathBase, coverMode,
                                              transformType, transformValues);
        }
        ANGLE_CAPTURE(CoverStrokePathInstancedCHROMIUM, isCallValid, context, numPath, pathNameType,
                      paths, pathBase, coverMode, transformType, transformValues);
    }
}

void GL_APIENTRY StencilStrokePathInstancedCHROMIUM(GLsizei numPath,
                                                    GLenum pathNameType,
                                                    const void *paths,
                                                    GLuint pathBase,
                                                    GLint reference,
                                                    GLuint mask,
                                                    GLenum transformType,
                                                    const GLfloat *transformValues)
{
    EVENT("(GLsizei numPath = %d, GLenum pathNameType = 0x%X, const void * paths = 0x%016" PRIxPTR
          ", GLuint pathBase = %u, GLint reference = %d, GLuint mask = %u, GLenum transformType = "
          "0x%X, const GLfloat * transformValues = 0x%016" PRIxPTR ")",
          numPath, pathNameType, (uintptr_t)paths, pathBase, reference, mask, transformType,
          (uintptr_t)transformValues);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() || ValidateStencilStrokePathInstancedCHROMIUM(
                                              context, numPath, pathNameType, paths, pathBase,
                                              reference, mask, transformType, transformValues));
        if (isCallValid)
        {
            context->stencilStrokePathInstanced(numPath, pathNameType, paths, pathBase, reference,
                                                mask, transformType, transformValues);
        }
        ANGLE_CAPTURE(StencilStrokePathInstancedCHROMIUM, isCallValid, context, numPath,
                      pathNameType, paths, pathBase, reference, mask, transformType,
                      transformValues);
    }
}

void GL_APIENTRY StencilFillPathInstancedCHROMIUM(GLsizei numPaths,
                                                  GLenum pathNameType,
                                                  const void *paths,
                                                  GLuint pathBase,
                                                  GLenum fillMode,
                                                  GLuint mask,
                                                  GLenum transformType,
                                                  const GLfloat *transformValues)
{
    EVENT("(GLsizei numPaths = %d, GLenum pathNameType = 0x%X, const void * paths = 0x%016" PRIxPTR
          ", GLuint pathBase = %u, GLenum fillMode = 0x%X, GLuint mask = %u, GLenum transformType "
          "= 0x%X, const GLfloat * transformValues = 0x%016" PRIxPTR ")",
          numPaths, pathNameType, (uintptr_t)paths, pathBase, fillMode, mask, transformType,
          (uintptr_t)transformValues);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() || ValidateStencilFillPathInstancedCHROMIUM(
                                              context, numPaths, pathNameType, paths, pathBase,
                                              fillMode, mask, transformType, transformValues));
        if (isCallValid)
        {
            context->stencilFillPathInstanced(numPaths, pathNameType, paths, pathBase, fillMode,
                                              mask, transformType, transformValues);
        }
        ANGLE_CAPTURE(StencilFillPathInstancedCHROMIUM, isCallValid, context, numPaths,
                      pathNameType, paths, pathBase, fillMode, mask, transformType,
                      transformValues);
    }
}

void GL_APIENTRY StencilThenCoverFillPathInstancedCHROMIUM(GLsizei numPaths,
                                                           GLenum pathNameType,
                                                           const void *paths,
                                                           GLuint pathBase,
                                                           GLenum fillMode,
                                                           GLuint mask,
                                                           GLenum coverMode,
                                                           GLenum transformType,
                                                           const GLfloat *transformValues)
{
    EVENT("(GLsizei numPaths = %d, GLenum pathNameType = 0x%X, const void * paths = 0x%016" PRIxPTR
          ", GLuint pathBase = %u, GLenum fillMode = 0x%X, GLuint mask = %u, GLenum coverMode = "
          "0x%X, GLenum transformType = 0x%X, const GLfloat * transformValues = 0x%016" PRIxPTR ")",
          numPaths, pathNameType, (uintptr_t)paths, pathBase, fillMode, mask, coverMode,
          transformType, (uintptr_t)transformValues);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid = (context->skipValidation() ||
                            ValidateStencilThenCoverFillPathInstancedCHROMIUM(
                                context, numPaths, pathNameType, paths, pathBase, fillMode, mask,
                                coverMode, transformType, transformValues));
        if (isCallValid)
        {
            context->stencilThenCoverFillPathInstanced(numPaths, pathNameType, paths, pathBase,
                                                       fillMode, mask, coverMode, transformType,
                                                       transformValues);
        }
        ANGLE_CAPTURE(StencilThenCoverFillPathInstancedCHROMIUM, isCallValid, context, numPaths,
                      pathNameType, paths, pathBase, fillMode, mask, coverMode, transformType,
                      transformValues);
    }
}

void GL_APIENTRY StencilThenCoverStrokePathInstancedCHROMIUM(GLsizei numPaths,
                                                             GLenum pathNameType,
                                                             const void *paths,
                                                             GLuint pathBase,
                                                             GLint reference,
                                                             GLuint mask,
                                                             GLenum coverMode,
                                                             GLenum transformType,
                                                             const GLfloat *transformValues)
{
    EVENT("(GLsizei numPaths = %d, GLenum pathNameType = 0x%X, const void * paths = 0x%016" PRIxPTR
          ", GLuint pathBase = %u, GLint reference = %d, GLuint mask = %u, GLenum coverMode = "
          "0x%X, GLenum transformType = 0x%X, const GLfloat * transformValues = 0x%016" PRIxPTR ")",
          numPaths, pathNameType, (uintptr_t)paths, pathBase, reference, mask, coverMode,
          transformType, (uintptr_t)transformValues);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid = (context->skipValidation() ||
                            ValidateStencilThenCoverStrokePathInstancedCHROMIUM(
                                context, numPaths, pathNameType, paths, pathBase, reference, mask,
                                coverMode, transformType, transformValues));
        if (isCallValid)
        {
            context->stencilThenCoverStrokePathInstanced(numPaths, pathNameType, paths, pathBase,
                                                         reference, mask, coverMode, transformType,
                                                         transformValues);
        }
        ANGLE_CAPTURE(StencilThenCoverStrokePathInstancedCHROMIUM, isCallValid, context, numPaths,
                      pathNameType, paths, pathBase, reference, mask, coverMode, transformType,
                      transformValues);
    }
}

void GL_APIENTRY BindFragmentInputLocationCHROMIUM(GLuint programs,
                                                   GLint location,
                                                   const GLchar *name)
{
    EVENT("(GLuint programs = %u, GLint location = %d, const GLchar * name = 0x%016" PRIxPTR ")",
          programs, location, (uintptr_t)name);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid = (context->skipValidation() || ValidateBindFragmentInputLocationCHROMIUM(
                                                             context, programs, location, name));
        if (isCallValid)
        {
            context->bindFragmentInputLocation(programs, location, name);
        }
        ANGLE_CAPTURE(BindFragmentInputLocationCHROMIUM, isCallValid, context, programs, location,
                      name);
    }
}

void GL_APIENTRY ProgramPathFragmentInputGenCHROMIUM(GLuint program,
                                                     GLint location,
                                                     GLenum genMode,
                                                     GLint components,
                                                     const GLfloat *coeffs)
{
    EVENT(
        "(GLuint program = %u, GLint location = %d, GLenum genMode = 0x%X, GLint components = %d, "
        "const GLfloat * coeffs = 0x%016" PRIxPTR ")",
        program, location, genMode, components, (uintptr_t)coeffs);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid = (context->skipValidation() ||
                            ValidateProgramPathFragmentInputGenCHROMIUM(
                                context, program, location, genMode, components, coeffs));
        if (isCallValid)
        {
            context->programPathFragmentInputGen(program, location, genMode, components, coeffs);
        }
        ANGLE_CAPTURE(ProgramPathFragmentInputGenCHROMIUM, isCallValid, context, program, location,
                      genMode, components, coeffs);
    }
}

// GL_EXT_blend_func_extended
void GL_APIENTRY BindFragDataLocationEXT(GLuint program, GLuint color, const GLchar *name)
{
    EVENT("(GLuint program = %u, GLuint color = %u, const GLchar *name = 0x%016" PRIxPTR ")",
          program, color, (uintptr_t)name);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid = (context->skipValidation() ||
                            ValidateBindFragDataLocationEXT(context, program, color, name));
        if (isCallValid)
        {
            context->bindFragDataLocation(program, color, name);
        }
        ANGLE_CAPTURE(BindFragDataLocationEXT, isCallValid, context, program, color, name);
    }
}

void GL_APIENTRY BindFragDataLocationIndexedEXT(GLuint program,
                                                GLuint colorNumber,
                                                GLuint index,
                                                const GLchar *name)
{
    EVENT(
        "(GLuint program = %u, GLuint colorNumber = %u, GLuint index = %u, const GLchar *name = "
        "0x%016" PRIxPTR ")",
        program, colorNumber, index, (uintptr_t)name);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() ||
             ValidateBindFragDataLocationIndexedEXT(context, program, colorNumber, index, name));
        if (isCallValid)
        {
            context->bindFragDataLocationIndexed(program, colorNumber, index, name);
        }
        ANGLE_CAPTURE(BindFragDataLocationIndexedEXT, isCallValid, context, program, colorNumber,
                      index, name);
    }
}

GLint GL_APIENTRY GetFragDataIndexEXT(GLuint program, const GLchar *name)
{
    EVENT("(GLuint program = %u, const GLchar *name = 0x%016" PRIxPTR ")", program,
          (uintptr_t)name);

    Context *context = GetValidGlobalContext();
    GLint returnValue;
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() || ValidateGetFragDataIndexEXT(context, program, name));
        if (isCallValid)
        {
            returnValue = context->getFragDataIndex(program, name);
        }
        else
        {
            returnValue = GetDefaultReturnValue<EntryPoint::GetFragDataIndexEXT, GLint>();
        }
        ANGLE_CAPTURE(GetFragDataIndexEXT, isCallValid, context, program, name, returnValue);
    }
    else
    {
        returnValue = GetDefaultReturnValue<EntryPoint::GetFragDataIndexEXT, GLint>();
    }
    return returnValue;
}

GLint GL_APIENTRY GetProgramResourceLocationIndexEXT(GLuint program,
                                                     GLenum programInterface,
                                                     const GLchar *name)
{
    EVENT(
        "(GLuint program = %u, GLenum programInterface = 0x%X, const GLchar *name = 0x%016" PRIxPTR
        ")",
        program, programInterface, (uintptr_t)name);

    Context *context = GetValidGlobalContext();
    GLint returnValue;
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() ||
             ValidateGetProgramResourceLocationIndexEXT(context, program, programInterface, name));
        if (isCallValid)
        {
            returnValue = context->getProgramResourceLocationIndex(program, programInterface, name);
        }
        else
        {
            returnValue =
                GetDefaultReturnValue<EntryPoint::GetProgramResourceLocationIndexEXT, GLint>();
        }
        ANGLE_CAPTURE(GetProgramResourceLocationIndexEXT, isCallValid, context, program,
                      programInterface, name, returnValue);
    }
    else
    {
        returnValue =
            GetDefaultReturnValue<EntryPoint::GetProgramResourceLocationIndexEXT, GLint>();
    }
    return returnValue;
}

// GL_EXT_debug_marker
void GL_APIENTRY InsertEventMarkerEXT(GLsizei length, const GLchar *marker)
{
    // Don't run an EVENT() macro on the EXT_debug_marker entry points.
    // It can interfere with the debug events being set by the caller.
    // EVENT("(GLsizei length = %d, const GLchar *marker = 0x%016" PRIxPTR ")", length,
    // (uintptr_t)marker);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() || ValidateInsertEventMarkerEXT(context, length, marker));
        if (isCallValid)
        {
            context->insertEventMarker(length, marker);
        }
        ANGLE_CAPTURE(InsertEventMarkerEXT, isCallValid, context, length, marker);
    }
}

void GL_APIENTRY PopGroupMarkerEXT()
{
    // Don't run an EVENT() macro on the EXT_debug_marker entry points.
    // It can interfere with the debug events being set by the caller.
    // EVENT("()");

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid = (context->skipValidation() || ValidatePopGroupMarkerEXT(context));
        if (isCallValid)
        {
            context->popGroupMarker();
        }
        ANGLE_CAPTURE(PopGroupMarkerEXT, isCallValid, context);
    }
}

void GL_APIENTRY PushGroupMarkerEXT(GLsizei length, const GLchar *marker)
{
    // Don't run an EVENT() macro on the EXT_debug_marker entry points.
    // It can interfere with the debug events being set by the caller.
    // EVENT("(GLsizei length = %d, const GLchar *marker = 0x%016" PRIxPTR ")", length,
    // (uintptr_t)marker);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() || ValidatePushGroupMarkerEXT(context, length, marker));
        if (isCallValid)
        {
            context->pushGroupMarker(length, marker);
        }
        ANGLE_CAPTURE(PushGroupMarkerEXT, isCallValid, context, length, marker);
    }
}

// GL_EXT_discard_framebuffer
void GL_APIENTRY DiscardFramebufferEXT(GLenum target,
                                       GLsizei numAttachments,
                                       const GLenum *attachments)
{
    EVENT(
        "(GLenum target = 0x%X, GLsizei numAttachments = %d, const GLenum *attachments = "
        "0x%016" PRIxPTR ")",
        target, numAttachments, (uintptr_t)attachments);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() ||
             ValidateDiscardFramebufferEXT(context, target, numAttachments, attachments));
        if (isCallValid)
        {
            context->discardFramebuffer(target, numAttachments, attachments);
        }
        ANGLE_CAPTURE(DiscardFramebufferEXT, isCallValid, context, target, numAttachments,
                      attachments);
    }
}

// GL_EXT_disjoint_timer_query
void GL_APIENTRY BeginQueryEXT(GLenum target, GLuint id)
{
    EVENT("(GLenum target = 0x%X, GLuint id = %u)", target, id);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        QueryType targetPacked = FromGLenum<QueryType>(target);
        bool isCallValid =
            (context->skipValidation() || ValidateBeginQueryEXT(context, targetPacked, id));
        if (isCallValid)
        {
            context->beginQuery(targetPacked, id);
        }
        ANGLE_CAPTURE(BeginQueryEXT, isCallValid, context, targetPacked, id);
    }
}

void GL_APIENTRY DeleteQueriesEXT(GLsizei n, const GLuint *ids)
{
    EVENT("(GLsizei n = %d, const GLuint *ids = 0x%016" PRIxPTR ")", n, (uintptr_t)ids);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid = (context->skipValidation() || ValidateDeleteQueriesEXT(context, n, ids));
        if (isCallValid)
        {
            context->deleteQueries(n, ids);
        }
        ANGLE_CAPTURE(DeleteQueriesEXT, isCallValid, context, n, ids);
    }
}

void GL_APIENTRY EndQueryEXT(GLenum target)
{
    EVENT("(GLenum target = 0x%X)", target);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        QueryType targetPacked = FromGLenum<QueryType>(target);
        bool isCallValid =
            (context->skipValidation() || ValidateEndQueryEXT(context, targetPacked));
        if (isCallValid)
        {
            context->endQuery(targetPacked);
        }
        ANGLE_CAPTURE(EndQueryEXT, isCallValid, context, targetPacked);
    }
}

void GL_APIENTRY GenQueriesEXT(GLsizei n, GLuint *ids)
{
    EVENT("(GLsizei n = %d, GLuint *ids = 0x%016" PRIxPTR ")", n, (uintptr_t)ids);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid = (context->skipValidation() || ValidateGenQueriesEXT(context, n, ids));
        if (isCallValid)
        {
            context->genQueries(n, ids);
        }
        ANGLE_CAPTURE(GenQueriesEXT, isCallValid, context, n, ids);
    }
}

void GL_APIENTRY GetQueryObjecti64vEXT(GLuint id, GLenum pname, GLint64 *params)
{
    EVENT("(GLuint id = %u, GLenum pname = 0x%X, GLint64 *params = 0x%016" PRIxPTR ")", id, pname,
          (uintptr_t)params);

    Context *context = GetGlobalContext();
    if (context)
    {
        bool isCallValid = (context->skipValidation() ||
                            ValidateGetQueryObjecti64vEXT(context, id, pname, params));
        if (isCallValid)
        {
            context->getQueryObjecti64v(id, pname, params);
        }
        ANGLE_CAPTURE(GetQueryObjecti64vEXT, isCallValid, context, id, pname, params);
    }
}

void GL_APIENTRY GetQueryObjectivEXT(GLuint id, GLenum pname, GLint *params)
{
    EVENT("(GLuint id = %u, GLenum pname = 0x%X, GLint *params = 0x%016" PRIxPTR ")", id, pname,
          (uintptr_t)params);

    Context *context = GetGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() || ValidateGetQueryObjectivEXT(context, id, pname, params));
        if (isCallValid)
        {
            context->getQueryObjectiv(id, pname, params);
        }
        ANGLE_CAPTURE(GetQueryObjectivEXT, isCallValid, context, id, pname, params);
    }
}

void GL_APIENTRY GetQueryObjectui64vEXT(GLuint id, GLenum pname, GLuint64 *params)
{
    EVENT("(GLuint id = %u, GLenum pname = 0x%X, GLuint64 *params = 0x%016" PRIxPTR ")", id, pname,
          (uintptr_t)params);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid = (context->skipValidation() ||
                            ValidateGetQueryObjectui64vEXT(context, id, pname, params));
        if (isCallValid)
        {
            context->getQueryObjectui64v(id, pname, params);
        }
        ANGLE_CAPTURE(GetQueryObjectui64vEXT, isCallValid, context, id, pname, params);
    }
}

void GL_APIENTRY GetQueryObjectuivEXT(GLuint id, GLenum pname, GLuint *params)
{
    EVENT("(GLuint id = %u, GLenum pname = 0x%X, GLuint *params = 0x%016" PRIxPTR ")", id, pname,
          (uintptr_t)params);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() || ValidateGetQueryObjectuivEXT(context, id, pname, params));
        if (isCallValid)
        {
            context->getQueryObjectuiv(id, pname, params);
        }
        ANGLE_CAPTURE(GetQueryObjectuivEXT, isCallValid, context, id, pname, params);
    }
}

void GL_APIENTRY GetQueryivEXT(GLenum target, GLenum pname, GLint *params)
{
    EVENT("(GLenum target = 0x%X, GLenum pname = 0x%X, GLint *params = 0x%016" PRIxPTR ")", target,
          pname, (uintptr_t)params);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        QueryType targetPacked = FromGLenum<QueryType>(target);
        bool isCallValid       = (context->skipValidation() ||
                            ValidateGetQueryivEXT(context, targetPacked, pname, params));
        if (isCallValid)
        {
            context->getQueryiv(targetPacked, pname, params);
        }
        ANGLE_CAPTURE(GetQueryivEXT, isCallValid, context, targetPacked, pname, params);
    }
}

GLboolean GL_APIENTRY IsQueryEXT(GLuint id)
{
    EVENT("(GLuint id = %u)", id);

    Context *context = GetValidGlobalContext();
    GLboolean returnValue;
    if (context)
    {
        bool isCallValid = (context->skipValidation() || ValidateIsQueryEXT(context, id));
        if (isCallValid)
        {
            returnValue = context->isQuery(id);
        }
        else
        {
            returnValue = GetDefaultReturnValue<EntryPoint::IsQueryEXT, GLboolean>();
        }
        ANGLE_CAPTURE(IsQueryEXT, isCallValid, context, id, returnValue);
    }
    else
    {
        returnValue = GetDefaultReturnValue<EntryPoint::IsQueryEXT, GLboolean>();
    }
    return returnValue;
}

void GL_APIENTRY QueryCounterEXT(GLuint id, GLenum target)
{
    EVENT("(GLuint id = %u, GLenum target = 0x%X)", id, target);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        QueryType targetPacked = FromGLenum<QueryType>(target);
        bool isCallValid =
            (context->skipValidation() || ValidateQueryCounterEXT(context, id, targetPacked));
        if (isCallValid)
        {
            context->queryCounter(id, targetPacked);
        }
        ANGLE_CAPTURE(QueryCounterEXT, isCallValid, context, id, targetPacked);
    }
}

// GL_EXT_draw_buffers
void GL_APIENTRY DrawBuffersEXT(GLsizei n, const GLenum *bufs)
{
    EVENT("(GLsizei n = %d, const GLenum *bufs = 0x%016" PRIxPTR ")", n, (uintptr_t)bufs);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid = (context->skipValidation() || ValidateDrawBuffersEXT(context, n, bufs));
        if (isCallValid)
        {
            context->drawBuffers(n, bufs);
        }
        ANGLE_CAPTURE(DrawBuffersEXT, isCallValid, context, n, bufs);
    }
}

// GL_EXT_geometry_shader
void GL_APIENTRY FramebufferTextureEXT(GLenum target,
                                       GLenum attachment,
                                       GLuint texture,
                                       GLint level)
{
    EVENT("(GLenum target = 0x%X, GLenum attachment = 0x%X, GLuint texture = %u, GLint level = %d)",
          target, attachment, texture, level);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() ||
             ValidateFramebufferTextureEXT(context, target, attachment, texture, level));
        if (isCallValid)
        {
            context->framebufferTexture(target, attachment, texture, level);
        }
        ANGLE_CAPTURE(FramebufferTextureEXT, isCallValid, context, target, attachment, texture,
                      level);
    }
}

// GL_EXT_instanced_arrays
void GL_APIENTRY DrawArraysInstancedEXT(GLenum mode, GLint start, GLsizei count, GLsizei primcount)
{
    EVENT("(GLenum mode = 0x%X, GLint start = %d, GLsizei count = %d, GLsizei primcount = %d)",
          mode, start, count, primcount);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        PrimitiveMode modePacked = FromGLenum<PrimitiveMode>(mode);
        bool isCallValid =
            (context->skipValidation() ||
             ValidateDrawArraysInstancedEXT(context, modePacked, start, count, primcount));
        if (isCallValid)
        {
            context->drawArraysInstanced(modePacked, start, count, primcount);
        }
        ANGLE_CAPTURE(DrawArraysInstancedEXT, isCallValid, context, modePacked, start, count,
                      primcount);
    }
}

void GL_APIENTRY DrawElementsInstancedEXT(GLenum mode,
                                          GLsizei count,
                                          GLenum type,
                                          const void *indices,
                                          GLsizei primcount)
{
    EVENT(
        "(GLenum mode = 0x%X, GLsizei count = %d, GLenum type = 0x%X, const void *indices = "
        "0x%016" PRIxPTR ", GLsizei primcount = %d)",
        mode, count, type, (uintptr_t)indices, primcount);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        PrimitiveMode modePacked    = FromGLenum<PrimitiveMode>(mode);
        DrawElementsType typePacked = FromGLenum<DrawElementsType>(type);
        bool isCallValid            = (context->skipValidation() ||
                            ValidateDrawElementsInstancedEXT(context, modePacked, count, typePacked,
                                                             indices, primcount));
        if (isCallValid)
        {
            context->drawElementsInstanced(modePacked, count, typePacked, indices, primcount);
        }
        ANGLE_CAPTURE(DrawElementsInstancedEXT, isCallValid, context, modePacked, count, typePacked,
                      indices, primcount);
    }
}

void GL_APIENTRY VertexAttribDivisorEXT(GLuint index, GLuint divisor)
{
    EVENT("(GLuint index = %u, GLuint divisor = %u)", index, divisor);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() || ValidateVertexAttribDivisorEXT(context, index, divisor));
        if (isCallValid)
        {
            context->vertexAttribDivisor(index, divisor);
        }
        ANGLE_CAPTURE(VertexAttribDivisorEXT, isCallValid, context, index, divisor);
    }
}

// GL_EXT_map_buffer_range
void GL_APIENTRY FlushMappedBufferRangeEXT(GLenum target, GLintptr offset, GLsizeiptr length)
{
    EVENT("(GLenum target = 0x%X, GLintptr offset = %llu, GLsizeiptr length = %llu)", target,
          static_cast<unsigned long long>(offset), static_cast<unsigned long long>(length));

    Context *context = GetValidGlobalContext();
    if (context)
    {
        BufferBinding targetPacked = FromGLenum<BufferBinding>(target);
        bool isCallValid =
            (context->skipValidation() ||
             ValidateFlushMappedBufferRangeEXT(context, targetPacked, offset, length));
        if (isCallValid)
        {
            context->flushMappedBufferRange(targetPacked, offset, length);
        }
        ANGLE_CAPTURE(FlushMappedBufferRangeEXT, isCallValid, context, targetPacked, offset,
                      length);
    }
}

void *GL_APIENTRY MapBufferRangeEXT(GLenum target,
                                    GLintptr offset,
                                    GLsizeiptr length,
                                    GLbitfield access)
{
    EVENT(
        "(GLenum target = 0x%X, GLintptr offset = %llu, GLsizeiptr length = %llu, GLbitfield "
        "access = 0x%X)",
        target, static_cast<unsigned long long>(offset), static_cast<unsigned long long>(length),
        access);

    Context *context = GetValidGlobalContext();
    void *returnValue;
    if (context)
    {
        BufferBinding targetPacked = FromGLenum<BufferBinding>(target);
        bool isCallValid =
            (context->skipValidation() ||
             ValidateMapBufferRangeEXT(context, targetPacked, offset, length, access));
        if (isCallValid)
        {
            returnValue = context->mapBufferRange(targetPacked, offset, length, access);
        }
        else
        {
            returnValue = GetDefaultReturnValue<EntryPoint::MapBufferRangeEXT, void *>();
        }
        ANGLE_CAPTURE(MapBufferRangeEXT, isCallValid, context, targetPacked, offset, length, access,
                      returnValue);
    }
    else
    {
        returnValue = GetDefaultReturnValue<EntryPoint::MapBufferRangeEXT, void *>();
    }
    return returnValue;
}

// GL_EXT_memory_object
void GL_APIENTRY BufferStorageMemEXT(GLenum target, GLsizeiptr size, GLuint memory, GLuint64 offset)
{
    EVENT(
        "(GLenum target = 0x%X, GLsizeiptr size = %llu, GLuint memory = %u, GLuint64 offset = "
        "%llu)",
        target, static_cast<unsigned long long>(size), memory,
        static_cast<unsigned long long>(offset));

    Context *context = GetValidGlobalContext();
    if (context)
    {
        TextureType targetPacked = FromGLenum<TextureType>(target);
        bool isCallValid =
            (context->skipValidation() ||
             ValidateBufferStorageMemEXT(context, targetPacked, size, memory, offset));
        if (isCallValid)
        {
            context->bufferStorageMem(targetPacked, size, memory, offset);
        }
        ANGLE_CAPTURE(BufferStorageMemEXT, isCallValid, context, targetPacked, size, memory,
                      offset);
    }
}

void GL_APIENTRY CreateMemoryObjectsEXT(GLsizei n, GLuint *memoryObjects)
{
    EVENT("(GLsizei n = %d, GLuint *memoryObjects = 0x%016" PRIxPTR ")", n,
          (uintptr_t)memoryObjects);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid = (context->skipValidation() ||
                            ValidateCreateMemoryObjectsEXT(context, n, memoryObjects));
        if (isCallValid)
        {
            context->createMemoryObjects(n, memoryObjects);
        }
        ANGLE_CAPTURE(CreateMemoryObjectsEXT, isCallValid, context, n, memoryObjects);
    }
}

void GL_APIENTRY DeleteMemoryObjectsEXT(GLsizei n, const GLuint *memoryObjects)
{
    EVENT("(GLsizei n = %d, const GLuint *memoryObjects = 0x%016" PRIxPTR ")", n,
          (uintptr_t)memoryObjects);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid = (context->skipValidation() ||
                            ValidateDeleteMemoryObjectsEXT(context, n, memoryObjects));
        if (isCallValid)
        {
            context->deleteMemoryObjects(n, memoryObjects);
        }
        ANGLE_CAPTURE(DeleteMemoryObjectsEXT, isCallValid, context, n, memoryObjects);
    }
}

void GL_APIENTRY GetMemoryObjectParameterivEXT(GLuint memoryObject, GLenum pname, GLint *params)
{
    EVENT("(GLuint memoryObject = %u, GLenum pname = 0x%X, GLint *params = 0x%016" PRIxPTR ")",
          memoryObject, pname, (uintptr_t)params);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid = (context->skipValidation() || ValidateGetMemoryObjectParameterivEXT(
                                                             context, memoryObject, pname, params));
        if (isCallValid)
        {
            context->getMemoryObjectParameteriv(memoryObject, pname, params);
        }
        ANGLE_CAPTURE(GetMemoryObjectParameterivEXT, isCallValid, context, memoryObject, pname,
                      params);
    }
}

void GL_APIENTRY GetUnsignedBytevEXT(GLenum pname, GLubyte *data)
{
    EVENT("(GLenum pname = 0x%X, GLubyte *data = 0x%016" PRIxPTR ")", pname, (uintptr_t)data);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() || ValidateGetUnsignedBytevEXT(context, pname, data));
        if (isCallValid)
        {
            context->getUnsignedBytev(pname, data);
        }
        ANGLE_CAPTURE(GetUnsignedBytevEXT, isCallValid, context, pname, data);
    }
}

void GL_APIENTRY GetUnsignedBytei_vEXT(GLenum target, GLuint index, GLubyte *data)
{
    EVENT("(GLenum target = 0x%X, GLuint index = %u, GLubyte *data = 0x%016" PRIxPTR ")", target,
          index, (uintptr_t)data);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid = (context->skipValidation() ||
                            ValidateGetUnsignedBytei_vEXT(context, target, index, data));
        if (isCallValid)
        {
            context->getUnsignedBytei_v(target, index, data);
        }
        ANGLE_CAPTURE(GetUnsignedBytei_vEXT, isCallValid, context, target, index, data);
    }
}

GLboolean GL_APIENTRY IsMemoryObjectEXT(GLuint memoryObject)
{
    EVENT("(GLuint memoryObject = %u)", memoryObject);

    Context *context = GetValidGlobalContext();
    GLboolean returnValue;
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() || ValidateIsMemoryObjectEXT(context, memoryObject));
        if (isCallValid)
        {
            returnValue = context->isMemoryObject(memoryObject);
        }
        else
        {
            returnValue = GetDefaultReturnValue<EntryPoint::IsMemoryObjectEXT, GLboolean>();
        }
        ANGLE_CAPTURE(IsMemoryObjectEXT, isCallValid, context, memoryObject, returnValue);
    }
    else
    {
        returnValue = GetDefaultReturnValue<EntryPoint::IsMemoryObjectEXT, GLboolean>();
    }
    return returnValue;
}

void GL_APIENTRY MemoryObjectParameterivEXT(GLuint memoryObject, GLenum pname, const GLint *params)
{
    EVENT("(GLuint memoryObject = %u, GLenum pname = 0x%X, const GLint *params = 0x%016" PRIxPTR
          ")",
          memoryObject, pname, (uintptr_t)params);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid = (context->skipValidation() || ValidateMemoryObjectParameterivEXT(
                                                             context, memoryObject, pname, params));
        if (isCallValid)
        {
            context->memoryObjectParameteriv(memoryObject, pname, params);
        }
        ANGLE_CAPTURE(MemoryObjectParameterivEXT, isCallValid, context, memoryObject, pname,
                      params);
    }
}

void GL_APIENTRY TexStorageMem2DEXT(GLenum target,
                                    GLsizei levels,
                                    GLenum internalFormat,
                                    GLsizei width,
                                    GLsizei height,
                                    GLuint memory,
                                    GLuint64 offset)
{
    EVENT(
        "(GLenum target = 0x%X, GLsizei levels = %d, GLenum internalFormat = 0x%X, GLsizei width = "
        "%d, GLsizei height = %d, GLuint memory = %u, GLuint64 offset = %llu)",
        target, levels, internalFormat, width, height, memory,
        static_cast<unsigned long long>(offset));

    Context *context = GetValidGlobalContext();
    if (context)
    {
        TextureType targetPacked = FromGLenum<TextureType>(target);
        bool isCallValid =
            (context->skipValidation() ||
             ValidateTexStorageMem2DEXT(context, targetPacked, levels, internalFormat, width,
                                        height, memory, offset));
        if (isCallValid)
        {
            context->texStorageMem2D(targetPacked, levels, internalFormat, width, height, memory,
                                     offset);
        }
        ANGLE_CAPTURE(TexStorageMem2DEXT, isCallValid, context, targetPacked, levels,
                      internalFormat, width, height, memory, offset);
    }
}

void GL_APIENTRY TexStorageMem2DMultisampleEXT(GLenum target,
                                               GLsizei samples,
                                               GLenum internalFormat,
                                               GLsizei width,
                                               GLsizei height,
                                               GLboolean fixedSampleLocations,
                                               GLuint memory,
                                               GLuint64 offset)
{
    EVENT(
        "(GLenum target = 0x%X, GLsizei samples = %d, GLenum internalFormat = 0x%X, GLsizei width "
        "= %d, GLsizei height = %d, GLboolean fixedSampleLocations = %u, GLuint memory = %u, "
        "GLuint64 offset = %llu)",
        target, samples, internalFormat, width, height, fixedSampleLocations, memory,
        static_cast<unsigned long long>(offset));

    Context *context = GetValidGlobalContext();
    if (context)
    {
        TextureType targetPacked = FromGLenum<TextureType>(target);
        bool isCallValid =
            (context->skipValidation() || ValidateTexStorageMem2DMultisampleEXT(
                                              context, targetPacked, samples, internalFormat, width,
                                              height, fixedSampleLocations, memory, offset));
        if (isCallValid)
        {
            context->texStorageMem2DMultisample(targetPacked, samples, internalFormat, width,
                                                height, fixedSampleLocations, memory, offset);
        }
        ANGLE_CAPTURE(TexStorageMem2DMultisampleEXT, isCallValid, context, targetPacked, samples,
                      internalFormat, width, height, fixedSampleLocations, memory, offset);
    }
}

void GL_APIENTRY TexStorageMem3DEXT(GLenum target,
                                    GLsizei levels,
                                    GLenum internalFormat,
                                    GLsizei width,
                                    GLsizei height,
                                    GLsizei depth,
                                    GLuint memory,
                                    GLuint64 offset)
{
    EVENT(
        "(GLenum target = 0x%X, GLsizei levels = %d, GLenum internalFormat = 0x%X, GLsizei width = "
        "%d, GLsizei height = %d, GLsizei depth = %d, GLuint memory = %u, GLuint64 offset = %llu)",
        target, levels, internalFormat, width, height, depth, memory,
        static_cast<unsigned long long>(offset));

    Context *context = GetValidGlobalContext();
    if (context)
    {
        TextureType targetPacked = FromGLenum<TextureType>(target);
        bool isCallValid =
            (context->skipValidation() ||
             ValidateTexStorageMem3DEXT(context, targetPacked, levels, internalFormat, width,
                                        height, depth, memory, offset));
        if (isCallValid)
        {
            context->texStorageMem3D(targetPacked, levels, internalFormat, width, height, depth,
                                     memory, offset);
        }
        ANGLE_CAPTURE(TexStorageMem3DEXT, isCallValid, context, targetPacked, levels,
                      internalFormat, width, height, depth, memory, offset);
    }
}

void GL_APIENTRY TexStorageMem3DMultisampleEXT(GLenum target,
                                               GLsizei samples,
                                               GLenum internalFormat,
                                               GLsizei width,
                                               GLsizei height,
                                               GLsizei depth,
                                               GLboolean fixedSampleLocations,
                                               GLuint memory,
                                               GLuint64 offset)
{
    EVENT(
        "(GLenum target = 0x%X, GLsizei samples = %d, GLenum internalFormat = 0x%X, GLsizei width "
        "= %d, GLsizei height = %d, GLsizei depth = %d, GLboolean fixedSampleLocations = %u, "
        "GLuint memory = %u, GLuint64 offset = %llu)",
        target, samples, internalFormat, width, height, depth, fixedSampleLocations, memory,
        static_cast<unsigned long long>(offset));

    Context *context = GetValidGlobalContext();
    if (context)
    {
        TextureType targetPacked = FromGLenum<TextureType>(target);
        bool isCallValid =
            (context->skipValidation() || ValidateTexStorageMem3DMultisampleEXT(
                                              context, targetPacked, samples, internalFormat, width,
                                              height, depth, fixedSampleLocations, memory, offset));
        if (isCallValid)
        {
            context->texStorageMem3DMultisample(targetPacked, samples, internalFormat, width,
                                                height, depth, fixedSampleLocations, memory,
                                                offset);
        }
        ANGLE_CAPTURE(TexStorageMem3DMultisampleEXT, isCallValid, context, targetPacked, samples,
                      internalFormat, width, height, depth, fixedSampleLocations, memory, offset);
    }
}

// GL_EXT_memory_object_fd
void GL_APIENTRY ImportMemoryFdEXT(GLuint memory, GLuint64 size, GLenum handleType, GLint fd)
{
    EVENT("(GLuint memory = %u, GLuint64 size = %llu, GLenum handleType = 0x%X, GLint fd = %d)",
          memory, static_cast<unsigned long long>(size), handleType, fd);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        HandleType handleTypePacked = FromGLenum<HandleType>(handleType);
        bool isCallValid            = (context->skipValidation() ||
                            ValidateImportMemoryFdEXT(context, memory, size, handleTypePacked, fd));
        if (isCallValid)
        {
            context->importMemoryFd(memory, size, handleTypePacked, fd);
        }
        ANGLE_CAPTURE(ImportMemoryFdEXT, isCallValid, context, memory, size, handleTypePacked, fd);
    }
}

// GL_EXT_occlusion_query_boolean
// BeginQueryEXT is already defined.

// DeleteQueriesEXT is already defined.

// EndQueryEXT is already defined.

// GenQueriesEXT is already defined.

// GetQueryObjectuivEXT is already defined.

// GetQueryivEXT is already defined.

// IsQueryEXT is already defined.

// GL_EXT_robustness
GLenum GL_APIENTRY GetGraphicsResetStatusEXT()
{
    EVENT("()");

    Context *context = GetGlobalContext();
    GLenum returnValue;
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() || ValidateGetGraphicsResetStatusEXT(context));
        if (isCallValid)
        {
            returnValue = context->getGraphicsResetStatus();
        }
        else
        {
            returnValue = GetDefaultReturnValue<EntryPoint::GetGraphicsResetStatusEXT, GLenum>();
        }
        ANGLE_CAPTURE(GetGraphicsResetStatusEXT, isCallValid, context, returnValue);
    }
    else
    {
        returnValue = GetDefaultReturnValue<EntryPoint::GetGraphicsResetStatusEXT, GLenum>();
    }
    return returnValue;
}

void GL_APIENTRY GetnUniformfvEXT(GLuint program, GLint location, GLsizei bufSize, GLfloat *params)
{
    EVENT(
        "(GLuint program = %u, GLint location = %d, GLsizei bufSize = %d, GLfloat *params = "
        "0x%016" PRIxPTR ")",
        program, location, bufSize, (uintptr_t)params);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid = (context->skipValidation() ||
                            ValidateGetnUniformfvEXT(context, program, location, bufSize, params));
        if (isCallValid)
        {
            context->getnUniformfv(program, location, bufSize, params);
        }
        ANGLE_CAPTURE(GetnUniformfvEXT, isCallValid, context, program, location, bufSize, params);
    }
}

void GL_APIENTRY GetnUniformivEXT(GLuint program, GLint location, GLsizei bufSize, GLint *params)
{
    EVENT(
        "(GLuint program = %u, GLint location = %d, GLsizei bufSize = %d, GLint *params = "
        "0x%016" PRIxPTR ")",
        program, location, bufSize, (uintptr_t)params);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid = (context->skipValidation() ||
                            ValidateGetnUniformivEXT(context, program, location, bufSize, params));
        if (isCallValid)
        {
            context->getnUniformiv(program, location, bufSize, params);
        }
        ANGLE_CAPTURE(GetnUniformivEXT, isCallValid, context, program, location, bufSize, params);
    }
}

void GL_APIENTRY ReadnPixelsEXT(GLint x,
                                GLint y,
                                GLsizei width,
                                GLsizei height,
                                GLenum format,
                                GLenum type,
                                GLsizei bufSize,
                                void *data)
{
    EVENT(
        "(GLint x = %d, GLint y = %d, GLsizei width = %d, GLsizei height = %d, GLenum format = "
        "0x%X, GLenum type = 0x%X, GLsizei bufSize = %d, void *data = 0x%016" PRIxPTR ")",
        x, y, width, height, format, type, bufSize, (uintptr_t)data);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() ||
             ValidateReadnPixelsEXT(context, x, y, width, height, format, type, bufSize, data));
        if (isCallValid)
        {
            context->readnPixels(x, y, width, height, format, type, bufSize, data);
        }
        ANGLE_CAPTURE(ReadnPixelsEXT, isCallValid, context, x, y, width, height, format, type,
                      bufSize, data);
    }
}

// GL_EXT_semaphore
void GL_APIENTRY DeleteSemaphoresEXT(GLsizei n, const GLuint *semaphores)
{
    EVENT("(GLsizei n = %d, const GLuint *semaphores = 0x%016" PRIxPTR ")", n,
          (uintptr_t)semaphores);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() || ValidateDeleteSemaphoresEXT(context, n, semaphores));
        if (isCallValid)
        {
            context->deleteSemaphores(n, semaphores);
        }
        ANGLE_CAPTURE(DeleteSemaphoresEXT, isCallValid, context, n, semaphores);
    }
}

void GL_APIENTRY GenSemaphoresEXT(GLsizei n, GLuint *semaphores)
{
    EVENT("(GLsizei n = %d, GLuint *semaphores = 0x%016" PRIxPTR ")", n, (uintptr_t)semaphores);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() || ValidateGenSemaphoresEXT(context, n, semaphores));
        if (isCallValid)
        {
            context->genSemaphores(n, semaphores);
        }
        ANGLE_CAPTURE(GenSemaphoresEXT, isCallValid, context, n, semaphores);
    }
}

void GL_APIENTRY GetSemaphoreParameterui64vEXT(GLuint semaphore, GLenum pname, GLuint64 *params)
{
    EVENT("(GLuint semaphore = %u, GLenum pname = 0x%X, GLuint64 *params = 0x%016" PRIxPTR ")",
          semaphore, pname, (uintptr_t)params);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid = (context->skipValidation() || ValidateGetSemaphoreParameterui64vEXT(
                                                             context, semaphore, pname, params));
        if (isCallValid)
        {
            context->getSemaphoreParameterui64v(semaphore, pname, params);
        }
        ANGLE_CAPTURE(GetSemaphoreParameterui64vEXT, isCallValid, context, semaphore, pname,
                      params);
    }
}

GLboolean GL_APIENTRY IsSemaphoreEXT(GLuint semaphore)
{
    EVENT("(GLuint semaphore = %u)", semaphore);

    Context *context = GetValidGlobalContext();
    GLboolean returnValue;
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() || ValidateIsSemaphoreEXT(context, semaphore));
        if (isCallValid)
        {
            returnValue = context->isSemaphore(semaphore);
        }
        else
        {
            returnValue = GetDefaultReturnValue<EntryPoint::IsSemaphoreEXT, GLboolean>();
        }
        ANGLE_CAPTURE(IsSemaphoreEXT, isCallValid, context, semaphore, returnValue);
    }
    else
    {
        returnValue = GetDefaultReturnValue<EntryPoint::IsSemaphoreEXT, GLboolean>();
    }
    return returnValue;
}

void GL_APIENTRY SemaphoreParameterui64vEXT(GLuint semaphore, GLenum pname, const GLuint64 *params)
{
    EVENT("(GLuint semaphore = %u, GLenum pname = 0x%X, const GLuint64 *params = 0x%016" PRIxPTR
          ")",
          semaphore, pname, (uintptr_t)params);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid = (context->skipValidation() ||
                            ValidateSemaphoreParameterui64vEXT(context, semaphore, pname, params));
        if (isCallValid)
        {
            context->semaphoreParameterui64v(semaphore, pname, params);
        }
        ANGLE_CAPTURE(SemaphoreParameterui64vEXT, isCallValid, context, semaphore, pname, params);
    }
}

void GL_APIENTRY SignalSemaphoreEXT(GLuint semaphore,
                                    GLuint numBufferBarriers,
                                    const GLuint *buffers,
                                    GLuint numTextureBarriers,
                                    const GLuint *textures,
                                    const GLenum *dstLayouts)
{
    EVENT(
        "(GLuint semaphore = %u, GLuint numBufferBarriers = %u, const GLuint *buffers = "
        "0x%016" PRIxPTR ", GLuint numTextureBarriers = %u, const GLuint *textures = 0x%016" PRIxPTR
        ", const GLenum *dstLayouts = 0x%016" PRIxPTR ")",
        semaphore, numBufferBarriers, (uintptr_t)buffers, numTextureBarriers, (uintptr_t)textures,
        (uintptr_t)dstLayouts);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() ||
             ValidateSignalSemaphoreEXT(context, semaphore, numBufferBarriers, buffers,
                                        numTextureBarriers, textures, dstLayouts));
        if (isCallValid)
        {
            context->signalSemaphore(semaphore, numBufferBarriers, buffers, numTextureBarriers,
                                     textures, dstLayouts);
        }
        ANGLE_CAPTURE(SignalSemaphoreEXT, isCallValid, context, semaphore, numBufferBarriers,
                      buffers, numTextureBarriers, textures, dstLayouts);
    }
}

void GL_APIENTRY WaitSemaphoreEXT(GLuint semaphore,
                                  GLuint numBufferBarriers,
                                  const GLuint *buffers,
                                  GLuint numTextureBarriers,
                                  const GLuint *textures,
                                  const GLenum *srcLayouts)
{
    EVENT(
        "(GLuint semaphore = %u, GLuint numBufferBarriers = %u, const GLuint *buffers = "
        "0x%016" PRIxPTR ", GLuint numTextureBarriers = %u, const GLuint *textures = 0x%016" PRIxPTR
        ", const GLenum *srcLayouts = 0x%016" PRIxPTR ")",
        semaphore, numBufferBarriers, (uintptr_t)buffers, numTextureBarriers, (uintptr_t)textures,
        (uintptr_t)srcLayouts);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid = (context->skipValidation() ||
                            ValidateWaitSemaphoreEXT(context, semaphore, numBufferBarriers, buffers,
                                                     numTextureBarriers, textures, srcLayouts));
        if (isCallValid)
        {
            context->waitSemaphore(semaphore, numBufferBarriers, buffers, numTextureBarriers,
                                   textures, srcLayouts);
        }
        ANGLE_CAPTURE(WaitSemaphoreEXT, isCallValid, context, semaphore, numBufferBarriers, buffers,
                      numTextureBarriers, textures, srcLayouts);
    }
}

// GetUnsignedBytei_vEXT is already defined.

// GetUnsignedBytevEXT is already defined.

// GL_EXT_semaphore_fd
void GL_APIENTRY ImportSemaphoreFdEXT(GLuint semaphore, GLenum handleType, GLint fd)
{
    EVENT("(GLuint semaphore = %u, GLenum handleType = 0x%X, GLint fd = %d)", semaphore, handleType,
          fd);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        HandleType handleTypePacked = FromGLenum<HandleType>(handleType);
        bool isCallValid            = (context->skipValidation() ||
                            ValidateImportSemaphoreFdEXT(context, semaphore, handleTypePacked, fd));
        if (isCallValid)
        {
            context->importSemaphoreFd(semaphore, handleTypePacked, fd);
        }
        ANGLE_CAPTURE(ImportSemaphoreFdEXT, isCallValid, context, semaphore, handleTypePacked, fd);
    }
}

// GL_EXT_texture_storage
void GL_APIENTRY TexStorage1DEXT(GLenum target,
                                 GLsizei levels,
                                 GLenum internalformat,
                                 GLsizei width)
{
    EVENT(
        "(GLenum target = 0x%X, GLsizei levels = %d, GLenum internalformat = 0x%X, GLsizei width = "
        "%d)",
        target, levels, internalformat, width);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() ||
             ValidateTexStorage1DEXT(context, target, levels, internalformat, width));
        if (isCallValid)
        {
            context->texStorage1D(target, levels, internalformat, width);
        }
        ANGLE_CAPTURE(TexStorage1DEXT, isCallValid, context, target, levels, internalformat, width);
    }
}

void GL_APIENTRY
TexStorage2DEXT(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height)
{
    EVENT(
        "(GLenum target = 0x%X, GLsizei levels = %d, GLenum internalformat = 0x%X, GLsizei width = "
        "%d, GLsizei height = %d)",
        target, levels, internalformat, width, height);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        TextureType targetPacked = FromGLenum<TextureType>(target);
        bool isCallValid =
            (context->skipValidation() ||
             ValidateTexStorage2DEXT(context, targetPacked, levels, internalformat, width, height));
        if (isCallValid)
        {
            context->texStorage2D(targetPacked, levels, internalformat, width, height);
        }
        ANGLE_CAPTURE(TexStorage2DEXT, isCallValid, context, targetPacked, levels, internalformat,
                      width, height);
    }
}

void GL_APIENTRY TexStorage3DEXT(GLenum target,
                                 GLsizei levels,
                                 GLenum internalformat,
                                 GLsizei width,
                                 GLsizei height,
                                 GLsizei depth)
{
    EVENT(
        "(GLenum target = 0x%X, GLsizei levels = %d, GLenum internalformat = 0x%X, GLsizei width = "
        "%d, GLsizei height = %d, GLsizei depth = %d)",
        target, levels, internalformat, width, height, depth);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        TextureType targetPacked = FromGLenum<TextureType>(target);
        bool isCallValid         = (context->skipValidation() ||
                            ValidateTexStorage3DEXT(context, targetPacked, levels, internalformat,
                                                    width, height, depth));
        if (isCallValid)
        {
            context->texStorage3D(targetPacked, levels, internalformat, width, height, depth);
        }
        ANGLE_CAPTURE(TexStorage3DEXT, isCallValid, context, targetPacked, levels, internalformat,
                      width, height, depth);
    }
}

// GL_KHR_debug
void GL_APIENTRY DebugMessageCallbackKHR(GLDEBUGPROCKHR callback, const void *userParam)
{
    EVENT("(GLDEBUGPROCKHR callback = 0x%016" PRIxPTR ", const void *userParam = 0x%016" PRIxPTR
          ")",
          (uintptr_t)callback, (uintptr_t)userParam);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid = (context->skipValidation() ||
                            ValidateDebugMessageCallbackKHR(context, callback, userParam));
        if (isCallValid)
        {
            context->debugMessageCallback(callback, userParam);
        }
        ANGLE_CAPTURE(DebugMessageCallbackKHR, isCallValid, context, callback, userParam);
    }
}

void GL_APIENTRY DebugMessageControlKHR(GLenum source,
                                        GLenum type,
                                        GLenum severity,
                                        GLsizei count,
                                        const GLuint *ids,
                                        GLboolean enabled)
{
    EVENT(
        "(GLenum source = 0x%X, GLenum type = 0x%X, GLenum severity = 0x%X, GLsizei count = %d, "
        "const GLuint *ids = 0x%016" PRIxPTR ", GLboolean enabled = %u)",
        source, type, severity, count, (uintptr_t)ids, enabled);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() ||
             ValidateDebugMessageControlKHR(context, source, type, severity, count, ids, enabled));
        if (isCallValid)
        {
            context->debugMessageControl(source, type, severity, count, ids, enabled);
        }
        ANGLE_CAPTURE(DebugMessageControlKHR, isCallValid, context, source, type, severity, count,
                      ids, enabled);
    }
}

void GL_APIENTRY DebugMessageInsertKHR(GLenum source,
                                       GLenum type,
                                       GLuint id,
                                       GLenum severity,
                                       GLsizei length,
                                       const GLchar *buf)
{
    EVENT(
        "(GLenum source = 0x%X, GLenum type = 0x%X, GLuint id = %u, GLenum severity = 0x%X, "
        "GLsizei length = %d, const GLchar *buf = 0x%016" PRIxPTR ")",
        source, type, id, severity, length, (uintptr_t)buf);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() ||
             ValidateDebugMessageInsertKHR(context, source, type, id, severity, length, buf));
        if (isCallValid)
        {
            context->debugMessageInsert(source, type, id, severity, length, buf);
        }
        ANGLE_CAPTURE(DebugMessageInsertKHR, isCallValid, context, source, type, id, severity,
                      length, buf);
    }
}

GLuint GL_APIENTRY GetDebugMessageLogKHR(GLuint count,
                                         GLsizei bufSize,
                                         GLenum *sources,
                                         GLenum *types,
                                         GLuint *ids,
                                         GLenum *severities,
                                         GLsizei *lengths,
                                         GLchar *messageLog)
{
    EVENT("(GLuint count = %u, GLsizei bufSize = %d, GLenum *sources = 0x%016" PRIxPTR
          ", GLenum *types = 0x%016" PRIxPTR ", GLuint *ids = 0x%016" PRIxPTR
          ", GLenum *severities = 0x%016" PRIxPTR ", GLsizei *lengths = 0x%016" PRIxPTR
          ", GLchar *messageLog = 0x%016" PRIxPTR ")",
          count, bufSize, (uintptr_t)sources, (uintptr_t)types, (uintptr_t)ids,
          (uintptr_t)severities, (uintptr_t)lengths, (uintptr_t)messageLog);

    Context *context = GetValidGlobalContext();
    GLuint returnValue;
    if (context)
    {
        bool isCallValid = (context->skipValidation() ||
                            ValidateGetDebugMessageLogKHR(context, count, bufSize, sources, types,
                                                          ids, severities, lengths, messageLog));
        if (isCallValid)
        {
            returnValue = context->getDebugMessageLog(count, bufSize, sources, types, ids,
                                                      severities, lengths, messageLog);
        }
        else
        {
            returnValue = GetDefaultReturnValue<EntryPoint::GetDebugMessageLogKHR, GLuint>();
        }
        ANGLE_CAPTURE(GetDebugMessageLogKHR, isCallValid, context, count, bufSize, sources, types,
                      ids, severities, lengths, messageLog, returnValue);
    }
    else
    {
        returnValue = GetDefaultReturnValue<EntryPoint::GetDebugMessageLogKHR, GLuint>();
    }
    return returnValue;
}

void GL_APIENTRY
GetObjectLabelKHR(GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label)
{
    EVENT(
        "(GLenum identifier = 0x%X, GLuint name = %u, GLsizei bufSize = %d, GLsizei *length = "
        "0x%016" PRIxPTR ", GLchar *label = 0x%016" PRIxPTR ")",
        identifier, name, bufSize, (uintptr_t)length, (uintptr_t)label);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() ||
             ValidateGetObjectLabelKHR(context, identifier, name, bufSize, length, label));
        if (isCallValid)
        {
            context->getObjectLabel(identifier, name, bufSize, length, label);
        }
        ANGLE_CAPTURE(GetObjectLabelKHR, isCallValid, context, identifier, name, bufSize, length,
                      label);
    }
}

void GL_APIENTRY GetObjectPtrLabelKHR(const void *ptr,
                                      GLsizei bufSize,
                                      GLsizei *length,
                                      GLchar *label)
{
    EVENT("(const void *ptr = 0x%016" PRIxPTR
          ", GLsizei bufSize = %d, GLsizei *length = 0x%016" PRIxPTR
          ", GLchar *label = 0x%016" PRIxPTR ")",
          (uintptr_t)ptr, bufSize, (uintptr_t)length, (uintptr_t)label);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid = (context->skipValidation() ||
                            ValidateGetObjectPtrLabelKHR(context, ptr, bufSize, length, label));
        if (isCallValid)
        {
            context->getObjectPtrLabel(ptr, bufSize, length, label);
        }
        ANGLE_CAPTURE(GetObjectPtrLabelKHR, isCallValid, context, ptr, bufSize, length, label);
    }
}

void GL_APIENTRY GetPointervKHR(GLenum pname, void **params)
{
    EVENT("(GLenum pname = 0x%X, void **params = 0x%016" PRIxPTR ")", pname, (uintptr_t)params);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() || ValidateGetPointervKHR(context, pname, params));
        if (isCallValid)
        {
            context->getPointerv(pname, params);
        }
        ANGLE_CAPTURE(GetPointervKHR, isCallValid, context, pname, params);
    }
}

void GL_APIENTRY ObjectLabelKHR(GLenum identifier, GLuint name, GLsizei length, const GLchar *label)
{
    EVENT(
        "(GLenum identifier = 0x%X, GLuint name = %u, GLsizei length = %d, const GLchar *label = "
        "0x%016" PRIxPTR ")",
        identifier, name, length, (uintptr_t)label);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid = (context->skipValidation() ||
                            ValidateObjectLabelKHR(context, identifier, name, length, label));
        if (isCallValid)
        {
            context->objectLabel(identifier, name, length, label);
        }
        ANGLE_CAPTURE(ObjectLabelKHR, isCallValid, context, identifier, name, length, label);
    }
}

void GL_APIENTRY ObjectPtrLabelKHR(const void *ptr, GLsizei length, const GLchar *label)
{
    EVENT("(const void *ptr = 0x%016" PRIxPTR
          ", GLsizei length = %d, const GLchar *label = 0x%016" PRIxPTR ")",
          (uintptr_t)ptr, length, (uintptr_t)label);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() || ValidateObjectPtrLabelKHR(context, ptr, length, label));
        if (isCallValid)
        {
            context->objectPtrLabel(ptr, length, label);
        }
        ANGLE_CAPTURE(ObjectPtrLabelKHR, isCallValid, context, ptr, length, label);
    }
}

void GL_APIENTRY PopDebugGroupKHR()
{
    EVENT("()");

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid = (context->skipValidation() || ValidatePopDebugGroupKHR(context));
        if (isCallValid)
        {
            context->popDebugGroup();
        }
        ANGLE_CAPTURE(PopDebugGroupKHR, isCallValid, context);
    }
}

void GL_APIENTRY PushDebugGroupKHR(GLenum source, GLuint id, GLsizei length, const GLchar *message)
{
    EVENT(
        "(GLenum source = 0x%X, GLuint id = %u, GLsizei length = %d, const GLchar *message = "
        "0x%016" PRIxPTR ")",
        source, id, length, (uintptr_t)message);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid = (context->skipValidation() ||
                            ValidatePushDebugGroupKHR(context, source, id, length, message));
        if (isCallValid)
        {
            context->pushDebugGroup(source, id, length, message);
        }
        ANGLE_CAPTURE(PushDebugGroupKHR, isCallValid, context, source, id, length, message);
    }
}

// GL_KHR_parallel_shader_compile
void GL_APIENTRY MaxShaderCompilerThreadsKHR(GLuint count)
{
    EVENT("(GLuint count = %u)", count);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() || ValidateMaxShaderCompilerThreadsKHR(context, count));
        if (isCallValid)
        {
            context->maxShaderCompilerThreads(count);
        }
        ANGLE_CAPTURE(MaxShaderCompilerThreadsKHR, isCallValid, context, count);
    }
}

// GL_NV_fence
void GL_APIENTRY DeleteFencesNV(GLsizei n, const GLuint *fences)
{
    EVENT("(GLsizei n = %d, const GLuint *fences = 0x%016" PRIxPTR ")", n, (uintptr_t)fences);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() || ValidateDeleteFencesNV(context, n, fences));
        if (isCallValid)
        {
            context->deleteFencesNV(n, fences);
        }
        ANGLE_CAPTURE(DeleteFencesNV, isCallValid, context, n, fences);
    }
}

void GL_APIENTRY FinishFenceNV(GLuint fence)
{
    EVENT("(GLuint fence = %u)", fence);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid = (context->skipValidation() || ValidateFinishFenceNV(context, fence));
        if (isCallValid)
        {
            context->finishFenceNV(fence);
        }
        ANGLE_CAPTURE(FinishFenceNV, isCallValid, context, fence);
    }
}

void GL_APIENTRY GenFencesNV(GLsizei n, GLuint *fences)
{
    EVENT("(GLsizei n = %d, GLuint *fences = 0x%016" PRIxPTR ")", n, (uintptr_t)fences);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid = (context->skipValidation() || ValidateGenFencesNV(context, n, fences));
        if (isCallValid)
        {
            context->genFencesNV(n, fences);
        }
        ANGLE_CAPTURE(GenFencesNV, isCallValid, context, n, fences);
    }
}

void GL_APIENTRY GetFenceivNV(GLuint fence, GLenum pname, GLint *params)
{
    EVENT("(GLuint fence = %u, GLenum pname = 0x%X, GLint *params = 0x%016" PRIxPTR ")", fence,
          pname, (uintptr_t)params);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() || ValidateGetFenceivNV(context, fence, pname, params));
        if (isCallValid)
        {
            context->getFenceivNV(fence, pname, params);
        }
        ANGLE_CAPTURE(GetFenceivNV, isCallValid, context, fence, pname, params);
    }
}

GLboolean GL_APIENTRY IsFenceNV(GLuint fence)
{
    EVENT("(GLuint fence = %u)", fence);

    Context *context = GetValidGlobalContext();
    GLboolean returnValue;
    if (context)
    {
        bool isCallValid = (context->skipValidation() || ValidateIsFenceNV(context, fence));
        if (isCallValid)
        {
            returnValue = context->isFenceNV(fence);
        }
        else
        {
            returnValue = GetDefaultReturnValue<EntryPoint::IsFenceNV, GLboolean>();
        }
        ANGLE_CAPTURE(IsFenceNV, isCallValid, context, fence, returnValue);
    }
    else
    {
        returnValue = GetDefaultReturnValue<EntryPoint::IsFenceNV, GLboolean>();
    }
    return returnValue;
}

void GL_APIENTRY SetFenceNV(GLuint fence, GLenum condition)
{
    EVENT("(GLuint fence = %u, GLenum condition = 0x%X)", fence, condition);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() || ValidateSetFenceNV(context, fence, condition));
        if (isCallValid)
        {
            context->setFenceNV(fence, condition);
        }
        ANGLE_CAPTURE(SetFenceNV, isCallValid, context, fence, condition);
    }
}

GLboolean GL_APIENTRY TestFenceNV(GLuint fence)
{
    EVENT("(GLuint fence = %u)", fence);

    Context *context = GetValidGlobalContext();
    GLboolean returnValue;
    if (context)
    {
        bool isCallValid = (context->skipValidation() || ValidateTestFenceNV(context, fence));
        if (isCallValid)
        {
            returnValue = context->testFenceNV(fence);
        }
        else
        {
            returnValue = GetDefaultReturnValue<EntryPoint::TestFenceNV, GLboolean>();
        }
        ANGLE_CAPTURE(TestFenceNV, isCallValid, context, fence, returnValue);
    }
    else
    {
        returnValue = GetDefaultReturnValue<EntryPoint::TestFenceNV, GLboolean>();
    }
    return returnValue;
}

// GL_OES_EGL_image
void GL_APIENTRY EGLImageTargetRenderbufferStorageOES(GLenum target, GLeglImageOES image)
{
    EVENT("(GLenum target = 0x%X, GLeglImageOES image = 0x%016" PRIxPTR ")", target,
          (uintptr_t)image);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid = (context->skipValidation() ||
                            ValidateEGLImageTargetRenderbufferStorageOES(context, target, image));
        if (isCallValid)
        {
            context->eGLImageTargetRenderbufferStorage(target, image);
        }
        ANGLE_CAPTURE(EGLImageTargetRenderbufferStorageOES, isCallValid, context, target, image);
    }
}

void GL_APIENTRY EGLImageTargetTexture2DOES(GLenum target, GLeglImageOES image)
{
    EVENT("(GLenum target = 0x%X, GLeglImageOES image = 0x%016" PRIxPTR ")", target,
          (uintptr_t)image);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        TextureType targetPacked = FromGLenum<TextureType>(target);
        bool isCallValid         = (context->skipValidation() ||
                            ValidateEGLImageTargetTexture2DOES(context, targetPacked, image));
        if (isCallValid)
        {
            context->eGLImageTargetTexture2D(targetPacked, image);
        }
        ANGLE_CAPTURE(EGLImageTargetTexture2DOES, isCallValid, context, targetPacked, image);
    }
}

// GL_OES_draw_texture
void GL_APIENTRY DrawTexfOES(GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height)
{
    EVENT(
        "(GLfloat x = %f, GLfloat y = %f, GLfloat z = %f, GLfloat width = %f, GLfloat height = %f)",
        x, y, z, width, height);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() || ValidateDrawTexfOES(context, x, y, z, width, height));
        if (isCallValid)
        {
            context->drawTexf(x, y, z, width, height);
        }
        ANGLE_CAPTURE(DrawTexfOES, isCallValid, context, x, y, z, width, height);
    }
}

void GL_APIENTRY DrawTexfvOES(const GLfloat *coords)
{
    EVENT("(const GLfloat *coords = 0x%016" PRIxPTR ")", (uintptr_t)coords);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid = (context->skipValidation() || ValidateDrawTexfvOES(context, coords));
        if (isCallValid)
        {
            context->drawTexfv(coords);
        }
        ANGLE_CAPTURE(DrawTexfvOES, isCallValid, context, coords);
    }
}

void GL_APIENTRY DrawTexiOES(GLint x, GLint y, GLint z, GLint width, GLint height)
{
    EVENT("(GLint x = %d, GLint y = %d, GLint z = %d, GLint width = %d, GLint height = %d)", x, y,
          z, width, height);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() || ValidateDrawTexiOES(context, x, y, z, width, height));
        if (isCallValid)
        {
            context->drawTexi(x, y, z, width, height);
        }
        ANGLE_CAPTURE(DrawTexiOES, isCallValid, context, x, y, z, width, height);
    }
}

void GL_APIENTRY DrawTexivOES(const GLint *coords)
{
    EVENT("(const GLint *coords = 0x%016" PRIxPTR ")", (uintptr_t)coords);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid = (context->skipValidation() || ValidateDrawTexivOES(context, coords));
        if (isCallValid)
        {
            context->drawTexiv(coords);
        }
        ANGLE_CAPTURE(DrawTexivOES, isCallValid, context, coords);
    }
}

void GL_APIENTRY DrawTexsOES(GLshort x, GLshort y, GLshort z, GLshort width, GLshort height)
{
    EVENT(
        "(GLshort x = %d, GLshort y = %d, GLshort z = %d, GLshort width = %d, GLshort height = %d)",
        x, y, z, width, height);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() || ValidateDrawTexsOES(context, x, y, z, width, height));
        if (isCallValid)
        {
            context->drawTexs(x, y, z, width, height);
        }
        ANGLE_CAPTURE(DrawTexsOES, isCallValid, context, x, y, z, width, height);
    }
}

void GL_APIENTRY DrawTexsvOES(const GLshort *coords)
{
    EVENT("(const GLshort *coords = 0x%016" PRIxPTR ")", (uintptr_t)coords);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid = (context->skipValidation() || ValidateDrawTexsvOES(context, coords));
        if (isCallValid)
        {
            context->drawTexsv(coords);
        }
        ANGLE_CAPTURE(DrawTexsvOES, isCallValid, context, coords);
    }
}

void GL_APIENTRY DrawTexxOES(GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height)
{
    EVENT(
        "(GLfixed x = 0x%X, GLfixed y = 0x%X, GLfixed z = 0x%X, GLfixed width = 0x%X, GLfixed "
        "height = 0x%X)",
        x, y, z, width, height);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() || ValidateDrawTexxOES(context, x, y, z, width, height));
        if (isCallValid)
        {
            context->drawTexx(x, y, z, width, height);
        }
        ANGLE_CAPTURE(DrawTexxOES, isCallValid, context, x, y, z, width, height);
    }
}

void GL_APIENTRY DrawTexxvOES(const GLfixed *coords)
{
    EVENT("(const GLfixed *coords = 0x%016" PRIxPTR ")", (uintptr_t)coords);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid = (context->skipValidation() || ValidateDrawTexxvOES(context, coords));
        if (isCallValid)
        {
            context->drawTexxv(coords);
        }
        ANGLE_CAPTURE(DrawTexxvOES, isCallValid, context, coords);
    }
}

// GL_OES_framebuffer_object
void GL_APIENTRY BindFramebufferOES(GLenum target, GLuint framebuffer)
{
    EVENT("(GLenum target = 0x%X, GLuint framebuffer = %u)", target, framebuffer);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() || ValidateBindFramebufferOES(context, target, framebuffer));
        if (isCallValid)
        {
            context->bindFramebuffer(target, framebuffer);
        }
        ANGLE_CAPTURE(BindFramebufferOES, isCallValid, context, target, framebuffer);
    }
}

void GL_APIENTRY BindRenderbufferOES(GLenum target, GLuint renderbuffer)
{
    EVENT("(GLenum target = 0x%X, GLuint renderbuffer = %u)", target, renderbuffer);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid = (context->skipValidation() ||
                            ValidateBindRenderbufferOES(context, target, renderbuffer));
        if (isCallValid)
        {
            context->bindRenderbuffer(target, renderbuffer);
        }
        ANGLE_CAPTURE(BindRenderbufferOES, isCallValid, context, target, renderbuffer);
    }
}

GLenum GL_APIENTRY CheckFramebufferStatusOES(GLenum target)
{
    EVENT("(GLenum target = 0x%X)", target);

    Context *context = GetValidGlobalContext();
    GLenum returnValue;
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() || ValidateCheckFramebufferStatusOES(context, target));
        if (isCallValid)
        {
            returnValue = context->checkFramebufferStatus(target);
        }
        else
        {
            returnValue = GetDefaultReturnValue<EntryPoint::CheckFramebufferStatusOES, GLenum>();
        }
        ANGLE_CAPTURE(CheckFramebufferStatusOES, isCallValid, context, target, returnValue);
    }
    else
    {
        returnValue = GetDefaultReturnValue<EntryPoint::CheckFramebufferStatusOES, GLenum>();
    }
    return returnValue;
}

void GL_APIENTRY DeleteFramebuffersOES(GLsizei n, const GLuint *framebuffers)
{
    EVENT("(GLsizei n = %d, const GLuint *framebuffers = 0x%016" PRIxPTR ")", n,
          (uintptr_t)framebuffers);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() || ValidateDeleteFramebuffersOES(context, n, framebuffers));
        if (isCallValid)
        {
            context->deleteFramebuffers(n, framebuffers);
        }
        ANGLE_CAPTURE(DeleteFramebuffersOES, isCallValid, context, n, framebuffers);
    }
}

void GL_APIENTRY DeleteRenderbuffersOES(GLsizei n, const GLuint *renderbuffers)
{
    EVENT("(GLsizei n = %d, const GLuint *renderbuffers = 0x%016" PRIxPTR ")", n,
          (uintptr_t)renderbuffers);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid = (context->skipValidation() ||
                            ValidateDeleteRenderbuffersOES(context, n, renderbuffers));
        if (isCallValid)
        {
            context->deleteRenderbuffers(n, renderbuffers);
        }
        ANGLE_CAPTURE(DeleteRenderbuffersOES, isCallValid, context, n, renderbuffers);
    }
}

void GL_APIENTRY FramebufferRenderbufferOES(GLenum target,
                                            GLenum attachment,
                                            GLenum renderbuffertarget,
                                            GLuint renderbuffer)
{
    EVENT(
        "(GLenum target = 0x%X, GLenum attachment = 0x%X, GLenum renderbuffertarget = 0x%X, GLuint "
        "renderbuffer = %u)",
        target, attachment, renderbuffertarget, renderbuffer);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid = (context->skipValidation() ||
                            ValidateFramebufferRenderbufferOES(context, target, attachment,
                                                               renderbuffertarget, renderbuffer));
        if (isCallValid)
        {
            context->framebufferRenderbuffer(target, attachment, renderbuffertarget, renderbuffer);
        }
        ANGLE_CAPTURE(FramebufferRenderbufferOES, isCallValid, context, target, attachment,
                      renderbuffertarget, renderbuffer);
    }
}

void GL_APIENTRY FramebufferTexture2DOES(GLenum target,
                                         GLenum attachment,
                                         GLenum textarget,
                                         GLuint texture,
                                         GLint level)
{
    EVENT(
        "(GLenum target = 0x%X, GLenum attachment = 0x%X, GLenum textarget = 0x%X, GLuint texture "
        "= %u, GLint level = %d)",
        target, attachment, textarget, texture, level);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        TextureTarget textargetPacked = FromGLenum<TextureTarget>(textarget);
        bool isCallValid              = (context->skipValidation() ||
                            ValidateFramebufferTexture2DOES(context, target, attachment,
                                                            textargetPacked, texture, level));
        if (isCallValid)
        {
            context->framebufferTexture2D(target, attachment, textargetPacked, texture, level);
        }
        ANGLE_CAPTURE(FramebufferTexture2DOES, isCallValid, context, target, attachment,
                      textargetPacked, texture, level);
    }
}

void GL_APIENTRY GenFramebuffersOES(GLsizei n, GLuint *framebuffers)
{
    EVENT("(GLsizei n = %d, GLuint *framebuffers = 0x%016" PRIxPTR ")", n, (uintptr_t)framebuffers);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() || ValidateGenFramebuffersOES(context, n, framebuffers));
        if (isCallValid)
        {
            context->genFramebuffers(n, framebuffers);
        }
        ANGLE_CAPTURE(GenFramebuffersOES, isCallValid, context, n, framebuffers);
    }
}

void GL_APIENTRY GenRenderbuffersOES(GLsizei n, GLuint *renderbuffers)
{
    EVENT("(GLsizei n = %d, GLuint *renderbuffers = 0x%016" PRIxPTR ")", n,
          (uintptr_t)renderbuffers);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() || ValidateGenRenderbuffersOES(context, n, renderbuffers));
        if (isCallValid)
        {
            context->genRenderbuffers(n, renderbuffers);
        }
        ANGLE_CAPTURE(GenRenderbuffersOES, isCallValid, context, n, renderbuffers);
    }
}

void GL_APIENTRY GenerateMipmapOES(GLenum target)
{
    EVENT("(GLenum target = 0x%X)", target);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        TextureType targetPacked = FromGLenum<TextureType>(target);
        bool isCallValid =
            (context->skipValidation() || ValidateGenerateMipmapOES(context, targetPacked));
        if (isCallValid)
        {
            context->generateMipmap(targetPacked);
        }
        ANGLE_CAPTURE(GenerateMipmapOES, isCallValid, context, targetPacked);
    }
}

void GL_APIENTRY GetFramebufferAttachmentParameterivOES(GLenum target,
                                                        GLenum attachment,
                                                        GLenum pname,
                                                        GLint *params)
{
    EVENT(
        "(GLenum target = 0x%X, GLenum attachment = 0x%X, GLenum pname = 0x%X, GLint *params = "
        "0x%016" PRIxPTR ")",
        target, attachment, pname, (uintptr_t)params);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() || ValidateGetFramebufferAttachmentParameterivOES(
                                              context, target, attachment, pname, params));
        if (isCallValid)
        {
            context->getFramebufferAttachmentParameteriv(target, attachment, pname, params);
        }
        ANGLE_CAPTURE(GetFramebufferAttachmentParameterivOES, isCallValid, context, target,
                      attachment, pname, params);
    }
}

void GL_APIENTRY GetRenderbufferParameterivOES(GLenum target, GLenum pname, GLint *params)
{
    EVENT("(GLenum target = 0x%X, GLenum pname = 0x%X, GLint *params = 0x%016" PRIxPTR ")", target,
          pname, (uintptr_t)params);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid = (context->skipValidation() ||
                            ValidateGetRenderbufferParameterivOES(context, target, pname, params));
        if (isCallValid)
        {
            context->getRenderbufferParameteriv(target, pname, params);
        }
        ANGLE_CAPTURE(GetRenderbufferParameterivOES, isCallValid, context, target, pname, params);
    }
}

GLboolean GL_APIENTRY IsFramebufferOES(GLuint framebuffer)
{
    EVENT("(GLuint framebuffer = %u)", framebuffer);

    Context *context = GetValidGlobalContext();
    GLboolean returnValue;
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() || ValidateIsFramebufferOES(context, framebuffer));
        if (isCallValid)
        {
            returnValue = context->isFramebuffer(framebuffer);
        }
        else
        {
            returnValue = GetDefaultReturnValue<EntryPoint::IsFramebufferOES, GLboolean>();
        }
        ANGLE_CAPTURE(IsFramebufferOES, isCallValid, context, framebuffer, returnValue);
    }
    else
    {
        returnValue = GetDefaultReturnValue<EntryPoint::IsFramebufferOES, GLboolean>();
    }
    return returnValue;
}

GLboolean GL_APIENTRY IsRenderbufferOES(GLuint renderbuffer)
{
    EVENT("(GLuint renderbuffer = %u)", renderbuffer);

    Context *context = GetValidGlobalContext();
    GLboolean returnValue;
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() || ValidateIsRenderbufferOES(context, renderbuffer));
        if (isCallValid)
        {
            returnValue = context->isRenderbuffer(renderbuffer);
        }
        else
        {
            returnValue = GetDefaultReturnValue<EntryPoint::IsRenderbufferOES, GLboolean>();
        }
        ANGLE_CAPTURE(IsRenderbufferOES, isCallValid, context, renderbuffer, returnValue);
    }
    else
    {
        returnValue = GetDefaultReturnValue<EntryPoint::IsRenderbufferOES, GLboolean>();
    }
    return returnValue;
}

void GL_APIENTRY RenderbufferStorageOES(GLenum target,
                                        GLenum internalformat,
                                        GLsizei width,
                                        GLsizei height)
{
    EVENT(
        "(GLenum target = 0x%X, GLenum internalformat = 0x%X, GLsizei width = %d, GLsizei height = "
        "%d)",
        target, internalformat, width, height);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() ||
             ValidateRenderbufferStorageOES(context, target, internalformat, width, height));
        if (isCallValid)
        {
            context->renderbufferStorage(target, internalformat, width, height);
        }
        ANGLE_CAPTURE(RenderbufferStorageOES, isCallValid, context, target, internalformat, width,
                      height);
    }
}

// GL_OES_get_program_binary
void GL_APIENTRY GetProgramBinaryOES(GLuint program,
                                     GLsizei bufSize,
                                     GLsizei *length,
                                     GLenum *binaryFormat,
                                     void *binary)
{
    EVENT("(GLuint program = %u, GLsizei bufSize = %d, GLsizei *length = 0x%016" PRIxPTR
          ", GLenum *binaryFormat = 0x%016" PRIxPTR ", void *binary = 0x%016" PRIxPTR ")",
          program, bufSize, (uintptr_t)length, (uintptr_t)binaryFormat, (uintptr_t)binary);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() ||
             ValidateGetProgramBinaryOES(context, program, bufSize, length, binaryFormat, binary));
        if (isCallValid)
        {
            context->getProgramBinary(program, bufSize, length, binaryFormat, binary);
        }
        ANGLE_CAPTURE(GetProgramBinaryOES, isCallValid, context, program, bufSize, length,
                      binaryFormat, binary);
    }
}

void GL_APIENTRY ProgramBinaryOES(GLuint program,
                                  GLenum binaryFormat,
                                  const void *binary,
                                  GLint length)
{
    EVENT("(GLuint program = %u, GLenum binaryFormat = 0x%X, const void *binary = 0x%016" PRIxPTR
          ", GLint length = %d)",
          program, binaryFormat, (uintptr_t)binary, length);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() ||
             ValidateProgramBinaryOES(context, program, binaryFormat, binary, length));
        if (isCallValid)
        {
            context->programBinary(program, binaryFormat, binary, length);
        }
        ANGLE_CAPTURE(ProgramBinaryOES, isCallValid, context, program, binaryFormat, binary,
                      length);
    }
}

// GL_OES_mapbuffer
void GL_APIENTRY GetBufferPointervOES(GLenum target, GLenum pname, void **params)
{
    EVENT("(GLenum target = 0x%X, GLenum pname = 0x%X, void **params = 0x%016" PRIxPTR ")", target,
          pname, (uintptr_t)params);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        BufferBinding targetPacked = FromGLenum<BufferBinding>(target);
        bool isCallValid           = (context->skipValidation() ||
                            ValidateGetBufferPointervOES(context, targetPacked, pname, params));
        if (isCallValid)
        {
            context->getBufferPointerv(targetPacked, pname, params);
        }
        ANGLE_CAPTURE(GetBufferPointervOES, isCallValid, context, targetPacked, pname, params);
    }
}

void *GL_APIENTRY MapBufferOES(GLenum target, GLenum access)
{
    EVENT("(GLenum target = 0x%X, GLenum access = 0x%X)", target, access);

    Context *context = GetValidGlobalContext();
    void *returnValue;
    if (context)
    {
        BufferBinding targetPacked = FromGLenum<BufferBinding>(target);
        bool isCallValid =
            (context->skipValidation() || ValidateMapBufferOES(context, targetPacked, access));
        if (isCallValid)
        {
            returnValue = context->mapBuffer(targetPacked, access);
        }
        else
        {
            returnValue = GetDefaultReturnValue<EntryPoint::MapBufferOES, void *>();
        }
        ANGLE_CAPTURE(MapBufferOES, isCallValid, context, targetPacked, access, returnValue);
    }
    else
    {
        returnValue = GetDefaultReturnValue<EntryPoint::MapBufferOES, void *>();
    }
    return returnValue;
}

GLboolean GL_APIENTRY UnmapBufferOES(GLenum target)
{
    EVENT("(GLenum target = 0x%X)", target);

    Context *context = GetValidGlobalContext();
    GLboolean returnValue;
    if (context)
    {
        BufferBinding targetPacked = FromGLenum<BufferBinding>(target);
        bool isCallValid =
            (context->skipValidation() || ValidateUnmapBufferOES(context, targetPacked));
        if (isCallValid)
        {
            returnValue = context->unmapBuffer(targetPacked);
        }
        else
        {
            returnValue = GetDefaultReturnValue<EntryPoint::UnmapBufferOES, GLboolean>();
        }
        ANGLE_CAPTURE(UnmapBufferOES, isCallValid, context, targetPacked, returnValue);
    }
    else
    {
        returnValue = GetDefaultReturnValue<EntryPoint::UnmapBufferOES, GLboolean>();
    }
    return returnValue;
}

// GL_OES_matrix_palette
void GL_APIENTRY CurrentPaletteMatrixOES(GLuint matrixpaletteindex)
{
    EVENT("(GLuint matrixpaletteindex = %u)", matrixpaletteindex);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid = (context->skipValidation() ||
                            ValidateCurrentPaletteMatrixOES(context, matrixpaletteindex));
        if (isCallValid)
        {
            context->currentPaletteMatrix(matrixpaletteindex);
        }
        ANGLE_CAPTURE(CurrentPaletteMatrixOES, isCallValid, context, matrixpaletteindex);
    }
}

void GL_APIENTRY LoadPaletteFromModelViewMatrixOES()
{
    EVENT("()");

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() || ValidateLoadPaletteFromModelViewMatrixOES(context));
        if (isCallValid)
        {
            context->loadPaletteFromModelViewMatrix();
        }
        ANGLE_CAPTURE(LoadPaletteFromModelViewMatrixOES, isCallValid, context);
    }
}

void GL_APIENTRY MatrixIndexPointerOES(GLint size, GLenum type, GLsizei stride, const void *pointer)
{
    EVENT(
        "(GLint size = %d, GLenum type = 0x%X, GLsizei stride = %d, const void *pointer = "
        "0x%016" PRIxPTR ")",
        size, type, stride, (uintptr_t)pointer);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid = (context->skipValidation() ||
                            ValidateMatrixIndexPointerOES(context, size, type, stride, pointer));
        if (isCallValid)
        {
            context->matrixIndexPointer(size, type, stride, pointer);
        }
        ANGLE_CAPTURE(MatrixIndexPointerOES, isCallValid, context, size, type, stride, pointer);
    }
}

void GL_APIENTRY WeightPointerOES(GLint size, GLenum type, GLsizei stride, const void *pointer)
{
    EVENT(
        "(GLint size = %d, GLenum type = 0x%X, GLsizei stride = %d, const void *pointer = "
        "0x%016" PRIxPTR ")",
        size, type, stride, (uintptr_t)pointer);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid = (context->skipValidation() ||
                            ValidateWeightPointerOES(context, size, type, stride, pointer));
        if (isCallValid)
        {
            context->weightPointer(size, type, stride, pointer);
        }
        ANGLE_CAPTURE(WeightPointerOES, isCallValid, context, size, type, stride, pointer);
    }
}

// GL_OES_point_size_array
void GL_APIENTRY PointSizePointerOES(GLenum type, GLsizei stride, const void *pointer)
{
    EVENT("(GLenum type = 0x%X, GLsizei stride = %d, const void *pointer = 0x%016" PRIxPTR ")",
          type, stride, (uintptr_t)pointer);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        VertexAttribType typePacked = FromGLenum<VertexAttribType>(type);
        bool isCallValid            = (context->skipValidation() ||
                            ValidatePointSizePointerOES(context, typePacked, stride, pointer));
        if (isCallValid)
        {
            context->pointSizePointer(typePacked, stride, pointer);
        }
        ANGLE_CAPTURE(PointSizePointerOES, isCallValid, context, typePacked, stride, pointer);
    }
}

// GL_OES_query_matrix
GLbitfield GL_APIENTRY QueryMatrixxOES(GLfixed *mantissa, GLint *exponent)
{
    EVENT("(GLfixed *mantissa = 0x%016" PRIxPTR ", GLint *exponent = 0x%016" PRIxPTR ")",
          (uintptr_t)mantissa, (uintptr_t)exponent);

    Context *context = GetValidGlobalContext();
    GLbitfield returnValue;
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() || ValidateQueryMatrixxOES(context, mantissa, exponent));
        if (isCallValid)
        {
            returnValue = context->queryMatrixx(mantissa, exponent);
        }
        else
        {
            returnValue = GetDefaultReturnValue<EntryPoint::QueryMatrixxOES, GLbitfield>();
        }
        ANGLE_CAPTURE(QueryMatrixxOES, isCallValid, context, mantissa, exponent, returnValue);
    }
    else
    {
        returnValue = GetDefaultReturnValue<EntryPoint::QueryMatrixxOES, GLbitfield>();
    }
    return returnValue;
}

// GL_OES_texture_3D
void GL_APIENTRY CompressedTexImage3DOES(GLenum target,
                                         GLint level,
                                         GLenum internalformat,
                                         GLsizei width,
                                         GLsizei height,
                                         GLsizei depth,
                                         GLint border,
                                         GLsizei imageSize,
                                         const void *data)
{
    EVENT(
        "(GLenum target = 0x%X, GLint level = %d, GLenum internalformat = 0x%X, GLsizei width = "
        "%d, GLsizei height = %d, GLsizei depth = %d, GLint border = %d, GLsizei imageSize = %d, "
        "const void *data = 0x%016" PRIxPTR ")",
        target, level, internalformat, width, height, depth, border, imageSize, (uintptr_t)data);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        TextureTarget targetPacked = FromGLenum<TextureTarget>(target);
        bool isCallValid =
            (context->skipValidation() ||
             ValidateCompressedTexImage3DOES(context, targetPacked, level, internalformat, width,
                                             height, depth, border, imageSize, data));
        if (isCallValid)
        {
            context->compressedTexImage3D(targetPacked, level, internalformat, width, height, depth,
                                          border, imageSize, data);
        }
        ANGLE_CAPTURE(CompressedTexImage3DOES, isCallValid, context, targetPacked, level,
                      internalformat, width, height, depth, border, imageSize, data);
    }
}

void GL_APIENTRY CompressedTexSubImage3DOES(GLenum target,
                                            GLint level,
                                            GLint xoffset,
                                            GLint yoffset,
                                            GLint zoffset,
                                            GLsizei width,
                                            GLsizei height,
                                            GLsizei depth,
                                            GLenum format,
                                            GLsizei imageSize,
                                            const void *data)
{
    EVENT(
        "(GLenum target = 0x%X, GLint level = %d, GLint xoffset = %d, GLint yoffset = %d, GLint "
        "zoffset = %d, GLsizei width = %d, GLsizei height = %d, GLsizei depth = %d, GLenum format "
        "= 0x%X, GLsizei imageSize = %d, const void *data = 0x%016" PRIxPTR ")",
        target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize,
        (uintptr_t)data);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        TextureTarget targetPacked = FromGLenum<TextureTarget>(target);
        bool isCallValid           = (context->skipValidation() ||
                            ValidateCompressedTexSubImage3DOES(
                                context, targetPacked, level, xoffset, yoffset, zoffset, width,
                                height, depth, format, imageSize, data));
        if (isCallValid)
        {
            context->compressedTexSubImage3D(targetPacked, level, xoffset, yoffset, zoffset, width,
                                             height, depth, format, imageSize, data);
        }
        ANGLE_CAPTURE(CompressedTexSubImage3DOES, isCallValid, context, targetPacked, level,
                      xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data);
    }
}

void GL_APIENTRY CopyTexSubImage3DOES(GLenum target,
                                      GLint level,
                                      GLint xoffset,
                                      GLint yoffset,
                                      GLint zoffset,
                                      GLint x,
                                      GLint y,
                                      GLsizei width,
                                      GLsizei height)
{
    EVENT(
        "(GLenum target = 0x%X, GLint level = %d, GLint xoffset = %d, GLint yoffset = %d, GLint "
        "zoffset = %d, GLint x = %d, GLint y = %d, GLsizei width = %d, GLsizei height = %d)",
        target, level, xoffset, yoffset, zoffset, x, y, width, height);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        TextureTarget targetPacked = FromGLenum<TextureTarget>(target);
        bool isCallValid           = (context->skipValidation() ||
                            ValidateCopyTexSubImage3DOES(context, targetPacked, level, xoffset,
                                                         yoffset, zoffset, x, y, width, height));
        if (isCallValid)
        {
            context->copyTexSubImage3D(targetPacked, level, xoffset, yoffset, zoffset, x, y, width,
                                       height);
        }
        ANGLE_CAPTURE(CopyTexSubImage3DOES, isCallValid, context, targetPacked, level, xoffset,
                      yoffset, zoffset, x, y, width, height);
    }
}

void GL_APIENTRY FramebufferTexture3DOES(GLenum target,
                                         GLenum attachment,
                                         GLenum textarget,
                                         GLuint texture,
                                         GLint level,
                                         GLint zoffset)
{
    EVENT(
        "(GLenum target = 0x%X, GLenum attachment = 0x%X, GLenum textarget = 0x%X, GLuint texture "
        "= %u, GLint level = %d, GLint zoffset = %d)",
        target, attachment, textarget, texture, level, zoffset);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        TextureTarget textargetPacked = FromGLenum<TextureTarget>(textarget);
        bool isCallValid =
            (context->skipValidation() ||
             ValidateFramebufferTexture3DOES(context, target, attachment, textargetPacked, texture,
                                             level, zoffset));
        if (isCallValid)
        {
            context->framebufferTexture3D(target, attachment, textargetPacked, texture, level,
                                          zoffset);
        }
        ANGLE_CAPTURE(FramebufferTexture3DOES, isCallValid, context, target, attachment,
                      textargetPacked, texture, level, zoffset);
    }
}

void GL_APIENTRY TexImage3DOES(GLenum target,
                               GLint level,
                               GLenum internalformat,
                               GLsizei width,
                               GLsizei height,
                               GLsizei depth,
                               GLint border,
                               GLenum format,
                               GLenum type,
                               const void *pixels)
{
    EVENT(
        "(GLenum target = 0x%X, GLint level = %d, GLenum internalformat = 0x%X, GLsizei width = "
        "%d, GLsizei height = %d, GLsizei depth = %d, GLint border = %d, GLenum format = 0x%X, "
        "GLenum type = 0x%X, const void *pixels = 0x%016" PRIxPTR ")",
        target, level, internalformat, width, height, depth, border, format, type,
        (uintptr_t)pixels);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        TextureTarget targetPacked = FromGLenum<TextureTarget>(target);
        bool isCallValid =
            (context->skipValidation() ||
             ValidateTexImage3DOES(context, targetPacked, level, internalformat, width, height,
                                   depth, border, format, type, pixels));
        if (isCallValid)
        {
            context->texImage3D(targetPacked, level, internalformat, width, height, depth, border,
                                format, type, pixels);
        }
        ANGLE_CAPTURE(TexImage3DOES, isCallValid, context, targetPacked, level, internalformat,
                      width, height, depth, border, format, type, pixels);
    }
}

void GL_APIENTRY TexSubImage3DOES(GLenum target,
                                  GLint level,
                                  GLint xoffset,
                                  GLint yoffset,
                                  GLint zoffset,
                                  GLsizei width,
                                  GLsizei height,
                                  GLsizei depth,
                                  GLenum format,
                                  GLenum type,
                                  const void *pixels)
{
    EVENT(
        "(GLenum target = 0x%X, GLint level = %d, GLint xoffset = %d, GLint yoffset = %d, GLint "
        "zoffset = %d, GLsizei width = %d, GLsizei height = %d, GLsizei depth = %d, GLenum format "
        "= 0x%X, GLenum type = 0x%X, const void *pixels = 0x%016" PRIxPTR ")",
        target, level, xoffset, yoffset, zoffset, width, height, depth, format, type,
        (uintptr_t)pixels);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        TextureTarget targetPacked = FromGLenum<TextureTarget>(target);
        bool isCallValid =
            (context->skipValidation() ||
             ValidateTexSubImage3DOES(context, targetPacked, level, xoffset, yoffset, zoffset,
                                      width, height, depth, format, type, pixels));
        if (isCallValid)
        {
            context->texSubImage3D(targetPacked, level, xoffset, yoffset, zoffset, width, height,
                                   depth, format, type, pixels);
        }
        ANGLE_CAPTURE(TexSubImage3DOES, isCallValid, context, targetPacked, level, xoffset, yoffset,
                      zoffset, width, height, depth, format, type, pixels);
    }
}

// GL_OES_texture_border_clamp
void GL_APIENTRY GetSamplerParameterIivOES(GLuint sampler, GLenum pname, GLint *params)
{
    EVENT("(GLuint sampler = %u, GLenum pname = 0x%X, GLint *params = 0x%016" PRIxPTR ")", sampler,
          pname, (uintptr_t)params);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid = (context->skipValidation() ||
                            ValidateGetSamplerParameterIivOES(context, sampler, pname, params));
        if (isCallValid)
        {
            context->getSamplerParameterIiv(sampler, pname, params);
        }
        ANGLE_CAPTURE(GetSamplerParameterIivOES, isCallValid, context, sampler, pname, params);
    }
}

void GL_APIENTRY GetSamplerParameterIuivOES(GLuint sampler, GLenum pname, GLuint *params)
{
    EVENT("(GLuint sampler = %u, GLenum pname = 0x%X, GLuint *params = 0x%016" PRIxPTR ")", sampler,
          pname, (uintptr_t)params);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid = (context->skipValidation() ||
                            ValidateGetSamplerParameterIuivOES(context, sampler, pname, params));
        if (isCallValid)
        {
            context->getSamplerParameterIuiv(sampler, pname, params);
        }
        ANGLE_CAPTURE(GetSamplerParameterIuivOES, isCallValid, context, sampler, pname, params);
    }
}

void GL_APIENTRY GetTexParameterIivOES(GLenum target, GLenum pname, GLint *params)
{
    EVENT("(GLenum target = 0x%X, GLenum pname = 0x%X, GLint *params = 0x%016" PRIxPTR ")", target,
          pname, (uintptr_t)params);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        TextureType targetPacked = FromGLenum<TextureType>(target);
        bool isCallValid         = (context->skipValidation() ||
                            ValidateGetTexParameterIivOES(context, targetPacked, pname, params));
        if (isCallValid)
        {
            context->getTexParameterIiv(targetPacked, pname, params);
        }
        ANGLE_CAPTURE(GetTexParameterIivOES, isCallValid, context, targetPacked, pname, params);
    }
}

void GL_APIENTRY GetTexParameterIuivOES(GLenum target, GLenum pname, GLuint *params)
{
    EVENT("(GLenum target = 0x%X, GLenum pname = 0x%X, GLuint *params = 0x%016" PRIxPTR ")", target,
          pname, (uintptr_t)params);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        TextureType targetPacked = FromGLenum<TextureType>(target);
        bool isCallValid         = (context->skipValidation() ||
                            ValidateGetTexParameterIuivOES(context, targetPacked, pname, params));
        if (isCallValid)
        {
            context->getTexParameterIuiv(targetPacked, pname, params);
        }
        ANGLE_CAPTURE(GetTexParameterIuivOES, isCallValid, context, targetPacked, pname, params);
    }
}

void GL_APIENTRY SamplerParameterIivOES(GLuint sampler, GLenum pname, const GLint *param)
{
    EVENT("(GLuint sampler = %u, GLenum pname = 0x%X, const GLint *param = 0x%016" PRIxPTR ")",
          sampler, pname, (uintptr_t)param);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid = (context->skipValidation() ||
                            ValidateSamplerParameterIivOES(context, sampler, pname, param));
        if (isCallValid)
        {
            context->samplerParameterIiv(sampler, pname, param);
        }
        ANGLE_CAPTURE(SamplerParameterIivOES, isCallValid, context, sampler, pname, param);
    }
}

void GL_APIENTRY SamplerParameterIuivOES(GLuint sampler, GLenum pname, const GLuint *param)
{
    EVENT("(GLuint sampler = %u, GLenum pname = 0x%X, const GLuint *param = 0x%016" PRIxPTR ")",
          sampler, pname, (uintptr_t)param);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid = (context->skipValidation() ||
                            ValidateSamplerParameterIuivOES(context, sampler, pname, param));
        if (isCallValid)
        {
            context->samplerParameterIuiv(sampler, pname, param);
        }
        ANGLE_CAPTURE(SamplerParameterIuivOES, isCallValid, context, sampler, pname, param);
    }
}

void GL_APIENTRY TexParameterIivOES(GLenum target, GLenum pname, const GLint *params)
{
    EVENT("(GLenum target = 0x%X, GLenum pname = 0x%X, const GLint *params = 0x%016" PRIxPTR ")",
          target, pname, (uintptr_t)params);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        TextureType targetPacked = FromGLenum<TextureType>(target);
        bool isCallValid         = (context->skipValidation() ||
                            ValidateTexParameterIivOES(context, targetPacked, pname, params));
        if (isCallValid)
        {
            context->texParameterIiv(targetPacked, pname, params);
        }
        ANGLE_CAPTURE(TexParameterIivOES, isCallValid, context, targetPacked, pname, params);
    }
}

void GL_APIENTRY TexParameterIuivOES(GLenum target, GLenum pname, const GLuint *params)
{
    EVENT("(GLenum target = 0x%X, GLenum pname = 0x%X, const GLuint *params = 0x%016" PRIxPTR ")",
          target, pname, (uintptr_t)params);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        TextureType targetPacked = FromGLenum<TextureType>(target);
        bool isCallValid         = (context->skipValidation() ||
                            ValidateTexParameterIuivOES(context, targetPacked, pname, params));
        if (isCallValid)
        {
            context->texParameterIuiv(targetPacked, pname, params);
        }
        ANGLE_CAPTURE(TexParameterIuivOES, isCallValid, context, targetPacked, pname, params);
    }
}

// GL_OES_texture_cube_map
void GL_APIENTRY GetTexGenfvOES(GLenum coord, GLenum pname, GLfloat *params)
{
    EVENT("(GLenum coord = 0x%X, GLenum pname = 0x%X, GLfloat *params = 0x%016" PRIxPTR ")", coord,
          pname, (uintptr_t)params);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() || ValidateGetTexGenfvOES(context, coord, pname, params));
        if (isCallValid)
        {
            context->getTexGenfv(coord, pname, params);
        }
        ANGLE_CAPTURE(GetTexGenfvOES, isCallValid, context, coord, pname, params);
    }
}

void GL_APIENTRY GetTexGenivOES(GLenum coord, GLenum pname, GLint *params)
{
    EVENT("(GLenum coord = 0x%X, GLenum pname = 0x%X, GLint *params = 0x%016" PRIxPTR ")", coord,
          pname, (uintptr_t)params);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() || ValidateGetTexGenivOES(context, coord, pname, params));
        if (isCallValid)
        {
            context->getTexGeniv(coord, pname, params);
        }
        ANGLE_CAPTURE(GetTexGenivOES, isCallValid, context, coord, pname, params);
    }
}

void GL_APIENTRY GetTexGenxvOES(GLenum coord, GLenum pname, GLfixed *params)
{
    EVENT("(GLenum coord = 0x%X, GLenum pname = 0x%X, GLfixed *params = 0x%016" PRIxPTR ")", coord,
          pname, (uintptr_t)params);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() || ValidateGetTexGenxvOES(context, coord, pname, params));
        if (isCallValid)
        {
            context->getTexGenxv(coord, pname, params);
        }
        ANGLE_CAPTURE(GetTexGenxvOES, isCallValid, context, coord, pname, params);
    }
}

void GL_APIENTRY TexGenfOES(GLenum coord, GLenum pname, GLfloat param)
{
    EVENT("(GLenum coord = 0x%X, GLenum pname = 0x%X, GLfloat param = %f)", coord, pname, param);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() || ValidateTexGenfOES(context, coord, pname, param));
        if (isCallValid)
        {
            context->texGenf(coord, pname, param);
        }
        ANGLE_CAPTURE(TexGenfOES, isCallValid, context, coord, pname, param);
    }
}

void GL_APIENTRY TexGenfvOES(GLenum coord, GLenum pname, const GLfloat *params)
{
    EVENT("(GLenum coord = 0x%X, GLenum pname = 0x%X, const GLfloat *params = 0x%016" PRIxPTR ")",
          coord, pname, (uintptr_t)params);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() || ValidateTexGenfvOES(context, coord, pname, params));
        if (isCallValid)
        {
            context->texGenfv(coord, pname, params);
        }
        ANGLE_CAPTURE(TexGenfvOES, isCallValid, context, coord, pname, params);
    }
}

void GL_APIENTRY TexGeniOES(GLenum coord, GLenum pname, GLint param)
{
    EVENT("(GLenum coord = 0x%X, GLenum pname = 0x%X, GLint param = %d)", coord, pname, param);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() || ValidateTexGeniOES(context, coord, pname, param));
        if (isCallValid)
        {
            context->texGeni(coord, pname, param);
        }
        ANGLE_CAPTURE(TexGeniOES, isCallValid, context, coord, pname, param);
    }
}

void GL_APIENTRY TexGenivOES(GLenum coord, GLenum pname, const GLint *params)
{
    EVENT("(GLenum coord = 0x%X, GLenum pname = 0x%X, const GLint *params = 0x%016" PRIxPTR ")",
          coord, pname, (uintptr_t)params);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() || ValidateTexGenivOES(context, coord, pname, params));
        if (isCallValid)
        {
            context->texGeniv(coord, pname, params);
        }
        ANGLE_CAPTURE(TexGenivOES, isCallValid, context, coord, pname, params);
    }
}

void GL_APIENTRY TexGenxOES(GLenum coord, GLenum pname, GLfixed param)
{
    EVENT("(GLenum coord = 0x%X, GLenum pname = 0x%X, GLfixed param = 0x%X)", coord, pname, param);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() || ValidateTexGenxOES(context, coord, pname, param));
        if (isCallValid)
        {
            context->texGenx(coord, pname, param);
        }
        ANGLE_CAPTURE(TexGenxOES, isCallValid, context, coord, pname, param);
    }
}

void GL_APIENTRY TexGenxvOES(GLenum coord, GLenum pname, const GLfixed *params)
{
    EVENT("(GLenum coord = 0x%X, GLenum pname = 0x%X, const GLfixed *params = 0x%016" PRIxPTR ")",
          coord, pname, (uintptr_t)params);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() || ValidateTexGenxvOES(context, coord, pname, params));
        if (isCallValid)
        {
            context->texGenxv(coord, pname, params);
        }
        ANGLE_CAPTURE(TexGenxvOES, isCallValid, context, coord, pname, params);
    }
}

// GL_OES_texture_storage_multisample_2d_array
void GL_APIENTRY TexStorage3DMultisampleOES(GLenum target,
                                            GLsizei samples,
                                            GLenum internalformat,
                                            GLsizei width,
                                            GLsizei height,
                                            GLsizei depth,
                                            GLboolean fixedsamplelocations)
{
    EVENT(
        "(GLenum target = 0x%X, GLsizei samples = %d, GLenum internalformat = 0x%X, GLsizei width "
        "= %d, GLsizei height = %d, GLsizei depth = %d, GLboolean fixedsamplelocations = %u)",
        target, samples, internalformat, width, height, depth, fixedsamplelocations);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        TextureType targetPacked = FromGLenum<TextureType>(target);
        bool isCallValid =
            (context->skipValidation() ||
             ValidateTexStorage3DMultisampleOES(context, targetPacked, samples, internalformat,
                                                width, height, depth, fixedsamplelocations));
        if (isCallValid)
        {
            context->texStorage3DMultisample(targetPacked, samples, internalformat, width, height,
                                             depth, fixedsamplelocations);
        }
        ANGLE_CAPTURE(TexStorage3DMultisampleOES, isCallValid, context, targetPacked, samples,
                      internalformat, width, height, depth, fixedsamplelocations);
    }
}

// GL_OES_vertex_array_object
void GL_APIENTRY BindVertexArrayOES(GLuint array)
{
    EVENT("(GLuint array = %u)", array);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() || ValidateBindVertexArrayOES(context, array));
        if (isCallValid)
        {
            context->bindVertexArray(array);
        }
        ANGLE_CAPTURE(BindVertexArrayOES, isCallValid, context, array);
    }
}

void GL_APIENTRY DeleteVertexArraysOES(GLsizei n, const GLuint *arrays)
{
    EVENT("(GLsizei n = %d, const GLuint *arrays = 0x%016" PRIxPTR ")", n, (uintptr_t)arrays);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() || ValidateDeleteVertexArraysOES(context, n, arrays));
        if (isCallValid)
        {
            context->deleteVertexArrays(n, arrays);
        }
        ANGLE_CAPTURE(DeleteVertexArraysOES, isCallValid, context, n, arrays);
    }
}

void GL_APIENTRY GenVertexArraysOES(GLsizei n, GLuint *arrays)
{
    EVENT("(GLsizei n = %d, GLuint *arrays = 0x%016" PRIxPTR ")", n, (uintptr_t)arrays);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid =
            (context->skipValidation() || ValidateGenVertexArraysOES(context, n, arrays));
        if (isCallValid)
        {
            context->genVertexArrays(n, arrays);
        }
        ANGLE_CAPTURE(GenVertexArraysOES, isCallValid, context, n, arrays);
    }
}

GLboolean GL_APIENTRY IsVertexArrayOES(GLuint array)
{
    EVENT("(GLuint array = %u)", array);

    Context *context = GetValidGlobalContext();
    GLboolean returnValue;
    if (context)
    {
        bool isCallValid = (context->skipValidation() || ValidateIsVertexArrayOES(context, array));
        if (isCallValid)
        {
            returnValue = context->isVertexArray(array);
        }
        else
        {
            returnValue = GetDefaultReturnValue<EntryPoint::IsVertexArrayOES, GLboolean>();
        }
        ANGLE_CAPTURE(IsVertexArrayOES, isCallValid, context, array, returnValue);
    }
    else
    {
        returnValue = GetDefaultReturnValue<EntryPoint::IsVertexArrayOES, GLboolean>();
    }
    return returnValue;
}

// GL_OVR_multiview
void GL_APIENTRY FramebufferTextureMultiviewOVR(GLenum target,
                                                GLenum attachment,
                                                GLuint texture,
                                                GLint level,
                                                GLint baseViewIndex,
                                                GLsizei numViews)
{
    EVENT(
        "(GLenum target = 0x%X, GLenum attachment = 0x%X, GLuint texture = %u, GLint level = %d, "
        "GLint baseViewIndex = %d, GLsizei numViews = %d)",
        target, attachment, texture, level, baseViewIndex, numViews);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        bool isCallValid = (context->skipValidation() || ValidateFramebufferTextureMultiviewOVR(
                                                             context, target, attachment, texture,
                                                             level, baseViewIndex, numViews));
        if (isCallValid)
        {
            context->framebufferTextureMultiview(target, attachment, texture, level, baseViewIndex,
                                                 numViews);
        }
        ANGLE_CAPTURE(FramebufferTextureMultiviewOVR, isCallValid, context, target, attachment,
                      texture, level, baseViewIndex, numViews);
    }
}

// GL_OVR_multiview2

// EGL_ANGLE_explicit_context
void GL_APIENTRY ActiveShaderProgramContextANGLE(GLeglContext ctx, GLuint pipeline, GLuint program)
{
    EVENT("(GLuint pipeline = %u, GLuint program = %u)", pipeline, program);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateActiveShaderProgram(context, pipeline, program));
        if (isCallValid)
        {
            context->activeShaderProgram(pipeline, program);
        }
        ANGLE_CAPTURE(ActiveShaderProgram, isCallValid, context, pipeline, program);
    }
}

void GL_APIENTRY ActiveTextureContextANGLE(GLeglContext ctx, GLenum texture)
{
    EVENT("(GLenum texture = 0x%X)", texture);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateActiveTexture(context, texture));
        if (isCallValid)
        {
            context->activeTexture(texture);
        }
        ANGLE_CAPTURE(ActiveTexture, isCallValid, context, texture);
    }
}

void GL_APIENTRY AlphaFuncContextANGLE(GLeglContext ctx, GLenum func, GLfloat ref)
{
    EVENT("(GLenum func = 0x%X, GLfloat ref = %f)", func, ref);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        AlphaTestFunc funcPacked = FromGLenum<AlphaTestFunc>(func);
        bool isCallValid =
            (context->skipValidation() || ValidateAlphaFunc(context, funcPacked, ref));
        if (isCallValid)
        {
            context->alphaFunc(funcPacked, ref);
        }
        ANGLE_CAPTURE(AlphaFunc, isCallValid, context, funcPacked, ref);
    }
}

void GL_APIENTRY AlphaFuncxContextANGLE(GLeglContext ctx, GLenum func, GLfixed ref)
{
    EVENT("(GLenum func = 0x%X, GLfixed ref = 0x%X)", func, ref);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        AlphaTestFunc funcPacked = FromGLenum<AlphaTestFunc>(func);
        bool isCallValid =
            (context->skipValidation() || ValidateAlphaFuncx(context, funcPacked, ref));
        if (isCallValid)
        {
            context->alphaFuncx(funcPacked, ref);
        }
        ANGLE_CAPTURE(AlphaFuncx, isCallValid, context, funcPacked, ref);
    }
}

void GL_APIENTRY AttachShaderContextANGLE(GLeglContext ctx, GLuint program, GLuint shader)
{
    EVENT("(GLuint program = %u, GLuint shader = %u)", program, shader);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateAttachShader(context, program, shader));
        if (isCallValid)
        {
            context->attachShader(program, shader);
        }
        ANGLE_CAPTURE(AttachShader, isCallValid, context, program, shader);
    }
}

void GL_APIENTRY BeginQueryContextANGLE(GLeglContext ctx, GLenum target, GLuint id)
{
    EVENT("(GLenum target = 0x%X, GLuint id = %u)", target, id);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        QueryType targetPacked = FromGLenum<QueryType>(target);
        bool isCallValid =
            (context->skipValidation() || ValidateBeginQuery(context, targetPacked, id));
        if (isCallValid)
        {
            context->beginQuery(targetPacked, id);
        }
        ANGLE_CAPTURE(BeginQuery, isCallValid, context, targetPacked, id);
    }
}

void GL_APIENTRY BeginQueryEXTContextANGLE(GLeglContext ctx, GLenum target, GLuint id)
{
    EVENT("(GLenum target = 0x%X, GLuint id = %u)", target, id);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        QueryType targetPacked = FromGLenum<QueryType>(target);
        bool isCallValid =
            (context->skipValidation() || ValidateBeginQueryEXT(context, targetPacked, id));
        if (isCallValid)
        {
            context->beginQuery(targetPacked, id);
        }
        ANGLE_CAPTURE(BeginQueryEXT, isCallValid, context, targetPacked, id);
    }
}

void GL_APIENTRY BeginTransformFeedbackContextANGLE(GLeglContext ctx, GLenum primitiveMode)
{
    EVENT("(GLenum primitiveMode = 0x%X)", primitiveMode);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        PrimitiveMode primitiveModePacked = FromGLenum<PrimitiveMode>(primitiveMode);
        bool isCallValid                  = (context->skipValidation() ||
                            ValidateBeginTransformFeedback(context, primitiveModePacked));
        if (isCallValid)
        {
            context->beginTransformFeedback(primitiveModePacked);
        }
        ANGLE_CAPTURE(BeginTransformFeedback, isCallValid, context, primitiveModePacked);
    }
}

void GL_APIENTRY BindAttribLocationContextANGLE(GLeglContext ctx,
                                                GLuint program,
                                                GLuint index,
                                                const GLchar *name)
{
    EVENT("(GLuint program = %u, GLuint index = %u, const GLchar *name = 0x%016" PRIxPTR ")",
          program, index, (uintptr_t)name);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateBindAttribLocation(context, program, index, name));
        if (isCallValid)
        {
            context->bindAttribLocation(program, index, name);
        }
        ANGLE_CAPTURE(BindAttribLocation, isCallValid, context, program, index, name);
    }
}

void GL_APIENTRY BindBufferContextANGLE(GLeglContext ctx, GLenum target, GLuint buffer)
{
    EVENT("(GLenum target = 0x%X, GLuint buffer = %u)", target, buffer);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        BufferBinding targetPacked = FromGLenum<BufferBinding>(target);
        bool isCallValid =
            (context->skipValidation() || ValidateBindBuffer(context, targetPacked, buffer));
        if (isCallValid)
        {
            context->bindBuffer(targetPacked, buffer);
        }
        ANGLE_CAPTURE(BindBuffer, isCallValid, context, targetPacked, buffer);
    }
}

void GL_APIENTRY BindBufferBaseContextANGLE(GLeglContext ctx,
                                            GLenum target,
                                            GLuint index,
                                            GLuint buffer)
{
    EVENT("(GLenum target = 0x%X, GLuint index = %u, GLuint buffer = %u)", target, index, buffer);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        BufferBinding targetPacked = FromGLenum<BufferBinding>(target);
        bool isCallValid           = (context->skipValidation() ||
                            ValidateBindBufferBase(context, targetPacked, index, buffer));
        if (isCallValid)
        {
            context->bindBufferBase(targetPacked, index, buffer);
        }
        ANGLE_CAPTURE(BindBufferBase, isCallValid, context, targetPacked, index, buffer);
    }
}

void GL_APIENTRY BindBufferRangeContextANGLE(GLeglContext ctx,
                                             GLenum target,
                                             GLuint index,
                                             GLuint buffer,
                                             GLintptr offset,
                                             GLsizeiptr size)
{
    EVENT(
        "(GLenum target = 0x%X, GLuint index = %u, GLuint buffer = %u, GLintptr offset = %llu, "
        "GLsizeiptr size = %llu)",
        target, index, buffer, static_cast<unsigned long long>(offset),
        static_cast<unsigned long long>(size));

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        BufferBinding targetPacked = FromGLenum<BufferBinding>(target);
        bool isCallValid =
            (context->skipValidation() ||
             ValidateBindBufferRange(context, targetPacked, index, buffer, offset, size));
        if (isCallValid)
        {
            context->bindBufferRange(targetPacked, index, buffer, offset, size);
        }
        ANGLE_CAPTURE(BindBufferRange, isCallValid, context, targetPacked, index, buffer, offset,
                      size);
    }
}

void GL_APIENTRY BindFragDataLocationEXTContextANGLE(GLeglContext ctx,
                                                     GLuint program,
                                                     GLuint color,
                                                     const GLchar *name)
{
    EVENT("(GLuint program = %u, GLuint color = %u, const GLchar *name = 0x%016" PRIxPTR ")",
          program, color, (uintptr_t)name);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateBindFragDataLocationEXT(context, program, color, name));
        if (isCallValid)
        {
            context->bindFragDataLocation(program, color, name);
        }
        ANGLE_CAPTURE(BindFragDataLocationEXT, isCallValid, context, program, color, name);
    }
}

void GL_APIENTRY BindFragDataLocationIndexedEXTContextANGLE(GLeglContext ctx,
                                                            GLuint program,
                                                            GLuint colorNumber,
                                                            GLuint index,
                                                            const GLchar *name)
{
    EVENT(
        "(GLuint program = %u, GLuint colorNumber = %u, GLuint index = %u, const GLchar *name = "
        "0x%016" PRIxPTR ")",
        program, colorNumber, index, (uintptr_t)name);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() ||
             ValidateBindFragDataLocationIndexedEXT(context, program, colorNumber, index, name));
        if (isCallValid)
        {
            context->bindFragDataLocationIndexed(program, colorNumber, index, name);
        }
        ANGLE_CAPTURE(BindFragDataLocationIndexedEXT, isCallValid, context, program, colorNumber,
                      index, name);
    }
}

void GL_APIENTRY BindFramebufferContextANGLE(GLeglContext ctx, GLenum target, GLuint framebuffer)
{
    EVENT("(GLenum target = 0x%X, GLuint framebuffer = %u)", target, framebuffer);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateBindFramebuffer(context, target, framebuffer));
        if (isCallValid)
        {
            context->bindFramebuffer(target, framebuffer);
        }
        ANGLE_CAPTURE(BindFramebuffer, isCallValid, context, target, framebuffer);
    }
}

void GL_APIENTRY BindFramebufferOESContextANGLE(GLeglContext ctx, GLenum target, GLuint framebuffer)
{
    EVENT("(GLenum target = 0x%X, GLuint framebuffer = %u)", target, framebuffer);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateBindFramebufferOES(context, target, framebuffer));
        if (isCallValid)
        {
            context->bindFramebuffer(target, framebuffer);
        }
        ANGLE_CAPTURE(BindFramebufferOES, isCallValid, context, target, framebuffer);
    }
}

void GL_APIENTRY BindImageTextureContextANGLE(GLeglContext ctx,
                                              GLuint unit,
                                              GLuint texture,
                                              GLint level,
                                              GLboolean layered,
                                              GLint layer,
                                              GLenum access,
                                              GLenum format)
{
    EVENT(
        "(GLuint unit = %u, GLuint texture = %u, GLint level = %d, GLboolean layered = %u, GLint "
        "layer = %d, GLenum access = 0x%X, GLenum format = 0x%X)",
        unit, texture, level, layered, layer, access, format);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateBindImageTexture(context, unit, texture, level,
                                                                   layered, layer, access, format));
        if (isCallValid)
        {
            context->bindImageTexture(unit, texture, level, layered, layer, access, format);
        }
        ANGLE_CAPTURE(BindImageTexture, isCallValid, context, unit, texture, level, layered, layer,
                      access, format);
    }
}

void GL_APIENTRY BindProgramPipelineContextANGLE(GLeglContext ctx, GLuint pipeline)
{
    EVENT("(GLuint pipeline = %u)", pipeline);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateBindProgramPipeline(context, pipeline));
        if (isCallValid)
        {
            context->bindProgramPipeline(pipeline);
        }
        ANGLE_CAPTURE(BindProgramPipeline, isCallValid, context, pipeline);
    }
}

void GL_APIENTRY BindRenderbufferContextANGLE(GLeglContext ctx, GLenum target, GLuint renderbuffer)
{
    EVENT("(GLenum target = 0x%X, GLuint renderbuffer = %u)", target, renderbuffer);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateBindRenderbuffer(context, target, renderbuffer));
        if (isCallValid)
        {
            context->bindRenderbuffer(target, renderbuffer);
        }
        ANGLE_CAPTURE(BindRenderbuffer, isCallValid, context, target, renderbuffer);
    }
}

void GL_APIENTRY BindRenderbufferOESContextANGLE(GLeglContext ctx,
                                                 GLenum target,
                                                 GLuint renderbuffer)
{
    EVENT("(GLenum target = 0x%X, GLuint renderbuffer = %u)", target, renderbuffer);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateBindRenderbufferOES(context, target, renderbuffer));
        if (isCallValid)
        {
            context->bindRenderbuffer(target, renderbuffer);
        }
        ANGLE_CAPTURE(BindRenderbufferOES, isCallValid, context, target, renderbuffer);
    }
}

void GL_APIENTRY BindSamplerContextANGLE(GLeglContext ctx, GLuint unit, GLuint sampler)
{
    EVENT("(GLuint unit = %u, GLuint sampler = %u)", unit, sampler);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateBindSampler(context, unit, sampler));
        if (isCallValid)
        {
            context->bindSampler(unit, sampler);
        }
        ANGLE_CAPTURE(BindSampler, isCallValid, context, unit, sampler);
    }
}

void GL_APIENTRY BindTextureContextANGLE(GLeglContext ctx, GLenum target, GLuint texture)
{
    EVENT("(GLenum target = 0x%X, GLuint texture = %u)", target, texture);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        TextureType targetPacked = FromGLenum<TextureType>(target);
        bool isCallValid =
            (context->skipValidation() || ValidateBindTexture(context, targetPacked, texture));
        if (isCallValid)
        {
            context->bindTexture(targetPacked, texture);
        }
        ANGLE_CAPTURE(BindTexture, isCallValid, context, targetPacked, texture);
    }
}

void GL_APIENTRY BindTransformFeedbackContextANGLE(GLeglContext ctx, GLenum target, GLuint id)
{
    EVENT("(GLenum target = 0x%X, GLuint id = %u)", target, id);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateBindTransformFeedback(context, target, id));
        if (isCallValid)
        {
            context->bindTransformFeedback(target, id);
        }
        ANGLE_CAPTURE(BindTransformFeedback, isCallValid, context, target, id);
    }
}

void GL_APIENTRY BindVertexArrayContextANGLE(GLeglContext ctx, GLuint array)
{
    EVENT("(GLuint array = %u)", array);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateBindVertexArray(context, array));
        if (isCallValid)
        {
            context->bindVertexArray(array);
        }
        ANGLE_CAPTURE(BindVertexArray, isCallValid, context, array);
    }
}

void GL_APIENTRY BindVertexArrayOESContextANGLE(GLeglContext ctx, GLuint array)
{
    EVENT("(GLuint array = %u)", array);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateBindVertexArrayOES(context, array));
        if (isCallValid)
        {
            context->bindVertexArray(array);
        }
        ANGLE_CAPTURE(BindVertexArrayOES, isCallValid, context, array);
    }
}

void GL_APIENTRY BindVertexBufferContextANGLE(GLeglContext ctx,
                                              GLuint bindingindex,
                                              GLuint buffer,
                                              GLintptr offset,
                                              GLsizei stride)
{
    EVENT(
        "(GLuint bindingindex = %u, GLuint buffer = %u, GLintptr offset = %llu, GLsizei stride = "
        "%d)",
        bindingindex, buffer, static_cast<unsigned long long>(offset), stride);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() ||
             ValidateBindVertexBuffer(context, bindingindex, buffer, offset, stride));
        if (isCallValid)
        {
            context->bindVertexBuffer(bindingindex, buffer, offset, stride);
        }
        ANGLE_CAPTURE(BindVertexBuffer, isCallValid, context, bindingindex, buffer, offset, stride);
    }
}

void GL_APIENTRY
BlendColorContextANGLE(GLeglContext ctx, GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
{
    EVENT("(GLfloat red = %f, GLfloat green = %f, GLfloat blue = %f, GLfloat alpha = %f)", red,
          green, blue, alpha);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateBlendColor(context, red, green, blue, alpha));
        if (isCallValid)
        {
            context->blendColor(red, green, blue, alpha);
        }
        ANGLE_CAPTURE(BlendColor, isCallValid, context, red, green, blue, alpha);
    }
}

void GL_APIENTRY BlendEquationContextANGLE(GLeglContext ctx, GLenum mode)
{
    EVENT("(GLenum mode = 0x%X)", mode);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateBlendEquation(context, mode));
        if (isCallValid)
        {
            context->blendEquation(mode);
        }
        ANGLE_CAPTURE(BlendEquation, isCallValid, context, mode);
    }
}

void GL_APIENTRY BlendEquationSeparateContextANGLE(GLeglContext ctx,
                                                   GLenum modeRGB,
                                                   GLenum modeAlpha)
{
    EVENT("(GLenum modeRGB = 0x%X, GLenum modeAlpha = 0x%X)", modeRGB, modeAlpha);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateBlendEquationSeparate(context, modeRGB, modeAlpha));
        if (isCallValid)
        {
            context->blendEquationSeparate(modeRGB, modeAlpha);
        }
        ANGLE_CAPTURE(BlendEquationSeparate, isCallValid, context, modeRGB, modeAlpha);
    }
}

void GL_APIENTRY BlendFuncContextANGLE(GLeglContext ctx, GLenum sfactor, GLenum dfactor)
{
    EVENT("(GLenum sfactor = 0x%X, GLenum dfactor = 0x%X)", sfactor, dfactor);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateBlendFunc(context, sfactor, dfactor));
        if (isCallValid)
        {
            context->blendFunc(sfactor, dfactor);
        }
        ANGLE_CAPTURE(BlendFunc, isCallValid, context, sfactor, dfactor);
    }
}

void GL_APIENTRY BlendFuncSeparateContextANGLE(GLeglContext ctx,
                                               GLenum sfactorRGB,
                                               GLenum dfactorRGB,
                                               GLenum sfactorAlpha,
                                               GLenum dfactorAlpha)
{
    EVENT(
        "(GLenum sfactorRGB = 0x%X, GLenum dfactorRGB = 0x%X, GLenum sfactorAlpha = 0x%X, GLenum "
        "dfactorAlpha = 0x%X)",
        sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateBlendFuncSeparate(context, sfactorRGB, dfactorRGB,
                                                                    sfactorAlpha, dfactorAlpha));
        if (isCallValid)
        {
            context->blendFuncSeparate(sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha);
        }
        ANGLE_CAPTURE(BlendFuncSeparate, isCallValid, context, sfactorRGB, dfactorRGB, sfactorAlpha,
                      dfactorAlpha);
    }
}

void GL_APIENTRY BlitFramebufferContextANGLE(GLeglContext ctx,
                                             GLint srcX0,
                                             GLint srcY0,
                                             GLint srcX1,
                                             GLint srcY1,
                                             GLint dstX0,
                                             GLint dstY0,
                                             GLint dstX1,
                                             GLint dstY1,
                                             GLbitfield mask,
                                             GLenum filter)
{
    EVENT(
        "(GLint srcX0 = %d, GLint srcY0 = %d, GLint srcX1 = %d, GLint srcY1 = %d, GLint dstX0 = "
        "%d, GLint dstY0 = %d, GLint dstX1 = %d, GLint dstY1 = %d, GLbitfield mask = 0x%X, GLenum "
        "filter = 0x%X)",
        srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateBlitFramebuffer(context, srcX0, srcY0, srcX1, srcY1, dstX0,
                                                    dstY0, dstX1, dstY1, mask, filter));
        if (isCallValid)
        {
            context->blitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask,
                                     filter);
        }
        ANGLE_CAPTURE(BlitFramebuffer, isCallValid, context, srcX0, srcY0, srcX1, srcY1, dstX0,
                      dstY0, dstX1, dstY1, mask, filter);
    }
}

void GL_APIENTRY BlitFramebufferANGLEContextANGLE(GLeglContext ctx,
                                                  GLint srcX0,
                                                  GLint srcY0,
                                                  GLint srcX1,
                                                  GLint srcY1,
                                                  GLint dstX0,
                                                  GLint dstY0,
                                                  GLint dstX1,
                                                  GLint dstY1,
                                                  GLbitfield mask,
                                                  GLenum filter)
{
    EVENT(
        "(GLint srcX0 = %d, GLint srcY0 = %d, GLint srcX1 = %d, GLint srcY1 = %d, GLint dstX0 = "
        "%d, GLint dstY0 = %d, GLint dstX1 = %d, GLint dstY1 = %d, GLbitfield mask = 0x%X, GLenum "
        "filter = 0x%X)",
        srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateBlitFramebufferANGLE(context, srcX0, srcY0, srcX1, srcY1, dstX0,
                                                         dstY0, dstX1, dstY1, mask, filter));
        if (isCallValid)
        {
            context->blitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask,
                                     filter);
        }
        ANGLE_CAPTURE(BlitFramebufferANGLE, isCallValid, context, srcX0, srcY0, srcX1, srcY1, dstX0,
                      dstY0, dstX1, dstY1, mask, filter);
    }
}

void GL_APIENTRY BufferDataContextANGLE(GLeglContext ctx,
                                        GLenum target,
                                        GLsizeiptr size,
                                        const void *data,
                                        GLenum usage)
{
    EVENT("(GLenum target = 0x%X, GLsizeiptr size = %llu, const void *data = 0x%016" PRIxPTR
          ", GLenum usage = 0x%X)",
          target, static_cast<unsigned long long>(size), (uintptr_t)data, usage);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        BufferBinding targetPacked = FromGLenum<BufferBinding>(target);
        BufferUsage usagePacked    = FromGLenum<BufferUsage>(usage);
        bool isCallValid           = (context->skipValidation() ||
                            ValidateBufferData(context, targetPacked, size, data, usagePacked));
        if (isCallValid)
        {
            context->bufferData(targetPacked, size, data, usagePacked);
        }
        ANGLE_CAPTURE(BufferData, isCallValid, context, targetPacked, size, data, usagePacked);
    }
}

void GL_APIENTRY BufferStorageMemEXTContextANGLE(GLeglContext ctx,
                                                 GLenum target,
                                                 GLsizeiptr size,
                                                 GLuint memory,
                                                 GLuint64 offset)
{
    EVENT(
        "(GLenum target = 0x%X, GLsizeiptr size = %llu, GLuint memory = %u, GLuint64 offset = "
        "%llu)",
        target, static_cast<unsigned long long>(size), memory,
        static_cast<unsigned long long>(offset));

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        TextureType targetPacked = FromGLenum<TextureType>(target);
        bool isCallValid =
            (context->skipValidation() ||
             ValidateBufferStorageMemEXT(context, targetPacked, size, memory, offset));
        if (isCallValid)
        {
            context->bufferStorageMem(targetPacked, size, memory, offset);
        }
        ANGLE_CAPTURE(BufferStorageMemEXT, isCallValid, context, targetPacked, size, memory,
                      offset);
    }
}

void GL_APIENTRY BufferSubDataContextANGLE(GLeglContext ctx,
                                           GLenum target,
                                           GLintptr offset,
                                           GLsizeiptr size,
                                           const void *data)
{
    EVENT(
        "(GLenum target = 0x%X, GLintptr offset = %llu, GLsizeiptr size = %llu, const void *data = "
        "0x%016" PRIxPTR ")",
        target, static_cast<unsigned long long>(offset), static_cast<unsigned long long>(size),
        (uintptr_t)data);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        BufferBinding targetPacked = FromGLenum<BufferBinding>(target);
        bool isCallValid           = (context->skipValidation() ||
                            ValidateBufferSubData(context, targetPacked, offset, size, data));
        if (isCallValid)
        {
            context->bufferSubData(targetPacked, offset, size, data);
        }
        ANGLE_CAPTURE(BufferSubData, isCallValid, context, targetPacked, offset, size, data);
    }
}

GLenum GL_APIENTRY CheckFramebufferStatusContextANGLE(GLeglContext ctx, GLenum target)
{
    EVENT("(GLenum target = 0x%X)", target);

    Context *context = static_cast<gl::Context *>(ctx);
    GLenum returnValue;
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateCheckFramebufferStatus(context, target));
        if (isCallValid)
        {
            returnValue = context->checkFramebufferStatus(target);
        }
        else
        {
            returnValue = GetDefaultReturnValue<EntryPoint::CheckFramebufferStatus, GLenum>();
        }
        ANGLE_CAPTURE(CheckFramebufferStatus, isCallValid, context, target, returnValue);
    }
    else
    {
        returnValue = GetDefaultReturnValue<EntryPoint::CheckFramebufferStatus, GLenum>();
    }
    return returnValue;
}

GLenum GL_APIENTRY CheckFramebufferStatusOESContextANGLE(GLeglContext ctx, GLenum target)
{
    EVENT("(GLenum target = 0x%X)", target);

    Context *context = static_cast<gl::Context *>(ctx);
    GLenum returnValue;
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateCheckFramebufferStatusOES(context, target));
        if (isCallValid)
        {
            returnValue = context->checkFramebufferStatus(target);
        }
        else
        {
            returnValue = GetDefaultReturnValue<EntryPoint::CheckFramebufferStatusOES, GLenum>();
        }
        ANGLE_CAPTURE(CheckFramebufferStatusOES, isCallValid, context, target, returnValue);
    }
    else
    {
        returnValue = GetDefaultReturnValue<EntryPoint::CheckFramebufferStatusOES, GLenum>();
    }
    return returnValue;
}

void GL_APIENTRY ClearContextANGLE(GLeglContext ctx, GLbitfield mask)
{
    EVENT("(GLbitfield mask = 0x%X)", mask);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateClear(context, mask));
        if (isCallValid)
        {
            context->clear(mask);
        }
        ANGLE_CAPTURE(Clear, isCallValid, context, mask);
    }
}

void GL_APIENTRY ClearBufferfiContextANGLE(GLeglContext ctx,
                                           GLenum buffer,
                                           GLint drawbuffer,
                                           GLfloat depth,
                                           GLint stencil)
{
    EVENT("(GLenum buffer = 0x%X, GLint drawbuffer = %d, GLfloat depth = %f, GLint stencil = %d)",
          buffer, drawbuffer, depth, stencil);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateClearBufferfi(context, buffer, drawbuffer, depth, stencil));
        if (isCallValid)
        {
            context->clearBufferfi(buffer, drawbuffer, depth, stencil);
        }
        ANGLE_CAPTURE(ClearBufferfi, isCallValid, context, buffer, drawbuffer, depth, stencil);
    }
}

void GL_APIENTRY ClearBufferfvContextANGLE(GLeglContext ctx,
                                           GLenum buffer,
                                           GLint drawbuffer,
                                           const GLfloat *value)
{
    EVENT("(GLenum buffer = 0x%X, GLint drawbuffer = %d, const GLfloat *value = 0x%016" PRIxPTR ")",
          buffer, drawbuffer, (uintptr_t)value);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateClearBufferfv(context, buffer, drawbuffer, value));
        if (isCallValid)
        {
            context->clearBufferfv(buffer, drawbuffer, value);
        }
        ANGLE_CAPTURE(ClearBufferfv, isCallValid, context, buffer, drawbuffer, value);
    }
}

void GL_APIENTRY ClearBufferivContextANGLE(GLeglContext ctx,
                                           GLenum buffer,
                                           GLint drawbuffer,
                                           const GLint *value)
{
    EVENT("(GLenum buffer = 0x%X, GLint drawbuffer = %d, const GLint *value = 0x%016" PRIxPTR ")",
          buffer, drawbuffer, (uintptr_t)value);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateClearBufferiv(context, buffer, drawbuffer, value));
        if (isCallValid)
        {
            context->clearBufferiv(buffer, drawbuffer, value);
        }
        ANGLE_CAPTURE(ClearBufferiv, isCallValid, context, buffer, drawbuffer, value);
    }
}

void GL_APIENTRY ClearBufferuivContextANGLE(GLeglContext ctx,
                                            GLenum buffer,
                                            GLint drawbuffer,
                                            const GLuint *value)
{
    EVENT("(GLenum buffer = 0x%X, GLint drawbuffer = %d, const GLuint *value = 0x%016" PRIxPTR ")",
          buffer, drawbuffer, (uintptr_t)value);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateClearBufferuiv(context, buffer, drawbuffer, value));
        if (isCallValid)
        {
            context->clearBufferuiv(buffer, drawbuffer, value);
        }
        ANGLE_CAPTURE(ClearBufferuiv, isCallValid, context, buffer, drawbuffer, value);
    }
}

void GL_APIENTRY
ClearColorContextANGLE(GLeglContext ctx, GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
{
    EVENT("(GLfloat red = %f, GLfloat green = %f, GLfloat blue = %f, GLfloat alpha = %f)", red,
          green, blue, alpha);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateClearColor(context, red, green, blue, alpha));
        if (isCallValid)
        {
            context->clearColor(red, green, blue, alpha);
        }
        ANGLE_CAPTURE(ClearColor, isCallValid, context, red, green, blue, alpha);
    }
}

void GL_APIENTRY
ClearColorxContextANGLE(GLeglContext ctx, GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha)
{
    EVENT("(GLfixed red = 0x%X, GLfixed green = 0x%X, GLfixed blue = 0x%X, GLfixed alpha = 0x%X)",
          red, green, blue, alpha);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateClearColorx(context, red, green, blue, alpha));
        if (isCallValid)
        {
            context->clearColorx(red, green, blue, alpha);
        }
        ANGLE_CAPTURE(ClearColorx, isCallValid, context, red, green, blue, alpha);
    }
}

void GL_APIENTRY ClearDepthfContextANGLE(GLeglContext ctx, GLfloat d)
{
    EVENT("(GLfloat d = %f)", d);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateClearDepthf(context, d));
        if (isCallValid)
        {
            context->clearDepthf(d);
        }
        ANGLE_CAPTURE(ClearDepthf, isCallValid, context, d);
    }
}

void GL_APIENTRY ClearDepthxContextANGLE(GLeglContext ctx, GLfixed depth)
{
    EVENT("(GLfixed depth = 0x%X)", depth);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateClearDepthx(context, depth));
        if (isCallValid)
        {
            context->clearDepthx(depth);
        }
        ANGLE_CAPTURE(ClearDepthx, isCallValid, context, depth);
    }
}

void GL_APIENTRY ClearStencilContextANGLE(GLeglContext ctx, GLint s)
{
    EVENT("(GLint s = %d)", s);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateClearStencil(context, s));
        if (isCallValid)
        {
            context->clearStencil(s);
        }
        ANGLE_CAPTURE(ClearStencil, isCallValid, context, s);
    }
}

void GL_APIENTRY ClientActiveTextureContextANGLE(GLeglContext ctx, GLenum texture)
{
    EVENT("(GLenum texture = 0x%X)", texture);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateClientActiveTexture(context, texture));
        if (isCallValid)
        {
            context->clientActiveTexture(texture);
        }
        ANGLE_CAPTURE(ClientActiveTexture, isCallValid, context, texture);
    }
}

GLenum GL_APIENTRY ClientWaitSyncContextANGLE(GLeglContext ctx,
                                              GLsync sync,
                                              GLbitfield flags,
                                              GLuint64 timeout)
{
    EVENT("(GLsync sync = 0x%016" PRIxPTR ", GLbitfield flags = 0x%X, GLuint64 timeout = %llu)",
          (uintptr_t)sync, flags, static_cast<unsigned long long>(timeout));

    Context *context = static_cast<gl::Context *>(ctx);
    GLenum returnValue;
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateClientWaitSync(context, sync, flags, timeout));
        if (isCallValid)
        {
            returnValue = context->clientWaitSync(sync, flags, timeout);
        }
        else
        {
            returnValue = GetDefaultReturnValue<EntryPoint::ClientWaitSync, GLenum>();
        }
        ANGLE_CAPTURE(ClientWaitSync, isCallValid, context, sync, flags, timeout, returnValue);
    }
    else
    {
        returnValue = GetDefaultReturnValue<EntryPoint::ClientWaitSync, GLenum>();
    }
    return returnValue;
}

void GL_APIENTRY ClipPlanefContextANGLE(GLeglContext ctx, GLenum p, const GLfloat *eqn)
{
    EVENT("(GLenum p = 0x%X, const GLfloat *eqn = 0x%016" PRIxPTR ")", p, (uintptr_t)eqn);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateClipPlanef(context, p, eqn));
        if (isCallValid)
        {
            context->clipPlanef(p, eqn);
        }
        ANGLE_CAPTURE(ClipPlanef, isCallValid, context, p, eqn);
    }
}

void GL_APIENTRY ClipPlanexContextANGLE(GLeglContext ctx, GLenum plane, const GLfixed *equation)
{
    EVENT("(GLenum plane = 0x%X, const GLfixed *equation = 0x%016" PRIxPTR ")", plane,
          (uintptr_t)equation);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateClipPlanex(context, plane, equation));
        if (isCallValid)
        {
            context->clipPlanex(plane, equation);
        }
        ANGLE_CAPTURE(ClipPlanex, isCallValid, context, plane, equation);
    }
}

void GL_APIENTRY
Color4fContextANGLE(GLeglContext ctx, GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
{
    EVENT("(GLfloat red = %f, GLfloat green = %f, GLfloat blue = %f, GLfloat alpha = %f)", red,
          green, blue, alpha);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateColor4f(context, red, green, blue, alpha));
        if (isCallValid)
        {
            context->color4f(red, green, blue, alpha);
        }
        ANGLE_CAPTURE(Color4f, isCallValid, context, red, green, blue, alpha);
    }
}

void GL_APIENTRY
Color4ubContextANGLE(GLeglContext ctx, GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha)
{
    EVENT("(GLubyte red = %d, GLubyte green = %d, GLubyte blue = %d, GLubyte alpha = %d)", red,
          green, blue, alpha);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateColor4ub(context, red, green, blue, alpha));
        if (isCallValid)
        {
            context->color4ub(red, green, blue, alpha);
        }
        ANGLE_CAPTURE(Color4ub, isCallValid, context, red, green, blue, alpha);
    }
}

void GL_APIENTRY
Color4xContextANGLE(GLeglContext ctx, GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha)
{
    EVENT("(GLfixed red = 0x%X, GLfixed green = 0x%X, GLfixed blue = 0x%X, GLfixed alpha = 0x%X)",
          red, green, blue, alpha);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateColor4x(context, red, green, blue, alpha));
        if (isCallValid)
        {
            context->color4x(red, green, blue, alpha);
        }
        ANGLE_CAPTURE(Color4x, isCallValid, context, red, green, blue, alpha);
    }
}

void GL_APIENTRY ColorMaskContextANGLE(GLeglContext ctx,
                                       GLboolean red,
                                       GLboolean green,
                                       GLboolean blue,
                                       GLboolean alpha)
{
    EVENT("(GLboolean red = %u, GLboolean green = %u, GLboolean blue = %u, GLboolean alpha = %u)",
          red, green, blue, alpha);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateColorMask(context, red, green, blue, alpha));
        if (isCallValid)
        {
            context->colorMask(red, green, blue, alpha);
        }
        ANGLE_CAPTURE(ColorMask, isCallValid, context, red, green, blue, alpha);
    }
}

void GL_APIENTRY ColorPointerContextANGLE(GLeglContext ctx,
                                          GLint size,
                                          GLenum type,
                                          GLsizei stride,
                                          const void *pointer)
{
    EVENT(
        "(GLint size = %d, GLenum type = 0x%X, GLsizei stride = %d, const void *pointer = "
        "0x%016" PRIxPTR ")",
        size, type, stride, (uintptr_t)pointer);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        VertexAttribType typePacked = FromGLenum<VertexAttribType>(type);
        bool isCallValid            = (context->skipValidation() ||
                            ValidateColorPointer(context, size, typePacked, stride, pointer));
        if (isCallValid)
        {
            context->colorPointer(size, typePacked, stride, pointer);
        }
        ANGLE_CAPTURE(ColorPointer, isCallValid, context, size, typePacked, stride, pointer);
    }
}

void GL_APIENTRY CompileShaderContextANGLE(GLeglContext ctx, GLuint shader)
{
    EVENT("(GLuint shader = %u)", shader);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateCompileShader(context, shader));
        if (isCallValid)
        {
            context->compileShader(shader);
        }
        ANGLE_CAPTURE(CompileShader, isCallValid, context, shader);
    }
}

void GL_APIENTRY CompressedTexImage2DContextANGLE(GLeglContext ctx,
                                                  GLenum target,
                                                  GLint level,
                                                  GLenum internalformat,
                                                  GLsizei width,
                                                  GLsizei height,
                                                  GLint border,
                                                  GLsizei imageSize,
                                                  const void *data)
{
    EVENT(
        "(GLenum target = 0x%X, GLint level = %d, GLenum internalformat = 0x%X, GLsizei width = "
        "%d, GLsizei height = %d, GLint border = %d, GLsizei imageSize = %d, const void *data = "
        "0x%016" PRIxPTR ")",
        target, level, internalformat, width, height, border, imageSize, (uintptr_t)data);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        TextureTarget targetPacked = FromGLenum<TextureTarget>(target);
        bool isCallValid =
            (context->skipValidation() ||
             ValidateCompressedTexImage2D(context, targetPacked, level, internalformat, width,
                                          height, border, imageSize, data));
        if (isCallValid)
        {
            context->compressedTexImage2D(targetPacked, level, internalformat, width, height,
                                          border, imageSize, data);
        }
        ANGLE_CAPTURE(CompressedTexImage2D, isCallValid, context, targetPacked, level,
                      internalformat, width, height, border, imageSize, data);
    }
}

void GL_APIENTRY CompressedTexImage3DContextANGLE(GLeglContext ctx,
                                                  GLenum target,
                                                  GLint level,
                                                  GLenum internalformat,
                                                  GLsizei width,
                                                  GLsizei height,
                                                  GLsizei depth,
                                                  GLint border,
                                                  GLsizei imageSize,
                                                  const void *data)
{
    EVENT(
        "(GLenum target = 0x%X, GLint level = %d, GLenum internalformat = 0x%X, GLsizei width = "
        "%d, GLsizei height = %d, GLsizei depth = %d, GLint border = %d, GLsizei imageSize = %d, "
        "const void *data = 0x%016" PRIxPTR ")",
        target, level, internalformat, width, height, depth, border, imageSize, (uintptr_t)data);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        TextureTarget targetPacked = FromGLenum<TextureTarget>(target);
        bool isCallValid =
            (context->skipValidation() ||
             ValidateCompressedTexImage3D(context, targetPacked, level, internalformat, width,
                                          height, depth, border, imageSize, data));
        if (isCallValid)
        {
            context->compressedTexImage3D(targetPacked, level, internalformat, width, height, depth,
                                          border, imageSize, data);
        }
        ANGLE_CAPTURE(CompressedTexImage3D, isCallValid, context, targetPacked, level,
                      internalformat, width, height, depth, border, imageSize, data);
    }
}

void GL_APIENTRY CompressedTexImage3DOESContextANGLE(GLeglContext ctx,
                                                     GLenum target,
                                                     GLint level,
                                                     GLenum internalformat,
                                                     GLsizei width,
                                                     GLsizei height,
                                                     GLsizei depth,
                                                     GLint border,
                                                     GLsizei imageSize,
                                                     const void *data)
{
    EVENT(
        "(GLenum target = 0x%X, GLint level = %d, GLenum internalformat = 0x%X, GLsizei width = "
        "%d, GLsizei height = %d, GLsizei depth = %d, GLint border = %d, GLsizei imageSize = %d, "
        "const void *data = 0x%016" PRIxPTR ")",
        target, level, internalformat, width, height, depth, border, imageSize, (uintptr_t)data);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        TextureTarget targetPacked = FromGLenum<TextureTarget>(target);
        bool isCallValid =
            (context->skipValidation() ||
             ValidateCompressedTexImage3DOES(context, targetPacked, level, internalformat, width,
                                             height, depth, border, imageSize, data));
        if (isCallValid)
        {
            context->compressedTexImage3D(targetPacked, level, internalformat, width, height, depth,
                                          border, imageSize, data);
        }
        ANGLE_CAPTURE(CompressedTexImage3DOES, isCallValid, context, targetPacked, level,
                      internalformat, width, height, depth, border, imageSize, data);
    }
}

void GL_APIENTRY CompressedTexSubImage2DContextANGLE(GLeglContext ctx,
                                                     GLenum target,
                                                     GLint level,
                                                     GLint xoffset,
                                                     GLint yoffset,
                                                     GLsizei width,
                                                     GLsizei height,
                                                     GLenum format,
                                                     GLsizei imageSize,
                                                     const void *data)
{
    EVENT(
        "(GLenum target = 0x%X, GLint level = %d, GLint xoffset = %d, GLint yoffset = %d, GLsizei "
        "width = %d, GLsizei height = %d, GLenum format = 0x%X, GLsizei imageSize = %d, const void "
        "*data = 0x%016" PRIxPTR ")",
        target, level, xoffset, yoffset, width, height, format, imageSize, (uintptr_t)data);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        TextureTarget targetPacked = FromGLenum<TextureTarget>(target);
        bool isCallValid =
            (context->skipValidation() ||
             ValidateCompressedTexSubImage2D(context, targetPacked, level, xoffset, yoffset, width,
                                             height, format, imageSize, data));
        if (isCallValid)
        {
            context->compressedTexSubImage2D(targetPacked, level, xoffset, yoffset, width, height,
                                             format, imageSize, data);
        }
        ANGLE_CAPTURE(CompressedTexSubImage2D, isCallValid, context, targetPacked, level, xoffset,
                      yoffset, width, height, format, imageSize, data);
    }
}

void GL_APIENTRY CompressedTexSubImage3DContextANGLE(GLeglContext ctx,
                                                     GLenum target,
                                                     GLint level,
                                                     GLint xoffset,
                                                     GLint yoffset,
                                                     GLint zoffset,
                                                     GLsizei width,
                                                     GLsizei height,
                                                     GLsizei depth,
                                                     GLenum format,
                                                     GLsizei imageSize,
                                                     const void *data)
{
    EVENT(
        "(GLenum target = 0x%X, GLint level = %d, GLint xoffset = %d, GLint yoffset = %d, GLint "
        "zoffset = %d, GLsizei width = %d, GLsizei height = %d, GLsizei depth = %d, GLenum format "
        "= 0x%X, GLsizei imageSize = %d, const void *data = 0x%016" PRIxPTR ")",
        target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize,
        (uintptr_t)data);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        TextureTarget targetPacked = FromGLenum<TextureTarget>(target);
        bool isCallValid           = (context->skipValidation() ||
                            ValidateCompressedTexSubImage3D(context, targetPacked, level, xoffset,
                                                            yoffset, zoffset, width, height, depth,
                                                            format, imageSize, data));
        if (isCallValid)
        {
            context->compressedTexSubImage3D(targetPacked, level, xoffset, yoffset, zoffset, width,
                                             height, depth, format, imageSize, data);
        }
        ANGLE_CAPTURE(CompressedTexSubImage3D, isCallValid, context, targetPacked, level, xoffset,
                      yoffset, zoffset, width, height, depth, format, imageSize, data);
    }
}

void GL_APIENTRY CompressedTexSubImage3DOESContextANGLE(GLeglContext ctx,
                                                        GLenum target,
                                                        GLint level,
                                                        GLint xoffset,
                                                        GLint yoffset,
                                                        GLint zoffset,
                                                        GLsizei width,
                                                        GLsizei height,
                                                        GLsizei depth,
                                                        GLenum format,
                                                        GLsizei imageSize,
                                                        const void *data)
{
    EVENT(
        "(GLenum target = 0x%X, GLint level = %d, GLint xoffset = %d, GLint yoffset = %d, GLint "
        "zoffset = %d, GLsizei width = %d, GLsizei height = %d, GLsizei depth = %d, GLenum format "
        "= 0x%X, GLsizei imageSize = %d, const void *data = 0x%016" PRIxPTR ")",
        target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize,
        (uintptr_t)data);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        TextureTarget targetPacked = FromGLenum<TextureTarget>(target);
        bool isCallValid           = (context->skipValidation() ||
                            ValidateCompressedTexSubImage3DOES(
                                context, targetPacked, level, xoffset, yoffset, zoffset, width,
                                height, depth, format, imageSize, data));
        if (isCallValid)
        {
            context->compressedTexSubImage3D(targetPacked, level, xoffset, yoffset, zoffset, width,
                                             height, depth, format, imageSize, data);
        }
        ANGLE_CAPTURE(CompressedTexSubImage3DOES, isCallValid, context, targetPacked, level,
                      xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data);
    }
}

void GL_APIENTRY CopyBufferSubDataContextANGLE(GLeglContext ctx,
                                               GLenum readTarget,
                                               GLenum writeTarget,
                                               GLintptr readOffset,
                                               GLintptr writeOffset,
                                               GLsizeiptr size)
{
    EVENT(
        "(GLenum readTarget = 0x%X, GLenum writeTarget = 0x%X, GLintptr readOffset = %llu, "
        "GLintptr writeOffset = %llu, GLsizeiptr size = %llu)",
        readTarget, writeTarget, static_cast<unsigned long long>(readOffset),
        static_cast<unsigned long long>(writeOffset), static_cast<unsigned long long>(size));

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        BufferBinding readTargetPacked  = FromGLenum<BufferBinding>(readTarget);
        BufferBinding writeTargetPacked = FromGLenum<BufferBinding>(writeTarget);
        bool isCallValid                = (context->skipValidation() ||
                            ValidateCopyBufferSubData(context, readTargetPacked, writeTargetPacked,
                                                      readOffset, writeOffset, size));
        if (isCallValid)
        {
            context->copyBufferSubData(readTargetPacked, writeTargetPacked, readOffset, writeOffset,
                                       size);
        }
        ANGLE_CAPTURE(CopyBufferSubData, isCallValid, context, readTargetPacked, writeTargetPacked,
                      readOffset, writeOffset, size);
    }
}

void GL_APIENTRY CopyTexImage2DContextANGLE(GLeglContext ctx,
                                            GLenum target,
                                            GLint level,
                                            GLenum internalformat,
                                            GLint x,
                                            GLint y,
                                            GLsizei width,
                                            GLsizei height,
                                            GLint border)
{
    EVENT(
        "(GLenum target = 0x%X, GLint level = %d, GLenum internalformat = 0x%X, GLint x = %d, "
        "GLint y = %d, GLsizei width = %d, GLsizei height = %d, GLint border = %d)",
        target, level, internalformat, x, y, width, height, border);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        TextureTarget targetPacked = FromGLenum<TextureTarget>(target);
        bool isCallValid           = (context->skipValidation() ||
                            ValidateCopyTexImage2D(context, targetPacked, level, internalformat, x,
                                                   y, width, height, border));
        if (isCallValid)
        {
            context->copyTexImage2D(targetPacked, level, internalformat, x, y, width, height,
                                    border);
        }
        ANGLE_CAPTURE(CopyTexImage2D, isCallValid, context, targetPacked, level, internalformat, x,
                      y, width, height, border);
    }
}

void GL_APIENTRY CopyTexSubImage2DContextANGLE(GLeglContext ctx,
                                               GLenum target,
                                               GLint level,
                                               GLint xoffset,
                                               GLint yoffset,
                                               GLint x,
                                               GLint y,
                                               GLsizei width,
                                               GLsizei height)
{
    EVENT(
        "(GLenum target = 0x%X, GLint level = %d, GLint xoffset = %d, GLint yoffset = %d, GLint x "
        "= %d, GLint y = %d, GLsizei width = %d, GLsizei height = %d)",
        target, level, xoffset, yoffset, x, y, width, height);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        TextureTarget targetPacked = FromGLenum<TextureTarget>(target);
        bool isCallValid           = (context->skipValidation() ||
                            ValidateCopyTexSubImage2D(context, targetPacked, level, xoffset,
                                                      yoffset, x, y, width, height));
        if (isCallValid)
        {
            context->copyTexSubImage2D(targetPacked, level, xoffset, yoffset, x, y, width, height);
        }
        ANGLE_CAPTURE(CopyTexSubImage2D, isCallValid, context, targetPacked, level, xoffset,
                      yoffset, x, y, width, height);
    }
}

void GL_APIENTRY CopyTexSubImage3DContextANGLE(GLeglContext ctx,
                                               GLenum target,
                                               GLint level,
                                               GLint xoffset,
                                               GLint yoffset,
                                               GLint zoffset,
                                               GLint x,
                                               GLint y,
                                               GLsizei width,
                                               GLsizei height)
{
    EVENT(
        "(GLenum target = 0x%X, GLint level = %d, GLint xoffset = %d, GLint yoffset = %d, GLint "
        "zoffset = %d, GLint x = %d, GLint y = %d, GLsizei width = %d, GLsizei height = %d)",
        target, level, xoffset, yoffset, zoffset, x, y, width, height);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        TextureTarget targetPacked = FromGLenum<TextureTarget>(target);
        bool isCallValid           = (context->skipValidation() ||
                            ValidateCopyTexSubImage3D(context, targetPacked, level, xoffset,
                                                      yoffset, zoffset, x, y, width, height));
        if (isCallValid)
        {
            context->copyTexSubImage3D(targetPacked, level, xoffset, yoffset, zoffset, x, y, width,
                                       height);
        }
        ANGLE_CAPTURE(CopyTexSubImage3D, isCallValid, context, targetPacked, level, xoffset,
                      yoffset, zoffset, x, y, width, height);
    }
}

void GL_APIENTRY CopyTexSubImage3DOESContextANGLE(GLeglContext ctx,
                                                  GLenum target,
                                                  GLint level,
                                                  GLint xoffset,
                                                  GLint yoffset,
                                                  GLint zoffset,
                                                  GLint x,
                                                  GLint y,
                                                  GLsizei width,
                                                  GLsizei height)
{
    EVENT(
        "(GLenum target = 0x%X, GLint level = %d, GLint xoffset = %d, GLint yoffset = %d, GLint "
        "zoffset = %d, GLint x = %d, GLint y = %d, GLsizei width = %d, GLsizei height = %d)",
        target, level, xoffset, yoffset, zoffset, x, y, width, height);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        TextureTarget targetPacked = FromGLenum<TextureTarget>(target);
        bool isCallValid           = (context->skipValidation() ||
                            ValidateCopyTexSubImage3DOES(context, targetPacked, level, xoffset,
                                                         yoffset, zoffset, x, y, width, height));
        if (isCallValid)
        {
            context->copyTexSubImage3D(targetPacked, level, xoffset, yoffset, zoffset, x, y, width,
                                       height);
        }
        ANGLE_CAPTURE(CopyTexSubImage3DOES, isCallValid, context, targetPacked, level, xoffset,
                      yoffset, zoffset, x, y, width, height);
    }
}

void GL_APIENTRY CreateMemoryObjectsEXTContextANGLE(GLeglContext ctx,
                                                    GLsizei n,
                                                    GLuint *memoryObjects)
{
    EVENT("(GLsizei n = %d, GLuint *memoryObjects = 0x%016" PRIxPTR ")", n,
          (uintptr_t)memoryObjects);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateCreateMemoryObjectsEXT(context, n, memoryObjects));
        if (isCallValid)
        {
            context->createMemoryObjects(n, memoryObjects);
        }
        ANGLE_CAPTURE(CreateMemoryObjectsEXT, isCallValid, context, n, memoryObjects);
    }
}

GLuint GL_APIENTRY CreateProgramContextANGLE(GLeglContext ctx)
{
    EVENT("()");

    Context *context = static_cast<gl::Context *>(ctx);
    GLuint returnValue;
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateCreateProgram(context));
        if (isCallValid)
        {
            returnValue = context->createProgram();
        }
        else
        {
            returnValue = GetDefaultReturnValue<EntryPoint::CreateProgram, GLuint>();
        }
        ANGLE_CAPTURE(CreateProgram, isCallValid, context, returnValue);
    }
    else
    {
        returnValue = GetDefaultReturnValue<EntryPoint::CreateProgram, GLuint>();
    }
    return returnValue;
}

GLuint GL_APIENTRY CreateShaderContextANGLE(GLeglContext ctx, GLenum type)
{
    EVENT("(GLenum type = 0x%X)", type);

    Context *context = static_cast<gl::Context *>(ctx);
    GLuint returnValue;
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        ShaderType typePacked = FromGLenum<ShaderType>(type);
        bool isCallValid = (context->skipValidation() || ValidateCreateShader(context, typePacked));
        if (isCallValid)
        {
            returnValue = context->createShader(typePacked);
        }
        else
        {
            returnValue = GetDefaultReturnValue<EntryPoint::CreateShader, GLuint>();
        }
        ANGLE_CAPTURE(CreateShader, isCallValid, context, typePacked, returnValue);
    }
    else
    {
        returnValue = GetDefaultReturnValue<EntryPoint::CreateShader, GLuint>();
    }
    return returnValue;
}

GLuint GL_APIENTRY CreateShaderProgramvContextANGLE(GLeglContext ctx,
                                                    GLenum type,
                                                    GLsizei count,
                                                    const GLchar *const *strings)
{
    EVENT("(GLenum type = 0x%X, GLsizei count = %d, const GLchar *const*strings = 0x%016" PRIxPTR
          ")",
          type, count, (uintptr_t)strings);

    Context *context = static_cast<gl::Context *>(ctx);
    GLuint returnValue;
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        ShaderType typePacked = FromGLenum<ShaderType>(type);
        bool isCallValid      = (context->skipValidation() ||
                            ValidateCreateShaderProgramv(context, typePacked, count, strings));
        if (isCallValid)
        {
            returnValue = context->createShaderProgramv(typePacked, count, strings);
        }
        else
        {
            returnValue = GetDefaultReturnValue<EntryPoint::CreateShaderProgramv, GLuint>();
        }
        ANGLE_CAPTURE(CreateShaderProgramv, isCallValid, context, typePacked, count, strings,
                      returnValue);
    }
    else
    {
        returnValue = GetDefaultReturnValue<EntryPoint::CreateShaderProgramv, GLuint>();
    }
    return returnValue;
}

void GL_APIENTRY CullFaceContextANGLE(GLeglContext ctx, GLenum mode)
{
    EVENT("(GLenum mode = 0x%X)", mode);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        CullFaceMode modePacked = FromGLenum<CullFaceMode>(mode);
        bool isCallValid = (context->skipValidation() || ValidateCullFace(context, modePacked));
        if (isCallValid)
        {
            context->cullFace(modePacked);
        }
        ANGLE_CAPTURE(CullFace, isCallValid, context, modePacked);
    }
}

void GL_APIENTRY CurrentPaletteMatrixOESContextANGLE(GLeglContext ctx, GLuint matrixpaletteindex)
{
    EVENT("(GLuint matrixpaletteindex = %u)", matrixpaletteindex);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateCurrentPaletteMatrixOES(context, matrixpaletteindex));
        if (isCallValid)
        {
            context->currentPaletteMatrix(matrixpaletteindex);
        }
        ANGLE_CAPTURE(CurrentPaletteMatrixOES, isCallValid, context, matrixpaletteindex);
    }
}

void GL_APIENTRY DebugMessageCallbackKHRContextANGLE(GLeglContext ctx,
                                                     GLDEBUGPROCKHR callback,
                                                     const void *userParam)
{
    EVENT("(GLDEBUGPROCKHR callback = 0x%016" PRIxPTR ", const void *userParam = 0x%016" PRIxPTR
          ")",
          (uintptr_t)callback, (uintptr_t)userParam);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateDebugMessageCallbackKHR(context, callback, userParam));
        if (isCallValid)
        {
            context->debugMessageCallback(callback, userParam);
        }
        ANGLE_CAPTURE(DebugMessageCallbackKHR, isCallValid, context, callback, userParam);
    }
}

void GL_APIENTRY DebugMessageControlKHRContextANGLE(GLeglContext ctx,
                                                    GLenum source,
                                                    GLenum type,
                                                    GLenum severity,
                                                    GLsizei count,
                                                    const GLuint *ids,
                                                    GLboolean enabled)
{
    EVENT(
        "(GLenum source = 0x%X, GLenum type = 0x%X, GLenum severity = 0x%X, GLsizei count = %d, "
        "const GLuint *ids = 0x%016" PRIxPTR ", GLboolean enabled = %u)",
        source, type, severity, count, (uintptr_t)ids, enabled);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() ||
             ValidateDebugMessageControlKHR(context, source, type, severity, count, ids, enabled));
        if (isCallValid)
        {
            context->debugMessageControl(source, type, severity, count, ids, enabled);
        }
        ANGLE_CAPTURE(DebugMessageControlKHR, isCallValid, context, source, type, severity, count,
                      ids, enabled);
    }
}

void GL_APIENTRY DebugMessageInsertKHRContextANGLE(GLeglContext ctx,
                                                   GLenum source,
                                                   GLenum type,
                                                   GLuint id,
                                                   GLenum severity,
                                                   GLsizei length,
                                                   const GLchar *buf)
{
    EVENT(
        "(GLenum source = 0x%X, GLenum type = 0x%X, GLuint id = %u, GLenum severity = 0x%X, "
        "GLsizei length = %d, const GLchar *buf = 0x%016" PRIxPTR ")",
        source, type, id, severity, length, (uintptr_t)buf);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() ||
             ValidateDebugMessageInsertKHR(context, source, type, id, severity, length, buf));
        if (isCallValid)
        {
            context->debugMessageInsert(source, type, id, severity, length, buf);
        }
        ANGLE_CAPTURE(DebugMessageInsertKHR, isCallValid, context, source, type, id, severity,
                      length, buf);
    }
}

void GL_APIENTRY DeleteBuffersContextANGLE(GLeglContext ctx, GLsizei n, const GLuint *buffers)
{
    EVENT("(GLsizei n = %d, const GLuint *buffers = 0x%016" PRIxPTR ")", n, (uintptr_t)buffers);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateDeleteBuffers(context, n, buffers));
        if (isCallValid)
        {
            context->deleteBuffers(n, buffers);
        }
        ANGLE_CAPTURE(DeleteBuffers, isCallValid, context, n, buffers);
    }
}

void GL_APIENTRY DeleteFencesNVContextANGLE(GLeglContext ctx, GLsizei n, const GLuint *fences)
{
    EVENT("(GLsizei n = %d, const GLuint *fences = 0x%016" PRIxPTR ")", n, (uintptr_t)fences);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateDeleteFencesNV(context, n, fences));
        if (isCallValid)
        {
            context->deleteFencesNV(n, fences);
        }
        ANGLE_CAPTURE(DeleteFencesNV, isCallValid, context, n, fences);
    }
}

void GL_APIENTRY DeleteFramebuffersContextANGLE(GLeglContext ctx,
                                                GLsizei n,
                                                const GLuint *framebuffers)
{
    EVENT("(GLsizei n = %d, const GLuint *framebuffers = 0x%016" PRIxPTR ")", n,
          (uintptr_t)framebuffers);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateDeleteFramebuffers(context, n, framebuffers));
        if (isCallValid)
        {
            context->deleteFramebuffers(n, framebuffers);
        }
        ANGLE_CAPTURE(DeleteFramebuffers, isCallValid, context, n, framebuffers);
    }
}

void GL_APIENTRY DeleteFramebuffersOESContextANGLE(GLeglContext ctx,
                                                   GLsizei n,
                                                   const GLuint *framebuffers)
{
    EVENT("(GLsizei n = %d, const GLuint *framebuffers = 0x%016" PRIxPTR ")", n,
          (uintptr_t)framebuffers);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateDeleteFramebuffersOES(context, n, framebuffers));
        if (isCallValid)
        {
            context->deleteFramebuffers(n, framebuffers);
        }
        ANGLE_CAPTURE(DeleteFramebuffersOES, isCallValid, context, n, framebuffers);
    }
}

void GL_APIENTRY DeleteMemoryObjectsEXTContextANGLE(GLeglContext ctx,
                                                    GLsizei n,
                                                    const GLuint *memoryObjects)
{
    EVENT("(GLsizei n = %d, const GLuint *memoryObjects = 0x%016" PRIxPTR ")", n,
          (uintptr_t)memoryObjects);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateDeleteMemoryObjectsEXT(context, n, memoryObjects));
        if (isCallValid)
        {
            context->deleteMemoryObjects(n, memoryObjects);
        }
        ANGLE_CAPTURE(DeleteMemoryObjectsEXT, isCallValid, context, n, memoryObjects);
    }
}

void GL_APIENTRY DeleteProgramContextANGLE(GLeglContext ctx, GLuint program)
{
    EVENT("(GLuint program = %u)", program);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateDeleteProgram(context, program));
        if (isCallValid)
        {
            context->deleteProgram(program);
        }
        ANGLE_CAPTURE(DeleteProgram, isCallValid, context, program);
    }
}

void GL_APIENTRY DeleteProgramPipelinesContextANGLE(GLeglContext ctx,
                                                    GLsizei n,
                                                    const GLuint *pipelines)
{
    EVENT("(GLsizei n = %d, const GLuint *pipelines = 0x%016" PRIxPTR ")", n, (uintptr_t)pipelines);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateDeleteProgramPipelines(context, n, pipelines));
        if (isCallValid)
        {
            context->deleteProgramPipelines(n, pipelines);
        }
        ANGLE_CAPTURE(DeleteProgramPipelines, isCallValid, context, n, pipelines);
    }
}

void GL_APIENTRY DeleteQueriesContextANGLE(GLeglContext ctx, GLsizei n, const GLuint *ids)
{
    EVENT("(GLsizei n = %d, const GLuint *ids = 0x%016" PRIxPTR ")", n, (uintptr_t)ids);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateDeleteQueries(context, n, ids));
        if (isCallValid)
        {
            context->deleteQueries(n, ids);
        }
        ANGLE_CAPTURE(DeleteQueries, isCallValid, context, n, ids);
    }
}

void GL_APIENTRY DeleteQueriesEXTContextANGLE(GLeglContext ctx, GLsizei n, const GLuint *ids)
{
    EVENT("(GLsizei n = %d, const GLuint *ids = 0x%016" PRIxPTR ")", n, (uintptr_t)ids);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateDeleteQueriesEXT(context, n, ids));
        if (isCallValid)
        {
            context->deleteQueries(n, ids);
        }
        ANGLE_CAPTURE(DeleteQueriesEXT, isCallValid, context, n, ids);
    }
}

void GL_APIENTRY DeleteRenderbuffersContextANGLE(GLeglContext ctx,
                                                 GLsizei n,
                                                 const GLuint *renderbuffers)
{
    EVENT("(GLsizei n = %d, const GLuint *renderbuffers = 0x%016" PRIxPTR ")", n,
          (uintptr_t)renderbuffers);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateDeleteRenderbuffers(context, n, renderbuffers));
        if (isCallValid)
        {
            context->deleteRenderbuffers(n, renderbuffers);
        }
        ANGLE_CAPTURE(DeleteRenderbuffers, isCallValid, context, n, renderbuffers);
    }
}

void GL_APIENTRY DeleteRenderbuffersOESContextANGLE(GLeglContext ctx,
                                                    GLsizei n,
                                                    const GLuint *renderbuffers)
{
    EVENT("(GLsizei n = %d, const GLuint *renderbuffers = 0x%016" PRIxPTR ")", n,
          (uintptr_t)renderbuffers);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateDeleteRenderbuffersOES(context, n, renderbuffers));
        if (isCallValid)
        {
            context->deleteRenderbuffers(n, renderbuffers);
        }
        ANGLE_CAPTURE(DeleteRenderbuffersOES, isCallValid, context, n, renderbuffers);
    }
}

void GL_APIENTRY DeleteSamplersContextANGLE(GLeglContext ctx, GLsizei count, const GLuint *samplers)
{
    EVENT("(GLsizei count = %d, const GLuint *samplers = 0x%016" PRIxPTR ")", count,
          (uintptr_t)samplers);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateDeleteSamplers(context, count, samplers));
        if (isCallValid)
        {
            context->deleteSamplers(count, samplers);
        }
        ANGLE_CAPTURE(DeleteSamplers, isCallValid, context, count, samplers);
    }
}

void GL_APIENTRY DeleteSemaphoresEXTContextANGLE(GLeglContext ctx,
                                                 GLsizei n,
                                                 const GLuint *semaphores)
{
    EVENT("(GLsizei n = %d, const GLuint *semaphores = 0x%016" PRIxPTR ")", n,
          (uintptr_t)semaphores);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateDeleteSemaphoresEXT(context, n, semaphores));
        if (isCallValid)
        {
            context->deleteSemaphores(n, semaphores);
        }
        ANGLE_CAPTURE(DeleteSemaphoresEXT, isCallValid, context, n, semaphores);
    }
}

void GL_APIENTRY DeleteShaderContextANGLE(GLeglContext ctx, GLuint shader)
{
    EVENT("(GLuint shader = %u)", shader);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateDeleteShader(context, shader));
        if (isCallValid)
        {
            context->deleteShader(shader);
        }
        ANGLE_CAPTURE(DeleteShader, isCallValid, context, shader);
    }
}

void GL_APIENTRY DeleteSyncContextANGLE(GLeglContext ctx, GLsync sync)
{
    EVENT("(GLsync sync = 0x%016" PRIxPTR ")", (uintptr_t)sync);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateDeleteSync(context, sync));
        if (isCallValid)
        {
            context->deleteSync(sync);
        }
        ANGLE_CAPTURE(DeleteSync, isCallValid, context, sync);
    }
}

void GL_APIENTRY DeleteTexturesContextANGLE(GLeglContext ctx, GLsizei n, const GLuint *textures)
{
    EVENT("(GLsizei n = %d, const GLuint *textures = 0x%016" PRIxPTR ")", n, (uintptr_t)textures);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateDeleteTextures(context, n, textures));
        if (isCallValid)
        {
            context->deleteTextures(n, textures);
        }
        ANGLE_CAPTURE(DeleteTextures, isCallValid, context, n, textures);
    }
}

void GL_APIENTRY DeleteTransformFeedbacksContextANGLE(GLeglContext ctx,
                                                      GLsizei n,
                                                      const GLuint *ids)
{
    EVENT("(GLsizei n = %d, const GLuint *ids = 0x%016" PRIxPTR ")", n, (uintptr_t)ids);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateDeleteTransformFeedbacks(context, n, ids));
        if (isCallValid)
        {
            context->deleteTransformFeedbacks(n, ids);
        }
        ANGLE_CAPTURE(DeleteTransformFeedbacks, isCallValid, context, n, ids);
    }
}

void GL_APIENTRY DeleteVertexArraysContextANGLE(GLeglContext ctx, GLsizei n, const GLuint *arrays)
{
    EVENT("(GLsizei n = %d, const GLuint *arrays = 0x%016" PRIxPTR ")", n, (uintptr_t)arrays);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateDeleteVertexArrays(context, n, arrays));
        if (isCallValid)
        {
            context->deleteVertexArrays(n, arrays);
        }
        ANGLE_CAPTURE(DeleteVertexArrays, isCallValid, context, n, arrays);
    }
}

void GL_APIENTRY DeleteVertexArraysOESContextANGLE(GLeglContext ctx,
                                                   GLsizei n,
                                                   const GLuint *arrays)
{
    EVENT("(GLsizei n = %d, const GLuint *arrays = 0x%016" PRIxPTR ")", n, (uintptr_t)arrays);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateDeleteVertexArraysOES(context, n, arrays));
        if (isCallValid)
        {
            context->deleteVertexArrays(n, arrays);
        }
        ANGLE_CAPTURE(DeleteVertexArraysOES, isCallValid, context, n, arrays);
    }
}

void GL_APIENTRY DepthFuncContextANGLE(GLeglContext ctx, GLenum func)
{
    EVENT("(GLenum func = 0x%X)", func);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateDepthFunc(context, func));
        if (isCallValid)
        {
            context->depthFunc(func);
        }
        ANGLE_CAPTURE(DepthFunc, isCallValid, context, func);
    }
}

void GL_APIENTRY DepthMaskContextANGLE(GLeglContext ctx, GLboolean flag)
{
    EVENT("(GLboolean flag = %u)", flag);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateDepthMask(context, flag));
        if (isCallValid)
        {
            context->depthMask(flag);
        }
        ANGLE_CAPTURE(DepthMask, isCallValid, context, flag);
    }
}

void GL_APIENTRY DepthRangefContextANGLE(GLeglContext ctx, GLfloat n, GLfloat f)
{
    EVENT("(GLfloat n = %f, GLfloat f = %f)", n, f);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateDepthRangef(context, n, f));
        if (isCallValid)
        {
            context->depthRangef(n, f);
        }
        ANGLE_CAPTURE(DepthRangef, isCallValid, context, n, f);
    }
}

void GL_APIENTRY DepthRangexContextANGLE(GLeglContext ctx, GLfixed n, GLfixed f)
{
    EVENT("(GLfixed n = 0x%X, GLfixed f = 0x%X)", n, f);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateDepthRangex(context, n, f));
        if (isCallValid)
        {
            context->depthRangex(n, f);
        }
        ANGLE_CAPTURE(DepthRangex, isCallValid, context, n, f);
    }
}

void GL_APIENTRY DetachShaderContextANGLE(GLeglContext ctx, GLuint program, GLuint shader)
{
    EVENT("(GLuint program = %u, GLuint shader = %u)", program, shader);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateDetachShader(context, program, shader));
        if (isCallValid)
        {
            context->detachShader(program, shader);
        }
        ANGLE_CAPTURE(DetachShader, isCallValid, context, program, shader);
    }
}

void GL_APIENTRY DisableContextANGLE(GLeglContext ctx, GLenum cap)
{
    EVENT("(GLenum cap = 0x%X)", cap);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateDisable(context, cap));
        if (isCallValid)
        {
            context->disable(cap);
        }
        ANGLE_CAPTURE(Disable, isCallValid, context, cap);
    }
}

void GL_APIENTRY DisableClientStateContextANGLE(GLeglContext ctx, GLenum array)
{
    EVENT("(GLenum array = 0x%X)", array);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        ClientVertexArrayType arrayPacked = FromGLenum<ClientVertexArrayType>(array);
        bool isCallValid =
            (context->skipValidation() || ValidateDisableClientState(context, arrayPacked));
        if (isCallValid)
        {
            context->disableClientState(arrayPacked);
        }
        ANGLE_CAPTURE(DisableClientState, isCallValid, context, arrayPacked);
    }
}

void GL_APIENTRY DisableVertexAttribArrayContextANGLE(GLeglContext ctx, GLuint index)
{
    EVENT("(GLuint index = %u)", index);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateDisableVertexAttribArray(context, index));
        if (isCallValid)
        {
            context->disableVertexAttribArray(index);
        }
        ANGLE_CAPTURE(DisableVertexAttribArray, isCallValid, context, index);
    }
}

void GL_APIENTRY DiscardFramebufferEXTContextANGLE(GLeglContext ctx,
                                                   GLenum target,
                                                   GLsizei numAttachments,
                                                   const GLenum *attachments)
{
    EVENT(
        "(GLenum target = 0x%X, GLsizei numAttachments = %d, const GLenum *attachments = "
        "0x%016" PRIxPTR ")",
        target, numAttachments, (uintptr_t)attachments);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() ||
             ValidateDiscardFramebufferEXT(context, target, numAttachments, attachments));
        if (isCallValid)
        {
            context->discardFramebuffer(target, numAttachments, attachments);
        }
        ANGLE_CAPTURE(DiscardFramebufferEXT, isCallValid, context, target, numAttachments,
                      attachments);
    }
}

void GL_APIENTRY DispatchComputeContextANGLE(GLeglContext ctx,
                                             GLuint num_groups_x,
                                             GLuint num_groups_y,
                                             GLuint num_groups_z)
{
    EVENT("(GLuint num_groups_x = %u, GLuint num_groups_y = %u, GLuint num_groups_z = %u)",
          num_groups_x, num_groups_y, num_groups_z);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() ||
             ValidateDispatchCompute(context, num_groups_x, num_groups_y, num_groups_z));
        if (isCallValid)
        {
            context->dispatchCompute(num_groups_x, num_groups_y, num_groups_z);
        }
        ANGLE_CAPTURE(DispatchCompute, isCallValid, context, num_groups_x, num_groups_y,
                      num_groups_z);
    }
}

void GL_APIENTRY DispatchComputeIndirectContextANGLE(GLeglContext ctx, GLintptr indirect)
{
    EVENT("(GLintptr indirect = %llu)", static_cast<unsigned long long>(indirect));

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateDispatchComputeIndirect(context, indirect));
        if (isCallValid)
        {
            context->dispatchComputeIndirect(indirect);
        }
        ANGLE_CAPTURE(DispatchComputeIndirect, isCallValid, context, indirect);
    }
}

void GL_APIENTRY DrawArraysContextANGLE(GLeglContext ctx, GLenum mode, GLint first, GLsizei count)
{
    EVENT("(GLenum mode = 0x%X, GLint first = %d, GLsizei count = %d)", mode, first, count);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        PrimitiveMode modePacked = FromGLenum<PrimitiveMode>(mode);
        bool isCallValid =
            (context->skipValidation() || ValidateDrawArrays(context, modePacked, first, count));
        if (isCallValid)
        {
            context->drawArrays(modePacked, first, count);
        }
        ANGLE_CAPTURE(DrawArrays, isCallValid, context, modePacked, first, count);
    }
}

void GL_APIENTRY DrawArraysIndirectContextANGLE(GLeglContext ctx, GLenum mode, const void *indirect)
{
    EVENT("(GLenum mode = 0x%X, const void *indirect = 0x%016" PRIxPTR ")", mode,
          (uintptr_t)indirect);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        PrimitiveMode modePacked = FromGLenum<PrimitiveMode>(mode);
        bool isCallValid         = (context->skipValidation() ||
                            ValidateDrawArraysIndirect(context, modePacked, indirect));
        if (isCallValid)
        {
            context->drawArraysIndirect(modePacked, indirect);
        }
        ANGLE_CAPTURE(DrawArraysIndirect, isCallValid, context, modePacked, indirect);
    }
}

void GL_APIENTRY DrawArraysInstancedContextANGLE(GLeglContext ctx,
                                                 GLenum mode,
                                                 GLint first,
                                                 GLsizei count,
                                                 GLsizei instancecount)
{
    EVENT("(GLenum mode = 0x%X, GLint first = %d, GLsizei count = %d, GLsizei instancecount = %d)",
          mode, first, count, instancecount);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        PrimitiveMode modePacked = FromGLenum<PrimitiveMode>(mode);
        bool isCallValid =
            (context->skipValidation() ||
             ValidateDrawArraysInstanced(context, modePacked, first, count, instancecount));
        if (isCallValid)
        {
            context->drawArraysInstanced(modePacked, first, count, instancecount);
        }
        ANGLE_CAPTURE(DrawArraysInstanced, isCallValid, context, modePacked, first, count,
                      instancecount);
    }
}

void GL_APIENTRY DrawArraysInstancedANGLEContextANGLE(GLeglContext ctx,
                                                      GLenum mode,
                                                      GLint first,
                                                      GLsizei count,
                                                      GLsizei primcount)
{
    EVENT("(GLenum mode = 0x%X, GLint first = %d, GLsizei count = %d, GLsizei primcount = %d)",
          mode, first, count, primcount);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        PrimitiveMode modePacked = FromGLenum<PrimitiveMode>(mode);
        bool isCallValid =
            (context->skipValidation() ||
             ValidateDrawArraysInstancedANGLE(context, modePacked, first, count, primcount));
        if (isCallValid)
        {
            context->drawArraysInstanced(modePacked, first, count, primcount);
        }
        ANGLE_CAPTURE(DrawArraysInstancedANGLE, isCallValid, context, modePacked, first, count,
                      primcount);
    }
}

void GL_APIENTRY DrawArraysInstancedEXTContextANGLE(GLeglContext ctx,
                                                    GLenum mode,
                                                    GLint start,
                                                    GLsizei count,
                                                    GLsizei primcount)
{
    EVENT("(GLenum mode = 0x%X, GLint start = %d, GLsizei count = %d, GLsizei primcount = %d)",
          mode, start, count, primcount);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        PrimitiveMode modePacked = FromGLenum<PrimitiveMode>(mode);
        bool isCallValid =
            (context->skipValidation() ||
             ValidateDrawArraysInstancedEXT(context, modePacked, start, count, primcount));
        if (isCallValid)
        {
            context->drawArraysInstanced(modePacked, start, count, primcount);
        }
        ANGLE_CAPTURE(DrawArraysInstancedEXT, isCallValid, context, modePacked, start, count,
                      primcount);
    }
}

void GL_APIENTRY DrawBuffersContextANGLE(GLeglContext ctx, GLsizei n, const GLenum *bufs)
{
    EVENT("(GLsizei n = %d, const GLenum *bufs = 0x%016" PRIxPTR ")", n, (uintptr_t)bufs);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateDrawBuffers(context, n, bufs));
        if (isCallValid)
        {
            context->drawBuffers(n, bufs);
        }
        ANGLE_CAPTURE(DrawBuffers, isCallValid, context, n, bufs);
    }
}

void GL_APIENTRY DrawBuffersEXTContextANGLE(GLeglContext ctx, GLsizei n, const GLenum *bufs)
{
    EVENT("(GLsizei n = %d, const GLenum *bufs = 0x%016" PRIxPTR ")", n, (uintptr_t)bufs);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateDrawBuffersEXT(context, n, bufs));
        if (isCallValid)
        {
            context->drawBuffers(n, bufs);
        }
        ANGLE_CAPTURE(DrawBuffersEXT, isCallValid, context, n, bufs);
    }
}

void GL_APIENTRY DrawElementsContextANGLE(GLeglContext ctx,
                                          GLenum mode,
                                          GLsizei count,
                                          GLenum type,
                                          const void *indices)
{
    EVENT(
        "(GLenum mode = 0x%X, GLsizei count = %d, GLenum type = 0x%X, const void *indices = "
        "0x%016" PRIxPTR ")",
        mode, count, type, (uintptr_t)indices);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        PrimitiveMode modePacked    = FromGLenum<PrimitiveMode>(mode);
        DrawElementsType typePacked = FromGLenum<DrawElementsType>(type);
        bool isCallValid            = (context->skipValidation() ||
                            ValidateDrawElements(context, modePacked, count, typePacked, indices));
        if (isCallValid)
        {
            context->drawElements(modePacked, count, typePacked, indices);
        }
        ANGLE_CAPTURE(DrawElements, isCallValid, context, modePacked, count, typePacked, indices);
    }
}

void GL_APIENTRY DrawElementsIndirectContextANGLE(GLeglContext ctx,
                                                  GLenum mode,
                                                  GLenum type,
                                                  const void *indirect)
{
    EVENT("(GLenum mode = 0x%X, GLenum type = 0x%X, const void *indirect = 0x%016" PRIxPTR ")",
          mode, type, (uintptr_t)indirect);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        PrimitiveMode modePacked    = FromGLenum<PrimitiveMode>(mode);
        DrawElementsType typePacked = FromGLenum<DrawElementsType>(type);
        bool isCallValid =
            (context->skipValidation() ||
             ValidateDrawElementsIndirect(context, modePacked, typePacked, indirect));
        if (isCallValid)
        {
            context->drawElementsIndirect(modePacked, typePacked, indirect);
        }
        ANGLE_CAPTURE(DrawElementsIndirect, isCallValid, context, modePacked, typePacked, indirect);
    }
}

void GL_APIENTRY DrawElementsInstancedContextANGLE(GLeglContext ctx,
                                                   GLenum mode,
                                                   GLsizei count,
                                                   GLenum type,
                                                   const void *indices,
                                                   GLsizei instancecount)
{
    EVENT(
        "(GLenum mode = 0x%X, GLsizei count = %d, GLenum type = 0x%X, const void *indices = "
        "0x%016" PRIxPTR ", GLsizei instancecount = %d)",
        mode, count, type, (uintptr_t)indices, instancecount);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        PrimitiveMode modePacked    = FromGLenum<PrimitiveMode>(mode);
        DrawElementsType typePacked = FromGLenum<DrawElementsType>(type);
        bool isCallValid            = (context->skipValidation() ||
                            ValidateDrawElementsInstanced(context, modePacked, count, typePacked,
                                                          indices, instancecount));
        if (isCallValid)
        {
            context->drawElementsInstanced(modePacked, count, typePacked, indices, instancecount);
        }
        ANGLE_CAPTURE(DrawElementsInstanced, isCallValid, context, modePacked, count, typePacked,
                      indices, instancecount);
    }
}

void GL_APIENTRY DrawElementsInstancedANGLEContextANGLE(GLeglContext ctx,
                                                        GLenum mode,
                                                        GLsizei count,
                                                        GLenum type,
                                                        const void *indices,
                                                        GLsizei primcount)
{
    EVENT(
        "(GLenum mode = 0x%X, GLsizei count = %d, GLenum type = 0x%X, const void *indices = "
        "0x%016" PRIxPTR ", GLsizei primcount = %d)",
        mode, count, type, (uintptr_t)indices, primcount);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        PrimitiveMode modePacked    = FromGLenum<PrimitiveMode>(mode);
        DrawElementsType typePacked = FromGLenum<DrawElementsType>(type);
        bool isCallValid            = (context->skipValidation() ||
                            ValidateDrawElementsInstancedANGLE(context, modePacked, count,
                                                               typePacked, indices, primcount));
        if (isCallValid)
        {
            context->drawElementsInstanced(modePacked, count, typePacked, indices, primcount);
        }
        ANGLE_CAPTURE(DrawElementsInstancedANGLE, isCallValid, context, modePacked, count,
                      typePacked, indices, primcount);
    }
}

void GL_APIENTRY DrawElementsInstancedEXTContextANGLE(GLeglContext ctx,
                                                      GLenum mode,
                                                      GLsizei count,
                                                      GLenum type,
                                                      const void *indices,
                                                      GLsizei primcount)
{
    EVENT(
        "(GLenum mode = 0x%X, GLsizei count = %d, GLenum type = 0x%X, const void *indices = "
        "0x%016" PRIxPTR ", GLsizei primcount = %d)",
        mode, count, type, (uintptr_t)indices, primcount);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        PrimitiveMode modePacked    = FromGLenum<PrimitiveMode>(mode);
        DrawElementsType typePacked = FromGLenum<DrawElementsType>(type);
        bool isCallValid            = (context->skipValidation() ||
                            ValidateDrawElementsInstancedEXT(context, modePacked, count, typePacked,
                                                             indices, primcount));
        if (isCallValid)
        {
            context->drawElementsInstanced(modePacked, count, typePacked, indices, primcount);
        }
        ANGLE_CAPTURE(DrawElementsInstancedEXT, isCallValid, context, modePacked, count, typePacked,
                      indices, primcount);
    }
}

void GL_APIENTRY DrawRangeElementsContextANGLE(GLeglContext ctx,
                                               GLenum mode,
                                               GLuint start,
                                               GLuint end,
                                               GLsizei count,
                                               GLenum type,
                                               const void *indices)
{
    EVENT(
        "(GLenum mode = 0x%X, GLuint start = %u, GLuint end = %u, GLsizei count = %d, GLenum type "
        "= 0x%X, const void *indices = 0x%016" PRIxPTR ")",
        mode, start, end, count, type, (uintptr_t)indices);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        PrimitiveMode modePacked    = FromGLenum<PrimitiveMode>(mode);
        DrawElementsType typePacked = FromGLenum<DrawElementsType>(type);
        bool isCallValid =
            (context->skipValidation() || ValidateDrawRangeElements(context, modePacked, start, end,
                                                                    count, typePacked, indices));
        if (isCallValid)
        {
            context->drawRangeElements(modePacked, start, end, count, typePacked, indices);
        }
        ANGLE_CAPTURE(DrawRangeElements, isCallValid, context, modePacked, start, end, count,
                      typePacked, indices);
    }
}

void GL_APIENTRY DrawTexfOESContextANGLE(GLeglContext ctx,
                                         GLfloat x,
                                         GLfloat y,
                                         GLfloat z,
                                         GLfloat width,
                                         GLfloat height)
{
    EVENT(
        "(GLfloat x = %f, GLfloat y = %f, GLfloat z = %f, GLfloat width = %f, GLfloat height = %f)",
        x, y, z, width, height);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateDrawTexfOES(context, x, y, z, width, height));
        if (isCallValid)
        {
            context->drawTexf(x, y, z, width, height);
        }
        ANGLE_CAPTURE(DrawTexfOES, isCallValid, context, x, y, z, width, height);
    }
}

void GL_APIENTRY DrawTexfvOESContextANGLE(GLeglContext ctx, const GLfloat *coords)
{
    EVENT("(const GLfloat *coords = 0x%016" PRIxPTR ")", (uintptr_t)coords);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateDrawTexfvOES(context, coords));
        if (isCallValid)
        {
            context->drawTexfv(coords);
        }
        ANGLE_CAPTURE(DrawTexfvOES, isCallValid, context, coords);
    }
}

void GL_APIENTRY
DrawTexiOESContextANGLE(GLeglContext ctx, GLint x, GLint y, GLint z, GLint width, GLint height)
{
    EVENT("(GLint x = %d, GLint y = %d, GLint z = %d, GLint width = %d, GLint height = %d)", x, y,
          z, width, height);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateDrawTexiOES(context, x, y, z, width, height));
        if (isCallValid)
        {
            context->drawTexi(x, y, z, width, height);
        }
        ANGLE_CAPTURE(DrawTexiOES, isCallValid, context, x, y, z, width, height);
    }
}

void GL_APIENTRY DrawTexivOESContextANGLE(GLeglContext ctx, const GLint *coords)
{
    EVENT("(const GLint *coords = 0x%016" PRIxPTR ")", (uintptr_t)coords);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateDrawTexivOES(context, coords));
        if (isCallValid)
        {
            context->drawTexiv(coords);
        }
        ANGLE_CAPTURE(DrawTexivOES, isCallValid, context, coords);
    }
}

void GL_APIENTRY DrawTexsOESContextANGLE(GLeglContext ctx,
                                         GLshort x,
                                         GLshort y,
                                         GLshort z,
                                         GLshort width,
                                         GLshort height)
{
    EVENT(
        "(GLshort x = %d, GLshort y = %d, GLshort z = %d, GLshort width = %d, GLshort height = %d)",
        x, y, z, width, height);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateDrawTexsOES(context, x, y, z, width, height));
        if (isCallValid)
        {
            context->drawTexs(x, y, z, width, height);
        }
        ANGLE_CAPTURE(DrawTexsOES, isCallValid, context, x, y, z, width, height);
    }
}

void GL_APIENTRY DrawTexsvOESContextANGLE(GLeglContext ctx, const GLshort *coords)
{
    EVENT("(const GLshort *coords = 0x%016" PRIxPTR ")", (uintptr_t)coords);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateDrawTexsvOES(context, coords));
        if (isCallValid)
        {
            context->drawTexsv(coords);
        }
        ANGLE_CAPTURE(DrawTexsvOES, isCallValid, context, coords);
    }
}

void GL_APIENTRY DrawTexxOESContextANGLE(GLeglContext ctx,
                                         GLfixed x,
                                         GLfixed y,
                                         GLfixed z,
                                         GLfixed width,
                                         GLfixed height)
{
    EVENT(
        "(GLfixed x = 0x%X, GLfixed y = 0x%X, GLfixed z = 0x%X, GLfixed width = 0x%X, GLfixed "
        "height = 0x%X)",
        x, y, z, width, height);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateDrawTexxOES(context, x, y, z, width, height));
        if (isCallValid)
        {
            context->drawTexx(x, y, z, width, height);
        }
        ANGLE_CAPTURE(DrawTexxOES, isCallValid, context, x, y, z, width, height);
    }
}

void GL_APIENTRY DrawTexxvOESContextANGLE(GLeglContext ctx, const GLfixed *coords)
{
    EVENT("(const GLfixed *coords = 0x%016" PRIxPTR ")", (uintptr_t)coords);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateDrawTexxvOES(context, coords));
        if (isCallValid)
        {
            context->drawTexxv(coords);
        }
        ANGLE_CAPTURE(DrawTexxvOES, isCallValid, context, coords);
    }
}

void GL_APIENTRY EGLImageTargetRenderbufferStorageOESContextANGLE(GLeglContext ctx,
                                                                  GLenum target,
                                                                  GLeglImageOES image)
{
    EVENT("(GLenum target = 0x%X, GLeglImageOES image = 0x%016" PRIxPTR ")", target,
          (uintptr_t)image);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateEGLImageTargetRenderbufferStorageOES(context, target, image));
        if (isCallValid)
        {
            context->eGLImageTargetRenderbufferStorage(target, image);
        }
        ANGLE_CAPTURE(EGLImageTargetRenderbufferStorageOES, isCallValid, context, target, image);
    }
}

void GL_APIENTRY EGLImageTargetTexture2DOESContextANGLE(GLeglContext ctx,
                                                        GLenum target,
                                                        GLeglImageOES image)
{
    EVENT("(GLenum target = 0x%X, GLeglImageOES image = 0x%016" PRIxPTR ")", target,
          (uintptr_t)image);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        TextureType targetPacked = FromGLenum<TextureType>(target);
        bool isCallValid         = (context->skipValidation() ||
                            ValidateEGLImageTargetTexture2DOES(context, targetPacked, image));
        if (isCallValid)
        {
            context->eGLImageTargetTexture2D(targetPacked, image);
        }
        ANGLE_CAPTURE(EGLImageTargetTexture2DOES, isCallValid, context, targetPacked, image);
    }
}

void GL_APIENTRY EnableContextANGLE(GLeglContext ctx, GLenum cap)
{
    EVENT("(GLenum cap = 0x%X)", cap);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateEnable(context, cap));
        if (isCallValid)
        {
            context->enable(cap);
        }
        ANGLE_CAPTURE(Enable, isCallValid, context, cap);
    }
}

void GL_APIENTRY EnableClientStateContextANGLE(GLeglContext ctx, GLenum array)
{
    EVENT("(GLenum array = 0x%X)", array);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        ClientVertexArrayType arrayPacked = FromGLenum<ClientVertexArrayType>(array);
        bool isCallValid =
            (context->skipValidation() || ValidateEnableClientState(context, arrayPacked));
        if (isCallValid)
        {
            context->enableClientState(arrayPacked);
        }
        ANGLE_CAPTURE(EnableClientState, isCallValid, context, arrayPacked);
    }
}

void GL_APIENTRY EnableVertexAttribArrayContextANGLE(GLeglContext ctx, GLuint index)
{
    EVENT("(GLuint index = %u)", index);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateEnableVertexAttribArray(context, index));
        if (isCallValid)
        {
            context->enableVertexAttribArray(index);
        }
        ANGLE_CAPTURE(EnableVertexAttribArray, isCallValid, context, index);
    }
}

void GL_APIENTRY EndQueryContextANGLE(GLeglContext ctx, GLenum target)
{
    EVENT("(GLenum target = 0x%X)", target);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        QueryType targetPacked = FromGLenum<QueryType>(target);
        bool isCallValid = (context->skipValidation() || ValidateEndQuery(context, targetPacked));
        if (isCallValid)
        {
            context->endQuery(targetPacked);
        }
        ANGLE_CAPTURE(EndQuery, isCallValid, context, targetPacked);
    }
}

void GL_APIENTRY EndQueryEXTContextANGLE(GLeglContext ctx, GLenum target)
{
    EVENT("(GLenum target = 0x%X)", target);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        QueryType targetPacked = FromGLenum<QueryType>(target);
        bool isCallValid =
            (context->skipValidation() || ValidateEndQueryEXT(context, targetPacked));
        if (isCallValid)
        {
            context->endQuery(targetPacked);
        }
        ANGLE_CAPTURE(EndQueryEXT, isCallValid, context, targetPacked);
    }
}

void GL_APIENTRY EndTransformFeedbackContextANGLE(GLeglContext ctx)
{
    EVENT("()");

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateEndTransformFeedback(context));
        if (isCallValid)
        {
            context->endTransformFeedback();
        }
        ANGLE_CAPTURE(EndTransformFeedback, isCallValid, context);
    }
}

GLsync GL_APIENTRY FenceSyncContextANGLE(GLeglContext ctx, GLenum condition, GLbitfield flags)
{
    EVENT("(GLenum condition = 0x%X, GLbitfield flags = 0x%X)", condition, flags);

    Context *context = static_cast<gl::Context *>(ctx);
    GLsync returnValue;
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateFenceSync(context, condition, flags));
        if (isCallValid)
        {
            returnValue = context->fenceSync(condition, flags);
        }
        else
        {
            returnValue = GetDefaultReturnValue<EntryPoint::FenceSync, GLsync>();
        }
        ANGLE_CAPTURE(FenceSync, isCallValid, context, condition, flags, returnValue);
    }
    else
    {
        returnValue = GetDefaultReturnValue<EntryPoint::FenceSync, GLsync>();
    }
    return returnValue;
}

void GL_APIENTRY FinishContextANGLE(GLeglContext ctx)
{
    EVENT("()");

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateFinish(context));
        if (isCallValid)
        {
            context->finish();
        }
        ANGLE_CAPTURE(Finish, isCallValid, context);
    }
}

void GL_APIENTRY FinishFenceNVContextANGLE(GLeglContext ctx, GLuint fence)
{
    EVENT("(GLuint fence = %u)", fence);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateFinishFenceNV(context, fence));
        if (isCallValid)
        {
            context->finishFenceNV(fence);
        }
        ANGLE_CAPTURE(FinishFenceNV, isCallValid, context, fence);
    }
}

void GL_APIENTRY FlushContextANGLE(GLeglContext ctx)
{
    EVENT("()");

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateFlush(context));
        if (isCallValid)
        {
            context->flush();
        }
        ANGLE_CAPTURE(Flush, isCallValid, context);
    }
}

void GL_APIENTRY FlushMappedBufferRangeContextANGLE(GLeglContext ctx,
                                                    GLenum target,
                                                    GLintptr offset,
                                                    GLsizeiptr length)
{
    EVENT("(GLenum target = 0x%X, GLintptr offset = %llu, GLsizeiptr length = %llu)", target,
          static_cast<unsigned long long>(offset), static_cast<unsigned long long>(length));

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        BufferBinding targetPacked = FromGLenum<BufferBinding>(target);
        bool isCallValid           = (context->skipValidation() ||
                            ValidateFlushMappedBufferRange(context, targetPacked, offset, length));
        if (isCallValid)
        {
            context->flushMappedBufferRange(targetPacked, offset, length);
        }
        ANGLE_CAPTURE(FlushMappedBufferRange, isCallValid, context, targetPacked, offset, length);
    }
}

void GL_APIENTRY FlushMappedBufferRangeEXTContextANGLE(GLeglContext ctx,
                                                       GLenum target,
                                                       GLintptr offset,
                                                       GLsizeiptr length)
{
    EVENT("(GLenum target = 0x%X, GLintptr offset = %llu, GLsizeiptr length = %llu)", target,
          static_cast<unsigned long long>(offset), static_cast<unsigned long long>(length));

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        BufferBinding targetPacked = FromGLenum<BufferBinding>(target);
        bool isCallValid =
            (context->skipValidation() ||
             ValidateFlushMappedBufferRangeEXT(context, targetPacked, offset, length));
        if (isCallValid)
        {
            context->flushMappedBufferRange(targetPacked, offset, length);
        }
        ANGLE_CAPTURE(FlushMappedBufferRangeEXT, isCallValid, context, targetPacked, offset,
                      length);
    }
}

void GL_APIENTRY FogfContextANGLE(GLeglContext ctx, GLenum pname, GLfloat param)
{
    EVENT("(GLenum pname = 0x%X, GLfloat param = %f)", pname, param);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateFogf(context, pname, param));
        if (isCallValid)
        {
            context->fogf(pname, param);
        }
        ANGLE_CAPTURE(Fogf, isCallValid, context, pname, param);
    }
}

void GL_APIENTRY FogfvContextANGLE(GLeglContext ctx, GLenum pname, const GLfloat *params)
{
    EVENT("(GLenum pname = 0x%X, const GLfloat *params = 0x%016" PRIxPTR ")", pname,
          (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateFogfv(context, pname, params));
        if (isCallValid)
        {
            context->fogfv(pname, params);
        }
        ANGLE_CAPTURE(Fogfv, isCallValid, context, pname, params);
    }
}

void GL_APIENTRY FogxContextANGLE(GLeglContext ctx, GLenum pname, GLfixed param)
{
    EVENT("(GLenum pname = 0x%X, GLfixed param = 0x%X)", pname, param);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateFogx(context, pname, param));
        if (isCallValid)
        {
            context->fogx(pname, param);
        }
        ANGLE_CAPTURE(Fogx, isCallValid, context, pname, param);
    }
}

void GL_APIENTRY FogxvContextANGLE(GLeglContext ctx, GLenum pname, const GLfixed *param)
{
    EVENT("(GLenum pname = 0x%X, const GLfixed *param = 0x%016" PRIxPTR ")", pname,
          (uintptr_t)param);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateFogxv(context, pname, param));
        if (isCallValid)
        {
            context->fogxv(pname, param);
        }
        ANGLE_CAPTURE(Fogxv, isCallValid, context, pname, param);
    }
}

void GL_APIENTRY FramebufferParameteriContextANGLE(GLeglContext ctx,
                                                   GLenum target,
                                                   GLenum pname,
                                                   GLint param)
{
    EVENT("(GLenum target = 0x%X, GLenum pname = 0x%X, GLint param = %d)", target, pname, param);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateFramebufferParameteri(context, target, pname, param));
        if (isCallValid)
        {
            context->framebufferParameteri(target, pname, param);
        }
        ANGLE_CAPTURE(FramebufferParameteri, isCallValid, context, target, pname, param);
    }
}

void GL_APIENTRY FramebufferRenderbufferContextANGLE(GLeglContext ctx,
                                                     GLenum target,
                                                     GLenum attachment,
                                                     GLenum renderbuffertarget,
                                                     GLuint renderbuffer)
{
    EVENT(
        "(GLenum target = 0x%X, GLenum attachment = 0x%X, GLenum renderbuffertarget = 0x%X, GLuint "
        "renderbuffer = %u)",
        target, attachment, renderbuffertarget, renderbuffer);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateFramebufferRenderbuffer(context, target, attachment,
                                                            renderbuffertarget, renderbuffer));
        if (isCallValid)
        {
            context->framebufferRenderbuffer(target, attachment, renderbuffertarget, renderbuffer);
        }
        ANGLE_CAPTURE(FramebufferRenderbuffer, isCallValid, context, target, attachment,
                      renderbuffertarget, renderbuffer);
    }
}

void GL_APIENTRY FramebufferRenderbufferOESContextANGLE(GLeglContext ctx,
                                                        GLenum target,
                                                        GLenum attachment,
                                                        GLenum renderbuffertarget,
                                                        GLuint renderbuffer)
{
    EVENT(
        "(GLenum target = 0x%X, GLenum attachment = 0x%X, GLenum renderbuffertarget = 0x%X, GLuint "
        "renderbuffer = %u)",
        target, attachment, renderbuffertarget, renderbuffer);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateFramebufferRenderbufferOES(context, target, attachment,
                                                               renderbuffertarget, renderbuffer));
        if (isCallValid)
        {
            context->framebufferRenderbuffer(target, attachment, renderbuffertarget, renderbuffer);
        }
        ANGLE_CAPTURE(FramebufferRenderbufferOES, isCallValid, context, target, attachment,
                      renderbuffertarget, renderbuffer);
    }
}

void GL_APIENTRY FramebufferTexture2DContextANGLE(GLeglContext ctx,
                                                  GLenum target,
                                                  GLenum attachment,
                                                  GLenum textarget,
                                                  GLuint texture,
                                                  GLint level)
{
    EVENT(
        "(GLenum target = 0x%X, GLenum attachment = 0x%X, GLenum textarget = 0x%X, GLuint texture "
        "= %u, GLint level = %d)",
        target, attachment, textarget, texture, level);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        TextureTarget textargetPacked = FromGLenum<TextureTarget>(textarget);
        bool isCallValid              = (context->skipValidation() ||
                            ValidateFramebufferTexture2D(context, target, attachment,
                                                         textargetPacked, texture, level));
        if (isCallValid)
        {
            context->framebufferTexture2D(target, attachment, textargetPacked, texture, level);
        }
        ANGLE_CAPTURE(FramebufferTexture2D, isCallValid, context, target, attachment,
                      textargetPacked, texture, level);
    }
}

void GL_APIENTRY FramebufferTexture2DOESContextANGLE(GLeglContext ctx,
                                                     GLenum target,
                                                     GLenum attachment,
                                                     GLenum textarget,
                                                     GLuint texture,
                                                     GLint level)
{
    EVENT(
        "(GLenum target = 0x%X, GLenum attachment = 0x%X, GLenum textarget = 0x%X, GLuint texture "
        "= %u, GLint level = %d)",
        target, attachment, textarget, texture, level);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        TextureTarget textargetPacked = FromGLenum<TextureTarget>(textarget);
        bool isCallValid              = (context->skipValidation() ||
                            ValidateFramebufferTexture2DOES(context, target, attachment,
                                                            textargetPacked, texture, level));
        if (isCallValid)
        {
            context->framebufferTexture2D(target, attachment, textargetPacked, texture, level);
        }
        ANGLE_CAPTURE(FramebufferTexture2DOES, isCallValid, context, target, attachment,
                      textargetPacked, texture, level);
    }
}

void GL_APIENTRY FramebufferTexture3DOESContextANGLE(GLeglContext ctx,
                                                     GLenum target,
                                                     GLenum attachment,
                                                     GLenum textarget,
                                                     GLuint texture,
                                                     GLint level,
                                                     GLint zoffset)
{
    EVENT(
        "(GLenum target = 0x%X, GLenum attachment = 0x%X, GLenum textarget = 0x%X, GLuint texture "
        "= %u, GLint level = %d, GLint zoffset = %d)",
        target, attachment, textarget, texture, level, zoffset);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        TextureTarget textargetPacked = FromGLenum<TextureTarget>(textarget);
        bool isCallValid =
            (context->skipValidation() ||
             ValidateFramebufferTexture3DOES(context, target, attachment, textargetPacked, texture,
                                             level, zoffset));
        if (isCallValid)
        {
            context->framebufferTexture3D(target, attachment, textargetPacked, texture, level,
                                          zoffset);
        }
        ANGLE_CAPTURE(FramebufferTexture3DOES, isCallValid, context, target, attachment,
                      textargetPacked, texture, level, zoffset);
    }
}

void GL_APIENTRY FramebufferTextureEXTContextANGLE(GLeglContext ctx,
                                                   GLenum target,
                                                   GLenum attachment,
                                                   GLuint texture,
                                                   GLint level)
{
    EVENT("(GLenum target = 0x%X, GLenum attachment = 0x%X, GLuint texture = %u, GLint level = %d)",
          target, attachment, texture, level);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() ||
             ValidateFramebufferTextureEXT(context, target, attachment, texture, level));
        if (isCallValid)
        {
            context->framebufferTexture(target, attachment, texture, level);
        }
        ANGLE_CAPTURE(FramebufferTextureEXT, isCallValid, context, target, attachment, texture,
                      level);
    }
}

void GL_APIENTRY FramebufferTextureLayerContextANGLE(GLeglContext ctx,
                                                     GLenum target,
                                                     GLenum attachment,
                                                     GLuint texture,
                                                     GLint level,
                                                     GLint layer)
{
    EVENT(
        "(GLenum target = 0x%X, GLenum attachment = 0x%X, GLuint texture = %u, GLint level = %d, "
        "GLint layer = %d)",
        target, attachment, texture, level, layer);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() ||
             ValidateFramebufferTextureLayer(context, target, attachment, texture, level, layer));
        if (isCallValid)
        {
            context->framebufferTextureLayer(target, attachment, texture, level, layer);
        }
        ANGLE_CAPTURE(FramebufferTextureLayer, isCallValid, context, target, attachment, texture,
                      level, layer);
    }
}

void GL_APIENTRY FramebufferTextureMultiviewOVRContextANGLE(GLeglContext ctx,
                                                            GLenum target,
                                                            GLenum attachment,
                                                            GLuint texture,
                                                            GLint level,
                                                            GLint baseViewIndex,
                                                            GLsizei numViews)
{
    EVENT(
        "(GLenum target = 0x%X, GLenum attachment = 0x%X, GLuint texture = %u, GLint level = %d, "
        "GLint baseViewIndex = %d, GLsizei numViews = %d)",
        target, attachment, texture, level, baseViewIndex, numViews);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateFramebufferTextureMultiviewOVR(
                                                             context, target, attachment, texture,
                                                             level, baseViewIndex, numViews));
        if (isCallValid)
        {
            context->framebufferTextureMultiview(target, attachment, texture, level, baseViewIndex,
                                                 numViews);
        }
        ANGLE_CAPTURE(FramebufferTextureMultiviewOVR, isCallValid, context, target, attachment,
                      texture, level, baseViewIndex, numViews);
    }
}

void GL_APIENTRY FrontFaceContextANGLE(GLeglContext ctx, GLenum mode)
{
    EVENT("(GLenum mode = 0x%X)", mode);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateFrontFace(context, mode));
        if (isCallValid)
        {
            context->frontFace(mode);
        }
        ANGLE_CAPTURE(FrontFace, isCallValid, context, mode);
    }
}

void GL_APIENTRY FrustumfContextANGLE(GLeglContext ctx,
                                      GLfloat l,
                                      GLfloat r,
                                      GLfloat b,
                                      GLfloat t,
                                      GLfloat n,
                                      GLfloat f)
{
    EVENT(
        "(GLfloat l = %f, GLfloat r = %f, GLfloat b = %f, GLfloat t = %f, GLfloat n = %f, GLfloat "
        "f = %f)",
        l, r, b, t, n, f);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateFrustumf(context, l, r, b, t, n, f));
        if (isCallValid)
        {
            context->frustumf(l, r, b, t, n, f);
        }
        ANGLE_CAPTURE(Frustumf, isCallValid, context, l, r, b, t, n, f);
    }
}

void GL_APIENTRY FrustumxContextANGLE(GLeglContext ctx,
                                      GLfixed l,
                                      GLfixed r,
                                      GLfixed b,
                                      GLfixed t,
                                      GLfixed n,
                                      GLfixed f)
{
    EVENT(
        "(GLfixed l = 0x%X, GLfixed r = 0x%X, GLfixed b = 0x%X, GLfixed t = 0x%X, GLfixed n = "
        "0x%X, GLfixed f = 0x%X)",
        l, r, b, t, n, f);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateFrustumx(context, l, r, b, t, n, f));
        if (isCallValid)
        {
            context->frustumx(l, r, b, t, n, f);
        }
        ANGLE_CAPTURE(Frustumx, isCallValid, context, l, r, b, t, n, f);
    }
}

void GL_APIENTRY GenBuffersContextANGLE(GLeglContext ctx, GLsizei n, GLuint *buffers)
{
    EVENT("(GLsizei n = %d, GLuint *buffers = 0x%016" PRIxPTR ")", n, (uintptr_t)buffers);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateGenBuffers(context, n, buffers));
        if (isCallValid)
        {
            context->genBuffers(n, buffers);
        }
        ANGLE_CAPTURE(GenBuffers, isCallValid, context, n, buffers);
    }
}

void GL_APIENTRY GenFencesNVContextANGLE(GLeglContext ctx, GLsizei n, GLuint *fences)
{
    EVENT("(GLsizei n = %d, GLuint *fences = 0x%016" PRIxPTR ")", n, (uintptr_t)fences);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateGenFencesNV(context, n, fences));
        if (isCallValid)
        {
            context->genFencesNV(n, fences);
        }
        ANGLE_CAPTURE(GenFencesNV, isCallValid, context, n, fences);
    }
}

void GL_APIENTRY GenFramebuffersContextANGLE(GLeglContext ctx, GLsizei n, GLuint *framebuffers)
{
    EVENT("(GLsizei n = %d, GLuint *framebuffers = 0x%016" PRIxPTR ")", n, (uintptr_t)framebuffers);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateGenFramebuffers(context, n, framebuffers));
        if (isCallValid)
        {
            context->genFramebuffers(n, framebuffers);
        }
        ANGLE_CAPTURE(GenFramebuffers, isCallValid, context, n, framebuffers);
    }
}

void GL_APIENTRY GenFramebuffersOESContextANGLE(GLeglContext ctx, GLsizei n, GLuint *framebuffers)
{
    EVENT("(GLsizei n = %d, GLuint *framebuffers = 0x%016" PRIxPTR ")", n, (uintptr_t)framebuffers);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateGenFramebuffersOES(context, n, framebuffers));
        if (isCallValid)
        {
            context->genFramebuffers(n, framebuffers);
        }
        ANGLE_CAPTURE(GenFramebuffersOES, isCallValid, context, n, framebuffers);
    }
}

void GL_APIENTRY GenProgramPipelinesContextANGLE(GLeglContext ctx, GLsizei n, GLuint *pipelines)
{
    EVENT("(GLsizei n = %d, GLuint *pipelines = 0x%016" PRIxPTR ")", n, (uintptr_t)pipelines);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateGenProgramPipelines(context, n, pipelines));
        if (isCallValid)
        {
            context->genProgramPipelines(n, pipelines);
        }
        ANGLE_CAPTURE(GenProgramPipelines, isCallValid, context, n, pipelines);
    }
}

void GL_APIENTRY GenQueriesContextANGLE(GLeglContext ctx, GLsizei n, GLuint *ids)
{
    EVENT("(GLsizei n = %d, GLuint *ids = 0x%016" PRIxPTR ")", n, (uintptr_t)ids);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateGenQueries(context, n, ids));
        if (isCallValid)
        {
            context->genQueries(n, ids);
        }
        ANGLE_CAPTURE(GenQueries, isCallValid, context, n, ids);
    }
}

void GL_APIENTRY GenQueriesEXTContextANGLE(GLeglContext ctx, GLsizei n, GLuint *ids)
{
    EVENT("(GLsizei n = %d, GLuint *ids = 0x%016" PRIxPTR ")", n, (uintptr_t)ids);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateGenQueriesEXT(context, n, ids));
        if (isCallValid)
        {
            context->genQueries(n, ids);
        }
        ANGLE_CAPTURE(GenQueriesEXT, isCallValid, context, n, ids);
    }
}

void GL_APIENTRY GenRenderbuffersContextANGLE(GLeglContext ctx, GLsizei n, GLuint *renderbuffers)
{
    EVENT("(GLsizei n = %d, GLuint *renderbuffers = 0x%016" PRIxPTR ")", n,
          (uintptr_t)renderbuffers);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateGenRenderbuffers(context, n, renderbuffers));
        if (isCallValid)
        {
            context->genRenderbuffers(n, renderbuffers);
        }
        ANGLE_CAPTURE(GenRenderbuffers, isCallValid, context, n, renderbuffers);
    }
}

void GL_APIENTRY GenRenderbuffersOESContextANGLE(GLeglContext ctx, GLsizei n, GLuint *renderbuffers)
{
    EVENT("(GLsizei n = %d, GLuint *renderbuffers = 0x%016" PRIxPTR ")", n,
          (uintptr_t)renderbuffers);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateGenRenderbuffersOES(context, n, renderbuffers));
        if (isCallValid)
        {
            context->genRenderbuffers(n, renderbuffers);
        }
        ANGLE_CAPTURE(GenRenderbuffersOES, isCallValid, context, n, renderbuffers);
    }
}

void GL_APIENTRY GenSamplersContextANGLE(GLeglContext ctx, GLsizei count, GLuint *samplers)
{
    EVENT("(GLsizei count = %d, GLuint *samplers = 0x%016" PRIxPTR ")", count, (uintptr_t)samplers);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateGenSamplers(context, count, samplers));
        if (isCallValid)
        {
            context->genSamplers(count, samplers);
        }
        ANGLE_CAPTURE(GenSamplers, isCallValid, context, count, samplers);
    }
}

void GL_APIENTRY GenSemaphoresEXTContextANGLE(GLeglContext ctx, GLsizei n, GLuint *semaphores)
{
    EVENT("(GLsizei n = %d, GLuint *semaphores = 0x%016" PRIxPTR ")", n, (uintptr_t)semaphores);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateGenSemaphoresEXT(context, n, semaphores));
        if (isCallValid)
        {
            context->genSemaphores(n, semaphores);
        }
        ANGLE_CAPTURE(GenSemaphoresEXT, isCallValid, context, n, semaphores);
    }
}

void GL_APIENTRY GenTexturesContextANGLE(GLeglContext ctx, GLsizei n, GLuint *textures)
{
    EVENT("(GLsizei n = %d, GLuint *textures = 0x%016" PRIxPTR ")", n, (uintptr_t)textures);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateGenTextures(context, n, textures));
        if (isCallValid)
        {
            context->genTextures(n, textures);
        }
        ANGLE_CAPTURE(GenTextures, isCallValid, context, n, textures);
    }
}

void GL_APIENTRY GenTransformFeedbacksContextANGLE(GLeglContext ctx, GLsizei n, GLuint *ids)
{
    EVENT("(GLsizei n = %d, GLuint *ids = 0x%016" PRIxPTR ")", n, (uintptr_t)ids);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateGenTransformFeedbacks(context, n, ids));
        if (isCallValid)
        {
            context->genTransformFeedbacks(n, ids);
        }
        ANGLE_CAPTURE(GenTransformFeedbacks, isCallValid, context, n, ids);
    }
}

void GL_APIENTRY GenVertexArraysContextANGLE(GLeglContext ctx, GLsizei n, GLuint *arrays)
{
    EVENT("(GLsizei n = %d, GLuint *arrays = 0x%016" PRIxPTR ")", n, (uintptr_t)arrays);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateGenVertexArrays(context, n, arrays));
        if (isCallValid)
        {
            context->genVertexArrays(n, arrays);
        }
        ANGLE_CAPTURE(GenVertexArrays, isCallValid, context, n, arrays);
    }
}

void GL_APIENTRY GenVertexArraysOESContextANGLE(GLeglContext ctx, GLsizei n, GLuint *arrays)
{
    EVENT("(GLsizei n = %d, GLuint *arrays = 0x%016" PRIxPTR ")", n, (uintptr_t)arrays);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateGenVertexArraysOES(context, n, arrays));
        if (isCallValid)
        {
            context->genVertexArrays(n, arrays);
        }
        ANGLE_CAPTURE(GenVertexArraysOES, isCallValid, context, n, arrays);
    }
}

void GL_APIENTRY GenerateMipmapContextANGLE(GLeglContext ctx, GLenum target)
{
    EVENT("(GLenum target = 0x%X)", target);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        TextureType targetPacked = FromGLenum<TextureType>(target);
        bool isCallValid =
            (context->skipValidation() || ValidateGenerateMipmap(context, targetPacked));
        if (isCallValid)
        {
            context->generateMipmap(targetPacked);
        }
        ANGLE_CAPTURE(GenerateMipmap, isCallValid, context, targetPacked);
    }
}

void GL_APIENTRY GenerateMipmapOESContextANGLE(GLeglContext ctx, GLenum target)
{
    EVENT("(GLenum target = 0x%X)", target);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        TextureType targetPacked = FromGLenum<TextureType>(target);
        bool isCallValid =
            (context->skipValidation() || ValidateGenerateMipmapOES(context, targetPacked));
        if (isCallValid)
        {
            context->generateMipmap(targetPacked);
        }
        ANGLE_CAPTURE(GenerateMipmapOES, isCallValid, context, targetPacked);
    }
}

void GL_APIENTRY GetActiveAttribContextANGLE(GLeglContext ctx,
                                             GLuint program,
                                             GLuint index,
                                             GLsizei bufSize,
                                             GLsizei *length,
                                             GLint *size,
                                             GLenum *type,
                                             GLchar *name)
{
    EVENT(
        "(GLuint program = %u, GLuint index = %u, GLsizei bufSize = %d, GLsizei *length = "
        "0x%016" PRIxPTR ", GLint *size = 0x%016" PRIxPTR ", GLenum *type = 0x%016" PRIxPTR
        ", GLchar *name = 0x%016" PRIxPTR ")",
        program, index, bufSize, (uintptr_t)length, (uintptr_t)size, (uintptr_t)type,
        (uintptr_t)name);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() ||
             ValidateGetActiveAttrib(context, program, index, bufSize, length, size, type, name));
        if (isCallValid)
        {
            context->getActiveAttrib(program, index, bufSize, length, size, type, name);
        }
        ANGLE_CAPTURE(GetActiveAttrib, isCallValid, context, program, index, bufSize, length, size,
                      type, name);
    }
}

void GL_APIENTRY GetActiveUniformContextANGLE(GLeglContext ctx,
                                              GLuint program,
                                              GLuint index,
                                              GLsizei bufSize,
                                              GLsizei *length,
                                              GLint *size,
                                              GLenum *type,
                                              GLchar *name)
{
    EVENT(
        "(GLuint program = %u, GLuint index = %u, GLsizei bufSize = %d, GLsizei *length = "
        "0x%016" PRIxPTR ", GLint *size = 0x%016" PRIxPTR ", GLenum *type = 0x%016" PRIxPTR
        ", GLchar *name = 0x%016" PRIxPTR ")",
        program, index, bufSize, (uintptr_t)length, (uintptr_t)size, (uintptr_t)type,
        (uintptr_t)name);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() ||
             ValidateGetActiveUniform(context, program, index, bufSize, length, size, type, name));
        if (isCallValid)
        {
            context->getActiveUniform(program, index, bufSize, length, size, type, name);
        }
        ANGLE_CAPTURE(GetActiveUniform, isCallValid, context, program, index, bufSize, length, size,
                      type, name);
    }
}

void GL_APIENTRY GetActiveUniformBlockNameContextANGLE(GLeglContext ctx,
                                                       GLuint program,
                                                       GLuint uniformBlockIndex,
                                                       GLsizei bufSize,
                                                       GLsizei *length,
                                                       GLchar *uniformBlockName)
{
    EVENT(
        "(GLuint program = %u, GLuint uniformBlockIndex = %u, GLsizei bufSize = %d, GLsizei "
        "*length = 0x%016" PRIxPTR ", GLchar *uniformBlockName = 0x%016" PRIxPTR ")",
        program, uniformBlockIndex, bufSize, (uintptr_t)length, (uintptr_t)uniformBlockName);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateGetActiveUniformBlockName(context, program, uniformBlockIndex,
                                                              bufSize, length, uniformBlockName));
        if (isCallValid)
        {
            context->getActiveUniformBlockName(program, uniformBlockIndex, bufSize, length,
                                               uniformBlockName);
        }
        ANGLE_CAPTURE(GetActiveUniformBlockName, isCallValid, context, program, uniformBlockIndex,
                      bufSize, length, uniformBlockName);
    }
}

void GL_APIENTRY GetActiveUniformBlockivContextANGLE(GLeglContext ctx,
                                                     GLuint program,
                                                     GLuint uniformBlockIndex,
                                                     GLenum pname,
                                                     GLint *params)
{
    EVENT(
        "(GLuint program = %u, GLuint uniformBlockIndex = %u, GLenum pname = 0x%X, GLint *params = "
        "0x%016" PRIxPTR ")",
        program, uniformBlockIndex, pname, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() ||
             ValidateGetActiveUniformBlockiv(context, program, uniformBlockIndex, pname, params));
        if (isCallValid)
        {
            context->getActiveUniformBlockiv(program, uniformBlockIndex, pname, params);
        }
        ANGLE_CAPTURE(GetActiveUniformBlockiv, isCallValid, context, program, uniformBlockIndex,
                      pname, params);
    }
}

void GL_APIENTRY GetActiveUniformsivContextANGLE(GLeglContext ctx,
                                                 GLuint program,
                                                 GLsizei uniformCount,
                                                 const GLuint *uniformIndices,
                                                 GLenum pname,
                                                 GLint *params)
{
    EVENT(
        "(GLuint program = %u, GLsizei uniformCount = %d, const GLuint *uniformIndices = "
        "0x%016" PRIxPTR ", GLenum pname = 0x%X, GLint *params = 0x%016" PRIxPTR ")",
        program, uniformCount, (uintptr_t)uniformIndices, pname, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateGetActiveUniformsiv(context, program, uniformCount,
                                                        uniformIndices, pname, params));
        if (isCallValid)
        {
            context->getActiveUniformsiv(program, uniformCount, uniformIndices, pname, params);
        }
        ANGLE_CAPTURE(GetActiveUniformsiv, isCallValid, context, program, uniformCount,
                      uniformIndices, pname, params);
    }
}

void GL_APIENTRY GetAttachedShadersContextANGLE(GLeglContext ctx,
                                                GLuint program,
                                                GLsizei maxCount,
                                                GLsizei *count,
                                                GLuint *shaders)
{
    EVENT("(GLuint program = %u, GLsizei maxCount = %d, GLsizei *count = 0x%016" PRIxPTR
          ", GLuint *shaders = 0x%016" PRIxPTR ")",
          program, maxCount, (uintptr_t)count, (uintptr_t)shaders);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateGetAttachedShaders(context, program, maxCount, count, shaders));
        if (isCallValid)
        {
            context->getAttachedShaders(program, maxCount, count, shaders);
        }
        ANGLE_CAPTURE(GetAttachedShaders, isCallValid, context, program, maxCount, count, shaders);
    }
}

GLint GL_APIENTRY GetAttribLocationContextANGLE(GLeglContext ctx,
                                                GLuint program,
                                                const GLchar *name)
{
    EVENT("(GLuint program = %u, const GLchar *name = 0x%016" PRIxPTR ")", program,
          (uintptr_t)name);

    Context *context = static_cast<gl::Context *>(ctx);
    GLint returnValue;
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateGetAttribLocation(context, program, name));
        if (isCallValid)
        {
            returnValue = context->getAttribLocation(program, name);
        }
        else
        {
            returnValue = GetDefaultReturnValue<EntryPoint::GetAttribLocation, GLint>();
        }
        ANGLE_CAPTURE(GetAttribLocation, isCallValid, context, program, name, returnValue);
    }
    else
    {
        returnValue = GetDefaultReturnValue<EntryPoint::GetAttribLocation, GLint>();
    }
    return returnValue;
}

void GL_APIENTRY GetBooleani_vContextANGLE(GLeglContext ctx,
                                           GLenum target,
                                           GLuint index,
                                           GLboolean *data)
{
    EVENT("(GLenum target = 0x%X, GLuint index = %u, GLboolean *data = 0x%016" PRIxPTR ")", target,
          index, (uintptr_t)data);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateGetBooleani_v(context, target, index, data));
        if (isCallValid)
        {
            context->getBooleani_v(target, index, data);
        }
        ANGLE_CAPTURE(GetBooleani_v, isCallValid, context, target, index, data);
    }
}

void GL_APIENTRY GetBooleanvContextANGLE(GLeglContext ctx, GLenum pname, GLboolean *data)
{
    EVENT("(GLenum pname = 0x%X, GLboolean *data = 0x%016" PRIxPTR ")", pname, (uintptr_t)data);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateGetBooleanv(context, pname, data));
        if (isCallValid)
        {
            context->getBooleanv(pname, data);
        }
        ANGLE_CAPTURE(GetBooleanv, isCallValid, context, pname, data);
    }
}

void GL_APIENTRY GetBufferParameteri64vContextANGLE(GLeglContext ctx,
                                                    GLenum target,
                                                    GLenum pname,
                                                    GLint64 *params)
{
    EVENT("(GLenum target = 0x%X, GLenum pname = 0x%X, GLint64 *params = 0x%016" PRIxPTR ")",
          target, pname, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        BufferBinding targetPacked = FromGLenum<BufferBinding>(target);
        bool isCallValid           = (context->skipValidation() ||
                            ValidateGetBufferParameteri64v(context, targetPacked, pname, params));
        if (isCallValid)
        {
            context->getBufferParameteri64v(targetPacked, pname, params);
        }
        ANGLE_CAPTURE(GetBufferParameteri64v, isCallValid, context, targetPacked, pname, params);
    }
}

void GL_APIENTRY GetBufferParameterivContextANGLE(GLeglContext ctx,
                                                  GLenum target,
                                                  GLenum pname,
                                                  GLint *params)
{
    EVENT("(GLenum target = 0x%X, GLenum pname = 0x%X, GLint *params = 0x%016" PRIxPTR ")", target,
          pname, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        BufferBinding targetPacked = FromGLenum<BufferBinding>(target);
        bool isCallValid           = (context->skipValidation() ||
                            ValidateGetBufferParameteriv(context, targetPacked, pname, params));
        if (isCallValid)
        {
            context->getBufferParameteriv(targetPacked, pname, params);
        }
        ANGLE_CAPTURE(GetBufferParameteriv, isCallValid, context, targetPacked, pname, params);
    }
}

void GL_APIENTRY GetBufferPointervContextANGLE(GLeglContext ctx,
                                               GLenum target,
                                               GLenum pname,
                                               void **params)
{
    EVENT("(GLenum target = 0x%X, GLenum pname = 0x%X, void **params = 0x%016" PRIxPTR ")", target,
          pname, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        BufferBinding targetPacked = FromGLenum<BufferBinding>(target);
        bool isCallValid           = (context->skipValidation() ||
                            ValidateGetBufferPointerv(context, targetPacked, pname, params));
        if (isCallValid)
        {
            context->getBufferPointerv(targetPacked, pname, params);
        }
        ANGLE_CAPTURE(GetBufferPointerv, isCallValid, context, targetPacked, pname, params);
    }
}

void GL_APIENTRY GetBufferPointervOESContextANGLE(GLeglContext ctx,
                                                  GLenum target,
                                                  GLenum pname,
                                                  void **params)
{
    EVENT("(GLenum target = 0x%X, GLenum pname = 0x%X, void **params = 0x%016" PRIxPTR ")", target,
          pname, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        BufferBinding targetPacked = FromGLenum<BufferBinding>(target);
        bool isCallValid           = (context->skipValidation() ||
                            ValidateGetBufferPointervOES(context, targetPacked, pname, params));
        if (isCallValid)
        {
            context->getBufferPointerv(targetPacked, pname, params);
        }
        ANGLE_CAPTURE(GetBufferPointervOES, isCallValid, context, targetPacked, pname, params);
    }
}

void GL_APIENTRY GetClipPlanefContextANGLE(GLeglContext ctx, GLenum plane, GLfloat *equation)
{
    EVENT("(GLenum plane = 0x%X, GLfloat *equation = 0x%016" PRIxPTR ")", plane,
          (uintptr_t)equation);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateGetClipPlanef(context, plane, equation));
        if (isCallValid)
        {
            context->getClipPlanef(plane, equation);
        }
        ANGLE_CAPTURE(GetClipPlanef, isCallValid, context, plane, equation);
    }
}

void GL_APIENTRY GetClipPlanexContextANGLE(GLeglContext ctx, GLenum plane, GLfixed *equation)
{
    EVENT("(GLenum plane = 0x%X, GLfixed *equation = 0x%016" PRIxPTR ")", plane,
          (uintptr_t)equation);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateGetClipPlanex(context, plane, equation));
        if (isCallValid)
        {
            context->getClipPlanex(plane, equation);
        }
        ANGLE_CAPTURE(GetClipPlanex, isCallValid, context, plane, equation);
    }
}

GLuint GL_APIENTRY GetDebugMessageLogKHRContextANGLE(GLeglContext ctx,
                                                     GLuint count,
                                                     GLsizei bufSize,
                                                     GLenum *sources,
                                                     GLenum *types,
                                                     GLuint *ids,
                                                     GLenum *severities,
                                                     GLsizei *lengths,
                                                     GLchar *messageLog)
{
    EVENT("(GLuint count = %u, GLsizei bufSize = %d, GLenum *sources = 0x%016" PRIxPTR
          ", GLenum *types = 0x%016" PRIxPTR ", GLuint *ids = 0x%016" PRIxPTR
          ", GLenum *severities = 0x%016" PRIxPTR ", GLsizei *lengths = 0x%016" PRIxPTR
          ", GLchar *messageLog = 0x%016" PRIxPTR ")",
          count, bufSize, (uintptr_t)sources, (uintptr_t)types, (uintptr_t)ids,
          (uintptr_t)severities, (uintptr_t)lengths, (uintptr_t)messageLog);

    Context *context = static_cast<gl::Context *>(ctx);
    GLuint returnValue;
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateGetDebugMessageLogKHR(context, count, bufSize, sources, types,
                                                          ids, severities, lengths, messageLog));
        if (isCallValid)
        {
            returnValue = context->getDebugMessageLog(count, bufSize, sources, types, ids,
                                                      severities, lengths, messageLog);
        }
        else
        {
            returnValue = GetDefaultReturnValue<EntryPoint::GetDebugMessageLogKHR, GLuint>();
        }
        ANGLE_CAPTURE(GetDebugMessageLogKHR, isCallValid, context, count, bufSize, sources, types,
                      ids, severities, lengths, messageLog, returnValue);
    }
    else
    {
        returnValue = GetDefaultReturnValue<EntryPoint::GetDebugMessageLogKHR, GLuint>();
    }
    return returnValue;
}

GLenum GL_APIENTRY GetErrorContextANGLE(GLeglContext ctx)
{
    EVENT("()");

    Context *context = static_cast<gl::Context *>(ctx);
    GLenum returnValue;
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateGetError(context));
        if (isCallValid)
        {
            returnValue = context->getError();
        }
        else
        {
            returnValue = GetDefaultReturnValue<EntryPoint::GetError, GLenum>();
        }
        ANGLE_CAPTURE(GetError, isCallValid, context, returnValue);
    }
    else
    {
        returnValue = GetDefaultReturnValue<EntryPoint::GetError, GLenum>();
    }
    return returnValue;
}

void GL_APIENTRY GetFenceivNVContextANGLE(GLeglContext ctx,
                                          GLuint fence,
                                          GLenum pname,
                                          GLint *params)
{
    EVENT("(GLuint fence = %u, GLenum pname = 0x%X, GLint *params = 0x%016" PRIxPTR ")", fence,
          pname, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateGetFenceivNV(context, fence, pname, params));
        if (isCallValid)
        {
            context->getFenceivNV(fence, pname, params);
        }
        ANGLE_CAPTURE(GetFenceivNV, isCallValid, context, fence, pname, params);
    }
}

void GL_APIENTRY GetFixedvContextANGLE(GLeglContext ctx, GLenum pname, GLfixed *params)
{
    EVENT("(GLenum pname = 0x%X, GLfixed *params = 0x%016" PRIxPTR ")", pname, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateGetFixedv(context, pname, params));
        if (isCallValid)
        {
            context->getFixedv(pname, params);
        }
        ANGLE_CAPTURE(GetFixedv, isCallValid, context, pname, params);
    }
}

void GL_APIENTRY GetFloatvContextANGLE(GLeglContext ctx, GLenum pname, GLfloat *data)
{
    EVENT("(GLenum pname = 0x%X, GLfloat *data = 0x%016" PRIxPTR ")", pname, (uintptr_t)data);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateGetFloatv(context, pname, data));
        if (isCallValid)
        {
            context->getFloatv(pname, data);
        }
        ANGLE_CAPTURE(GetFloatv, isCallValid, context, pname, data);
    }
}

GLint GL_APIENTRY GetFragDataIndexEXTContextANGLE(GLeglContext ctx,
                                                  GLuint program,
                                                  const GLchar *name)
{
    EVENT("(GLuint program = %u, const GLchar *name = 0x%016" PRIxPTR ")", program,
          (uintptr_t)name);

    Context *context = static_cast<gl::Context *>(ctx);
    GLint returnValue;
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateGetFragDataIndexEXT(context, program, name));
        if (isCallValid)
        {
            returnValue = context->getFragDataIndex(program, name);
        }
        else
        {
            returnValue = GetDefaultReturnValue<EntryPoint::GetFragDataIndexEXT, GLint>();
        }
        ANGLE_CAPTURE(GetFragDataIndexEXT, isCallValid, context, program, name, returnValue);
    }
    else
    {
        returnValue = GetDefaultReturnValue<EntryPoint::GetFragDataIndexEXT, GLint>();
    }
    return returnValue;
}

GLint GL_APIENTRY GetFragDataLocationContextANGLE(GLeglContext ctx,
                                                  GLuint program,
                                                  const GLchar *name)
{
    EVENT("(GLuint program = %u, const GLchar *name = 0x%016" PRIxPTR ")", program,
          (uintptr_t)name);

    Context *context = static_cast<gl::Context *>(ctx);
    GLint returnValue;
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateGetFragDataLocation(context, program, name));
        if (isCallValid)
        {
            returnValue = context->getFragDataLocation(program, name);
        }
        else
        {
            returnValue = GetDefaultReturnValue<EntryPoint::GetFragDataLocation, GLint>();
        }
        ANGLE_CAPTURE(GetFragDataLocation, isCallValid, context, program, name, returnValue);
    }
    else
    {
        returnValue = GetDefaultReturnValue<EntryPoint::GetFragDataLocation, GLint>();
    }
    return returnValue;
}

void GL_APIENTRY GetFramebufferAttachmentParameterivContextANGLE(GLeglContext ctx,
                                                                 GLenum target,
                                                                 GLenum attachment,
                                                                 GLenum pname,
                                                                 GLint *params)
{
    EVENT(
        "(GLenum target = 0x%X, GLenum attachment = 0x%X, GLenum pname = 0x%X, GLint *params = "
        "0x%016" PRIxPTR ")",
        target, attachment, pname, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateGetFramebufferAttachmentParameteriv(
                                              context, target, attachment, pname, params));
        if (isCallValid)
        {
            context->getFramebufferAttachmentParameteriv(target, attachment, pname, params);
        }
        ANGLE_CAPTURE(GetFramebufferAttachmentParameteriv, isCallValid, context, target, attachment,
                      pname, params);
    }
}

void GL_APIENTRY GetFramebufferAttachmentParameterivOESContextANGLE(GLeglContext ctx,
                                                                    GLenum target,
                                                                    GLenum attachment,
                                                                    GLenum pname,
                                                                    GLint *params)
{
    EVENT(
        "(GLenum target = 0x%X, GLenum attachment = 0x%X, GLenum pname = 0x%X, GLint *params = "
        "0x%016" PRIxPTR ")",
        target, attachment, pname, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateGetFramebufferAttachmentParameterivOES(
                                              context, target, attachment, pname, params));
        if (isCallValid)
        {
            context->getFramebufferAttachmentParameteriv(target, attachment, pname, params);
        }
        ANGLE_CAPTURE(GetFramebufferAttachmentParameterivOES, isCallValid, context, target,
                      attachment, pname, params);
    }
}

void GL_APIENTRY GetFramebufferParameterivContextANGLE(GLeglContext ctx,
                                                       GLenum target,
                                                       GLenum pname,
                                                       GLint *params)
{
    EVENT("(GLenum target = 0x%X, GLenum pname = 0x%X, GLint *params = 0x%016" PRIxPTR ")", target,
          pname, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateGetFramebufferParameteriv(context, target, pname, params));
        if (isCallValid)
        {
            context->getFramebufferParameteriv(target, pname, params);
        }
        ANGLE_CAPTURE(GetFramebufferParameteriv, isCallValid, context, target, pname, params);
    }
}

GLenum GL_APIENTRY GetGraphicsResetStatusEXTContextANGLE(GLeglContext ctx)
{
    EVENT("()");

    Context *context = static_cast<gl::Context *>(ctx);
    GLenum returnValue;
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateGetGraphicsResetStatusEXT(context));
        if (isCallValid)
        {
            returnValue = context->getGraphicsResetStatus();
        }
        else
        {
            returnValue = GetDefaultReturnValue<EntryPoint::GetGraphicsResetStatusEXT, GLenum>();
        }
        ANGLE_CAPTURE(GetGraphicsResetStatusEXT, isCallValid, context, returnValue);
    }
    else
    {
        returnValue = GetDefaultReturnValue<EntryPoint::GetGraphicsResetStatusEXT, GLenum>();
    }
    return returnValue;
}

void GL_APIENTRY GetInteger64i_vContextANGLE(GLeglContext ctx,
                                             GLenum target,
                                             GLuint index,
                                             GLint64 *data)
{
    EVENT("(GLenum target = 0x%X, GLuint index = %u, GLint64 *data = 0x%016" PRIxPTR ")", target,
          index, (uintptr_t)data);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateGetInteger64i_v(context, target, index, data));
        if (isCallValid)
        {
            context->getInteger64i_v(target, index, data);
        }
        ANGLE_CAPTURE(GetInteger64i_v, isCallValid, context, target, index, data);
    }
}

void GL_APIENTRY GetInteger64vContextANGLE(GLeglContext ctx, GLenum pname, GLint64 *data)
{
    EVENT("(GLenum pname = 0x%X, GLint64 *data = 0x%016" PRIxPTR ")", pname, (uintptr_t)data);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateGetInteger64v(context, pname, data));
        if (isCallValid)
        {
            context->getInteger64v(pname, data);
        }
        ANGLE_CAPTURE(GetInteger64v, isCallValid, context, pname, data);
    }
}

void GL_APIENTRY GetIntegeri_vContextANGLE(GLeglContext ctx,
                                           GLenum target,
                                           GLuint index,
                                           GLint *data)
{
    EVENT("(GLenum target = 0x%X, GLuint index = %u, GLint *data = 0x%016" PRIxPTR ")", target,
          index, (uintptr_t)data);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateGetIntegeri_v(context, target, index, data));
        if (isCallValid)
        {
            context->getIntegeri_v(target, index, data);
        }
        ANGLE_CAPTURE(GetIntegeri_v, isCallValid, context, target, index, data);
    }
}

void GL_APIENTRY GetIntegervContextANGLE(GLeglContext ctx, GLenum pname, GLint *data)
{
    EVENT("(GLenum pname = 0x%X, GLint *data = 0x%016" PRIxPTR ")", pname, (uintptr_t)data);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateGetIntegerv(context, pname, data));
        if (isCallValid)
        {
            context->getIntegerv(pname, data);
        }
        ANGLE_CAPTURE(GetIntegerv, isCallValid, context, pname, data);
    }
}

void GL_APIENTRY GetInternalformativContextANGLE(GLeglContext ctx,
                                                 GLenum target,
                                                 GLenum internalformat,
                                                 GLenum pname,
                                                 GLsizei bufSize,
                                                 GLint *params)
{
    EVENT(
        "(GLenum target = 0x%X, GLenum internalformat = 0x%X, GLenum pname = 0x%X, GLsizei bufSize "
        "= %d, GLint *params = 0x%016" PRIxPTR ")",
        target, internalformat, pname, bufSize, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() ||
             ValidateGetInternalformativ(context, target, internalformat, pname, bufSize, params));
        if (isCallValid)
        {
            context->getInternalformativ(target, internalformat, pname, bufSize, params);
        }
        ANGLE_CAPTURE(GetInternalformativ, isCallValid, context, target, internalformat, pname,
                      bufSize, params);
    }
}

void GL_APIENTRY GetLightfvContextANGLE(GLeglContext ctx,
                                        GLenum light,
                                        GLenum pname,
                                        GLfloat *params)
{
    EVENT("(GLenum light = 0x%X, GLenum pname = 0x%X, GLfloat *params = 0x%016" PRIxPTR ")", light,
          pname, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        LightParameter pnamePacked = FromGLenum<LightParameter>(pname);
        bool isCallValid =
            (context->skipValidation() || ValidateGetLightfv(context, light, pnamePacked, params));
        if (isCallValid)
        {
            context->getLightfv(light, pnamePacked, params);
        }
        ANGLE_CAPTURE(GetLightfv, isCallValid, context, light, pnamePacked, params);
    }
}

void GL_APIENTRY GetLightxvContextANGLE(GLeglContext ctx,
                                        GLenum light,
                                        GLenum pname,
                                        GLfixed *params)
{
    EVENT("(GLenum light = 0x%X, GLenum pname = 0x%X, GLfixed *params = 0x%016" PRIxPTR ")", light,
          pname, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        LightParameter pnamePacked = FromGLenum<LightParameter>(pname);
        bool isCallValid =
            (context->skipValidation() || ValidateGetLightxv(context, light, pnamePacked, params));
        if (isCallValid)
        {
            context->getLightxv(light, pnamePacked, params);
        }
        ANGLE_CAPTURE(GetLightxv, isCallValid, context, light, pnamePacked, params);
    }
}

void GL_APIENTRY GetMaterialfvContextANGLE(GLeglContext ctx,
                                           GLenum face,
                                           GLenum pname,
                                           GLfloat *params)
{
    EVENT("(GLenum face = 0x%X, GLenum pname = 0x%X, GLfloat *params = 0x%016" PRIxPTR ")", face,
          pname, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        MaterialParameter pnamePacked = FromGLenum<MaterialParameter>(pname);
        bool isCallValid              = (context->skipValidation() ||
                            ValidateGetMaterialfv(context, face, pnamePacked, params));
        if (isCallValid)
        {
            context->getMaterialfv(face, pnamePacked, params);
        }
        ANGLE_CAPTURE(GetMaterialfv, isCallValid, context, face, pnamePacked, params);
    }
}

void GL_APIENTRY GetMaterialxvContextANGLE(GLeglContext ctx,
                                           GLenum face,
                                           GLenum pname,
                                           GLfixed *params)
{
    EVENT("(GLenum face = 0x%X, GLenum pname = 0x%X, GLfixed *params = 0x%016" PRIxPTR ")", face,
          pname, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        MaterialParameter pnamePacked = FromGLenum<MaterialParameter>(pname);
        bool isCallValid              = (context->skipValidation() ||
                            ValidateGetMaterialxv(context, face, pnamePacked, params));
        if (isCallValid)
        {
            context->getMaterialxv(face, pnamePacked, params);
        }
        ANGLE_CAPTURE(GetMaterialxv, isCallValid, context, face, pnamePacked, params);
    }
}

void GL_APIENTRY GetMemoryObjectParameterivEXTContextANGLE(GLeglContext ctx,
                                                           GLuint memoryObject,
                                                           GLenum pname,
                                                           GLint *params)
{
    EVENT("(GLuint memoryObject = %u, GLenum pname = 0x%X, GLint *params = 0x%016" PRIxPTR ")",
          memoryObject, pname, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateGetMemoryObjectParameterivEXT(
                                                             context, memoryObject, pname, params));
        if (isCallValid)
        {
            context->getMemoryObjectParameteriv(memoryObject, pname, params);
        }
        ANGLE_CAPTURE(GetMemoryObjectParameterivEXT, isCallValid, context, memoryObject, pname,
                      params);
    }
}

void GL_APIENTRY GetMultisamplefvContextANGLE(GLeglContext ctx,
                                              GLenum pname,
                                              GLuint index,
                                              GLfloat *val)
{
    EVENT("(GLenum pname = 0x%X, GLuint index = %u, GLfloat *val = 0x%016" PRIxPTR ")", pname,
          index, (uintptr_t)val);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateGetMultisamplefv(context, pname, index, val));
        if (isCallValid)
        {
            context->getMultisamplefv(pname, index, val);
        }
        ANGLE_CAPTURE(GetMultisamplefv, isCallValid, context, pname, index, val);
    }
}

void GL_APIENTRY GetObjectLabelKHRContextANGLE(GLeglContext ctx,
                                               GLenum identifier,
                                               GLuint name,
                                               GLsizei bufSize,
                                               GLsizei *length,
                                               GLchar *label)
{
    EVENT(
        "(GLenum identifier = 0x%X, GLuint name = %u, GLsizei bufSize = %d, GLsizei *length = "
        "0x%016" PRIxPTR ", GLchar *label = 0x%016" PRIxPTR ")",
        identifier, name, bufSize, (uintptr_t)length, (uintptr_t)label);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() ||
             ValidateGetObjectLabelKHR(context, identifier, name, bufSize, length, label));
        if (isCallValid)
        {
            context->getObjectLabel(identifier, name, bufSize, length, label);
        }
        ANGLE_CAPTURE(GetObjectLabelKHR, isCallValid, context, identifier, name, bufSize, length,
                      label);
    }
}

void GL_APIENTRY GetObjectPtrLabelKHRContextANGLE(GLeglContext ctx,
                                                  const void *ptr,
                                                  GLsizei bufSize,
                                                  GLsizei *length,
                                                  GLchar *label)
{
    EVENT("(const void *ptr = 0x%016" PRIxPTR
          ", GLsizei bufSize = %d, GLsizei *length = 0x%016" PRIxPTR
          ", GLchar *label = 0x%016" PRIxPTR ")",
          (uintptr_t)ptr, bufSize, (uintptr_t)length, (uintptr_t)label);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateGetObjectPtrLabelKHR(context, ptr, bufSize, length, label));
        if (isCallValid)
        {
            context->getObjectPtrLabel(ptr, bufSize, length, label);
        }
        ANGLE_CAPTURE(GetObjectPtrLabelKHR, isCallValid, context, ptr, bufSize, length, label);
    }
}

void GL_APIENTRY GetPointervContextANGLE(GLeglContext ctx, GLenum pname, void **params)
{
    EVENT("(GLenum pname = 0x%X, void **params = 0x%016" PRIxPTR ")", pname, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateGetPointerv(context, pname, params));
        if (isCallValid)
        {
            context->getPointerv(pname, params);
        }
        ANGLE_CAPTURE(GetPointerv, isCallValid, context, pname, params);
    }
}

void GL_APIENTRY GetPointervKHRContextANGLE(GLeglContext ctx, GLenum pname, void **params)
{
    EVENT("(GLenum pname = 0x%X, void **params = 0x%016" PRIxPTR ")", pname, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateGetPointervKHR(context, pname, params));
        if (isCallValid)
        {
            context->getPointerv(pname, params);
        }
        ANGLE_CAPTURE(GetPointervKHR, isCallValid, context, pname, params);
    }
}

void GL_APIENTRY GetProgramBinaryContextANGLE(GLeglContext ctx,
                                              GLuint program,
                                              GLsizei bufSize,
                                              GLsizei *length,
                                              GLenum *binaryFormat,
                                              void *binary)
{
    EVENT("(GLuint program = %u, GLsizei bufSize = %d, GLsizei *length = 0x%016" PRIxPTR
          ", GLenum *binaryFormat = 0x%016" PRIxPTR ", void *binary = 0x%016" PRIxPTR ")",
          program, bufSize, (uintptr_t)length, (uintptr_t)binaryFormat, (uintptr_t)binary);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() ||
             ValidateGetProgramBinary(context, program, bufSize, length, binaryFormat, binary));
        if (isCallValid)
        {
            context->getProgramBinary(program, bufSize, length, binaryFormat, binary);
        }
        ANGLE_CAPTURE(GetProgramBinary, isCallValid, context, program, bufSize, length,
                      binaryFormat, binary);
    }
}

void GL_APIENTRY GetProgramBinaryOESContextANGLE(GLeglContext ctx,
                                                 GLuint program,
                                                 GLsizei bufSize,
                                                 GLsizei *length,
                                                 GLenum *binaryFormat,
                                                 void *binary)
{
    EVENT("(GLuint program = %u, GLsizei bufSize = %d, GLsizei *length = 0x%016" PRIxPTR
          ", GLenum *binaryFormat = 0x%016" PRIxPTR ", void *binary = 0x%016" PRIxPTR ")",
          program, bufSize, (uintptr_t)length, (uintptr_t)binaryFormat, (uintptr_t)binary);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() ||
             ValidateGetProgramBinaryOES(context, program, bufSize, length, binaryFormat, binary));
        if (isCallValid)
        {
            context->getProgramBinary(program, bufSize, length, binaryFormat, binary);
        }
        ANGLE_CAPTURE(GetProgramBinaryOES, isCallValid, context, program, bufSize, length,
                      binaryFormat, binary);
    }
}

void GL_APIENTRY GetProgramInfoLogContextANGLE(GLeglContext ctx,
                                               GLuint program,
                                               GLsizei bufSize,
                                               GLsizei *length,
                                               GLchar *infoLog)
{
    EVENT("(GLuint program = %u, GLsizei bufSize = %d, GLsizei *length = 0x%016" PRIxPTR
          ", GLchar *infoLog = 0x%016" PRIxPTR ")",
          program, bufSize, (uintptr_t)length, (uintptr_t)infoLog);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateGetProgramInfoLog(context, program, bufSize, length, infoLog));
        if (isCallValid)
        {
            context->getProgramInfoLog(program, bufSize, length, infoLog);
        }
        ANGLE_CAPTURE(GetProgramInfoLog, isCallValid, context, program, bufSize, length, infoLog);
    }
}

void GL_APIENTRY GetProgramInterfaceivContextANGLE(GLeglContext ctx,
                                                   GLuint program,
                                                   GLenum programInterface,
                                                   GLenum pname,
                                                   GLint *params)
{
    EVENT(
        "(GLuint program = %u, GLenum programInterface = 0x%X, GLenum pname = 0x%X, GLint *params "
        "= 0x%016" PRIxPTR ")",
        program, programInterface, pname, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() ||
             ValidateGetProgramInterfaceiv(context, program, programInterface, pname, params));
        if (isCallValid)
        {
            context->getProgramInterfaceiv(program, programInterface, pname, params);
        }
        ANGLE_CAPTURE(GetProgramInterfaceiv, isCallValid, context, program, programInterface, pname,
                      params);
    }
}

void GL_APIENTRY GetProgramPipelineInfoLogContextANGLE(GLeglContext ctx,
                                                       GLuint pipeline,
                                                       GLsizei bufSize,
                                                       GLsizei *length,
                                                       GLchar *infoLog)
{
    EVENT("(GLuint pipeline = %u, GLsizei bufSize = %d, GLsizei *length = 0x%016" PRIxPTR
          ", GLchar *infoLog = 0x%016" PRIxPTR ")",
          pipeline, bufSize, (uintptr_t)length, (uintptr_t)infoLog);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() ||
             ValidateGetProgramPipelineInfoLog(context, pipeline, bufSize, length, infoLog));
        if (isCallValid)
        {
            context->getProgramPipelineInfoLog(pipeline, bufSize, length, infoLog);
        }
        ANGLE_CAPTURE(GetProgramPipelineInfoLog, isCallValid, context, pipeline, bufSize, length,
                      infoLog);
    }
}

void GL_APIENTRY GetProgramPipelineivContextANGLE(GLeglContext ctx,
                                                  GLuint pipeline,
                                                  GLenum pname,
                                                  GLint *params)
{
    EVENT("(GLuint pipeline = %u, GLenum pname = 0x%X, GLint *params = 0x%016" PRIxPTR ")",
          pipeline, pname, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateGetProgramPipelineiv(context, pipeline, pname, params));
        if (isCallValid)
        {
            context->getProgramPipelineiv(pipeline, pname, params);
        }
        ANGLE_CAPTURE(GetProgramPipelineiv, isCallValid, context, pipeline, pname, params);
    }
}

GLuint GL_APIENTRY GetProgramResourceIndexContextANGLE(GLeglContext ctx,
                                                       GLuint program,
                                                       GLenum programInterface,
                                                       const GLchar *name)
{
    EVENT(
        "(GLuint program = %u, GLenum programInterface = 0x%X, const GLchar *name = 0x%016" PRIxPTR
        ")",
        program, programInterface, (uintptr_t)name);

    Context *context = static_cast<gl::Context *>(ctx);
    GLuint returnValue;
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() ||
             ValidateGetProgramResourceIndex(context, program, programInterface, name));
        if (isCallValid)
        {
            returnValue = context->getProgramResourceIndex(program, programInterface, name);
        }
        else
        {
            returnValue = GetDefaultReturnValue<EntryPoint::GetProgramResourceIndex, GLuint>();
        }
        ANGLE_CAPTURE(GetProgramResourceIndex, isCallValid, context, program, programInterface,
                      name, returnValue);
    }
    else
    {
        returnValue = GetDefaultReturnValue<EntryPoint::GetProgramResourceIndex, GLuint>();
    }
    return returnValue;
}

GLint GL_APIENTRY GetProgramResourceLocationContextANGLE(GLeglContext ctx,
                                                         GLuint program,
                                                         GLenum programInterface,
                                                         const GLchar *name)
{
    EVENT(
        "(GLuint program = %u, GLenum programInterface = 0x%X, const GLchar *name = 0x%016" PRIxPTR
        ")",
        program, programInterface, (uintptr_t)name);

    Context *context = static_cast<gl::Context *>(ctx);
    GLint returnValue;
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() ||
             ValidateGetProgramResourceLocation(context, program, programInterface, name));
        if (isCallValid)
        {
            returnValue = context->getProgramResourceLocation(program, programInterface, name);
        }
        else
        {
            returnValue = GetDefaultReturnValue<EntryPoint::GetProgramResourceLocation, GLint>();
        }
        ANGLE_CAPTURE(GetProgramResourceLocation, isCallValid, context, program, programInterface,
                      name, returnValue);
    }
    else
    {
        returnValue = GetDefaultReturnValue<EntryPoint::GetProgramResourceLocation, GLint>();
    }
    return returnValue;
}

GLint GL_APIENTRY GetProgramResourceLocationIndexEXTContextANGLE(GLeglContext ctx,
                                                                 GLuint program,
                                                                 GLenum programInterface,
                                                                 const GLchar *name)
{
    EVENT(
        "(GLuint program = %u, GLenum programInterface = 0x%X, const GLchar *name = 0x%016" PRIxPTR
        ")",
        program, programInterface, (uintptr_t)name);

    Context *context = static_cast<gl::Context *>(ctx);
    GLint returnValue;
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() ||
             ValidateGetProgramResourceLocationIndexEXT(context, program, programInterface, name));
        if (isCallValid)
        {
            returnValue = context->getProgramResourceLocationIndex(program, programInterface, name);
        }
        else
        {
            returnValue =
                GetDefaultReturnValue<EntryPoint::GetProgramResourceLocationIndexEXT, GLint>();
        }
        ANGLE_CAPTURE(GetProgramResourceLocationIndexEXT, isCallValid, context, program,
                      programInterface, name, returnValue);
    }
    else
    {
        returnValue =
            GetDefaultReturnValue<EntryPoint::GetProgramResourceLocationIndexEXT, GLint>();
    }
    return returnValue;
}

void GL_APIENTRY GetProgramResourceNameContextANGLE(GLeglContext ctx,
                                                    GLuint program,
                                                    GLenum programInterface,
                                                    GLuint index,
                                                    GLsizei bufSize,
                                                    GLsizei *length,
                                                    GLchar *name)
{
    EVENT(
        "(GLuint program = %u, GLenum programInterface = 0x%X, GLuint index = %u, GLsizei bufSize "
        "= %d, GLsizei *length = 0x%016" PRIxPTR ", GLchar *name = 0x%016" PRIxPTR ")",
        program, programInterface, index, bufSize, (uintptr_t)length, (uintptr_t)name);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateGetProgramResourceName(context, program, programInterface,
                                                           index, bufSize, length, name));
        if (isCallValid)
        {
            context->getProgramResourceName(program, programInterface, index, bufSize, length,
                                            name);
        }
        ANGLE_CAPTURE(GetProgramResourceName, isCallValid, context, program, programInterface,
                      index, bufSize, length, name);
    }
}

void GL_APIENTRY GetProgramResourceivContextANGLE(GLeglContext ctx,
                                                  GLuint program,
                                                  GLenum programInterface,
                                                  GLuint index,
                                                  GLsizei propCount,
                                                  const GLenum *props,
                                                  GLsizei bufSize,
                                                  GLsizei *length,
                                                  GLint *params)
{
    EVENT(
        "(GLuint program = %u, GLenum programInterface = 0x%X, GLuint index = %u, GLsizei "
        "propCount = %d, const GLenum *props = 0x%016" PRIxPTR
        ", GLsizei bufSize = %d, GLsizei *length = 0x%016" PRIxPTR
        ", GLint *params = 0x%016" PRIxPTR ")",
        program, programInterface, index, propCount, (uintptr_t)props, bufSize, (uintptr_t)length,
        (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() ||
             ValidateGetProgramResourceiv(context, program, programInterface, index, propCount,
                                          props, bufSize, length, params));
        if (isCallValid)
        {
            context->getProgramResourceiv(program, programInterface, index, propCount, props,
                                          bufSize, length, params);
        }
        ANGLE_CAPTURE(GetProgramResourceiv, isCallValid, context, program, programInterface, index,
                      propCount, props, bufSize, length, params);
    }
}

void GL_APIENTRY GetProgramivContextANGLE(GLeglContext ctx,
                                          GLuint program,
                                          GLenum pname,
                                          GLint *params)
{
    EVENT("(GLuint program = %u, GLenum pname = 0x%X, GLint *params = 0x%016" PRIxPTR ")", program,
          pname, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateGetProgramiv(context, program, pname, params));
        if (isCallValid)
        {
            context->getProgramiv(program, pname, params);
        }
        ANGLE_CAPTURE(GetProgramiv, isCallValid, context, program, pname, params);
    }
}

void GL_APIENTRY GetQueryObjecti64vEXTContextANGLE(GLeglContext ctx,
                                                   GLuint id,
                                                   GLenum pname,
                                                   GLint64 *params)
{
    EVENT("(GLuint id = %u, GLenum pname = 0x%X, GLint64 *params = 0x%016" PRIxPTR ")", id, pname,
          (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateGetQueryObjecti64vEXT(context, id, pname, params));
        if (isCallValid)
        {
            context->getQueryObjecti64v(id, pname, params);
        }
        ANGLE_CAPTURE(GetQueryObjecti64vEXT, isCallValid, context, id, pname, params);
    }
}

void GL_APIENTRY GetQueryObjectivEXTContextANGLE(GLeglContext ctx,
                                                 GLuint id,
                                                 GLenum pname,
                                                 GLint *params)
{
    EVENT("(GLuint id = %u, GLenum pname = 0x%X, GLint *params = 0x%016" PRIxPTR ")", id, pname,
          (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateGetQueryObjectivEXT(context, id, pname, params));
        if (isCallValid)
        {
            context->getQueryObjectiv(id, pname, params);
        }
        ANGLE_CAPTURE(GetQueryObjectivEXT, isCallValid, context, id, pname, params);
    }
}

void GL_APIENTRY GetQueryObjectui64vEXTContextANGLE(GLeglContext ctx,
                                                    GLuint id,
                                                    GLenum pname,
                                                    GLuint64 *params)
{
    EVENT("(GLuint id = %u, GLenum pname = 0x%X, GLuint64 *params = 0x%016" PRIxPTR ")", id, pname,
          (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateGetQueryObjectui64vEXT(context, id, pname, params));
        if (isCallValid)
        {
            context->getQueryObjectui64v(id, pname, params);
        }
        ANGLE_CAPTURE(GetQueryObjectui64vEXT, isCallValid, context, id, pname, params);
    }
}

void GL_APIENTRY GetQueryObjectuivContextANGLE(GLeglContext ctx,
                                               GLuint id,
                                               GLenum pname,
                                               GLuint *params)
{
    EVENT("(GLuint id = %u, GLenum pname = 0x%X, GLuint *params = 0x%016" PRIxPTR ")", id, pname,
          (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateGetQueryObjectuiv(context, id, pname, params));
        if (isCallValid)
        {
            context->getQueryObjectuiv(id, pname, params);
        }
        ANGLE_CAPTURE(GetQueryObjectuiv, isCallValid, context, id, pname, params);
    }
}

void GL_APIENTRY GetQueryObjectuivEXTContextANGLE(GLeglContext ctx,
                                                  GLuint id,
                                                  GLenum pname,
                                                  GLuint *params)
{
    EVENT("(GLuint id = %u, GLenum pname = 0x%X, GLuint *params = 0x%016" PRIxPTR ")", id, pname,
          (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateGetQueryObjectuivEXT(context, id, pname, params));
        if (isCallValid)
        {
            context->getQueryObjectuiv(id, pname, params);
        }
        ANGLE_CAPTURE(GetQueryObjectuivEXT, isCallValid, context, id, pname, params);
    }
}

void GL_APIENTRY GetQueryivContextANGLE(GLeglContext ctx,
                                        GLenum target,
                                        GLenum pname,
                                        GLint *params)
{
    EVENT("(GLenum target = 0x%X, GLenum pname = 0x%X, GLint *params = 0x%016" PRIxPTR ")", target,
          pname, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        QueryType targetPacked = FromGLenum<QueryType>(target);
        bool isCallValid =
            (context->skipValidation() || ValidateGetQueryiv(context, targetPacked, pname, params));
        if (isCallValid)
        {
            context->getQueryiv(targetPacked, pname, params);
        }
        ANGLE_CAPTURE(GetQueryiv, isCallValid, context, targetPacked, pname, params);
    }
}

void GL_APIENTRY GetQueryivEXTContextANGLE(GLeglContext ctx,
                                           GLenum target,
                                           GLenum pname,
                                           GLint *params)
{
    EVENT("(GLenum target = 0x%X, GLenum pname = 0x%X, GLint *params = 0x%016" PRIxPTR ")", target,
          pname, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        QueryType targetPacked = FromGLenum<QueryType>(target);
        bool isCallValid       = (context->skipValidation() ||
                            ValidateGetQueryivEXT(context, targetPacked, pname, params));
        if (isCallValid)
        {
            context->getQueryiv(targetPacked, pname, params);
        }
        ANGLE_CAPTURE(GetQueryivEXT, isCallValid, context, targetPacked, pname, params);
    }
}

void GL_APIENTRY GetRenderbufferParameterivContextANGLE(GLeglContext ctx,
                                                        GLenum target,
                                                        GLenum pname,
                                                        GLint *params)
{
    EVENT("(GLenum target = 0x%X, GLenum pname = 0x%X, GLint *params = 0x%016" PRIxPTR ")", target,
          pname, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateGetRenderbufferParameteriv(context, target, pname, params));
        if (isCallValid)
        {
            context->getRenderbufferParameteriv(target, pname, params);
        }
        ANGLE_CAPTURE(GetRenderbufferParameteriv, isCallValid, context, target, pname, params);
    }
}

void GL_APIENTRY GetRenderbufferParameterivOESContextANGLE(GLeglContext ctx,
                                                           GLenum target,
                                                           GLenum pname,
                                                           GLint *params)
{
    EVENT("(GLenum target = 0x%X, GLenum pname = 0x%X, GLint *params = 0x%016" PRIxPTR ")", target,
          pname, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateGetRenderbufferParameterivOES(context, target, pname, params));
        if (isCallValid)
        {
            context->getRenderbufferParameteriv(target, pname, params);
        }
        ANGLE_CAPTURE(GetRenderbufferParameterivOES, isCallValid, context, target, pname, params);
    }
}

void GL_APIENTRY GetSamplerParameterIivOESContextANGLE(GLeglContext ctx,
                                                       GLuint sampler,
                                                       GLenum pname,
                                                       GLint *params)
{
    EVENT("(GLuint sampler = %u, GLenum pname = 0x%X, GLint *params = 0x%016" PRIxPTR ")", sampler,
          pname, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateGetSamplerParameterIivOES(context, sampler, pname, params));
        if (isCallValid)
        {
            context->getSamplerParameterIiv(sampler, pname, params);
        }
        ANGLE_CAPTURE(GetSamplerParameterIivOES, isCallValid, context, sampler, pname, params);
    }
}

void GL_APIENTRY GetSamplerParameterIuivOESContextANGLE(GLeglContext ctx,
                                                        GLuint sampler,
                                                        GLenum pname,
                                                        GLuint *params)
{
    EVENT("(GLuint sampler = %u, GLenum pname = 0x%X, GLuint *params = 0x%016" PRIxPTR ")", sampler,
          pname, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateGetSamplerParameterIuivOES(context, sampler, pname, params));
        if (isCallValid)
        {
            context->getSamplerParameterIuiv(sampler, pname, params);
        }
        ANGLE_CAPTURE(GetSamplerParameterIuivOES, isCallValid, context, sampler, pname, params);
    }
}

void GL_APIENTRY GetSamplerParameterfvContextANGLE(GLeglContext ctx,
                                                   GLuint sampler,
                                                   GLenum pname,
                                                   GLfloat *params)
{
    EVENT("(GLuint sampler = %u, GLenum pname = 0x%X, GLfloat *params = 0x%016" PRIxPTR ")",
          sampler, pname, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateGetSamplerParameterfv(context, sampler, pname, params));
        if (isCallValid)
        {
            context->getSamplerParameterfv(sampler, pname, params);
        }
        ANGLE_CAPTURE(GetSamplerParameterfv, isCallValid, context, sampler, pname, params);
    }
}

void GL_APIENTRY GetSamplerParameterivContextANGLE(GLeglContext ctx,
                                                   GLuint sampler,
                                                   GLenum pname,
                                                   GLint *params)
{
    EVENT("(GLuint sampler = %u, GLenum pname = 0x%X, GLint *params = 0x%016" PRIxPTR ")", sampler,
          pname, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateGetSamplerParameteriv(context, sampler, pname, params));
        if (isCallValid)
        {
            context->getSamplerParameteriv(sampler, pname, params);
        }
        ANGLE_CAPTURE(GetSamplerParameteriv, isCallValid, context, sampler, pname, params);
    }
}

void GL_APIENTRY GetSemaphoreParameterui64vEXTContextANGLE(GLeglContext ctx,
                                                           GLuint semaphore,
                                                           GLenum pname,
                                                           GLuint64 *params)
{
    EVENT("(GLuint semaphore = %u, GLenum pname = 0x%X, GLuint64 *params = 0x%016" PRIxPTR ")",
          semaphore, pname, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateGetSemaphoreParameterui64vEXT(
                                                             context, semaphore, pname, params));
        if (isCallValid)
        {
            context->getSemaphoreParameterui64v(semaphore, pname, params);
        }
        ANGLE_CAPTURE(GetSemaphoreParameterui64vEXT, isCallValid, context, semaphore, pname,
                      params);
    }
}

void GL_APIENTRY GetShaderInfoLogContextANGLE(GLeglContext ctx,
                                              GLuint shader,
                                              GLsizei bufSize,
                                              GLsizei *length,
                                              GLchar *infoLog)
{
    EVENT("(GLuint shader = %u, GLsizei bufSize = %d, GLsizei *length = 0x%016" PRIxPTR
          ", GLchar *infoLog = 0x%016" PRIxPTR ")",
          shader, bufSize, (uintptr_t)length, (uintptr_t)infoLog);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateGetShaderInfoLog(context, shader, bufSize, length, infoLog));
        if (isCallValid)
        {
            context->getShaderInfoLog(shader, bufSize, length, infoLog);
        }
        ANGLE_CAPTURE(GetShaderInfoLog, isCallValid, context, shader, bufSize, length, infoLog);
    }
}

void GL_APIENTRY GetShaderPrecisionFormatContextANGLE(GLeglContext ctx,
                                                      GLenum shadertype,
                                                      GLenum precisiontype,
                                                      GLint *range,
                                                      GLint *precision)
{
    EVENT("(GLenum shadertype = 0x%X, GLenum precisiontype = 0x%X, GLint *range = 0x%016" PRIxPTR
          ", GLint *precision = 0x%016" PRIxPTR ")",
          shadertype, precisiontype, (uintptr_t)range, (uintptr_t)precision);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateGetShaderPrecisionFormat(context, shadertype, precisiontype,
                                                             range, precision));
        if (isCallValid)
        {
            context->getShaderPrecisionFormat(shadertype, precisiontype, range, precision);
        }
        ANGLE_CAPTURE(GetShaderPrecisionFormat, isCallValid, context, shadertype, precisiontype,
                      range, precision);
    }
}

void GL_APIENTRY GetShaderSourceContextANGLE(GLeglContext ctx,
                                             GLuint shader,
                                             GLsizei bufSize,
                                             GLsizei *length,
                                             GLchar *source)
{
    EVENT("(GLuint shader = %u, GLsizei bufSize = %d, GLsizei *length = 0x%016" PRIxPTR
          ", GLchar *source = 0x%016" PRIxPTR ")",
          shader, bufSize, (uintptr_t)length, (uintptr_t)source);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateGetShaderSource(context, shader, bufSize, length, source));
        if (isCallValid)
        {
            context->getShaderSource(shader, bufSize, length, source);
        }
        ANGLE_CAPTURE(GetShaderSource, isCallValid, context, shader, bufSize, length, source);
    }
}

void GL_APIENTRY GetShaderivContextANGLE(GLeglContext ctx,
                                         GLuint shader,
                                         GLenum pname,
                                         GLint *params)
{
    EVENT("(GLuint shader = %u, GLenum pname = 0x%X, GLint *params = 0x%016" PRIxPTR ")", shader,
          pname, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateGetShaderiv(context, shader, pname, params));
        if (isCallValid)
        {
            context->getShaderiv(shader, pname, params);
        }
        ANGLE_CAPTURE(GetShaderiv, isCallValid, context, shader, pname, params);
    }
}

const GLubyte *GL_APIENTRY GetStringContextANGLE(GLeglContext ctx, GLenum name)
{
    EVENT("(GLenum name = 0x%X)", name);

    Context *context = static_cast<gl::Context *>(ctx);
    const GLubyte *returnValue;
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateGetString(context, name));
        if (isCallValid)
        {
            returnValue = context->getString(name);
        }
        else
        {
            returnValue = GetDefaultReturnValue<EntryPoint::GetString, const GLubyte *>();
        }
        ANGLE_CAPTURE(GetString, isCallValid, context, name, returnValue);
    }
    else
    {
        returnValue = GetDefaultReturnValue<EntryPoint::GetString, const GLubyte *>();
    }
    return returnValue;
}

const GLubyte *GL_APIENTRY GetStringiContextANGLE(GLeglContext ctx, GLenum name, GLuint index)
{
    EVENT("(GLenum name = 0x%X, GLuint index = %u)", name, index);

    Context *context = static_cast<gl::Context *>(ctx);
    const GLubyte *returnValue;
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateGetStringi(context, name, index));
        if (isCallValid)
        {
            returnValue = context->getStringi(name, index);
        }
        else
        {
            returnValue = GetDefaultReturnValue<EntryPoint::GetStringi, const GLubyte *>();
        }
        ANGLE_CAPTURE(GetStringi, isCallValid, context, name, index, returnValue);
    }
    else
    {
        returnValue = GetDefaultReturnValue<EntryPoint::GetStringi, const GLubyte *>();
    }
    return returnValue;
}

void GL_APIENTRY GetSyncivContextANGLE(GLeglContext ctx,
                                       GLsync sync,
                                       GLenum pname,
                                       GLsizei bufSize,
                                       GLsizei *length,
                                       GLint *values)
{
    EVENT("(GLsync sync = 0x%016" PRIxPTR
          ", GLenum pname = 0x%X, GLsizei bufSize = %d, GLsizei *length = 0x%016" PRIxPTR
          ", GLint *values = 0x%016" PRIxPTR ")",
          (uintptr_t)sync, pname, bufSize, (uintptr_t)length, (uintptr_t)values);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateGetSynciv(context, sync, pname, bufSize, length, values));
        if (isCallValid)
        {
            context->getSynciv(sync, pname, bufSize, length, values);
        }
        ANGLE_CAPTURE(GetSynciv, isCallValid, context, sync, pname, bufSize, length, values);
    }
}

void GL_APIENTRY GetTexEnvfvContextANGLE(GLeglContext ctx,
                                         GLenum target,
                                         GLenum pname,
                                         GLfloat *params)
{
    EVENT("(GLenum target = 0x%X, GLenum pname = 0x%X, GLfloat *params = 0x%016" PRIxPTR ")",
          target, pname, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        TextureEnvTarget targetPacked   = FromGLenum<TextureEnvTarget>(target);
        TextureEnvParameter pnamePacked = FromGLenum<TextureEnvParameter>(pname);
        bool isCallValid                = (context->skipValidation() ||
                            ValidateGetTexEnvfv(context, targetPacked, pnamePacked, params));
        if (isCallValid)
        {
            context->getTexEnvfv(targetPacked, pnamePacked, params);
        }
        ANGLE_CAPTURE(GetTexEnvfv, isCallValid, context, targetPacked, pnamePacked, params);
    }
}

void GL_APIENTRY GetTexEnvivContextANGLE(GLeglContext ctx,
                                         GLenum target,
                                         GLenum pname,
                                         GLint *params)
{
    EVENT("(GLenum target = 0x%X, GLenum pname = 0x%X, GLint *params = 0x%016" PRIxPTR ")", target,
          pname, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        TextureEnvTarget targetPacked   = FromGLenum<TextureEnvTarget>(target);
        TextureEnvParameter pnamePacked = FromGLenum<TextureEnvParameter>(pname);
        bool isCallValid                = (context->skipValidation() ||
                            ValidateGetTexEnviv(context, targetPacked, pnamePacked, params));
        if (isCallValid)
        {
            context->getTexEnviv(targetPacked, pnamePacked, params);
        }
        ANGLE_CAPTURE(GetTexEnviv, isCallValid, context, targetPacked, pnamePacked, params);
    }
}

void GL_APIENTRY GetTexEnvxvContextANGLE(GLeglContext ctx,
                                         GLenum target,
                                         GLenum pname,
                                         GLfixed *params)
{
    EVENT("(GLenum target = 0x%X, GLenum pname = 0x%X, GLfixed *params = 0x%016" PRIxPTR ")",
          target, pname, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        TextureEnvTarget targetPacked   = FromGLenum<TextureEnvTarget>(target);
        TextureEnvParameter pnamePacked = FromGLenum<TextureEnvParameter>(pname);
        bool isCallValid                = (context->skipValidation() ||
                            ValidateGetTexEnvxv(context, targetPacked, pnamePacked, params));
        if (isCallValid)
        {
            context->getTexEnvxv(targetPacked, pnamePacked, params);
        }
        ANGLE_CAPTURE(GetTexEnvxv, isCallValid, context, targetPacked, pnamePacked, params);
    }
}

void GL_APIENTRY GetTexGenfvOESContextANGLE(GLeglContext ctx,
                                            GLenum coord,
                                            GLenum pname,
                                            GLfloat *params)
{
    EVENT("(GLenum coord = 0x%X, GLenum pname = 0x%X, GLfloat *params = 0x%016" PRIxPTR ")", coord,
          pname, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateGetTexGenfvOES(context, coord, pname, params));
        if (isCallValid)
        {
            context->getTexGenfv(coord, pname, params);
        }
        ANGLE_CAPTURE(GetTexGenfvOES, isCallValid, context, coord, pname, params);
    }
}

void GL_APIENTRY GetTexGenivOESContextANGLE(GLeglContext ctx,
                                            GLenum coord,
                                            GLenum pname,
                                            GLint *params)
{
    EVENT("(GLenum coord = 0x%X, GLenum pname = 0x%X, GLint *params = 0x%016" PRIxPTR ")", coord,
          pname, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateGetTexGenivOES(context, coord, pname, params));
        if (isCallValid)
        {
            context->getTexGeniv(coord, pname, params);
        }
        ANGLE_CAPTURE(GetTexGenivOES, isCallValid, context, coord, pname, params);
    }
}

void GL_APIENTRY GetTexGenxvOESContextANGLE(GLeglContext ctx,
                                            GLenum coord,
                                            GLenum pname,
                                            GLfixed *params)
{
    EVENT("(GLenum coord = 0x%X, GLenum pname = 0x%X, GLfixed *params = 0x%016" PRIxPTR ")", coord,
          pname, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateGetTexGenxvOES(context, coord, pname, params));
        if (isCallValid)
        {
            context->getTexGenxv(coord, pname, params);
        }
        ANGLE_CAPTURE(GetTexGenxvOES, isCallValid, context, coord, pname, params);
    }
}

void GL_APIENTRY GetTexLevelParameterfvContextANGLE(GLeglContext ctx,
                                                    GLenum target,
                                                    GLint level,
                                                    GLenum pname,
                                                    GLfloat *params)
{
    EVENT(
        "(GLenum target = 0x%X, GLint level = %d, GLenum pname = 0x%X, GLfloat *params = "
        "0x%016" PRIxPTR ")",
        target, level, pname, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        TextureTarget targetPacked = FromGLenum<TextureTarget>(target);
        bool isCallValid =
            (context->skipValidation() ||
             ValidateGetTexLevelParameterfv(context, targetPacked, level, pname, params));
        if (isCallValid)
        {
            context->getTexLevelParameterfv(targetPacked, level, pname, params);
        }
        ANGLE_CAPTURE(GetTexLevelParameterfv, isCallValid, context, targetPacked, level, pname,
                      params);
    }
}

void GL_APIENTRY GetTexLevelParameterivContextANGLE(GLeglContext ctx,
                                                    GLenum target,
                                                    GLint level,
                                                    GLenum pname,
                                                    GLint *params)
{
    EVENT(
        "(GLenum target = 0x%X, GLint level = %d, GLenum pname = 0x%X, GLint *params = "
        "0x%016" PRIxPTR ")",
        target, level, pname, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        TextureTarget targetPacked = FromGLenum<TextureTarget>(target);
        bool isCallValid =
            (context->skipValidation() ||
             ValidateGetTexLevelParameteriv(context, targetPacked, level, pname, params));
        if (isCallValid)
        {
            context->getTexLevelParameteriv(targetPacked, level, pname, params);
        }
        ANGLE_CAPTURE(GetTexLevelParameteriv, isCallValid, context, targetPacked, level, pname,
                      params);
    }
}

void GL_APIENTRY GetTexParameterIivOESContextANGLE(GLeglContext ctx,
                                                   GLenum target,
                                                   GLenum pname,
                                                   GLint *params)
{
    EVENT("(GLenum target = 0x%X, GLenum pname = 0x%X, GLint *params = 0x%016" PRIxPTR ")", target,
          pname, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        TextureType targetPacked = FromGLenum<TextureType>(target);
        bool isCallValid         = (context->skipValidation() ||
                            ValidateGetTexParameterIivOES(context, targetPacked, pname, params));
        if (isCallValid)
        {
            context->getTexParameterIiv(targetPacked, pname, params);
        }
        ANGLE_CAPTURE(GetTexParameterIivOES, isCallValid, context, targetPacked, pname, params);
    }
}

void GL_APIENTRY GetTexParameterIuivOESContextANGLE(GLeglContext ctx,
                                                    GLenum target,
                                                    GLenum pname,
                                                    GLuint *params)
{
    EVENT("(GLenum target = 0x%X, GLenum pname = 0x%X, GLuint *params = 0x%016" PRIxPTR ")", target,
          pname, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        TextureType targetPacked = FromGLenum<TextureType>(target);
        bool isCallValid         = (context->skipValidation() ||
                            ValidateGetTexParameterIuivOES(context, targetPacked, pname, params));
        if (isCallValid)
        {
            context->getTexParameterIuiv(targetPacked, pname, params);
        }
        ANGLE_CAPTURE(GetTexParameterIuivOES, isCallValid, context, targetPacked, pname, params);
    }
}

void GL_APIENTRY GetTexParameterfvContextANGLE(GLeglContext ctx,
                                               GLenum target,
                                               GLenum pname,
                                               GLfloat *params)
{
    EVENT("(GLenum target = 0x%X, GLenum pname = 0x%X, GLfloat *params = 0x%016" PRIxPTR ")",
          target, pname, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        TextureType targetPacked = FromGLenum<TextureType>(target);
        bool isCallValid         = (context->skipValidation() ||
                            ValidateGetTexParameterfv(context, targetPacked, pname, params));
        if (isCallValid)
        {
            context->getTexParameterfv(targetPacked, pname, params);
        }
        ANGLE_CAPTURE(GetTexParameterfv, isCallValid, context, targetPacked, pname, params);
    }
}

void GL_APIENTRY GetTexParameterivContextANGLE(GLeglContext ctx,
                                               GLenum target,
                                               GLenum pname,
                                               GLint *params)
{
    EVENT("(GLenum target = 0x%X, GLenum pname = 0x%X, GLint *params = 0x%016" PRIxPTR ")", target,
          pname, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        TextureType targetPacked = FromGLenum<TextureType>(target);
        bool isCallValid         = (context->skipValidation() ||
                            ValidateGetTexParameteriv(context, targetPacked, pname, params));
        if (isCallValid)
        {
            context->getTexParameteriv(targetPacked, pname, params);
        }
        ANGLE_CAPTURE(GetTexParameteriv, isCallValid, context, targetPacked, pname, params);
    }
}

void GL_APIENTRY GetTexParameterxvContextANGLE(GLeglContext ctx,
                                               GLenum target,
                                               GLenum pname,
                                               GLfixed *params)
{
    EVENT("(GLenum target = 0x%X, GLenum pname = 0x%X, GLfixed *params = 0x%016" PRIxPTR ")",
          target, pname, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        TextureType targetPacked = FromGLenum<TextureType>(target);
        bool isCallValid         = (context->skipValidation() ||
                            ValidateGetTexParameterxv(context, targetPacked, pname, params));
        if (isCallValid)
        {
            context->getTexParameterxv(targetPacked, pname, params);
        }
        ANGLE_CAPTURE(GetTexParameterxv, isCallValid, context, targetPacked, pname, params);
    }
}

void GL_APIENTRY GetTransformFeedbackVaryingContextANGLE(GLeglContext ctx,
                                                         GLuint program,
                                                         GLuint index,
                                                         GLsizei bufSize,
                                                         GLsizei *length,
                                                         GLsizei *size,
                                                         GLenum *type,
                                                         GLchar *name)
{
    EVENT(
        "(GLuint program = %u, GLuint index = %u, GLsizei bufSize = %d, GLsizei *length = "
        "0x%016" PRIxPTR ", GLsizei *size = 0x%016" PRIxPTR ", GLenum *type = 0x%016" PRIxPTR
        ", GLchar *name = 0x%016" PRIxPTR ")",
        program, index, bufSize, (uintptr_t)length, (uintptr_t)size, (uintptr_t)type,
        (uintptr_t)name);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateGetTransformFeedbackVarying(context, program, index, bufSize,
                                                                length, size, type, name));
        if (isCallValid)
        {
            context->getTransformFeedbackVarying(program, index, bufSize, length, size, type, name);
        }
        ANGLE_CAPTURE(GetTransformFeedbackVarying, isCallValid, context, program, index, bufSize,
                      length, size, type, name);
    }
}

void GL_APIENTRY GetTranslatedShaderSourceANGLEContextANGLE(GLeglContext ctx,
                                                            GLuint shader,
                                                            GLsizei bufsize,
                                                            GLsizei *length,
                                                            GLchar *source)
{
    EVENT("(GLuint shader = %u, GLsizei bufsize = %d, GLsizei *length = 0x%016" PRIxPTR
          ", GLchar *source = 0x%016" PRIxPTR ")",
          shader, bufsize, (uintptr_t)length, (uintptr_t)source);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() ||
             ValidateGetTranslatedShaderSourceANGLE(context, shader, bufsize, length, source));
        if (isCallValid)
        {
            context->getTranslatedShaderSource(shader, bufsize, length, source);
        }
        ANGLE_CAPTURE(GetTranslatedShaderSourceANGLE, isCallValid, context, shader, bufsize, length,
                      source);
    }
}

GLuint GL_APIENTRY GetUniformBlockIndexContextANGLE(GLeglContext ctx,
                                                    GLuint program,
                                                    const GLchar *uniformBlockName)
{
    EVENT("(GLuint program = %u, const GLchar *uniformBlockName = 0x%016" PRIxPTR ")", program,
          (uintptr_t)uniformBlockName);

    Context *context = static_cast<gl::Context *>(ctx);
    GLuint returnValue;
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateGetUniformBlockIndex(context, program, uniformBlockName));
        if (isCallValid)
        {
            returnValue = context->getUniformBlockIndex(program, uniformBlockName);
        }
        else
        {
            returnValue = GetDefaultReturnValue<EntryPoint::GetUniformBlockIndex, GLuint>();
        }
        ANGLE_CAPTURE(GetUniformBlockIndex, isCallValid, context, program, uniformBlockName,
                      returnValue);
    }
    else
    {
        returnValue = GetDefaultReturnValue<EntryPoint::GetUniformBlockIndex, GLuint>();
    }
    return returnValue;
}

void GL_APIENTRY GetUniformIndicesContextANGLE(GLeglContext ctx,
                                               GLuint program,
                                               GLsizei uniformCount,
                                               const GLchar *const *uniformNames,
                                               GLuint *uniformIndices)
{
    EVENT(
        "(GLuint program = %u, GLsizei uniformCount = %d, const GLchar *const*uniformNames = "
        "0x%016" PRIxPTR ", GLuint *uniformIndices = 0x%016" PRIxPTR ")",
        program, uniformCount, (uintptr_t)uniformNames, (uintptr_t)uniformIndices);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateGetUniformIndices(context, program, uniformCount,
                                                                    uniformNames, uniformIndices));
        if (isCallValid)
        {
            context->getUniformIndices(program, uniformCount, uniformNames, uniformIndices);
        }
        ANGLE_CAPTURE(GetUniformIndices, isCallValid, context, program, uniformCount, uniformNames,
                      uniformIndices);
    }
}

GLint GL_APIENTRY GetUniformLocationContextANGLE(GLeglContext ctx,
                                                 GLuint program,
                                                 const GLchar *name)
{
    EVENT("(GLuint program = %u, const GLchar *name = 0x%016" PRIxPTR ")", program,
          (uintptr_t)name);

    Context *context = static_cast<gl::Context *>(ctx);
    GLint returnValue;
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateGetUniformLocation(context, program, name));
        if (isCallValid)
        {
            returnValue = context->getUniformLocation(program, name);
        }
        else
        {
            returnValue = GetDefaultReturnValue<EntryPoint::GetUniformLocation, GLint>();
        }
        ANGLE_CAPTURE(GetUniformLocation, isCallValid, context, program, name, returnValue);
    }
    else
    {
        returnValue = GetDefaultReturnValue<EntryPoint::GetUniformLocation, GLint>();
    }
    return returnValue;
}

void GL_APIENTRY GetUniformfvContextANGLE(GLeglContext ctx,
                                          GLuint program,
                                          GLint location,
                                          GLfloat *params)
{
    EVENT("(GLuint program = %u, GLint location = %d, GLfloat *params = 0x%016" PRIxPTR ")",
          program, location, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateGetUniformfv(context, program, location, params));
        if (isCallValid)
        {
            context->getUniformfv(program, location, params);
        }
        ANGLE_CAPTURE(GetUniformfv, isCallValid, context, program, location, params);
    }
}

void GL_APIENTRY GetUniformivContextANGLE(GLeglContext ctx,
                                          GLuint program,
                                          GLint location,
                                          GLint *params)
{
    EVENT("(GLuint program = %u, GLint location = %d, GLint *params = 0x%016" PRIxPTR ")", program,
          location, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateGetUniformiv(context, program, location, params));
        if (isCallValid)
        {
            context->getUniformiv(program, location, params);
        }
        ANGLE_CAPTURE(GetUniformiv, isCallValid, context, program, location, params);
    }
}

void GL_APIENTRY GetUniformuivContextANGLE(GLeglContext ctx,
                                           GLuint program,
                                           GLint location,
                                           GLuint *params)
{
    EVENT("(GLuint program = %u, GLint location = %d, GLuint *params = 0x%016" PRIxPTR ")", program,
          location, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateGetUniformuiv(context, program, location, params));
        if (isCallValid)
        {
            context->getUniformuiv(program, location, params);
        }
        ANGLE_CAPTURE(GetUniformuiv, isCallValid, context, program, location, params);
    }
}

void GL_APIENTRY GetUnsignedBytevEXTContextANGLE(GLeglContext ctx, GLenum pname, GLubyte *data)
{
    EVENT("(GLenum pname = 0x%X, GLubyte *data = 0x%016" PRIxPTR ")", pname, (uintptr_t)data);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateGetUnsignedBytevEXT(context, pname, data));
        if (isCallValid)
        {
            context->getUnsignedBytev(pname, data);
        }
        ANGLE_CAPTURE(GetUnsignedBytevEXT, isCallValid, context, pname, data);
    }
}

void GL_APIENTRY GetUnsignedBytei_vEXTContextANGLE(GLeglContext ctx,
                                                   GLenum target,
                                                   GLuint index,
                                                   GLubyte *data)
{
    EVENT("(GLenum target = 0x%X, GLuint index = %u, GLubyte *data = 0x%016" PRIxPTR ")", target,
          index, (uintptr_t)data);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateGetUnsignedBytei_vEXT(context, target, index, data));
        if (isCallValid)
        {
            context->getUnsignedBytei_v(target, index, data);
        }
        ANGLE_CAPTURE(GetUnsignedBytei_vEXT, isCallValid, context, target, index, data);
    }
}

void GL_APIENTRY GetVertexAttribIivContextANGLE(GLeglContext ctx,
                                                GLuint index,
                                                GLenum pname,
                                                GLint *params)
{
    EVENT("(GLuint index = %u, GLenum pname = 0x%X, GLint *params = 0x%016" PRIxPTR ")", index,
          pname, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateGetVertexAttribIiv(context, index, pname, params));
        if (isCallValid)
        {
            context->getVertexAttribIiv(index, pname, params);
        }
        ANGLE_CAPTURE(GetVertexAttribIiv, isCallValid, context, index, pname, params);
    }
}

void GL_APIENTRY GetVertexAttribIuivContextANGLE(GLeglContext ctx,
                                                 GLuint index,
                                                 GLenum pname,
                                                 GLuint *params)
{
    EVENT("(GLuint index = %u, GLenum pname = 0x%X, GLuint *params = 0x%016" PRIxPTR ")", index,
          pname, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateGetVertexAttribIuiv(context, index, pname, params));
        if (isCallValid)
        {
            context->getVertexAttribIuiv(index, pname, params);
        }
        ANGLE_CAPTURE(GetVertexAttribIuiv, isCallValid, context, index, pname, params);
    }
}

void GL_APIENTRY GetVertexAttribPointervContextANGLE(GLeglContext ctx,
                                                     GLuint index,
                                                     GLenum pname,
                                                     void **pointer)
{
    EVENT("(GLuint index = %u, GLenum pname = 0x%X, void **pointer = 0x%016" PRIxPTR ")", index,
          pname, (uintptr_t)pointer);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateGetVertexAttribPointerv(context, index, pname, pointer));
        if (isCallValid)
        {
            context->getVertexAttribPointerv(index, pname, pointer);
        }
        ANGLE_CAPTURE(GetVertexAttribPointerv, isCallValid, context, index, pname, pointer);
    }
}

void GL_APIENTRY GetVertexAttribfvContextANGLE(GLeglContext ctx,
                                               GLuint index,
                                               GLenum pname,
                                               GLfloat *params)
{
    EVENT("(GLuint index = %u, GLenum pname = 0x%X, GLfloat *params = 0x%016" PRIxPTR ")", index,
          pname, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateGetVertexAttribfv(context, index, pname, params));
        if (isCallValid)
        {
            context->getVertexAttribfv(index, pname, params);
        }
        ANGLE_CAPTURE(GetVertexAttribfv, isCallValid, context, index, pname, params);
    }
}

void GL_APIENTRY GetVertexAttribivContextANGLE(GLeglContext ctx,
                                               GLuint index,
                                               GLenum pname,
                                               GLint *params)
{
    EVENT("(GLuint index = %u, GLenum pname = 0x%X, GLint *params = 0x%016" PRIxPTR ")", index,
          pname, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateGetVertexAttribiv(context, index, pname, params));
        if (isCallValid)
        {
            context->getVertexAttribiv(index, pname, params);
        }
        ANGLE_CAPTURE(GetVertexAttribiv, isCallValid, context, index, pname, params);
    }
}

void GL_APIENTRY GetnUniformfvEXTContextANGLE(GLeglContext ctx,
                                              GLuint program,
                                              GLint location,
                                              GLsizei bufSize,
                                              GLfloat *params)
{
    EVENT(
        "(GLuint program = %u, GLint location = %d, GLsizei bufSize = %d, GLfloat *params = "
        "0x%016" PRIxPTR ")",
        program, location, bufSize, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateGetnUniformfvEXT(context, program, location, bufSize, params));
        if (isCallValid)
        {
            context->getnUniformfv(program, location, bufSize, params);
        }
        ANGLE_CAPTURE(GetnUniformfvEXT, isCallValid, context, program, location, bufSize, params);
    }
}

void GL_APIENTRY GetnUniformivEXTContextANGLE(GLeglContext ctx,
                                              GLuint program,
                                              GLint location,
                                              GLsizei bufSize,
                                              GLint *params)
{
    EVENT(
        "(GLuint program = %u, GLint location = %d, GLsizei bufSize = %d, GLint *params = "
        "0x%016" PRIxPTR ")",
        program, location, bufSize, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateGetnUniformivEXT(context, program, location, bufSize, params));
        if (isCallValid)
        {
            context->getnUniformiv(program, location, bufSize, params);
        }
        ANGLE_CAPTURE(GetnUniformivEXT, isCallValid, context, program, location, bufSize, params);
    }
}

void GL_APIENTRY HintContextANGLE(GLeglContext ctx, GLenum target, GLenum mode)
{
    EVENT("(GLenum target = 0x%X, GLenum mode = 0x%X)", target, mode);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateHint(context, target, mode));
        if (isCallValid)
        {
            context->hint(target, mode);
        }
        ANGLE_CAPTURE(Hint, isCallValid, context, target, mode);
    }
}

void GL_APIENTRY ImportMemoryFdEXTContextANGLE(GLeglContext ctx,
                                               GLuint memory,
                                               GLuint64 size,
                                               GLenum handleType,
                                               GLint fd)
{
    EVENT("(GLuint memory = %u, GLuint64 size = %llu, GLenum handleType = 0x%X, GLint fd = %d)",
          memory, static_cast<unsigned long long>(size), handleType, fd);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        HandleType handleTypePacked = FromGLenum<HandleType>(handleType);
        bool isCallValid            = (context->skipValidation() ||
                            ValidateImportMemoryFdEXT(context, memory, size, handleTypePacked, fd));
        if (isCallValid)
        {
            context->importMemoryFd(memory, size, handleTypePacked, fd);
        }
        ANGLE_CAPTURE(ImportMemoryFdEXT, isCallValid, context, memory, size, handleTypePacked, fd);
    }
}

void GL_APIENTRY ImportSemaphoreFdEXTContextANGLE(GLeglContext ctx,
                                                  GLuint semaphore,
                                                  GLenum handleType,
                                                  GLint fd)
{
    EVENT("(GLuint semaphore = %u, GLenum handleType = 0x%X, GLint fd = %d)", semaphore, handleType,
          fd);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        HandleType handleTypePacked = FromGLenum<HandleType>(handleType);
        bool isCallValid            = (context->skipValidation() ||
                            ValidateImportSemaphoreFdEXT(context, semaphore, handleTypePacked, fd));
        if (isCallValid)
        {
            context->importSemaphoreFd(semaphore, handleTypePacked, fd);
        }
        ANGLE_CAPTURE(ImportSemaphoreFdEXT, isCallValid, context, semaphore, handleTypePacked, fd);
    }
}

void GL_APIENTRY InsertEventMarkerEXTContextANGLE(GLeglContext ctx,
                                                  GLsizei length,
                                                  const GLchar *marker)
{
    // Don't run an EVENT() macro on the EXT_debug_marker entry points.
    // It can interfere with the debug events being set by the caller.
    // EVENT("(GLsizei length = %d, const GLchar *marker = 0x%016" PRIxPTR ")", length,
    // (uintptr_t)marker);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateInsertEventMarkerEXT(context, length, marker));
        if (isCallValid)
        {
            context->insertEventMarker(length, marker);
        }
        ANGLE_CAPTURE(InsertEventMarkerEXT, isCallValid, context, length, marker);
    }
}

void GL_APIENTRY InvalidateFramebufferContextANGLE(GLeglContext ctx,
                                                   GLenum target,
                                                   GLsizei numAttachments,
                                                   const GLenum *attachments)
{
    EVENT(
        "(GLenum target = 0x%X, GLsizei numAttachments = %d, const GLenum *attachments = "
        "0x%016" PRIxPTR ")",
        target, numAttachments, (uintptr_t)attachments);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() ||
             ValidateInvalidateFramebuffer(context, target, numAttachments, attachments));
        if (isCallValid)
        {
            context->invalidateFramebuffer(target, numAttachments, attachments);
        }
        ANGLE_CAPTURE(InvalidateFramebuffer, isCallValid, context, target, numAttachments,
                      attachments);
    }
}

void GL_APIENTRY InvalidateSubFramebufferContextANGLE(GLeglContext ctx,
                                                      GLenum target,
                                                      GLsizei numAttachments,
                                                      const GLenum *attachments,
                                                      GLint x,
                                                      GLint y,
                                                      GLsizei width,
                                                      GLsizei height)
{
    EVENT(
        "(GLenum target = 0x%X, GLsizei numAttachments = %d, const GLenum *attachments = "
        "0x%016" PRIxPTR ", GLint x = %d, GLint y = %d, GLsizei width = %d, GLsizei height = %d)",
        target, numAttachments, (uintptr_t)attachments, x, y, width, height);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateInvalidateSubFramebuffer(context, target, numAttachments,
                                                             attachments, x, y, width, height));
        if (isCallValid)
        {
            context->invalidateSubFramebuffer(target, numAttachments, attachments, x, y, width,
                                              height);
        }
        ANGLE_CAPTURE(InvalidateSubFramebuffer, isCallValid, context, target, numAttachments,
                      attachments, x, y, width, height);
    }
}

GLboolean GL_APIENTRY IsBufferContextANGLE(GLeglContext ctx, GLuint buffer)
{
    EVENT("(GLuint buffer = %u)", buffer);

    Context *context = static_cast<gl::Context *>(ctx);
    GLboolean returnValue;
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateIsBuffer(context, buffer));
        if (isCallValid)
        {
            returnValue = context->isBuffer(buffer);
        }
        else
        {
            returnValue = GetDefaultReturnValue<EntryPoint::IsBuffer, GLboolean>();
        }
        ANGLE_CAPTURE(IsBuffer, isCallValid, context, buffer, returnValue);
    }
    else
    {
        returnValue = GetDefaultReturnValue<EntryPoint::IsBuffer, GLboolean>();
    }
    return returnValue;
}

GLboolean GL_APIENTRY IsEnabledContextANGLE(GLeglContext ctx, GLenum cap)
{
    EVENT("(GLenum cap = 0x%X)", cap);

    Context *context = static_cast<gl::Context *>(ctx);
    GLboolean returnValue;
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateIsEnabled(context, cap));
        if (isCallValid)
        {
            returnValue = context->isEnabled(cap);
        }
        else
        {
            returnValue = GetDefaultReturnValue<EntryPoint::IsEnabled, GLboolean>();
        }
        ANGLE_CAPTURE(IsEnabled, isCallValid, context, cap, returnValue);
    }
    else
    {
        returnValue = GetDefaultReturnValue<EntryPoint::IsEnabled, GLboolean>();
    }
    return returnValue;
}

GLboolean GL_APIENTRY IsFenceNVContextANGLE(GLeglContext ctx, GLuint fence)
{
    EVENT("(GLuint fence = %u)", fence);

    Context *context = static_cast<gl::Context *>(ctx);
    GLboolean returnValue;
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateIsFenceNV(context, fence));
        if (isCallValid)
        {
            returnValue = context->isFenceNV(fence);
        }
        else
        {
            returnValue = GetDefaultReturnValue<EntryPoint::IsFenceNV, GLboolean>();
        }
        ANGLE_CAPTURE(IsFenceNV, isCallValid, context, fence, returnValue);
    }
    else
    {
        returnValue = GetDefaultReturnValue<EntryPoint::IsFenceNV, GLboolean>();
    }
    return returnValue;
}

GLboolean GL_APIENTRY IsFramebufferContextANGLE(GLeglContext ctx, GLuint framebuffer)
{
    EVENT("(GLuint framebuffer = %u)", framebuffer);

    Context *context = static_cast<gl::Context *>(ctx);
    GLboolean returnValue;
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateIsFramebuffer(context, framebuffer));
        if (isCallValid)
        {
            returnValue = context->isFramebuffer(framebuffer);
        }
        else
        {
            returnValue = GetDefaultReturnValue<EntryPoint::IsFramebuffer, GLboolean>();
        }
        ANGLE_CAPTURE(IsFramebuffer, isCallValid, context, framebuffer, returnValue);
    }
    else
    {
        returnValue = GetDefaultReturnValue<EntryPoint::IsFramebuffer, GLboolean>();
    }
    return returnValue;
}

GLboolean GL_APIENTRY IsFramebufferOESContextANGLE(GLeglContext ctx, GLuint framebuffer)
{
    EVENT("(GLuint framebuffer = %u)", framebuffer);

    Context *context = static_cast<gl::Context *>(ctx);
    GLboolean returnValue;
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateIsFramebufferOES(context, framebuffer));
        if (isCallValid)
        {
            returnValue = context->isFramebuffer(framebuffer);
        }
        else
        {
            returnValue = GetDefaultReturnValue<EntryPoint::IsFramebufferOES, GLboolean>();
        }
        ANGLE_CAPTURE(IsFramebufferOES, isCallValid, context, framebuffer, returnValue);
    }
    else
    {
        returnValue = GetDefaultReturnValue<EntryPoint::IsFramebufferOES, GLboolean>();
    }
    return returnValue;
}

GLboolean GL_APIENTRY IsMemoryObjectEXTContextANGLE(GLeglContext ctx, GLuint memoryObject)
{
    EVENT("(GLuint memoryObject = %u)", memoryObject);

    Context *context = static_cast<gl::Context *>(ctx);
    GLboolean returnValue;
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateIsMemoryObjectEXT(context, memoryObject));
        if (isCallValid)
        {
            returnValue = context->isMemoryObject(memoryObject);
        }
        else
        {
            returnValue = GetDefaultReturnValue<EntryPoint::IsMemoryObjectEXT, GLboolean>();
        }
        ANGLE_CAPTURE(IsMemoryObjectEXT, isCallValid, context, memoryObject, returnValue);
    }
    else
    {
        returnValue = GetDefaultReturnValue<EntryPoint::IsMemoryObjectEXT, GLboolean>();
    }
    return returnValue;
}

GLboolean GL_APIENTRY IsProgramContextANGLE(GLeglContext ctx, GLuint program)
{
    EVENT("(GLuint program = %u)", program);

    Context *context = static_cast<gl::Context *>(ctx);
    GLboolean returnValue;
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateIsProgram(context, program));
        if (isCallValid)
        {
            returnValue = context->isProgram(program);
        }
        else
        {
            returnValue = GetDefaultReturnValue<EntryPoint::IsProgram, GLboolean>();
        }
        ANGLE_CAPTURE(IsProgram, isCallValid, context, program, returnValue);
    }
    else
    {
        returnValue = GetDefaultReturnValue<EntryPoint::IsProgram, GLboolean>();
    }
    return returnValue;
}

GLboolean GL_APIENTRY IsProgramPipelineContextANGLE(GLeglContext ctx, GLuint pipeline)
{
    EVENT("(GLuint pipeline = %u)", pipeline);

    Context *context = static_cast<gl::Context *>(ctx);
    GLboolean returnValue;
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateIsProgramPipeline(context, pipeline));
        if (isCallValid)
        {
            returnValue = context->isProgramPipeline(pipeline);
        }
        else
        {
            returnValue = GetDefaultReturnValue<EntryPoint::IsProgramPipeline, GLboolean>();
        }
        ANGLE_CAPTURE(IsProgramPipeline, isCallValid, context, pipeline, returnValue);
    }
    else
    {
        returnValue = GetDefaultReturnValue<EntryPoint::IsProgramPipeline, GLboolean>();
    }
    return returnValue;
}

GLboolean GL_APIENTRY IsQueryContextANGLE(GLeglContext ctx, GLuint id)
{
    EVENT("(GLuint id = %u)", id);

    Context *context = static_cast<gl::Context *>(ctx);
    GLboolean returnValue;
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateIsQuery(context, id));
        if (isCallValid)
        {
            returnValue = context->isQuery(id);
        }
        else
        {
            returnValue = GetDefaultReturnValue<EntryPoint::IsQuery, GLboolean>();
        }
        ANGLE_CAPTURE(IsQuery, isCallValid, context, id, returnValue);
    }
    else
    {
        returnValue = GetDefaultReturnValue<EntryPoint::IsQuery, GLboolean>();
    }
    return returnValue;
}

GLboolean GL_APIENTRY IsQueryEXTContextANGLE(GLeglContext ctx, GLuint id)
{
    EVENT("(GLuint id = %u)", id);

    Context *context = static_cast<gl::Context *>(ctx);
    GLboolean returnValue;
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateIsQueryEXT(context, id));
        if (isCallValid)
        {
            returnValue = context->isQuery(id);
        }
        else
        {
            returnValue = GetDefaultReturnValue<EntryPoint::IsQueryEXT, GLboolean>();
        }
        ANGLE_CAPTURE(IsQueryEXT, isCallValid, context, id, returnValue);
    }
    else
    {
        returnValue = GetDefaultReturnValue<EntryPoint::IsQueryEXT, GLboolean>();
    }
    return returnValue;
}

GLboolean GL_APIENTRY IsRenderbufferContextANGLE(GLeglContext ctx, GLuint renderbuffer)
{
    EVENT("(GLuint renderbuffer = %u)", renderbuffer);

    Context *context = static_cast<gl::Context *>(ctx);
    GLboolean returnValue;
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateIsRenderbuffer(context, renderbuffer));
        if (isCallValid)
        {
            returnValue = context->isRenderbuffer(renderbuffer);
        }
        else
        {
            returnValue = GetDefaultReturnValue<EntryPoint::IsRenderbuffer, GLboolean>();
        }
        ANGLE_CAPTURE(IsRenderbuffer, isCallValid, context, renderbuffer, returnValue);
    }
    else
    {
        returnValue = GetDefaultReturnValue<EntryPoint::IsRenderbuffer, GLboolean>();
    }
    return returnValue;
}

GLboolean GL_APIENTRY IsRenderbufferOESContextANGLE(GLeglContext ctx, GLuint renderbuffer)
{
    EVENT("(GLuint renderbuffer = %u)", renderbuffer);

    Context *context = static_cast<gl::Context *>(ctx);
    GLboolean returnValue;
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateIsRenderbufferOES(context, renderbuffer));
        if (isCallValid)
        {
            returnValue = context->isRenderbuffer(renderbuffer);
        }
        else
        {
            returnValue = GetDefaultReturnValue<EntryPoint::IsRenderbufferOES, GLboolean>();
        }
        ANGLE_CAPTURE(IsRenderbufferOES, isCallValid, context, renderbuffer, returnValue);
    }
    else
    {
        returnValue = GetDefaultReturnValue<EntryPoint::IsRenderbufferOES, GLboolean>();
    }
    return returnValue;
}

GLboolean GL_APIENTRY IsSemaphoreEXTContextANGLE(GLeglContext ctx, GLuint semaphore)
{
    EVENT("(GLuint semaphore = %u)", semaphore);

    Context *context = static_cast<gl::Context *>(ctx);
    GLboolean returnValue;
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateIsSemaphoreEXT(context, semaphore));
        if (isCallValid)
        {
            returnValue = context->isSemaphore(semaphore);
        }
        else
        {
            returnValue = GetDefaultReturnValue<EntryPoint::IsSemaphoreEXT, GLboolean>();
        }
        ANGLE_CAPTURE(IsSemaphoreEXT, isCallValid, context, semaphore, returnValue);
    }
    else
    {
        returnValue = GetDefaultReturnValue<EntryPoint::IsSemaphoreEXT, GLboolean>();
    }
    return returnValue;
}

GLboolean GL_APIENTRY IsSamplerContextANGLE(GLeglContext ctx, GLuint sampler)
{
    EVENT("(GLuint sampler = %u)", sampler);

    Context *context = static_cast<gl::Context *>(ctx);
    GLboolean returnValue;
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateIsSampler(context, sampler));
        if (isCallValid)
        {
            returnValue = context->isSampler(sampler);
        }
        else
        {
            returnValue = GetDefaultReturnValue<EntryPoint::IsSampler, GLboolean>();
        }
        ANGLE_CAPTURE(IsSampler, isCallValid, context, sampler, returnValue);
    }
    else
    {
        returnValue = GetDefaultReturnValue<EntryPoint::IsSampler, GLboolean>();
    }
    return returnValue;
}

GLboolean GL_APIENTRY IsShaderContextANGLE(GLeglContext ctx, GLuint shader)
{
    EVENT("(GLuint shader = %u)", shader);

    Context *context = static_cast<gl::Context *>(ctx);
    GLboolean returnValue;
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateIsShader(context, shader));
        if (isCallValid)
        {
            returnValue = context->isShader(shader);
        }
        else
        {
            returnValue = GetDefaultReturnValue<EntryPoint::IsShader, GLboolean>();
        }
        ANGLE_CAPTURE(IsShader, isCallValid, context, shader, returnValue);
    }
    else
    {
        returnValue = GetDefaultReturnValue<EntryPoint::IsShader, GLboolean>();
    }
    return returnValue;
}

GLboolean GL_APIENTRY IsSyncContextANGLE(GLeglContext ctx, GLsync sync)
{
    EVENT("(GLsync sync = 0x%016" PRIxPTR ")", (uintptr_t)sync);

    Context *context = static_cast<gl::Context *>(ctx);
    GLboolean returnValue;
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateIsSync(context, sync));
        if (isCallValid)
        {
            returnValue = context->isSync(sync);
        }
        else
        {
            returnValue = GetDefaultReturnValue<EntryPoint::IsSync, GLboolean>();
        }
        ANGLE_CAPTURE(IsSync, isCallValid, context, sync, returnValue);
    }
    else
    {
        returnValue = GetDefaultReturnValue<EntryPoint::IsSync, GLboolean>();
    }
    return returnValue;
}

GLboolean GL_APIENTRY IsTextureContextANGLE(GLeglContext ctx, GLuint texture)
{
    EVENT("(GLuint texture = %u)", texture);

    Context *context = static_cast<gl::Context *>(ctx);
    GLboolean returnValue;
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateIsTexture(context, texture));
        if (isCallValid)
        {
            returnValue = context->isTexture(texture);
        }
        else
        {
            returnValue = GetDefaultReturnValue<EntryPoint::IsTexture, GLboolean>();
        }
        ANGLE_CAPTURE(IsTexture, isCallValid, context, texture, returnValue);
    }
    else
    {
        returnValue = GetDefaultReturnValue<EntryPoint::IsTexture, GLboolean>();
    }
    return returnValue;
}

GLboolean GL_APIENTRY IsTransformFeedbackContextANGLE(GLeglContext ctx, GLuint id)
{
    EVENT("(GLuint id = %u)", id);

    Context *context = static_cast<gl::Context *>(ctx);
    GLboolean returnValue;
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateIsTransformFeedback(context, id));
        if (isCallValid)
        {
            returnValue = context->isTransformFeedback(id);
        }
        else
        {
            returnValue = GetDefaultReturnValue<EntryPoint::IsTransformFeedback, GLboolean>();
        }
        ANGLE_CAPTURE(IsTransformFeedback, isCallValid, context, id, returnValue);
    }
    else
    {
        returnValue = GetDefaultReturnValue<EntryPoint::IsTransformFeedback, GLboolean>();
    }
    return returnValue;
}

GLboolean GL_APIENTRY IsVertexArrayContextANGLE(GLeglContext ctx, GLuint array)
{
    EVENT("(GLuint array = %u)", array);

    Context *context = static_cast<gl::Context *>(ctx);
    GLboolean returnValue;
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateIsVertexArray(context, array));
        if (isCallValid)
        {
            returnValue = context->isVertexArray(array);
        }
        else
        {
            returnValue = GetDefaultReturnValue<EntryPoint::IsVertexArray, GLboolean>();
        }
        ANGLE_CAPTURE(IsVertexArray, isCallValid, context, array, returnValue);
    }
    else
    {
        returnValue = GetDefaultReturnValue<EntryPoint::IsVertexArray, GLboolean>();
    }
    return returnValue;
}

GLboolean GL_APIENTRY IsVertexArrayOESContextANGLE(GLeglContext ctx, GLuint array)
{
    EVENT("(GLuint array = %u)", array);

    Context *context = static_cast<gl::Context *>(ctx);
    GLboolean returnValue;
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateIsVertexArrayOES(context, array));
        if (isCallValid)
        {
            returnValue = context->isVertexArray(array);
        }
        else
        {
            returnValue = GetDefaultReturnValue<EntryPoint::IsVertexArrayOES, GLboolean>();
        }
        ANGLE_CAPTURE(IsVertexArrayOES, isCallValid, context, array, returnValue);
    }
    else
    {
        returnValue = GetDefaultReturnValue<EntryPoint::IsVertexArrayOES, GLboolean>();
    }
    return returnValue;
}

void GL_APIENTRY LightModelfContextANGLE(GLeglContext ctx, GLenum pname, GLfloat param)
{
    EVENT("(GLenum pname = 0x%X, GLfloat param = %f)", pname, param);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateLightModelf(context, pname, param));
        if (isCallValid)
        {
            context->lightModelf(pname, param);
        }
        ANGLE_CAPTURE(LightModelf, isCallValid, context, pname, param);
    }
}

void GL_APIENTRY LightModelfvContextANGLE(GLeglContext ctx, GLenum pname, const GLfloat *params)
{
    EVENT("(GLenum pname = 0x%X, const GLfloat *params = 0x%016" PRIxPTR ")", pname,
          (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateLightModelfv(context, pname, params));
        if (isCallValid)
        {
            context->lightModelfv(pname, params);
        }
        ANGLE_CAPTURE(LightModelfv, isCallValid, context, pname, params);
    }
}

void GL_APIENTRY LightModelxContextANGLE(GLeglContext ctx, GLenum pname, GLfixed param)
{
    EVENT("(GLenum pname = 0x%X, GLfixed param = 0x%X)", pname, param);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateLightModelx(context, pname, param));
        if (isCallValid)
        {
            context->lightModelx(pname, param);
        }
        ANGLE_CAPTURE(LightModelx, isCallValid, context, pname, param);
    }
}

void GL_APIENTRY LightModelxvContextANGLE(GLeglContext ctx, GLenum pname, const GLfixed *param)
{
    EVENT("(GLenum pname = 0x%X, const GLfixed *param = 0x%016" PRIxPTR ")", pname,
          (uintptr_t)param);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateLightModelxv(context, pname, param));
        if (isCallValid)
        {
            context->lightModelxv(pname, param);
        }
        ANGLE_CAPTURE(LightModelxv, isCallValid, context, pname, param);
    }
}

void GL_APIENTRY LightfContextANGLE(GLeglContext ctx, GLenum light, GLenum pname, GLfloat param)
{
    EVENT("(GLenum light = 0x%X, GLenum pname = 0x%X, GLfloat param = %f)", light, pname, param);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        LightParameter pnamePacked = FromGLenum<LightParameter>(pname);
        bool isCallValid =
            (context->skipValidation() || ValidateLightf(context, light, pnamePacked, param));
        if (isCallValid)
        {
            context->lightf(light, pnamePacked, param);
        }
        ANGLE_CAPTURE(Lightf, isCallValid, context, light, pnamePacked, param);
    }
}

void GL_APIENTRY LightfvContextANGLE(GLeglContext ctx,
                                     GLenum light,
                                     GLenum pname,
                                     const GLfloat *params)
{
    EVENT("(GLenum light = 0x%X, GLenum pname = 0x%X, const GLfloat *params = 0x%016" PRIxPTR ")",
          light, pname, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        LightParameter pnamePacked = FromGLenum<LightParameter>(pname);
        bool isCallValid =
            (context->skipValidation() || ValidateLightfv(context, light, pnamePacked, params));
        if (isCallValid)
        {
            context->lightfv(light, pnamePacked, params);
        }
        ANGLE_CAPTURE(Lightfv, isCallValid, context, light, pnamePacked, params);
    }
}

void GL_APIENTRY LightxContextANGLE(GLeglContext ctx, GLenum light, GLenum pname, GLfixed param)
{
    EVENT("(GLenum light = 0x%X, GLenum pname = 0x%X, GLfixed param = 0x%X)", light, pname, param);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        LightParameter pnamePacked = FromGLenum<LightParameter>(pname);
        bool isCallValid =
            (context->skipValidation() || ValidateLightx(context, light, pnamePacked, param));
        if (isCallValid)
        {
            context->lightx(light, pnamePacked, param);
        }
        ANGLE_CAPTURE(Lightx, isCallValid, context, light, pnamePacked, param);
    }
}

void GL_APIENTRY LightxvContextANGLE(GLeglContext ctx,
                                     GLenum light,
                                     GLenum pname,
                                     const GLfixed *params)
{
    EVENT("(GLenum light = 0x%X, GLenum pname = 0x%X, const GLfixed *params = 0x%016" PRIxPTR ")",
          light, pname, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        LightParameter pnamePacked = FromGLenum<LightParameter>(pname);
        bool isCallValid =
            (context->skipValidation() || ValidateLightxv(context, light, pnamePacked, params));
        if (isCallValid)
        {
            context->lightxv(light, pnamePacked, params);
        }
        ANGLE_CAPTURE(Lightxv, isCallValid, context, light, pnamePacked, params);
    }
}

void GL_APIENTRY LineWidthContextANGLE(GLeglContext ctx, GLfloat width)
{
    EVENT("(GLfloat width = %f)", width);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateLineWidth(context, width));
        if (isCallValid)
        {
            context->lineWidth(width);
        }
        ANGLE_CAPTURE(LineWidth, isCallValid, context, width);
    }
}

void GL_APIENTRY LineWidthxContextANGLE(GLeglContext ctx, GLfixed width)
{
    EVENT("(GLfixed width = 0x%X)", width);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateLineWidthx(context, width));
        if (isCallValid)
        {
            context->lineWidthx(width);
        }
        ANGLE_CAPTURE(LineWidthx, isCallValid, context, width);
    }
}

void GL_APIENTRY LinkProgramContextANGLE(GLeglContext ctx, GLuint program)
{
    EVENT("(GLuint program = %u)", program);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateLinkProgram(context, program));
        if (isCallValid)
        {
            context->linkProgram(program);
        }
        ANGLE_CAPTURE(LinkProgram, isCallValid, context, program);
    }
}

void GL_APIENTRY LoadIdentityContextANGLE(GLeglContext ctx)
{
    EVENT("()");

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateLoadIdentity(context));
        if (isCallValid)
        {
            context->loadIdentity();
        }
        ANGLE_CAPTURE(LoadIdentity, isCallValid, context);
    }
}

void GL_APIENTRY LoadMatrixfContextANGLE(GLeglContext ctx, const GLfloat *m)
{
    EVENT("(const GLfloat *m = 0x%016" PRIxPTR ")", (uintptr_t)m);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateLoadMatrixf(context, m));
        if (isCallValid)
        {
            context->loadMatrixf(m);
        }
        ANGLE_CAPTURE(LoadMatrixf, isCallValid, context, m);
    }
}

void GL_APIENTRY LoadMatrixxContextANGLE(GLeglContext ctx, const GLfixed *m)
{
    EVENT("(const GLfixed *m = 0x%016" PRIxPTR ")", (uintptr_t)m);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateLoadMatrixx(context, m));
        if (isCallValid)
        {
            context->loadMatrixx(m);
        }
        ANGLE_CAPTURE(LoadMatrixx, isCallValid, context, m);
    }
}

void GL_APIENTRY LoadPaletteFromModelViewMatrixOESContextANGLE(GLeglContext ctx)
{
    EVENT("()");

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateLoadPaletteFromModelViewMatrixOES(context));
        if (isCallValid)
        {
            context->loadPaletteFromModelViewMatrix();
        }
        ANGLE_CAPTURE(LoadPaletteFromModelViewMatrixOES, isCallValid, context);
    }
}

void GL_APIENTRY LogicOpContextANGLE(GLeglContext ctx, GLenum opcode)
{
    EVENT("(GLenum opcode = 0x%X)", opcode);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        LogicalOperation opcodePacked = FromGLenum<LogicalOperation>(opcode);
        bool isCallValid = (context->skipValidation() || ValidateLogicOp(context, opcodePacked));
        if (isCallValid)
        {
            context->logicOp(opcodePacked);
        }
        ANGLE_CAPTURE(LogicOp, isCallValid, context, opcodePacked);
    }
}

void *GL_APIENTRY MapBufferOESContextANGLE(GLeglContext ctx, GLenum target, GLenum access)
{
    EVENT("(GLenum target = 0x%X, GLenum access = 0x%X)", target, access);

    Context *context = static_cast<gl::Context *>(ctx);
    void *returnValue;
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        BufferBinding targetPacked = FromGLenum<BufferBinding>(target);
        bool isCallValid =
            (context->skipValidation() || ValidateMapBufferOES(context, targetPacked, access));
        if (isCallValid)
        {
            returnValue = context->mapBuffer(targetPacked, access);
        }
        else
        {
            returnValue = GetDefaultReturnValue<EntryPoint::MapBufferOES, void *>();
        }
        ANGLE_CAPTURE(MapBufferOES, isCallValid, context, targetPacked, access, returnValue);
    }
    else
    {
        returnValue = GetDefaultReturnValue<EntryPoint::MapBufferOES, void *>();
    }
    return returnValue;
}

void *GL_APIENTRY MapBufferRangeContextANGLE(GLeglContext ctx,
                                             GLenum target,
                                             GLintptr offset,
                                             GLsizeiptr length,
                                             GLbitfield access)
{
    EVENT(
        "(GLenum target = 0x%X, GLintptr offset = %llu, GLsizeiptr length = %llu, GLbitfield "
        "access = 0x%X)",
        target, static_cast<unsigned long long>(offset), static_cast<unsigned long long>(length),
        access);

    Context *context = static_cast<gl::Context *>(ctx);
    void *returnValue;
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        BufferBinding targetPacked = FromGLenum<BufferBinding>(target);
        bool isCallValid           = (context->skipValidation() ||
                            ValidateMapBufferRange(context, targetPacked, offset, length, access));
        if (isCallValid)
        {
            returnValue = context->mapBufferRange(targetPacked, offset, length, access);
        }
        else
        {
            returnValue = GetDefaultReturnValue<EntryPoint::MapBufferRange, void *>();
        }
        ANGLE_CAPTURE(MapBufferRange, isCallValid, context, targetPacked, offset, length, access,
                      returnValue);
    }
    else
    {
        returnValue = GetDefaultReturnValue<EntryPoint::MapBufferRange, void *>();
    }
    return returnValue;
}

void *GL_APIENTRY MapBufferRangeEXTContextANGLE(GLeglContext ctx,
                                                GLenum target,
                                                GLintptr offset,
                                                GLsizeiptr length,
                                                GLbitfield access)
{
    EVENT(
        "(GLenum target = 0x%X, GLintptr offset = %llu, GLsizeiptr length = %llu, GLbitfield "
        "access = 0x%X)",
        target, static_cast<unsigned long long>(offset), static_cast<unsigned long long>(length),
        access);

    Context *context = static_cast<gl::Context *>(ctx);
    void *returnValue;
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        BufferBinding targetPacked = FromGLenum<BufferBinding>(target);
        bool isCallValid =
            (context->skipValidation() ||
             ValidateMapBufferRangeEXT(context, targetPacked, offset, length, access));
        if (isCallValid)
        {
            returnValue = context->mapBufferRange(targetPacked, offset, length, access);
        }
        else
        {
            returnValue = GetDefaultReturnValue<EntryPoint::MapBufferRangeEXT, void *>();
        }
        ANGLE_CAPTURE(MapBufferRangeEXT, isCallValid, context, targetPacked, offset, length, access,
                      returnValue);
    }
    else
    {
        returnValue = GetDefaultReturnValue<EntryPoint::MapBufferRangeEXT, void *>();
    }
    return returnValue;
}

void GL_APIENTRY MaterialfContextANGLE(GLeglContext ctx, GLenum face, GLenum pname, GLfloat param)
{
    EVENT("(GLenum face = 0x%X, GLenum pname = 0x%X, GLfloat param = %f)", face, pname, param);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        MaterialParameter pnamePacked = FromGLenum<MaterialParameter>(pname);
        bool isCallValid =
            (context->skipValidation() || ValidateMaterialf(context, face, pnamePacked, param));
        if (isCallValid)
        {
            context->materialf(face, pnamePacked, param);
        }
        ANGLE_CAPTURE(Materialf, isCallValid, context, face, pnamePacked, param);
    }
}

void GL_APIENTRY MaterialfvContextANGLE(GLeglContext ctx,
                                        GLenum face,
                                        GLenum pname,
                                        const GLfloat *params)
{
    EVENT("(GLenum face = 0x%X, GLenum pname = 0x%X, const GLfloat *params = 0x%016" PRIxPTR ")",
          face, pname, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        MaterialParameter pnamePacked = FromGLenum<MaterialParameter>(pname);
        bool isCallValid =
            (context->skipValidation() || ValidateMaterialfv(context, face, pnamePacked, params));
        if (isCallValid)
        {
            context->materialfv(face, pnamePacked, params);
        }
        ANGLE_CAPTURE(Materialfv, isCallValid, context, face, pnamePacked, params);
    }
}

void GL_APIENTRY MaterialxContextANGLE(GLeglContext ctx, GLenum face, GLenum pname, GLfixed param)
{
    EVENT("(GLenum face = 0x%X, GLenum pname = 0x%X, GLfixed param = 0x%X)", face, pname, param);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        MaterialParameter pnamePacked = FromGLenum<MaterialParameter>(pname);
        bool isCallValid =
            (context->skipValidation() || ValidateMaterialx(context, face, pnamePacked, param));
        if (isCallValid)
        {
            context->materialx(face, pnamePacked, param);
        }
        ANGLE_CAPTURE(Materialx, isCallValid, context, face, pnamePacked, param);
    }
}

void GL_APIENTRY MaterialxvContextANGLE(GLeglContext ctx,
                                        GLenum face,
                                        GLenum pname,
                                        const GLfixed *param)
{
    EVENT("(GLenum face = 0x%X, GLenum pname = 0x%X, const GLfixed *param = 0x%016" PRIxPTR ")",
          face, pname, (uintptr_t)param);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        MaterialParameter pnamePacked = FromGLenum<MaterialParameter>(pname);
        bool isCallValid =
            (context->skipValidation() || ValidateMaterialxv(context, face, pnamePacked, param));
        if (isCallValid)
        {
            context->materialxv(face, pnamePacked, param);
        }
        ANGLE_CAPTURE(Materialxv, isCallValid, context, face, pnamePacked, param);
    }
}

void GL_APIENTRY MatrixIndexPointerOESContextANGLE(GLeglContext ctx,
                                                   GLint size,
                                                   GLenum type,
                                                   GLsizei stride,
                                                   const void *pointer)
{
    EVENT(
        "(GLint size = %d, GLenum type = 0x%X, GLsizei stride = %d, const void *pointer = "
        "0x%016" PRIxPTR ")",
        size, type, stride, (uintptr_t)pointer);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateMatrixIndexPointerOES(context, size, type, stride, pointer));
        if (isCallValid)
        {
            context->matrixIndexPointer(size, type, stride, pointer);
        }
        ANGLE_CAPTURE(MatrixIndexPointerOES, isCallValid, context, size, type, stride, pointer);
    }
}

void GL_APIENTRY MatrixModeContextANGLE(GLeglContext ctx, GLenum mode)
{
    EVENT("(GLenum mode = 0x%X)", mode);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        MatrixType modePacked = FromGLenum<MatrixType>(mode);
        bool isCallValid = (context->skipValidation() || ValidateMatrixMode(context, modePacked));
        if (isCallValid)
        {
            context->matrixMode(modePacked);
        }
        ANGLE_CAPTURE(MatrixMode, isCallValid, context, modePacked);
    }
}

void GL_APIENTRY MaxShaderCompilerThreadsKHRContextANGLE(GLeglContext ctx, GLuint count)
{
    EVENT("(GLuint count = %u)", count);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateMaxShaderCompilerThreadsKHR(context, count));
        if (isCallValid)
        {
            context->maxShaderCompilerThreads(count);
        }
        ANGLE_CAPTURE(MaxShaderCompilerThreadsKHR, isCallValid, context, count);
    }
}

void GL_APIENTRY MemoryBarrierContextANGLE(GLeglContext ctx, GLbitfield barriers)
{
    EVENT("(GLbitfield barriers = 0x%X)", barriers);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateMemoryBarrier(context, barriers));
        if (isCallValid)
        {
            context->memoryBarrier(barriers);
        }
        ANGLE_CAPTURE(MemoryBarrier, isCallValid, context, barriers);
    }
}

void GL_APIENTRY MemoryBarrierByRegionContextANGLE(GLeglContext ctx, GLbitfield barriers)
{
    EVENT("(GLbitfield barriers = 0x%X)", barriers);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateMemoryBarrierByRegion(context, barriers));
        if (isCallValid)
        {
            context->memoryBarrierByRegion(barriers);
        }
        ANGLE_CAPTURE(MemoryBarrierByRegion, isCallValid, context, barriers);
    }
}

void GL_APIENTRY MemoryObjectParameterivEXTContextANGLE(GLeglContext ctx,
                                                        GLuint memoryObject,
                                                        GLenum pname,
                                                        const GLint *params)
{
    EVENT("(GLuint memoryObject = %u, GLenum pname = 0x%X, const GLint *params = 0x%016" PRIxPTR
          ")",
          memoryObject, pname, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateMemoryObjectParameterivEXT(
                                                             context, memoryObject, pname, params));
        if (isCallValid)
        {
            context->memoryObjectParameteriv(memoryObject, pname, params);
        }
        ANGLE_CAPTURE(MemoryObjectParameterivEXT, isCallValid, context, memoryObject, pname,
                      params);
    }
}

void GL_APIENTRY MultMatrixfContextANGLE(GLeglContext ctx, const GLfloat *m)
{
    EVENT("(const GLfloat *m = 0x%016" PRIxPTR ")", (uintptr_t)m);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateMultMatrixf(context, m));
        if (isCallValid)
        {
            context->multMatrixf(m);
        }
        ANGLE_CAPTURE(MultMatrixf, isCallValid, context, m);
    }
}

void GL_APIENTRY MultMatrixxContextANGLE(GLeglContext ctx, const GLfixed *m)
{
    EVENT("(const GLfixed *m = 0x%016" PRIxPTR ")", (uintptr_t)m);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateMultMatrixx(context, m));
        if (isCallValid)
        {
            context->multMatrixx(m);
        }
        ANGLE_CAPTURE(MultMatrixx, isCallValid, context, m);
    }
}

void GL_APIENTRY MultiTexCoord4fContextANGLE(GLeglContext ctx,
                                             GLenum target,
                                             GLfloat s,
                                             GLfloat t,
                                             GLfloat r,
                                             GLfloat q)
{
    EVENT("(GLenum target = 0x%X, GLfloat s = %f, GLfloat t = %f, GLfloat r = %f, GLfloat q = %f)",
          target, s, t, r, q);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateMultiTexCoord4f(context, target, s, t, r, q));
        if (isCallValid)
        {
            context->multiTexCoord4f(target, s, t, r, q);
        }
        ANGLE_CAPTURE(MultiTexCoord4f, isCallValid, context, target, s, t, r, q);
    }
}

void GL_APIENTRY MultiTexCoord4xContextANGLE(GLeglContext ctx,
                                             GLenum texture,
                                             GLfixed s,
                                             GLfixed t,
                                             GLfixed r,
                                             GLfixed q)
{
    EVENT(
        "(GLenum texture = 0x%X, GLfixed s = 0x%X, GLfixed t = 0x%X, GLfixed r = 0x%X, GLfixed q = "
        "0x%X)",
        texture, s, t, r, q);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateMultiTexCoord4x(context, texture, s, t, r, q));
        if (isCallValid)
        {
            context->multiTexCoord4x(texture, s, t, r, q);
        }
        ANGLE_CAPTURE(MultiTexCoord4x, isCallValid, context, texture, s, t, r, q);
    }
}

void GL_APIENTRY Normal3fContextANGLE(GLeglContext ctx, GLfloat nx, GLfloat ny, GLfloat nz)
{
    EVENT("(GLfloat nx = %f, GLfloat ny = %f, GLfloat nz = %f)", nx, ny, nz);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateNormal3f(context, nx, ny, nz));
        if (isCallValid)
        {
            context->normal3f(nx, ny, nz);
        }
        ANGLE_CAPTURE(Normal3f, isCallValid, context, nx, ny, nz);
    }
}

void GL_APIENTRY Normal3xContextANGLE(GLeglContext ctx, GLfixed nx, GLfixed ny, GLfixed nz)
{
    EVENT("(GLfixed nx = 0x%X, GLfixed ny = 0x%X, GLfixed nz = 0x%X)", nx, ny, nz);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateNormal3x(context, nx, ny, nz));
        if (isCallValid)
        {
            context->normal3x(nx, ny, nz);
        }
        ANGLE_CAPTURE(Normal3x, isCallValid, context, nx, ny, nz);
    }
}

void GL_APIENTRY NormalPointerContextANGLE(GLeglContext ctx,
                                           GLenum type,
                                           GLsizei stride,
                                           const void *pointer)
{
    EVENT("(GLenum type = 0x%X, GLsizei stride = %d, const void *pointer = 0x%016" PRIxPTR ")",
          type, stride, (uintptr_t)pointer);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        VertexAttribType typePacked = FromGLenum<VertexAttribType>(type);
        bool isCallValid            = (context->skipValidation() ||
                            ValidateNormalPointer(context, typePacked, stride, pointer));
        if (isCallValid)
        {
            context->normalPointer(typePacked, stride, pointer);
        }
        ANGLE_CAPTURE(NormalPointer, isCallValid, context, typePacked, stride, pointer);
    }
}

void GL_APIENTRY ObjectLabelKHRContextANGLE(GLeglContext ctx,
                                            GLenum identifier,
                                            GLuint name,
                                            GLsizei length,
                                            const GLchar *label)
{
    EVENT(
        "(GLenum identifier = 0x%X, GLuint name = %u, GLsizei length = %d, const GLchar *label = "
        "0x%016" PRIxPTR ")",
        identifier, name, length, (uintptr_t)label);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateObjectLabelKHR(context, identifier, name, length, label));
        if (isCallValid)
        {
            context->objectLabel(identifier, name, length, label);
        }
        ANGLE_CAPTURE(ObjectLabelKHR, isCallValid, context, identifier, name, length, label);
    }
}

void GL_APIENTRY ObjectPtrLabelKHRContextANGLE(GLeglContext ctx,
                                               const void *ptr,
                                               GLsizei length,
                                               const GLchar *label)
{
    EVENT("(const void *ptr = 0x%016" PRIxPTR
          ", GLsizei length = %d, const GLchar *label = 0x%016" PRIxPTR ")",
          (uintptr_t)ptr, length, (uintptr_t)label);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateObjectPtrLabelKHR(context, ptr, length, label));
        if (isCallValid)
        {
            context->objectPtrLabel(ptr, length, label);
        }
        ANGLE_CAPTURE(ObjectPtrLabelKHR, isCallValid, context, ptr, length, label);
    }
}

void GL_APIENTRY OrthofContextANGLE(GLeglContext ctx,
                                    GLfloat l,
                                    GLfloat r,
                                    GLfloat b,
                                    GLfloat t,
                                    GLfloat n,
                                    GLfloat f)
{
    EVENT(
        "(GLfloat l = %f, GLfloat r = %f, GLfloat b = %f, GLfloat t = %f, GLfloat n = %f, GLfloat "
        "f = %f)",
        l, r, b, t, n, f);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateOrthof(context, l, r, b, t, n, f));
        if (isCallValid)
        {
            context->orthof(l, r, b, t, n, f);
        }
        ANGLE_CAPTURE(Orthof, isCallValid, context, l, r, b, t, n, f);
    }
}

void GL_APIENTRY OrthoxContextANGLE(GLeglContext ctx,
                                    GLfixed l,
                                    GLfixed r,
                                    GLfixed b,
                                    GLfixed t,
                                    GLfixed n,
                                    GLfixed f)
{
    EVENT(
        "(GLfixed l = 0x%X, GLfixed r = 0x%X, GLfixed b = 0x%X, GLfixed t = 0x%X, GLfixed n = "
        "0x%X, GLfixed f = 0x%X)",
        l, r, b, t, n, f);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateOrthox(context, l, r, b, t, n, f));
        if (isCallValid)
        {
            context->orthox(l, r, b, t, n, f);
        }
        ANGLE_CAPTURE(Orthox, isCallValid, context, l, r, b, t, n, f);
    }
}

void GL_APIENTRY PauseTransformFeedbackContextANGLE(GLeglContext ctx)
{
    EVENT("()");

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidatePauseTransformFeedback(context));
        if (isCallValid)
        {
            context->pauseTransformFeedback();
        }
        ANGLE_CAPTURE(PauseTransformFeedback, isCallValid, context);
    }
}

void GL_APIENTRY PixelStoreiContextANGLE(GLeglContext ctx, GLenum pname, GLint param)
{
    EVENT("(GLenum pname = 0x%X, GLint param = %d)", pname, param);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidatePixelStorei(context, pname, param));
        if (isCallValid)
        {
            context->pixelStorei(pname, param);
        }
        ANGLE_CAPTURE(PixelStorei, isCallValid, context, pname, param);
    }
}

void GL_APIENTRY PointParameterfContextANGLE(GLeglContext ctx, GLenum pname, GLfloat param)
{
    EVENT("(GLenum pname = 0x%X, GLfloat param = %f)", pname, param);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        PointParameter pnamePacked = FromGLenum<PointParameter>(pname);
        bool isCallValid =
            (context->skipValidation() || ValidatePointParameterf(context, pnamePacked, param));
        if (isCallValid)
        {
            context->pointParameterf(pnamePacked, param);
        }
        ANGLE_CAPTURE(PointParameterf, isCallValid, context, pnamePacked, param);
    }
}

void GL_APIENTRY PointParameterfvContextANGLE(GLeglContext ctx, GLenum pname, const GLfloat *params)
{
    EVENT("(GLenum pname = 0x%X, const GLfloat *params = 0x%016" PRIxPTR ")", pname,
          (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        PointParameter pnamePacked = FromGLenum<PointParameter>(pname);
        bool isCallValid =
            (context->skipValidation() || ValidatePointParameterfv(context, pnamePacked, params));
        if (isCallValid)
        {
            context->pointParameterfv(pnamePacked, params);
        }
        ANGLE_CAPTURE(PointParameterfv, isCallValid, context, pnamePacked, params);
    }
}

void GL_APIENTRY PointParameterxContextANGLE(GLeglContext ctx, GLenum pname, GLfixed param)
{
    EVENT("(GLenum pname = 0x%X, GLfixed param = 0x%X)", pname, param);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        PointParameter pnamePacked = FromGLenum<PointParameter>(pname);
        bool isCallValid =
            (context->skipValidation() || ValidatePointParameterx(context, pnamePacked, param));
        if (isCallValid)
        {
            context->pointParameterx(pnamePacked, param);
        }
        ANGLE_CAPTURE(PointParameterx, isCallValid, context, pnamePacked, param);
    }
}

void GL_APIENTRY PointParameterxvContextANGLE(GLeglContext ctx, GLenum pname, const GLfixed *params)
{
    EVENT("(GLenum pname = 0x%X, const GLfixed *params = 0x%016" PRIxPTR ")", pname,
          (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        PointParameter pnamePacked = FromGLenum<PointParameter>(pname);
        bool isCallValid =
            (context->skipValidation() || ValidatePointParameterxv(context, pnamePacked, params));
        if (isCallValid)
        {
            context->pointParameterxv(pnamePacked, params);
        }
        ANGLE_CAPTURE(PointParameterxv, isCallValid, context, pnamePacked, params);
    }
}

void GL_APIENTRY PointSizeContextANGLE(GLeglContext ctx, GLfloat size)
{
    EVENT("(GLfloat size = %f)", size);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidatePointSize(context, size));
        if (isCallValid)
        {
            context->pointSize(size);
        }
        ANGLE_CAPTURE(PointSize, isCallValid, context, size);
    }
}

void GL_APIENTRY PointSizePointerOESContextANGLE(GLeglContext ctx,
                                                 GLenum type,
                                                 GLsizei stride,
                                                 const void *pointer)
{
    EVENT("(GLenum type = 0x%X, GLsizei stride = %d, const void *pointer = 0x%016" PRIxPTR ")",
          type, stride, (uintptr_t)pointer);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        VertexAttribType typePacked = FromGLenum<VertexAttribType>(type);
        bool isCallValid            = (context->skipValidation() ||
                            ValidatePointSizePointerOES(context, typePacked, stride, pointer));
        if (isCallValid)
        {
            context->pointSizePointer(typePacked, stride, pointer);
        }
        ANGLE_CAPTURE(PointSizePointerOES, isCallValid, context, typePacked, stride, pointer);
    }
}

void GL_APIENTRY PointSizexContextANGLE(GLeglContext ctx, GLfixed size)
{
    EVENT("(GLfixed size = 0x%X)", size);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidatePointSizex(context, size));
        if (isCallValid)
        {
            context->pointSizex(size);
        }
        ANGLE_CAPTURE(PointSizex, isCallValid, context, size);
    }
}

void GL_APIENTRY PolygonOffsetContextANGLE(GLeglContext ctx, GLfloat factor, GLfloat units)
{
    EVENT("(GLfloat factor = %f, GLfloat units = %f)", factor, units);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidatePolygonOffset(context, factor, units));
        if (isCallValid)
        {
            context->polygonOffset(factor, units);
        }
        ANGLE_CAPTURE(PolygonOffset, isCallValid, context, factor, units);
    }
}

void GL_APIENTRY PolygonOffsetxContextANGLE(GLeglContext ctx, GLfixed factor, GLfixed units)
{
    EVENT("(GLfixed factor = 0x%X, GLfixed units = 0x%X)", factor, units);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidatePolygonOffsetx(context, factor, units));
        if (isCallValid)
        {
            context->polygonOffsetx(factor, units);
        }
        ANGLE_CAPTURE(PolygonOffsetx, isCallValid, context, factor, units);
    }
}

void GL_APIENTRY PopDebugGroupKHRContextANGLE(GLeglContext ctx)
{
    EVENT("()");

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidatePopDebugGroupKHR(context));
        if (isCallValid)
        {
            context->popDebugGroup();
        }
        ANGLE_CAPTURE(PopDebugGroupKHR, isCallValid, context);
    }
}

void GL_APIENTRY PopGroupMarkerEXTContextANGLE(GLeglContext ctx)
{
    // Don't run an EVENT() macro on the EXT_debug_marker entry points.
    // It can interfere with the debug events being set by the caller.
    // EVENT("()");

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidatePopGroupMarkerEXT(context));
        if (isCallValid)
        {
            context->popGroupMarker();
        }
        ANGLE_CAPTURE(PopGroupMarkerEXT, isCallValid, context);
    }
}

void GL_APIENTRY PopMatrixContextANGLE(GLeglContext ctx)
{
    EVENT("()");

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidatePopMatrix(context));
        if (isCallValid)
        {
            context->popMatrix();
        }
        ANGLE_CAPTURE(PopMatrix, isCallValid, context);
    }
}

void GL_APIENTRY ProgramBinaryContextANGLE(GLeglContext ctx,
                                           GLuint program,
                                           GLenum binaryFormat,
                                           const void *binary,
                                           GLsizei length)
{
    EVENT("(GLuint program = %u, GLenum binaryFormat = 0x%X, const void *binary = 0x%016" PRIxPTR
          ", GLsizei length = %d)",
          program, binaryFormat, (uintptr_t)binary, length);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateProgramBinary(context, program, binaryFormat, binary, length));
        if (isCallValid)
        {
            context->programBinary(program, binaryFormat, binary, length);
        }
        ANGLE_CAPTURE(ProgramBinary, isCallValid, context, program, binaryFormat, binary, length);
    }
}

void GL_APIENTRY ProgramBinaryOESContextANGLE(GLeglContext ctx,
                                              GLuint program,
                                              GLenum binaryFormat,
                                              const void *binary,
                                              GLint length)
{
    EVENT("(GLuint program = %u, GLenum binaryFormat = 0x%X, const void *binary = 0x%016" PRIxPTR
          ", GLint length = %d)",
          program, binaryFormat, (uintptr_t)binary, length);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() ||
             ValidateProgramBinaryOES(context, program, binaryFormat, binary, length));
        if (isCallValid)
        {
            context->programBinary(program, binaryFormat, binary, length);
        }
        ANGLE_CAPTURE(ProgramBinaryOES, isCallValid, context, program, binaryFormat, binary,
                      length);
    }
}

void GL_APIENTRY ProgramParameteriContextANGLE(GLeglContext ctx,
                                               GLuint program,
                                               GLenum pname,
                                               GLint value)
{
    EVENT("(GLuint program = %u, GLenum pname = 0x%X, GLint value = %d)", program, pname, value);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateProgramParameteri(context, program, pname, value));
        if (isCallValid)
        {
            context->programParameteri(program, pname, value);
        }
        ANGLE_CAPTURE(ProgramParameteri, isCallValid, context, program, pname, value);
    }
}

void GL_APIENTRY ProgramUniform1fContextANGLE(GLeglContext ctx,
                                              GLuint program,
                                              GLint location,
                                              GLfloat v0)
{
    EVENT("(GLuint program = %u, GLint location = %d, GLfloat v0 = %f)", program, location, v0);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateProgramUniform1f(context, program, location, v0));
        if (isCallValid)
        {
            context->programUniform1f(program, location, v0);
        }
        ANGLE_CAPTURE(ProgramUniform1f, isCallValid, context, program, location, v0);
    }
}

void GL_APIENTRY ProgramUniform1fvContextANGLE(GLeglContext ctx,
                                               GLuint program,
                                               GLint location,
                                               GLsizei count,
                                               const GLfloat *value)
{
    EVENT(
        "(GLuint program = %u, GLint location = %d, GLsizei count = %d, const GLfloat *value = "
        "0x%016" PRIxPTR ")",
        program, location, count, (uintptr_t)value);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateProgramUniform1fv(context, program, location, count, value));
        if (isCallValid)
        {
            context->programUniform1fv(program, location, count, value);
        }
        ANGLE_CAPTURE(ProgramUniform1fv, isCallValid, context, program, location, count, value);
    }
}

void GL_APIENTRY ProgramUniform1iContextANGLE(GLeglContext ctx,
                                              GLuint program,
                                              GLint location,
                                              GLint v0)
{
    EVENT("(GLuint program = %u, GLint location = %d, GLint v0 = %d)", program, location, v0);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateProgramUniform1i(context, program, location, v0));
        if (isCallValid)
        {
            context->programUniform1i(program, location, v0);
        }
        ANGLE_CAPTURE(ProgramUniform1i, isCallValid, context, program, location, v0);
    }
}

void GL_APIENTRY ProgramUniform1ivContextANGLE(GLeglContext ctx,
                                               GLuint program,
                                               GLint location,
                                               GLsizei count,
                                               const GLint *value)
{
    EVENT(
        "(GLuint program = %u, GLint location = %d, GLsizei count = %d, const GLint *value = "
        "0x%016" PRIxPTR ")",
        program, location, count, (uintptr_t)value);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateProgramUniform1iv(context, program, location, count, value));
        if (isCallValid)
        {
            context->programUniform1iv(program, location, count, value);
        }
        ANGLE_CAPTURE(ProgramUniform1iv, isCallValid, context, program, location, count, value);
    }
}

void GL_APIENTRY ProgramUniform1uiContextANGLE(GLeglContext ctx,
                                               GLuint program,
                                               GLint location,
                                               GLuint v0)
{
    EVENT("(GLuint program = %u, GLint location = %d, GLuint v0 = %u)", program, location, v0);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateProgramUniform1ui(context, program, location, v0));
        if (isCallValid)
        {
            context->programUniform1ui(program, location, v0);
        }
        ANGLE_CAPTURE(ProgramUniform1ui, isCallValid, context, program, location, v0);
    }
}

void GL_APIENTRY ProgramUniform1uivContextANGLE(GLeglContext ctx,
                                                GLuint program,
                                                GLint location,
                                                GLsizei count,
                                                const GLuint *value)
{
    EVENT(
        "(GLuint program = %u, GLint location = %d, GLsizei count = %d, const GLuint *value = "
        "0x%016" PRIxPTR ")",
        program, location, count, (uintptr_t)value);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateProgramUniform1uiv(context, program, location, count, value));
        if (isCallValid)
        {
            context->programUniform1uiv(program, location, count, value);
        }
        ANGLE_CAPTURE(ProgramUniform1uiv, isCallValid, context, program, location, count, value);
    }
}

void GL_APIENTRY ProgramUniform2fContextANGLE(GLeglContext ctx,
                                              GLuint program,
                                              GLint location,
                                              GLfloat v0,
                                              GLfloat v1)
{
    EVENT("(GLuint program = %u, GLint location = %d, GLfloat v0 = %f, GLfloat v1 = %f)", program,
          location, v0, v1);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateProgramUniform2f(context, program, location, v0, v1));
        if (isCallValid)
        {
            context->programUniform2f(program, location, v0, v1);
        }
        ANGLE_CAPTURE(ProgramUniform2f, isCallValid, context, program, location, v0, v1);
    }
}

void GL_APIENTRY ProgramUniform2fvContextANGLE(GLeglContext ctx,
                                               GLuint program,
                                               GLint location,
                                               GLsizei count,
                                               const GLfloat *value)
{
    EVENT(
        "(GLuint program = %u, GLint location = %d, GLsizei count = %d, const GLfloat *value = "
        "0x%016" PRIxPTR ")",
        program, location, count, (uintptr_t)value);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateProgramUniform2fv(context, program, location, count, value));
        if (isCallValid)
        {
            context->programUniform2fv(program, location, count, value);
        }
        ANGLE_CAPTURE(ProgramUniform2fv, isCallValid, context, program, location, count, value);
    }
}

void GL_APIENTRY
ProgramUniform2iContextANGLE(GLeglContext ctx, GLuint program, GLint location, GLint v0, GLint v1)
{
    EVENT("(GLuint program = %u, GLint location = %d, GLint v0 = %d, GLint v1 = %d)", program,
          location, v0, v1);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateProgramUniform2i(context, program, location, v0, v1));
        if (isCallValid)
        {
            context->programUniform2i(program, location, v0, v1);
        }
        ANGLE_CAPTURE(ProgramUniform2i, isCallValid, context, program, location, v0, v1);
    }
}

void GL_APIENTRY ProgramUniform2ivContextANGLE(GLeglContext ctx,
                                               GLuint program,
                                               GLint location,
                                               GLsizei count,
                                               const GLint *value)
{
    EVENT(
        "(GLuint program = %u, GLint location = %d, GLsizei count = %d, const GLint *value = "
        "0x%016" PRIxPTR ")",
        program, location, count, (uintptr_t)value);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateProgramUniform2iv(context, program, location, count, value));
        if (isCallValid)
        {
            context->programUniform2iv(program, location, count, value);
        }
        ANGLE_CAPTURE(ProgramUniform2iv, isCallValid, context, program, location, count, value);
    }
}

void GL_APIENTRY ProgramUniform2uiContextANGLE(GLeglContext ctx,
                                               GLuint program,
                                               GLint location,
                                               GLuint v0,
                                               GLuint v1)
{
    EVENT("(GLuint program = %u, GLint location = %d, GLuint v0 = %u, GLuint v1 = %u)", program,
          location, v0, v1);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateProgramUniform2ui(context, program, location, v0, v1));
        if (isCallValid)
        {
            context->programUniform2ui(program, location, v0, v1);
        }
        ANGLE_CAPTURE(ProgramUniform2ui, isCallValid, context, program, location, v0, v1);
    }
}

void GL_APIENTRY ProgramUniform2uivContextANGLE(GLeglContext ctx,
                                                GLuint program,
                                                GLint location,
                                                GLsizei count,
                                                const GLuint *value)
{
    EVENT(
        "(GLuint program = %u, GLint location = %d, GLsizei count = %d, const GLuint *value = "
        "0x%016" PRIxPTR ")",
        program, location, count, (uintptr_t)value);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateProgramUniform2uiv(context, program, location, count, value));
        if (isCallValid)
        {
            context->programUniform2uiv(program, location, count, value);
        }
        ANGLE_CAPTURE(ProgramUniform2uiv, isCallValid, context, program, location, count, value);
    }
}

void GL_APIENTRY ProgramUniform3fContextANGLE(GLeglContext ctx,
                                              GLuint program,
                                              GLint location,
                                              GLfloat v0,
                                              GLfloat v1,
                                              GLfloat v2)
{
    EVENT(
        "(GLuint program = %u, GLint location = %d, GLfloat v0 = %f, GLfloat v1 = %f, GLfloat v2 = "
        "%f)",
        program, location, v0, v1, v2);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateProgramUniform3f(context, program, location, v0, v1, v2));
        if (isCallValid)
        {
            context->programUniform3f(program, location, v0, v1, v2);
        }
        ANGLE_CAPTURE(ProgramUniform3f, isCallValid, context, program, location, v0, v1, v2);
    }
}

void GL_APIENTRY ProgramUniform3fvContextANGLE(GLeglContext ctx,
                                               GLuint program,
                                               GLint location,
                                               GLsizei count,
                                               const GLfloat *value)
{
    EVENT(
        "(GLuint program = %u, GLint location = %d, GLsizei count = %d, const GLfloat *value = "
        "0x%016" PRIxPTR ")",
        program, location, count, (uintptr_t)value);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateProgramUniform3fv(context, program, location, count, value));
        if (isCallValid)
        {
            context->programUniform3fv(program, location, count, value);
        }
        ANGLE_CAPTURE(ProgramUniform3fv, isCallValid, context, program, location, count, value);
    }
}

void GL_APIENTRY ProgramUniform3iContextANGLE(GLeglContext ctx,
                                              GLuint program,
                                              GLint location,
                                              GLint v0,
                                              GLint v1,
                                              GLint v2)
{
    EVENT("(GLuint program = %u, GLint location = %d, GLint v0 = %d, GLint v1 = %d, GLint v2 = %d)",
          program, location, v0, v1, v2);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateProgramUniform3i(context, program, location, v0, v1, v2));
        if (isCallValid)
        {
            context->programUniform3i(program, location, v0, v1, v2);
        }
        ANGLE_CAPTURE(ProgramUniform3i, isCallValid, context, program, location, v0, v1, v2);
    }
}

void GL_APIENTRY ProgramUniform3ivContextANGLE(GLeglContext ctx,
                                               GLuint program,
                                               GLint location,
                                               GLsizei count,
                                               const GLint *value)
{
    EVENT(
        "(GLuint program = %u, GLint location = %d, GLsizei count = %d, const GLint *value = "
        "0x%016" PRIxPTR ")",
        program, location, count, (uintptr_t)value);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateProgramUniform3iv(context, program, location, count, value));
        if (isCallValid)
        {
            context->programUniform3iv(program, location, count, value);
        }
        ANGLE_CAPTURE(ProgramUniform3iv, isCallValid, context, program, location, count, value);
    }
}

void GL_APIENTRY ProgramUniform3uiContextANGLE(GLeglContext ctx,
                                               GLuint program,
                                               GLint location,
                                               GLuint v0,
                                               GLuint v1,
                                               GLuint v2)
{
    EVENT(
        "(GLuint program = %u, GLint location = %d, GLuint v0 = %u, GLuint v1 = %u, GLuint v2 = "
        "%u)",
        program, location, v0, v1, v2);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateProgramUniform3ui(context, program, location, v0, v1, v2));
        if (isCallValid)
        {
            context->programUniform3ui(program, location, v0, v1, v2);
        }
        ANGLE_CAPTURE(ProgramUniform3ui, isCallValid, context, program, location, v0, v1, v2);
    }
}

void GL_APIENTRY ProgramUniform3uivContextANGLE(GLeglContext ctx,
                                                GLuint program,
                                                GLint location,
                                                GLsizei count,
                                                const GLuint *value)
{
    EVENT(
        "(GLuint program = %u, GLint location = %d, GLsizei count = %d, const GLuint *value = "
        "0x%016" PRIxPTR ")",
        program, location, count, (uintptr_t)value);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateProgramUniform3uiv(context, program, location, count, value));
        if (isCallValid)
        {
            context->programUniform3uiv(program, location, count, value);
        }
        ANGLE_CAPTURE(ProgramUniform3uiv, isCallValid, context, program, location, count, value);
    }
}

void GL_APIENTRY ProgramUniform4fContextANGLE(GLeglContext ctx,
                                              GLuint program,
                                              GLint location,
                                              GLfloat v0,
                                              GLfloat v1,
                                              GLfloat v2,
                                              GLfloat v3)
{
    EVENT(
        "(GLuint program = %u, GLint location = %d, GLfloat v0 = %f, GLfloat v1 = %f, GLfloat v2 = "
        "%f, GLfloat v3 = %f)",
        program, location, v0, v1, v2, v3);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateProgramUniform4f(context, program, location, v0, v1, v2, v3));
        if (isCallValid)
        {
            context->programUniform4f(program, location, v0, v1, v2, v3);
        }
        ANGLE_CAPTURE(ProgramUniform4f, isCallValid, context, program, location, v0, v1, v2, v3);
    }
}

void GL_APIENTRY ProgramUniform4fvContextANGLE(GLeglContext ctx,
                                               GLuint program,
                                               GLint location,
                                               GLsizei count,
                                               const GLfloat *value)
{
    EVENT(
        "(GLuint program = %u, GLint location = %d, GLsizei count = %d, const GLfloat *value = "
        "0x%016" PRIxPTR ")",
        program, location, count, (uintptr_t)value);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateProgramUniform4fv(context, program, location, count, value));
        if (isCallValid)
        {
            context->programUniform4fv(program, location, count, value);
        }
        ANGLE_CAPTURE(ProgramUniform4fv, isCallValid, context, program, location, count, value);
    }
}

void GL_APIENTRY ProgramUniform4iContextANGLE(GLeglContext ctx,
                                              GLuint program,
                                              GLint location,
                                              GLint v0,
                                              GLint v1,
                                              GLint v2,
                                              GLint v3)
{
    EVENT(
        "(GLuint program = %u, GLint location = %d, GLint v0 = %d, GLint v1 = %d, GLint v2 = %d, "
        "GLint v3 = %d)",
        program, location, v0, v1, v2, v3);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateProgramUniform4i(context, program, location, v0, v1, v2, v3));
        if (isCallValid)
        {
            context->programUniform4i(program, location, v0, v1, v2, v3);
        }
        ANGLE_CAPTURE(ProgramUniform4i, isCallValid, context, program, location, v0, v1, v2, v3);
    }
}

void GL_APIENTRY ProgramUniform4ivContextANGLE(GLeglContext ctx,
                                               GLuint program,
                                               GLint location,
                                               GLsizei count,
                                               const GLint *value)
{
    EVENT(
        "(GLuint program = %u, GLint location = %d, GLsizei count = %d, const GLint *value = "
        "0x%016" PRIxPTR ")",
        program, location, count, (uintptr_t)value);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateProgramUniform4iv(context, program, location, count, value));
        if (isCallValid)
        {
            context->programUniform4iv(program, location, count, value);
        }
        ANGLE_CAPTURE(ProgramUniform4iv, isCallValid, context, program, location, count, value);
    }
}

void GL_APIENTRY ProgramUniform4uiContextANGLE(GLeglContext ctx,
                                               GLuint program,
                                               GLint location,
                                               GLuint v0,
                                               GLuint v1,
                                               GLuint v2,
                                               GLuint v3)
{
    EVENT(
        "(GLuint program = %u, GLint location = %d, GLuint v0 = %u, GLuint v1 = %u, GLuint v2 = "
        "%u, GLuint v3 = %u)",
        program, location, v0, v1, v2, v3);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateProgramUniform4ui(context, program, location, v0, v1, v2, v3));
        if (isCallValid)
        {
            context->programUniform4ui(program, location, v0, v1, v2, v3);
        }
        ANGLE_CAPTURE(ProgramUniform4ui, isCallValid, context, program, location, v0, v1, v2, v3);
    }
}

void GL_APIENTRY ProgramUniform4uivContextANGLE(GLeglContext ctx,
                                                GLuint program,
                                                GLint location,
                                                GLsizei count,
                                                const GLuint *value)
{
    EVENT(
        "(GLuint program = %u, GLint location = %d, GLsizei count = %d, const GLuint *value = "
        "0x%016" PRIxPTR ")",
        program, location, count, (uintptr_t)value);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateProgramUniform4uiv(context, program, location, count, value));
        if (isCallValid)
        {
            context->programUniform4uiv(program, location, count, value);
        }
        ANGLE_CAPTURE(ProgramUniform4uiv, isCallValid, context, program, location, count, value);
    }
}

void GL_APIENTRY ProgramUniformMatrix2fvContextANGLE(GLeglContext ctx,
                                                     GLuint program,
                                                     GLint location,
                                                     GLsizei count,
                                                     GLboolean transpose,
                                                     const GLfloat *value)
{
    EVENT(
        "(GLuint program = %u, GLint location = %d, GLsizei count = %d, GLboolean transpose = %u, "
        "const GLfloat *value = 0x%016" PRIxPTR ")",
        program, location, count, transpose, (uintptr_t)value);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() ||
             ValidateProgramUniformMatrix2fv(context, program, location, count, transpose, value));
        if (isCallValid)
        {
            context->programUniformMatrix2fv(program, location, count, transpose, value);
        }
        ANGLE_CAPTURE(ProgramUniformMatrix2fv, isCallValid, context, program, location, count,
                      transpose, value);
    }
}

void GL_APIENTRY ProgramUniformMatrix2x3fvContextANGLE(GLeglContext ctx,
                                                       GLuint program,
                                                       GLint location,
                                                       GLsizei count,
                                                       GLboolean transpose,
                                                       const GLfloat *value)
{
    EVENT(
        "(GLuint program = %u, GLint location = %d, GLsizei count = %d, GLboolean transpose = %u, "
        "const GLfloat *value = 0x%016" PRIxPTR ")",
        program, location, count, transpose, (uintptr_t)value);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateProgramUniformMatrix2x3fv(
                                              context, program, location, count, transpose, value));
        if (isCallValid)
        {
            context->programUniformMatrix2x3fv(program, location, count, transpose, value);
        }
        ANGLE_CAPTURE(ProgramUniformMatrix2x3fv, isCallValid, context, program, location, count,
                      transpose, value);
    }
}

void GL_APIENTRY ProgramUniformMatrix2x4fvContextANGLE(GLeglContext ctx,
                                                       GLuint program,
                                                       GLint location,
                                                       GLsizei count,
                                                       GLboolean transpose,
                                                       const GLfloat *value)
{
    EVENT(
        "(GLuint program = %u, GLint location = %d, GLsizei count = %d, GLboolean transpose = %u, "
        "const GLfloat *value = 0x%016" PRIxPTR ")",
        program, location, count, transpose, (uintptr_t)value);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateProgramUniformMatrix2x4fv(
                                              context, program, location, count, transpose, value));
        if (isCallValid)
        {
            context->programUniformMatrix2x4fv(program, location, count, transpose, value);
        }
        ANGLE_CAPTURE(ProgramUniformMatrix2x4fv, isCallValid, context, program, location, count,
                      transpose, value);
    }
}

void GL_APIENTRY ProgramUniformMatrix3fvContextANGLE(GLeglContext ctx,
                                                     GLuint program,
                                                     GLint location,
                                                     GLsizei count,
                                                     GLboolean transpose,
                                                     const GLfloat *value)
{
    EVENT(
        "(GLuint program = %u, GLint location = %d, GLsizei count = %d, GLboolean transpose = %u, "
        "const GLfloat *value = 0x%016" PRIxPTR ")",
        program, location, count, transpose, (uintptr_t)value);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() ||
             ValidateProgramUniformMatrix3fv(context, program, location, count, transpose, value));
        if (isCallValid)
        {
            context->programUniformMatrix3fv(program, location, count, transpose, value);
        }
        ANGLE_CAPTURE(ProgramUniformMatrix3fv, isCallValid, context, program, location, count,
                      transpose, value);
    }
}

void GL_APIENTRY ProgramUniformMatrix3x2fvContextANGLE(GLeglContext ctx,
                                                       GLuint program,
                                                       GLint location,
                                                       GLsizei count,
                                                       GLboolean transpose,
                                                       const GLfloat *value)
{
    EVENT(
        "(GLuint program = %u, GLint location = %d, GLsizei count = %d, GLboolean transpose = %u, "
        "const GLfloat *value = 0x%016" PRIxPTR ")",
        program, location, count, transpose, (uintptr_t)value);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateProgramUniformMatrix3x2fv(
                                              context, program, location, count, transpose, value));
        if (isCallValid)
        {
            context->programUniformMatrix3x2fv(program, location, count, transpose, value);
        }
        ANGLE_CAPTURE(ProgramUniformMatrix3x2fv, isCallValid, context, program, location, count,
                      transpose, value);
    }
}

void GL_APIENTRY ProgramUniformMatrix3x4fvContextANGLE(GLeglContext ctx,
                                                       GLuint program,
                                                       GLint location,
                                                       GLsizei count,
                                                       GLboolean transpose,
                                                       const GLfloat *value)
{
    EVENT(
        "(GLuint program = %u, GLint location = %d, GLsizei count = %d, GLboolean transpose = %u, "
        "const GLfloat *value = 0x%016" PRIxPTR ")",
        program, location, count, transpose, (uintptr_t)value);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateProgramUniformMatrix3x4fv(
                                              context, program, location, count, transpose, value));
        if (isCallValid)
        {
            context->programUniformMatrix3x4fv(program, location, count, transpose, value);
        }
        ANGLE_CAPTURE(ProgramUniformMatrix3x4fv, isCallValid, context, program, location, count,
                      transpose, value);
    }
}

void GL_APIENTRY ProgramUniformMatrix4fvContextANGLE(GLeglContext ctx,
                                                     GLuint program,
                                                     GLint location,
                                                     GLsizei count,
                                                     GLboolean transpose,
                                                     const GLfloat *value)
{
    EVENT(
        "(GLuint program = %u, GLint location = %d, GLsizei count = %d, GLboolean transpose = %u, "
        "const GLfloat *value = 0x%016" PRIxPTR ")",
        program, location, count, transpose, (uintptr_t)value);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() ||
             ValidateProgramUniformMatrix4fv(context, program, location, count, transpose, value));
        if (isCallValid)
        {
            context->programUniformMatrix4fv(program, location, count, transpose, value);
        }
        ANGLE_CAPTURE(ProgramUniformMatrix4fv, isCallValid, context, program, location, count,
                      transpose, value);
    }
}

void GL_APIENTRY ProgramUniformMatrix4x2fvContextANGLE(GLeglContext ctx,
                                                       GLuint program,
                                                       GLint location,
                                                       GLsizei count,
                                                       GLboolean transpose,
                                                       const GLfloat *value)
{
    EVENT(
        "(GLuint program = %u, GLint location = %d, GLsizei count = %d, GLboolean transpose = %u, "
        "const GLfloat *value = 0x%016" PRIxPTR ")",
        program, location, count, transpose, (uintptr_t)value);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateProgramUniformMatrix4x2fv(
                                              context, program, location, count, transpose, value));
        if (isCallValid)
        {
            context->programUniformMatrix4x2fv(program, location, count, transpose, value);
        }
        ANGLE_CAPTURE(ProgramUniformMatrix4x2fv, isCallValid, context, program, location, count,
                      transpose, value);
    }
}

void GL_APIENTRY ProgramUniformMatrix4x3fvContextANGLE(GLeglContext ctx,
                                                       GLuint program,
                                                       GLint location,
                                                       GLsizei count,
                                                       GLboolean transpose,
                                                       const GLfloat *value)
{
    EVENT(
        "(GLuint program = %u, GLint location = %d, GLsizei count = %d, GLboolean transpose = %u, "
        "const GLfloat *value = 0x%016" PRIxPTR ")",
        program, location, count, transpose, (uintptr_t)value);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateProgramUniformMatrix4x3fv(
                                              context, program, location, count, transpose, value));
        if (isCallValid)
        {
            context->programUniformMatrix4x3fv(program, location, count, transpose, value);
        }
        ANGLE_CAPTURE(ProgramUniformMatrix4x3fv, isCallValid, context, program, location, count,
                      transpose, value);
    }
}

void GL_APIENTRY PushDebugGroupKHRContextANGLE(GLeglContext ctx,
                                               GLenum source,
                                               GLuint id,
                                               GLsizei length,
                                               const GLchar *message)
{
    EVENT(
        "(GLenum source = 0x%X, GLuint id = %u, GLsizei length = %d, const GLchar *message = "
        "0x%016" PRIxPTR ")",
        source, id, length, (uintptr_t)message);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidatePushDebugGroupKHR(context, source, id, length, message));
        if (isCallValid)
        {
            context->pushDebugGroup(source, id, length, message);
        }
        ANGLE_CAPTURE(PushDebugGroupKHR, isCallValid, context, source, id, length, message);
    }
}

void GL_APIENTRY PushGroupMarkerEXTContextANGLE(GLeglContext ctx,
                                                GLsizei length,
                                                const GLchar *marker)
{
    // Don't run an EVENT() macro on the EXT_debug_marker entry points.
    // It can interfere with the debug events being set by the caller.
    // EVENT("(GLsizei length = %d, const GLchar *marker = 0x%016" PRIxPTR ")", length,
    // (uintptr_t)marker);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidatePushGroupMarkerEXT(context, length, marker));
        if (isCallValid)
        {
            context->pushGroupMarker(length, marker);
        }
        ANGLE_CAPTURE(PushGroupMarkerEXT, isCallValid, context, length, marker);
    }
}

void GL_APIENTRY PushMatrixContextANGLE(GLeglContext ctx)
{
    EVENT("()");

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidatePushMatrix(context));
        if (isCallValid)
        {
            context->pushMatrix();
        }
        ANGLE_CAPTURE(PushMatrix, isCallValid, context);
    }
}

void GL_APIENTRY QueryCounterEXTContextANGLE(GLeglContext ctx, GLuint id, GLenum target)
{
    EVENT("(GLuint id = %u, GLenum target = 0x%X)", id, target);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        QueryType targetPacked = FromGLenum<QueryType>(target);
        bool isCallValid =
            (context->skipValidation() || ValidateQueryCounterEXT(context, id, targetPacked));
        if (isCallValid)
        {
            context->queryCounter(id, targetPacked);
        }
        ANGLE_CAPTURE(QueryCounterEXT, isCallValid, context, id, targetPacked);
    }
}

GLbitfield GL_APIENTRY QueryMatrixxOESContextANGLE(GLeglContext ctx,
                                                   GLfixed *mantissa,
                                                   GLint *exponent)
{
    EVENT("(GLfixed *mantissa = 0x%016" PRIxPTR ", GLint *exponent = 0x%016" PRIxPTR ")",
          (uintptr_t)mantissa, (uintptr_t)exponent);

    Context *context = static_cast<gl::Context *>(ctx);
    GLbitfield returnValue;
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateQueryMatrixxOES(context, mantissa, exponent));
        if (isCallValid)
        {
            returnValue = context->queryMatrixx(mantissa, exponent);
        }
        else
        {
            returnValue = GetDefaultReturnValue<EntryPoint::QueryMatrixxOES, GLbitfield>();
        }
        ANGLE_CAPTURE(QueryMatrixxOES, isCallValid, context, mantissa, exponent, returnValue);
    }
    else
    {
        returnValue = GetDefaultReturnValue<EntryPoint::QueryMatrixxOES, GLbitfield>();
    }
    return returnValue;
}

void GL_APIENTRY ReadBufferContextANGLE(GLeglContext ctx, GLenum src)
{
    EVENT("(GLenum src = 0x%X)", src);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateReadBuffer(context, src));
        if (isCallValid)
        {
            context->readBuffer(src);
        }
        ANGLE_CAPTURE(ReadBuffer, isCallValid, context, src);
    }
}

void GL_APIENTRY ReadPixelsContextANGLE(GLeglContext ctx,
                                        GLint x,
                                        GLint y,
                                        GLsizei width,
                                        GLsizei height,
                                        GLenum format,
                                        GLenum type,
                                        void *pixels)
{
    EVENT(
        "(GLint x = %d, GLint y = %d, GLsizei width = %d, GLsizei height = %d, GLenum format = "
        "0x%X, GLenum type = 0x%X, void *pixels = 0x%016" PRIxPTR ")",
        x, y, width, height, format, type, (uintptr_t)pixels);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateReadPixels(context, x, y, width, height, format, type, pixels));
        if (isCallValid)
        {
            context->readPixels(x, y, width, height, format, type, pixels);
        }
        ANGLE_CAPTURE(ReadPixels, isCallValid, context, x, y, width, height, format, type, pixels);
    }
}

void GL_APIENTRY ReadnPixelsEXTContextANGLE(GLeglContext ctx,
                                            GLint x,
                                            GLint y,
                                            GLsizei width,
                                            GLsizei height,
                                            GLenum format,
                                            GLenum type,
                                            GLsizei bufSize,
                                            void *data)
{
    EVENT(
        "(GLint x = %d, GLint y = %d, GLsizei width = %d, GLsizei height = %d, GLenum format = "
        "0x%X, GLenum type = 0x%X, GLsizei bufSize = %d, void *data = 0x%016" PRIxPTR ")",
        x, y, width, height, format, type, bufSize, (uintptr_t)data);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() ||
             ValidateReadnPixelsEXT(context, x, y, width, height, format, type, bufSize, data));
        if (isCallValid)
        {
            context->readnPixels(x, y, width, height, format, type, bufSize, data);
        }
        ANGLE_CAPTURE(ReadnPixelsEXT, isCallValid, context, x, y, width, height, format, type,
                      bufSize, data);
    }
}

void GL_APIENTRY ReleaseShaderCompilerContextANGLE(GLeglContext ctx)
{
    EVENT("()");

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateReleaseShaderCompiler(context));
        if (isCallValid)
        {
            context->releaseShaderCompiler();
        }
        ANGLE_CAPTURE(ReleaseShaderCompiler, isCallValid, context);
    }
}

void GL_APIENTRY RenderbufferStorageContextANGLE(GLeglContext ctx,
                                                 GLenum target,
                                                 GLenum internalformat,
                                                 GLsizei width,
                                                 GLsizei height)
{
    EVENT(
        "(GLenum target = 0x%X, GLenum internalformat = 0x%X, GLsizei width = %d, GLsizei height = "
        "%d)",
        target, internalformat, width, height);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() ||
             ValidateRenderbufferStorage(context, target, internalformat, width, height));
        if (isCallValid)
        {
            context->renderbufferStorage(target, internalformat, width, height);
        }
        ANGLE_CAPTURE(RenderbufferStorage, isCallValid, context, target, internalformat, width,
                      height);
    }
}

void GL_APIENTRY RenderbufferStorageMultisampleContextANGLE(GLeglContext ctx,
                                                            GLenum target,
                                                            GLsizei samples,
                                                            GLenum internalformat,
                                                            GLsizei width,
                                                            GLsizei height)
{
    EVENT(
        "(GLenum target = 0x%X, GLsizei samples = %d, GLenum internalformat = 0x%X, GLsizei width "
        "= %d, GLsizei height = %d)",
        target, samples, internalformat, width, height);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateRenderbufferStorageMultisample(context, target, samples,
                                                                   internalformat, width, height));
        if (isCallValid)
        {
            context->renderbufferStorageMultisample(target, samples, internalformat, width, height);
        }
        ANGLE_CAPTURE(RenderbufferStorageMultisample, isCallValid, context, target, samples,
                      internalformat, width, height);
    }
}

void GL_APIENTRY RenderbufferStorageMultisampleANGLEContextANGLE(GLeglContext ctx,
                                                                 GLenum target,
                                                                 GLsizei samples,
                                                                 GLenum internalformat,
                                                                 GLsizei width,
                                                                 GLsizei height)
{
    EVENT(
        "(GLenum target = 0x%X, GLsizei samples = %d, GLenum internalformat = 0x%X, GLsizei width "
        "= %d, GLsizei height = %d)",
        target, samples, internalformat, width, height);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateRenderbufferStorageMultisampleANGLE(
                                context, target, samples, internalformat, width, height));
        if (isCallValid)
        {
            context->renderbufferStorageMultisample(target, samples, internalformat, width, height);
        }
        ANGLE_CAPTURE(RenderbufferStorageMultisampleANGLE, isCallValid, context, target, samples,
                      internalformat, width, height);
    }
}

void GL_APIENTRY RenderbufferStorageOESContextANGLE(GLeglContext ctx,
                                                    GLenum target,
                                                    GLenum internalformat,
                                                    GLsizei width,
                                                    GLsizei height)
{
    EVENT(
        "(GLenum target = 0x%X, GLenum internalformat = 0x%X, GLsizei width = %d, GLsizei height = "
        "%d)",
        target, internalformat, width, height);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() ||
             ValidateRenderbufferStorageOES(context, target, internalformat, width, height));
        if (isCallValid)
        {
            context->renderbufferStorage(target, internalformat, width, height);
        }
        ANGLE_CAPTURE(RenderbufferStorageOES, isCallValid, context, target, internalformat, width,
                      height);
    }
}

void GL_APIENTRY ResumeTransformFeedbackContextANGLE(GLeglContext ctx)
{
    EVENT("()");

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateResumeTransformFeedback(context));
        if (isCallValid)
        {
            context->resumeTransformFeedback();
        }
        ANGLE_CAPTURE(ResumeTransformFeedback, isCallValid, context);
    }
}

void GL_APIENTRY
RotatefContextANGLE(GLeglContext ctx, GLfloat angle, GLfloat x, GLfloat y, GLfloat z)
{
    EVENT("(GLfloat angle = %f, GLfloat x = %f, GLfloat y = %f, GLfloat z = %f)", angle, x, y, z);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateRotatef(context, angle, x, y, z));
        if (isCallValid)
        {
            context->rotatef(angle, x, y, z);
        }
        ANGLE_CAPTURE(Rotatef, isCallValid, context, angle, x, y, z);
    }
}

void GL_APIENTRY
RotatexContextANGLE(GLeglContext ctx, GLfixed angle, GLfixed x, GLfixed y, GLfixed z)
{
    EVENT("(GLfixed angle = 0x%X, GLfixed x = 0x%X, GLfixed y = 0x%X, GLfixed z = 0x%X)", angle, x,
          y, z);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateRotatex(context, angle, x, y, z));
        if (isCallValid)
        {
            context->rotatex(angle, x, y, z);
        }
        ANGLE_CAPTURE(Rotatex, isCallValid, context, angle, x, y, z);
    }
}

void GL_APIENTRY SampleCoverageContextANGLE(GLeglContext ctx, GLfloat value, GLboolean invert)
{
    EVENT("(GLfloat value = %f, GLboolean invert = %u)", value, invert);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateSampleCoverage(context, value, invert));
        if (isCallValid)
        {
            context->sampleCoverage(value, invert);
        }
        ANGLE_CAPTURE(SampleCoverage, isCallValid, context, value, invert);
    }
}

void GL_APIENTRY SampleCoveragexContextANGLE(GLeglContext ctx, GLclampx value, GLboolean invert)
{
    EVENT("(GLclampx value = 0x%X, GLboolean invert = %u)", value, invert);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateSampleCoveragex(context, value, invert));
        if (isCallValid)
        {
            context->sampleCoveragex(value, invert);
        }
        ANGLE_CAPTURE(SampleCoveragex, isCallValid, context, value, invert);
    }
}

void GL_APIENTRY SampleMaskiContextANGLE(GLeglContext ctx, GLuint maskNumber, GLbitfield mask)
{
    EVENT("(GLuint maskNumber = %u, GLbitfield mask = 0x%X)", maskNumber, mask);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateSampleMaski(context, maskNumber, mask));
        if (isCallValid)
        {
            context->sampleMaski(maskNumber, mask);
        }
        ANGLE_CAPTURE(SampleMaski, isCallValid, context, maskNumber, mask);
    }
}

void GL_APIENTRY SamplerParameterIivOESContextANGLE(GLeglContext ctx,
                                                    GLuint sampler,
                                                    GLenum pname,
                                                    const GLint *param)
{
    EVENT("(GLuint sampler = %u, GLenum pname = 0x%X, const GLint *param = 0x%016" PRIxPTR ")",
          sampler, pname, (uintptr_t)param);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateSamplerParameterIivOES(context, sampler, pname, param));
        if (isCallValid)
        {
            context->samplerParameterIiv(sampler, pname, param);
        }
        ANGLE_CAPTURE(SamplerParameterIivOES, isCallValid, context, sampler, pname, param);
    }
}

void GL_APIENTRY SamplerParameterIuivOESContextANGLE(GLeglContext ctx,
                                                     GLuint sampler,
                                                     GLenum pname,
                                                     const GLuint *param)
{
    EVENT("(GLuint sampler = %u, GLenum pname = 0x%X, const GLuint *param = 0x%016" PRIxPTR ")",
          sampler, pname, (uintptr_t)param);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateSamplerParameterIuivOES(context, sampler, pname, param));
        if (isCallValid)
        {
            context->samplerParameterIuiv(sampler, pname, param);
        }
        ANGLE_CAPTURE(SamplerParameterIuivOES, isCallValid, context, sampler, pname, param);
    }
}

void GL_APIENTRY SamplerParameterfContextANGLE(GLeglContext ctx,
                                               GLuint sampler,
                                               GLenum pname,
                                               GLfloat param)
{
    EVENT("(GLuint sampler = %u, GLenum pname = 0x%X, GLfloat param = %f)", sampler, pname, param);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateSamplerParameterf(context, sampler, pname, param));
        if (isCallValid)
        {
            context->samplerParameterf(sampler, pname, param);
        }
        ANGLE_CAPTURE(SamplerParameterf, isCallValid, context, sampler, pname, param);
    }
}

void GL_APIENTRY SamplerParameterfvContextANGLE(GLeglContext ctx,
                                                GLuint sampler,
                                                GLenum pname,
                                                const GLfloat *param)
{
    EVENT("(GLuint sampler = %u, GLenum pname = 0x%X, const GLfloat *param = 0x%016" PRIxPTR ")",
          sampler, pname, (uintptr_t)param);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateSamplerParameterfv(context, sampler, pname, param));
        if (isCallValid)
        {
            context->samplerParameterfv(sampler, pname, param);
        }
        ANGLE_CAPTURE(SamplerParameterfv, isCallValid, context, sampler, pname, param);
    }
}

void GL_APIENTRY SamplerParameteriContextANGLE(GLeglContext ctx,
                                               GLuint sampler,
                                               GLenum pname,
                                               GLint param)
{
    EVENT("(GLuint sampler = %u, GLenum pname = 0x%X, GLint param = %d)", sampler, pname, param);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateSamplerParameteri(context, sampler, pname, param));
        if (isCallValid)
        {
            context->samplerParameteri(sampler, pname, param);
        }
        ANGLE_CAPTURE(SamplerParameteri, isCallValid, context, sampler, pname, param);
    }
}

void GL_APIENTRY SamplerParameterivContextANGLE(GLeglContext ctx,
                                                GLuint sampler,
                                                GLenum pname,
                                                const GLint *param)
{
    EVENT("(GLuint sampler = %u, GLenum pname = 0x%X, const GLint *param = 0x%016" PRIxPTR ")",
          sampler, pname, (uintptr_t)param);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateSamplerParameteriv(context, sampler, pname, param));
        if (isCallValid)
        {
            context->samplerParameteriv(sampler, pname, param);
        }
        ANGLE_CAPTURE(SamplerParameteriv, isCallValid, context, sampler, pname, param);
    }
}

void GL_APIENTRY ScalefContextANGLE(GLeglContext ctx, GLfloat x, GLfloat y, GLfloat z)
{
    EVENT("(GLfloat x = %f, GLfloat y = %f, GLfloat z = %f)", x, y, z);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateScalef(context, x, y, z));
        if (isCallValid)
        {
            context->scalef(x, y, z);
        }
        ANGLE_CAPTURE(Scalef, isCallValid, context, x, y, z);
    }
}

void GL_APIENTRY ScalexContextANGLE(GLeglContext ctx, GLfixed x, GLfixed y, GLfixed z)
{
    EVENT("(GLfixed x = 0x%X, GLfixed y = 0x%X, GLfixed z = 0x%X)", x, y, z);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateScalex(context, x, y, z));
        if (isCallValid)
        {
            context->scalex(x, y, z);
        }
        ANGLE_CAPTURE(Scalex, isCallValid, context, x, y, z);
    }
}

void GL_APIENTRY
ScissorContextANGLE(GLeglContext ctx, GLint x, GLint y, GLsizei width, GLsizei height)
{
    EVENT("(GLint x = %d, GLint y = %d, GLsizei width = %d, GLsizei height = %d)", x, y, width,
          height);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateScissor(context, x, y, width, height));
        if (isCallValid)
        {
            context->scissor(x, y, width, height);
        }
        ANGLE_CAPTURE(Scissor, isCallValid, context, x, y, width, height);
    }
}

void GL_APIENTRY SemaphoreParameterui64vEXTContextANGLE(GLeglContext ctx,
                                                        GLuint semaphore,
                                                        GLenum pname,
                                                        const GLuint64 *params)
{
    EVENT("(GLuint semaphore = %u, GLenum pname = 0x%X, const GLuint64 *params = 0x%016" PRIxPTR
          ")",
          semaphore, pname, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateSemaphoreParameterui64vEXT(context, semaphore, pname, params));
        if (isCallValid)
        {
            context->semaphoreParameterui64v(semaphore, pname, params);
        }
        ANGLE_CAPTURE(SemaphoreParameterui64vEXT, isCallValid, context, semaphore, pname, params);
    }
}

void GL_APIENTRY SetFenceNVContextANGLE(GLeglContext ctx, GLuint fence, GLenum condition)
{
    EVENT("(GLuint fence = %u, GLenum condition = 0x%X)", fence, condition);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateSetFenceNV(context, fence, condition));
        if (isCallValid)
        {
            context->setFenceNV(fence, condition);
        }
        ANGLE_CAPTURE(SetFenceNV, isCallValid, context, fence, condition);
    }
}

void GL_APIENTRY ShadeModelContextANGLE(GLeglContext ctx, GLenum mode)
{
    EVENT("(GLenum mode = 0x%X)", mode);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        ShadingModel modePacked = FromGLenum<ShadingModel>(mode);
        bool isCallValid = (context->skipValidation() || ValidateShadeModel(context, modePacked));
        if (isCallValid)
        {
            context->shadeModel(modePacked);
        }
        ANGLE_CAPTURE(ShadeModel, isCallValid, context, modePacked);
    }
}

void GL_APIENTRY ShaderBinaryContextANGLE(GLeglContext ctx,
                                          GLsizei count,
                                          const GLuint *shaders,
                                          GLenum binaryformat,
                                          const void *binary,
                                          GLsizei length)
{
    EVENT("(GLsizei count = %d, const GLuint *shaders = 0x%016" PRIxPTR
          ", GLenum binaryformat = 0x%X, const void *binary = 0x%016" PRIxPTR
          ", GLsizei length = %d)",
          count, (uintptr_t)shaders, binaryformat, (uintptr_t)binary, length);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() ||
             ValidateShaderBinary(context, count, shaders, binaryformat, binary, length));
        if (isCallValid)
        {
            context->shaderBinary(count, shaders, binaryformat, binary, length);
        }
        ANGLE_CAPTURE(ShaderBinary, isCallValid, context, count, shaders, binaryformat, binary,
                      length);
    }
}

void GL_APIENTRY ShaderSourceContextANGLE(GLeglContext ctx,
                                          GLuint shader,
                                          GLsizei count,
                                          const GLchar *const *string,
                                          const GLint *length)
{
    EVENT("(GLuint shader = %u, GLsizei count = %d, const GLchar *const*string = 0x%016" PRIxPTR
          ", const GLint *length = 0x%016" PRIxPTR ")",
          shader, count, (uintptr_t)string, (uintptr_t)length);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateShaderSource(context, shader, count, string, length));
        if (isCallValid)
        {
            context->shaderSource(shader, count, string, length);
        }
        ANGLE_CAPTURE(ShaderSource, isCallValid, context, shader, count, string, length);
    }
}

void GL_APIENTRY SignalSemaphoreEXTContextANGLE(GLeglContext ctx,
                                                GLuint semaphore,
                                                GLuint numBufferBarriers,
                                                const GLuint *buffers,
                                                GLuint numTextureBarriers,
                                                const GLuint *textures,
                                                const GLenum *dstLayouts)
{
    EVENT(
        "(GLuint semaphore = %u, GLuint numBufferBarriers = %u, const GLuint *buffers = "
        "0x%016" PRIxPTR ", GLuint numTextureBarriers = %u, const GLuint *textures = 0x%016" PRIxPTR
        ", const GLenum *dstLayouts = 0x%016" PRIxPTR ")",
        semaphore, numBufferBarriers, (uintptr_t)buffers, numTextureBarriers, (uintptr_t)textures,
        (uintptr_t)dstLayouts);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() ||
             ValidateSignalSemaphoreEXT(context, semaphore, numBufferBarriers, buffers,
                                        numTextureBarriers, textures, dstLayouts));
        if (isCallValid)
        {
            context->signalSemaphore(semaphore, numBufferBarriers, buffers, numTextureBarriers,
                                     textures, dstLayouts);
        }
        ANGLE_CAPTURE(SignalSemaphoreEXT, isCallValid, context, semaphore, numBufferBarriers,
                      buffers, numTextureBarriers, textures, dstLayouts);
    }
}

void GL_APIENTRY StencilFuncContextANGLE(GLeglContext ctx, GLenum func, GLint ref, GLuint mask)
{
    EVENT("(GLenum func = 0x%X, GLint ref = %d, GLuint mask = %u)", func, ref, mask);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateStencilFunc(context, func, ref, mask));
        if (isCallValid)
        {
            context->stencilFunc(func, ref, mask);
        }
        ANGLE_CAPTURE(StencilFunc, isCallValid, context, func, ref, mask);
    }
}

void GL_APIENTRY
StencilFuncSeparateContextANGLE(GLeglContext ctx, GLenum face, GLenum func, GLint ref, GLuint mask)
{
    EVENT("(GLenum face = 0x%X, GLenum func = 0x%X, GLint ref = %d, GLuint mask = %u)", face, func,
          ref, mask);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateStencilFuncSeparate(context, face, func, ref, mask));
        if (isCallValid)
        {
            context->stencilFuncSeparate(face, func, ref, mask);
        }
        ANGLE_CAPTURE(StencilFuncSeparate, isCallValid, context, face, func, ref, mask);
    }
}

void GL_APIENTRY StencilMaskContextANGLE(GLeglContext ctx, GLuint mask)
{
    EVENT("(GLuint mask = %u)", mask);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateStencilMask(context, mask));
        if (isCallValid)
        {
            context->stencilMask(mask);
        }
        ANGLE_CAPTURE(StencilMask, isCallValid, context, mask);
    }
}

void GL_APIENTRY StencilMaskSeparateContextANGLE(GLeglContext ctx, GLenum face, GLuint mask)
{
    EVENT("(GLenum face = 0x%X, GLuint mask = %u)", face, mask);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateStencilMaskSeparate(context, face, mask));
        if (isCallValid)
        {
            context->stencilMaskSeparate(face, mask);
        }
        ANGLE_CAPTURE(StencilMaskSeparate, isCallValid, context, face, mask);
    }
}

void GL_APIENTRY StencilOpContextANGLE(GLeglContext ctx, GLenum fail, GLenum zfail, GLenum zpass)
{
    EVENT("(GLenum fail = 0x%X, GLenum zfail = 0x%X, GLenum zpass = 0x%X)", fail, zfail, zpass);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateStencilOp(context, fail, zfail, zpass));
        if (isCallValid)
        {
            context->stencilOp(fail, zfail, zpass);
        }
        ANGLE_CAPTURE(StencilOp, isCallValid, context, fail, zfail, zpass);
    }
}

void GL_APIENTRY StencilOpSeparateContextANGLE(GLeglContext ctx,
                                               GLenum face,
                                               GLenum sfail,
                                               GLenum dpfail,
                                               GLenum dppass)
{
    EVENT("(GLenum face = 0x%X, GLenum sfail = 0x%X, GLenum dpfail = 0x%X, GLenum dppass = 0x%X)",
          face, sfail, dpfail, dppass);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateStencilOpSeparate(context, face, sfail, dpfail, dppass));
        if (isCallValid)
        {
            context->stencilOpSeparate(face, sfail, dpfail, dppass);
        }
        ANGLE_CAPTURE(StencilOpSeparate, isCallValid, context, face, sfail, dpfail, dppass);
    }
}

GLboolean GL_APIENTRY TestFenceNVContextANGLE(GLeglContext ctx, GLuint fence)
{
    EVENT("(GLuint fence = %u)", fence);

    Context *context = static_cast<gl::Context *>(ctx);
    GLboolean returnValue;
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateTestFenceNV(context, fence));
        if (isCallValid)
        {
            returnValue = context->testFenceNV(fence);
        }
        else
        {
            returnValue = GetDefaultReturnValue<EntryPoint::TestFenceNV, GLboolean>();
        }
        ANGLE_CAPTURE(TestFenceNV, isCallValid, context, fence, returnValue);
    }
    else
    {
        returnValue = GetDefaultReturnValue<EntryPoint::TestFenceNV, GLboolean>();
    }
    return returnValue;
}

void GL_APIENTRY TexCoordPointerContextANGLE(GLeglContext ctx,
                                             GLint size,
                                             GLenum type,
                                             GLsizei stride,
                                             const void *pointer)
{
    EVENT(
        "(GLint size = %d, GLenum type = 0x%X, GLsizei stride = %d, const void *pointer = "
        "0x%016" PRIxPTR ")",
        size, type, stride, (uintptr_t)pointer);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        VertexAttribType typePacked = FromGLenum<VertexAttribType>(type);
        bool isCallValid            = (context->skipValidation() ||
                            ValidateTexCoordPointer(context, size, typePacked, stride, pointer));
        if (isCallValid)
        {
            context->texCoordPointer(size, typePacked, stride, pointer);
        }
        ANGLE_CAPTURE(TexCoordPointer, isCallValid, context, size, typePacked, stride, pointer);
    }
}

void GL_APIENTRY TexEnvfContextANGLE(GLeglContext ctx, GLenum target, GLenum pname, GLfloat param)
{
    EVENT("(GLenum target = 0x%X, GLenum pname = 0x%X, GLfloat param = %f)", target, pname, param);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        TextureEnvTarget targetPacked   = FromGLenum<TextureEnvTarget>(target);
        TextureEnvParameter pnamePacked = FromGLenum<TextureEnvParameter>(pname);
        bool isCallValid                = (context->skipValidation() ||
                            ValidateTexEnvf(context, targetPacked, pnamePacked, param));
        if (isCallValid)
        {
            context->texEnvf(targetPacked, pnamePacked, param);
        }
        ANGLE_CAPTURE(TexEnvf, isCallValid, context, targetPacked, pnamePacked, param);
    }
}

void GL_APIENTRY TexEnvfvContextANGLE(GLeglContext ctx,
                                      GLenum target,
                                      GLenum pname,
                                      const GLfloat *params)
{
    EVENT("(GLenum target = 0x%X, GLenum pname = 0x%X, const GLfloat *params = 0x%016" PRIxPTR ")",
          target, pname, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        TextureEnvTarget targetPacked   = FromGLenum<TextureEnvTarget>(target);
        TextureEnvParameter pnamePacked = FromGLenum<TextureEnvParameter>(pname);
        bool isCallValid                = (context->skipValidation() ||
                            ValidateTexEnvfv(context, targetPacked, pnamePacked, params));
        if (isCallValid)
        {
            context->texEnvfv(targetPacked, pnamePacked, params);
        }
        ANGLE_CAPTURE(TexEnvfv, isCallValid, context, targetPacked, pnamePacked, params);
    }
}

void GL_APIENTRY TexEnviContextANGLE(GLeglContext ctx, GLenum target, GLenum pname, GLint param)
{
    EVENT("(GLenum target = 0x%X, GLenum pname = 0x%X, GLint param = %d)", target, pname, param);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        TextureEnvTarget targetPacked   = FromGLenum<TextureEnvTarget>(target);
        TextureEnvParameter pnamePacked = FromGLenum<TextureEnvParameter>(pname);
        bool isCallValid                = (context->skipValidation() ||
                            ValidateTexEnvi(context, targetPacked, pnamePacked, param));
        if (isCallValid)
        {
            context->texEnvi(targetPacked, pnamePacked, param);
        }
        ANGLE_CAPTURE(TexEnvi, isCallValid, context, targetPacked, pnamePacked, param);
    }
}

void GL_APIENTRY TexEnvivContextANGLE(GLeglContext ctx,
                                      GLenum target,
                                      GLenum pname,
                                      const GLint *params)
{
    EVENT("(GLenum target = 0x%X, GLenum pname = 0x%X, const GLint *params = 0x%016" PRIxPTR ")",
          target, pname, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        TextureEnvTarget targetPacked   = FromGLenum<TextureEnvTarget>(target);
        TextureEnvParameter pnamePacked = FromGLenum<TextureEnvParameter>(pname);
        bool isCallValid                = (context->skipValidation() ||
                            ValidateTexEnviv(context, targetPacked, pnamePacked, params));
        if (isCallValid)
        {
            context->texEnviv(targetPacked, pnamePacked, params);
        }
        ANGLE_CAPTURE(TexEnviv, isCallValid, context, targetPacked, pnamePacked, params);
    }
}

void GL_APIENTRY TexEnvxContextANGLE(GLeglContext ctx, GLenum target, GLenum pname, GLfixed param)
{
    EVENT("(GLenum target = 0x%X, GLenum pname = 0x%X, GLfixed param = 0x%X)", target, pname,
          param);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        TextureEnvTarget targetPacked   = FromGLenum<TextureEnvTarget>(target);
        TextureEnvParameter pnamePacked = FromGLenum<TextureEnvParameter>(pname);
        bool isCallValid                = (context->skipValidation() ||
                            ValidateTexEnvx(context, targetPacked, pnamePacked, param));
        if (isCallValid)
        {
            context->texEnvx(targetPacked, pnamePacked, param);
        }
        ANGLE_CAPTURE(TexEnvx, isCallValid, context, targetPacked, pnamePacked, param);
    }
}

void GL_APIENTRY TexEnvxvContextANGLE(GLeglContext ctx,
                                      GLenum target,
                                      GLenum pname,
                                      const GLfixed *params)
{
    EVENT("(GLenum target = 0x%X, GLenum pname = 0x%X, const GLfixed *params = 0x%016" PRIxPTR ")",
          target, pname, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        TextureEnvTarget targetPacked   = FromGLenum<TextureEnvTarget>(target);
        TextureEnvParameter pnamePacked = FromGLenum<TextureEnvParameter>(pname);
        bool isCallValid                = (context->skipValidation() ||
                            ValidateTexEnvxv(context, targetPacked, pnamePacked, params));
        if (isCallValid)
        {
            context->texEnvxv(targetPacked, pnamePacked, params);
        }
        ANGLE_CAPTURE(TexEnvxv, isCallValid, context, targetPacked, pnamePacked, params);
    }
}

void GL_APIENTRY TexGenfOESContextANGLE(GLeglContext ctx, GLenum coord, GLenum pname, GLfloat param)
{
    EVENT("(GLenum coord = 0x%X, GLenum pname = 0x%X, GLfloat param = %f)", coord, pname, param);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateTexGenfOES(context, coord, pname, param));
        if (isCallValid)
        {
            context->texGenf(coord, pname, param);
        }
        ANGLE_CAPTURE(TexGenfOES, isCallValid, context, coord, pname, param);
    }
}

void GL_APIENTRY TexGenfvOESContextANGLE(GLeglContext ctx,
                                         GLenum coord,
                                         GLenum pname,
                                         const GLfloat *params)
{
    EVENT("(GLenum coord = 0x%X, GLenum pname = 0x%X, const GLfloat *params = 0x%016" PRIxPTR ")",
          coord, pname, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateTexGenfvOES(context, coord, pname, params));
        if (isCallValid)
        {
            context->texGenfv(coord, pname, params);
        }
        ANGLE_CAPTURE(TexGenfvOES, isCallValid, context, coord, pname, params);
    }
}

void GL_APIENTRY TexGeniOESContextANGLE(GLeglContext ctx, GLenum coord, GLenum pname, GLint param)
{
    EVENT("(GLenum coord = 0x%X, GLenum pname = 0x%X, GLint param = %d)", coord, pname, param);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateTexGeniOES(context, coord, pname, param));
        if (isCallValid)
        {
            context->texGeni(coord, pname, param);
        }
        ANGLE_CAPTURE(TexGeniOES, isCallValid, context, coord, pname, param);
    }
}

void GL_APIENTRY TexGenivOESContextANGLE(GLeglContext ctx,
                                         GLenum coord,
                                         GLenum pname,
                                         const GLint *params)
{
    EVENT("(GLenum coord = 0x%X, GLenum pname = 0x%X, const GLint *params = 0x%016" PRIxPTR ")",
          coord, pname, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateTexGenivOES(context, coord, pname, params));
        if (isCallValid)
        {
            context->texGeniv(coord, pname, params);
        }
        ANGLE_CAPTURE(TexGenivOES, isCallValid, context, coord, pname, params);
    }
}

void GL_APIENTRY TexGenxOESContextANGLE(GLeglContext ctx, GLenum coord, GLenum pname, GLfixed param)
{
    EVENT("(GLenum coord = 0x%X, GLenum pname = 0x%X, GLfixed param = 0x%X)", coord, pname, param);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateTexGenxOES(context, coord, pname, param));
        if (isCallValid)
        {
            context->texGenx(coord, pname, param);
        }
        ANGLE_CAPTURE(TexGenxOES, isCallValid, context, coord, pname, param);
    }
}

void GL_APIENTRY TexGenxvOESContextANGLE(GLeglContext ctx,
                                         GLenum coord,
                                         GLenum pname,
                                         const GLfixed *params)
{
    EVENT("(GLenum coord = 0x%X, GLenum pname = 0x%X, const GLfixed *params = 0x%016" PRIxPTR ")",
          coord, pname, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateTexGenxvOES(context, coord, pname, params));
        if (isCallValid)
        {
            context->texGenxv(coord, pname, params);
        }
        ANGLE_CAPTURE(TexGenxvOES, isCallValid, context, coord, pname, params);
    }
}

void GL_APIENTRY TexImage2DContextANGLE(GLeglContext ctx,
                                        GLenum target,
                                        GLint level,
                                        GLint internalformat,
                                        GLsizei width,
                                        GLsizei height,
                                        GLint border,
                                        GLenum format,
                                        GLenum type,
                                        const void *pixels)
{
    EVENT(
        "(GLenum target = 0x%X, GLint level = %d, GLint internalformat = %d, GLsizei width = %d, "
        "GLsizei height = %d, GLint border = %d, GLenum format = 0x%X, GLenum type = 0x%X, const "
        "void *pixels = 0x%016" PRIxPTR ")",
        target, level, internalformat, width, height, border, format, type, (uintptr_t)pixels);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        TextureTarget targetPacked = FromGLenum<TextureTarget>(target);
        bool isCallValid           = (context->skipValidation() ||
                            ValidateTexImage2D(context, targetPacked, level, internalformat, width,
                                               height, border, format, type, pixels));
        if (isCallValid)
        {
            context->texImage2D(targetPacked, level, internalformat, width, height, border, format,
                                type, pixels);
        }
        ANGLE_CAPTURE(TexImage2D, isCallValid, context, targetPacked, level, internalformat, width,
                      height, border, format, type, pixels);
    }
}

void GL_APIENTRY TexImage3DContextANGLE(GLeglContext ctx,
                                        GLenum target,
                                        GLint level,
                                        GLint internalformat,
                                        GLsizei width,
                                        GLsizei height,
                                        GLsizei depth,
                                        GLint border,
                                        GLenum format,
                                        GLenum type,
                                        const void *pixels)
{
    EVENT(
        "(GLenum target = 0x%X, GLint level = %d, GLint internalformat = %d, GLsizei width = %d, "
        "GLsizei height = %d, GLsizei depth = %d, GLint border = %d, GLenum format = 0x%X, GLenum "
        "type = 0x%X, const void *pixels = 0x%016" PRIxPTR ")",
        target, level, internalformat, width, height, depth, border, format, type,
        (uintptr_t)pixels);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        TextureTarget targetPacked = FromGLenum<TextureTarget>(target);
        bool isCallValid           = (context->skipValidation() ||
                            ValidateTexImage3D(context, targetPacked, level, internalformat, width,
                                               height, depth, border, format, type, pixels));
        if (isCallValid)
        {
            context->texImage3D(targetPacked, level, internalformat, width, height, depth, border,
                                format, type, pixels);
        }
        ANGLE_CAPTURE(TexImage3D, isCallValid, context, targetPacked, level, internalformat, width,
                      height, depth, border, format, type, pixels);
    }
}

void GL_APIENTRY TexImage3DOESContextANGLE(GLeglContext ctx,
                                           GLenum target,
                                           GLint level,
                                           GLenum internalformat,
                                           GLsizei width,
                                           GLsizei height,
                                           GLsizei depth,
                                           GLint border,
                                           GLenum format,
                                           GLenum type,
                                           const void *pixels)
{
    EVENT(
        "(GLenum target = 0x%X, GLint level = %d, GLenum internalformat = 0x%X, GLsizei width = "
        "%d, GLsizei height = %d, GLsizei depth = %d, GLint border = %d, GLenum format = 0x%X, "
        "GLenum type = 0x%X, const void *pixels = 0x%016" PRIxPTR ")",
        target, level, internalformat, width, height, depth, border, format, type,
        (uintptr_t)pixels);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        TextureTarget targetPacked = FromGLenum<TextureTarget>(target);
        bool isCallValid =
            (context->skipValidation() ||
             ValidateTexImage3DOES(context, targetPacked, level, internalformat, width, height,
                                   depth, border, format, type, pixels));
        if (isCallValid)
        {
            context->texImage3D(targetPacked, level, internalformat, width, height, depth, border,
                                format, type, pixels);
        }
        ANGLE_CAPTURE(TexImage3DOES, isCallValid, context, targetPacked, level, internalformat,
                      width, height, depth, border, format, type, pixels);
    }
}

void GL_APIENTRY TexParameterIivOESContextANGLE(GLeglContext ctx,
                                                GLenum target,
                                                GLenum pname,
                                                const GLint *params)
{
    EVENT("(GLenum target = 0x%X, GLenum pname = 0x%X, const GLint *params = 0x%016" PRIxPTR ")",
          target, pname, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        TextureType targetPacked = FromGLenum<TextureType>(target);
        bool isCallValid         = (context->skipValidation() ||
                            ValidateTexParameterIivOES(context, targetPacked, pname, params));
        if (isCallValid)
        {
            context->texParameterIiv(targetPacked, pname, params);
        }
        ANGLE_CAPTURE(TexParameterIivOES, isCallValid, context, targetPacked, pname, params);
    }
}

void GL_APIENTRY TexParameterIuivOESContextANGLE(GLeglContext ctx,
                                                 GLenum target,
                                                 GLenum pname,
                                                 const GLuint *params)
{
    EVENT("(GLenum target = 0x%X, GLenum pname = 0x%X, const GLuint *params = 0x%016" PRIxPTR ")",
          target, pname, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        TextureType targetPacked = FromGLenum<TextureType>(target);
        bool isCallValid         = (context->skipValidation() ||
                            ValidateTexParameterIuivOES(context, targetPacked, pname, params));
        if (isCallValid)
        {
            context->texParameterIuiv(targetPacked, pname, params);
        }
        ANGLE_CAPTURE(TexParameterIuivOES, isCallValid, context, targetPacked, pname, params);
    }
}

void GL_APIENTRY TexParameterfContextANGLE(GLeglContext ctx,
                                           GLenum target,
                                           GLenum pname,
                                           GLfloat param)
{
    EVENT("(GLenum target = 0x%X, GLenum pname = 0x%X, GLfloat param = %f)", target, pname, param);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        TextureType targetPacked = FromGLenum<TextureType>(target);
        bool isCallValid         = (context->skipValidation() ||
                            ValidateTexParameterf(context, targetPacked, pname, param));
        if (isCallValid)
        {
            context->texParameterf(targetPacked, pname, param);
        }
        ANGLE_CAPTURE(TexParameterf, isCallValid, context, targetPacked, pname, param);
    }
}

void GL_APIENTRY TexParameterfvContextANGLE(GLeglContext ctx,
                                            GLenum target,
                                            GLenum pname,
                                            const GLfloat *params)
{
    EVENT("(GLenum target = 0x%X, GLenum pname = 0x%X, const GLfloat *params = 0x%016" PRIxPTR ")",
          target, pname, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        TextureType targetPacked = FromGLenum<TextureType>(target);
        bool isCallValid         = (context->skipValidation() ||
                            ValidateTexParameterfv(context, targetPacked, pname, params));
        if (isCallValid)
        {
            context->texParameterfv(targetPacked, pname, params);
        }
        ANGLE_CAPTURE(TexParameterfv, isCallValid, context, targetPacked, pname, params);
    }
}

void GL_APIENTRY TexParameteriContextANGLE(GLeglContext ctx,
                                           GLenum target,
                                           GLenum pname,
                                           GLint param)
{
    EVENT("(GLenum target = 0x%X, GLenum pname = 0x%X, GLint param = %d)", target, pname, param);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        TextureType targetPacked = FromGLenum<TextureType>(target);
        bool isCallValid         = (context->skipValidation() ||
                            ValidateTexParameteri(context, targetPacked, pname, param));
        if (isCallValid)
        {
            context->texParameteri(targetPacked, pname, param);
        }
        ANGLE_CAPTURE(TexParameteri, isCallValid, context, targetPacked, pname, param);
    }
}

void GL_APIENTRY TexParameterivContextANGLE(GLeglContext ctx,
                                            GLenum target,
                                            GLenum pname,
                                            const GLint *params)
{
    EVENT("(GLenum target = 0x%X, GLenum pname = 0x%X, const GLint *params = 0x%016" PRIxPTR ")",
          target, pname, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        TextureType targetPacked = FromGLenum<TextureType>(target);
        bool isCallValid         = (context->skipValidation() ||
                            ValidateTexParameteriv(context, targetPacked, pname, params));
        if (isCallValid)
        {
            context->texParameteriv(targetPacked, pname, params);
        }
        ANGLE_CAPTURE(TexParameteriv, isCallValid, context, targetPacked, pname, params);
    }
}

void GL_APIENTRY TexParameterxContextANGLE(GLeglContext ctx,
                                           GLenum target,
                                           GLenum pname,
                                           GLfixed param)
{
    EVENT("(GLenum target = 0x%X, GLenum pname = 0x%X, GLfixed param = 0x%X)", target, pname,
          param);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        TextureType targetPacked = FromGLenum<TextureType>(target);
        bool isCallValid         = (context->skipValidation() ||
                            ValidateTexParameterx(context, targetPacked, pname, param));
        if (isCallValid)
        {
            context->texParameterx(targetPacked, pname, param);
        }
        ANGLE_CAPTURE(TexParameterx, isCallValid, context, targetPacked, pname, param);
    }
}

void GL_APIENTRY TexParameterxvContextANGLE(GLeglContext ctx,
                                            GLenum target,
                                            GLenum pname,
                                            const GLfixed *params)
{
    EVENT("(GLenum target = 0x%X, GLenum pname = 0x%X, const GLfixed *params = 0x%016" PRIxPTR ")",
          target, pname, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        TextureType targetPacked = FromGLenum<TextureType>(target);
        bool isCallValid         = (context->skipValidation() ||
                            ValidateTexParameterxv(context, targetPacked, pname, params));
        if (isCallValid)
        {
            context->texParameterxv(targetPacked, pname, params);
        }
        ANGLE_CAPTURE(TexParameterxv, isCallValid, context, targetPacked, pname, params);
    }
}

void GL_APIENTRY TexStorage1DEXTContextANGLE(GLeglContext ctx,
                                             GLenum target,
                                             GLsizei levels,
                                             GLenum internalformat,
                                             GLsizei width)
{
    EVENT(
        "(GLenum target = 0x%X, GLsizei levels = %d, GLenum internalformat = 0x%X, GLsizei width = "
        "%d)",
        target, levels, internalformat, width);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() ||
             ValidateTexStorage1DEXT(context, target, levels, internalformat, width));
        if (isCallValid)
        {
            context->texStorage1D(target, levels, internalformat, width);
        }
        ANGLE_CAPTURE(TexStorage1DEXT, isCallValid, context, target, levels, internalformat, width);
    }
}

void GL_APIENTRY TexStorage2DContextANGLE(GLeglContext ctx,
                                          GLenum target,
                                          GLsizei levels,
                                          GLenum internalformat,
                                          GLsizei width,
                                          GLsizei height)
{
    EVENT(
        "(GLenum target = 0x%X, GLsizei levels = %d, GLenum internalformat = 0x%X, GLsizei width = "
        "%d, GLsizei height = %d)",
        target, levels, internalformat, width, height);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        TextureType targetPacked = FromGLenum<TextureType>(target);
        bool isCallValid =
            (context->skipValidation() ||
             ValidateTexStorage2D(context, targetPacked, levels, internalformat, width, height));
        if (isCallValid)
        {
            context->texStorage2D(targetPacked, levels, internalformat, width, height);
        }
        ANGLE_CAPTURE(TexStorage2D, isCallValid, context, targetPacked, levels, internalformat,
                      width, height);
    }
}

void GL_APIENTRY TexStorage2DEXTContextANGLE(GLeglContext ctx,
                                             GLenum target,
                                             GLsizei levels,
                                             GLenum internalformat,
                                             GLsizei width,
                                             GLsizei height)
{
    EVENT(
        "(GLenum target = 0x%X, GLsizei levels = %d, GLenum internalformat = 0x%X, GLsizei width = "
        "%d, GLsizei height = %d)",
        target, levels, internalformat, width, height);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        TextureType targetPacked = FromGLenum<TextureType>(target);
        bool isCallValid =
            (context->skipValidation() ||
             ValidateTexStorage2DEXT(context, targetPacked, levels, internalformat, width, height));
        if (isCallValid)
        {
            context->texStorage2D(targetPacked, levels, internalformat, width, height);
        }
        ANGLE_CAPTURE(TexStorage2DEXT, isCallValid, context, targetPacked, levels, internalformat,
                      width, height);
    }
}

void GL_APIENTRY TexStorage2DMultisampleContextANGLE(GLeglContext ctx,
                                                     GLenum target,
                                                     GLsizei samples,
                                                     GLenum internalformat,
                                                     GLsizei width,
                                                     GLsizei height,
                                                     GLboolean fixedsamplelocations)
{
    EVENT(
        "(GLenum target = 0x%X, GLsizei samples = %d, GLenum internalformat = 0x%X, GLsizei width "
        "= %d, GLsizei height = %d, GLboolean fixedsamplelocations = %u)",
        target, samples, internalformat, width, height, fixedsamplelocations);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        TextureType targetPacked = FromGLenum<TextureType>(target);
        bool isCallValid =
            (context->skipValidation() ||
             ValidateTexStorage2DMultisample(context, targetPacked, samples, internalformat, width,
                                             height, fixedsamplelocations));
        if (isCallValid)
        {
            context->texStorage2DMultisample(targetPacked, samples, internalformat, width, height,
                                             fixedsamplelocations);
        }
        ANGLE_CAPTURE(TexStorage2DMultisample, isCallValid, context, targetPacked, samples,
                      internalformat, width, height, fixedsamplelocations);
    }
}

void GL_APIENTRY TexStorage3DContextANGLE(GLeglContext ctx,
                                          GLenum target,
                                          GLsizei levels,
                                          GLenum internalformat,
                                          GLsizei width,
                                          GLsizei height,
                                          GLsizei depth)
{
    EVENT(
        "(GLenum target = 0x%X, GLsizei levels = %d, GLenum internalformat = 0x%X, GLsizei width = "
        "%d, GLsizei height = %d, GLsizei depth = %d)",
        target, levels, internalformat, width, height, depth);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        TextureType targetPacked = FromGLenum<TextureType>(target);
        bool isCallValid         = (context->skipValidation() ||
                            ValidateTexStorage3D(context, targetPacked, levels, internalformat,
                                                 width, height, depth));
        if (isCallValid)
        {
            context->texStorage3D(targetPacked, levels, internalformat, width, height, depth);
        }
        ANGLE_CAPTURE(TexStorage3D, isCallValid, context, targetPacked, levels, internalformat,
                      width, height, depth);
    }
}

void GL_APIENTRY TexStorage3DEXTContextANGLE(GLeglContext ctx,
                                             GLenum target,
                                             GLsizei levels,
                                             GLenum internalformat,
                                             GLsizei width,
                                             GLsizei height,
                                             GLsizei depth)
{
    EVENT(
        "(GLenum target = 0x%X, GLsizei levels = %d, GLenum internalformat = 0x%X, GLsizei width = "
        "%d, GLsizei height = %d, GLsizei depth = %d)",
        target, levels, internalformat, width, height, depth);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        TextureType targetPacked = FromGLenum<TextureType>(target);
        bool isCallValid         = (context->skipValidation() ||
                            ValidateTexStorage3DEXT(context, targetPacked, levels, internalformat,
                                                    width, height, depth));
        if (isCallValid)
        {
            context->texStorage3D(targetPacked, levels, internalformat, width, height, depth);
        }
        ANGLE_CAPTURE(TexStorage3DEXT, isCallValid, context, targetPacked, levels, internalformat,
                      width, height, depth);
    }
}

void GL_APIENTRY TexStorage3DMultisampleOESContextANGLE(GLeglContext ctx,
                                                        GLenum target,
                                                        GLsizei samples,
                                                        GLenum internalformat,
                                                        GLsizei width,
                                                        GLsizei height,
                                                        GLsizei depth,
                                                        GLboolean fixedsamplelocations)
{
    EVENT(
        "(GLenum target = 0x%X, GLsizei samples = %d, GLenum internalformat = 0x%X, GLsizei width "
        "= %d, GLsizei height = %d, GLsizei depth = %d, GLboolean fixedsamplelocations = %u)",
        target, samples, internalformat, width, height, depth, fixedsamplelocations);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        TextureType targetPacked = FromGLenum<TextureType>(target);
        bool isCallValid =
            (context->skipValidation() ||
             ValidateTexStorage3DMultisampleOES(context, targetPacked, samples, internalformat,
                                                width, height, depth, fixedsamplelocations));
        if (isCallValid)
        {
            context->texStorage3DMultisample(targetPacked, samples, internalformat, width, height,
                                             depth, fixedsamplelocations);
        }
        ANGLE_CAPTURE(TexStorage3DMultisampleOES, isCallValid, context, targetPacked, samples,
                      internalformat, width, height, depth, fixedsamplelocations);
    }
}

void GL_APIENTRY TexStorageMem2DEXTContextANGLE(GLeglContext ctx,
                                                GLenum target,
                                                GLsizei levels,
                                                GLenum internalFormat,
                                                GLsizei width,
                                                GLsizei height,
                                                GLuint memory,
                                                GLuint64 offset)
{
    EVENT(
        "(GLenum target = 0x%X, GLsizei levels = %d, GLenum internalFormat = 0x%X, GLsizei width = "
        "%d, GLsizei height = %d, GLuint memory = %u, GLuint64 offset = %llu)",
        target, levels, internalFormat, width, height, memory,
        static_cast<unsigned long long>(offset));

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        TextureType targetPacked = FromGLenum<TextureType>(target);
        bool isCallValid =
            (context->skipValidation() ||
             ValidateTexStorageMem2DEXT(context, targetPacked, levels, internalFormat, width,
                                        height, memory, offset));
        if (isCallValid)
        {
            context->texStorageMem2D(targetPacked, levels, internalFormat, width, height, memory,
                                     offset);
        }
        ANGLE_CAPTURE(TexStorageMem2DEXT, isCallValid, context, targetPacked, levels,
                      internalFormat, width, height, memory, offset);
    }
}

void GL_APIENTRY TexStorageMem2DMultisampleEXTContextANGLE(GLeglContext ctx,
                                                           GLenum target,
                                                           GLsizei samples,
                                                           GLenum internalFormat,
                                                           GLsizei width,
                                                           GLsizei height,
                                                           GLboolean fixedSampleLocations,
                                                           GLuint memory,
                                                           GLuint64 offset)
{
    EVENT(
        "(GLenum target = 0x%X, GLsizei samples = %d, GLenum internalFormat = 0x%X, GLsizei width "
        "= %d, GLsizei height = %d, GLboolean fixedSampleLocations = %u, GLuint memory = %u, "
        "GLuint64 offset = %llu)",
        target, samples, internalFormat, width, height, fixedSampleLocations, memory,
        static_cast<unsigned long long>(offset));

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        TextureType targetPacked = FromGLenum<TextureType>(target);
        bool isCallValid =
            (context->skipValidation() || ValidateTexStorageMem2DMultisampleEXT(
                                              context, targetPacked, samples, internalFormat, width,
                                              height, fixedSampleLocations, memory, offset));
        if (isCallValid)
        {
            context->texStorageMem2DMultisample(targetPacked, samples, internalFormat, width,
                                                height, fixedSampleLocations, memory, offset);
        }
        ANGLE_CAPTURE(TexStorageMem2DMultisampleEXT, isCallValid, context, targetPacked, samples,
                      internalFormat, width, height, fixedSampleLocations, memory, offset);
    }
}

void GL_APIENTRY TexStorageMem3DEXTContextANGLE(GLeglContext ctx,
                                                GLenum target,
                                                GLsizei levels,
                                                GLenum internalFormat,
                                                GLsizei width,
                                                GLsizei height,
                                                GLsizei depth,
                                                GLuint memory,
                                                GLuint64 offset)
{
    EVENT(
        "(GLenum target = 0x%X, GLsizei levels = %d, GLenum internalFormat = 0x%X, GLsizei width = "
        "%d, GLsizei height = %d, GLsizei depth = %d, GLuint memory = %u, GLuint64 offset = %llu)",
        target, levels, internalFormat, width, height, depth, memory,
        static_cast<unsigned long long>(offset));

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        TextureType targetPacked = FromGLenum<TextureType>(target);
        bool isCallValid =
            (context->skipValidation() ||
             ValidateTexStorageMem3DEXT(context, targetPacked, levels, internalFormat, width,
                                        height, depth, memory, offset));
        if (isCallValid)
        {
            context->texStorageMem3D(targetPacked, levels, internalFormat, width, height, depth,
                                     memory, offset);
        }
        ANGLE_CAPTURE(TexStorageMem3DEXT, isCallValid, context, targetPacked, levels,
                      internalFormat, width, height, depth, memory, offset);
    }
}

void GL_APIENTRY TexStorageMem3DMultisampleEXTContextANGLE(GLeglContext ctx,
                                                           GLenum target,
                                                           GLsizei samples,
                                                           GLenum internalFormat,
                                                           GLsizei width,
                                                           GLsizei height,
                                                           GLsizei depth,
                                                           GLboolean fixedSampleLocations,
                                                           GLuint memory,
                                                           GLuint64 offset)
{
    EVENT(
        "(GLenum target = 0x%X, GLsizei samples = %d, GLenum internalFormat = 0x%X, GLsizei width "
        "= %d, GLsizei height = %d, GLsizei depth = %d, GLboolean fixedSampleLocations = %u, "
        "GLuint memory = %u, GLuint64 offset = %llu)",
        target, samples, internalFormat, width, height, depth, fixedSampleLocations, memory,
        static_cast<unsigned long long>(offset));

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        TextureType targetPacked = FromGLenum<TextureType>(target);
        bool isCallValid =
            (context->skipValidation() || ValidateTexStorageMem3DMultisampleEXT(
                                              context, targetPacked, samples, internalFormat, width,
                                              height, depth, fixedSampleLocations, memory, offset));
        if (isCallValid)
        {
            context->texStorageMem3DMultisample(targetPacked, samples, internalFormat, width,
                                                height, depth, fixedSampleLocations, memory,
                                                offset);
        }
        ANGLE_CAPTURE(TexStorageMem3DMultisampleEXT, isCallValid, context, targetPacked, samples,
                      internalFormat, width, height, depth, fixedSampleLocations, memory, offset);
    }
}

void GL_APIENTRY TexSubImage2DContextANGLE(GLeglContext ctx,
                                           GLenum target,
                                           GLint level,
                                           GLint xoffset,
                                           GLint yoffset,
                                           GLsizei width,
                                           GLsizei height,
                                           GLenum format,
                                           GLenum type,
                                           const void *pixels)
{
    EVENT(
        "(GLenum target = 0x%X, GLint level = %d, GLint xoffset = %d, GLint yoffset = %d, GLsizei "
        "width = %d, GLsizei height = %d, GLenum format = 0x%X, GLenum type = 0x%X, const void "
        "*pixels = 0x%016" PRIxPTR ")",
        target, level, xoffset, yoffset, width, height, format, type, (uintptr_t)pixels);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        TextureTarget targetPacked = FromGLenum<TextureTarget>(target);
        bool isCallValid           = (context->skipValidation() ||
                            ValidateTexSubImage2D(context, targetPacked, level, xoffset, yoffset,
                                                  width, height, format, type, pixels));
        if (isCallValid)
        {
            context->texSubImage2D(targetPacked, level, xoffset, yoffset, width, height, format,
                                   type, pixels);
        }
        ANGLE_CAPTURE(TexSubImage2D, isCallValid, context, targetPacked, level, xoffset, yoffset,
                      width, height, format, type, pixels);
    }
}

void GL_APIENTRY TexSubImage3DContextANGLE(GLeglContext ctx,
                                           GLenum target,
                                           GLint level,
                                           GLint xoffset,
                                           GLint yoffset,
                                           GLint zoffset,
                                           GLsizei width,
                                           GLsizei height,
                                           GLsizei depth,
                                           GLenum format,
                                           GLenum type,
                                           const void *pixels)
{
    EVENT(
        "(GLenum target = 0x%X, GLint level = %d, GLint xoffset = %d, GLint yoffset = %d, GLint "
        "zoffset = %d, GLsizei width = %d, GLsizei height = %d, GLsizei depth = %d, GLenum format "
        "= 0x%X, GLenum type = 0x%X, const void *pixels = 0x%016" PRIxPTR ")",
        target, level, xoffset, yoffset, zoffset, width, height, depth, format, type,
        (uintptr_t)pixels);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        TextureTarget targetPacked = FromGLenum<TextureTarget>(target);
        bool isCallValid =
            (context->skipValidation() ||
             ValidateTexSubImage3D(context, targetPacked, level, xoffset, yoffset, zoffset, width,
                                   height, depth, format, type, pixels));
        if (isCallValid)
        {
            context->texSubImage3D(targetPacked, level, xoffset, yoffset, zoffset, width, height,
                                   depth, format, type, pixels);
        }
        ANGLE_CAPTURE(TexSubImage3D, isCallValid, context, targetPacked, level, xoffset, yoffset,
                      zoffset, width, height, depth, format, type, pixels);
    }
}

void GL_APIENTRY TexSubImage3DOESContextANGLE(GLeglContext ctx,
                                              GLenum target,
                                              GLint level,
                                              GLint xoffset,
                                              GLint yoffset,
                                              GLint zoffset,
                                              GLsizei width,
                                              GLsizei height,
                                              GLsizei depth,
                                              GLenum format,
                                              GLenum type,
                                              const void *pixels)
{
    EVENT(
        "(GLenum target = 0x%X, GLint level = %d, GLint xoffset = %d, GLint yoffset = %d, GLint "
        "zoffset = %d, GLsizei width = %d, GLsizei height = %d, GLsizei depth = %d, GLenum format "
        "= 0x%X, GLenum type = 0x%X, const void *pixels = 0x%016" PRIxPTR ")",
        target, level, xoffset, yoffset, zoffset, width, height, depth, format, type,
        (uintptr_t)pixels);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        TextureTarget targetPacked = FromGLenum<TextureTarget>(target);
        bool isCallValid =
            (context->skipValidation() ||
             ValidateTexSubImage3DOES(context, targetPacked, level, xoffset, yoffset, zoffset,
                                      width, height, depth, format, type, pixels));
        if (isCallValid)
        {
            context->texSubImage3D(targetPacked, level, xoffset, yoffset, zoffset, width, height,
                                   depth, format, type, pixels);
        }
        ANGLE_CAPTURE(TexSubImage3DOES, isCallValid, context, targetPacked, level, xoffset, yoffset,
                      zoffset, width, height, depth, format, type, pixels);
    }
}

void GL_APIENTRY TransformFeedbackVaryingsContextANGLE(GLeglContext ctx,
                                                       GLuint program,
                                                       GLsizei count,
                                                       const GLchar *const *varyings,
                                                       GLenum bufferMode)
{
    EVENT("(GLuint program = %u, GLsizei count = %d, const GLchar *const*varyings = 0x%016" PRIxPTR
          ", GLenum bufferMode = 0x%X)",
          program, count, (uintptr_t)varyings, bufferMode);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() ||
             ValidateTransformFeedbackVaryings(context, program, count, varyings, bufferMode));
        if (isCallValid)
        {
            context->transformFeedbackVaryings(program, count, varyings, bufferMode);
        }
        ANGLE_CAPTURE(TransformFeedbackVaryings, isCallValid, context, program, count, varyings,
                      bufferMode);
    }
}

void GL_APIENTRY TranslatefContextANGLE(GLeglContext ctx, GLfloat x, GLfloat y, GLfloat z)
{
    EVENT("(GLfloat x = %f, GLfloat y = %f, GLfloat z = %f)", x, y, z);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateTranslatef(context, x, y, z));
        if (isCallValid)
        {
            context->translatef(x, y, z);
        }
        ANGLE_CAPTURE(Translatef, isCallValid, context, x, y, z);
    }
}

void GL_APIENTRY TranslatexContextANGLE(GLeglContext ctx, GLfixed x, GLfixed y, GLfixed z)
{
    EVENT("(GLfixed x = 0x%X, GLfixed y = 0x%X, GLfixed z = 0x%X)", x, y, z);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateTranslatex(context, x, y, z));
        if (isCallValid)
        {
            context->translatex(x, y, z);
        }
        ANGLE_CAPTURE(Translatex, isCallValid, context, x, y, z);
    }
}

void GL_APIENTRY Uniform1fContextANGLE(GLeglContext ctx, GLint location, GLfloat v0)
{
    EVENT("(GLint location = %d, GLfloat v0 = %f)", location, v0);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateUniform1f(context, location, v0));
        if (isCallValid)
        {
            context->uniform1f(location, v0);
        }
        ANGLE_CAPTURE(Uniform1f, isCallValid, context, location, v0);
    }
}

void GL_APIENTRY Uniform1fvContextANGLE(GLeglContext ctx,
                                        GLint location,
                                        GLsizei count,
                                        const GLfloat *value)
{
    EVENT("(GLint location = %d, GLsizei count = %d, const GLfloat *value = 0x%016" PRIxPTR ")",
          location, count, (uintptr_t)value);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateUniform1fv(context, location, count, value));
        if (isCallValid)
        {
            context->uniform1fv(location, count, value);
        }
        ANGLE_CAPTURE(Uniform1fv, isCallValid, context, location, count, value);
    }
}

void GL_APIENTRY Uniform1iContextANGLE(GLeglContext ctx, GLint location, GLint v0)
{
    EVENT("(GLint location = %d, GLint v0 = %d)", location, v0);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateUniform1i(context, location, v0));
        if (isCallValid)
        {
            context->uniform1i(location, v0);
        }
        ANGLE_CAPTURE(Uniform1i, isCallValid, context, location, v0);
    }
}

void GL_APIENTRY Uniform1ivContextANGLE(GLeglContext ctx,
                                        GLint location,
                                        GLsizei count,
                                        const GLint *value)
{
    EVENT("(GLint location = %d, GLsizei count = %d, const GLint *value = 0x%016" PRIxPTR ")",
          location, count, (uintptr_t)value);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateUniform1iv(context, location, count, value));
        if (isCallValid)
        {
            context->uniform1iv(location, count, value);
        }
        ANGLE_CAPTURE(Uniform1iv, isCallValid, context, location, count, value);
    }
}

void GL_APIENTRY Uniform1uiContextANGLE(GLeglContext ctx, GLint location, GLuint v0)
{
    EVENT("(GLint location = %d, GLuint v0 = %u)", location, v0);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateUniform1ui(context, location, v0));
        if (isCallValid)
        {
            context->uniform1ui(location, v0);
        }
        ANGLE_CAPTURE(Uniform1ui, isCallValid, context, location, v0);
    }
}

void GL_APIENTRY Uniform1uivContextANGLE(GLeglContext ctx,
                                         GLint location,
                                         GLsizei count,
                                         const GLuint *value)
{
    EVENT("(GLint location = %d, GLsizei count = %d, const GLuint *value = 0x%016" PRIxPTR ")",
          location, count, (uintptr_t)value);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateUniform1uiv(context, location, count, value));
        if (isCallValid)
        {
            context->uniform1uiv(location, count, value);
        }
        ANGLE_CAPTURE(Uniform1uiv, isCallValid, context, location, count, value);
    }
}

void GL_APIENTRY Uniform2fContextANGLE(GLeglContext ctx, GLint location, GLfloat v0, GLfloat v1)
{
    EVENT("(GLint location = %d, GLfloat v0 = %f, GLfloat v1 = %f)", location, v0, v1);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateUniform2f(context, location, v0, v1));
        if (isCallValid)
        {
            context->uniform2f(location, v0, v1);
        }
        ANGLE_CAPTURE(Uniform2f, isCallValid, context, location, v0, v1);
    }
}

void GL_APIENTRY Uniform2fvContextANGLE(GLeglContext ctx,
                                        GLint location,
                                        GLsizei count,
                                        const GLfloat *value)
{
    EVENT("(GLint location = %d, GLsizei count = %d, const GLfloat *value = 0x%016" PRIxPTR ")",
          location, count, (uintptr_t)value);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateUniform2fv(context, location, count, value));
        if (isCallValid)
        {
            context->uniform2fv(location, count, value);
        }
        ANGLE_CAPTURE(Uniform2fv, isCallValid, context, location, count, value);
    }
}

void GL_APIENTRY Uniform2iContextANGLE(GLeglContext ctx, GLint location, GLint v0, GLint v1)
{
    EVENT("(GLint location = %d, GLint v0 = %d, GLint v1 = %d)", location, v0, v1);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateUniform2i(context, location, v0, v1));
        if (isCallValid)
        {
            context->uniform2i(location, v0, v1);
        }
        ANGLE_CAPTURE(Uniform2i, isCallValid, context, location, v0, v1);
    }
}

void GL_APIENTRY Uniform2ivContextANGLE(GLeglContext ctx,
                                        GLint location,
                                        GLsizei count,
                                        const GLint *value)
{
    EVENT("(GLint location = %d, GLsizei count = %d, const GLint *value = 0x%016" PRIxPTR ")",
          location, count, (uintptr_t)value);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateUniform2iv(context, location, count, value));
        if (isCallValid)
        {
            context->uniform2iv(location, count, value);
        }
        ANGLE_CAPTURE(Uniform2iv, isCallValid, context, location, count, value);
    }
}

void GL_APIENTRY Uniform2uiContextANGLE(GLeglContext ctx, GLint location, GLuint v0, GLuint v1)
{
    EVENT("(GLint location = %d, GLuint v0 = %u, GLuint v1 = %u)", location, v0, v1);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateUniform2ui(context, location, v0, v1));
        if (isCallValid)
        {
            context->uniform2ui(location, v0, v1);
        }
        ANGLE_CAPTURE(Uniform2ui, isCallValid, context, location, v0, v1);
    }
}

void GL_APIENTRY Uniform2uivContextANGLE(GLeglContext ctx,
                                         GLint location,
                                         GLsizei count,
                                         const GLuint *value)
{
    EVENT("(GLint location = %d, GLsizei count = %d, const GLuint *value = 0x%016" PRIxPTR ")",
          location, count, (uintptr_t)value);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateUniform2uiv(context, location, count, value));
        if (isCallValid)
        {
            context->uniform2uiv(location, count, value);
        }
        ANGLE_CAPTURE(Uniform2uiv, isCallValid, context, location, count, value);
    }
}

void GL_APIENTRY
Uniform3fContextANGLE(GLeglContext ctx, GLint location, GLfloat v0, GLfloat v1, GLfloat v2)
{
    EVENT("(GLint location = %d, GLfloat v0 = %f, GLfloat v1 = %f, GLfloat v2 = %f)", location, v0,
          v1, v2);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateUniform3f(context, location, v0, v1, v2));
        if (isCallValid)
        {
            context->uniform3f(location, v0, v1, v2);
        }
        ANGLE_CAPTURE(Uniform3f, isCallValid, context, location, v0, v1, v2);
    }
}

void GL_APIENTRY Uniform3fvContextANGLE(GLeglContext ctx,
                                        GLint location,
                                        GLsizei count,
                                        const GLfloat *value)
{
    EVENT("(GLint location = %d, GLsizei count = %d, const GLfloat *value = 0x%016" PRIxPTR ")",
          location, count, (uintptr_t)value);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateUniform3fv(context, location, count, value));
        if (isCallValid)
        {
            context->uniform3fv(location, count, value);
        }
        ANGLE_CAPTURE(Uniform3fv, isCallValid, context, location, count, value);
    }
}

void GL_APIENTRY
Uniform3iContextANGLE(GLeglContext ctx, GLint location, GLint v0, GLint v1, GLint v2)
{
    EVENT("(GLint location = %d, GLint v0 = %d, GLint v1 = %d, GLint v2 = %d)", location, v0, v1,
          v2);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateUniform3i(context, location, v0, v1, v2));
        if (isCallValid)
        {
            context->uniform3i(location, v0, v1, v2);
        }
        ANGLE_CAPTURE(Uniform3i, isCallValid, context, location, v0, v1, v2);
    }
}

void GL_APIENTRY Uniform3ivContextANGLE(GLeglContext ctx,
                                        GLint location,
                                        GLsizei count,
                                        const GLint *value)
{
    EVENT("(GLint location = %d, GLsizei count = %d, const GLint *value = 0x%016" PRIxPTR ")",
          location, count, (uintptr_t)value);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateUniform3iv(context, location, count, value));
        if (isCallValid)
        {
            context->uniform3iv(location, count, value);
        }
        ANGLE_CAPTURE(Uniform3iv, isCallValid, context, location, count, value);
    }
}

void GL_APIENTRY
Uniform3uiContextANGLE(GLeglContext ctx, GLint location, GLuint v0, GLuint v1, GLuint v2)
{
    EVENT("(GLint location = %d, GLuint v0 = %u, GLuint v1 = %u, GLuint v2 = %u)", location, v0, v1,
          v2);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateUniform3ui(context, location, v0, v1, v2));
        if (isCallValid)
        {
            context->uniform3ui(location, v0, v1, v2);
        }
        ANGLE_CAPTURE(Uniform3ui, isCallValid, context, location, v0, v1, v2);
    }
}

void GL_APIENTRY Uniform3uivContextANGLE(GLeglContext ctx,
                                         GLint location,
                                         GLsizei count,
                                         const GLuint *value)
{
    EVENT("(GLint location = %d, GLsizei count = %d, const GLuint *value = 0x%016" PRIxPTR ")",
          location, count, (uintptr_t)value);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateUniform3uiv(context, location, count, value));
        if (isCallValid)
        {
            context->uniform3uiv(location, count, value);
        }
        ANGLE_CAPTURE(Uniform3uiv, isCallValid, context, location, count, value);
    }
}

void GL_APIENTRY Uniform4fContextANGLE(GLeglContext ctx,
                                       GLint location,
                                       GLfloat v0,
                                       GLfloat v1,
                                       GLfloat v2,
                                       GLfloat v3)
{
    EVENT(
        "(GLint location = %d, GLfloat v0 = %f, GLfloat v1 = %f, GLfloat v2 = %f, GLfloat v3 = %f)",
        location, v0, v1, v2, v3);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateUniform4f(context, location, v0, v1, v2, v3));
        if (isCallValid)
        {
            context->uniform4f(location, v0, v1, v2, v3);
        }
        ANGLE_CAPTURE(Uniform4f, isCallValid, context, location, v0, v1, v2, v3);
    }
}

void GL_APIENTRY Uniform4fvContextANGLE(GLeglContext ctx,
                                        GLint location,
                                        GLsizei count,
                                        const GLfloat *value)
{
    EVENT("(GLint location = %d, GLsizei count = %d, const GLfloat *value = 0x%016" PRIxPTR ")",
          location, count, (uintptr_t)value);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateUniform4fv(context, location, count, value));
        if (isCallValid)
        {
            context->uniform4fv(location, count, value);
        }
        ANGLE_CAPTURE(Uniform4fv, isCallValid, context, location, count, value);
    }
}

void GL_APIENTRY
Uniform4iContextANGLE(GLeglContext ctx, GLint location, GLint v0, GLint v1, GLint v2, GLint v3)
{
    EVENT("(GLint location = %d, GLint v0 = %d, GLint v1 = %d, GLint v2 = %d, GLint v3 = %d)",
          location, v0, v1, v2, v3);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateUniform4i(context, location, v0, v1, v2, v3));
        if (isCallValid)
        {
            context->uniform4i(location, v0, v1, v2, v3);
        }
        ANGLE_CAPTURE(Uniform4i, isCallValid, context, location, v0, v1, v2, v3);
    }
}

void GL_APIENTRY Uniform4ivContextANGLE(GLeglContext ctx,
                                        GLint location,
                                        GLsizei count,
                                        const GLint *value)
{
    EVENT("(GLint location = %d, GLsizei count = %d, const GLint *value = 0x%016" PRIxPTR ")",
          location, count, (uintptr_t)value);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateUniform4iv(context, location, count, value));
        if (isCallValid)
        {
            context->uniform4iv(location, count, value);
        }
        ANGLE_CAPTURE(Uniform4iv, isCallValid, context, location, count, value);
    }
}

void GL_APIENTRY
Uniform4uiContextANGLE(GLeglContext ctx, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3)
{
    EVENT("(GLint location = %d, GLuint v0 = %u, GLuint v1 = %u, GLuint v2 = %u, GLuint v3 = %u)",
          location, v0, v1, v2, v3);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateUniform4ui(context, location, v0, v1, v2, v3));
        if (isCallValid)
        {
            context->uniform4ui(location, v0, v1, v2, v3);
        }
        ANGLE_CAPTURE(Uniform4ui, isCallValid, context, location, v0, v1, v2, v3);
    }
}

void GL_APIENTRY Uniform4uivContextANGLE(GLeglContext ctx,
                                         GLint location,
                                         GLsizei count,
                                         const GLuint *value)
{
    EVENT("(GLint location = %d, GLsizei count = %d, const GLuint *value = 0x%016" PRIxPTR ")",
          location, count, (uintptr_t)value);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateUniform4uiv(context, location, count, value));
        if (isCallValid)
        {
            context->uniform4uiv(location, count, value);
        }
        ANGLE_CAPTURE(Uniform4uiv, isCallValid, context, location, count, value);
    }
}

void GL_APIENTRY UniformBlockBindingContextANGLE(GLeglContext ctx,
                                                 GLuint program,
                                                 GLuint uniformBlockIndex,
                                                 GLuint uniformBlockBinding)
{
    EVENT("(GLuint program = %u, GLuint uniformBlockIndex = %u, GLuint uniformBlockBinding = %u)",
          program, uniformBlockIndex, uniformBlockBinding);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() ||
             ValidateUniformBlockBinding(context, program, uniformBlockIndex, uniformBlockBinding));
        if (isCallValid)
        {
            context->uniformBlockBinding(program, uniformBlockIndex, uniformBlockBinding);
        }
        ANGLE_CAPTURE(UniformBlockBinding, isCallValid, context, program, uniformBlockIndex,
                      uniformBlockBinding);
    }
}

void GL_APIENTRY UniformMatrix2fvContextANGLE(GLeglContext ctx,
                                              GLint location,
                                              GLsizei count,
                                              GLboolean transpose,
                                              const GLfloat *value)
{
    EVENT(
        "(GLint location = %d, GLsizei count = %d, GLboolean transpose = %u, const GLfloat *value "
        "= 0x%016" PRIxPTR ")",
        location, count, transpose, (uintptr_t)value);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateUniformMatrix2fv(context, location, count, transpose, value));
        if (isCallValid)
        {
            context->uniformMatrix2fv(location, count, transpose, value);
        }
        ANGLE_CAPTURE(UniformMatrix2fv, isCallValid, context, location, count, transpose, value);
    }
}

void GL_APIENTRY UniformMatrix2x3fvContextANGLE(GLeglContext ctx,
                                                GLint location,
                                                GLsizei count,
                                                GLboolean transpose,
                                                const GLfloat *value)
{
    EVENT(
        "(GLint location = %d, GLsizei count = %d, GLboolean transpose = %u, const GLfloat *value "
        "= 0x%016" PRIxPTR ")",
        location, count, transpose, (uintptr_t)value);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateUniformMatrix2x3fv(context, location, count, transpose, value));
        if (isCallValid)
        {
            context->uniformMatrix2x3fv(location, count, transpose, value);
        }
        ANGLE_CAPTURE(UniformMatrix2x3fv, isCallValid, context, location, count, transpose, value);
    }
}

void GL_APIENTRY UniformMatrix2x4fvContextANGLE(GLeglContext ctx,
                                                GLint location,
                                                GLsizei count,
                                                GLboolean transpose,
                                                const GLfloat *value)
{
    EVENT(
        "(GLint location = %d, GLsizei count = %d, GLboolean transpose = %u, const GLfloat *value "
        "= 0x%016" PRIxPTR ")",
        location, count, transpose, (uintptr_t)value);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateUniformMatrix2x4fv(context, location, count, transpose, value));
        if (isCallValid)
        {
            context->uniformMatrix2x4fv(location, count, transpose, value);
        }
        ANGLE_CAPTURE(UniformMatrix2x4fv, isCallValid, context, location, count, transpose, value);
    }
}

void GL_APIENTRY UniformMatrix3fvContextANGLE(GLeglContext ctx,
                                              GLint location,
                                              GLsizei count,
                                              GLboolean transpose,
                                              const GLfloat *value)
{
    EVENT(
        "(GLint location = %d, GLsizei count = %d, GLboolean transpose = %u, const GLfloat *value "
        "= 0x%016" PRIxPTR ")",
        location, count, transpose, (uintptr_t)value);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateUniformMatrix3fv(context, location, count, transpose, value));
        if (isCallValid)
        {
            context->uniformMatrix3fv(location, count, transpose, value);
        }
        ANGLE_CAPTURE(UniformMatrix3fv, isCallValid, context, location, count, transpose, value);
    }
}

void GL_APIENTRY UniformMatrix3x2fvContextANGLE(GLeglContext ctx,
                                                GLint location,
                                                GLsizei count,
                                                GLboolean transpose,
                                                const GLfloat *value)
{
    EVENT(
        "(GLint location = %d, GLsizei count = %d, GLboolean transpose = %u, const GLfloat *value "
        "= 0x%016" PRIxPTR ")",
        location, count, transpose, (uintptr_t)value);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateUniformMatrix3x2fv(context, location, count, transpose, value));
        if (isCallValid)
        {
            context->uniformMatrix3x2fv(location, count, transpose, value);
        }
        ANGLE_CAPTURE(UniformMatrix3x2fv, isCallValid, context, location, count, transpose, value);
    }
}

void GL_APIENTRY UniformMatrix3x4fvContextANGLE(GLeglContext ctx,
                                                GLint location,
                                                GLsizei count,
                                                GLboolean transpose,
                                                const GLfloat *value)
{
    EVENT(
        "(GLint location = %d, GLsizei count = %d, GLboolean transpose = %u, const GLfloat *value "
        "= 0x%016" PRIxPTR ")",
        location, count, transpose, (uintptr_t)value);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateUniformMatrix3x4fv(context, location, count, transpose, value));
        if (isCallValid)
        {
            context->uniformMatrix3x4fv(location, count, transpose, value);
        }
        ANGLE_CAPTURE(UniformMatrix3x4fv, isCallValid, context, location, count, transpose, value);
    }
}

void GL_APIENTRY UniformMatrix4fvContextANGLE(GLeglContext ctx,
                                              GLint location,
                                              GLsizei count,
                                              GLboolean transpose,
                                              const GLfloat *value)
{
    EVENT(
        "(GLint location = %d, GLsizei count = %d, GLboolean transpose = %u, const GLfloat *value "
        "= 0x%016" PRIxPTR ")",
        location, count, transpose, (uintptr_t)value);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateUniformMatrix4fv(context, location, count, transpose, value));
        if (isCallValid)
        {
            context->uniformMatrix4fv(location, count, transpose, value);
        }
        ANGLE_CAPTURE(UniformMatrix4fv, isCallValid, context, location, count, transpose, value);
    }
}

void GL_APIENTRY UniformMatrix4x2fvContextANGLE(GLeglContext ctx,
                                                GLint location,
                                                GLsizei count,
                                                GLboolean transpose,
                                                const GLfloat *value)
{
    EVENT(
        "(GLint location = %d, GLsizei count = %d, GLboolean transpose = %u, const GLfloat *value "
        "= 0x%016" PRIxPTR ")",
        location, count, transpose, (uintptr_t)value);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateUniformMatrix4x2fv(context, location, count, transpose, value));
        if (isCallValid)
        {
            context->uniformMatrix4x2fv(location, count, transpose, value);
        }
        ANGLE_CAPTURE(UniformMatrix4x2fv, isCallValid, context, location, count, transpose, value);
    }
}

void GL_APIENTRY UniformMatrix4x3fvContextANGLE(GLeglContext ctx,
                                                GLint location,
                                                GLsizei count,
                                                GLboolean transpose,
                                                const GLfloat *value)
{
    EVENT(
        "(GLint location = %d, GLsizei count = %d, GLboolean transpose = %u, const GLfloat *value "
        "= 0x%016" PRIxPTR ")",
        location, count, transpose, (uintptr_t)value);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateUniformMatrix4x3fv(context, location, count, transpose, value));
        if (isCallValid)
        {
            context->uniformMatrix4x3fv(location, count, transpose, value);
        }
        ANGLE_CAPTURE(UniformMatrix4x3fv, isCallValid, context, location, count, transpose, value);
    }
}

GLboolean GL_APIENTRY UnmapBufferContextANGLE(GLeglContext ctx, GLenum target)
{
    EVENT("(GLenum target = 0x%X)", target);

    Context *context = static_cast<gl::Context *>(ctx);
    GLboolean returnValue;
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        BufferBinding targetPacked = FromGLenum<BufferBinding>(target);
        bool isCallValid =
            (context->skipValidation() || ValidateUnmapBuffer(context, targetPacked));
        if (isCallValid)
        {
            returnValue = context->unmapBuffer(targetPacked);
        }
        else
        {
            returnValue = GetDefaultReturnValue<EntryPoint::UnmapBuffer, GLboolean>();
        }
        ANGLE_CAPTURE(UnmapBuffer, isCallValid, context, targetPacked, returnValue);
    }
    else
    {
        returnValue = GetDefaultReturnValue<EntryPoint::UnmapBuffer, GLboolean>();
    }
    return returnValue;
}

GLboolean GL_APIENTRY UnmapBufferOESContextANGLE(GLeglContext ctx, GLenum target)
{
    EVENT("(GLenum target = 0x%X)", target);

    Context *context = static_cast<gl::Context *>(ctx);
    GLboolean returnValue;
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        BufferBinding targetPacked = FromGLenum<BufferBinding>(target);
        bool isCallValid =
            (context->skipValidation() || ValidateUnmapBufferOES(context, targetPacked));
        if (isCallValid)
        {
            returnValue = context->unmapBuffer(targetPacked);
        }
        else
        {
            returnValue = GetDefaultReturnValue<EntryPoint::UnmapBufferOES, GLboolean>();
        }
        ANGLE_CAPTURE(UnmapBufferOES, isCallValid, context, targetPacked, returnValue);
    }
    else
    {
        returnValue = GetDefaultReturnValue<EntryPoint::UnmapBufferOES, GLboolean>();
    }
    return returnValue;
}

void GL_APIENTRY UseProgramContextANGLE(GLeglContext ctx, GLuint program)
{
    EVENT("(GLuint program = %u)", program);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateUseProgram(context, program));
        if (isCallValid)
        {
            context->useProgram(program);
        }
        ANGLE_CAPTURE(UseProgram, isCallValid, context, program);
    }
}

void GL_APIENTRY UseProgramStagesContextANGLE(GLeglContext ctx,
                                              GLuint pipeline,
                                              GLbitfield stages,
                                              GLuint program)
{
    EVENT("(GLuint pipeline = %u, GLbitfield stages = 0x%X, GLuint program = %u)", pipeline, stages,
          program);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateUseProgramStages(context, pipeline, stages, program));
        if (isCallValid)
        {
            context->useProgramStages(pipeline, stages, program);
        }
        ANGLE_CAPTURE(UseProgramStages, isCallValid, context, pipeline, stages, program);
    }
}

void GL_APIENTRY ValidateProgramContextANGLE(GLeglContext ctx, GLuint program)
{
    EVENT("(GLuint program = %u)", program);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateValidateProgram(context, program));
        if (isCallValid)
        {
            context->validateProgram(program);
        }
        ANGLE_CAPTURE(ValidateProgram, isCallValid, context, program);
    }
}

void GL_APIENTRY ValidateProgramPipelineContextANGLE(GLeglContext ctx, GLuint pipeline)
{
    EVENT("(GLuint pipeline = %u)", pipeline);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateValidateProgramPipeline(context, pipeline));
        if (isCallValid)
        {
            context->validateProgramPipeline(pipeline);
        }
        ANGLE_CAPTURE(ValidateProgramPipeline, isCallValid, context, pipeline);
    }
}

void GL_APIENTRY VertexAttrib1fContextANGLE(GLeglContext ctx, GLuint index, GLfloat x)
{
    EVENT("(GLuint index = %u, GLfloat x = %f)", index, x);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateVertexAttrib1f(context, index, x));
        if (isCallValid)
        {
            context->vertexAttrib1f(index, x);
        }
        ANGLE_CAPTURE(VertexAttrib1f, isCallValid, context, index, x);
    }
}

void GL_APIENTRY VertexAttrib1fvContextANGLE(GLeglContext ctx, GLuint index, const GLfloat *v)
{
    EVENT("(GLuint index = %u, const GLfloat *v = 0x%016" PRIxPTR ")", index, (uintptr_t)v);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateVertexAttrib1fv(context, index, v));
        if (isCallValid)
        {
            context->vertexAttrib1fv(index, v);
        }
        ANGLE_CAPTURE(VertexAttrib1fv, isCallValid, context, index, v);
    }
}

void GL_APIENTRY VertexAttrib2fContextANGLE(GLeglContext ctx, GLuint index, GLfloat x, GLfloat y)
{
    EVENT("(GLuint index = %u, GLfloat x = %f, GLfloat y = %f)", index, x, y);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateVertexAttrib2f(context, index, x, y));
        if (isCallValid)
        {
            context->vertexAttrib2f(index, x, y);
        }
        ANGLE_CAPTURE(VertexAttrib2f, isCallValid, context, index, x, y);
    }
}

void GL_APIENTRY VertexAttrib2fvContextANGLE(GLeglContext ctx, GLuint index, const GLfloat *v)
{
    EVENT("(GLuint index = %u, const GLfloat *v = 0x%016" PRIxPTR ")", index, (uintptr_t)v);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateVertexAttrib2fv(context, index, v));
        if (isCallValid)
        {
            context->vertexAttrib2fv(index, v);
        }
        ANGLE_CAPTURE(VertexAttrib2fv, isCallValid, context, index, v);
    }
}

void GL_APIENTRY
VertexAttrib3fContextANGLE(GLeglContext ctx, GLuint index, GLfloat x, GLfloat y, GLfloat z)
{
    EVENT("(GLuint index = %u, GLfloat x = %f, GLfloat y = %f, GLfloat z = %f)", index, x, y, z);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateVertexAttrib3f(context, index, x, y, z));
        if (isCallValid)
        {
            context->vertexAttrib3f(index, x, y, z);
        }
        ANGLE_CAPTURE(VertexAttrib3f, isCallValid, context, index, x, y, z);
    }
}

void GL_APIENTRY VertexAttrib3fvContextANGLE(GLeglContext ctx, GLuint index, const GLfloat *v)
{
    EVENT("(GLuint index = %u, const GLfloat *v = 0x%016" PRIxPTR ")", index, (uintptr_t)v);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateVertexAttrib3fv(context, index, v));
        if (isCallValid)
        {
            context->vertexAttrib3fv(index, v);
        }
        ANGLE_CAPTURE(VertexAttrib3fv, isCallValid, context, index, v);
    }
}

void GL_APIENTRY VertexAttrib4fContextANGLE(GLeglContext ctx,
                                            GLuint index,
                                            GLfloat x,
                                            GLfloat y,
                                            GLfloat z,
                                            GLfloat w)
{
    EVENT("(GLuint index = %u, GLfloat x = %f, GLfloat y = %f, GLfloat z = %f, GLfloat w = %f)",
          index, x, y, z, w);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateVertexAttrib4f(context, index, x, y, z, w));
        if (isCallValid)
        {
            context->vertexAttrib4f(index, x, y, z, w);
        }
        ANGLE_CAPTURE(VertexAttrib4f, isCallValid, context, index, x, y, z, w);
    }
}

void GL_APIENTRY VertexAttrib4fvContextANGLE(GLeglContext ctx, GLuint index, const GLfloat *v)
{
    EVENT("(GLuint index = %u, const GLfloat *v = 0x%016" PRIxPTR ")", index, (uintptr_t)v);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateVertexAttrib4fv(context, index, v));
        if (isCallValid)
        {
            context->vertexAttrib4fv(index, v);
        }
        ANGLE_CAPTURE(VertexAttrib4fv, isCallValid, context, index, v);
    }
}

void GL_APIENTRY VertexAttribBindingContextANGLE(GLeglContext ctx,
                                                 GLuint attribindex,
                                                 GLuint bindingindex)
{
    EVENT("(GLuint attribindex = %u, GLuint bindingindex = %u)", attribindex, bindingindex);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateVertexAttribBinding(context, attribindex, bindingindex));
        if (isCallValid)
        {
            context->vertexAttribBinding(attribindex, bindingindex);
        }
        ANGLE_CAPTURE(VertexAttribBinding, isCallValid, context, attribindex, bindingindex);
    }
}

void GL_APIENTRY VertexAttribDivisorContextANGLE(GLeglContext ctx, GLuint index, GLuint divisor)
{
    EVENT("(GLuint index = %u, GLuint divisor = %u)", index, divisor);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateVertexAttribDivisor(context, index, divisor));
        if (isCallValid)
        {
            context->vertexAttribDivisor(index, divisor);
        }
        ANGLE_CAPTURE(VertexAttribDivisor, isCallValid, context, index, divisor);
    }
}

void GL_APIENTRY VertexAttribDivisorANGLEContextANGLE(GLeglContext ctx,
                                                      GLuint index,
                                                      GLuint divisor)
{
    EVENT("(GLuint index = %u, GLuint divisor = %u)", index, divisor);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateVertexAttribDivisorANGLE(context, index, divisor));
        if (isCallValid)
        {
            context->vertexAttribDivisor(index, divisor);
        }
        ANGLE_CAPTURE(VertexAttribDivisorANGLE, isCallValid, context, index, divisor);
    }
}

void GL_APIENTRY VertexAttribDivisorEXTContextANGLE(GLeglContext ctx, GLuint index, GLuint divisor)
{
    EVENT("(GLuint index = %u, GLuint divisor = %u)", index, divisor);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateVertexAttribDivisorEXT(context, index, divisor));
        if (isCallValid)
        {
            context->vertexAttribDivisor(index, divisor);
        }
        ANGLE_CAPTURE(VertexAttribDivisorEXT, isCallValid, context, index, divisor);
    }
}

void GL_APIENTRY VertexAttribFormatContextANGLE(GLeglContext ctx,
                                                GLuint attribindex,
                                                GLint size,
                                                GLenum type,
                                                GLboolean normalized,
                                                GLuint relativeoffset)
{
    EVENT(
        "(GLuint attribindex = %u, GLint size = %d, GLenum type = 0x%X, GLboolean normalized = %u, "
        "GLuint relativeoffset = %u)",
        attribindex, size, type, normalized, relativeoffset);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        VertexAttribType typePacked = FromGLenum<VertexAttribType>(type);
        bool isCallValid            = (context->skipValidation() ||
                            ValidateVertexAttribFormat(context, attribindex, size, typePacked,
                                                       normalized, relativeoffset));
        if (isCallValid)
        {
            context->vertexAttribFormat(attribindex, size, typePacked, normalized, relativeoffset);
        }
        ANGLE_CAPTURE(VertexAttribFormat, isCallValid, context, attribindex, size, typePacked,
                      normalized, relativeoffset);
    }
}

void GL_APIENTRY
VertexAttribI4iContextANGLE(GLeglContext ctx, GLuint index, GLint x, GLint y, GLint z, GLint w)
{
    EVENT("(GLuint index = %u, GLint x = %d, GLint y = %d, GLint z = %d, GLint w = %d)", index, x,
          y, z, w);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateVertexAttribI4i(context, index, x, y, z, w));
        if (isCallValid)
        {
            context->vertexAttribI4i(index, x, y, z, w);
        }
        ANGLE_CAPTURE(VertexAttribI4i, isCallValid, context, index, x, y, z, w);
    }
}

void GL_APIENTRY VertexAttribI4ivContextANGLE(GLeglContext ctx, GLuint index, const GLint *v)
{
    EVENT("(GLuint index = %u, const GLint *v = 0x%016" PRIxPTR ")", index, (uintptr_t)v);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateVertexAttribI4iv(context, index, v));
        if (isCallValid)
        {
            context->vertexAttribI4iv(index, v);
        }
        ANGLE_CAPTURE(VertexAttribI4iv, isCallValid, context, index, v);
    }
}

void GL_APIENTRY
VertexAttribI4uiContextANGLE(GLeglContext ctx, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w)
{
    EVENT("(GLuint index = %u, GLuint x = %u, GLuint y = %u, GLuint z = %u, GLuint w = %u)", index,
          x, y, z, w);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateVertexAttribI4ui(context, index, x, y, z, w));
        if (isCallValid)
        {
            context->vertexAttribI4ui(index, x, y, z, w);
        }
        ANGLE_CAPTURE(VertexAttribI4ui, isCallValid, context, index, x, y, z, w);
    }
}

void GL_APIENTRY VertexAttribI4uivContextANGLE(GLeglContext ctx, GLuint index, const GLuint *v)
{
    EVENT("(GLuint index = %u, const GLuint *v = 0x%016" PRIxPTR ")", index, (uintptr_t)v);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateVertexAttribI4uiv(context, index, v));
        if (isCallValid)
        {
            context->vertexAttribI4uiv(index, v);
        }
        ANGLE_CAPTURE(VertexAttribI4uiv, isCallValid, context, index, v);
    }
}

void GL_APIENTRY VertexAttribIFormatContextANGLE(GLeglContext ctx,
                                                 GLuint attribindex,
                                                 GLint size,
                                                 GLenum type,
                                                 GLuint relativeoffset)
{
    EVENT(
        "(GLuint attribindex = %u, GLint size = %d, GLenum type = 0x%X, GLuint relativeoffset = "
        "%u)",
        attribindex, size, type, relativeoffset);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        VertexAttribType typePacked = FromGLenum<VertexAttribType>(type);
        bool isCallValid =
            (context->skipValidation() ||
             ValidateVertexAttribIFormat(context, attribindex, size, typePacked, relativeoffset));
        if (isCallValid)
        {
            context->vertexAttribIFormat(attribindex, size, typePacked, relativeoffset);
        }
        ANGLE_CAPTURE(VertexAttribIFormat, isCallValid, context, attribindex, size, typePacked,
                      relativeoffset);
    }
}

void GL_APIENTRY VertexAttribIPointerContextANGLE(GLeglContext ctx,
                                                  GLuint index,
                                                  GLint size,
                                                  GLenum type,
                                                  GLsizei stride,
                                                  const void *pointer)
{
    EVENT(
        "(GLuint index = %u, GLint size = %d, GLenum type = 0x%X, GLsizei stride = %d, const void "
        "*pointer = 0x%016" PRIxPTR ")",
        index, size, type, stride, (uintptr_t)pointer);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        VertexAttribType typePacked = FromGLenum<VertexAttribType>(type);
        bool isCallValid =
            (context->skipValidation() ||
             ValidateVertexAttribIPointer(context, index, size, typePacked, stride, pointer));
        if (isCallValid)
        {
            context->vertexAttribIPointer(index, size, typePacked, stride, pointer);
        }
        ANGLE_CAPTURE(VertexAttribIPointer, isCallValid, context, index, size, typePacked, stride,
                      pointer);
    }
}

void GL_APIENTRY VertexAttribPointerContextANGLE(GLeglContext ctx,
                                                 GLuint index,
                                                 GLint size,
                                                 GLenum type,
                                                 GLboolean normalized,
                                                 GLsizei stride,
                                                 const void *pointer)
{
    EVENT(
        "(GLuint index = %u, GLint size = %d, GLenum type = 0x%X, GLboolean normalized = %u, "
        "GLsizei stride = %d, const void *pointer = 0x%016" PRIxPTR ")",
        index, size, type, normalized, stride, (uintptr_t)pointer);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        VertexAttribType typePacked = FromGLenum<VertexAttribType>(type);
        bool isCallValid            = (context->skipValidation() ||
                            ValidateVertexAttribPointer(context, index, size, typePacked,
                                                        normalized, stride, pointer));
        if (isCallValid)
        {
            context->vertexAttribPointer(index, size, typePacked, normalized, stride, pointer);
        }
        ANGLE_CAPTURE(VertexAttribPointer, isCallValid, context, index, size, typePacked,
                      normalized, stride, pointer);
    }
}

void GL_APIENTRY VertexBindingDivisorContextANGLE(GLeglContext ctx,
                                                  GLuint bindingindex,
                                                  GLuint divisor)
{
    EVENT("(GLuint bindingindex = %u, GLuint divisor = %u)", bindingindex, divisor);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateVertexBindingDivisor(context, bindingindex, divisor));
        if (isCallValid)
        {
            context->vertexBindingDivisor(bindingindex, divisor);
        }
        ANGLE_CAPTURE(VertexBindingDivisor, isCallValid, context, bindingindex, divisor);
    }
}

void GL_APIENTRY VertexPointerContextANGLE(GLeglContext ctx,
                                           GLint size,
                                           GLenum type,
                                           GLsizei stride,
                                           const void *pointer)
{
    EVENT(
        "(GLint size = %d, GLenum type = 0x%X, GLsizei stride = %d, const void *pointer = "
        "0x%016" PRIxPTR ")",
        size, type, stride, (uintptr_t)pointer);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        VertexAttribType typePacked = FromGLenum<VertexAttribType>(type);
        bool isCallValid            = (context->skipValidation() ||
                            ValidateVertexPointer(context, size, typePacked, stride, pointer));
        if (isCallValid)
        {
            context->vertexPointer(size, typePacked, stride, pointer);
        }
        ANGLE_CAPTURE(VertexPointer, isCallValid, context, size, typePacked, stride, pointer);
    }
}

void GL_APIENTRY
ViewportContextANGLE(GLeglContext ctx, GLint x, GLint y, GLsizei width, GLsizei height)
{
    EVENT("(GLint x = %d, GLint y = %d, GLsizei width = %d, GLsizei height = %d)", x, y, width,
          height);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateViewport(context, x, y, width, height));
        if (isCallValid)
        {
            context->viewport(x, y, width, height);
        }
        ANGLE_CAPTURE(Viewport, isCallValid, context, x, y, width, height);
    }
}

void GL_APIENTRY WaitSemaphoreEXTContextANGLE(GLeglContext ctx,
                                              GLuint semaphore,
                                              GLuint numBufferBarriers,
                                              const GLuint *buffers,
                                              GLuint numTextureBarriers,
                                              const GLuint *textures,
                                              const GLenum *srcLayouts)
{
    EVENT(
        "(GLuint semaphore = %u, GLuint numBufferBarriers = %u, const GLuint *buffers = "
        "0x%016" PRIxPTR ", GLuint numTextureBarriers = %u, const GLuint *textures = 0x%016" PRIxPTR
        ", const GLenum *srcLayouts = 0x%016" PRIxPTR ")",
        semaphore, numBufferBarriers, (uintptr_t)buffers, numTextureBarriers, (uintptr_t)textures,
        (uintptr_t)srcLayouts);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateWaitSemaphoreEXT(context, semaphore, numBufferBarriers, buffers,
                                                     numTextureBarriers, textures, srcLayouts));
        if (isCallValid)
        {
            context->waitSemaphore(semaphore, numBufferBarriers, buffers, numTextureBarriers,
                                   textures, srcLayouts);
        }
        ANGLE_CAPTURE(WaitSemaphoreEXT, isCallValid, context, semaphore, numBufferBarriers, buffers,
                      numTextureBarriers, textures, srcLayouts);
    }
}

void GL_APIENTRY WaitSyncContextANGLE(GLeglContext ctx,
                                      GLsync sync,
                                      GLbitfield flags,
                                      GLuint64 timeout)
{
    EVENT("(GLsync sync = 0x%016" PRIxPTR ", GLbitfield flags = 0x%X, GLuint64 timeout = %llu)",
          (uintptr_t)sync, flags, static_cast<unsigned long long>(timeout));

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateWaitSync(context, sync, flags, timeout));
        if (isCallValid)
        {
            context->waitSync(sync, flags, timeout);
        }
        ANGLE_CAPTURE(WaitSync, isCallValid, context, sync, flags, timeout);
    }
}

void GL_APIENTRY WeightPointerOESContextANGLE(GLeglContext ctx,
                                              GLint size,
                                              GLenum type,
                                              GLsizei stride,
                                              const void *pointer)
{
    EVENT(
        "(GLint size = %d, GLenum type = 0x%X, GLsizei stride = %d, const void *pointer = "
        "0x%016" PRIxPTR ")",
        size, type, stride, (uintptr_t)pointer);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateWeightPointerOES(context, size, type, stride, pointer));
        if (isCallValid)
        {
            context->weightPointer(size, type, stride, pointer);
        }
        ANGLE_CAPTURE(WeightPointerOES, isCallValid, context, size, type, stride, pointer);
    }
}

void GL_APIENTRY BindUniformLocationCHROMIUMContextANGLE(GLeglContext ctx,
                                                         GLuint program,
                                                         GLint location,
                                                         const GLchar *name)
{
    EVENT("(GLuint program = %u, GLint location = %d, const GLchar* name = 0x%016" PRIxPTR ")",
          program, location, (uintptr_t)name);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateBindUniformLocationCHROMIUM(context, program, location, name));
        if (isCallValid)
        {
            context->bindUniformLocation(program, location, name);
        }
        ANGLE_CAPTURE(BindUniformLocationCHROMIUM, isCallValid, context, program, location, name);
    }
}

void GL_APIENTRY CoverageModulationCHROMIUMContextANGLE(GLeglContext ctx, GLenum components)
{
    EVENT("(GLenum components = 0x%X)", components);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateCoverageModulationCHROMIUM(context, components));
        if (isCallValid)
        {
            context->coverageModulation(components);
        }
        ANGLE_CAPTURE(CoverageModulationCHROMIUM, isCallValid, context, components);
    }
}

void GL_APIENTRY MatrixLoadfCHROMIUMContextANGLE(GLeglContext ctx,
                                                 GLenum matrixMode,
                                                 const GLfloat *matrix)
{
    EVENT("(GLenum matrixMode = 0x%X, const GLfloat * matrix = 0x%016" PRIxPTR ")", matrixMode,
          (uintptr_t)matrix);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateMatrixLoadfCHROMIUM(context, matrixMode, matrix));
        if (isCallValid)
        {
            context->matrixLoadf(matrixMode, matrix);
        }
        ANGLE_CAPTURE(MatrixLoadfCHROMIUM, isCallValid, context, matrixMode, matrix);
    }
}

void GL_APIENTRY MatrixLoadIdentityCHROMIUMContextANGLE(GLeglContext ctx, GLenum matrixMode)
{
    EVENT("(GLenum matrixMode = 0x%X)", matrixMode);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateMatrixLoadIdentityCHROMIUM(context, matrixMode));
        if (isCallValid)
        {
            context->matrixLoadIdentity(matrixMode);
        }
        ANGLE_CAPTURE(MatrixLoadIdentityCHROMIUM, isCallValid, context, matrixMode);
    }
}

GLuint GL_APIENTRY GenPathsCHROMIUMContextANGLE(GLeglContext ctx, GLsizei range)
{
    EVENT("(GLsizei range = %d)", range);

    Context *context = static_cast<gl::Context *>(ctx);
    GLuint returnValue;
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateGenPathsCHROMIUM(context, range));
        if (isCallValid)
        {
            returnValue = context->genPaths(range);
        }
        else
        {
            returnValue = GetDefaultReturnValue<EntryPoint::GenPathsCHROMIUM, GLuint>();
        }
        ANGLE_CAPTURE(GenPathsCHROMIUM, isCallValid, context, range, returnValue);
    }
    else
    {
        returnValue = GetDefaultReturnValue<EntryPoint::GenPathsCHROMIUM, GLuint>();
    }
    return returnValue;
}

void GL_APIENTRY DeletePathsCHROMIUMContextANGLE(GLeglContext ctx, GLuint first, GLsizei range)
{
    EVENT("(GLuint first = %u, GLsizei range = %d)", first, range);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateDeletePathsCHROMIUM(context, first, range));
        if (isCallValid)
        {
            context->deletePaths(first, range);
        }
        ANGLE_CAPTURE(DeletePathsCHROMIUM, isCallValid, context, first, range);
    }
}

GLboolean GL_APIENTRY IsPathCHROMIUMContextANGLE(GLeglContext ctx, GLuint path)
{
    EVENT("(GLuint path = %u)", path);

    Context *context = static_cast<gl::Context *>(ctx);
    GLboolean returnValue;
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateIsPathCHROMIUM(context, path));
        if (isCallValid)
        {
            returnValue = context->isPath(path);
        }
        else
        {
            returnValue = GetDefaultReturnValue<EntryPoint::IsPathCHROMIUM, GLboolean>();
        }
        ANGLE_CAPTURE(IsPathCHROMIUM, isCallValid, context, path, returnValue);
    }
    else
    {
        returnValue = GetDefaultReturnValue<EntryPoint::IsPathCHROMIUM, GLboolean>();
    }
    return returnValue;
}

void GL_APIENTRY PathCommandsCHROMIUMContextANGLE(GLeglContext ctx,
                                                  GLuint path,
                                                  GLsizei numCommands,
                                                  const GLubyte *commands,
                                                  GLsizei numCoords,
                                                  GLenum coordType,
                                                  const void *coords)
{
    EVENT("(GLuint path = %u, GLsizei numCommands = %d, const GLubyte * commands = 0x%016" PRIxPTR
          ", GLsizei numCoords = %d, GLenum coordType = 0x%X, const void* coords = 0x%016" PRIxPTR
          ")",
          path, numCommands, (uintptr_t)commands, numCoords, coordType, (uintptr_t)coords);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidatePathCommandsCHROMIUM(context, path, numCommands, commands,
                                                         numCoords, coordType, coords));
        if (isCallValid)
        {
            context->pathCommands(path, numCommands, commands, numCoords, coordType, coords);
        }
        ANGLE_CAPTURE(PathCommandsCHROMIUM, isCallValid, context, path, numCommands, commands,
                      numCoords, coordType, coords);
    }
}

void GL_APIENTRY PathParameterfCHROMIUMContextANGLE(GLeglContext ctx,
                                                    GLuint path,
                                                    GLenum pname,
                                                    GLfloat value)
{
    EVENT("(GLuint path = %u, GLenum pname = 0x%X, GLfloat value = %f)", path, pname, value);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidatePathParameterfCHROMIUM(context, path, pname, value));
        if (isCallValid)
        {
            context->pathParameterf(path, pname, value);
        }
        ANGLE_CAPTURE(PathParameterfCHROMIUM, isCallValid, context, path, pname, value);
    }
}

void GL_APIENTRY PathParameteriCHROMIUMContextANGLE(GLeglContext ctx,
                                                    GLuint path,
                                                    GLenum pname,
                                                    GLint value)
{
    EVENT("(GLuint path = %u, GLenum pname = 0x%X, GLint value = %d)", path, pname, value);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidatePathParameteriCHROMIUM(context, path, pname, value));
        if (isCallValid)
        {
            context->pathParameteri(path, pname, value);
        }
        ANGLE_CAPTURE(PathParameteriCHROMIUM, isCallValid, context, path, pname, value);
    }
}

void GL_APIENTRY GetPathParameterfvCHROMIUMContextANGLE(GLeglContext ctx,
                                                        GLuint path,
                                                        GLenum pname,
                                                        GLfloat *value)
{
    EVENT("(GLuint path = %u, GLenum pname = 0x%X, GLfloat * value = 0x%016" PRIxPTR ")", path,
          pname, (uintptr_t)value);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateGetPathParameterfvCHROMIUM(context, path, pname, value));
        if (isCallValid)
        {
            context->getPathParameterfv(path, pname, value);
        }
        ANGLE_CAPTURE(GetPathParameterfvCHROMIUM, isCallValid, context, path, pname, value);
    }
}

void GL_APIENTRY GetPathParameterivCHROMIUMContextANGLE(GLeglContext ctx,
                                                        GLuint path,
                                                        GLenum pname,
                                                        GLint *value)
{
    EVENT("(GLuint path = %u, GLenum pname = 0x%X, GLint * value = 0x%016" PRIxPTR ")", path, pname,
          (uintptr_t)value);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateGetPathParameterivCHROMIUM(context, path, pname, value));
        if (isCallValid)
        {
            context->getPathParameteriv(path, pname, value);
        }
        ANGLE_CAPTURE(GetPathParameterivCHROMIUM, isCallValid, context, path, pname, value);
    }
}

void GL_APIENTRY PathStencilFuncCHROMIUMContextANGLE(GLeglContext ctx,
                                                     GLenum func,
                                                     GLint ref,
                                                     GLuint mask)
{
    EVENT("(GLenum func = 0x%X, GLint ref = %d, GLuint mask = %u)", func, ref, mask);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidatePathStencilFuncCHROMIUM(context, func, ref, mask));
        if (isCallValid)
        {
            context->pathStencilFunc(func, ref, mask);
        }
        ANGLE_CAPTURE(PathStencilFuncCHROMIUM, isCallValid, context, func, ref, mask);
    }
}

void GL_APIENTRY StencilFillPathCHROMIUMContextANGLE(GLeglContext ctx,
                                                     GLuint path,
                                                     GLenum fillMode,
                                                     GLuint mask)
{
    EVENT("(GLuint path = %u, GLenum fillMode = 0x%X, GLuint mask = %u)", path, fillMode, mask);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateStencilFillPathCHROMIUM(context, path, fillMode, mask));
        if (isCallValid)
        {
            context->stencilFillPath(path, fillMode, mask);
        }
        ANGLE_CAPTURE(StencilFillPathCHROMIUM, isCallValid, context, path, fillMode, mask);
    }
}

void GL_APIENTRY StencilStrokePathCHROMIUMContextANGLE(GLeglContext ctx,
                                                       GLuint path,
                                                       GLint reference,
                                                       GLuint mask)
{
    EVENT("(GLuint path = %u, GLint reference = %d, GLuint mask = %u)", path, reference, mask);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateStencilStrokePathCHROMIUM(context, path, reference, mask));
        if (isCallValid)
        {
            context->stencilStrokePath(path, reference, mask);
        }
        ANGLE_CAPTURE(StencilStrokePathCHROMIUM, isCallValid, context, path, reference, mask);
    }
}

void GL_APIENTRY CoverFillPathCHROMIUMContextANGLE(GLeglContext ctx, GLuint path, GLenum coverMode)
{
    EVENT("(GLuint path = %u, GLenum coverMode = 0x%X)", path, coverMode);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateCoverFillPathCHROMIUM(context, path, coverMode));
        if (isCallValid)
        {
            context->coverFillPath(path, coverMode);
        }
        ANGLE_CAPTURE(CoverFillPathCHROMIUM, isCallValid, context, path, coverMode);
    }
}

void GL_APIENTRY CoverStrokePathCHROMIUMContextANGLE(GLeglContext ctx,
                                                     GLuint path,
                                                     GLenum coverMode)
{
    EVENT("(GLuint path = %u, GLenum coverMode = 0x%X)", path, coverMode);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateCoverStrokePathCHROMIUM(context, path, coverMode));
        if (isCallValid)
        {
            context->coverStrokePath(path, coverMode);
        }
        ANGLE_CAPTURE(CoverStrokePathCHROMIUM, isCallValid, context, path, coverMode);
    }
}

void GL_APIENTRY StencilThenCoverFillPathCHROMIUMContextANGLE(GLeglContext ctx,
                                                              GLuint path,
                                                              GLenum fillMode,
                                                              GLuint mask,
                                                              GLenum coverMode)
{
    EVENT("(GLuint path = %u, GLenum fillMode = 0x%X, GLuint mask = %u, GLenum coverMode = 0x%X)",
          path, fillMode, mask, coverMode);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() ||
             ValidateStencilThenCoverFillPathCHROMIUM(context, path, fillMode, mask, coverMode));
        if (isCallValid)
        {
            context->stencilThenCoverFillPath(path, fillMode, mask, coverMode);
        }
        ANGLE_CAPTURE(StencilThenCoverFillPathCHROMIUM, isCallValid, context, path, fillMode, mask,
                      coverMode);
    }
}

void GL_APIENTRY StencilThenCoverStrokePathCHROMIUMContextANGLE(GLeglContext ctx,
                                                                GLuint path,
                                                                GLint reference,
                                                                GLuint mask,
                                                                GLenum coverMode)
{
    EVENT("(GLuint path = %u, GLint reference = %d, GLuint mask = %u, GLenum coverMode = 0x%X)",
          path, reference, mask, coverMode);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() ||
             ValidateStencilThenCoverStrokePathCHROMIUM(context, path, reference, mask, coverMode));
        if (isCallValid)
        {
            context->stencilThenCoverStrokePath(path, reference, mask, coverMode);
        }
        ANGLE_CAPTURE(StencilThenCoverStrokePathCHROMIUM, isCallValid, context, path, reference,
                      mask, coverMode);
    }
}

void GL_APIENTRY CoverFillPathInstancedCHROMIUMContextANGLE(GLeglContext ctx,
                                                            GLsizei numPath,
                                                            GLenum pathNameType,
                                                            const void *paths,
                                                            GLuint pathBase,
                                                            GLenum coverMode,
                                                            GLenum transformType,
                                                            const GLfloat *transformValues)
{
    EVENT("(GLsizei numPath = %d, GLenum pathNameType = 0x%X, const void * paths = 0x%016" PRIxPTR
          ", GLuint pathBase = %u, GLenum coverMode = 0x%X, GLenum transformType = 0x%X, const "
          "GLfloat * transformValues = 0x%016" PRIxPTR ")",
          numPath, pathNameType, (uintptr_t)paths, pathBase, coverMode, transformType,
          (uintptr_t)transformValues);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() ||
             ValidateCoverFillPathInstancedCHROMIUM(context, numPath, pathNameType, paths, pathBase,
                                                    coverMode, transformType, transformValues));
        if (isCallValid)
        {
            context->coverFillPathInstanced(numPath, pathNameType, paths, pathBase, coverMode,
                                            transformType, transformValues);
        }
        ANGLE_CAPTURE(CoverFillPathInstancedCHROMIUM, isCallValid, context, numPath, pathNameType,
                      paths, pathBase, coverMode, transformType, transformValues);
    }
}

void GL_APIENTRY CoverStrokePathInstancedCHROMIUMContextANGLE(GLeglContext ctx,
                                                              GLsizei numPath,
                                                              GLenum pathNameType,
                                                              const void *paths,
                                                              GLuint pathBase,
                                                              GLenum coverMode,
                                                              GLenum transformType,
                                                              const GLfloat *transformValues)
{
    EVENT("(GLsizei numPath = %d, GLenum pathNameType = 0x%X, const void * paths = 0x%016" PRIxPTR
          ", GLuint pathBase = %u, GLenum coverMode = 0x%X, GLenum transformType = 0x%X, const "
          "GLfloat * transformValues = 0x%016" PRIxPTR ")",
          numPath, pathNameType, (uintptr_t)paths, pathBase, coverMode, transformType,
          (uintptr_t)transformValues);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateCoverStrokePathInstancedCHROMIUM(
                                              context, numPath, pathNameType, paths, pathBase,
                                              coverMode, transformType, transformValues));
        if (isCallValid)
        {
            context->coverStrokePathInstanced(numPath, pathNameType, paths, pathBase, coverMode,
                                              transformType, transformValues);
        }
        ANGLE_CAPTURE(CoverStrokePathInstancedCHROMIUM, isCallValid, context, numPath, pathNameType,
                      paths, pathBase, coverMode, transformType, transformValues);
    }
}

void GL_APIENTRY StencilStrokePathInstancedCHROMIUMContextANGLE(GLeglContext ctx,
                                                                GLsizei numPath,
                                                                GLenum pathNameType,
                                                                const void *paths,
                                                                GLuint pathBase,
                                                                GLint reference,
                                                                GLuint mask,
                                                                GLenum transformType,
                                                                const GLfloat *transformValues)
{
    EVENT("(GLsizei numPath = %d, GLenum pathNameType = 0x%X, const void * paths = 0x%016" PRIxPTR
          ", GLuint pathBase = %u, GLint reference = %d, GLuint mask = %u, GLenum transformType = "
          "0x%X, const GLfloat * transformValues = 0x%016" PRIxPTR ")",
          numPath, pathNameType, (uintptr_t)paths, pathBase, reference, mask, transformType,
          (uintptr_t)transformValues);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateStencilStrokePathInstancedCHROMIUM(
                                              context, numPath, pathNameType, paths, pathBase,
                                              reference, mask, transformType, transformValues));
        if (isCallValid)
        {
            context->stencilStrokePathInstanced(numPath, pathNameType, paths, pathBase, reference,
                                                mask, transformType, transformValues);
        }
        ANGLE_CAPTURE(StencilStrokePathInstancedCHROMIUM, isCallValid, context, numPath,
                      pathNameType, paths, pathBase, reference, mask, transformType,
                      transformValues);
    }
}

void GL_APIENTRY StencilFillPathInstancedCHROMIUMContextANGLE(GLeglContext ctx,
                                                              GLsizei numPaths,
                                                              GLenum pathNameType,
                                                              const void *paths,
                                                              GLuint pathBase,
                                                              GLenum fillMode,
                                                              GLuint mask,
                                                              GLenum transformType,
                                                              const GLfloat *transformValues)
{
    EVENT("(GLsizei numPaths = %d, GLenum pathNameType = 0x%X, const void * paths = 0x%016" PRIxPTR
          ", GLuint pathBase = %u, GLenum fillMode = 0x%X, GLuint mask = %u, GLenum transformType "
          "= 0x%X, const GLfloat * transformValues = 0x%016" PRIxPTR ")",
          numPaths, pathNameType, (uintptr_t)paths, pathBase, fillMode, mask, transformType,
          (uintptr_t)transformValues);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateStencilFillPathInstancedCHROMIUM(
                                              context, numPaths, pathNameType, paths, pathBase,
                                              fillMode, mask, transformType, transformValues));
        if (isCallValid)
        {
            context->stencilFillPathInstanced(numPaths, pathNameType, paths, pathBase, fillMode,
                                              mask, transformType, transformValues);
        }
        ANGLE_CAPTURE(StencilFillPathInstancedCHROMIUM, isCallValid, context, numPaths,
                      pathNameType, paths, pathBase, fillMode, mask, transformType,
                      transformValues);
    }
}

void GL_APIENTRY
StencilThenCoverFillPathInstancedCHROMIUMContextANGLE(GLeglContext ctx,
                                                      GLsizei numPaths,
                                                      GLenum pathNameType,
                                                      const void *paths,
                                                      GLuint pathBase,
                                                      GLenum fillMode,
                                                      GLuint mask,
                                                      GLenum coverMode,
                                                      GLenum transformType,
                                                      const GLfloat *transformValues)
{
    EVENT("(GLsizei numPaths = %d, GLenum pathNameType = 0x%X, const void * paths = 0x%016" PRIxPTR
          ", GLuint pathBase = %u, GLenum fillMode = 0x%X, GLuint mask = %u, GLenum coverMode = "
          "0x%X, GLenum transformType = 0x%X, const GLfloat * transformValues = 0x%016" PRIxPTR ")",
          numPaths, pathNameType, (uintptr_t)paths, pathBase, fillMode, mask, coverMode,
          transformType, (uintptr_t)transformValues);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateStencilThenCoverFillPathInstancedCHROMIUM(
                                context, numPaths, pathNameType, paths, pathBase, fillMode, mask,
                                coverMode, transformType, transformValues));
        if (isCallValid)
        {
            context->stencilThenCoverFillPathInstanced(numPaths, pathNameType, paths, pathBase,
                                                       fillMode, mask, coverMode, transformType,
                                                       transformValues);
        }
        ANGLE_CAPTURE(StencilThenCoverFillPathInstancedCHROMIUM, isCallValid, context, numPaths,
                      pathNameType, paths, pathBase, fillMode, mask, coverMode, transformType,
                      transformValues);
    }
}

void GL_APIENTRY
StencilThenCoverStrokePathInstancedCHROMIUMContextANGLE(GLeglContext ctx,
                                                        GLsizei numPaths,
                                                        GLenum pathNameType,
                                                        const void *paths,
                                                        GLuint pathBase,
                                                        GLint reference,
                                                        GLuint mask,
                                                        GLenum coverMode,
                                                        GLenum transformType,
                                                        const GLfloat *transformValues)
{
    EVENT("(GLsizei numPaths = %d, GLenum pathNameType = 0x%X, const void * paths = 0x%016" PRIxPTR
          ", GLuint pathBase = %u, GLint reference = %d, GLuint mask = %u, GLenum coverMode = "
          "0x%X, GLenum transformType = 0x%X, const GLfloat * transformValues = 0x%016" PRIxPTR ")",
          numPaths, pathNameType, (uintptr_t)paths, pathBase, reference, mask, coverMode,
          transformType, (uintptr_t)transformValues);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateStencilThenCoverStrokePathInstancedCHROMIUM(
                                context, numPaths, pathNameType, paths, pathBase, reference, mask,
                                coverMode, transformType, transformValues));
        if (isCallValid)
        {
            context->stencilThenCoverStrokePathInstanced(numPaths, pathNameType, paths, pathBase,
                                                         reference, mask, coverMode, transformType,
                                                         transformValues);
        }
        ANGLE_CAPTURE(StencilThenCoverStrokePathInstancedCHROMIUM, isCallValid, context, numPaths,
                      pathNameType, paths, pathBase, reference, mask, coverMode, transformType,
                      transformValues);
    }
}

void GL_APIENTRY BindFragmentInputLocationCHROMIUMContextANGLE(GLeglContext ctx,
                                                               GLuint programs,
                                                               GLint location,
                                                               const GLchar *name)
{
    EVENT("(GLuint programs = %u, GLint location = %d, const GLchar * name = 0x%016" PRIxPTR ")",
          programs, location, (uintptr_t)name);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateBindFragmentInputLocationCHROMIUM(
                                                             context, programs, location, name));
        if (isCallValid)
        {
            context->bindFragmentInputLocation(programs, location, name);
        }
        ANGLE_CAPTURE(BindFragmentInputLocationCHROMIUM, isCallValid, context, programs, location,
                      name);
    }
}

void GL_APIENTRY ProgramPathFragmentInputGenCHROMIUMContextANGLE(GLeglContext ctx,
                                                                 GLuint program,
                                                                 GLint location,
                                                                 GLenum genMode,
                                                                 GLint components,
                                                                 const GLfloat *coeffs)
{
    EVENT(
        "(GLuint program = %u, GLint location = %d, GLenum genMode = 0x%X, GLint components = %d, "
        "const GLfloat * coeffs = 0x%016" PRIxPTR ")",
        program, location, genMode, components, (uintptr_t)coeffs);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateProgramPathFragmentInputGenCHROMIUM(
                                context, program, location, genMode, components, coeffs));
        if (isCallValid)
        {
            context->programPathFragmentInputGen(program, location, genMode, components, coeffs);
        }
        ANGLE_CAPTURE(ProgramPathFragmentInputGenCHROMIUM, isCallValid, context, program, location,
                      genMode, components, coeffs);
    }
}

void GL_APIENTRY CopyTextureCHROMIUMContextANGLE(GLeglContext ctx,
                                                 GLuint sourceId,
                                                 GLint sourceLevel,
                                                 GLenum destTarget,
                                                 GLuint destId,
                                                 GLint destLevel,
                                                 GLint internalFormat,
                                                 GLenum destType,
                                                 GLboolean unpackFlipY,
                                                 GLboolean unpackPremultiplyAlpha,
                                                 GLboolean unpackUnmultiplyAlpha)
{
    EVENT(
        "(GLuint sourceId = %u, GLint sourceLevel = %d, GLenum destTarget = 0x%X, GLuint destId = "
        "%u, GLint destLevel = %d, GLint internalFormat = %d, GLenum destType = 0x%X, GLboolean "
        "unpackFlipY = %u, GLboolean unpackPremultiplyAlpha = %u, GLboolean unpackUnmultiplyAlpha "
        "= %u)",
        sourceId, sourceLevel, destTarget, destId, destLevel, internalFormat, destType, unpackFlipY,
        unpackPremultiplyAlpha, unpackUnmultiplyAlpha);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        TextureTarget destTargetPacked = FromGLenum<TextureTarget>(destTarget);
        bool isCallValid =
            (context->skipValidation() ||
             ValidateCopyTextureCHROMIUM(context, sourceId, sourceLevel, destTargetPacked, destId,
                                         destLevel, internalFormat, destType, unpackFlipY,
                                         unpackPremultiplyAlpha, unpackUnmultiplyAlpha));
        if (isCallValid)
        {
            context->copyTexture(sourceId, sourceLevel, destTargetPacked, destId, destLevel,
                                 internalFormat, destType, unpackFlipY, unpackPremultiplyAlpha,
                                 unpackUnmultiplyAlpha);
        }
        ANGLE_CAPTURE(CopyTextureCHROMIUM, isCallValid, context, sourceId, sourceLevel,
                      destTargetPacked, destId, destLevel, internalFormat, destType, unpackFlipY,
                      unpackPremultiplyAlpha, unpackUnmultiplyAlpha);
    }
}

void GL_APIENTRY CopySubTextureCHROMIUMContextANGLE(GLeglContext ctx,
                                                    GLuint sourceId,
                                                    GLint sourceLevel,
                                                    GLenum destTarget,
                                                    GLuint destId,
                                                    GLint destLevel,
                                                    GLint xoffset,
                                                    GLint yoffset,
                                                    GLint x,
                                                    GLint y,
                                                    GLint width,
                                                    GLint height,
                                                    GLboolean unpackFlipY,
                                                    GLboolean unpackPremultiplyAlpha,
                                                    GLboolean unpackUnmultiplyAlpha)
{
    EVENT(
        "(GLuint sourceId = %u, GLint sourceLevel = %d, GLenum destTarget = 0x%X, GLuint destId = "
        "%u, GLint destLevel = %d, GLint xoffset = %d, GLint yoffset = %d, GLint x = %d, GLint y = "
        "%d, GLint width = %d, GLint height = %d, GLboolean unpackFlipY = %u, GLboolean "
        "unpackPremultiplyAlpha = %u, GLboolean unpackUnmultiplyAlpha = %u)",
        sourceId, sourceLevel, destTarget, destId, destLevel, xoffset, yoffset, x, y, width, height,
        unpackFlipY, unpackPremultiplyAlpha, unpackUnmultiplyAlpha);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        TextureTarget destTargetPacked = FromGLenum<TextureTarget>(destTarget);
        bool isCallValid               = (context->skipValidation() ||
                            ValidateCopySubTextureCHROMIUM(
                                context, sourceId, sourceLevel, destTargetPacked, destId, destLevel,
                                xoffset, yoffset, x, y, width, height, unpackFlipY,
                                unpackPremultiplyAlpha, unpackUnmultiplyAlpha));
        if (isCallValid)
        {
            context->copySubTexture(sourceId, sourceLevel, destTargetPacked, destId, destLevel,
                                    xoffset, yoffset, x, y, width, height, unpackFlipY,
                                    unpackPremultiplyAlpha, unpackUnmultiplyAlpha);
        }
        ANGLE_CAPTURE(CopySubTextureCHROMIUM, isCallValid, context, sourceId, sourceLevel,
                      destTargetPacked, destId, destLevel, xoffset, yoffset, x, y, width, height,
                      unpackFlipY, unpackPremultiplyAlpha, unpackUnmultiplyAlpha);
    }
}

void GL_APIENTRY CompressedCopyTextureCHROMIUMContextANGLE(GLeglContext ctx,
                                                           GLuint sourceId,
                                                           GLuint destId)
{
    EVENT("(GLuint sourceId = %u, GLuint destId = %u)", sourceId, destId);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateCompressedCopyTextureCHROMIUM(context, sourceId, destId));
        if (isCallValid)
        {
            context->compressedCopyTexture(sourceId, destId);
        }
        ANGLE_CAPTURE(CompressedCopyTextureCHROMIUM, isCallValid, context, sourceId, destId);
    }
}

void GL_APIENTRY RequestExtensionANGLEContextANGLE(GLeglContext ctx, const GLchar *name)
{
    EVENT("(const GLchar * name = 0x%016" PRIxPTR ")", (uintptr_t)name);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateRequestExtensionANGLE(context, name));
        if (isCallValid)
        {
            context->requestExtension(name);
        }
        ANGLE_CAPTURE(RequestExtensionANGLE, isCallValid, context, name);
    }
}

void GL_APIENTRY GetBooleanvRobustANGLEContextANGLE(GLeglContext ctx,
                                                    GLenum pname,
                                                    GLsizei bufSize,
                                                    GLsizei *length,
                                                    GLboolean *params)
{
    EVENT("(GLenum pname = 0x%X, GLsizei bufSize = %d, GLsizei * length = 0x%016" PRIxPTR
          ", GLboolean * params = 0x%016" PRIxPTR ")",
          pname, bufSize, (uintptr_t)length, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() ||
             ValidateGetBooleanvRobustANGLE(context, pname, bufSize, length, params));
        if (isCallValid)
        {
            context->getBooleanvRobust(pname, bufSize, length, params);
        }
        ANGLE_CAPTURE(GetBooleanvRobustANGLE, isCallValid, context, pname, bufSize, length, params);
    }
}

void GL_APIENTRY GetBufferParameterivRobustANGLEContextANGLE(GLeglContext ctx,
                                                             GLenum target,
                                                             GLenum pname,
                                                             GLsizei bufSize,
                                                             GLsizei *length,
                                                             GLint *params)
{
    EVENT(
        "(GLenum target = 0x%X, GLenum pname = 0x%X, GLsizei bufSize = %d, GLsizei * length = "
        "0x%016" PRIxPTR ", GLint * params = 0x%016" PRIxPTR ")",
        target, pname, bufSize, (uintptr_t)length, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        BufferBinding targetPacked = FromGLenum<BufferBinding>(target);
        bool isCallValid           = (context->skipValidation() ||
                            ValidateGetBufferParameterivRobustANGLE(context, targetPacked, pname,
                                                                    bufSize, length, params));
        if (isCallValid)
        {
            context->getBufferParameterivRobust(targetPacked, pname, bufSize, length, params);
        }
        ANGLE_CAPTURE(GetBufferParameterivRobustANGLE, isCallValid, context, targetPacked, pname,
                      bufSize, length, params);
    }
}

void GL_APIENTRY GetFloatvRobustANGLEContextANGLE(GLeglContext ctx,
                                                  GLenum pname,
                                                  GLsizei bufSize,
                                                  GLsizei *length,
                                                  GLfloat *params)
{
    EVENT("(GLenum pname = 0x%X, GLsizei bufSize = %d, GLsizei * length = 0x%016" PRIxPTR
          ", GLfloat * params = 0x%016" PRIxPTR ")",
          pname, bufSize, (uintptr_t)length, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateGetFloatvRobustANGLE(context, pname, bufSize, length, params));
        if (isCallValid)
        {
            context->getFloatvRobust(pname, bufSize, length, params);
        }
        ANGLE_CAPTURE(GetFloatvRobustANGLE, isCallValid, context, pname, bufSize, length, params);
    }
}

void GL_APIENTRY GetFramebufferAttachmentParameterivRobustANGLEContextANGLE(GLeglContext ctx,
                                                                            GLenum target,
                                                                            GLenum attachment,
                                                                            GLenum pname,
                                                                            GLsizei bufSize,
                                                                            GLsizei *length,
                                                                            GLint *params)
{
    EVENT(
        "(GLenum target = 0x%X, GLenum attachment = 0x%X, GLenum pname = 0x%X, GLsizei bufSize = "
        "%d, GLsizei * length = 0x%016" PRIxPTR ", GLint * params = 0x%016" PRIxPTR ")",
        target, attachment, pname, bufSize, (uintptr_t)length, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateGetFramebufferAttachmentParameterivRobustANGLE(
                                context, target, attachment, pname, bufSize, length, params));
        if (isCallValid)
        {
            context->getFramebufferAttachmentParameterivRobust(target, attachment, pname, bufSize,
                                                               length, params);
        }
        ANGLE_CAPTURE(GetFramebufferAttachmentParameterivRobustANGLE, isCallValid, context, target,
                      attachment, pname, bufSize, length, params);
    }
}

void GL_APIENTRY GetIntegervRobustANGLEContextANGLE(GLeglContext ctx,
                                                    GLenum pname,
                                                    GLsizei bufSize,
                                                    GLsizei *length,
                                                    GLint *data)
{
    EVENT("(GLenum pname = 0x%X, GLsizei bufSize = %d, GLsizei * length = 0x%016" PRIxPTR
          ", GLint * data = 0x%016" PRIxPTR ")",
          pname, bufSize, (uintptr_t)length, (uintptr_t)data);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateGetIntegervRobustANGLE(context, pname, bufSize, length, data));
        if (isCallValid)
        {
            context->getIntegervRobust(pname, bufSize, length, data);
        }
        ANGLE_CAPTURE(GetIntegervRobustANGLE, isCallValid, context, pname, bufSize, length, data);
    }
}

void GL_APIENTRY GetProgramivRobustANGLEContextANGLE(GLeglContext ctx,
                                                     GLuint program,
                                                     GLenum pname,
                                                     GLsizei bufSize,
                                                     GLsizei *length,
                                                     GLint *params)
{
    EVENT(
        "(GLuint program = %u, GLenum pname = 0x%X, GLsizei bufSize = %d, GLsizei * length = "
        "0x%016" PRIxPTR ", GLint * params = 0x%016" PRIxPTR ")",
        program, pname, bufSize, (uintptr_t)length, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() ||
             ValidateGetProgramivRobustANGLE(context, program, pname, bufSize, length, params));
        if (isCallValid)
        {
            context->getProgramivRobust(program, pname, bufSize, length, params);
        }
        ANGLE_CAPTURE(GetProgramivRobustANGLE, isCallValid, context, program, pname, bufSize,
                      length, params);
    }
}

void GL_APIENTRY GetRenderbufferParameterivRobustANGLEContextANGLE(GLeglContext ctx,
                                                                   GLenum target,
                                                                   GLenum pname,
                                                                   GLsizei bufSize,
                                                                   GLsizei *length,
                                                                   GLint *params)
{
    EVENT(
        "(GLenum target = 0x%X, GLenum pname = 0x%X, GLsizei bufSize = %d, GLsizei * length = "
        "0x%016" PRIxPTR ", GLint * params = 0x%016" PRIxPTR ")",
        target, pname, bufSize, (uintptr_t)length, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateGetRenderbufferParameterivRobustANGLE(
                                              context, target, pname, bufSize, length, params));
        if (isCallValid)
        {
            context->getRenderbufferParameterivRobust(target, pname, bufSize, length, params);
        }
        ANGLE_CAPTURE(GetRenderbufferParameterivRobustANGLE, isCallValid, context, target, pname,
                      bufSize, length, params);
    }
}

void GL_APIENTRY GetShaderivRobustANGLEContextANGLE(GLeglContext ctx,
                                                    GLuint shader,
                                                    GLenum pname,
                                                    GLsizei bufSize,
                                                    GLsizei *length,
                                                    GLint *params)
{
    EVENT(
        "(GLuint shader = %u, GLenum pname = 0x%X, GLsizei bufSize = %d, GLsizei * length = "
        "0x%016" PRIxPTR ", GLint * params = 0x%016" PRIxPTR ")",
        shader, pname, bufSize, (uintptr_t)length, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() ||
             ValidateGetShaderivRobustANGLE(context, shader, pname, bufSize, length, params));
        if (isCallValid)
        {
            context->getShaderivRobust(shader, pname, bufSize, length, params);
        }
        ANGLE_CAPTURE(GetShaderivRobustANGLE, isCallValid, context, shader, pname, bufSize, length,
                      params);
    }
}

void GL_APIENTRY GetTexParameterfvRobustANGLEContextANGLE(GLeglContext ctx,
                                                          GLenum target,
                                                          GLenum pname,
                                                          GLsizei bufSize,
                                                          GLsizei *length,
                                                          GLfloat *params)
{
    EVENT(
        "(GLenum target = 0x%X, GLenum pname = 0x%X, GLsizei bufSize = %d, GLsizei * length = "
        "0x%016" PRIxPTR ", GLfloat * params = 0x%016" PRIxPTR ")",
        target, pname, bufSize, (uintptr_t)length, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        TextureType targetPacked = FromGLenum<TextureType>(target);
        bool isCallValid         = (context->skipValidation() ||
                            ValidateGetTexParameterfvRobustANGLE(context, targetPacked, pname,
                                                                 bufSize, length, params));
        if (isCallValid)
        {
            context->getTexParameterfvRobust(targetPacked, pname, bufSize, length, params);
        }
        ANGLE_CAPTURE(GetTexParameterfvRobustANGLE, isCallValid, context, targetPacked, pname,
                      bufSize, length, params);
    }
}

void GL_APIENTRY GetTexParameterivRobustANGLEContextANGLE(GLeglContext ctx,
                                                          GLenum target,
                                                          GLenum pname,
                                                          GLsizei bufSize,
                                                          GLsizei *length,
                                                          GLint *params)
{
    EVENT(
        "(GLenum target = 0x%X, GLenum pname = 0x%X, GLsizei bufSize = %d, GLsizei * length = "
        "0x%016" PRIxPTR ", GLint * params = 0x%016" PRIxPTR ")",
        target, pname, bufSize, (uintptr_t)length, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        TextureType targetPacked = FromGLenum<TextureType>(target);
        bool isCallValid         = (context->skipValidation() ||
                            ValidateGetTexParameterivRobustANGLE(context, targetPacked, pname,
                                                                 bufSize, length, params));
        if (isCallValid)
        {
            context->getTexParameterivRobust(targetPacked, pname, bufSize, length, params);
        }
        ANGLE_CAPTURE(GetTexParameterivRobustANGLE, isCallValid, context, targetPacked, pname,
                      bufSize, length, params);
    }
}

void GL_APIENTRY GetUniformfvRobustANGLEContextANGLE(GLeglContext ctx,
                                                     GLuint program,
                                                     GLint location,
                                                     GLsizei bufSize,
                                                     GLsizei *length,
                                                     GLfloat *params)
{
    EVENT(
        "(GLuint program = %u, GLint location = %d, GLsizei bufSize = %d, GLsizei * length = "
        "0x%016" PRIxPTR ", GLfloat * params = 0x%016" PRIxPTR ")",
        program, location, bufSize, (uintptr_t)length, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() ||
             ValidateGetUniformfvRobustANGLE(context, program, location, bufSize, length, params));
        if (isCallValid)
        {
            context->getUniformfvRobust(program, location, bufSize, length, params);
        }
        ANGLE_CAPTURE(GetUniformfvRobustANGLE, isCallValid, context, program, location, bufSize,
                      length, params);
    }
}

void GL_APIENTRY GetUniformivRobustANGLEContextANGLE(GLeglContext ctx,
                                                     GLuint program,
                                                     GLint location,
                                                     GLsizei bufSize,
                                                     GLsizei *length,
                                                     GLint *params)
{
    EVENT(
        "(GLuint program = %u, GLint location = %d, GLsizei bufSize = %d, GLsizei * length = "
        "0x%016" PRIxPTR ", GLint * params = 0x%016" PRIxPTR ")",
        program, location, bufSize, (uintptr_t)length, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() ||
             ValidateGetUniformivRobustANGLE(context, program, location, bufSize, length, params));
        if (isCallValid)
        {
            context->getUniformivRobust(program, location, bufSize, length, params);
        }
        ANGLE_CAPTURE(GetUniformivRobustANGLE, isCallValid, context, program, location, bufSize,
                      length, params);
    }
}

void GL_APIENTRY GetVertexAttribfvRobustANGLEContextANGLE(GLeglContext ctx,
                                                          GLuint index,
                                                          GLenum pname,
                                                          GLsizei bufSize,
                                                          GLsizei *length,
                                                          GLfloat *params)
{
    EVENT(
        "(GLuint index = %u, GLenum pname = 0x%X, GLsizei bufSize = %d, GLsizei * length = "
        "0x%016" PRIxPTR ", GLfloat * params = 0x%016" PRIxPTR ")",
        index, pname, bufSize, (uintptr_t)length, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() ||
             ValidateGetVertexAttribfvRobustANGLE(context, index, pname, bufSize, length, params));
        if (isCallValid)
        {
            context->getVertexAttribfvRobust(index, pname, bufSize, length, params);
        }
        ANGLE_CAPTURE(GetVertexAttribfvRobustANGLE, isCallValid, context, index, pname, bufSize,
                      length, params);
    }
}

void GL_APIENTRY GetVertexAttribivRobustANGLEContextANGLE(GLeglContext ctx,
                                                          GLuint index,
                                                          GLenum pname,
                                                          GLsizei bufSize,
                                                          GLsizei *length,
                                                          GLint *params)
{
    EVENT(
        "(GLuint index = %u, GLenum pname = 0x%X, GLsizei bufSize = %d, GLsizei * length = "
        "0x%016" PRIxPTR ", GLint * params = 0x%016" PRIxPTR ")",
        index, pname, bufSize, (uintptr_t)length, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() ||
             ValidateGetVertexAttribivRobustANGLE(context, index, pname, bufSize, length, params));
        if (isCallValid)
        {
            context->getVertexAttribivRobust(index, pname, bufSize, length, params);
        }
        ANGLE_CAPTURE(GetVertexAttribivRobustANGLE, isCallValid, context, index, pname, bufSize,
                      length, params);
    }
}

void GL_APIENTRY GetVertexAttribPointervRobustANGLEContextANGLE(GLeglContext ctx,
                                                                GLuint index,
                                                                GLenum pname,
                                                                GLsizei bufSize,
                                                                GLsizei *length,
                                                                void **pointer)
{
    EVENT(
        "(GLuint index = %u, GLenum pname = 0x%X, GLsizei bufSize = %d, GLsizei * length = "
        "0x%016" PRIxPTR ", void ** pointer = 0x%016" PRIxPTR ")",
        index, pname, bufSize, (uintptr_t)length, (uintptr_t)pointer);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateGetVertexAttribPointervRobustANGLE(
                                              context, index, pname, bufSize, length, pointer));
        if (isCallValid)
        {
            context->getVertexAttribPointervRobust(index, pname, bufSize, length, pointer);
        }
        ANGLE_CAPTURE(GetVertexAttribPointervRobustANGLE, isCallValid, context, index, pname,
                      bufSize, length, pointer);
    }
}

void GL_APIENTRY ReadPixelsRobustANGLEContextANGLE(GLeglContext ctx,
                                                   GLint x,
                                                   GLint y,
                                                   GLsizei width,
                                                   GLsizei height,
                                                   GLenum format,
                                                   GLenum type,
                                                   GLsizei bufSize,
                                                   GLsizei *length,
                                                   GLsizei *columns,
                                                   GLsizei *rows,
                                                   void *pixels)
{
    EVENT(
        "(GLint x = %d, GLint y = %d, GLsizei width = %d, GLsizei height = %d, GLenum format = "
        "0x%X, GLenum type = 0x%X, GLsizei bufSize = %d, GLsizei * length = 0x%016" PRIxPTR
        ", GLsizei * columns = 0x%016" PRIxPTR ", GLsizei * rows = 0x%016" PRIxPTR
        ", void * pixels = 0x%016" PRIxPTR ")",
        x, y, width, height, format, type, bufSize, (uintptr_t)length, (uintptr_t)columns,
        (uintptr_t)rows, (uintptr_t)pixels);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() ||
             ValidateReadPixelsRobustANGLE(context, x, y, width, height, format, type, bufSize,
                                           length, columns, rows, pixels));
        if (isCallValid)
        {
            context->readPixelsRobust(x, y, width, height, format, type, bufSize, length, columns,
                                      rows, pixels);
        }
        ANGLE_CAPTURE(ReadPixelsRobustANGLE, isCallValid, context, x, y, width, height, format,
                      type, bufSize, length, columns, rows, pixels);
    }
}

void GL_APIENTRY TexImage2DRobustANGLEContextANGLE(GLeglContext ctx,
                                                   GLenum target,
                                                   GLint level,
                                                   GLint internalformat,
                                                   GLsizei width,
                                                   GLsizei height,
                                                   GLint border,
                                                   GLenum format,
                                                   GLenum type,
                                                   GLsizei bufSize,
                                                   const void *pixels)
{
    EVENT(
        "(GLenum target = 0x%X, GLint level = %d, GLint internalformat = %d, GLsizei width = %d, "
        "GLsizei height = %d, GLint border = %d, GLenum format = 0x%X, GLenum type = 0x%X, GLsizei "
        "bufSize = %d, const void * pixels = 0x%016" PRIxPTR ")",
        target, level, internalformat, width, height, border, format, type, bufSize,
        (uintptr_t)pixels);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        TextureTarget targetPacked = FromGLenum<TextureTarget>(target);
        bool isCallValid =
            (context->skipValidation() ||
             ValidateTexImage2DRobustANGLE(context, targetPacked, level, internalformat, width,
                                           height, border, format, type, bufSize, pixels));
        if (isCallValid)
        {
            context->texImage2DRobust(targetPacked, level, internalformat, width, height, border,
                                      format, type, bufSize, pixels);
        }
        ANGLE_CAPTURE(TexImage2DRobustANGLE, isCallValid, context, targetPacked, level,
                      internalformat, width, height, border, format, type, bufSize, pixels);
    }
}

void GL_APIENTRY TexParameterfvRobustANGLEContextANGLE(GLeglContext ctx,
                                                       GLenum target,
                                                       GLenum pname,
                                                       GLsizei bufSize,
                                                       const GLfloat *params)
{
    EVENT(
        "(GLenum target = 0x%X, GLenum pname = 0x%X, GLsizei bufSize = %d, const GLfloat * params "
        "= 0x%016" PRIxPTR ")",
        target, pname, bufSize, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        TextureType targetPacked = FromGLenum<TextureType>(target);
        bool isCallValid =
            (context->skipValidation() ||
             ValidateTexParameterfvRobustANGLE(context, targetPacked, pname, bufSize, params));
        if (isCallValid)
        {
            context->texParameterfvRobust(targetPacked, pname, bufSize, params);
        }
        ANGLE_CAPTURE(TexParameterfvRobustANGLE, isCallValid, context, targetPacked, pname, bufSize,
                      params);
    }
}

void GL_APIENTRY TexParameterivRobustANGLEContextANGLE(GLeglContext ctx,
                                                       GLenum target,
                                                       GLenum pname,
                                                       GLsizei bufSize,
                                                       const GLint *params)
{
    EVENT(
        "(GLenum target = 0x%X, GLenum pname = 0x%X, GLsizei bufSize = %d, const GLint * params = "
        "0x%016" PRIxPTR ")",
        target, pname, bufSize, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        TextureType targetPacked = FromGLenum<TextureType>(target);
        bool isCallValid =
            (context->skipValidation() ||
             ValidateTexParameterivRobustANGLE(context, targetPacked, pname, bufSize, params));
        if (isCallValid)
        {
            context->texParameterivRobust(targetPacked, pname, bufSize, params);
        }
        ANGLE_CAPTURE(TexParameterivRobustANGLE, isCallValid, context, targetPacked, pname, bufSize,
                      params);
    }
}

void GL_APIENTRY TexSubImage2DRobustANGLEContextANGLE(GLeglContext ctx,
                                                      GLenum target,
                                                      GLint level,
                                                      GLint xoffset,
                                                      GLint yoffset,
                                                      GLsizei width,
                                                      GLsizei height,
                                                      GLenum format,
                                                      GLenum type,
                                                      GLsizei bufSize,
                                                      const void *pixels)
{
    EVENT(
        "(GLenum target = 0x%X, GLint level = %d, GLint xoffset = %d, GLint yoffset = %d, GLsizei "
        "width = %d, GLsizei height = %d, GLenum format = 0x%X, GLenum type = 0x%X, GLsizei "
        "bufSize = %d, const void * pixels = 0x%016" PRIxPTR ")",
        target, level, xoffset, yoffset, width, height, format, type, bufSize, (uintptr_t)pixels);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        TextureTarget targetPacked = FromGLenum<TextureTarget>(target);
        bool isCallValid =
            (context->skipValidation() ||
             ValidateTexSubImage2DRobustANGLE(context, targetPacked, level, xoffset, yoffset, width,
                                              height, format, type, bufSize, pixels));
        if (isCallValid)
        {
            context->texSubImage2DRobust(targetPacked, level, xoffset, yoffset, width, height,
                                         format, type, bufSize, pixels);
        }
        ANGLE_CAPTURE(TexSubImage2DRobustANGLE, isCallValid, context, targetPacked, level, xoffset,
                      yoffset, width, height, format, type, bufSize, pixels);
    }
}

void GL_APIENTRY TexImage3DRobustANGLEContextANGLE(GLeglContext ctx,
                                                   GLenum target,
                                                   GLint level,
                                                   GLint internalformat,
                                                   GLsizei width,
                                                   GLsizei height,
                                                   GLsizei depth,
                                                   GLint border,
                                                   GLenum format,
                                                   GLenum type,
                                                   GLsizei bufSize,
                                                   const void *pixels)
{
    EVENT(
        "(GLenum target = 0x%X, GLint level = %d, GLint internalformat = %d, GLsizei width = %d, "
        "GLsizei height = %d, GLsizei depth = %d, GLint border = %d, GLenum format = 0x%X, GLenum "
        "type = 0x%X, GLsizei bufSize = %d, const void * pixels = 0x%016" PRIxPTR ")",
        target, level, internalformat, width, height, depth, border, format, type, bufSize,
        (uintptr_t)pixels);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        TextureTarget targetPacked = FromGLenum<TextureTarget>(target);
        bool isCallValid =
            (context->skipValidation() ||
             ValidateTexImage3DRobustANGLE(context, targetPacked, level, internalformat, width,
                                           height, depth, border, format, type, bufSize, pixels));
        if (isCallValid)
        {
            context->texImage3DRobust(targetPacked, level, internalformat, width, height, depth,
                                      border, format, type, bufSize, pixels);
        }
        ANGLE_CAPTURE(TexImage3DRobustANGLE, isCallValid, context, targetPacked, level,
                      internalformat, width, height, depth, border, format, type, bufSize, pixels);
    }
}

void GL_APIENTRY TexSubImage3DRobustANGLEContextANGLE(GLeglContext ctx,
                                                      GLenum target,
                                                      GLint level,
                                                      GLint xoffset,
                                                      GLint yoffset,
                                                      GLint zoffset,
                                                      GLsizei width,
                                                      GLsizei height,
                                                      GLsizei depth,
                                                      GLenum format,
                                                      GLenum type,
                                                      GLsizei bufSize,
                                                      const void *pixels)
{
    EVENT(
        "(GLenum target = 0x%X, GLint level = %d, GLint xoffset = %d, GLint yoffset = %d, GLint "
        "zoffset = %d, GLsizei width = %d, GLsizei height = %d, GLsizei depth = %d, GLenum format "
        "= 0x%X, GLenum type = 0x%X, GLsizei bufSize = %d, const void * pixels = 0x%016" PRIxPTR
        ")",
        target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, bufSize,
        (uintptr_t)pixels);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        TextureTarget targetPacked = FromGLenum<TextureTarget>(target);
        bool isCallValid           = (context->skipValidation() ||
                            ValidateTexSubImage3DRobustANGLE(context, targetPacked, level, xoffset,
                                                             yoffset, zoffset, width, height, depth,
                                                             format, type, bufSize, pixels));
        if (isCallValid)
        {
            context->texSubImage3DRobust(targetPacked, level, xoffset, yoffset, zoffset, width,
                                         height, depth, format, type, bufSize, pixels);
        }
        ANGLE_CAPTURE(TexSubImage3DRobustANGLE, isCallValid, context, targetPacked, level, xoffset,
                      yoffset, zoffset, width, height, depth, format, type, bufSize, pixels);
    }
}

void GL_APIENTRY CompressedTexImage2DRobustANGLEContextANGLE(GLeglContext ctx,
                                                             GLenum target,
                                                             GLint level,
                                                             GLenum internalformat,
                                                             GLsizei width,
                                                             GLsizei height,
                                                             GLint border,
                                                             GLsizei imageSize,
                                                             GLsizei dataSize,
                                                             const GLvoid *data)
{
    EVENT(
        "(GLenum target = 0x%X, GLint level = %d, GLenum internalformat = 0x%X, GLsizei width = "
        "%d, GLsizei height = %d, GLint border = %d, GLsizei imageSize = %d, GLsizei dataSize = "
        "%d, const GLvoid * data = 0x%016" PRIxPTR ")",
        target, level, internalformat, width, height, border, imageSize, dataSize, (uintptr_t)data);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        TextureTarget targetPacked = FromGLenum<TextureTarget>(target);
        bool isCallValid =
            (context->skipValidation() || ValidateCompressedTexImage2DRobustANGLE(
                                              context, targetPacked, level, internalformat, width,
                                              height, border, imageSize, dataSize, data));
        if (isCallValid)
        {
            context->compressedTexImage2DRobust(targetPacked, level, internalformat, width, height,
                                                border, imageSize, dataSize, data);
        }
        ANGLE_CAPTURE(CompressedTexImage2DRobustANGLE, isCallValid, context, targetPacked, level,
                      internalformat, width, height, border, imageSize, dataSize, data);
    }
}

void GL_APIENTRY CompressedTexSubImage2DRobustANGLEContextANGLE(GLeglContext ctx,
                                                                GLenum target,
                                                                GLint level,
                                                                GLsizei xoffset,
                                                                GLsizei yoffset,
                                                                GLsizei width,
                                                                GLsizei height,
                                                                GLenum format,
                                                                GLsizei imageSize,
                                                                GLsizei dataSize,
                                                                const GLvoid *data)
{
    EVENT(
        "(GLenum target = 0x%X, GLint level = %d, GLsizei xoffset = %d, GLsizei yoffset = %d, "
        "GLsizei width = %d, GLsizei height = %d, GLenum format = 0x%X, GLsizei imageSize = %d, "
        "GLsizei dataSize = %d, const GLvoid * data = 0x%016" PRIxPTR ")",
        target, level, xoffset, yoffset, width, height, format, imageSize, dataSize,
        (uintptr_t)data);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        TextureTarget targetPacked = FromGLenum<TextureTarget>(target);
        bool isCallValid =
            (context->skipValidation() || ValidateCompressedTexSubImage2DRobustANGLE(
                                              context, targetPacked, level, xoffset, yoffset, width,
                                              height, format, imageSize, dataSize, data));
        if (isCallValid)
        {
            context->compressedTexSubImage2DRobust(targetPacked, level, xoffset, yoffset, width,
                                                   height, format, imageSize, dataSize, data);
        }
        ANGLE_CAPTURE(CompressedTexSubImage2DRobustANGLE, isCallValid, context, targetPacked, level,
                      xoffset, yoffset, width, height, format, imageSize, dataSize, data);
    }
}

void GL_APIENTRY CompressedTexImage3DRobustANGLEContextANGLE(GLeglContext ctx,
                                                             GLenum target,
                                                             GLint level,
                                                             GLenum internalformat,
                                                             GLsizei width,
                                                             GLsizei height,
                                                             GLsizei depth,
                                                             GLint border,
                                                             GLsizei imageSize,
                                                             GLsizei dataSize,
                                                             const GLvoid *data)
{
    EVENT(
        "(GLenum target = 0x%X, GLint level = %d, GLenum internalformat = 0x%X, GLsizei width = "
        "%d, GLsizei height = %d, GLsizei depth = %d, GLint border = %d, GLsizei imageSize = %d, "
        "GLsizei dataSize = %d, const GLvoid * data = 0x%016" PRIxPTR ")",
        target, level, internalformat, width, height, depth, border, imageSize, dataSize,
        (uintptr_t)data);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        TextureTarget targetPacked = FromGLenum<TextureTarget>(target);
        bool isCallValid =
            (context->skipValidation() || ValidateCompressedTexImage3DRobustANGLE(
                                              context, targetPacked, level, internalformat, width,
                                              height, depth, border, imageSize, dataSize, data));
        if (isCallValid)
        {
            context->compressedTexImage3DRobust(targetPacked, level, internalformat, width, height,
                                                depth, border, imageSize, dataSize, data);
        }
        ANGLE_CAPTURE(CompressedTexImage3DRobustANGLE, isCallValid, context, targetPacked, level,
                      internalformat, width, height, depth, border, imageSize, dataSize, data);
    }
}

void GL_APIENTRY CompressedTexSubImage3DRobustANGLEContextANGLE(GLeglContext ctx,
                                                                GLenum target,
                                                                GLint level,
                                                                GLint xoffset,
                                                                GLint yoffset,
                                                                GLint zoffset,
                                                                GLsizei width,
                                                                GLsizei height,
                                                                GLsizei depth,
                                                                GLenum format,
                                                                GLsizei imageSize,
                                                                GLsizei dataSize,
                                                                const GLvoid *data)
{
    EVENT(
        "(GLenum target = 0x%X, GLint level = %d, GLint xoffset = %d, GLint yoffset = %d, GLint "
        "zoffset = %d, GLsizei width = %d, GLsizei height = %d, GLsizei depth = %d, GLenum format "
        "= 0x%X, GLsizei imageSize = %d, GLsizei dataSize = %d, const GLvoid * data = "
        "0x%016" PRIxPTR ")",
        target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, dataSize,
        (uintptr_t)data);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        TextureTarget targetPacked = FromGLenum<TextureTarget>(target);
        bool isCallValid           = (context->skipValidation() ||
                            ValidateCompressedTexSubImage3DRobustANGLE(
                                context, targetPacked, level, xoffset, yoffset, zoffset, width,
                                height, depth, format, imageSize, dataSize, data));
        if (isCallValid)
        {
            context->compressedTexSubImage3DRobust(targetPacked, level, xoffset, yoffset, zoffset,
                                                   width, height, depth, format, imageSize,
                                                   dataSize, data);
        }
        ANGLE_CAPTURE(CompressedTexSubImage3DRobustANGLE, isCallValid, context, targetPacked, level,
                      xoffset, yoffset, zoffset, width, height, depth, format, imageSize, dataSize,
                      data);
    }
}

void GL_APIENTRY GetQueryivRobustANGLEContextANGLE(GLeglContext ctx,
                                                   GLenum target,
                                                   GLenum pname,
                                                   GLsizei bufSize,
                                                   GLsizei *length,
                                                   GLint *params)
{
    EVENT(
        "(GLenum target = 0x%X, GLenum pname = 0x%X, GLsizei bufSize = %d, GLsizei * length = "
        "0x%016" PRIxPTR ", GLint * params = 0x%016" PRIxPTR ")",
        target, pname, bufSize, (uintptr_t)length, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        QueryType targetPacked = FromGLenum<QueryType>(target);
        bool isCallValid =
            (context->skipValidation() ||
             ValidateGetQueryivRobustANGLE(context, targetPacked, pname, bufSize, length, params));
        if (isCallValid)
        {
            context->getQueryivRobust(targetPacked, pname, bufSize, length, params);
        }
        ANGLE_CAPTURE(GetQueryivRobustANGLE, isCallValid, context, targetPacked, pname, bufSize,
                      length, params);
    }
}

void GL_APIENTRY GetQueryObjectuivRobustANGLEContextANGLE(GLeglContext ctx,
                                                          GLuint id,
                                                          GLenum pname,
                                                          GLsizei bufSize,
                                                          GLsizei *length,
                                                          GLuint *params)
{
    EVENT(
        "(GLuint id = %u, GLenum pname = 0x%X, GLsizei bufSize = %d, GLsizei * length = "
        "0x%016" PRIxPTR ", GLuint * params = 0x%016" PRIxPTR ")",
        id, pname, bufSize, (uintptr_t)length, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() ||
             ValidateGetQueryObjectuivRobustANGLE(context, id, pname, bufSize, length, params));
        if (isCallValid)
        {
            context->getQueryObjectuivRobust(id, pname, bufSize, length, params);
        }
        ANGLE_CAPTURE(GetQueryObjectuivRobustANGLE, isCallValid, context, id, pname, bufSize,
                      length, params);
    }
}

void GL_APIENTRY GetBufferPointervRobustANGLEContextANGLE(GLeglContext ctx,
                                                          GLenum target,
                                                          GLenum pname,
                                                          GLsizei bufSize,
                                                          GLsizei *length,
                                                          void **params)
{
    EVENT(
        "(GLenum target = 0x%X, GLenum pname = 0x%X, GLsizei bufSize = %d, GLsizei * length = "
        "0x%016" PRIxPTR ", void ** params = 0x%016" PRIxPTR ")",
        target, pname, bufSize, (uintptr_t)length, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        BufferBinding targetPacked = FromGLenum<BufferBinding>(target);
        bool isCallValid           = (context->skipValidation() ||
                            ValidateGetBufferPointervRobustANGLE(context, targetPacked, pname,
                                                                 bufSize, length, params));
        if (isCallValid)
        {
            context->getBufferPointervRobust(targetPacked, pname, bufSize, length, params);
        }
        ANGLE_CAPTURE(GetBufferPointervRobustANGLE, isCallValid, context, targetPacked, pname,
                      bufSize, length, params);
    }
}

void GL_APIENTRY GetIntegeri_vRobustANGLEContextANGLE(GLeglContext ctx,
                                                      GLenum target,
                                                      GLuint index,
                                                      GLsizei bufSize,
                                                      GLsizei *length,
                                                      GLint *data)
{
    EVENT(
        "(GLenum target = 0x%X, GLuint index = %u, GLsizei bufSize = %d, GLsizei * length = "
        "0x%016" PRIxPTR ", GLint * data = 0x%016" PRIxPTR ")",
        target, index, bufSize, (uintptr_t)length, (uintptr_t)data);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() ||
             ValidateGetIntegeri_vRobustANGLE(context, target, index, bufSize, length, data));
        if (isCallValid)
        {
            context->getIntegeri_vRobust(target, index, bufSize, length, data);
        }
        ANGLE_CAPTURE(GetIntegeri_vRobustANGLE, isCallValid, context, target, index, bufSize,
                      length, data);
    }
}

void GL_APIENTRY GetInternalformativRobustANGLEContextANGLE(GLeglContext ctx,
                                                            GLenum target,
                                                            GLenum internalformat,
                                                            GLenum pname,
                                                            GLsizei bufSize,
                                                            GLsizei *length,
                                                            GLint *params)
{
    EVENT(
        "(GLenum target = 0x%X, GLenum internalformat = 0x%X, GLenum pname = 0x%X, GLsizei bufSize "
        "= %d, GLsizei * length = 0x%016" PRIxPTR ", GLint * params = 0x%016" PRIxPTR ")",
        target, internalformat, pname, bufSize, (uintptr_t)length, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateGetInternalformativRobustANGLE(context, target, internalformat,
                                                                   pname, bufSize, length, params));
        if (isCallValid)
        {
            context->getInternalformativRobust(target, internalformat, pname, bufSize, length,
                                               params);
        }
        ANGLE_CAPTURE(GetInternalformativRobustANGLE, isCallValid, context, target, internalformat,
                      pname, bufSize, length, params);
    }
}

void GL_APIENTRY GetVertexAttribIivRobustANGLEContextANGLE(GLeglContext ctx,
                                                           GLuint index,
                                                           GLenum pname,
                                                           GLsizei bufSize,
                                                           GLsizei *length,
                                                           GLint *params)
{
    EVENT(
        "(GLuint index = %u, GLenum pname = 0x%X, GLsizei bufSize = %d, GLsizei * length = "
        "0x%016" PRIxPTR ", GLint * params = 0x%016" PRIxPTR ")",
        index, pname, bufSize, (uintptr_t)length, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() ||
             ValidateGetVertexAttribIivRobustANGLE(context, index, pname, bufSize, length, params));
        if (isCallValid)
        {
            context->getVertexAttribIivRobust(index, pname, bufSize, length, params);
        }
        ANGLE_CAPTURE(GetVertexAttribIivRobustANGLE, isCallValid, context, index, pname, bufSize,
                      length, params);
    }
}

void GL_APIENTRY GetVertexAttribIuivRobustANGLEContextANGLE(GLeglContext ctx,
                                                            GLuint index,
                                                            GLenum pname,
                                                            GLsizei bufSize,
                                                            GLsizei *length,
                                                            GLuint *params)
{
    EVENT(
        "(GLuint index = %u, GLenum pname = 0x%X, GLsizei bufSize = %d, GLsizei * length = "
        "0x%016" PRIxPTR ", GLuint * params = 0x%016" PRIxPTR ")",
        index, pname, bufSize, (uintptr_t)length, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateGetVertexAttribIuivRobustANGLE(
                                              context, index, pname, bufSize, length, params));
        if (isCallValid)
        {
            context->getVertexAttribIuivRobust(index, pname, bufSize, length, params);
        }
        ANGLE_CAPTURE(GetVertexAttribIuivRobustANGLE, isCallValid, context, index, pname, bufSize,
                      length, params);
    }
}

void GL_APIENTRY GetUniformuivRobustANGLEContextANGLE(GLeglContext ctx,
                                                      GLuint program,
                                                      GLint location,
                                                      GLsizei bufSize,
                                                      GLsizei *length,
                                                      GLuint *params)
{
    EVENT(
        "(GLuint program = %u, GLint location = %d, GLsizei bufSize = %d, GLsizei * length = "
        "0x%016" PRIxPTR ", GLuint * params = 0x%016" PRIxPTR ")",
        program, location, bufSize, (uintptr_t)length, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() ||
             ValidateGetUniformuivRobustANGLE(context, program, location, bufSize, length, params));
        if (isCallValid)
        {
            context->getUniformuivRobust(program, location, bufSize, length, params);
        }
        ANGLE_CAPTURE(GetUniformuivRobustANGLE, isCallValid, context, program, location, bufSize,
                      length, params);
    }
}

void GL_APIENTRY GetActiveUniformBlockivRobustANGLEContextANGLE(GLeglContext ctx,
                                                                GLuint program,
                                                                GLuint uniformBlockIndex,
                                                                GLenum pname,
                                                                GLsizei bufSize,
                                                                GLsizei *length,
                                                                GLint *params)
{
    EVENT(
        "(GLuint program = %u, GLuint uniformBlockIndex = %u, GLenum pname = 0x%X, GLsizei bufSize "
        "= %d, GLsizei * length = 0x%016" PRIxPTR ", GLint * params = 0x%016" PRIxPTR ")",
        program, uniformBlockIndex, pname, bufSize, (uintptr_t)length, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateGetActiveUniformBlockivRobustANGLE(
                                                             context, program, uniformBlockIndex,
                                                             pname, bufSize, length, params));
        if (isCallValid)
        {
            context->getActiveUniformBlockivRobust(program, uniformBlockIndex, pname, bufSize,
                                                   length, params);
        }
        ANGLE_CAPTURE(GetActiveUniformBlockivRobustANGLE, isCallValid, context, program,
                      uniformBlockIndex, pname, bufSize, length, params);
    }
}

void GL_APIENTRY GetInteger64vRobustANGLEContextANGLE(GLeglContext ctx,
                                                      GLenum pname,
                                                      GLsizei bufSize,
                                                      GLsizei *length,
                                                      GLint64 *data)
{
    EVENT("(GLenum pname = 0x%X, GLsizei bufSize = %d, GLsizei * length = 0x%016" PRIxPTR
          ", GLint64 * data = 0x%016" PRIxPTR ")",
          pname, bufSize, (uintptr_t)length, (uintptr_t)data);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() ||
             ValidateGetInteger64vRobustANGLE(context, pname, bufSize, length, data));
        if (isCallValid)
        {
            context->getInteger64vRobust(pname, bufSize, length, data);
        }
        ANGLE_CAPTURE(GetInteger64vRobustANGLE, isCallValid, context, pname, bufSize, length, data);
    }
}

void GL_APIENTRY GetInteger64i_vRobustANGLEContextANGLE(GLeglContext ctx,
                                                        GLenum target,
                                                        GLuint index,
                                                        GLsizei bufSize,
                                                        GLsizei *length,
                                                        GLint64 *data)
{
    EVENT(
        "(GLenum target = 0x%X, GLuint index = %u, GLsizei bufSize = %d, GLsizei * length = "
        "0x%016" PRIxPTR ", GLint64 * data = 0x%016" PRIxPTR ")",
        target, index, bufSize, (uintptr_t)length, (uintptr_t)data);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() ||
             ValidateGetInteger64i_vRobustANGLE(context, target, index, bufSize, length, data));
        if (isCallValid)
        {
            context->getInteger64i_vRobust(target, index, bufSize, length, data);
        }
        ANGLE_CAPTURE(GetInteger64i_vRobustANGLE, isCallValid, context, target, index, bufSize,
                      length, data);
    }
}

void GL_APIENTRY GetBufferParameteri64vRobustANGLEContextANGLE(GLeglContext ctx,
                                                               GLenum target,
                                                               GLenum pname,
                                                               GLsizei bufSize,
                                                               GLsizei *length,
                                                               GLint64 *params)
{
    EVENT(
        "(GLenum target = 0x%X, GLenum pname = 0x%X, GLsizei bufSize = %d, GLsizei * length = "
        "0x%016" PRIxPTR ", GLint64 * params = 0x%016" PRIxPTR ")",
        target, pname, bufSize, (uintptr_t)length, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        BufferBinding targetPacked = FromGLenum<BufferBinding>(target);
        bool isCallValid           = (context->skipValidation() ||
                            ValidateGetBufferParameteri64vRobustANGLE(context, targetPacked, pname,
                                                                      bufSize, length, params));
        if (isCallValid)
        {
            context->getBufferParameteri64vRobust(targetPacked, pname, bufSize, length, params);
        }
        ANGLE_CAPTURE(GetBufferParameteri64vRobustANGLE, isCallValid, context, targetPacked, pname,
                      bufSize, length, params);
    }
}

void GL_APIENTRY SamplerParameterivRobustANGLEContextANGLE(GLeglContext ctx,
                                                           GLuint sampler,
                                                           GLuint pname,
                                                           GLsizei bufSize,
                                                           const GLint *param)
{
    EVENT(
        "(GLuint sampler = %u, GLuint pname = %u, GLsizei bufSize = %d, const GLint * param = "
        "0x%016" PRIxPTR ")",
        sampler, pname, bufSize, (uintptr_t)param);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() ||
             ValidateSamplerParameterivRobustANGLE(context, sampler, pname, bufSize, param));
        if (isCallValid)
        {
            context->samplerParameterivRobust(sampler, pname, bufSize, param);
        }
        ANGLE_CAPTURE(SamplerParameterivRobustANGLE, isCallValid, context, sampler, pname, bufSize,
                      param);
    }
}

void GL_APIENTRY SamplerParameterfvRobustANGLEContextANGLE(GLeglContext ctx,
                                                           GLuint sampler,
                                                           GLenum pname,
                                                           GLsizei bufSize,
                                                           const GLfloat *param)
{
    EVENT(
        "(GLuint sampler = %u, GLenum pname = 0x%X, GLsizei bufSize = %d, const GLfloat * param = "
        "0x%016" PRIxPTR ")",
        sampler, pname, bufSize, (uintptr_t)param);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() ||
             ValidateSamplerParameterfvRobustANGLE(context, sampler, pname, bufSize, param));
        if (isCallValid)
        {
            context->samplerParameterfvRobust(sampler, pname, bufSize, param);
        }
        ANGLE_CAPTURE(SamplerParameterfvRobustANGLE, isCallValid, context, sampler, pname, bufSize,
                      param);
    }
}

void GL_APIENTRY GetSamplerParameterivRobustANGLEContextANGLE(GLeglContext ctx,
                                                              GLuint sampler,
                                                              GLenum pname,
                                                              GLsizei bufSize,
                                                              GLsizei *length,
                                                              GLint *params)
{
    EVENT(
        "(GLuint sampler = %u, GLenum pname = 0x%X, GLsizei bufSize = %d, GLsizei * length = "
        "0x%016" PRIxPTR ", GLint * params = 0x%016" PRIxPTR ")",
        sampler, pname, bufSize, (uintptr_t)length, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateGetSamplerParameterivRobustANGLE(
                                              context, sampler, pname, bufSize, length, params));
        if (isCallValid)
        {
            context->getSamplerParameterivRobust(sampler, pname, bufSize, length, params);
        }
        ANGLE_CAPTURE(GetSamplerParameterivRobustANGLE, isCallValid, context, sampler, pname,
                      bufSize, length, params);
    }
}

void GL_APIENTRY GetSamplerParameterfvRobustANGLEContextANGLE(GLeglContext ctx,
                                                              GLuint sampler,
                                                              GLenum pname,
                                                              GLsizei bufSize,
                                                              GLsizei *length,
                                                              GLfloat *params)
{
    EVENT(
        "(GLuint sampler = %u, GLenum pname = 0x%X, GLsizei bufSize = %d, GLsizei * length = "
        "0x%016" PRIxPTR ", GLfloat * params = 0x%016" PRIxPTR ")",
        sampler, pname, bufSize, (uintptr_t)length, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateGetSamplerParameterfvRobustANGLE(
                                              context, sampler, pname, bufSize, length, params));
        if (isCallValid)
        {
            context->getSamplerParameterfvRobust(sampler, pname, bufSize, length, params);
        }
        ANGLE_CAPTURE(GetSamplerParameterfvRobustANGLE, isCallValid, context, sampler, pname,
                      bufSize, length, params);
    }
}

void GL_APIENTRY GetFramebufferParameterivRobustANGLEContextANGLE(GLeglContext ctx,
                                                                  GLuint sampler,
                                                                  GLenum pname,
                                                                  GLsizei bufSize,
                                                                  GLsizei *length,
                                                                  GLint *params)
{
    EVENT(
        "(GLuint sampler = %u, GLenum pname = 0x%X, GLsizei bufSize = %d, GLsizei * length = "
        "0x%016" PRIxPTR ", GLint * params = 0x%016" PRIxPTR ")",
        sampler, pname, bufSize, (uintptr_t)length, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateGetFramebufferParameterivRobustANGLE(
                                              context, sampler, pname, bufSize, length, params));
        if (isCallValid)
        {
            context->getFramebufferParameterivRobust(sampler, pname, bufSize, length, params);
        }
        ANGLE_CAPTURE(GetFramebufferParameterivRobustANGLE, isCallValid, context, sampler, pname,
                      bufSize, length, params);
    }
}

void GL_APIENTRY GetProgramInterfaceivRobustANGLEContextANGLE(GLeglContext ctx,
                                                              GLuint program,
                                                              GLenum programInterface,
                                                              GLenum pname,
                                                              GLsizei bufSize,
                                                              GLsizei *length,
                                                              GLint *params)
{
    EVENT(
        "(GLuint program = %u, GLenum programInterface = 0x%X, GLenum pname = 0x%X, GLsizei "
        "bufSize = %d, GLsizei * length = 0x%016" PRIxPTR ", GLint * params = 0x%016" PRIxPTR ")",
        program, programInterface, pname, bufSize, (uintptr_t)length, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() || ValidateGetProgramInterfaceivRobustANGLE(
                                                             context, program, programInterface,
                                                             pname, bufSize, length, params));
        if (isCallValid)
        {
            context->getProgramInterfaceivRobust(program, programInterface, pname, bufSize, length,
                                                 params);
        }
        ANGLE_CAPTURE(GetProgramInterfaceivRobustANGLE, isCallValid, context, program,
                      programInterface, pname, bufSize, length, params);
    }
}

void GL_APIENTRY GetBooleani_vRobustANGLEContextANGLE(GLeglContext ctx,
                                                      GLenum target,
                                                      GLuint index,
                                                      GLsizei bufSize,
                                                      GLsizei *length,
                                                      GLboolean *data)
{
    EVENT(
        "(GLenum target = 0x%X, GLuint index = %u, GLsizei bufSize = %d, GLsizei * length = "
        "0x%016" PRIxPTR ", GLboolean * data = 0x%016" PRIxPTR ")",
        target, index, bufSize, (uintptr_t)length, (uintptr_t)data);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() ||
             ValidateGetBooleani_vRobustANGLE(context, target, index, bufSize, length, data));
        if (isCallValid)
        {
            context->getBooleani_vRobust(target, index, bufSize, length, data);
        }
        ANGLE_CAPTURE(GetBooleani_vRobustANGLE, isCallValid, context, target, index, bufSize,
                      length, data);
    }
}

void GL_APIENTRY GetMultisamplefvRobustANGLEContextANGLE(GLeglContext ctx,
                                                         GLenum pname,
                                                         GLuint index,
                                                         GLsizei bufSize,
                                                         GLsizei *length,
                                                         GLfloat *val)
{
    EVENT(
        "(GLenum pname = 0x%X, GLuint index = %u, GLsizei bufSize = %d, GLsizei * length = "
        "0x%016" PRIxPTR ", GLfloat * val = 0x%016" PRIxPTR ")",
        pname, index, bufSize, (uintptr_t)length, (uintptr_t)val);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() ||
             ValidateGetMultisamplefvRobustANGLE(context, pname, index, bufSize, length, val));
        if (isCallValid)
        {
            context->getMultisamplefvRobust(pname, index, bufSize, length, val);
        }
        ANGLE_CAPTURE(GetMultisamplefvRobustANGLE, isCallValid, context, pname, index, bufSize,
                      length, val);
    }
}

void GL_APIENTRY GetTexLevelParameterivRobustANGLEContextANGLE(GLeglContext ctx,
                                                               GLenum target,
                                                               GLint level,
                                                               GLenum pname,
                                                               GLsizei bufSize,
                                                               GLsizei *length,
                                                               GLint *params)
{
    EVENT(
        "(GLenum target = 0x%X, GLint level = %d, GLenum pname = 0x%X, GLsizei bufSize = %d, "
        "GLsizei * length = 0x%016" PRIxPTR ", GLint * params = 0x%016" PRIxPTR ")",
        target, level, pname, bufSize, (uintptr_t)length, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        TextureTarget targetPacked = FromGLenum<TextureTarget>(target);
        bool isCallValid           = (context->skipValidation() ||
                            ValidateGetTexLevelParameterivRobustANGLE(
                                context, targetPacked, level, pname, bufSize, length, params));
        if (isCallValid)
        {
            context->getTexLevelParameterivRobust(targetPacked, level, pname, bufSize, length,
                                                  params);
        }
        ANGLE_CAPTURE(GetTexLevelParameterivRobustANGLE, isCallValid, context, targetPacked, level,
                      pname, bufSize, length, params);
    }
}

void GL_APIENTRY GetTexLevelParameterfvRobustANGLEContextANGLE(GLeglContext ctx,
                                                               GLenum target,
                                                               GLint level,
                                                               GLenum pname,
                                                               GLsizei bufSize,
                                                               GLsizei *length,
                                                               GLfloat *params)
{
    EVENT(
        "(GLenum target = 0x%X, GLint level = %d, GLenum pname = 0x%X, GLsizei bufSize = %d, "
        "GLsizei * length = 0x%016" PRIxPTR ", GLfloat * params = 0x%016" PRIxPTR ")",
        target, level, pname, bufSize, (uintptr_t)length, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        TextureTarget targetPacked = FromGLenum<TextureTarget>(target);
        bool isCallValid           = (context->skipValidation() ||
                            ValidateGetTexLevelParameterfvRobustANGLE(
                                context, targetPacked, level, pname, bufSize, length, params));
        if (isCallValid)
        {
            context->getTexLevelParameterfvRobust(targetPacked, level, pname, bufSize, length,
                                                  params);
        }
        ANGLE_CAPTURE(GetTexLevelParameterfvRobustANGLE, isCallValid, context, targetPacked, level,
                      pname, bufSize, length, params);
    }
}

void GL_APIENTRY GetPointervRobustANGLERobustANGLEContextANGLE(GLeglContext ctx,
                                                               GLenum pname,
                                                               GLsizei bufSize,
                                                               GLsizei *length,
                                                               void **params)
{
    EVENT("(GLenum pname = 0x%X, GLsizei bufSize = %d, GLsizei * length = 0x%016" PRIxPTR
          ", void ** params = 0x%016" PRIxPTR ")",
          pname, bufSize, (uintptr_t)length, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() ||
             ValidateGetPointervRobustANGLERobustANGLE(context, pname, bufSize, length, params));
        if (isCallValid)
        {
            context->getPointervRobustANGLERobust(pname, bufSize, length, params);
        }
        ANGLE_CAPTURE(GetPointervRobustANGLERobustANGLE, isCallValid, context, pname, bufSize,
                      length, params);
    }
}

void GL_APIENTRY ReadnPixelsRobustANGLEContextANGLE(GLeglContext ctx,
                                                    GLint x,
                                                    GLint y,
                                                    GLsizei width,
                                                    GLsizei height,
                                                    GLenum format,
                                                    GLenum type,
                                                    GLsizei bufSize,
                                                    GLsizei *length,
                                                    GLsizei *columns,
                                                    GLsizei *rows,
                                                    void *data)
{
    EVENT(
        "(GLint x = %d, GLint y = %d, GLsizei width = %d, GLsizei height = %d, GLenum format = "
        "0x%X, GLenum type = 0x%X, GLsizei bufSize = %d, GLsizei * length = 0x%016" PRIxPTR
        ", GLsizei * columns = 0x%016" PRIxPTR ", GLsizei * rows = 0x%016" PRIxPTR
        ", void * data = 0x%016" PRIxPTR ")",
        x, y, width, height, format, type, bufSize, (uintptr_t)length, (uintptr_t)columns,
        (uintptr_t)rows, (uintptr_t)data);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() ||
             ValidateReadnPixelsRobustANGLE(context, x, y, width, height, format, type, bufSize,
                                            length, columns, rows, data));
        if (isCallValid)
        {
            context->readnPixelsRobust(x, y, width, height, format, type, bufSize, length, columns,
                                       rows, data);
        }
        ANGLE_CAPTURE(ReadnPixelsRobustANGLE, isCallValid, context, x, y, width, height, format,
                      type, bufSize, length, columns, rows, data);
    }
}

void GL_APIENTRY GetnUniformfvRobustANGLEContextANGLE(GLeglContext ctx,
                                                      GLuint program,
                                                      GLint location,
                                                      GLsizei bufSize,
                                                      GLsizei *length,
                                                      GLfloat *params)
{
    EVENT(
        "(GLuint program = %u, GLint location = %d, GLsizei bufSize = %d, GLsizei * length = "
        "0x%016" PRIxPTR ", GLfloat * params = 0x%016" PRIxPTR ")",
        program, location, bufSize, (uintptr_t)length, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() ||
             ValidateGetnUniformfvRobustANGLE(context, program, location, bufSize, length, params));
        if (isCallValid)
        {
            context->getnUniformfvRobust(program, location, bufSize, length, params);
        }
        ANGLE_CAPTURE(GetnUniformfvRobustANGLE, isCallValid, context, program, location, bufSize,
                      length, params);
    }
}

void GL_APIENTRY GetnUniformivRobustANGLEContextANGLE(GLeglContext ctx,
                                                      GLuint program,
                                                      GLint location,
                                                      GLsizei bufSize,
                                                      GLsizei *length,
                                                      GLint *params)
{
    EVENT(
        "(GLuint program = %u, GLint location = %d, GLsizei bufSize = %d, GLsizei * length = "
        "0x%016" PRIxPTR ", GLint * params = 0x%016" PRIxPTR ")",
        program, location, bufSize, (uintptr_t)length, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() ||
             ValidateGetnUniformivRobustANGLE(context, program, location, bufSize, length, params));
        if (isCallValid)
        {
            context->getnUniformivRobust(program, location, bufSize, length, params);
        }
        ANGLE_CAPTURE(GetnUniformivRobustANGLE, isCallValid, context, program, location, bufSize,
                      length, params);
    }
}

void GL_APIENTRY GetnUniformuivRobustANGLEContextANGLE(GLeglContext ctx,
                                                       GLuint program,
                                                       GLint location,
                                                       GLsizei bufSize,
                                                       GLsizei *length,
                                                       GLuint *params)
{
    EVENT(
        "(GLuint program = %u, GLint location = %d, GLsizei bufSize = %d, GLsizei * length = "
        "0x%016" PRIxPTR ", GLuint * params = 0x%016" PRIxPTR ")",
        program, location, bufSize, (uintptr_t)length, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateGetnUniformuivRobustANGLE(
                                              context, program, location, bufSize, length, params));
        if (isCallValid)
        {
            context->getnUniformuivRobust(program, location, bufSize, length, params);
        }
        ANGLE_CAPTURE(GetnUniformuivRobustANGLE, isCallValid, context, program, location, bufSize,
                      length, params);
    }
}

void GL_APIENTRY TexParameterIivRobustANGLEContextANGLE(GLeglContext ctx,
                                                        GLenum target,
                                                        GLenum pname,
                                                        GLsizei bufSize,
                                                        const GLint *params)
{
    EVENT(
        "(GLenum target = 0x%X, GLenum pname = 0x%X, GLsizei bufSize = %d, const GLint * params = "
        "0x%016" PRIxPTR ")",
        target, pname, bufSize, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        TextureType targetPacked = FromGLenum<TextureType>(target);
        bool isCallValid =
            (context->skipValidation() ||
             ValidateTexParameterIivRobustANGLE(context, targetPacked, pname, bufSize, params));
        if (isCallValid)
        {
            context->texParameterIivRobust(targetPacked, pname, bufSize, params);
        }
        ANGLE_CAPTURE(TexParameterIivRobustANGLE, isCallValid, context, targetPacked, pname,
                      bufSize, params);
    }
}

void GL_APIENTRY TexParameterIuivRobustANGLEContextANGLE(GLeglContext ctx,
                                                         GLenum target,
                                                         GLenum pname,
                                                         GLsizei bufSize,
                                                         const GLuint *params)
{
    EVENT(
        "(GLenum target = 0x%X, GLenum pname = 0x%X, GLsizei bufSize = %d, const GLuint * params = "
        "0x%016" PRIxPTR ")",
        target, pname, bufSize, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        TextureType targetPacked = FromGLenum<TextureType>(target);
        bool isCallValid =
            (context->skipValidation() ||
             ValidateTexParameterIuivRobustANGLE(context, targetPacked, pname, bufSize, params));
        if (isCallValid)
        {
            context->texParameterIuivRobust(targetPacked, pname, bufSize, params);
        }
        ANGLE_CAPTURE(TexParameterIuivRobustANGLE, isCallValid, context, targetPacked, pname,
                      bufSize, params);
    }
}

void GL_APIENTRY GetTexParameterIivRobustANGLEContextANGLE(GLeglContext ctx,
                                                           GLenum target,
                                                           GLenum pname,
                                                           GLsizei bufSize,
                                                           GLsizei *length,
                                                           GLint *params)
{
    EVENT(
        "(GLenum target = 0x%X, GLenum pname = 0x%X, GLsizei bufSize = %d, GLsizei * length = "
        "0x%016" PRIxPTR ", GLint * params = 0x%016" PRIxPTR ")",
        target, pname, bufSize, (uintptr_t)length, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        TextureType targetPacked = FromGLenum<TextureType>(target);
        bool isCallValid         = (context->skipValidation() ||
                            ValidateGetTexParameterIivRobustANGLE(context, targetPacked, pname,
                                                                  bufSize, length, params));
        if (isCallValid)
        {
            context->getTexParameterIivRobust(targetPacked, pname, bufSize, length, params);
        }
        ANGLE_CAPTURE(GetTexParameterIivRobustANGLE, isCallValid, context, targetPacked, pname,
                      bufSize, length, params);
    }
}

void GL_APIENTRY GetTexParameterIuivRobustANGLEContextANGLE(GLeglContext ctx,
                                                            GLenum target,
                                                            GLenum pname,
                                                            GLsizei bufSize,
                                                            GLsizei *length,
                                                            GLuint *params)
{
    EVENT(
        "(GLenum target = 0x%X, GLenum pname = 0x%X, GLsizei bufSize = %d, GLsizei * length = "
        "0x%016" PRIxPTR ", GLuint * params = 0x%016" PRIxPTR ")",
        target, pname, bufSize, (uintptr_t)length, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        TextureType targetPacked = FromGLenum<TextureType>(target);
        bool isCallValid         = (context->skipValidation() ||
                            ValidateGetTexParameterIuivRobustANGLE(context, targetPacked, pname,
                                                                   bufSize, length, params));
        if (isCallValid)
        {
            context->getTexParameterIuivRobust(targetPacked, pname, bufSize, length, params);
        }
        ANGLE_CAPTURE(GetTexParameterIuivRobustANGLE, isCallValid, context, targetPacked, pname,
                      bufSize, length, params);
    }
}

void GL_APIENTRY SamplerParameterIivRobustANGLEContextANGLE(GLeglContext ctx,
                                                            GLuint sampler,
                                                            GLenum pname,
                                                            GLsizei bufSize,
                                                            const GLint *param)
{
    EVENT(
        "(GLuint sampler = %u, GLenum pname = 0x%X, GLsizei bufSize = %d, const GLint * param = "
        "0x%016" PRIxPTR ")",
        sampler, pname, bufSize, (uintptr_t)param);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() ||
             ValidateSamplerParameterIivRobustANGLE(context, sampler, pname, bufSize, param));
        if (isCallValid)
        {
            context->samplerParameterIivRobust(sampler, pname, bufSize, param);
        }
        ANGLE_CAPTURE(SamplerParameterIivRobustANGLE, isCallValid, context, sampler, pname, bufSize,
                      param);
    }
}

void GL_APIENTRY SamplerParameterIuivRobustANGLEContextANGLE(GLeglContext ctx,
                                                             GLuint sampler,
                                                             GLenum pname,
                                                             GLsizei bufSize,
                                                             const GLuint *param)
{
    EVENT(
        "(GLuint sampler = %u, GLenum pname = 0x%X, GLsizei bufSize = %d, const GLuint * param = "
        "0x%016" PRIxPTR ")",
        sampler, pname, bufSize, (uintptr_t)param);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() ||
             ValidateSamplerParameterIuivRobustANGLE(context, sampler, pname, bufSize, param));
        if (isCallValid)
        {
            context->samplerParameterIuivRobust(sampler, pname, bufSize, param);
        }
        ANGLE_CAPTURE(SamplerParameterIuivRobustANGLE, isCallValid, context, sampler, pname,
                      bufSize, param);
    }
}

void GL_APIENTRY GetSamplerParameterIivRobustANGLEContextANGLE(GLeglContext ctx,
                                                               GLuint sampler,
                                                               GLenum pname,
                                                               GLsizei bufSize,
                                                               GLsizei *length,
                                                               GLint *params)
{
    EVENT(
        "(GLuint sampler = %u, GLenum pname = 0x%X, GLsizei bufSize = %d, GLsizei * length = "
        "0x%016" PRIxPTR ", GLint * params = 0x%016" PRIxPTR ")",
        sampler, pname, bufSize, (uintptr_t)length, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateGetSamplerParameterIivRobustANGLE(
                                              context, sampler, pname, bufSize, length, params));
        if (isCallValid)
        {
            context->getSamplerParameterIivRobust(sampler, pname, bufSize, length, params);
        }
        ANGLE_CAPTURE(GetSamplerParameterIivRobustANGLE, isCallValid, context, sampler, pname,
                      bufSize, length, params);
    }
}

void GL_APIENTRY GetSamplerParameterIuivRobustANGLEContextANGLE(GLeglContext ctx,
                                                                GLuint sampler,
                                                                GLenum pname,
                                                                GLsizei bufSize,
                                                                GLsizei *length,
                                                                GLuint *params)
{
    EVENT(
        "(GLuint sampler = %u, GLenum pname = 0x%X, GLsizei bufSize = %d, GLsizei * length = "
        "0x%016" PRIxPTR ", GLuint * params = 0x%016" PRIxPTR ")",
        sampler, pname, bufSize, (uintptr_t)length, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateGetSamplerParameterIuivRobustANGLE(
                                              context, sampler, pname, bufSize, length, params));
        if (isCallValid)
        {
            context->getSamplerParameterIuivRobust(sampler, pname, bufSize, length, params);
        }
        ANGLE_CAPTURE(GetSamplerParameterIuivRobustANGLE, isCallValid, context, sampler, pname,
                      bufSize, length, params);
    }
}

void GL_APIENTRY GetQueryObjectivRobustANGLEContextANGLE(GLeglContext ctx,
                                                         GLuint id,
                                                         GLenum pname,
                                                         GLsizei bufSize,
                                                         GLsizei *length,
                                                         GLint *params)
{
    EVENT(
        "(GLuint id = %u, GLenum pname = 0x%X, GLsizei bufSize = %d, GLsizei * length = "
        "0x%016" PRIxPTR ", GLint * params = 0x%016" PRIxPTR ")",
        id, pname, bufSize, (uintptr_t)length, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() ||
             ValidateGetQueryObjectivRobustANGLE(context, id, pname, bufSize, length, params));
        if (isCallValid)
        {
            context->getQueryObjectivRobust(id, pname, bufSize, length, params);
        }
        ANGLE_CAPTURE(GetQueryObjectivRobustANGLE, isCallValid, context, id, pname, bufSize, length,
                      params);
    }
}

void GL_APIENTRY GetQueryObjecti64vRobustANGLEContextANGLE(GLeglContext ctx,
                                                           GLuint id,
                                                           GLenum pname,
                                                           GLsizei bufSize,
                                                           GLsizei *length,
                                                           GLint64 *params)
{
    EVENT(
        "(GLuint id = %u, GLenum pname = 0x%X, GLsizei bufSize = %d, GLsizei * length = "
        "0x%016" PRIxPTR ", GLint64 * params = 0x%016" PRIxPTR ")",
        id, pname, bufSize, (uintptr_t)length, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() ||
             ValidateGetQueryObjecti64vRobustANGLE(context, id, pname, bufSize, length, params));
        if (isCallValid)
        {
            context->getQueryObjecti64vRobust(id, pname, bufSize, length, params);
        }
        ANGLE_CAPTURE(GetQueryObjecti64vRobustANGLE, isCallValid, context, id, pname, bufSize,
                      length, params);
    }
}

void GL_APIENTRY GetQueryObjectui64vRobustANGLEContextANGLE(GLeglContext ctx,
                                                            GLuint id,
                                                            GLenum pname,
                                                            GLsizei bufSize,
                                                            GLsizei *length,
                                                            GLuint64 *params)
{
    EVENT(
        "(GLuint id = %u, GLenum pname = 0x%X, GLsizei bufSize = %d, GLsizei * length = "
        "0x%016" PRIxPTR ", GLuint64 * params = 0x%016" PRIxPTR ")",
        id, pname, bufSize, (uintptr_t)length, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() ||
             ValidateGetQueryObjectui64vRobustANGLE(context, id, pname, bufSize, length, params));
        if (isCallValid)
        {
            context->getQueryObjectui64vRobust(id, pname, bufSize, length, params);
        }
        ANGLE_CAPTURE(GetQueryObjectui64vRobustANGLE, isCallValid, context, id, pname, bufSize,
                      length, params);
    }
}

void GL_APIENTRY CopyTexture3DANGLEContextANGLE(GLeglContext ctx,
                                                GLuint sourceId,
                                                GLint sourceLevel,
                                                GLenum destTarget,
                                                GLuint destId,
                                                GLint destLevel,
                                                GLint internalFormat,
                                                GLenum destType,
                                                GLboolean unpackFlipY,
                                                GLboolean unpackPremultiplyAlpha,
                                                GLboolean unpackUnmultiplyAlpha)
{
    EVENT(
        "(GLuint sourceId = %u, GLint sourceLevel = %d, GLenum destTarget = 0x%X, GLuint destId = "
        "%u, GLint destLevel = %d, GLint internalFormat = %d, GLenum destType = 0x%X, GLboolean "
        "unpackFlipY = %u, GLboolean unpackPremultiplyAlpha = %u, GLboolean unpackUnmultiplyAlpha "
        "= %u)",
        sourceId, sourceLevel, destTarget, destId, destLevel, internalFormat, destType, unpackFlipY,
        unpackPremultiplyAlpha, unpackUnmultiplyAlpha);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        TextureTarget destTargetPacked = FromGLenum<TextureTarget>(destTarget);
        bool isCallValid =
            (context->skipValidation() ||
             ValidateCopyTexture3DANGLE(context, sourceId, sourceLevel, destTargetPacked, destId,
                                        destLevel, internalFormat, destType, unpackFlipY,
                                        unpackPremultiplyAlpha, unpackUnmultiplyAlpha));
        if (isCallValid)
        {
            context->copyTexture3D(sourceId, sourceLevel, destTargetPacked, destId, destLevel,
                                   internalFormat, destType, unpackFlipY, unpackPremultiplyAlpha,
                                   unpackUnmultiplyAlpha);
        }
        ANGLE_CAPTURE(CopyTexture3DANGLE, isCallValid, context, sourceId, sourceLevel,
                      destTargetPacked, destId, destLevel, internalFormat, destType, unpackFlipY,
                      unpackPremultiplyAlpha, unpackUnmultiplyAlpha);
    }
}

void GL_APIENTRY CopySubTexture3DANGLEContextANGLE(GLeglContext ctx,
                                                   GLuint sourceId,
                                                   GLint sourceLevel,
                                                   GLenum destTarget,
                                                   GLuint destId,
                                                   GLint destLevel,
                                                   GLint xoffset,
                                                   GLint yoffset,
                                                   GLint zoffset,
                                                   GLint x,
                                                   GLint y,
                                                   GLint z,
                                                   GLint width,
                                                   GLint height,
                                                   GLint depth,
                                                   GLboolean unpackFlipY,
                                                   GLboolean unpackPremultiplyAlpha,
                                                   GLboolean unpackUnmultiplyAlpha)
{
    EVENT(
        "(GLuint sourceId = %u, GLint sourceLevel = %d, GLenum destTarget = 0x%X, GLuint destId = "
        "%u, GLint destLevel = %d, GLint xoffset = %d, GLint yoffset = %d, GLint zoffset = %d, "
        "GLint x = %d, GLint y = %d, GLint z = %d, GLint width = %d, GLint height = %d, GLint "
        "depth = %d, GLboolean unpackFlipY = %u, GLboolean unpackPremultiplyAlpha = %u, GLboolean "
        "unpackUnmultiplyAlpha = %u)",
        sourceId, sourceLevel, destTarget, destId, destLevel, xoffset, yoffset, zoffset, x, y, z,
        width, height, depth, unpackFlipY, unpackPremultiplyAlpha, unpackUnmultiplyAlpha);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        TextureTarget destTargetPacked = FromGLenum<TextureTarget>(destTarget);
        bool isCallValid               = (context->skipValidation() ||
                            ValidateCopySubTexture3DANGLE(
                                context, sourceId, sourceLevel, destTargetPacked, destId, destLevel,
                                xoffset, yoffset, zoffset, x, y, z, width, height, depth,
                                unpackFlipY, unpackPremultiplyAlpha, unpackUnmultiplyAlpha));
        if (isCallValid)
        {
            context->copySubTexture3D(sourceId, sourceLevel, destTargetPacked, destId, destLevel,
                                      xoffset, yoffset, zoffset, x, y, z, width, height, depth,
                                      unpackFlipY, unpackPremultiplyAlpha, unpackUnmultiplyAlpha);
        }
        ANGLE_CAPTURE(CopySubTexture3DANGLE, isCallValid, context, sourceId, sourceLevel,
                      destTargetPacked, destId, destLevel, xoffset, yoffset, zoffset, x, y, z,
                      width, height, depth, unpackFlipY, unpackPremultiplyAlpha,
                      unpackUnmultiplyAlpha);
    }
}

void GL_APIENTRY TexStorage2DMultisampleANGLEContextANGLE(GLeglContext ctx,
                                                          GLenum target,
                                                          GLsizei samples,
                                                          GLenum internalformat,
                                                          GLsizei width,
                                                          GLsizei height,
                                                          GLboolean fixedsamplelocations)
{
    EVENT(
        "(GLenum target = 0x%X, GLsizei samples = %d, GLenum internalformat = 0x%X, GLsizei width "
        "= %d, GLsizei height = %d, GLboolean fixedsamplelocations = %u)",
        target, samples, internalformat, width, height, fixedsamplelocations);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        TextureType targetPacked = FromGLenum<TextureType>(target);
        bool isCallValid =
            (context->skipValidation() ||
             ValidateTexStorage2DMultisampleANGLE(context, targetPacked, samples, internalformat,
                                                  width, height, fixedsamplelocations));
        if (isCallValid)
        {
            context->texStorage2DMultisample(targetPacked, samples, internalformat, width, height,
                                             fixedsamplelocations);
        }
        ANGLE_CAPTURE(TexStorage2DMultisampleANGLE, isCallValid, context, targetPacked, samples,
                      internalformat, width, height, fixedsamplelocations);
    }
}

void GL_APIENTRY GetTexLevelParameterivANGLEContextANGLE(GLeglContext ctx,
                                                         GLenum target,
                                                         GLint level,
                                                         GLenum pname,
                                                         GLint *params)
{
    EVENT(
        "(GLenum target = 0x%X, GLint level = %d, GLenum pname = 0x%X, GLint * params = "
        "0x%016" PRIxPTR ")",
        target, level, pname, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        TextureTarget targetPacked = FromGLenum<TextureTarget>(target);
        bool isCallValid =
            (context->skipValidation() ||
             ValidateGetTexLevelParameterivANGLE(context, targetPacked, level, pname, params));
        if (isCallValid)
        {
            context->getTexLevelParameteriv(targetPacked, level, pname, params);
        }
        ANGLE_CAPTURE(GetTexLevelParameterivANGLE, isCallValid, context, targetPacked, level, pname,
                      params);
    }
}

void GL_APIENTRY GetTexLevelParameterfvANGLEContextANGLE(GLeglContext ctx,
                                                         GLenum target,
                                                         GLint level,
                                                         GLenum pname,
                                                         GLfloat *params)
{
    EVENT(
        "(GLenum target = 0x%X, GLint level = %d, GLenum pname = 0x%X, GLfloat * params = "
        "0x%016" PRIxPTR ")",
        target, level, pname, (uintptr_t)params);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        TextureTarget targetPacked = FromGLenum<TextureTarget>(target);
        bool isCallValid =
            (context->skipValidation() ||
             ValidateGetTexLevelParameterfvANGLE(context, targetPacked, level, pname, params));
        if (isCallValid)
        {
            context->getTexLevelParameterfv(targetPacked, level, pname, params);
        }
        ANGLE_CAPTURE(GetTexLevelParameterfvANGLE, isCallValid, context, targetPacked, level, pname,
                      params);
    }
}

void GL_APIENTRY MultiDrawArraysANGLEContextANGLE(GLeglContext ctx,
                                                  GLenum mode,
                                                  const GLint *firsts,
                                                  const GLsizei *counts,
                                                  GLsizei drawcount)
{
    EVENT("(GLenum mode = 0x%X, const GLint *firsts = 0x%016" PRIxPTR
          ", const GLsizei *counts = 0x%016" PRIxPTR ", GLsizei drawcount = %d)",
          mode, (uintptr_t)firsts, (uintptr_t)counts, drawcount);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        PrimitiveMode modePacked = FromGLenum<PrimitiveMode>(mode);
        bool isCallValid =
            (context->skipValidation() ||
             ValidateMultiDrawArraysANGLE(context, modePacked, firsts, counts, drawcount));
        if (isCallValid)
        {
            context->multiDrawArrays(modePacked, firsts, counts, drawcount);
        }
        ANGLE_CAPTURE(MultiDrawArraysANGLE, isCallValid, context, modePacked, firsts, counts,
                      drawcount);
    }
}

void GL_APIENTRY MultiDrawArraysInstancedANGLEContextANGLE(GLeglContext ctx,
                                                           GLenum mode,
                                                           const GLint *firsts,
                                                           const GLsizei *counts,
                                                           const GLsizei *instanceCounts,
                                                           GLsizei drawcount)
{
    EVENT("(GLenum mode = 0x%X, const GLint *firsts = 0x%016" PRIxPTR
          ", const GLsizei *counts = 0x%016" PRIxPTR
          ", const GLsizei *instanceCounts = 0x%016" PRIxPTR ", GLsizei drawcount = %d)",
          mode, (uintptr_t)firsts, (uintptr_t)counts, (uintptr_t)instanceCounts, drawcount);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        PrimitiveMode modePacked = FromGLenum<PrimitiveMode>(mode);
        bool isCallValid         = (context->skipValidation() ||
                            ValidateMultiDrawArraysInstancedANGLE(
                                context, modePacked, firsts, counts, instanceCounts, drawcount));
        if (isCallValid)
        {
            context->multiDrawArraysInstanced(modePacked, firsts, counts, instanceCounts,
                                              drawcount);
        }
        ANGLE_CAPTURE(MultiDrawArraysInstancedANGLE, isCallValid, context, modePacked, firsts,
                      counts, instanceCounts, drawcount);
    }
}

void GL_APIENTRY MultiDrawElementsANGLEContextANGLE(GLeglContext ctx,
                                                    GLenum mode,
                                                    const GLsizei *counts,
                                                    GLenum type,
                                                    const GLvoid *const *indices,
                                                    GLsizei drawcount)
{
    EVENT("(GLenum mode = 0x%X, const GLsizei *counts = 0x%016" PRIxPTR
          ", GLenum type = 0x%X, const GLvoid *const*indices = 0x%016" PRIxPTR
          ", GLsizei drawcount = %d)",
          mode, (uintptr_t)counts, type, (uintptr_t)indices, drawcount);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        PrimitiveMode modePacked    = FromGLenum<PrimitiveMode>(mode);
        DrawElementsType typePacked = FromGLenum<DrawElementsType>(type);
        bool isCallValid            = (context->skipValidation() ||
                            ValidateMultiDrawElementsANGLE(context, modePacked, counts, typePacked,
                                                           indices, drawcount));
        if (isCallValid)
        {
            context->multiDrawElements(modePacked, counts, typePacked, indices, drawcount);
        }
        ANGLE_CAPTURE(MultiDrawElementsANGLE, isCallValid, context, modePacked, counts, typePacked,
                      indices, drawcount);
    }
}

void GL_APIENTRY MultiDrawElementsInstancedANGLEContextANGLE(GLeglContext ctx,
                                                             GLenum mode,
                                                             const GLsizei *counts,
                                                             GLenum type,
                                                             const GLvoid *const *indices,
                                                             const GLsizei *instanceCounts,
                                                             GLsizei drawcount)
{
    EVENT("(GLenum mode = 0x%X, const GLsizei *counts = 0x%016" PRIxPTR
          ", GLenum type = 0x%X, const GLvoid *const*indices = 0x%016" PRIxPTR
          ", const GLsizei*instanceCounts = 0x%016" PRIxPTR ", GLsizei drawcount = %d)",
          mode, (uintptr_t)counts, type, (uintptr_t)indices, (uintptr_t)instanceCounts, drawcount);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        PrimitiveMode modePacked    = FromGLenum<PrimitiveMode>(mode);
        DrawElementsType typePacked = FromGLenum<DrawElementsType>(type);
        bool isCallValid =
            (context->skipValidation() ||
             ValidateMultiDrawElementsInstancedANGLE(context, modePacked, counts, typePacked,
                                                     indices, instanceCounts, drawcount));
        if (isCallValid)
        {
            context->multiDrawElementsInstanced(modePacked, counts, typePacked, indices,
                                                instanceCounts, drawcount);
        }
        ANGLE_CAPTURE(MultiDrawElementsInstancedANGLE, isCallValid, context, modePacked, counts,
                      typePacked, indices, instanceCounts, drawcount);
    }
}

void GL_APIENTRY GetMultisamplefvANGLEContextANGLE(GLeglContext ctx,
                                                   GLenum pname,
                                                   GLuint index,
                                                   GLfloat *val)
{
    EVENT("(GLenum pname = 0x%X, GLuint index = %u, GLfloat * val = 0x%016" PRIxPTR ")", pname,
          index, (uintptr_t)val);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid = (context->skipValidation() ||
                            ValidateGetMultisamplefvANGLE(context, pname, index, val));
        if (isCallValid)
        {
            context->getMultisamplefv(pname, index, val);
        }
        ANGLE_CAPTURE(GetMultisamplefvANGLE, isCallValid, context, pname, index, val);
    }
}

void GL_APIENTRY SampleMaskiANGLEContextANGLE(GLeglContext ctx, GLuint maskNumber, GLbitfield mask)
{
    EVENT("(GLuint maskNumber = %u, GLbitfield mask = 0x%X)", maskNumber, mask);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        bool isCallValid =
            (context->skipValidation() || ValidateSampleMaskiANGLE(context, maskNumber, mask));
        if (isCallValid)
        {
            context->sampleMaski(maskNumber, mask);
        }
        ANGLE_CAPTURE(SampleMaskiANGLE, isCallValid, context, maskNumber, mask);
    }
}

void GL_APIENTRY ProvokingVertexANGLEContextANGLE(GLeglContext ctx, GLenum mode)
{
    EVENT("(GLenum mode = 0x%X)", mode);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        ProvokingVertexConvention modePacked = FromGLenum<ProvokingVertexConvention>(mode);
        bool isCallValid =
            (context->skipValidation() || ValidateProvokingVertexANGLE(context, modePacked));
        if (isCallValid)
        {
            context->provokingVertex(modePacked);
        }
        ANGLE_CAPTURE(ProvokingVertexANGLE, isCallValid, context, modePacked);
    }
}

void GL_APIENTRY LoseContextCHROMIUMContextANGLE(GLeglContext ctx, GLenum current, GLenum other)
{
    EVENT("(GLenum current = 0x%X, GLenum other = 0x%X)", current, other);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        GraphicsResetStatus currentPacked = FromGLenum<GraphicsResetStatus>(current);
        GraphicsResetStatus otherPacked   = FromGLenum<GraphicsResetStatus>(other);
        bool isCallValid                  = (context->skipValidation() ||
                            ValidateLoseContextCHROMIUM(context, currentPacked, otherPacked));
        if (isCallValid)
        {
            context->loseContext(currentPacked, otherPacked);
        }
        ANGLE_CAPTURE(LoseContextCHROMIUM, isCallValid, context, currentPacked, otherPacked);
    }
}

void GL_APIENTRY TexImage2DExternalANGLEContextANGLE(GLeglContext ctx,
                                                     GLenum target,
                                                     GLint level,
                                                     GLint internalformat,
                                                     GLsizei width,
                                                     GLsizei height,
                                                     GLint border,
                                                     GLenum format,
                                                     GLenum type)
{
    EVENT(
        "(GLenum target = 0x%X, GLint level = %d, GLint internalformat = %d, GLsizei width = %d, "
        "GLsizei height = %d, GLint border = %d, GLenum format = 0x%X, GLenum type = 0x%X)",
        target, level, internalformat, width, height, border, format, type);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        TextureTarget targetPacked = FromGLenum<TextureTarget>(target);
        bool isCallValid =
            (context->skipValidation() ||
             ValidateTexImage2DExternalANGLE(context, targetPacked, level, internalformat, width,
                                             height, border, format, type));
        if (isCallValid)
        {
            context->texImage2DExternal(targetPacked, level, internalformat, width, height, border,
                                        format, type);
        }
        ANGLE_CAPTURE(TexImage2DExternalANGLE, isCallValid, context, targetPacked, level,
                      internalformat, width, height, border, format, type);
    }
}

void GL_APIENTRY InvalidateTextureANGLEContextANGLE(GLeglContext ctx, GLenum target)
{
    EVENT("(GLenum target = 0x%X)", target);

    Context *context = static_cast<gl::Context *>(ctx);
    if (context)
    {
        ASSERT(context == GetValidGlobalContext());
        TextureType targetPacked = FromGLenum<TextureType>(target);
        bool isCallValid =
            (context->skipValidation() || ValidateInvalidateTextureANGLE(context, targetPacked));
        if (isCallValid)
        {
            context->invalidateTexture(targetPacked);
        }
        ANGLE_CAPTURE(InvalidateTextureANGLE, isCallValid, context, targetPacked);
    }
}
}  // namespace gl
