// GENERATED FILE - DO NOT EDIT.
// Generated by generate_entry_points.py using data from gl.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_gl_4_3_autogen.cpp:
//   Defines the GL 4.3 entry points.

#include "libGL/entry_points_gl_4_3_autogen.h"

#include "libANGLE/Context.h"
#include "libANGLE/Context.inl.h"
#include "libANGLE/entry_points_utils.h"
#include "libANGLE/validationEGL.h"
#include "libANGLE/validationES.h"
#include "libANGLE/validationES1.h"
#include "libANGLE/validationES2.h"
#include "libANGLE/validationES3.h"
#include "libANGLE/validationES31.h"
#include "libANGLE/validationESEXT.h"
#include "libANGLE/validationGL43_autogen.h"
#include "libGLESv2/global_state.h"

namespace gl
{
void GL_APIENTRY BindVertexBuffer(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 = GetValidGlobalContext();
    if (context)
    {
        ANGLE_CAPTURE(BindVertexBuffer, context, bindingindex, buffer, offset, stride);
        if (context->skipValidation() ||
            ValidateBindVertexBuffer(context, bindingindex, buffer, offset, stride))
        {
            context->bindVertexBuffer(bindingindex, buffer, offset, stride);
        }
    }
}

void GL_APIENTRY
ClearBufferData(GLenum target, GLenum internalformat, GLenum format, GLenum type, const void *data)
{
    EVENT(
        "(GLenum target = 0x%X, GLenum internalformat = 0x%X, GLenum format = 0x%X, GLenum type = "
        "0x%X, const void *data = 0x%016" PRIxPTR ")",
        target, internalformat, format, type, (uintptr_t)data);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        ANGLE_CAPTURE(ClearBufferData, context, target, internalformat, format, type, data);
        if (context->skipValidation() ||
            ValidateClearBufferData(context, target, internalformat, format, type, data))
        {
            context->clearBufferData(target, internalformat, format, type, data);
        }
    }
}

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

    Context *context = GetValidGlobalContext();
    if (context)
    {
        ANGLE_CAPTURE(ClearBufferSubData, context, target, internalformat, offset, size, format,
                      type, data);
        if (context->skipValidation() ||
            ValidateClearBufferSubData(context, target, internalformat, offset, size, format, type,
                                       data))
        {
            context->clearBufferSubData(target, internalformat, offset, size, format, type, data);
        }
    }
}

void GL_APIENTRY CopyImageSubData(GLuint srcName,
                                  GLenum srcTarget,
                                  GLint srcLevel,
                                  GLint srcX,
                                  GLint srcY,
                                  GLint srcZ,
                                  GLuint dstName,
                                  GLenum dstTarget,
                                  GLint dstLevel,
                                  GLint dstX,
                                  GLint dstY,
                                  GLint dstZ,
                                  GLsizei srcWidth,
                                  GLsizei srcHeight,
                                  GLsizei srcDepth)
{
    EVENT(
        "(GLuint srcName = %u, GLenum srcTarget = 0x%X, GLint srcLevel = %d, GLint srcX = %d, "
        "GLint srcY = %d, GLint srcZ = %d, GLuint dstName = %u, GLenum dstTarget = 0x%X, GLint "
        "dstLevel = %d, GLint dstX = %d, GLint dstY = %d, GLint dstZ = %d, GLsizei srcWidth = %d, "
        "GLsizei srcHeight = %d, GLsizei srcDepth = %d)",
        srcName, srcTarget, srcLevel, srcX, srcY, srcZ, dstName, dstTarget, dstLevel, dstX, dstY,
        dstZ, srcWidth, srcHeight, srcDepth);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        ANGLE_CAPTURE(CopyImageSubData, context, srcName, srcTarget, srcLevel, srcX, srcY, srcZ,
                      dstName, dstTarget, dstLevel, dstX, dstY, dstZ, srcWidth, srcHeight,
                      srcDepth);
        if (context->skipValidation() ||
            ValidateCopyImageSubData(context, srcName, srcTarget, srcLevel, srcX, srcY, srcZ,
                                     dstName, dstTarget, dstLevel, dstX, dstY, dstZ, srcWidth,
                                     srcHeight, srcDepth))
        {
            context->copyImageSubData(srcName, srcTarget, srcLevel, srcX, srcY, srcZ, dstName,
                                      dstTarget, dstLevel, dstX, dstY, dstZ, srcWidth, srcHeight,
                                      srcDepth);
        }
    }
}

void GL_APIENTRY DebugMessageCallback(GLDEBUGPROC callback, const void *userParam)
{
    EVENT("(GLDEBUGPROC callback = 0x%016" PRIxPTR ", const void *userParam = 0x%016" PRIxPTR ")",
          (uintptr_t)callback, (uintptr_t)userParam);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        ANGLE_CAPTURE(DebugMessageCallback, context, callback, userParam);
        if (context->skipValidation() || ValidateDebugMessageCallback(context, callback, userParam))
        {
            context->debugMessageCallback(callback, userParam);
        }
    }
}

void GL_APIENTRY DebugMessageControl(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)
    {
        ANGLE_CAPTURE(DebugMessageControl, context, source, type, severity, count, ids, enabled);
        if (context->skipValidation() ||
            ValidateDebugMessageControl(context, source, type, severity, count, ids, enabled))
        {
            context->debugMessageControl(source, type, severity, count, ids, enabled);
        }
    }
}

void GL_APIENTRY DebugMessageInsert(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)
    {
        ANGLE_CAPTURE(DebugMessageInsert, context, source, type, id, severity, length, buf);
        if (context->skipValidation() ||
            ValidateDebugMessageInsert(context, source, type, id, severity, length, buf))
        {
            context->debugMessageInsert(source, type, id, severity, length, buf);
        }
    }
}

void GL_APIENTRY DispatchCompute(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 = GetValidGlobalContext();
    if (context)
    {
        ANGLE_CAPTURE(DispatchCompute, context, num_groups_x, num_groups_y, num_groups_z);
        if (context->skipValidation() ||
            ValidateDispatchCompute(context, num_groups_x, num_groups_y, num_groups_z))
        {
            context->dispatchCompute(num_groups_x, num_groups_y, num_groups_z);
        }
    }
}

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

    Context *context = GetValidGlobalContext();
    if (context)
    {
        ANGLE_CAPTURE(DispatchComputeIndirect, context, indirect);
        if (context->skipValidation() || ValidateDispatchComputeIndirect(context, indirect))
        {
            context->dispatchComputeIndirect(indirect);
        }
    }
}

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

    Context *context = GetValidGlobalContext();
    if (context)
    {
        ANGLE_CAPTURE(FramebufferParameteri, context, target, pname, param);
        if (context->skipValidation() ||
            ValidateFramebufferParameteri(context, target, pname, param))
        {
            context->framebufferParameteri(target, pname, param);
        }
    }
}

GLuint GL_APIENTRY GetDebugMessageLog(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();
    if (context)
    {
        ANGLE_CAPTURE(GetDebugMessageLog, context, count, bufSize, sources, types, ids, severities,
                      lengths, messageLog);
        if (context->skipValidation() ||
            ValidateGetDebugMessageLog(context, count, bufSize, sources, types, ids, severities,
                                       lengths, messageLog))
        {
            return context->getDebugMessageLog(count, bufSize, sources, types, ids, severities,
                                               lengths, messageLog);
        }
    }

    return GetDefaultReturnValue<EntryPoint::GetDebugMessageLog, GLuint>();
}

void GL_APIENTRY GetFramebufferParameteriv(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)
    {
        ANGLE_CAPTURE(GetFramebufferParameteriv, context, target, pname, params);
        if (context->skipValidation() ||
            ValidateGetFramebufferParameteriv(context, target, pname, params))
        {
            context->getFramebufferParameteriv(target, pname, params);
        }
    }
}

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

    Context *context = GetValidGlobalContext();
    if (context)
    {
        ANGLE_CAPTURE(GetInternalformati64v, context, target, internalformat, pname, bufSize,
                      params);
        if (context->skipValidation() ||
            ValidateGetInternalformati64v(context, target, internalformat, pname, bufSize, params))
        {
            context->getInternalformati64v(target, internalformat, pname, bufSize, params);
        }
    }
}

void GL_APIENTRY
GetObjectLabel(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)
    {
        ANGLE_CAPTURE(GetObjectLabel, context, identifier, name, bufSize, length, label);
        if (context->skipValidation() ||
            ValidateGetObjectLabel(context, identifier, name, bufSize, length, label))
        {
            context->getObjectLabel(identifier, name, bufSize, length, label);
        }
    }
}

void GL_APIENTRY GetObjectPtrLabel(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)
    {
        ANGLE_CAPTURE(GetObjectPtrLabel, context, ptr, bufSize, length, label);
        if (context->skipValidation() ||
            ValidateGetObjectPtrLabel(context, ptr, bufSize, length, label))
        {
            context->getObjectPtrLabel(ptr, bufSize, length, label);
        }
    }
}

void GL_APIENTRY GetProgramInterfaceiv(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 = GetValidGlobalContext();
    if (context)
    {
        ANGLE_CAPTURE(GetProgramInterfaceiv, context, program, programInterface, pname, params);
        if (context->skipValidation() ||
            ValidateGetProgramInterfaceiv(context, program, programInterface, pname, params))
        {
            context->getProgramInterfaceiv(program, programInterface, pname, params);
        }
    }
}

GLuint GL_APIENTRY GetProgramResourceIndex(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();
    if (context)
    {
        ANGLE_CAPTURE(GetProgramResourceIndex, context, program, programInterface, name);
        if (context->skipValidation() ||
            ValidateGetProgramResourceIndex(context, program, programInterface, name))
        {
            return context->getProgramResourceIndex(program, programInterface, name);
        }
    }

    return GetDefaultReturnValue<EntryPoint::GetProgramResourceIndex, GLuint>();
}

GLint GL_APIENTRY GetProgramResourceLocation(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();
    if (context)
    {
        ANGLE_CAPTURE(GetProgramResourceLocation, context, program, programInterface, name);
        if (context->skipValidation() ||
            ValidateGetProgramResourceLocation(context, program, programInterface, name))
        {
            return context->getProgramResourceLocation(program, programInterface, name);
        }
    }

    return GetDefaultReturnValue<EntryPoint::GetProgramResourceLocation, GLint>();
}

GLint GL_APIENTRY GetProgramResourceLocationIndex(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();
    if (context)
    {
        ANGLE_CAPTURE(GetProgramResourceLocationIndex, context, program, programInterface, name);
        if (context->skipValidation() ||
            ValidateGetProgramResourceLocationIndex(context, program, programInterface, name))
        {
            return context->getProgramResourceLocationIndex(program, programInterface, name);
        }
    }

    return GetDefaultReturnValue<EntryPoint::GetProgramResourceLocationIndex, GLint>();
}

void GL_APIENTRY GetProgramResourceName(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 = GetValidGlobalContext();
    if (context)
    {
        ANGLE_CAPTURE(GetProgramResourceName, context, program, programInterface, index, bufSize,
                      length, name);
        if (context->skipValidation() ||
            ValidateGetProgramResourceName(context, program, programInterface, index, bufSize,
                                           length, name))
        {
            context->getProgramResourceName(program, programInterface, index, bufSize, length,
                                            name);
        }
    }
}

void GL_APIENTRY GetProgramResourceiv(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 = GetValidGlobalContext();
    if (context)
    {
        ANGLE_CAPTURE(GetProgramResourceiv, context, program, programInterface, index, propCount,
                      props, bufSize, length, params);
        if (context->skipValidation() ||
            ValidateGetProgramResourceiv(context, program, programInterface, index, propCount,
                                         props, bufSize, length, params))
        {
            context->getProgramResourceiv(program, programInterface, index, propCount, props,
                                          bufSize, length, params);
        }
    }
}

void GL_APIENTRY InvalidateBufferData(GLuint buffer)
{
    EVENT("(GLuint buffer = %u)", buffer);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        ANGLE_CAPTURE(InvalidateBufferData, context, buffer);
        if (context->skipValidation() || ValidateInvalidateBufferData(context, buffer))
        {
            context->invalidateBufferData(buffer);
        }
    }
}

void GL_APIENTRY InvalidateBufferSubData(GLuint buffer, GLintptr offset, GLsizeiptr length)
{
    EVENT("(GLuint buffer = %u, GLintptr offset = %llu, GLsizeiptr length = %llu)", buffer,
          static_cast<unsigned long long>(offset), static_cast<unsigned long long>(length));

    Context *context = GetValidGlobalContext();
    if (context)
    {
        ANGLE_CAPTURE(InvalidateBufferSubData, context, buffer, offset, length);
        if (context->skipValidation() ||
            ValidateInvalidateBufferSubData(context, buffer, offset, length))
        {
            context->invalidateBufferSubData(buffer, offset, length);
        }
    }
}

void GL_APIENTRY InvalidateFramebuffer(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)
    {
        ANGLE_CAPTURE(InvalidateFramebuffer, context, target, numAttachments, attachments);
        if (context->skipValidation() ||
            ValidateInvalidateFramebuffer(context, target, numAttachments, attachments))
        {
            context->invalidateFramebuffer(target, numAttachments, attachments);
        }
    }
}

void GL_APIENTRY InvalidateSubFramebuffer(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 = GetValidGlobalContext();
    if (context)
    {
        ANGLE_CAPTURE(InvalidateSubFramebuffer, context, target, numAttachments, attachments, x, y,
                      width, height);
        if (context->skipValidation() ||
            ValidateInvalidateSubFramebuffer(context, target, numAttachments, attachments, x, y,
                                             width, height))
        {
            context->invalidateSubFramebuffer(target, numAttachments, attachments, x, y, width,
                                              height);
        }
    }
}

void GL_APIENTRY InvalidateTexImage(GLuint texture, GLint level)
{
    EVENT("(GLuint texture = %u, GLint level = %d)", texture, level);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        ANGLE_CAPTURE(InvalidateTexImage, context, texture, level);
        if (context->skipValidation() || ValidateInvalidateTexImage(context, texture, level))
        {
            context->invalidateTexImage(texture, level);
        }
    }
}

void GL_APIENTRY InvalidateTexSubImage(GLuint texture,
                                       GLint level,
                                       GLint xoffset,
                                       GLint yoffset,
                                       GLint zoffset,
                                       GLsizei width,
                                       GLsizei height,
                                       GLsizei depth)
{
    EVENT(
        "(GLuint texture = %u, GLint level = %d, GLint xoffset = %d, GLint yoffset = %d, GLint "
        "zoffset = %d, GLsizei width = %d, GLsizei height = %d, GLsizei depth = %d)",
        texture, level, xoffset, yoffset, zoffset, width, height, depth);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        ANGLE_CAPTURE(InvalidateTexSubImage, context, texture, level, xoffset, yoffset, zoffset,
                      width, height, depth);
        if (context->skipValidation() ||
            ValidateInvalidateTexSubImage(context, texture, level, xoffset, yoffset, zoffset, width,
                                          height, depth))
        {
            context->invalidateTexSubImage(texture, level, xoffset, yoffset, zoffset, width, height,
                                           depth);
        }
    }
}

void GL_APIENTRY MultiDrawArraysIndirect(GLenum mode,
                                         const void *indirect,
                                         GLsizei drawcount,
                                         GLsizei stride)
{
    EVENT("(GLenum mode = 0x%X, const void *indirect = 0x%016" PRIxPTR
          ", GLsizei drawcount = %d, GLsizei stride = %d)",
          mode, (uintptr_t)indirect, drawcount, stride);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        ANGLE_CAPTURE(MultiDrawArraysIndirect, context, mode, indirect, drawcount, stride);
        if (context->skipValidation() ||
            ValidateMultiDrawArraysIndirect(context, mode, indirect, drawcount, stride))
        {
            context->multiDrawArraysIndirect(mode, indirect, drawcount, stride);
        }
    }
}

void GL_APIENTRY MultiDrawElementsIndirect(GLenum mode,
                                           GLenum type,
                                           const void *indirect,
                                           GLsizei drawcount,
                                           GLsizei stride)
{
    EVENT("(GLenum mode = 0x%X, GLenum type = 0x%X, const void *indirect = 0x%016" PRIxPTR
          ", GLsizei drawcount = %d, GLsizei stride = %d)",
          mode, type, (uintptr_t)indirect, drawcount, stride);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        ANGLE_CAPTURE(MultiDrawElementsIndirect, context, mode, type, indirect, drawcount, stride);
        if (context->skipValidation() ||
            ValidateMultiDrawElementsIndirect(context, mode, type, indirect, drawcount, stride))
        {
            context->multiDrawElementsIndirect(mode, type, indirect, drawcount, stride);
        }
    }
}

void GL_APIENTRY ObjectLabel(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)
    {
        ANGLE_CAPTURE(ObjectLabel, context, identifier, name, length, label);
        if (context->skipValidation() ||
            ValidateObjectLabel(context, identifier, name, length, label))
        {
            context->objectLabel(identifier, name, length, label);
        }
    }
}

void GL_APIENTRY ObjectPtrLabel(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)
    {
        ANGLE_CAPTURE(ObjectPtrLabel, context, ptr, length, label);
        if (context->skipValidation() || ValidateObjectPtrLabel(context, ptr, length, label))
        {
            context->objectPtrLabel(ptr, length, label);
        }
    }
}

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

    Context *context = GetValidGlobalContext();
    if (context)
    {
        ANGLE_CAPTURE(PopDebugGroup, context);
        if (context->skipValidation() || ValidatePopDebugGroup(context))
        {
            context->popDebugGroup();
        }
    }
}

void GL_APIENTRY PushDebugGroup(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)
    {
        ANGLE_CAPTURE(PushDebugGroup, context, source, id, length, message);
        if (context->skipValidation() ||
            ValidatePushDebugGroup(context, source, id, length, message))
        {
            context->pushDebugGroup(source, id, length, message);
        }
    }
}

void GL_APIENTRY ShaderStorageBlockBinding(GLuint program,
                                           GLuint storageBlockIndex,
                                           GLuint storageBlockBinding)
{
    EVENT("(GLuint program = %u, GLuint storageBlockIndex = %u, GLuint storageBlockBinding = %u)",
          program, storageBlockIndex, storageBlockBinding);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        ANGLE_CAPTURE(ShaderStorageBlockBinding, context, program, storageBlockIndex,
                      storageBlockBinding);
        if (context->skipValidation() ||
            ValidateShaderStorageBlockBinding(context, program, storageBlockIndex,
                                              storageBlockBinding))
        {
            context->shaderStorageBlockBinding(program, storageBlockIndex, storageBlockBinding);
        }
    }
}

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

    Context *context = GetValidGlobalContext();
    if (context)
    {
        ANGLE_CAPTURE(TexBufferRange, context, target, internalformat, buffer, offset, size);
        if (context->skipValidation() ||
            ValidateTexBufferRange(context, target, internalformat, buffer, offset, size))
        {
            context->texBufferRange(target, internalformat, buffer, offset, size);
        }
    }
}

void GL_APIENTRY TexStorage2DMultisample(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);
        ANGLE_CAPTURE(TexStorage2DMultisample, context, targetPacked, samples, internalformat,
                      width, height, fixedsamplelocations);
        if (context->skipValidation() ||
            ValidateTexStorage2DMultisample(context, targetPacked, samples, internalformat, width,
                                            height, fixedsamplelocations))
        {
            context->texStorage2DMultisample(targetPacked, samples, internalformat, width, height,
                                             fixedsamplelocations);
        }
    }
}

void GL_APIENTRY TexStorage3DMultisample(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);
        ANGLE_CAPTURE(TexStorage3DMultisample, context, targetPacked, samples, internalformat,
                      width, height, depth, fixedsamplelocations);
        if (context->skipValidation() ||
            ValidateTexStorage3DMultisample(context, targetPacked, samples, internalformat, width,
                                            height, depth, fixedsamplelocations))
        {
            context->texStorage3DMultisample(targetPacked, samples, internalformat, width, height,
                                             depth, fixedsamplelocations);
        }
    }
}

void GL_APIENTRY TextureView(GLuint texture,
                             GLenum target,
                             GLuint origtexture,
                             GLenum internalformat,
                             GLuint minlevel,
                             GLuint numlevels,
                             GLuint minlayer,
                             GLuint numlayers)
{
    EVENT(
        "(GLuint texture = %u, GLenum target = 0x%X, GLuint origtexture = %u, GLenum "
        "internalformat = 0x%X, GLuint minlevel = %u, GLuint numlevels = %u, GLuint minlayer = %u, "
        "GLuint numlayers = %u)",
        texture, target, origtexture, internalformat, minlevel, numlevels, minlayer, numlayers);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        ANGLE_CAPTURE(TextureView, context, texture, target, origtexture, internalformat, minlevel,
                      numlevels, minlayer, numlayers);
        if (context->skipValidation() ||
            ValidateTextureView(context, texture, target, origtexture, internalformat, minlevel,
                                numlevels, minlayer, numlayers))
        {
            context->textureView(texture, target, origtexture, internalformat, minlevel, numlevels,
                                 minlayer, numlayers);
        }
    }
}

void GL_APIENTRY VertexAttribBinding(GLuint attribindex, GLuint bindingindex)
{
    EVENT("(GLuint attribindex = %u, GLuint bindingindex = %u)", attribindex, bindingindex);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        ANGLE_CAPTURE(VertexAttribBinding, context, attribindex, bindingindex);
        if (context->skipValidation() ||
            ValidateVertexAttribBinding(context, attribindex, bindingindex))
        {
            context->vertexAttribBinding(attribindex, bindingindex);
        }
    }
}

void GL_APIENTRY VertexAttribFormat(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 = GetValidGlobalContext();
    if (context)
    {
        VertexAttribType typePacked = FromGLenum<VertexAttribType>(type);
        ANGLE_CAPTURE(VertexAttribFormat, context, attribindex, size, typePacked, normalized,
                      relativeoffset);
        if (context->skipValidation() ||
            ValidateVertexAttribFormat(context, attribindex, size, typePacked, normalized,
                                       relativeoffset))
        {
            context->vertexAttribFormat(attribindex, size, typePacked, normalized, relativeoffset);
        }
    }
}

void GL_APIENTRY VertexAttribIFormat(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 = GetValidGlobalContext();
    if (context)
    {
        VertexAttribType typePacked = FromGLenum<VertexAttribType>(type);
        ANGLE_CAPTURE(VertexAttribIFormat, context, attribindex, size, typePacked, relativeoffset);
        if (context->skipValidation() ||
            ValidateVertexAttribIFormat(context, attribindex, size, typePacked, relativeoffset))
        {
            context->vertexAttribIFormat(attribindex, size, typePacked, relativeoffset);
        }
    }
}

void GL_APIENTRY VertexAttribLFormat(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 = GetValidGlobalContext();
    if (context)
    {
        ANGLE_CAPTURE(VertexAttribLFormat, context, attribindex, size, type, relativeoffset);
        if (context->skipValidation() ||
            ValidateVertexAttribLFormat(context, attribindex, size, type, relativeoffset))
        {
            context->vertexAttribLFormat(attribindex, size, type, relativeoffset);
        }
    }
}

void GL_APIENTRY VertexBindingDivisor(GLuint bindingindex, GLuint divisor)
{
    EVENT("(GLuint bindingindex = %u, GLuint divisor = %u)", bindingindex, divisor);

    Context *context = GetValidGlobalContext();
    if (context)
    {
        ANGLE_CAPTURE(VertexBindingDivisor, context, bindingindex, divisor);
        if (context->skipValidation() ||
            ValidateVertexBindingDivisor(context, bindingindex, divisor))
        {
            context->vertexBindingDivisor(bindingindex, divisor);
        }
    }
}
}  // namespace gl
