tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

entry_points_gles_ext_autogen.cpp (493963B)


      1 // GENERATED FILE - DO NOT EDIT.
      2 // Generated by generate_entry_points.py using data from gl.xml and gl_angle_ext.xml.
      3 //
      4 // Copyright 2020 The ANGLE Project Authors. All rights reserved.
      5 // Use of this source code is governed by a BSD-style license that can be
      6 // found in the LICENSE file.
      7 //
      8 // entry_points_gles_ext_autogen.cpp:
      9 //   Defines the GLES extension entry points.
     10 
     11 #include "libGLESv2/entry_points_gles_ext_autogen.h"
     12 
     13 #include "common/entry_points_enum_autogen.h"
     14 #include "libANGLE/Context.h"
     15 #include "libANGLE/Context.inl.h"
     16 #include "libANGLE/capture/capture_gles_ext_autogen.h"
     17 #include "libANGLE/capture/gl_enum_utils.h"
     18 #include "libANGLE/entry_points_utils.h"
     19 #include "libANGLE/validationESEXT.h"
     20 #include "libGLESv2/global_state.h"
     21 
     22 using namespace gl;
     23 
     24 #include "libANGLE/capture/capture_gles_1_0_autogen.h"
     25 #include "libANGLE/capture/capture_gles_2_0_autogen.h"
     26 #include "libANGLE/capture/capture_gles_3_0_autogen.h"
     27 #include "libANGLE/capture/capture_gles_3_1_autogen.h"
     28 #include "libANGLE/capture/capture_gles_3_2_autogen.h"
     29 #include "libANGLE/validationES1.h"
     30 #include "libANGLE/validationES2.h"
     31 #include "libANGLE/validationES3.h"
     32 #include "libANGLE/validationES31.h"
     33 #include "libANGLE/validationES32.h"
     34 
     35 using namespace gl;
     36 
     37 extern "C" {
     38 
     39 // GL_AMD_performance_monitor
     40 void GL_APIENTRY GL_BeginPerfMonitorAMD(GLuint monitor)
     41 {
     42    Context *context = GetValidGlobalContext();
     43    EVENT(context, GLBeginPerfMonitorAMD, "context = %d, monitor = %u", CID(context), monitor);
     44 
     45    if (context)
     46    {
     47        SCOPED_SHARE_CONTEXT_LOCK(context);
     48        bool isCallValid = (context->skipValidation() ||
     49                            ValidateBeginPerfMonitorAMD(
     50                                context, angle::EntryPoint::GLBeginPerfMonitorAMD, monitor));
     51        if (isCallValid)
     52        {
     53            context->beginPerfMonitor(monitor);
     54        }
     55        ANGLE_CAPTURE_GL(BeginPerfMonitorAMD, isCallValid, context, monitor);
     56    }
     57    else
     58    {
     59        GenerateContextLostErrorOnCurrentGlobalContext();
     60    }
     61 }
     62 
     63 void GL_APIENTRY GL_DeletePerfMonitorsAMD(GLsizei n, GLuint *monitors)
     64 {
     65    Context *context = GetValidGlobalContext();
     66    EVENT(context, GLDeletePerfMonitorsAMD, "context = %d, n = %d, monitors = 0x%016" PRIxPTR "",
     67          CID(context), n, (uintptr_t)monitors);
     68 
     69    if (context)
     70    {
     71        SCOPED_SHARE_CONTEXT_LOCK(context);
     72        bool isCallValid = (context->skipValidation() ||
     73                            ValidateDeletePerfMonitorsAMD(
     74                                context, angle::EntryPoint::GLDeletePerfMonitorsAMD, n, monitors));
     75        if (isCallValid)
     76        {
     77            context->deletePerfMonitors(n, monitors);
     78        }
     79        ANGLE_CAPTURE_GL(DeletePerfMonitorsAMD, isCallValid, context, n, monitors);
     80    }
     81    else
     82    {
     83        GenerateContextLostErrorOnCurrentGlobalContext();
     84    }
     85 }
     86 
     87 void GL_APIENTRY GL_EndPerfMonitorAMD(GLuint monitor)
     88 {
     89    Context *context = GetValidGlobalContext();
     90    EVENT(context, GLEndPerfMonitorAMD, "context = %d, monitor = %u", CID(context), monitor);
     91 
     92    if (context)
     93    {
     94        SCOPED_SHARE_CONTEXT_LOCK(context);
     95        bool isCallValid =
     96            (context->skipValidation() ||
     97             ValidateEndPerfMonitorAMD(context, angle::EntryPoint::GLEndPerfMonitorAMD, monitor));
     98        if (isCallValid)
     99        {
    100            context->endPerfMonitor(monitor);
    101        }
    102        ANGLE_CAPTURE_GL(EndPerfMonitorAMD, isCallValid, context, monitor);
    103    }
    104    else
    105    {
    106        GenerateContextLostErrorOnCurrentGlobalContext();
    107    }
    108 }
    109 
    110 void GL_APIENTRY GL_GenPerfMonitorsAMD(GLsizei n, GLuint *monitors)
    111 {
    112    Context *context = GetValidGlobalContext();
    113    EVENT(context, GLGenPerfMonitorsAMD, "context = %d, n = %d, monitors = 0x%016" PRIxPTR "",
    114          CID(context), n, (uintptr_t)monitors);
    115 
    116    if (context)
    117    {
    118        SCOPED_SHARE_CONTEXT_LOCK(context);
    119        bool isCallValid = (context->skipValidation() ||
    120                            ValidateGenPerfMonitorsAMD(
    121                                context, angle::EntryPoint::GLGenPerfMonitorsAMD, n, monitors));
    122        if (isCallValid)
    123        {
    124            context->genPerfMonitors(n, monitors);
    125        }
    126        ANGLE_CAPTURE_GL(GenPerfMonitorsAMD, isCallValid, context, n, monitors);
    127    }
    128    else
    129    {
    130        GenerateContextLostErrorOnCurrentGlobalContext();
    131    }
    132 }
    133 
    134 void GL_APIENTRY GL_GetPerfMonitorCounterDataAMD(GLuint monitor,
    135                                                 GLenum pname,
    136                                                 GLsizei dataSize,
    137                                                 GLuint *data,
    138                                                 GLint *bytesWritten)
    139 {
    140    Context *context = GetValidGlobalContext();
    141    EVENT(context, GLGetPerfMonitorCounterDataAMD,
    142          "context = %d, monitor = %u, pname = %s, dataSize = %d, data = 0x%016" PRIxPTR
    143          ", bytesWritten = 0x%016" PRIxPTR "",
    144          CID(context), monitor, GLenumToString(GLESEnum::AllEnums, pname), dataSize,
    145          (uintptr_t)data, (uintptr_t)bytesWritten);
    146 
    147    if (context)
    148    {
    149        SCOPED_SHARE_CONTEXT_LOCK(context);
    150        bool isCallValid = (context->skipValidation() ||
    151                            ValidateGetPerfMonitorCounterDataAMD(
    152                                context, angle::EntryPoint::GLGetPerfMonitorCounterDataAMD, monitor,
    153                                pname, dataSize, data, bytesWritten));
    154        if (isCallValid)
    155        {
    156            context->getPerfMonitorCounterData(monitor, pname, dataSize, data, bytesWritten);
    157        }
    158        ANGLE_CAPTURE_GL(GetPerfMonitorCounterDataAMD, isCallValid, context, monitor, pname,
    159                         dataSize, data, bytesWritten);
    160    }
    161    else
    162    {
    163        GenerateContextLostErrorOnCurrentGlobalContext();
    164    }
    165 }
    166 
    167 void GL_APIENTRY GL_GetPerfMonitorCounterInfoAMD(GLuint group,
    168                                                 GLuint counter,
    169                                                 GLenum pname,
    170                                                 void *data)
    171 {
    172    Context *context = GetValidGlobalContext();
    173    EVENT(context, GLGetPerfMonitorCounterInfoAMD,
    174          "context = %d, group = %u, counter = %u, pname = %s, data = 0x%016" PRIxPTR "",
    175          CID(context), group, counter, GLenumToString(GLESEnum::AllEnums, pname), (uintptr_t)data);
    176 
    177    if (context)
    178    {
    179        SCOPED_SHARE_CONTEXT_LOCK(context);
    180        bool isCallValid = (context->skipValidation() ||
    181                            ValidateGetPerfMonitorCounterInfoAMD(
    182                                context, angle::EntryPoint::GLGetPerfMonitorCounterInfoAMD, group,
    183                                counter, pname, data));
    184        if (isCallValid)
    185        {
    186            context->getPerfMonitorCounterInfo(group, counter, pname, data);
    187        }
    188        ANGLE_CAPTURE_GL(GetPerfMonitorCounterInfoAMD, isCallValid, context, group, counter, pname,
    189                         data);
    190    }
    191    else
    192    {
    193        GenerateContextLostErrorOnCurrentGlobalContext();
    194    }
    195 }
    196 
    197 void GL_APIENTRY GL_GetPerfMonitorCounterStringAMD(GLuint group,
    198                                                   GLuint counter,
    199                                                   GLsizei bufSize,
    200                                                   GLsizei *length,
    201                                                   GLchar *counterString)
    202 {
    203    Context *context = GetValidGlobalContext();
    204    EVENT(context, GLGetPerfMonitorCounterStringAMD,
    205          "context = %d, group = %u, counter = %u, bufSize = %d, length = 0x%016" PRIxPTR
    206          ", counterString = 0x%016" PRIxPTR "",
    207          CID(context), group, counter, bufSize, (uintptr_t)length, (uintptr_t)counterString);
    208 
    209    if (context)
    210    {
    211        SCOPED_SHARE_CONTEXT_LOCK(context);
    212        bool isCallValid = (context->skipValidation() ||
    213                            ValidateGetPerfMonitorCounterStringAMD(
    214                                context, angle::EntryPoint::GLGetPerfMonitorCounterStringAMD, group,
    215                                counter, bufSize, length, counterString));
    216        if (isCallValid)
    217        {
    218            context->getPerfMonitorCounterString(group, counter, bufSize, length, counterString);
    219        }
    220        ANGLE_CAPTURE_GL(GetPerfMonitorCounterStringAMD, isCallValid, context, group, counter,
    221                         bufSize, length, counterString);
    222    }
    223    else
    224    {
    225        GenerateContextLostErrorOnCurrentGlobalContext();
    226    }
    227 }
    228 
    229 void GL_APIENTRY GL_GetPerfMonitorCountersAMD(GLuint group,
    230                                              GLint *numCounters,
    231                                              GLint *maxActiveCounters,
    232                                              GLsizei counterSize,
    233                                              GLuint *counters)
    234 {
    235    Context *context = GetValidGlobalContext();
    236    EVENT(context, GLGetPerfMonitorCountersAMD,
    237          "context = %d, group = %u, numCounters = 0x%016" PRIxPTR
    238          ", maxActiveCounters = 0x%016" PRIxPTR ", counterSize = %d, counters = 0x%016" PRIxPTR "",
    239          CID(context), group, (uintptr_t)numCounters, (uintptr_t)maxActiveCounters, counterSize,
    240          (uintptr_t)counters);
    241 
    242    if (context)
    243    {
    244        SCOPED_SHARE_CONTEXT_LOCK(context);
    245        bool isCallValid = (context->skipValidation() ||
    246                            ValidateGetPerfMonitorCountersAMD(
    247                                context, angle::EntryPoint::GLGetPerfMonitorCountersAMD, group,
    248                                numCounters, maxActiveCounters, counterSize, counters));
    249        if (isCallValid)
    250        {
    251            context->getPerfMonitorCounters(group, numCounters, maxActiveCounters, counterSize,
    252                                            counters);
    253        }
    254        ANGLE_CAPTURE_GL(GetPerfMonitorCountersAMD, isCallValid, context, group, numCounters,
    255                         maxActiveCounters, counterSize, counters);
    256    }
    257    else
    258    {
    259        GenerateContextLostErrorOnCurrentGlobalContext();
    260    }
    261 }
    262 
    263 void GL_APIENTRY GL_GetPerfMonitorGroupStringAMD(GLuint group,
    264                                                 GLsizei bufSize,
    265                                                 GLsizei *length,
    266                                                 GLchar *groupString)
    267 {
    268    Context *context = GetValidGlobalContext();
    269    EVENT(context, GLGetPerfMonitorGroupStringAMD,
    270          "context = %d, group = %u, bufSize = %d, length = 0x%016" PRIxPTR
    271          ", groupString = 0x%016" PRIxPTR "",
    272          CID(context), group, bufSize, (uintptr_t)length, (uintptr_t)groupString);
    273 
    274    if (context)
    275    {
    276        SCOPED_SHARE_CONTEXT_LOCK(context);
    277        bool isCallValid = (context->skipValidation() ||
    278                            ValidateGetPerfMonitorGroupStringAMD(
    279                                context, angle::EntryPoint::GLGetPerfMonitorGroupStringAMD, group,
    280                                bufSize, length, groupString));
    281        if (isCallValid)
    282        {
    283            context->getPerfMonitorGroupString(group, bufSize, length, groupString);
    284        }
    285        ANGLE_CAPTURE_GL(GetPerfMonitorGroupStringAMD, isCallValid, context, group, bufSize, length,
    286                         groupString);
    287    }
    288    else
    289    {
    290        GenerateContextLostErrorOnCurrentGlobalContext();
    291    }
    292 }
    293 
    294 void GL_APIENTRY GL_GetPerfMonitorGroupsAMD(GLint *numGroups, GLsizei groupsSize, GLuint *groups)
    295 {
    296    Context *context = GetValidGlobalContext();
    297    EVENT(context, GLGetPerfMonitorGroupsAMD,
    298          "context = %d, numGroups = 0x%016" PRIxPTR ", groupsSize = %d, groups = 0x%016" PRIxPTR
    299          "",
    300          CID(context), (uintptr_t)numGroups, groupsSize, (uintptr_t)groups);
    301 
    302    if (context)
    303    {
    304        SCOPED_SHARE_CONTEXT_LOCK(context);
    305        bool isCallValid =
    306            (context->skipValidation() ||
    307             ValidateGetPerfMonitorGroupsAMD(context, angle::EntryPoint::GLGetPerfMonitorGroupsAMD,
    308                                             numGroups, groupsSize, groups));
    309        if (isCallValid)
    310        {
    311            context->getPerfMonitorGroups(numGroups, groupsSize, groups);
    312        }
    313        ANGLE_CAPTURE_GL(GetPerfMonitorGroupsAMD, isCallValid, context, numGroups, groupsSize,
    314                         groups);
    315    }
    316    else
    317    {
    318        GenerateContextLostErrorOnCurrentGlobalContext();
    319    }
    320 }
    321 
    322 void GL_APIENTRY GL_SelectPerfMonitorCountersAMD(GLuint monitor,
    323                                                 GLboolean enable,
    324                                                 GLuint group,
    325                                                 GLint numCounters,
    326                                                 GLuint *counterList)
    327 {
    328    Context *context = GetValidGlobalContext();
    329    EVENT(context, GLSelectPerfMonitorCountersAMD,
    330          "context = %d, monitor = %u, enable = %s, group = %u, numCounters = %d, counterList = "
    331          "0x%016" PRIxPTR "",
    332          CID(context), monitor, GLbooleanToString(enable), group, numCounters,
    333          (uintptr_t)counterList);
    334 
    335    if (context)
    336    {
    337        SCOPED_SHARE_CONTEXT_LOCK(context);
    338        bool isCallValid = (context->skipValidation() ||
    339                            ValidateSelectPerfMonitorCountersAMD(
    340                                context, angle::EntryPoint::GLSelectPerfMonitorCountersAMD, monitor,
    341                                enable, group, numCounters, counterList));
    342        if (isCallValid)
    343        {
    344            context->selectPerfMonitorCounters(monitor, enable, group, numCounters, counterList);
    345        }
    346        ANGLE_CAPTURE_GL(SelectPerfMonitorCountersAMD, isCallValid, context, monitor, enable, group,
    347                         numCounters, counterList);
    348    }
    349    else
    350    {
    351        GenerateContextLostErrorOnCurrentGlobalContext();
    352    }
    353 }
    354 
    355 // GL_ANDROID_extension_pack_es31a
    356 
    357 // GL_ANGLE_base_vertex_base_instance
    358 void GL_APIENTRY GL_DrawArraysInstancedBaseInstanceANGLE(GLenum mode,
    359                                                         GLint first,
    360                                                         GLsizei count,
    361                                                         GLsizei instanceCount,
    362                                                         GLuint baseInstance)
    363 {
    364    Context *context = GetValidGlobalContext();
    365    EVENT(context, GLDrawArraysInstancedBaseInstanceANGLE,
    366          "context = %d, mode = %s, first = %d, count = %d, instanceCount = %d, baseInstance = %u",
    367          CID(context), GLenumToString(GLESEnum::PrimitiveType, mode), first, count, instanceCount,
    368          baseInstance);
    369 
    370    if (context)
    371    {
    372        PrimitiveMode modePacked = PackParam<PrimitiveMode>(mode);
    373        SCOPED_SHARE_CONTEXT_LOCK(context);
    374        bool isCallValid = (context->skipValidation() ||
    375                            ValidateDrawArraysInstancedBaseInstanceANGLE(
    376                                context, angle::EntryPoint::GLDrawArraysInstancedBaseInstanceANGLE,
    377                                modePacked, first, count, instanceCount, baseInstance));
    378        if (isCallValid)
    379        {
    380            context->drawArraysInstancedBaseInstanceANGLE(modePacked, first, count, instanceCount,
    381                                                          baseInstance);
    382        }
    383        ANGLE_CAPTURE_GL(DrawArraysInstancedBaseInstanceANGLE, isCallValid, context, modePacked,
    384                         first, count, instanceCount, baseInstance);
    385    }
    386    else
    387    {
    388        GenerateContextLostErrorOnCurrentGlobalContext();
    389    }
    390 }
    391 
    392 void GL_APIENTRY GL_DrawElementsInstancedBaseVertexBaseInstanceANGLE(GLenum mode,
    393                                                                     GLsizei count,
    394                                                                     GLenum type,
    395                                                                     const GLvoid *indices,
    396                                                                     GLsizei instanceCount,
    397                                                                     GLint baseVertex,
    398                                                                     GLuint baseInstance)
    399 {
    400    Context *context = GetValidGlobalContext();
    401    EVENT(context, GLDrawElementsInstancedBaseVertexBaseInstanceANGLE,
    402          "context = %d, mode = %s, count = %d, type = %s, indices = 0x%016" PRIxPTR
    403          ", instanceCount = %d, baseVertex = %d, baseInstance = %u",
    404          CID(context), GLenumToString(GLESEnum::PrimitiveType, mode), count,
    405          GLenumToString(GLESEnum::DrawElementsType, type), (uintptr_t)indices, instanceCount,
    406          baseVertex, baseInstance);
    407 
    408    if (context)
    409    {
    410        PrimitiveMode modePacked    = PackParam<PrimitiveMode>(mode);
    411        DrawElementsType typePacked = PackParam<DrawElementsType>(type);
    412        SCOPED_SHARE_CONTEXT_LOCK(context);
    413        bool isCallValid =
    414            (context->skipValidation() ||
    415             ValidateDrawElementsInstancedBaseVertexBaseInstanceANGLE(
    416                 context, angle::EntryPoint::GLDrawElementsInstancedBaseVertexBaseInstanceANGLE,
    417                 modePacked, count, typePacked, indices, instanceCount, baseVertex, baseInstance));
    418        if (isCallValid)
    419        {
    420            context->drawElementsInstancedBaseVertexBaseInstanceANGLE(
    421                modePacked, count, typePacked, indices, instanceCount, baseVertex, baseInstance);
    422        }
    423        ANGLE_CAPTURE_GL(DrawElementsInstancedBaseVertexBaseInstanceANGLE, isCallValid, context,
    424                         modePacked, count, typePacked, indices, instanceCount, baseVertex,
    425                         baseInstance);
    426    }
    427    else
    428    {
    429        GenerateContextLostErrorOnCurrentGlobalContext();
    430    }
    431 }
    432 
    433 void GL_APIENTRY GL_MultiDrawArraysInstancedBaseInstanceANGLE(GLenum mode,
    434                                                              const GLint *firsts,
    435                                                              const GLsizei *counts,
    436                                                              const GLsizei *instanceCounts,
    437                                                              const GLuint *baseInstances,
    438                                                              GLsizei drawcount)
    439 {
    440    Context *context = GetValidGlobalContext();
    441    EVENT(context, GLMultiDrawArraysInstancedBaseInstanceANGLE,
    442          "context = %d, mode = %s, firsts = 0x%016" PRIxPTR ", counts = 0x%016" PRIxPTR
    443          ", instanceCounts = 0x%016" PRIxPTR ", baseInstances = 0x%016" PRIxPTR ", drawcount = %d",
    444          CID(context), GLenumToString(GLESEnum::PrimitiveType, mode), (uintptr_t)firsts,
    445          (uintptr_t)counts, (uintptr_t)instanceCounts, (uintptr_t)baseInstances, drawcount);
    446 
    447    if (context)
    448    {
    449        PrimitiveMode modePacked = PackParam<PrimitiveMode>(mode);
    450        SCOPED_SHARE_CONTEXT_LOCK(context);
    451        bool isCallValid =
    452            (context->skipValidation() ||
    453             ValidateMultiDrawArraysInstancedBaseInstanceANGLE(
    454                 context, angle::EntryPoint::GLMultiDrawArraysInstancedBaseInstanceANGLE,
    455                 modePacked, firsts, counts, instanceCounts, baseInstances, drawcount));
    456        if (isCallValid)
    457        {
    458            context->multiDrawArraysInstancedBaseInstance(modePacked, firsts, counts,
    459                                                          instanceCounts, baseInstances, drawcount);
    460        }
    461        ANGLE_CAPTURE_GL(MultiDrawArraysInstancedBaseInstanceANGLE, isCallValid, context,
    462                         modePacked, firsts, counts, instanceCounts, baseInstances, drawcount);
    463    }
    464    else
    465    {
    466        GenerateContextLostErrorOnCurrentGlobalContext();
    467    }
    468 }
    469 
    470 void GL_APIENTRY
    471 GL_MultiDrawElementsInstancedBaseVertexBaseInstanceANGLE(GLenum mode,
    472                                                         const GLsizei *counts,
    473                                                         GLenum type,
    474                                                         const GLvoid *const *indices,
    475                                                         const GLsizei *instanceCounts,
    476                                                         const GLint *baseVertices,
    477                                                         const GLuint *baseInstances,
    478                                                         GLsizei drawcount)
    479 {
    480    Context *context = GetValidGlobalContext();
    481    EVENT(context, GLMultiDrawElementsInstancedBaseVertexBaseInstanceANGLE,
    482          "context = %d, mode = %s, counts = 0x%016" PRIxPTR ", type = %s, indices = 0x%016" PRIxPTR
    483          ", instanceCounts = 0x%016" PRIxPTR ", baseVertices = 0x%016" PRIxPTR
    484          ", baseInstances = 0x%016" PRIxPTR ", drawcount = %d",
    485          CID(context), GLenumToString(GLESEnum::PrimitiveType, mode), (uintptr_t)counts,
    486          GLenumToString(GLESEnum::DrawElementsType, type), (uintptr_t)indices,
    487          (uintptr_t)instanceCounts, (uintptr_t)baseVertices, (uintptr_t)baseInstances, drawcount);
    488 
    489    if (context)
    490    {
    491        PrimitiveMode modePacked    = PackParam<PrimitiveMode>(mode);
    492        DrawElementsType typePacked = PackParam<DrawElementsType>(type);
    493        SCOPED_SHARE_CONTEXT_LOCK(context);
    494        bool isCallValid =
    495            (context->skipValidation() ||
    496             ValidateMultiDrawElementsInstancedBaseVertexBaseInstanceANGLE(
    497                 context,
    498                 angle::EntryPoint::GLMultiDrawElementsInstancedBaseVertexBaseInstanceANGLE,
    499                 modePacked, counts, typePacked, indices, instanceCounts, baseVertices,
    500                 baseInstances, drawcount));
    501        if (isCallValid)
    502        {
    503            context->multiDrawElementsInstancedBaseVertexBaseInstance(
    504                modePacked, counts, typePacked, indices, instanceCounts, baseVertices,
    505                baseInstances, drawcount);
    506        }
    507        ANGLE_CAPTURE_GL(MultiDrawElementsInstancedBaseVertexBaseInstanceANGLE, isCallValid,
    508                         context, modePacked, counts, typePacked, indices, instanceCounts,
    509                         baseVertices, baseInstances, drawcount);
    510    }
    511    else
    512    {
    513        GenerateContextLostErrorOnCurrentGlobalContext();
    514    }
    515 }
    516 
    517 // GL_ANGLE_copy_texture_3d
    518 void GL_APIENTRY GL_CopyTexture3DANGLE(GLuint sourceId,
    519                                       GLint sourceLevel,
    520                                       GLenum destTarget,
    521                                       GLuint destId,
    522                                       GLint destLevel,
    523                                       GLint internalFormat,
    524                                       GLenum destType,
    525                                       GLboolean unpackFlipY,
    526                                       GLboolean unpackPremultiplyAlpha,
    527                                       GLboolean unpackUnmultiplyAlpha)
    528 {
    529    Context *context = GetValidGlobalContext();
    530    EVENT(context, GLCopyTexture3DANGLE,
    531          "context = %d, sourceId = %u, sourceLevel = %d, destTarget = %s, destId = %u, destLevel "
    532          "= %d, internalFormat = %d, destType = %s, unpackFlipY = %s, unpackPremultiplyAlpha = "
    533          "%s, unpackUnmultiplyAlpha = %s",
    534          CID(context), sourceId, sourceLevel, GLenumToString(GLESEnum::AllEnums, destTarget),
    535          destId, destLevel, internalFormat, GLenumToString(GLESEnum::AllEnums, destType),
    536          GLbooleanToString(unpackFlipY), GLbooleanToString(unpackPremultiplyAlpha),
    537          GLbooleanToString(unpackUnmultiplyAlpha));
    538 
    539    if (context)
    540    {
    541        TextureID sourceIdPacked       = PackParam<TextureID>(sourceId);
    542        TextureTarget destTargetPacked = PackParam<TextureTarget>(destTarget);
    543        TextureID destIdPacked         = PackParam<TextureID>(destId);
    544        SCOPED_SHARE_CONTEXT_LOCK(context);
    545        bool isCallValid =
    546            (context->skipValidation() ||
    547             ValidateCopyTexture3DANGLE(context, angle::EntryPoint::GLCopyTexture3DANGLE,
    548                                        sourceIdPacked, sourceLevel, destTargetPacked, destIdPacked,
    549                                        destLevel, internalFormat, destType, unpackFlipY,
    550                                        unpackPremultiplyAlpha, unpackUnmultiplyAlpha));
    551        if (isCallValid)
    552        {
    553            context->copyTexture3D(sourceIdPacked, sourceLevel, destTargetPacked, destIdPacked,
    554                                   destLevel, internalFormat, destType, unpackFlipY,
    555                                   unpackPremultiplyAlpha, unpackUnmultiplyAlpha);
    556        }
    557        ANGLE_CAPTURE_GL(CopyTexture3DANGLE, isCallValid, context, sourceIdPacked, sourceLevel,
    558                         destTargetPacked, destIdPacked, destLevel, internalFormat, destType,
    559                         unpackFlipY, unpackPremultiplyAlpha, unpackUnmultiplyAlpha);
    560    }
    561    else
    562    {
    563        GenerateContextLostErrorOnCurrentGlobalContext();
    564    }
    565 }
    566 
    567 void GL_APIENTRY GL_CopySubTexture3DANGLE(GLuint sourceId,
    568                                          GLint sourceLevel,
    569                                          GLenum destTarget,
    570                                          GLuint destId,
    571                                          GLint destLevel,
    572                                          GLint xoffset,
    573                                          GLint yoffset,
    574                                          GLint zoffset,
    575                                          GLint x,
    576                                          GLint y,
    577                                          GLint z,
    578                                          GLint width,
    579                                          GLint height,
    580                                          GLint depth,
    581                                          GLboolean unpackFlipY,
    582                                          GLboolean unpackPremultiplyAlpha,
    583                                          GLboolean unpackUnmultiplyAlpha)
    584 {
    585    Context *context = GetValidGlobalContext();
    586    EVENT(context, GLCopySubTexture3DANGLE,
    587          "context = %d, sourceId = %u, sourceLevel = %d, destTarget = %s, destId = %u, destLevel "
    588          "= %d, xoffset = %d, yoffset = %d, zoffset = %d, x = %d, y = %d, z = %d, width = %d, "
    589          "height = %d, depth = %d, unpackFlipY = %s, unpackPremultiplyAlpha = %s, "
    590          "unpackUnmultiplyAlpha = %s",
    591          CID(context), sourceId, sourceLevel, GLenumToString(GLESEnum::AllEnums, destTarget),
    592          destId, destLevel, xoffset, yoffset, zoffset, x, y, z, width, height, depth,
    593          GLbooleanToString(unpackFlipY), GLbooleanToString(unpackPremultiplyAlpha),
    594          GLbooleanToString(unpackUnmultiplyAlpha));
    595 
    596    if (context)
    597    {
    598        TextureID sourceIdPacked       = PackParam<TextureID>(sourceId);
    599        TextureTarget destTargetPacked = PackParam<TextureTarget>(destTarget);
    600        TextureID destIdPacked         = PackParam<TextureID>(destId);
    601        SCOPED_SHARE_CONTEXT_LOCK(context);
    602        bool isCallValid =
    603            (context->skipValidation() ||
    604             ValidateCopySubTexture3DANGLE(
    605                 context, angle::EntryPoint::GLCopySubTexture3DANGLE, sourceIdPacked, sourceLevel,
    606                 destTargetPacked, destIdPacked, destLevel, xoffset, yoffset, zoffset, x, y, z,
    607                 width, height, depth, unpackFlipY, unpackPremultiplyAlpha, unpackUnmultiplyAlpha));
    608        if (isCallValid)
    609        {
    610            context->copySubTexture3D(sourceIdPacked, sourceLevel, destTargetPacked, destIdPacked,
    611                                      destLevel, xoffset, yoffset, zoffset, x, y, z, width, height,
    612                                      depth, unpackFlipY, unpackPremultiplyAlpha,
    613                                      unpackUnmultiplyAlpha);
    614        }
    615        ANGLE_CAPTURE_GL(CopySubTexture3DANGLE, isCallValid, context, sourceIdPacked, sourceLevel,
    616                         destTargetPacked, destIdPacked, destLevel, xoffset, yoffset, zoffset, x, y,
    617                         z, width, height, depth, unpackFlipY, unpackPremultiplyAlpha,
    618                         unpackUnmultiplyAlpha);
    619    }
    620    else
    621    {
    622        GenerateContextLostErrorOnCurrentGlobalContext();
    623    }
    624 }
    625 
    626 // GL_ANGLE_depth_texture
    627 
    628 // GL_ANGLE_framebuffer_blit
    629 void GL_APIENTRY GL_BlitFramebufferANGLE(GLint srcX0,
    630                                         GLint srcY0,
    631                                         GLint srcX1,
    632                                         GLint srcY1,
    633                                         GLint dstX0,
    634                                         GLint dstY0,
    635                                         GLint dstX1,
    636                                         GLint dstY1,
    637                                         GLbitfield mask,
    638                                         GLenum filter)
    639 {
    640    Context *context = GetValidGlobalContext();
    641    EVENT(context, GLBlitFramebufferANGLE,
    642          "context = %d, srcX0 = %d, srcY0 = %d, srcX1 = %d, srcY1 = %d, dstX0 = %d, dstY0 = %d, "
    643          "dstX1 = %d, dstY1 = %d, mask = %s, filter = %s",
    644          CID(context), srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1,
    645          GLbitfieldToString(GLESEnum::ClearBufferMask, mask).c_str(),
    646          GLenumToString(GLESEnum::BlitFramebufferFilter, filter));
    647 
    648    if (context)
    649    {
    650        SCOPED_SHARE_CONTEXT_LOCK(context);
    651        bool isCallValid = (context->skipValidation() ||
    652                            ValidateBlitFramebufferANGLE(
    653                                context, angle::EntryPoint::GLBlitFramebufferANGLE, srcX0, srcY0,
    654                                srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter));
    655        if (isCallValid)
    656        {
    657            context->blitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask,
    658                                     filter);
    659        }
    660        ANGLE_CAPTURE_GL(BlitFramebufferANGLE, isCallValid, context, srcX0, srcY0, srcX1, srcY1,
    661                         dstX0, dstY0, dstX1, dstY1, mask, filter);
    662    }
    663    else
    664    {
    665        GenerateContextLostErrorOnCurrentGlobalContext();
    666    }
    667 }
    668 
    669 // GL_ANGLE_framebuffer_multisample
    670 void GL_APIENTRY GL_RenderbufferStorageMultisampleANGLE(GLenum target,
    671                                                        GLsizei samples,
    672                                                        GLenum internalformat,
    673                                                        GLsizei width,
    674                                                        GLsizei height)
    675 {
    676    Context *context = GetValidGlobalContext();
    677    EVENT(context, GLRenderbufferStorageMultisampleANGLE,
    678          "context = %d, target = %s, samples = %d, internalformat = %s, width = %d, height = %d",
    679          CID(context), GLenumToString(GLESEnum::RenderbufferTarget, target), samples,
    680          GLenumToString(GLESEnum::InternalFormat, internalformat), width, height);
    681 
    682    if (context)
    683    {
    684        SCOPED_SHARE_CONTEXT_LOCK(context);
    685        bool isCallValid = (context->skipValidation() ||
    686                            ValidateRenderbufferStorageMultisampleANGLE(
    687                                context, angle::EntryPoint::GLRenderbufferStorageMultisampleANGLE,
    688                                target, samples, internalformat, width, height));
    689        if (isCallValid)
    690        {
    691            context->renderbufferStorageMultisample(target, samples, internalformat, width, height);
    692        }
    693        ANGLE_CAPTURE_GL(RenderbufferStorageMultisampleANGLE, isCallValid, context, target, samples,
    694                         internalformat, width, height);
    695    }
    696    else
    697    {
    698        GenerateContextLostErrorOnCurrentGlobalContext();
    699    }
    700 }
    701 
    702 // GL_ANGLE_get_image
    703 void GL_APIENTRY
    704 GL_GetTexImageANGLE(GLenum target, GLint level, GLenum format, GLenum type, void *pixels)
    705 {
    706    Context *context = GetValidGlobalContext();
    707    EVENT(context, GLGetTexImageANGLE,
    708          "context = %d, target = %s, level = %d, format = %s, type = %s, pixels = 0x%016" PRIxPTR
    709          "",
    710          CID(context), GLenumToString(GLESEnum::TextureTarget, target), level,
    711          GLenumToString(GLESEnum::PixelFormat, format), GLenumToString(GLESEnum::PixelType, type),
    712          (uintptr_t)pixels);
    713 
    714    if (context)
    715    {
    716        TextureTarget targetPacked = PackParam<TextureTarget>(target);
    717        SCOPED_SHARE_CONTEXT_LOCK(context);
    718        bool isCallValid = (context->skipValidation() ||
    719                            ValidateGetTexImageANGLE(context, angle::EntryPoint::GLGetTexImageANGLE,
    720                                                     targetPacked, level, format, type, pixels));
    721        if (isCallValid)
    722        {
    723            context->getTexImage(targetPacked, level, format, type, pixels);
    724        }
    725        ANGLE_CAPTURE_GL(GetTexImageANGLE, isCallValid, context, targetPacked, level, format, type,
    726                         pixels);
    727    }
    728    else
    729    {
    730        GenerateContextLostErrorOnCurrentGlobalContext();
    731    }
    732 }
    733 
    734 void GL_APIENTRY GL_GetCompressedTexImageANGLE(GLenum target, GLint level, void *pixels)
    735 {
    736    Context *context = GetValidGlobalContext();
    737    EVENT(context, GLGetCompressedTexImageANGLE,
    738          "context = %d, target = %s, level = %d, pixels = 0x%016" PRIxPTR "", CID(context),
    739          GLenumToString(GLESEnum::TextureTarget, target), level, (uintptr_t)pixels);
    740 
    741    if (context)
    742    {
    743        TextureTarget targetPacked = PackParam<TextureTarget>(target);
    744        SCOPED_SHARE_CONTEXT_LOCK(context);
    745        bool isCallValid = (context->skipValidation() ||
    746                            ValidateGetCompressedTexImageANGLE(
    747                                context, angle::EntryPoint::GLGetCompressedTexImageANGLE,
    748                                targetPacked, level, pixels));
    749        if (isCallValid)
    750        {
    751            context->getCompressedTexImage(targetPacked, level, pixels);
    752        }
    753        ANGLE_CAPTURE_GL(GetCompressedTexImageANGLE, isCallValid, context, targetPacked, level,
    754                         pixels);
    755    }
    756    else
    757    {
    758        GenerateContextLostErrorOnCurrentGlobalContext();
    759    }
    760 }
    761 
    762 void GL_APIENTRY GL_GetRenderbufferImageANGLE(GLenum target,
    763                                              GLenum format,
    764                                              GLenum type,
    765                                              void *pixels)
    766 {
    767    Context *context = GetValidGlobalContext();
    768    EVENT(context, GLGetRenderbufferImageANGLE,
    769          "context = %d, target = %s, format = %s, type = %s, pixels = 0x%016" PRIxPTR "",
    770          CID(context), GLenumToString(GLESEnum::RenderbufferTarget, target),
    771          GLenumToString(GLESEnum::PixelFormat, format), GLenumToString(GLESEnum::PixelType, type),
    772          (uintptr_t)pixels);
    773 
    774    if (context)
    775    {
    776        SCOPED_SHARE_CONTEXT_LOCK(context);
    777        bool isCallValid = (context->skipValidation() ||
    778                            ValidateGetRenderbufferImageANGLE(
    779                                context, angle::EntryPoint::GLGetRenderbufferImageANGLE, target,
    780                                format, type, pixels));
    781        if (isCallValid)
    782        {
    783            context->getRenderbufferImage(target, format, type, pixels);
    784        }
    785        ANGLE_CAPTURE_GL(GetRenderbufferImageANGLE, isCallValid, context, target, format, type,
    786                         pixels);
    787    }
    788    else
    789    {
    790        GenerateContextLostErrorOnCurrentGlobalContext();
    791    }
    792 }
    793 
    794 // GL_ANGLE_get_tex_level_parameter
    795 void GL_APIENTRY GL_GetTexLevelParameterivANGLE(GLenum target,
    796                                                GLint level,
    797                                                GLenum pname,
    798                                                GLint *params)
    799 {
    800    Context *context = GetValidGlobalContext();
    801    EVENT(context, GLGetTexLevelParameterivANGLE,
    802          "context = %d, target = %s, level = %d, pname = %s, params = 0x%016" PRIxPTR "",
    803          CID(context), GLenumToString(GLESEnum::TextureTarget, target), level,
    804          GLenumToString(GLESEnum::GetTextureParameter, pname), (uintptr_t)params);
    805 
    806    if (context)
    807    {
    808        TextureTarget targetPacked = PackParam<TextureTarget>(target);
    809        SCOPED_SHARE_CONTEXT_LOCK(context);
    810        bool isCallValid = (context->skipValidation() ||
    811                            ValidateGetTexLevelParameterivANGLE(
    812                                context, angle::EntryPoint::GLGetTexLevelParameterivANGLE,
    813                                targetPacked, level, pname, params));
    814        if (isCallValid)
    815        {
    816            context->getTexLevelParameteriv(targetPacked, level, pname, params);
    817        }
    818        ANGLE_CAPTURE_GL(GetTexLevelParameterivANGLE, isCallValid, context, targetPacked, level,
    819                         pname, params);
    820    }
    821    else
    822    {
    823        GenerateContextLostErrorOnCurrentGlobalContext();
    824    }
    825 }
    826 
    827 void GL_APIENTRY GL_GetTexLevelParameterfvANGLE(GLenum target,
    828                                                GLint level,
    829                                                GLenum pname,
    830                                                GLfloat *params)
    831 {
    832    Context *context = GetValidGlobalContext();
    833    EVENT(context, GLGetTexLevelParameterfvANGLE,
    834          "context = %d, target = %s, level = %d, pname = %s, params = 0x%016" PRIxPTR "",
    835          CID(context), GLenumToString(GLESEnum::AllEnums, target), level,
    836          GLenumToString(GLESEnum::AllEnums, pname), (uintptr_t)params);
    837 
    838    if (context)
    839    {
    840        TextureTarget targetPacked = PackParam<TextureTarget>(target);
    841        SCOPED_SHARE_CONTEXT_LOCK(context);
    842        bool isCallValid = (context->skipValidation() ||
    843                            ValidateGetTexLevelParameterfvANGLE(
    844                                context, angle::EntryPoint::GLGetTexLevelParameterfvANGLE,
    845                                targetPacked, level, pname, params));
    846        if (isCallValid)
    847        {
    848            context->getTexLevelParameterfv(targetPacked, level, pname, params);
    849        }
    850        ANGLE_CAPTURE_GL(GetTexLevelParameterfvANGLE, isCallValid, context, targetPacked, level,
    851                         pname, params);
    852    }
    853    else
    854    {
    855        GenerateContextLostErrorOnCurrentGlobalContext();
    856    }
    857 }
    858 
    859 // GL_ANGLE_instanced_arrays
    860 void GL_APIENTRY GL_DrawArraysInstancedANGLE(GLenum mode,
    861                                             GLint first,
    862                                             GLsizei count,
    863                                             GLsizei primcount)
    864 {
    865    Context *context = GetValidGlobalContext();
    866    EVENT(context, GLDrawArraysInstancedANGLE,
    867          "context = %d, mode = %s, first = %d, count = %d, primcount = %d", CID(context),
    868          GLenumToString(GLESEnum::PrimitiveType, mode), first, count, primcount);
    869 
    870    if (context)
    871    {
    872        PrimitiveMode modePacked = PackParam<PrimitiveMode>(mode);
    873        SCOPED_SHARE_CONTEXT_LOCK(context);
    874        bool isCallValid = (context->skipValidation() ||
    875                            ValidateDrawArraysInstancedANGLE(
    876                                context, angle::EntryPoint::GLDrawArraysInstancedANGLE, modePacked,
    877                                first, count, primcount));
    878        if (isCallValid)
    879        {
    880            context->drawArraysInstanced(modePacked, first, count, primcount);
    881        }
    882        ANGLE_CAPTURE_GL(DrawArraysInstancedANGLE, isCallValid, context, modePacked, first, count,
    883                         primcount);
    884    }
    885    else
    886    {
    887        GenerateContextLostErrorOnCurrentGlobalContext();
    888    }
    889 }
    890 
    891 void GL_APIENTRY GL_DrawElementsInstancedANGLE(GLenum mode,
    892                                               GLsizei count,
    893                                               GLenum type,
    894                                               const void *indices,
    895                                               GLsizei primcount)
    896 {
    897    Context *context = GetValidGlobalContext();
    898    EVENT(context, GLDrawElementsInstancedANGLE,
    899          "context = %d, mode = %s, count = %d, type = %s, indices = 0x%016" PRIxPTR
    900          ", primcount = %d",
    901          CID(context), GLenumToString(GLESEnum::PrimitiveType, mode), count,
    902          GLenumToString(GLESEnum::PrimitiveType, type), (uintptr_t)indices, primcount);
    903 
    904    if (context)
    905    {
    906        PrimitiveMode modePacked    = PackParam<PrimitiveMode>(mode);
    907        DrawElementsType typePacked = PackParam<DrawElementsType>(type);
    908        SCOPED_SHARE_CONTEXT_LOCK(context);
    909        bool isCallValid = (context->skipValidation() ||
    910                            ValidateDrawElementsInstancedANGLE(
    911                                context, angle::EntryPoint::GLDrawElementsInstancedANGLE,
    912                                modePacked, count, typePacked, indices, primcount));
    913        if (isCallValid)
    914        {
    915            context->drawElementsInstanced(modePacked, count, typePacked, indices, primcount);
    916        }
    917        ANGLE_CAPTURE_GL(DrawElementsInstancedANGLE, isCallValid, context, modePacked, count,
    918                         typePacked, indices, primcount);
    919    }
    920    else
    921    {
    922        GenerateContextLostErrorOnCurrentGlobalContext();
    923    }
    924 }
    925 
    926 void GL_APIENTRY GL_VertexAttribDivisorANGLE(GLuint index, GLuint divisor)
    927 {
    928    Context *context = GetValidGlobalContext();
    929    EVENT(context, GLVertexAttribDivisorANGLE, "context = %d, index = %u, divisor = %u",
    930          CID(context), index, divisor);
    931 
    932    if (context)
    933    {
    934        SCOPED_SHARE_CONTEXT_LOCK(context);
    935        bool isCallValid =
    936            (context->skipValidation() ||
    937             ValidateVertexAttribDivisorANGLE(
    938                 context, angle::EntryPoint::GLVertexAttribDivisorANGLE, index, divisor));
    939        if (isCallValid)
    940        {
    941            context->vertexAttribDivisor(index, divisor);
    942        }
    943        ANGLE_CAPTURE_GL(VertexAttribDivisorANGLE, isCallValid, context, index, divisor);
    944    }
    945    else
    946    {
    947        GenerateContextLostErrorOnCurrentGlobalContext();
    948    }
    949 }
    950 
    951 // GL_ANGLE_logic_op
    952 void GL_APIENTRY GL_LogicOpANGLE(GLenum opcode)
    953 {
    954    Context *context = GetValidGlobalContext();
    955    EVENT(context, GLLogicOpANGLE, "context = %d, opcode = %s", CID(context),
    956          GLenumToString(GLESEnum::LogicOp, opcode));
    957 
    958    if (context)
    959    {
    960        LogicalOperation opcodePacked = PackParam<LogicalOperation>(opcode);
    961        SCOPED_SHARE_CONTEXT_LOCK(context);
    962        bool isCallValid =
    963            (context->skipValidation() ||
    964             ValidateLogicOpANGLE(context, angle::EntryPoint::GLLogicOpANGLE, opcodePacked));
    965        if (isCallValid)
    966        {
    967            context->logicOpANGLE(opcodePacked);
    968        }
    969        ANGLE_CAPTURE_GL(LogicOpANGLE, isCallValid, context, opcodePacked);
    970    }
    971    else
    972    {
    973        GenerateContextLostErrorOnCurrentGlobalContext();
    974    }
    975 }
    976 
    977 // GL_ANGLE_memory_object_flags
    978 void GL_APIENTRY GL_TexStorageMemFlags2DANGLE(GLenum target,
    979                                              GLsizei levels,
    980                                              GLenum internalFormat,
    981                                              GLsizei width,
    982                                              GLsizei height,
    983                                              GLuint memory,
    984                                              GLuint64 offset,
    985                                              GLbitfield createFlags,
    986                                              GLbitfield usageFlags,
    987                                              const void *imageCreateInfoPNext)
    988 {
    989    Context *context = GetValidGlobalContext();
    990    EVENT(context, GLTexStorageMemFlags2DANGLE,
    991          "context = %d, target = %s, levels = %d, internalFormat = %s, width = %d, height = %d, "
    992          "memory = %u, offset = %llu, createFlags = %s, usageFlags = %s, imageCreateInfoPNext = "
    993          "0x%016" PRIxPTR "",
    994          CID(context), GLenumToString(GLESEnum::TextureTarget, target), levels,
    995          GLenumToString(GLESEnum::AllEnums, internalFormat), width, height, memory,
    996          static_cast<unsigned long long>(offset),
    997          GLbitfieldToString(GLESEnum::AllEnums, createFlags).c_str(),
    998          GLbitfieldToString(GLESEnum::AllEnums, usageFlags).c_str(),
    999          (uintptr_t)imageCreateInfoPNext);
   1000 
   1001    if (context)
   1002    {
   1003        TextureType targetPacked    = PackParam<TextureType>(target);
   1004        MemoryObjectID memoryPacked = PackParam<MemoryObjectID>(memory);
   1005        SCOPED_SHARE_CONTEXT_LOCK(context);
   1006        bool isCallValid = (context->skipValidation() ||
   1007                            ValidateTexStorageMemFlags2DANGLE(
   1008                                context, angle::EntryPoint::GLTexStorageMemFlags2DANGLE,
   1009                                targetPacked, levels, internalFormat, width, height, memoryPacked,
   1010                                offset, createFlags, usageFlags, imageCreateInfoPNext));
   1011        if (isCallValid)
   1012        {
   1013            context->texStorageMemFlags2D(targetPacked, levels, internalFormat, width, height,
   1014                                          memoryPacked, offset, createFlags, usageFlags,
   1015                                          imageCreateInfoPNext);
   1016        }
   1017        ANGLE_CAPTURE_GL(TexStorageMemFlags2DANGLE, isCallValid, context, targetPacked, levels,
   1018                         internalFormat, width, height, memoryPacked, offset, createFlags,
   1019                         usageFlags, imageCreateInfoPNext);
   1020    }
   1021    else
   1022    {
   1023        GenerateContextLostErrorOnCurrentGlobalContext();
   1024    }
   1025 }
   1026 
   1027 void GL_APIENTRY GL_TexStorageMemFlags2DMultisampleANGLE(GLenum target,
   1028                                                         GLsizei samples,
   1029                                                         GLenum internalFormat,
   1030                                                         GLsizei width,
   1031                                                         GLsizei height,
   1032                                                         GLboolean fixedSampleLocations,
   1033                                                         GLuint memory,
   1034                                                         GLuint64 offset,
   1035                                                         GLbitfield createFlags,
   1036                                                         GLbitfield usageFlags,
   1037                                                         const void *imageCreateInfoPNext)
   1038 {
   1039    Context *context = GetValidGlobalContext();
   1040    EVENT(context, GLTexStorageMemFlags2DMultisampleANGLE,
   1041          "context = %d, target = %s, samples = %d, internalFormat = %s, width = %d, height = %d, "
   1042          "fixedSampleLocations = %s, memory = %u, offset = %llu, createFlags = %s, usageFlags = "
   1043          "%s, imageCreateInfoPNext = 0x%016" PRIxPTR "",
   1044          CID(context), GLenumToString(GLESEnum::TextureTarget, target), samples,
   1045          GLenumToString(GLESEnum::AllEnums, internalFormat), width, height,
   1046          GLbooleanToString(fixedSampleLocations), memory, static_cast<unsigned long long>(offset),
   1047          GLbitfieldToString(GLESEnum::AllEnums, createFlags).c_str(),
   1048          GLbitfieldToString(GLESEnum::AllEnums, usageFlags).c_str(),
   1049          (uintptr_t)imageCreateInfoPNext);
   1050 
   1051    if (context)
   1052    {
   1053        TextureType targetPacked    = PackParam<TextureType>(target);
   1054        MemoryObjectID memoryPacked = PackParam<MemoryObjectID>(memory);
   1055        SCOPED_SHARE_CONTEXT_LOCK(context);
   1056        bool isCallValid =
   1057            (context->skipValidation() ||
   1058             ValidateTexStorageMemFlags2DMultisampleANGLE(
   1059                 context, angle::EntryPoint::GLTexStorageMemFlags2DMultisampleANGLE, targetPacked,
   1060                 samples, internalFormat, width, height, fixedSampleLocations, memoryPacked, offset,
   1061                 createFlags, usageFlags, imageCreateInfoPNext));
   1062        if (isCallValid)
   1063        {
   1064            context->texStorageMemFlags2DMultisample(
   1065                targetPacked, samples, internalFormat, width, height, fixedSampleLocations,
   1066                memoryPacked, offset, createFlags, usageFlags, imageCreateInfoPNext);
   1067        }
   1068        ANGLE_CAPTURE_GL(TexStorageMemFlags2DMultisampleANGLE, isCallValid, context, targetPacked,
   1069                         samples, internalFormat, width, height, fixedSampleLocations, memoryPacked,
   1070                         offset, createFlags, usageFlags, imageCreateInfoPNext);
   1071    }
   1072    else
   1073    {
   1074        GenerateContextLostErrorOnCurrentGlobalContext();
   1075    }
   1076 }
   1077 
   1078 void GL_APIENTRY GL_TexStorageMemFlags3DANGLE(GLenum target,
   1079                                              GLsizei levels,
   1080                                              GLenum internalFormat,
   1081                                              GLsizei width,
   1082                                              GLsizei height,
   1083                                              GLsizei depth,
   1084                                              GLuint memory,
   1085                                              GLuint64 offset,
   1086                                              GLbitfield createFlags,
   1087                                              GLbitfield usageFlags,
   1088                                              const void *imageCreateInfoPNext)
   1089 {
   1090    Context *context = GetValidGlobalContext();
   1091    EVENT(context, GLTexStorageMemFlags3DANGLE,
   1092          "context = %d, target = %s, levels = %d, internalFormat = %s, width = %d, height = %d, "
   1093          "depth = %d, memory = %u, offset = %llu, createFlags = %s, usageFlags = %s, "
   1094          "imageCreateInfoPNext = 0x%016" PRIxPTR "",
   1095          CID(context), GLenumToString(GLESEnum::TextureTarget, target), levels,
   1096          GLenumToString(GLESEnum::AllEnums, internalFormat), width, height, depth, memory,
   1097          static_cast<unsigned long long>(offset),
   1098          GLbitfieldToString(GLESEnum::AllEnums, createFlags).c_str(),
   1099          GLbitfieldToString(GLESEnum::AllEnums, usageFlags).c_str(),
   1100          (uintptr_t)imageCreateInfoPNext);
   1101 
   1102    if (context)
   1103    {
   1104        TextureType targetPacked    = PackParam<TextureType>(target);
   1105        MemoryObjectID memoryPacked = PackParam<MemoryObjectID>(memory);
   1106        SCOPED_SHARE_CONTEXT_LOCK(context);
   1107        bool isCallValid =
   1108            (context->skipValidation() ||
   1109             ValidateTexStorageMemFlags3DANGLE(
   1110                 context, angle::EntryPoint::GLTexStorageMemFlags3DANGLE, targetPacked, levels,
   1111                 internalFormat, width, height, depth, memoryPacked, offset, createFlags,
   1112                 usageFlags, imageCreateInfoPNext));
   1113        if (isCallValid)
   1114        {
   1115            context->texStorageMemFlags3D(targetPacked, levels, internalFormat, width, height,
   1116                                          depth, memoryPacked, offset, createFlags, usageFlags,
   1117                                          imageCreateInfoPNext);
   1118        }
   1119        ANGLE_CAPTURE_GL(TexStorageMemFlags3DANGLE, isCallValid, context, targetPacked, levels,
   1120                         internalFormat, width, height, depth, memoryPacked, offset, createFlags,
   1121                         usageFlags, imageCreateInfoPNext);
   1122    }
   1123    else
   1124    {
   1125        GenerateContextLostErrorOnCurrentGlobalContext();
   1126    }
   1127 }
   1128 
   1129 void GL_APIENTRY GL_TexStorageMemFlags3DMultisampleANGLE(GLenum target,
   1130                                                         GLsizei samples,
   1131                                                         GLenum internalFormat,
   1132                                                         GLsizei width,
   1133                                                         GLsizei height,
   1134                                                         GLsizei depth,
   1135                                                         GLboolean fixedSampleLocations,
   1136                                                         GLuint memory,
   1137                                                         GLuint64 offset,
   1138                                                         GLbitfield createFlags,
   1139                                                         GLbitfield usageFlags,
   1140                                                         const void *imageCreateInfoPNext)
   1141 {
   1142    Context *context = GetValidGlobalContext();
   1143    EVENT(context, GLTexStorageMemFlags3DMultisampleANGLE,
   1144          "context = %d, target = %s, samples = %d, internalFormat = %s, width = %d, height = %d, "
   1145          "depth = %d, fixedSampleLocations = %s, memory = %u, offset = %llu, createFlags = %s, "
   1146          "usageFlags = %s, imageCreateInfoPNext = 0x%016" PRIxPTR "",
   1147          CID(context), GLenumToString(GLESEnum::TextureTarget, target), samples,
   1148          GLenumToString(GLESEnum::AllEnums, internalFormat), width, height, depth,
   1149          GLbooleanToString(fixedSampleLocations), memory, static_cast<unsigned long long>(offset),
   1150          GLbitfieldToString(GLESEnum::AllEnums, createFlags).c_str(),
   1151          GLbitfieldToString(GLESEnum::AllEnums, usageFlags).c_str(),
   1152          (uintptr_t)imageCreateInfoPNext);
   1153 
   1154    if (context)
   1155    {
   1156        TextureType targetPacked    = PackParam<TextureType>(target);
   1157        MemoryObjectID memoryPacked = PackParam<MemoryObjectID>(memory);
   1158        SCOPED_SHARE_CONTEXT_LOCK(context);
   1159        bool isCallValid =
   1160            (context->skipValidation() ||
   1161             ValidateTexStorageMemFlags3DMultisampleANGLE(
   1162                 context, angle::EntryPoint::GLTexStorageMemFlags3DMultisampleANGLE, targetPacked,
   1163                 samples, internalFormat, width, height, depth, fixedSampleLocations, memoryPacked,
   1164                 offset, createFlags, usageFlags, imageCreateInfoPNext));
   1165        if (isCallValid)
   1166        {
   1167            context->texStorageMemFlags3DMultisample(
   1168                targetPacked, samples, internalFormat, width, height, depth, fixedSampleLocations,
   1169                memoryPacked, offset, createFlags, usageFlags, imageCreateInfoPNext);
   1170        }
   1171        ANGLE_CAPTURE_GL(TexStorageMemFlags3DMultisampleANGLE, isCallValid, context, targetPacked,
   1172                         samples, internalFormat, width, height, depth, fixedSampleLocations,
   1173                         memoryPacked, offset, createFlags, usageFlags, imageCreateInfoPNext);
   1174    }
   1175    else
   1176    {
   1177        GenerateContextLostErrorOnCurrentGlobalContext();
   1178    }
   1179 }
   1180 
   1181 // GL_ANGLE_memory_object_fuchsia
   1182 void GL_APIENTRY GL_ImportMemoryZirconHandleANGLE(GLuint memory,
   1183                                                  GLuint64 size,
   1184                                                  GLenum handleType,
   1185                                                  GLuint handle)
   1186 {
   1187    Context *context = GetValidGlobalContext();
   1188    EVENT(context, GLImportMemoryZirconHandleANGLE,
   1189          "context = %d, memory = %u, size = %llu, handleType = %s, handle = %u", CID(context),
   1190          memory, static_cast<unsigned long long>(size),
   1191          GLenumToString(GLESEnum::ExternalHandleType, handleType), handle);
   1192 
   1193    if (context)
   1194    {
   1195        MemoryObjectID memoryPacked = PackParam<MemoryObjectID>(memory);
   1196        HandleType handleTypePacked = PackParam<HandleType>(handleType);
   1197        SCOPED_SHARE_CONTEXT_LOCK(context);
   1198        bool isCallValid = (context->skipValidation() ||
   1199                            ValidateImportMemoryZirconHandleANGLE(
   1200                                context, angle::EntryPoint::GLImportMemoryZirconHandleANGLE,
   1201                                memoryPacked, size, handleTypePacked, handle));
   1202        if (isCallValid)
   1203        {
   1204            context->importMemoryZirconHandle(memoryPacked, size, handleTypePacked, handle);
   1205        }
   1206        ANGLE_CAPTURE_GL(ImportMemoryZirconHandleANGLE, isCallValid, context, memoryPacked, size,
   1207                         handleTypePacked, handle);
   1208    }
   1209    else
   1210    {
   1211        GenerateContextLostErrorOnCurrentGlobalContext();
   1212    }
   1213 }
   1214 
   1215 // GL_ANGLE_multi_draw
   1216 void GL_APIENTRY GL_MultiDrawArraysANGLE(GLenum mode,
   1217                                         const GLint *firsts,
   1218                                         const GLsizei *counts,
   1219                                         GLsizei drawcount)
   1220 {
   1221    Context *context = GetValidGlobalContext();
   1222    EVENT(context, GLMultiDrawArraysANGLE,
   1223          "context = %d, mode = %s, firsts = 0x%016" PRIxPTR ", counts = 0x%016" PRIxPTR
   1224          ", drawcount = %d",
   1225          CID(context), GLenumToString(GLESEnum::PrimitiveType, mode), (uintptr_t)firsts,
   1226          (uintptr_t)counts, drawcount);
   1227 
   1228    if (context)
   1229    {
   1230        PrimitiveMode modePacked = PackParam<PrimitiveMode>(mode);
   1231        SCOPED_SHARE_CONTEXT_LOCK(context);
   1232        bool isCallValid =
   1233            (context->skipValidation() ||
   1234             ValidateMultiDrawArraysANGLE(context, angle::EntryPoint::GLMultiDrawArraysANGLE,
   1235                                          modePacked, firsts, counts, drawcount));
   1236        if (isCallValid)
   1237        {
   1238            context->multiDrawArrays(modePacked, firsts, counts, drawcount);
   1239        }
   1240        ANGLE_CAPTURE_GL(MultiDrawArraysANGLE, isCallValid, context, modePacked, firsts, counts,
   1241                         drawcount);
   1242    }
   1243    else
   1244    {
   1245        GenerateContextLostErrorOnCurrentGlobalContext();
   1246    }
   1247 }
   1248 
   1249 void GL_APIENTRY GL_MultiDrawArraysInstancedANGLE(GLenum mode,
   1250                                                  const GLint *firsts,
   1251                                                  const GLsizei *counts,
   1252                                                  const GLsizei *instanceCounts,
   1253                                                  GLsizei drawcount)
   1254 {
   1255    Context *context = GetValidGlobalContext();
   1256    EVENT(context, GLMultiDrawArraysInstancedANGLE,
   1257          "context = %d, mode = %s, firsts = 0x%016" PRIxPTR ", counts = 0x%016" PRIxPTR
   1258          ", instanceCounts = 0x%016" PRIxPTR ", drawcount = %d",
   1259          CID(context), GLenumToString(GLESEnum::PrimitiveType, mode), (uintptr_t)firsts,
   1260          (uintptr_t)counts, (uintptr_t)instanceCounts, drawcount);
   1261 
   1262    if (context)
   1263    {
   1264        PrimitiveMode modePacked = PackParam<PrimitiveMode>(mode);
   1265        SCOPED_SHARE_CONTEXT_LOCK(context);
   1266        bool isCallValid = (context->skipValidation() ||
   1267                            ValidateMultiDrawArraysInstancedANGLE(
   1268                                context, angle::EntryPoint::GLMultiDrawArraysInstancedANGLE,
   1269                                modePacked, firsts, counts, instanceCounts, drawcount));
   1270        if (isCallValid)
   1271        {
   1272            context->multiDrawArraysInstanced(modePacked, firsts, counts, instanceCounts,
   1273                                              drawcount);
   1274        }
   1275        ANGLE_CAPTURE_GL(MultiDrawArraysInstancedANGLE, isCallValid, context, modePacked, firsts,
   1276                         counts, instanceCounts, drawcount);
   1277    }
   1278    else
   1279    {
   1280        GenerateContextLostErrorOnCurrentGlobalContext();
   1281    }
   1282 }
   1283 
   1284 void GL_APIENTRY GL_MultiDrawElementsANGLE(GLenum mode,
   1285                                           const GLsizei *counts,
   1286                                           GLenum type,
   1287                                           const GLvoid *const *indices,
   1288                                           GLsizei drawcount)
   1289 {
   1290    Context *context = GetValidGlobalContext();
   1291    EVENT(context, GLMultiDrawElementsANGLE,
   1292          "context = %d, mode = %s, counts = 0x%016" PRIxPTR ", type = %s, indices = 0x%016" PRIxPTR
   1293          ", drawcount = %d",
   1294          CID(context), GLenumToString(GLESEnum::PrimitiveType, mode), (uintptr_t)counts,
   1295          GLenumToString(GLESEnum::DrawElementsType, type), (uintptr_t)indices, drawcount);
   1296 
   1297    if (context)
   1298    {
   1299        PrimitiveMode modePacked    = PackParam<PrimitiveMode>(mode);
   1300        DrawElementsType typePacked = PackParam<DrawElementsType>(type);
   1301        SCOPED_SHARE_CONTEXT_LOCK(context);
   1302        bool isCallValid =
   1303            (context->skipValidation() ||
   1304             ValidateMultiDrawElementsANGLE(context, angle::EntryPoint::GLMultiDrawElementsANGLE,
   1305                                            modePacked, counts, typePacked, indices, drawcount));
   1306        if (isCallValid)
   1307        {
   1308            context->multiDrawElements(modePacked, counts, typePacked, indices, drawcount);
   1309        }
   1310        ANGLE_CAPTURE_GL(MultiDrawElementsANGLE, isCallValid, context, modePacked, counts,
   1311                         typePacked, indices, drawcount);
   1312    }
   1313    else
   1314    {
   1315        GenerateContextLostErrorOnCurrentGlobalContext();
   1316    }
   1317 }
   1318 
   1319 void GL_APIENTRY GL_MultiDrawElementsInstancedANGLE(GLenum mode,
   1320                                                    const GLsizei *counts,
   1321                                                    GLenum type,
   1322                                                    const GLvoid *const *indices,
   1323                                                    const GLsizei *instanceCounts,
   1324                                                    GLsizei drawcount)
   1325 {
   1326    Context *context = GetValidGlobalContext();
   1327    EVENT(context, GLMultiDrawElementsInstancedANGLE,
   1328          "context = %d, mode = %s, counts = 0x%016" PRIxPTR ", type = %s, indices = 0x%016" PRIxPTR
   1329          ", instanceCounts = 0x%016" PRIxPTR ", drawcount = %d",
   1330          CID(context), GLenumToString(GLESEnum::PrimitiveType, mode), (uintptr_t)counts,
   1331          GLenumToString(GLESEnum::DrawElementsType, type), (uintptr_t)indices,
   1332          (uintptr_t)instanceCounts, drawcount);
   1333 
   1334    if (context)
   1335    {
   1336        PrimitiveMode modePacked    = PackParam<PrimitiveMode>(mode);
   1337        DrawElementsType typePacked = PackParam<DrawElementsType>(type);
   1338        SCOPED_SHARE_CONTEXT_LOCK(context);
   1339        bool isCallValid =
   1340            (context->skipValidation() ||
   1341             ValidateMultiDrawElementsInstancedANGLE(
   1342                 context, angle::EntryPoint::GLMultiDrawElementsInstancedANGLE, modePacked, counts,
   1343                 typePacked, indices, instanceCounts, drawcount));
   1344        if (isCallValid)
   1345        {
   1346            context->multiDrawElementsInstanced(modePacked, counts, typePacked, indices,
   1347                                                instanceCounts, drawcount);
   1348        }
   1349        ANGLE_CAPTURE_GL(MultiDrawElementsInstancedANGLE, isCallValid, context, modePacked, counts,
   1350                         typePacked, indices, instanceCounts, drawcount);
   1351    }
   1352    else
   1353    {
   1354        GenerateContextLostErrorOnCurrentGlobalContext();
   1355    }
   1356 }
   1357 
   1358 // GL_ANGLE_pack_reverse_row_order
   1359 
   1360 // GL_ANGLE_program_binary
   1361 
   1362 // GL_ANGLE_provoking_vertex
   1363 void GL_APIENTRY GL_ProvokingVertexANGLE(GLenum mode)
   1364 {
   1365    Context *context = GetValidGlobalContext();
   1366    EVENT(context, GLProvokingVertexANGLE, "context = %d, mode = %s", CID(context),
   1367          GLenumToString(GLESEnum::VertexProvokingMode, mode));
   1368 
   1369    if (context)
   1370    {
   1371        ProvokingVertexConvention modePacked = PackParam<ProvokingVertexConvention>(mode);
   1372        SCOPED_SHARE_CONTEXT_LOCK(context);
   1373        bool isCallValid = (context->skipValidation() ||
   1374                            ValidateProvokingVertexANGLE(
   1375                                context, angle::EntryPoint::GLProvokingVertexANGLE, modePacked));
   1376        if (isCallValid)
   1377        {
   1378            context->provokingVertex(modePacked);
   1379        }
   1380        ANGLE_CAPTURE_GL(ProvokingVertexANGLE, isCallValid, context, modePacked);
   1381    }
   1382    else
   1383    {
   1384        GenerateContextLostErrorOnCurrentGlobalContext();
   1385    }
   1386 }
   1387 
   1388 // GL_ANGLE_request_extension
   1389 void GL_APIENTRY GL_RequestExtensionANGLE(const GLchar *name)
   1390 {
   1391    Context *context = GetValidGlobalContext();
   1392    EVENT(context, GLRequestExtensionANGLE, "context = %d, name = 0x%016" PRIxPTR "", CID(context),
   1393          (uintptr_t)name);
   1394 
   1395    if (context)
   1396    {
   1397        SCOPED_SHARE_CONTEXT_LOCK(context);
   1398        bool isCallValid = (context->skipValidation() ||
   1399                            ValidateRequestExtensionANGLE(
   1400                                context, angle::EntryPoint::GLRequestExtensionANGLE, name));
   1401        if (isCallValid)
   1402        {
   1403            context->requestExtension(name);
   1404        }
   1405        ANGLE_CAPTURE_GL(RequestExtensionANGLE, isCallValid, context, name);
   1406    }
   1407    else
   1408    {
   1409        GenerateContextLostErrorOnCurrentGlobalContext();
   1410    }
   1411 }
   1412 
   1413 void GL_APIENTRY GL_DisableExtensionANGLE(const GLchar *name)
   1414 {
   1415    Context *context = GetValidGlobalContext();
   1416    EVENT(context, GLDisableExtensionANGLE, "context = %d, name = 0x%016" PRIxPTR "", CID(context),
   1417          (uintptr_t)name);
   1418 
   1419    if (context)
   1420    {
   1421        SCOPED_SHARE_CONTEXT_LOCK(context);
   1422        bool isCallValid = (context->skipValidation() ||
   1423                            ValidateDisableExtensionANGLE(
   1424                                context, angle::EntryPoint::GLDisableExtensionANGLE, name));
   1425        if (isCallValid)
   1426        {
   1427            context->disableExtension(name);
   1428        }
   1429        ANGLE_CAPTURE_GL(DisableExtensionANGLE, isCallValid, context, name);
   1430    }
   1431    else
   1432    {
   1433        GenerateContextLostErrorOnCurrentGlobalContext();
   1434    }
   1435 }
   1436 
   1437 // GL_ANGLE_robust_client_memory
   1438 void GL_APIENTRY GL_GetBooleanvRobustANGLE(GLenum pname,
   1439                                           GLsizei bufSize,
   1440                                           GLsizei *length,
   1441                                           GLboolean *params)
   1442 {
   1443    Context *context = GetValidGlobalContext();
   1444    EVENT(context, GLGetBooleanvRobustANGLE,
   1445          "context = %d, pname = %s, bufSize = %d, length = 0x%016" PRIxPTR
   1446          ", params = 0x%016" PRIxPTR "",
   1447          CID(context), GLenumToString(GLESEnum::AllEnums, pname), bufSize, (uintptr_t)length,
   1448          (uintptr_t)params);
   1449 
   1450    if (context)
   1451    {
   1452        SCOPED_SHARE_CONTEXT_LOCK(context);
   1453        bool isCallValid =
   1454            (context->skipValidation() ||
   1455             ValidateGetBooleanvRobustANGLE(context, angle::EntryPoint::GLGetBooleanvRobustANGLE,
   1456                                            pname, bufSize, length, params));
   1457        if (isCallValid)
   1458        {
   1459            context->getBooleanvRobust(pname, bufSize, length, params);
   1460        }
   1461        ANGLE_CAPTURE_GL(GetBooleanvRobustANGLE, isCallValid, context, pname, bufSize, length,
   1462                         params);
   1463    }
   1464    else
   1465    {
   1466        GenerateContextLostErrorOnCurrentGlobalContext();
   1467    }
   1468 }
   1469 
   1470 void GL_APIENTRY GL_GetBufferParameterivRobustANGLE(GLenum target,
   1471                                                    GLenum pname,
   1472                                                    GLsizei bufSize,
   1473                                                    GLsizei *length,
   1474                                                    GLint *params)
   1475 {
   1476    Context *context = GetValidGlobalContext();
   1477    EVENT(context, GLGetBufferParameterivRobustANGLE,
   1478          "context = %d, target = %s, pname = %s, bufSize = %d, length = 0x%016" PRIxPTR
   1479          ", params = 0x%016" PRIxPTR "",
   1480          CID(context), GLenumToString(GLESEnum::AllEnums, target),
   1481          GLenumToString(GLESEnum::AllEnums, pname), bufSize, (uintptr_t)length, (uintptr_t)params);
   1482 
   1483    if (context)
   1484    {
   1485        BufferBinding targetPacked = PackParam<BufferBinding>(target);
   1486        SCOPED_SHARE_CONTEXT_LOCK(context);
   1487        bool isCallValid = (context->skipValidation() ||
   1488                            ValidateGetBufferParameterivRobustANGLE(
   1489                                context, angle::EntryPoint::GLGetBufferParameterivRobustANGLE,
   1490                                targetPacked, pname, bufSize, length, params));
   1491        if (isCallValid)
   1492        {
   1493            context->getBufferParameterivRobust(targetPacked, pname, bufSize, length, params);
   1494        }
   1495        ANGLE_CAPTURE_GL(GetBufferParameterivRobustANGLE, isCallValid, context, targetPacked, pname,
   1496                         bufSize, length, params);
   1497    }
   1498    else
   1499    {
   1500        GenerateContextLostErrorOnCurrentGlobalContext();
   1501    }
   1502 }
   1503 
   1504 void GL_APIENTRY GL_GetFloatvRobustANGLE(GLenum pname,
   1505                                         GLsizei bufSize,
   1506                                         GLsizei *length,
   1507                                         GLfloat *params)
   1508 {
   1509    Context *context = GetValidGlobalContext();
   1510    EVENT(context, GLGetFloatvRobustANGLE,
   1511          "context = %d, pname = %s, bufSize = %d, length = 0x%016" PRIxPTR
   1512          ", params = 0x%016" PRIxPTR "",
   1513          CID(context), GLenumToString(GLESEnum::AllEnums, pname), bufSize, (uintptr_t)length,
   1514          (uintptr_t)params);
   1515 
   1516    if (context)
   1517    {
   1518        SCOPED_SHARE_CONTEXT_LOCK(context);
   1519        bool isCallValid =
   1520            (context->skipValidation() ||
   1521             ValidateGetFloatvRobustANGLE(context, angle::EntryPoint::GLGetFloatvRobustANGLE, pname,
   1522                                          bufSize, length, params));
   1523        if (isCallValid)
   1524        {
   1525            context->getFloatvRobust(pname, bufSize, length, params);
   1526        }
   1527        ANGLE_CAPTURE_GL(GetFloatvRobustANGLE, isCallValid, context, pname, bufSize, length,
   1528                         params);
   1529    }
   1530    else
   1531    {
   1532        GenerateContextLostErrorOnCurrentGlobalContext();
   1533    }
   1534 }
   1535 
   1536 void GL_APIENTRY GL_GetFramebufferAttachmentParameterivRobustANGLE(GLenum target,
   1537                                                                   GLenum attachment,
   1538                                                                   GLenum pname,
   1539                                                                   GLsizei bufSize,
   1540                                                                   GLsizei *length,
   1541                                                                   GLint *params)
   1542 {
   1543    Context *context = GetValidGlobalContext();
   1544    EVENT(context, GLGetFramebufferAttachmentParameterivRobustANGLE,
   1545          "context = %d, target = %s, attachment = %s, pname = %s, bufSize = %d, length = "
   1546          "0x%016" PRIxPTR ", params = 0x%016" PRIxPTR "",
   1547          CID(context), GLenumToString(GLESEnum::AllEnums, target),
   1548          GLenumToString(GLESEnum::AllEnums, attachment), GLenumToString(GLESEnum::AllEnums, pname),
   1549          bufSize, (uintptr_t)length, (uintptr_t)params);
   1550 
   1551    if (context)
   1552    {
   1553        SCOPED_SHARE_CONTEXT_LOCK(context);
   1554        bool isCallValid =
   1555            (context->skipValidation() ||
   1556             ValidateGetFramebufferAttachmentParameterivRobustANGLE(
   1557                 context, angle::EntryPoint::GLGetFramebufferAttachmentParameterivRobustANGLE,
   1558                 target, attachment, pname, bufSize, length, params));
   1559        if (isCallValid)
   1560        {
   1561            context->getFramebufferAttachmentParameterivRobust(target, attachment, pname, bufSize,
   1562                                                               length, params);
   1563        }
   1564        ANGLE_CAPTURE_GL(GetFramebufferAttachmentParameterivRobustANGLE, isCallValid, context,
   1565                         target, attachment, pname, bufSize, length, params);
   1566    }
   1567    else
   1568    {
   1569        GenerateContextLostErrorOnCurrentGlobalContext();
   1570    }
   1571 }
   1572 
   1573 void GL_APIENTRY GL_GetIntegervRobustANGLE(GLenum pname,
   1574                                           GLsizei bufSize,
   1575                                           GLsizei *length,
   1576                                           GLint *data)
   1577 {
   1578    Context *context = GetValidGlobalContext();
   1579    EVENT(context, GLGetIntegervRobustANGLE,
   1580          "context = %d, pname = %s, bufSize = %d, length = 0x%016" PRIxPTR
   1581          ", data = 0x%016" PRIxPTR "",
   1582          CID(context), GLenumToString(GLESEnum::AllEnums, pname), bufSize, (uintptr_t)length,
   1583          (uintptr_t)data);
   1584 
   1585    if (context)
   1586    {
   1587        SCOPED_SHARE_CONTEXT_LOCK(context);
   1588        bool isCallValid =
   1589            (context->skipValidation() ||
   1590             ValidateGetIntegervRobustANGLE(context, angle::EntryPoint::GLGetIntegervRobustANGLE,
   1591                                            pname, bufSize, length, data));
   1592        if (isCallValid)
   1593        {
   1594            context->getIntegervRobust(pname, bufSize, length, data);
   1595        }
   1596        ANGLE_CAPTURE_GL(GetIntegervRobustANGLE, isCallValid, context, pname, bufSize, length,
   1597                         data);
   1598    }
   1599    else
   1600    {
   1601        GenerateContextLostErrorOnCurrentGlobalContext();
   1602    }
   1603 }
   1604 
   1605 void GL_APIENTRY GL_GetProgramivRobustANGLE(GLuint program,
   1606                                            GLenum pname,
   1607                                            GLsizei bufSize,
   1608                                            GLsizei *length,
   1609                                            GLint *params)
   1610 {
   1611    Context *context = GetGlobalContext();
   1612    EVENT(context, GLGetProgramivRobustANGLE,
   1613          "context = %d, program = %u, pname = %s, bufSize = %d, length = 0x%016" PRIxPTR
   1614          ", params = 0x%016" PRIxPTR "",
   1615          CID(context), program, GLenumToString(GLESEnum::AllEnums, pname), bufSize,
   1616          (uintptr_t)length, (uintptr_t)params);
   1617 
   1618    if (context)
   1619    {
   1620        ShaderProgramID programPacked = PackParam<ShaderProgramID>(program);
   1621        SCOPED_SHARE_CONTEXT_LOCK(context);
   1622        bool isCallValid =
   1623            (context->skipValidation() ||
   1624             ValidateGetProgramivRobustANGLE(context, angle::EntryPoint::GLGetProgramivRobustANGLE,
   1625                                             programPacked, pname, bufSize, length, params));
   1626        if (isCallValid)
   1627        {
   1628            context->getProgramivRobust(programPacked, pname, bufSize, length, params);
   1629        }
   1630        ANGLE_CAPTURE_GL(GetProgramivRobustANGLE, isCallValid, context, programPacked, pname,
   1631                         bufSize, length, params);
   1632    }
   1633    else
   1634    {}
   1635 }
   1636 
   1637 void GL_APIENTRY GL_GetRenderbufferParameterivRobustANGLE(GLenum target,
   1638                                                          GLenum pname,
   1639                                                          GLsizei bufSize,
   1640                                                          GLsizei *length,
   1641                                                          GLint *params)
   1642 {
   1643    Context *context = GetValidGlobalContext();
   1644    EVENT(context, GLGetRenderbufferParameterivRobustANGLE,
   1645          "context = %d, target = %s, pname = %s, bufSize = %d, length = 0x%016" PRIxPTR
   1646          ", params = 0x%016" PRIxPTR "",
   1647          CID(context), GLenumToString(GLESEnum::AllEnums, target),
   1648          GLenumToString(GLESEnum::AllEnums, pname), bufSize, (uintptr_t)length, (uintptr_t)params);
   1649 
   1650    if (context)
   1651    {
   1652        SCOPED_SHARE_CONTEXT_LOCK(context);
   1653        bool isCallValid = (context->skipValidation() ||
   1654                            ValidateGetRenderbufferParameterivRobustANGLE(
   1655                                context, angle::EntryPoint::GLGetRenderbufferParameterivRobustANGLE,
   1656                                target, pname, bufSize, length, params));
   1657        if (isCallValid)
   1658        {
   1659            context->getRenderbufferParameterivRobust(target, pname, bufSize, length, params);
   1660        }
   1661        ANGLE_CAPTURE_GL(GetRenderbufferParameterivRobustANGLE, isCallValid, context, target, pname,
   1662                         bufSize, length, params);
   1663    }
   1664    else
   1665    {
   1666        GenerateContextLostErrorOnCurrentGlobalContext();
   1667    }
   1668 }
   1669 
   1670 void GL_APIENTRY GL_GetShaderivRobustANGLE(GLuint shader,
   1671                                           GLenum pname,
   1672                                           GLsizei bufSize,
   1673                                           GLsizei *length,
   1674                                           GLint *params)
   1675 {
   1676    Context *context = GetGlobalContext();
   1677    EVENT(context, GLGetShaderivRobustANGLE,
   1678          "context = %d, shader = %u, pname = %s, bufSize = %d, length = 0x%016" PRIxPTR
   1679          ", params = 0x%016" PRIxPTR "",
   1680          CID(context), shader, GLenumToString(GLESEnum::AllEnums, pname), bufSize,
   1681          (uintptr_t)length, (uintptr_t)params);
   1682 
   1683    if (context)
   1684    {
   1685        ShaderProgramID shaderPacked = PackParam<ShaderProgramID>(shader);
   1686        SCOPED_SHARE_CONTEXT_LOCK(context);
   1687        bool isCallValid =
   1688            (context->skipValidation() ||
   1689             ValidateGetShaderivRobustANGLE(context, angle::EntryPoint::GLGetShaderivRobustANGLE,
   1690                                            shaderPacked, pname, bufSize, length, params));
   1691        if (isCallValid)
   1692        {
   1693            context->getShaderivRobust(shaderPacked, pname, bufSize, length, params);
   1694        }
   1695        ANGLE_CAPTURE_GL(GetShaderivRobustANGLE, isCallValid, context, shaderPacked, pname, bufSize,
   1696                         length, params);
   1697    }
   1698    else
   1699    {}
   1700 }
   1701 
   1702 void GL_APIENTRY GL_GetTexParameterfvRobustANGLE(GLenum target,
   1703                                                 GLenum pname,
   1704                                                 GLsizei bufSize,
   1705                                                 GLsizei *length,
   1706                                                 GLfloat *params)
   1707 {
   1708    Context *context = GetValidGlobalContext();
   1709    EVENT(context, GLGetTexParameterfvRobustANGLE,
   1710          "context = %d, target = %s, pname = %s, bufSize = %d, length = 0x%016" PRIxPTR
   1711          ", params = 0x%016" PRIxPTR "",
   1712          CID(context), GLenumToString(GLESEnum::AllEnums, target),
   1713          GLenumToString(GLESEnum::AllEnums, pname), bufSize, (uintptr_t)length, (uintptr_t)params);
   1714 
   1715    if (context)
   1716    {
   1717        TextureType targetPacked = PackParam<TextureType>(target);
   1718        SCOPED_SHARE_CONTEXT_LOCK(context);
   1719        bool isCallValid = (context->skipValidation() ||
   1720                            ValidateGetTexParameterfvRobustANGLE(
   1721                                context, angle::EntryPoint::GLGetTexParameterfvRobustANGLE,
   1722                                targetPacked, pname, bufSize, length, params));
   1723        if (isCallValid)
   1724        {
   1725            context->getTexParameterfvRobust(targetPacked, pname, bufSize, length, params);
   1726        }
   1727        ANGLE_CAPTURE_GL(GetTexParameterfvRobustANGLE, isCallValid, context, targetPacked, pname,
   1728                         bufSize, length, params);
   1729    }
   1730    else
   1731    {
   1732        GenerateContextLostErrorOnCurrentGlobalContext();
   1733    }
   1734 }
   1735 
   1736 void GL_APIENTRY GL_GetTexParameterivRobustANGLE(GLenum target,
   1737                                                 GLenum pname,
   1738                                                 GLsizei bufSize,
   1739                                                 GLsizei *length,
   1740                                                 GLint *params)
   1741 {
   1742    Context *context = GetValidGlobalContext();
   1743    EVENT(context, GLGetTexParameterivRobustANGLE,
   1744          "context = %d, target = %s, pname = %s, bufSize = %d, length = 0x%016" PRIxPTR
   1745          ", params = 0x%016" PRIxPTR "",
   1746          CID(context), GLenumToString(GLESEnum::AllEnums, target),
   1747          GLenumToString(GLESEnum::AllEnums, pname), bufSize, (uintptr_t)length, (uintptr_t)params);
   1748 
   1749    if (context)
   1750    {
   1751        TextureType targetPacked = PackParam<TextureType>(target);
   1752        SCOPED_SHARE_CONTEXT_LOCK(context);
   1753        bool isCallValid = (context->skipValidation() ||
   1754                            ValidateGetTexParameterivRobustANGLE(
   1755                                context, angle::EntryPoint::GLGetTexParameterivRobustANGLE,
   1756                                targetPacked, pname, bufSize, length, params));
   1757        if (isCallValid)
   1758        {
   1759            context->getTexParameterivRobust(targetPacked, pname, bufSize, length, params);
   1760        }
   1761        ANGLE_CAPTURE_GL(GetTexParameterivRobustANGLE, isCallValid, context, targetPacked, pname,
   1762                         bufSize, length, params);
   1763    }
   1764    else
   1765    {
   1766        GenerateContextLostErrorOnCurrentGlobalContext();
   1767    }
   1768 }
   1769 
   1770 void GL_APIENTRY GL_GetUniformfvRobustANGLE(GLuint program,
   1771                                            GLint location,
   1772                                            GLsizei bufSize,
   1773                                            GLsizei *length,
   1774                                            GLfloat *params)
   1775 {
   1776    Context *context = GetValidGlobalContext();
   1777    EVENT(context, GLGetUniformfvRobustANGLE,
   1778          "context = %d, program = %u, location = %d, bufSize = %d, length = 0x%016" PRIxPTR
   1779          ", params = 0x%016" PRIxPTR "",
   1780          CID(context), program, location, bufSize, (uintptr_t)length, (uintptr_t)params);
   1781 
   1782    if (context)
   1783    {
   1784        ShaderProgramID programPacked  = PackParam<ShaderProgramID>(program);
   1785        UniformLocation locationPacked = PackParam<UniformLocation>(location);
   1786        SCOPED_SHARE_CONTEXT_LOCK(context);
   1787        bool isCallValid = (context->skipValidation() ||
   1788                            ValidateGetUniformfvRobustANGLE(
   1789                                context, angle::EntryPoint::GLGetUniformfvRobustANGLE,
   1790                                programPacked, locationPacked, bufSize, length, params));
   1791        if (isCallValid)
   1792        {
   1793            context->getUniformfvRobust(programPacked, locationPacked, bufSize, length, params);
   1794        }
   1795        ANGLE_CAPTURE_GL(GetUniformfvRobustANGLE, isCallValid, context, programPacked,
   1796                         locationPacked, bufSize, length, params);
   1797    }
   1798    else
   1799    {
   1800        GenerateContextLostErrorOnCurrentGlobalContext();
   1801    }
   1802 }
   1803 
   1804 void GL_APIENTRY GL_GetUniformivRobustANGLE(GLuint program,
   1805                                            GLint location,
   1806                                            GLsizei bufSize,
   1807                                            GLsizei *length,
   1808                                            GLint *params)
   1809 {
   1810    Context *context = GetValidGlobalContext();
   1811    EVENT(context, GLGetUniformivRobustANGLE,
   1812          "context = %d, program = %u, location = %d, bufSize = %d, length = 0x%016" PRIxPTR
   1813          ", params = 0x%016" PRIxPTR "",
   1814          CID(context), program, location, bufSize, (uintptr_t)length, (uintptr_t)params);
   1815 
   1816    if (context)
   1817    {
   1818        ShaderProgramID programPacked  = PackParam<ShaderProgramID>(program);
   1819        UniformLocation locationPacked = PackParam<UniformLocation>(location);
   1820        SCOPED_SHARE_CONTEXT_LOCK(context);
   1821        bool isCallValid = (context->skipValidation() ||
   1822                            ValidateGetUniformivRobustANGLE(
   1823                                context, angle::EntryPoint::GLGetUniformivRobustANGLE,
   1824                                programPacked, locationPacked, bufSize, length, params));
   1825        if (isCallValid)
   1826        {
   1827            context->getUniformivRobust(programPacked, locationPacked, bufSize, length, params);
   1828        }
   1829        ANGLE_CAPTURE_GL(GetUniformivRobustANGLE, isCallValid, context, programPacked,
   1830                         locationPacked, bufSize, length, params);
   1831    }
   1832    else
   1833    {
   1834        GenerateContextLostErrorOnCurrentGlobalContext();
   1835    }
   1836 }
   1837 
   1838 void GL_APIENTRY GL_GetVertexAttribfvRobustANGLE(GLuint index,
   1839                                                 GLenum pname,
   1840                                                 GLsizei bufSize,
   1841                                                 GLsizei *length,
   1842                                                 GLfloat *params)
   1843 {
   1844    Context *context = GetValidGlobalContext();
   1845    EVENT(context, GLGetVertexAttribfvRobustANGLE,
   1846          "context = %d, index = %u, pname = %s, bufSize = %d, length = 0x%016" PRIxPTR
   1847          ", params = 0x%016" PRIxPTR "",
   1848          CID(context), index, GLenumToString(GLESEnum::AllEnums, pname), bufSize,
   1849          (uintptr_t)length, (uintptr_t)params);
   1850 
   1851    if (context)
   1852    {
   1853        SCOPED_SHARE_CONTEXT_LOCK(context);
   1854        bool isCallValid = (context->skipValidation() ||
   1855                            ValidateGetVertexAttribfvRobustANGLE(
   1856                                context, angle::EntryPoint::GLGetVertexAttribfvRobustANGLE, index,
   1857                                pname, bufSize, length, params));
   1858        if (isCallValid)
   1859        {
   1860            context->getVertexAttribfvRobust(index, pname, bufSize, length, params);
   1861        }
   1862        ANGLE_CAPTURE_GL(GetVertexAttribfvRobustANGLE, isCallValid, context, index, pname, bufSize,
   1863                         length, params);
   1864    }
   1865    else
   1866    {
   1867        GenerateContextLostErrorOnCurrentGlobalContext();
   1868    }
   1869 }
   1870 
   1871 void GL_APIENTRY GL_GetVertexAttribivRobustANGLE(GLuint index,
   1872                                                 GLenum pname,
   1873                                                 GLsizei bufSize,
   1874                                                 GLsizei *length,
   1875                                                 GLint *params)
   1876 {
   1877    Context *context = GetValidGlobalContext();
   1878    EVENT(context, GLGetVertexAttribivRobustANGLE,
   1879          "context = %d, index = %u, pname = %s, bufSize = %d, length = 0x%016" PRIxPTR
   1880          ", params = 0x%016" PRIxPTR "",
   1881          CID(context), index, GLenumToString(GLESEnum::AllEnums, pname), bufSize,
   1882          (uintptr_t)length, (uintptr_t)params);
   1883 
   1884    if (context)
   1885    {
   1886        SCOPED_SHARE_CONTEXT_LOCK(context);
   1887        bool isCallValid = (context->skipValidation() ||
   1888                            ValidateGetVertexAttribivRobustANGLE(
   1889                                context, angle::EntryPoint::GLGetVertexAttribivRobustANGLE, index,
   1890                                pname, bufSize, length, params));
   1891        if (isCallValid)
   1892        {
   1893            context->getVertexAttribivRobust(index, pname, bufSize, length, params);
   1894        }
   1895        ANGLE_CAPTURE_GL(GetVertexAttribivRobustANGLE, isCallValid, context, index, pname, bufSize,
   1896                         length, params);
   1897    }
   1898    else
   1899    {
   1900        GenerateContextLostErrorOnCurrentGlobalContext();
   1901    }
   1902 }
   1903 
   1904 void GL_APIENTRY GL_GetVertexAttribPointervRobustANGLE(GLuint index,
   1905                                                       GLenum pname,
   1906                                                       GLsizei bufSize,
   1907                                                       GLsizei *length,
   1908                                                       void **pointer)
   1909 {
   1910    Context *context = GetValidGlobalContext();
   1911    EVENT(context, GLGetVertexAttribPointervRobustANGLE,
   1912          "context = %d, index = %u, pname = %s, bufSize = %d, length = 0x%016" PRIxPTR
   1913          ", pointer = 0x%016" PRIxPTR "",
   1914          CID(context), index, GLenumToString(GLESEnum::AllEnums, pname), bufSize,
   1915          (uintptr_t)length, (uintptr_t)pointer);
   1916 
   1917    if (context)
   1918    {
   1919        SCOPED_SHARE_CONTEXT_LOCK(context);
   1920        bool isCallValid = (context->skipValidation() ||
   1921                            ValidateGetVertexAttribPointervRobustANGLE(
   1922                                context, angle::EntryPoint::GLGetVertexAttribPointervRobustANGLE,
   1923                                index, pname, bufSize, length, pointer));
   1924        if (isCallValid)
   1925        {
   1926            context->getVertexAttribPointervRobust(index, pname, bufSize, length, pointer);
   1927        }
   1928        ANGLE_CAPTURE_GL(GetVertexAttribPointervRobustANGLE, isCallValid, context, index, pname,
   1929                         bufSize, length, pointer);
   1930    }
   1931    else
   1932    {
   1933        GenerateContextLostErrorOnCurrentGlobalContext();
   1934    }
   1935 }
   1936 
   1937 void GL_APIENTRY GL_ReadPixelsRobustANGLE(GLint x,
   1938                                          GLint y,
   1939                                          GLsizei width,
   1940                                          GLsizei height,
   1941                                          GLenum format,
   1942                                          GLenum type,
   1943                                          GLsizei bufSize,
   1944                                          GLsizei *length,
   1945                                          GLsizei *columns,
   1946                                          GLsizei *rows,
   1947                                          void *pixels)
   1948 {
   1949    Context *context = GetValidGlobalContext();
   1950    EVENT(context, GLReadPixelsRobustANGLE,
   1951          "context = %d, x = %d, y = %d, width = %d, height = %d, format = %s, type = %s, bufSize "
   1952          "= %d, length = 0x%016" PRIxPTR ", columns = 0x%016" PRIxPTR ", rows = 0x%016" PRIxPTR
   1953          ", pixels = 0x%016" PRIxPTR "",
   1954          CID(context), x, y, width, height, GLenumToString(GLESEnum::AllEnums, format),
   1955          GLenumToString(GLESEnum::AllEnums, type), bufSize, (uintptr_t)length, (uintptr_t)columns,
   1956          (uintptr_t)rows, (uintptr_t)pixels);
   1957 
   1958    if (context)
   1959    {
   1960        SCOPED_SHARE_CONTEXT_LOCK(context);
   1961        bool isCallValid = (context->skipValidation() ||
   1962                            ValidateReadPixelsRobustANGLE(
   1963                                context, angle::EntryPoint::GLReadPixelsRobustANGLE, x, y, width,
   1964                                height, format, type, bufSize, length, columns, rows, pixels));
   1965        if (isCallValid)
   1966        {
   1967            context->readPixelsRobust(x, y, width, height, format, type, bufSize, length, columns,
   1968                                      rows, pixels);
   1969        }
   1970        ANGLE_CAPTURE_GL(ReadPixelsRobustANGLE, isCallValid, context, x, y, width, height, format,
   1971                         type, bufSize, length, columns, rows, pixels);
   1972    }
   1973    else
   1974    {
   1975        GenerateContextLostErrorOnCurrentGlobalContext();
   1976    }
   1977 }
   1978 
   1979 void GL_APIENTRY GL_TexImage2DRobustANGLE(GLenum target,
   1980                                          GLint level,
   1981                                          GLint internalformat,
   1982                                          GLsizei width,
   1983                                          GLsizei height,
   1984                                          GLint border,
   1985                                          GLenum format,
   1986                                          GLenum type,
   1987                                          GLsizei bufSize,
   1988                                          const void *pixels)
   1989 {
   1990    Context *context = GetValidGlobalContext();
   1991    EVENT(context, GLTexImage2DRobustANGLE,
   1992          "context = %d, target = %s, level = %d, internalformat = %d, width = %d, height = %d, "
   1993          "border = %d, format = %s, type = %s, bufSize = %d, pixels = 0x%016" PRIxPTR "",
   1994          CID(context), GLenumToString(GLESEnum::AllEnums, target), level, internalformat, width,
   1995          height, border, GLenumToString(GLESEnum::AllEnums, format),
   1996          GLenumToString(GLESEnum::AllEnums, type), bufSize, (uintptr_t)pixels);
   1997 
   1998    if (context)
   1999    {
   2000        TextureTarget targetPacked = PackParam<TextureTarget>(target);
   2001        SCOPED_SHARE_CONTEXT_LOCK(context);
   2002        bool isCallValid =
   2003            (context->skipValidation() ||
   2004             ValidateTexImage2DRobustANGLE(context, angle::EntryPoint::GLTexImage2DRobustANGLE,
   2005                                           targetPacked, level, internalformat, width, height,
   2006                                           border, format, type, bufSize, pixels));
   2007        if (isCallValid)
   2008        {
   2009            context->texImage2DRobust(targetPacked, level, internalformat, width, height, border,
   2010                                      format, type, bufSize, pixels);
   2011        }
   2012        ANGLE_CAPTURE_GL(TexImage2DRobustANGLE, isCallValid, context, targetPacked, level,
   2013                         internalformat, width, height, border, format, type, bufSize, pixels);
   2014    }
   2015    else
   2016    {
   2017        GenerateContextLostErrorOnCurrentGlobalContext();
   2018    }
   2019 }
   2020 
   2021 void GL_APIENTRY GL_TexParameterfvRobustANGLE(GLenum target,
   2022                                              GLenum pname,
   2023                                              GLsizei bufSize,
   2024                                              const GLfloat *params)
   2025 {
   2026    Context *context = GetValidGlobalContext();
   2027    EVENT(context, GLTexParameterfvRobustANGLE,
   2028          "context = %d, target = %s, pname = %s, bufSize = %d, params = 0x%016" PRIxPTR "",
   2029          CID(context), GLenumToString(GLESEnum::AllEnums, target),
   2030          GLenumToString(GLESEnum::AllEnums, pname), bufSize, (uintptr_t)params);
   2031 
   2032    if (context)
   2033    {
   2034        TextureType targetPacked = PackParam<TextureType>(target);
   2035        SCOPED_SHARE_CONTEXT_LOCK(context);
   2036        bool isCallValid = (context->skipValidation() ||
   2037                            ValidateTexParameterfvRobustANGLE(
   2038                                context, angle::EntryPoint::GLTexParameterfvRobustANGLE,
   2039                                targetPacked, pname, bufSize, params));
   2040        if (isCallValid)
   2041        {
   2042            context->texParameterfvRobust(targetPacked, pname, bufSize, params);
   2043        }
   2044        ANGLE_CAPTURE_GL(TexParameterfvRobustANGLE, isCallValid, context, targetPacked, pname,
   2045                         bufSize, params);
   2046    }
   2047    else
   2048    {
   2049        GenerateContextLostErrorOnCurrentGlobalContext();
   2050    }
   2051 }
   2052 
   2053 void GL_APIENTRY GL_TexParameterivRobustANGLE(GLenum target,
   2054                                              GLenum pname,
   2055                                              GLsizei bufSize,
   2056                                              const GLint *params)
   2057 {
   2058    Context *context = GetValidGlobalContext();
   2059    EVENT(context, GLTexParameterivRobustANGLE,
   2060          "context = %d, target = %s, pname = %s, bufSize = %d, params = 0x%016" PRIxPTR "",
   2061          CID(context), GLenumToString(GLESEnum::AllEnums, target),
   2062          GLenumToString(GLESEnum::AllEnums, pname), bufSize, (uintptr_t)params);
   2063 
   2064    if (context)
   2065    {
   2066        TextureType targetPacked = PackParam<TextureType>(target);
   2067        SCOPED_SHARE_CONTEXT_LOCK(context);
   2068        bool isCallValid = (context->skipValidation() ||
   2069                            ValidateTexParameterivRobustANGLE(
   2070                                context, angle::EntryPoint::GLTexParameterivRobustANGLE,
   2071                                targetPacked, pname, bufSize, params));
   2072        if (isCallValid)
   2073        {
   2074            context->texParameterivRobust(targetPacked, pname, bufSize, params);
   2075        }
   2076        ANGLE_CAPTURE_GL(TexParameterivRobustANGLE, isCallValid, context, targetPacked, pname,
   2077                         bufSize, params);
   2078    }
   2079    else
   2080    {
   2081        GenerateContextLostErrorOnCurrentGlobalContext();
   2082    }
   2083 }
   2084 
   2085 void GL_APIENTRY GL_TexSubImage2DRobustANGLE(GLenum target,
   2086                                             GLint level,
   2087                                             GLint xoffset,
   2088                                             GLint yoffset,
   2089                                             GLsizei width,
   2090                                             GLsizei height,
   2091                                             GLenum format,
   2092                                             GLenum type,
   2093                                             GLsizei bufSize,
   2094                                             const void *pixels)
   2095 {
   2096    Context *context = GetValidGlobalContext();
   2097    EVENT(context, GLTexSubImage2DRobustANGLE,
   2098          "context = %d, target = %s, level = %d, xoffset = %d, yoffset = %d, width = %d, height = "
   2099          "%d, format = %s, type = %s, bufSize = %d, pixels = 0x%016" PRIxPTR "",
   2100          CID(context), GLenumToString(GLESEnum::AllEnums, target), level, xoffset, yoffset, width,
   2101          height, GLenumToString(GLESEnum::AllEnums, format),
   2102          GLenumToString(GLESEnum::AllEnums, type), bufSize, (uintptr_t)pixels);
   2103 
   2104    if (context)
   2105    {
   2106        TextureTarget targetPacked = PackParam<TextureTarget>(target);
   2107        SCOPED_SHARE_CONTEXT_LOCK(context);
   2108        bool isCallValid =
   2109            (context->skipValidation() ||
   2110             ValidateTexSubImage2DRobustANGLE(
   2111                 context, angle::EntryPoint::GLTexSubImage2DRobustANGLE, targetPacked, level,
   2112                 xoffset, yoffset, width, height, format, type, bufSize, pixels));
   2113        if (isCallValid)
   2114        {
   2115            context->texSubImage2DRobust(targetPacked, level, xoffset, yoffset, width, height,
   2116                                         format, type, bufSize, pixels);
   2117        }
   2118        ANGLE_CAPTURE_GL(TexSubImage2DRobustANGLE, isCallValid, context, targetPacked, level,
   2119                         xoffset, yoffset, width, height, format, type, bufSize, pixels);
   2120    }
   2121    else
   2122    {
   2123        GenerateContextLostErrorOnCurrentGlobalContext();
   2124    }
   2125 }
   2126 
   2127 void GL_APIENTRY GL_TexImage3DRobustANGLE(GLenum target,
   2128                                          GLint level,
   2129                                          GLint internalformat,
   2130                                          GLsizei width,
   2131                                          GLsizei height,
   2132                                          GLsizei depth,
   2133                                          GLint border,
   2134                                          GLenum format,
   2135                                          GLenum type,
   2136                                          GLsizei bufSize,
   2137                                          const void *pixels)
   2138 {
   2139    Context *context = GetValidGlobalContext();
   2140    EVENT(context, GLTexImage3DRobustANGLE,
   2141          "context = %d, target = %s, level = %d, internalformat = %d, width = %d, height = %d, "
   2142          "depth = %d, border = %d, format = %s, type = %s, bufSize = %d, pixels = 0x%016" PRIxPTR
   2143          "",
   2144          CID(context), GLenumToString(GLESEnum::AllEnums, target), level, internalformat, width,
   2145          height, depth, border, GLenumToString(GLESEnum::AllEnums, format),
   2146          GLenumToString(GLESEnum::AllEnums, type), bufSize, (uintptr_t)pixels);
   2147 
   2148    if (context)
   2149    {
   2150        TextureTarget targetPacked = PackParam<TextureTarget>(target);
   2151        SCOPED_SHARE_CONTEXT_LOCK(context);
   2152        bool isCallValid =
   2153            (context->skipValidation() ||
   2154             ValidateTexImage3DRobustANGLE(context, angle::EntryPoint::GLTexImage3DRobustANGLE,
   2155                                           targetPacked, level, internalformat, width, height,
   2156                                           depth, border, format, type, bufSize, pixels));
   2157        if (isCallValid)
   2158        {
   2159            context->texImage3DRobust(targetPacked, level, internalformat, width, height, depth,
   2160                                      border, format, type, bufSize, pixels);
   2161        }
   2162        ANGLE_CAPTURE_GL(TexImage3DRobustANGLE, isCallValid, context, targetPacked, level,
   2163                         internalformat, width, height, depth, border, format, type, bufSize,
   2164                         pixels);
   2165    }
   2166    else
   2167    {
   2168        GenerateContextLostErrorOnCurrentGlobalContext();
   2169    }
   2170 }
   2171 
   2172 void GL_APIENTRY GL_TexSubImage3DRobustANGLE(GLenum target,
   2173                                             GLint level,
   2174                                             GLint xoffset,
   2175                                             GLint yoffset,
   2176                                             GLint zoffset,
   2177                                             GLsizei width,
   2178                                             GLsizei height,
   2179                                             GLsizei depth,
   2180                                             GLenum format,
   2181                                             GLenum type,
   2182                                             GLsizei bufSize,
   2183                                             const void *pixels)
   2184 {
   2185    Context *context = GetValidGlobalContext();
   2186    EVENT(
   2187        context, GLTexSubImage3DRobustANGLE,
   2188        "context = %d, target = %s, level = %d, xoffset = %d, yoffset = %d, zoffset = %d, width = "
   2189        "%d, height = %d, depth = %d, format = %s, type = %s, bufSize = %d, pixels = 0x%016" PRIxPTR
   2190        "",
   2191        CID(context), GLenumToString(GLESEnum::AllEnums, target), level, xoffset, yoffset, zoffset,
   2192        width, height, depth, GLenumToString(GLESEnum::AllEnums, format),
   2193        GLenumToString(GLESEnum::AllEnums, type), bufSize, (uintptr_t)pixels);
   2194 
   2195    if (context)
   2196    {
   2197        TextureTarget targetPacked = PackParam<TextureTarget>(target);
   2198        SCOPED_SHARE_CONTEXT_LOCK(context);
   2199        bool isCallValid =
   2200            (context->skipValidation() ||
   2201             ValidateTexSubImage3DRobustANGLE(
   2202                 context, angle::EntryPoint::GLTexSubImage3DRobustANGLE, targetPacked, level,
   2203                 xoffset, yoffset, zoffset, width, height, depth, format, type, bufSize, pixels));
   2204        if (isCallValid)
   2205        {
   2206            context->texSubImage3DRobust(targetPacked, level, xoffset, yoffset, zoffset, width,
   2207                                         height, depth, format, type, bufSize, pixels);
   2208        }
   2209        ANGLE_CAPTURE_GL(TexSubImage3DRobustANGLE, isCallValid, context, targetPacked, level,
   2210                         xoffset, yoffset, zoffset, width, height, depth, format, type, bufSize,
   2211                         pixels);
   2212    }
   2213    else
   2214    {
   2215        GenerateContextLostErrorOnCurrentGlobalContext();
   2216    }
   2217 }
   2218 
   2219 void GL_APIENTRY GL_CompressedTexImage2DRobustANGLE(GLenum target,
   2220                                                    GLint level,
   2221                                                    GLenum internalformat,
   2222                                                    GLsizei width,
   2223                                                    GLsizei height,
   2224                                                    GLint border,
   2225                                                    GLsizei imageSize,
   2226                                                    GLsizei dataSize,
   2227                                                    const GLvoid *data)
   2228 {
   2229    Context *context = GetValidGlobalContext();
   2230    EVENT(context, GLCompressedTexImage2DRobustANGLE,
   2231          "context = %d, target = %s, level = %d, internalformat = %s, width = %d, height = %d, "
   2232          "border = %d, imageSize = %d, dataSize = %d, data = 0x%016" PRIxPTR "",
   2233          CID(context), GLenumToString(GLESEnum::AllEnums, target), level,
   2234          GLenumToString(GLESEnum::AllEnums, internalformat), width, height, border, imageSize,
   2235          dataSize, (uintptr_t)data);
   2236 
   2237    if (context)
   2238    {
   2239        TextureTarget targetPacked = PackParam<TextureTarget>(target);
   2240        SCOPED_SHARE_CONTEXT_LOCK(context);
   2241        bool isCallValid =
   2242            (context->skipValidation() ||
   2243             ValidateCompressedTexImage2DRobustANGLE(
   2244                 context, angle::EntryPoint::GLCompressedTexImage2DRobustANGLE, targetPacked, level,
   2245                 internalformat, width, height, border, imageSize, dataSize, data));
   2246        if (isCallValid)
   2247        {
   2248            context->compressedTexImage2DRobust(targetPacked, level, internalformat, width, height,
   2249                                                border, imageSize, dataSize, data);
   2250        }
   2251        ANGLE_CAPTURE_GL(CompressedTexImage2DRobustANGLE, isCallValid, context, targetPacked, level,
   2252                         internalformat, width, height, border, imageSize, dataSize, data);
   2253    }
   2254    else
   2255    {
   2256        GenerateContextLostErrorOnCurrentGlobalContext();
   2257    }
   2258 }
   2259 
   2260 void GL_APIENTRY GL_CompressedTexSubImage2DRobustANGLE(GLenum target,
   2261                                                       GLint level,
   2262                                                       GLsizei xoffset,
   2263                                                       GLsizei yoffset,
   2264                                                       GLsizei width,
   2265                                                       GLsizei height,
   2266                                                       GLenum format,
   2267                                                       GLsizei imageSize,
   2268                                                       GLsizei dataSize,
   2269                                                       const GLvoid *data)
   2270 {
   2271    Context *context = GetValidGlobalContext();
   2272    EVENT(context, GLCompressedTexSubImage2DRobustANGLE,
   2273          "context = %d, target = %s, level = %d, xoffset = %d, yoffset = %d, width = %d, height = "
   2274          "%d, format = %s, imageSize = %d, dataSize = %d, data = 0x%016" PRIxPTR "",
   2275          CID(context), GLenumToString(GLESEnum::AllEnums, target), level, xoffset, yoffset, width,
   2276          height, GLenumToString(GLESEnum::AllEnums, format), imageSize, dataSize, (uintptr_t)data);
   2277 
   2278    if (context)
   2279    {
   2280        TextureTarget targetPacked = PackParam<TextureTarget>(target);
   2281        SCOPED_SHARE_CONTEXT_LOCK(context);
   2282        bool isCallValid =
   2283            (context->skipValidation() ||
   2284             ValidateCompressedTexSubImage2DRobustANGLE(
   2285                 context, angle::EntryPoint::GLCompressedTexSubImage2DRobustANGLE, targetPacked,
   2286                 level, xoffset, yoffset, width, height, format, imageSize, dataSize, data));
   2287        if (isCallValid)
   2288        {
   2289            context->compressedTexSubImage2DRobust(targetPacked, level, xoffset, yoffset, width,
   2290                                                   height, format, imageSize, dataSize, data);
   2291        }
   2292        ANGLE_CAPTURE_GL(CompressedTexSubImage2DRobustANGLE, isCallValid, context, targetPacked,
   2293                         level, xoffset, yoffset, width, height, format, imageSize, dataSize, data);
   2294    }
   2295    else
   2296    {
   2297        GenerateContextLostErrorOnCurrentGlobalContext();
   2298    }
   2299 }
   2300 
   2301 void GL_APIENTRY GL_CompressedTexImage3DRobustANGLE(GLenum target,
   2302                                                    GLint level,
   2303                                                    GLenum internalformat,
   2304                                                    GLsizei width,
   2305                                                    GLsizei height,
   2306                                                    GLsizei depth,
   2307                                                    GLint border,
   2308                                                    GLsizei imageSize,
   2309                                                    GLsizei dataSize,
   2310                                                    const GLvoid *data)
   2311 {
   2312    Context *context = GetValidGlobalContext();
   2313    EVENT(context, GLCompressedTexImage3DRobustANGLE,
   2314          "context = %d, target = %s, level = %d, internalformat = %s, width = %d, height = %d, "
   2315          "depth = %d, border = %d, imageSize = %d, dataSize = %d, data = 0x%016" PRIxPTR "",
   2316          CID(context), GLenumToString(GLESEnum::AllEnums, target), level,
   2317          GLenumToString(GLESEnum::AllEnums, internalformat), width, height, depth, border,
   2318          imageSize, dataSize, (uintptr_t)data);
   2319 
   2320    if (context)
   2321    {
   2322        TextureTarget targetPacked = PackParam<TextureTarget>(target);
   2323        SCOPED_SHARE_CONTEXT_LOCK(context);
   2324        bool isCallValid =
   2325            (context->skipValidation() ||
   2326             ValidateCompressedTexImage3DRobustANGLE(
   2327                 context, angle::EntryPoint::GLCompressedTexImage3DRobustANGLE, targetPacked, level,
   2328                 internalformat, width, height, depth, border, imageSize, dataSize, data));
   2329        if (isCallValid)
   2330        {
   2331            context->compressedTexImage3DRobust(targetPacked, level, internalformat, width, height,
   2332                                                depth, border, imageSize, dataSize, data);
   2333        }
   2334        ANGLE_CAPTURE_GL(CompressedTexImage3DRobustANGLE, isCallValid, context, targetPacked, level,
   2335                         internalformat, width, height, depth, border, imageSize, dataSize, data);
   2336    }
   2337    else
   2338    {
   2339        GenerateContextLostErrorOnCurrentGlobalContext();
   2340    }
   2341 }
   2342 
   2343 void GL_APIENTRY GL_CompressedTexSubImage3DRobustANGLE(GLenum target,
   2344                                                       GLint level,
   2345                                                       GLint xoffset,
   2346                                                       GLint yoffset,
   2347                                                       GLint zoffset,
   2348                                                       GLsizei width,
   2349                                                       GLsizei height,
   2350                                                       GLsizei depth,
   2351                                                       GLenum format,
   2352                                                       GLsizei imageSize,
   2353                                                       GLsizei dataSize,
   2354                                                       const GLvoid *data)
   2355 {
   2356    Context *context = GetValidGlobalContext();
   2357    EVENT(context, GLCompressedTexSubImage3DRobustANGLE,
   2358          "context = %d, target = %s, level = %d, xoffset = %d, yoffset = %d, zoffset = %d, width "
   2359          "= %d, height = %d, depth = %d, format = %s, imageSize = %d, dataSize = %d, data = "
   2360          "0x%016" PRIxPTR "",
   2361          CID(context), GLenumToString(GLESEnum::AllEnums, target), level, xoffset, yoffset,
   2362          zoffset, width, height, depth, GLenumToString(GLESEnum::AllEnums, format), imageSize,
   2363          dataSize, (uintptr_t)data);
   2364 
   2365    if (context)
   2366    {
   2367        TextureTarget targetPacked = PackParam<TextureTarget>(target);
   2368        SCOPED_SHARE_CONTEXT_LOCK(context);
   2369        bool isCallValid = (context->skipValidation() ||
   2370                            ValidateCompressedTexSubImage3DRobustANGLE(
   2371                                context, angle::EntryPoint::GLCompressedTexSubImage3DRobustANGLE,
   2372                                targetPacked, level, xoffset, yoffset, zoffset, width, height,
   2373                                depth, format, imageSize, dataSize, data));
   2374        if (isCallValid)
   2375        {
   2376            context->compressedTexSubImage3DRobust(targetPacked, level, xoffset, yoffset, zoffset,
   2377                                                   width, height, depth, format, imageSize,
   2378                                                   dataSize, data);
   2379        }
   2380        ANGLE_CAPTURE_GL(CompressedTexSubImage3DRobustANGLE, isCallValid, context, targetPacked,
   2381                         level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize,
   2382                         dataSize, data);
   2383    }
   2384    else
   2385    {
   2386        GenerateContextLostErrorOnCurrentGlobalContext();
   2387    }
   2388 }
   2389 
   2390 void GL_APIENTRY GL_GetQueryivRobustANGLE(GLenum target,
   2391                                          GLenum pname,
   2392                                          GLsizei bufSize,
   2393                                          GLsizei *length,
   2394                                          GLint *params)
   2395 {
   2396    Context *context = GetValidGlobalContext();
   2397    EVENT(context, GLGetQueryivRobustANGLE,
   2398          "context = %d, target = %s, pname = %s, bufSize = %d, length = 0x%016" PRIxPTR
   2399          ", params = 0x%016" PRIxPTR "",
   2400          CID(context), GLenumToString(GLESEnum::AllEnums, target),
   2401          GLenumToString(GLESEnum::AllEnums, pname), bufSize, (uintptr_t)length, (uintptr_t)params);
   2402 
   2403    if (context)
   2404    {
   2405        QueryType targetPacked = PackParam<QueryType>(target);
   2406        SCOPED_SHARE_CONTEXT_LOCK(context);
   2407        bool isCallValid =
   2408            (context->skipValidation() ||
   2409             ValidateGetQueryivRobustANGLE(context, angle::EntryPoint::GLGetQueryivRobustANGLE,
   2410                                           targetPacked, pname, bufSize, length, params));
   2411        if (isCallValid)
   2412        {
   2413            context->getQueryivRobust(targetPacked, pname, bufSize, length, params);
   2414        }
   2415        ANGLE_CAPTURE_GL(GetQueryivRobustANGLE, isCallValid, context, targetPacked, pname, bufSize,
   2416                         length, params);
   2417    }
   2418    else
   2419    {
   2420        GenerateContextLostErrorOnCurrentGlobalContext();
   2421    }
   2422 }
   2423 
   2424 void GL_APIENTRY GL_GetQueryObjectuivRobustANGLE(GLuint id,
   2425                                                 GLenum pname,
   2426                                                 GLsizei bufSize,
   2427                                                 GLsizei *length,
   2428                                                 GLuint *params)
   2429 {
   2430    Context *context = GetValidGlobalContext();
   2431    EVENT(context, GLGetQueryObjectuivRobustANGLE,
   2432          "context = %d, id = %u, pname = %s, bufSize = %d, length = 0x%016" PRIxPTR
   2433          ", params = 0x%016" PRIxPTR "",
   2434          CID(context), id, GLenumToString(GLESEnum::AllEnums, pname), bufSize, (uintptr_t)length,
   2435          (uintptr_t)params);
   2436 
   2437    if (context)
   2438    {
   2439        QueryID idPacked = PackParam<QueryID>(id);
   2440        SCOPED_SHARE_CONTEXT_LOCK(context);
   2441        bool isCallValid = (context->skipValidation() ||
   2442                            ValidateGetQueryObjectuivRobustANGLE(
   2443                                context, angle::EntryPoint::GLGetQueryObjectuivRobustANGLE,
   2444                                idPacked, pname, bufSize, length, params));
   2445        if (isCallValid)
   2446        {
   2447            context->getQueryObjectuivRobust(idPacked, pname, bufSize, length, params);
   2448        }
   2449        ANGLE_CAPTURE_GL(GetQueryObjectuivRobustANGLE, isCallValid, context, idPacked, pname,
   2450                         bufSize, length, params);
   2451    }
   2452    else
   2453    {
   2454        GenerateContextLostErrorOnCurrentGlobalContext();
   2455    }
   2456 }
   2457 
   2458 void GL_APIENTRY GL_GetBufferPointervRobustANGLE(GLenum target,
   2459                                                 GLenum pname,
   2460                                                 GLsizei bufSize,
   2461                                                 GLsizei *length,
   2462                                                 void **params)
   2463 {
   2464    Context *context = GetValidGlobalContext();
   2465    EVENT(context, GLGetBufferPointervRobustANGLE,
   2466          "context = %d, target = %s, pname = %s, bufSize = %d, length = 0x%016" PRIxPTR
   2467          ", params = 0x%016" PRIxPTR "",
   2468          CID(context), GLenumToString(GLESEnum::AllEnums, target),
   2469          GLenumToString(GLESEnum::AllEnums, pname), bufSize, (uintptr_t)length, (uintptr_t)params);
   2470 
   2471    if (context)
   2472    {
   2473        BufferBinding targetPacked = PackParam<BufferBinding>(target);
   2474        SCOPED_SHARE_CONTEXT_LOCK(context);
   2475        bool isCallValid = (context->skipValidation() ||
   2476                            ValidateGetBufferPointervRobustANGLE(
   2477                                context, angle::EntryPoint::GLGetBufferPointervRobustANGLE,
   2478                                targetPacked, pname, bufSize, length, params));
   2479        if (isCallValid)
   2480        {
   2481            context->getBufferPointervRobust(targetPacked, pname, bufSize, length, params);
   2482        }
   2483        ANGLE_CAPTURE_GL(GetBufferPointervRobustANGLE, isCallValid, context, targetPacked, pname,
   2484                         bufSize, length, params);
   2485    }
   2486    else
   2487    {
   2488        GenerateContextLostErrorOnCurrentGlobalContext();
   2489    }
   2490 }
   2491 
   2492 void GL_APIENTRY GL_GetIntegeri_vRobustANGLE(GLenum target,
   2493                                             GLuint index,
   2494                                             GLsizei bufSize,
   2495                                             GLsizei *length,
   2496                                             GLint *data)
   2497 {
   2498    Context *context = GetValidGlobalContext();
   2499    EVENT(context, GLGetIntegeri_vRobustANGLE,
   2500          "context = %d, target = %s, index = %u, bufSize = %d, length = 0x%016" PRIxPTR
   2501          ", data = 0x%016" PRIxPTR "",
   2502          CID(context), GLenumToString(GLESEnum::AllEnums, target), index, bufSize,
   2503          (uintptr_t)length, (uintptr_t)data);
   2504 
   2505    if (context)
   2506    {
   2507        SCOPED_SHARE_CONTEXT_LOCK(context);
   2508        bool isCallValid = (context->skipValidation() ||
   2509                            ValidateGetIntegeri_vRobustANGLE(
   2510                                context, angle::EntryPoint::GLGetIntegeri_vRobustANGLE, target,
   2511                                index, bufSize, length, data));
   2512        if (isCallValid)
   2513        {
   2514            context->getIntegeri_vRobust(target, index, bufSize, length, data);
   2515        }
   2516        ANGLE_CAPTURE_GL(GetIntegeri_vRobustANGLE, isCallValid, context, target, index, bufSize,
   2517                         length, data);
   2518    }
   2519    else
   2520    {
   2521        GenerateContextLostErrorOnCurrentGlobalContext();
   2522    }
   2523 }
   2524 
   2525 void GL_APIENTRY GL_GetInternalformativRobustANGLE(GLenum target,
   2526                                                   GLenum internalformat,
   2527                                                   GLenum pname,
   2528                                                   GLsizei bufSize,
   2529                                                   GLsizei *length,
   2530                                                   GLint *params)
   2531 {
   2532    Context *context = GetValidGlobalContext();
   2533    EVENT(context, GLGetInternalformativRobustANGLE,
   2534          "context = %d, target = %s, internalformat = %s, pname = %s, bufSize = %d, length = "
   2535          "0x%016" PRIxPTR ", params = 0x%016" PRIxPTR "",
   2536          CID(context), GLenumToString(GLESEnum::AllEnums, target),
   2537          GLenumToString(GLESEnum::AllEnums, internalformat),
   2538          GLenumToString(GLESEnum::AllEnums, pname), bufSize, (uintptr_t)length, (uintptr_t)params);
   2539 
   2540    if (context)
   2541    {
   2542        SCOPED_SHARE_CONTEXT_LOCK(context);
   2543        bool isCallValid = (context->skipValidation() ||
   2544                            ValidateGetInternalformativRobustANGLE(
   2545                                context, angle::EntryPoint::GLGetInternalformativRobustANGLE,
   2546                                target, internalformat, pname, bufSize, length, params));
   2547        if (isCallValid)
   2548        {
   2549            context->getInternalformativRobust(target, internalformat, pname, bufSize, length,
   2550                                               params);
   2551        }
   2552        ANGLE_CAPTURE_GL(GetInternalformativRobustANGLE, isCallValid, context, target,
   2553                         internalformat, pname, bufSize, length, params);
   2554    }
   2555    else
   2556    {
   2557        GenerateContextLostErrorOnCurrentGlobalContext();
   2558    }
   2559 }
   2560 
   2561 void GL_APIENTRY GL_GetVertexAttribIivRobustANGLE(GLuint index,
   2562                                                  GLenum pname,
   2563                                                  GLsizei bufSize,
   2564                                                  GLsizei *length,
   2565                                                  GLint *params)
   2566 {
   2567    Context *context = GetValidGlobalContext();
   2568    EVENT(context, GLGetVertexAttribIivRobustANGLE,
   2569          "context = %d, index = %u, pname = %s, bufSize = %d, length = 0x%016" PRIxPTR
   2570          ", params = 0x%016" PRIxPTR "",
   2571          CID(context), index, GLenumToString(GLESEnum::AllEnums, pname), bufSize,
   2572          (uintptr_t)length, (uintptr_t)params);
   2573 
   2574    if (context)
   2575    {
   2576        SCOPED_SHARE_CONTEXT_LOCK(context);
   2577        bool isCallValid = (context->skipValidation() ||
   2578                            ValidateGetVertexAttribIivRobustANGLE(
   2579                                context, angle::EntryPoint::GLGetVertexAttribIivRobustANGLE, index,
   2580                                pname, bufSize, length, params));
   2581        if (isCallValid)
   2582        {
   2583            context->getVertexAttribIivRobust(index, pname, bufSize, length, params);
   2584        }
   2585        ANGLE_CAPTURE_GL(GetVertexAttribIivRobustANGLE, isCallValid, context, index, pname, bufSize,
   2586                         length, params);
   2587    }
   2588    else
   2589    {
   2590        GenerateContextLostErrorOnCurrentGlobalContext();
   2591    }
   2592 }
   2593 
   2594 void GL_APIENTRY GL_GetVertexAttribIuivRobustANGLE(GLuint index,
   2595                                                   GLenum pname,
   2596                                                   GLsizei bufSize,
   2597                                                   GLsizei *length,
   2598                                                   GLuint *params)
   2599 {
   2600    Context *context = GetValidGlobalContext();
   2601    EVENT(context, GLGetVertexAttribIuivRobustANGLE,
   2602          "context = %d, index = %u, pname = %s, bufSize = %d, length = 0x%016" PRIxPTR
   2603          ", params = 0x%016" PRIxPTR "",
   2604          CID(context), index, GLenumToString(GLESEnum::AllEnums, pname), bufSize,
   2605          (uintptr_t)length, (uintptr_t)params);
   2606 
   2607    if (context)
   2608    {
   2609        SCOPED_SHARE_CONTEXT_LOCK(context);
   2610        bool isCallValid = (context->skipValidation() ||
   2611                            ValidateGetVertexAttribIuivRobustANGLE(
   2612                                context, angle::EntryPoint::GLGetVertexAttribIuivRobustANGLE, index,
   2613                                pname, bufSize, length, params));
   2614        if (isCallValid)
   2615        {
   2616            context->getVertexAttribIuivRobust(index, pname, bufSize, length, params);
   2617        }
   2618        ANGLE_CAPTURE_GL(GetVertexAttribIuivRobustANGLE, isCallValid, context, index, pname,
   2619                         bufSize, length, params);
   2620    }
   2621    else
   2622    {
   2623        GenerateContextLostErrorOnCurrentGlobalContext();
   2624    }
   2625 }
   2626 
   2627 void GL_APIENTRY GL_GetUniformuivRobustANGLE(GLuint program,
   2628                                             GLint location,
   2629                                             GLsizei bufSize,
   2630                                             GLsizei *length,
   2631                                             GLuint *params)
   2632 {
   2633    Context *context = GetValidGlobalContext();
   2634    EVENT(context, GLGetUniformuivRobustANGLE,
   2635          "context = %d, program = %u, location = %d, bufSize = %d, length = 0x%016" PRIxPTR
   2636          ", params = 0x%016" PRIxPTR "",
   2637          CID(context), program, location, bufSize, (uintptr_t)length, (uintptr_t)params);
   2638 
   2639    if (context)
   2640    {
   2641        ShaderProgramID programPacked  = PackParam<ShaderProgramID>(program);
   2642        UniformLocation locationPacked = PackParam<UniformLocation>(location);
   2643        SCOPED_SHARE_CONTEXT_LOCK(context);
   2644        bool isCallValid = (context->skipValidation() ||
   2645                            ValidateGetUniformuivRobustANGLE(
   2646                                context, angle::EntryPoint::GLGetUniformuivRobustANGLE,
   2647                                programPacked, locationPacked, bufSize, length, params));
   2648        if (isCallValid)
   2649        {
   2650            context->getUniformuivRobust(programPacked, locationPacked, bufSize, length, params);
   2651        }
   2652        ANGLE_CAPTURE_GL(GetUniformuivRobustANGLE, isCallValid, context, programPacked,
   2653                         locationPacked, bufSize, length, params);
   2654    }
   2655    else
   2656    {
   2657        GenerateContextLostErrorOnCurrentGlobalContext();
   2658    }
   2659 }
   2660 
   2661 void GL_APIENTRY GL_GetActiveUniformBlockivRobustANGLE(GLuint program,
   2662                                                       GLuint uniformBlockIndex,
   2663                                                       GLenum pname,
   2664                                                       GLsizei bufSize,
   2665                                                       GLsizei *length,
   2666                                                       GLint *params)
   2667 {
   2668    Context *context = GetValidGlobalContext();
   2669    EVENT(context, GLGetActiveUniformBlockivRobustANGLE,
   2670          "context = %d, program = %u, uniformBlockIndex = %u, pname = %s, bufSize = %d, length = "
   2671          "0x%016" PRIxPTR ", params = 0x%016" PRIxPTR "",
   2672          CID(context), program, uniformBlockIndex, GLenumToString(GLESEnum::AllEnums, pname),
   2673          bufSize, (uintptr_t)length, (uintptr_t)params);
   2674 
   2675    if (context)
   2676    {
   2677        ShaderProgramID programPacked             = PackParam<ShaderProgramID>(program);
   2678        UniformBlockIndex uniformBlockIndexPacked = PackParam<UniformBlockIndex>(uniformBlockIndex);
   2679        SCOPED_SHARE_CONTEXT_LOCK(context);
   2680        bool isCallValid =
   2681            (context->skipValidation() ||
   2682             ValidateGetActiveUniformBlockivRobustANGLE(
   2683                 context, angle::EntryPoint::GLGetActiveUniformBlockivRobustANGLE, programPacked,
   2684                 uniformBlockIndexPacked, pname, bufSize, length, params));
   2685        if (isCallValid)
   2686        {
   2687            context->getActiveUniformBlockivRobust(programPacked, uniformBlockIndexPacked, pname,
   2688                                                   bufSize, length, params);
   2689        }
   2690        ANGLE_CAPTURE_GL(GetActiveUniformBlockivRobustANGLE, isCallValid, context, programPacked,
   2691                         uniformBlockIndexPacked, pname, bufSize, length, params);
   2692    }
   2693    else
   2694    {
   2695        GenerateContextLostErrorOnCurrentGlobalContext();
   2696    }
   2697 }
   2698 
   2699 void GL_APIENTRY GL_GetInteger64vRobustANGLE(GLenum pname,
   2700                                             GLsizei bufSize,
   2701                                             GLsizei *length,
   2702                                             GLint64 *data)
   2703 {
   2704    Context *context = GetValidGlobalContext();
   2705    EVENT(context, GLGetInteger64vRobustANGLE,
   2706          "context = %d, pname = %s, bufSize = %d, length = 0x%016" PRIxPTR
   2707          ", data = 0x%016" PRIxPTR "",
   2708          CID(context), GLenumToString(GLESEnum::AllEnums, pname), bufSize, (uintptr_t)length,
   2709          (uintptr_t)data);
   2710 
   2711    if (context)
   2712    {
   2713        SCOPED_SHARE_CONTEXT_LOCK(context);
   2714        bool isCallValid = (context->skipValidation() ||
   2715                            ValidateGetInteger64vRobustANGLE(
   2716                                context, angle::EntryPoint::GLGetInteger64vRobustANGLE, pname,
   2717                                bufSize, length, data));
   2718        if (isCallValid)
   2719        {
   2720            context->getInteger64vRobust(pname, bufSize, length, data);
   2721        }
   2722        ANGLE_CAPTURE_GL(GetInteger64vRobustANGLE, isCallValid, context, pname, bufSize, length,
   2723                         data);
   2724    }
   2725    else
   2726    {
   2727        GenerateContextLostErrorOnCurrentGlobalContext();
   2728    }
   2729 }
   2730 
   2731 void GL_APIENTRY GL_GetInteger64i_vRobustANGLE(GLenum target,
   2732                                               GLuint index,
   2733                                               GLsizei bufSize,
   2734                                               GLsizei *length,
   2735                                               GLint64 *data)
   2736 {
   2737    Context *context = GetValidGlobalContext();
   2738    EVENT(context, GLGetInteger64i_vRobustANGLE,
   2739          "context = %d, target = %s, index = %u, bufSize = %d, length = 0x%016" PRIxPTR
   2740          ", data = 0x%016" PRIxPTR "",
   2741          CID(context), GLenumToString(GLESEnum::AllEnums, target), index, bufSize,
   2742          (uintptr_t)length, (uintptr_t)data);
   2743 
   2744    if (context)
   2745    {
   2746        SCOPED_SHARE_CONTEXT_LOCK(context);
   2747        bool isCallValid = (context->skipValidation() ||
   2748                            ValidateGetInteger64i_vRobustANGLE(
   2749                                context, angle::EntryPoint::GLGetInteger64i_vRobustANGLE, target,
   2750                                index, bufSize, length, data));
   2751        if (isCallValid)
   2752        {
   2753            context->getInteger64i_vRobust(target, index, bufSize, length, data);
   2754        }
   2755        ANGLE_CAPTURE_GL(GetInteger64i_vRobustANGLE, isCallValid, context, target, index, bufSize,
   2756                         length, data);
   2757    }
   2758    else
   2759    {
   2760        GenerateContextLostErrorOnCurrentGlobalContext();
   2761    }
   2762 }
   2763 
   2764 void GL_APIENTRY GL_GetBufferParameteri64vRobustANGLE(GLenum target,
   2765                                                      GLenum pname,
   2766                                                      GLsizei bufSize,
   2767                                                      GLsizei *length,
   2768                                                      GLint64 *params)
   2769 {
   2770    Context *context = GetValidGlobalContext();
   2771    EVENT(context, GLGetBufferParameteri64vRobustANGLE,
   2772          "context = %d, target = %s, pname = %s, bufSize = %d, length = 0x%016" PRIxPTR
   2773          ", params = 0x%016" PRIxPTR "",
   2774          CID(context), GLenumToString(GLESEnum::AllEnums, target),
   2775          GLenumToString(GLESEnum::AllEnums, pname), bufSize, (uintptr_t)length, (uintptr_t)params);
   2776 
   2777    if (context)
   2778    {
   2779        BufferBinding targetPacked = PackParam<BufferBinding>(target);
   2780        SCOPED_SHARE_CONTEXT_LOCK(context);
   2781        bool isCallValid = (context->skipValidation() ||
   2782                            ValidateGetBufferParameteri64vRobustANGLE(
   2783                                context, angle::EntryPoint::GLGetBufferParameteri64vRobustANGLE,
   2784                                targetPacked, pname, bufSize, length, params));
   2785        if (isCallValid)
   2786        {
   2787            context->getBufferParameteri64vRobust(targetPacked, pname, bufSize, length, params);
   2788        }
   2789        ANGLE_CAPTURE_GL(GetBufferParameteri64vRobustANGLE, isCallValid, context, targetPacked,
   2790                         pname, bufSize, length, params);
   2791    }
   2792    else
   2793    {
   2794        GenerateContextLostErrorOnCurrentGlobalContext();
   2795    }
   2796 }
   2797 
   2798 void GL_APIENTRY GL_SamplerParameterivRobustANGLE(GLuint sampler,
   2799                                                  GLuint pname,
   2800                                                  GLsizei bufSize,
   2801                                                  const GLint *param)
   2802 {
   2803    Context *context = GetValidGlobalContext();
   2804    EVENT(context, GLSamplerParameterivRobustANGLE,
   2805          "context = %d, sampler = %u, pname = %u, bufSize = %d, param = 0x%016" PRIxPTR "",
   2806          CID(context), sampler, pname, bufSize, (uintptr_t)param);
   2807 
   2808    if (context)
   2809    {
   2810        SamplerID samplerPacked = PackParam<SamplerID>(sampler);
   2811        SCOPED_SHARE_CONTEXT_LOCK(context);
   2812        bool isCallValid = (context->skipValidation() ||
   2813                            ValidateSamplerParameterivRobustANGLE(
   2814                                context, angle::EntryPoint::GLSamplerParameterivRobustANGLE,
   2815                                samplerPacked, pname, bufSize, param));
   2816        if (isCallValid)
   2817        {
   2818            context->samplerParameterivRobust(samplerPacked, pname, bufSize, param);
   2819        }
   2820        ANGLE_CAPTURE_GL(SamplerParameterivRobustANGLE, isCallValid, context, samplerPacked, pname,
   2821                         bufSize, param);
   2822    }
   2823    else
   2824    {
   2825        GenerateContextLostErrorOnCurrentGlobalContext();
   2826    }
   2827 }
   2828 
   2829 void GL_APIENTRY GL_SamplerParameterfvRobustANGLE(GLuint sampler,
   2830                                                  GLenum pname,
   2831                                                  GLsizei bufSize,
   2832                                                  const GLfloat *param)
   2833 {
   2834    Context *context = GetValidGlobalContext();
   2835    EVENT(context, GLSamplerParameterfvRobustANGLE,
   2836          "context = %d, sampler = %u, pname = %s, bufSize = %d, param = 0x%016" PRIxPTR "",
   2837          CID(context), sampler, GLenumToString(GLESEnum::AllEnums, pname), bufSize,
   2838          (uintptr_t)param);
   2839 
   2840    if (context)
   2841    {
   2842        SamplerID samplerPacked = PackParam<SamplerID>(sampler);
   2843        SCOPED_SHARE_CONTEXT_LOCK(context);
   2844        bool isCallValid = (context->skipValidation() ||
   2845                            ValidateSamplerParameterfvRobustANGLE(
   2846                                context, angle::EntryPoint::GLSamplerParameterfvRobustANGLE,
   2847                                samplerPacked, pname, bufSize, param));
   2848        if (isCallValid)
   2849        {
   2850            context->samplerParameterfvRobust(samplerPacked, pname, bufSize, param);
   2851        }
   2852        ANGLE_CAPTURE_GL(SamplerParameterfvRobustANGLE, isCallValid, context, samplerPacked, pname,
   2853                         bufSize, param);
   2854    }
   2855    else
   2856    {
   2857        GenerateContextLostErrorOnCurrentGlobalContext();
   2858    }
   2859 }
   2860 
   2861 void GL_APIENTRY GL_GetSamplerParameterivRobustANGLE(GLuint sampler,
   2862                                                     GLenum pname,
   2863                                                     GLsizei bufSize,
   2864                                                     GLsizei *length,
   2865                                                     GLint *params)
   2866 {
   2867    Context *context = GetValidGlobalContext();
   2868    EVENT(context, GLGetSamplerParameterivRobustANGLE,
   2869          "context = %d, sampler = %u, pname = %s, bufSize = %d, length = 0x%016" PRIxPTR
   2870          ", params = 0x%016" PRIxPTR "",
   2871          CID(context), sampler, GLenumToString(GLESEnum::AllEnums, pname), bufSize,
   2872          (uintptr_t)length, (uintptr_t)params);
   2873 
   2874    if (context)
   2875    {
   2876        SamplerID samplerPacked = PackParam<SamplerID>(sampler);
   2877        SCOPED_SHARE_CONTEXT_LOCK(context);
   2878        bool isCallValid = (context->skipValidation() ||
   2879                            ValidateGetSamplerParameterivRobustANGLE(
   2880                                context, angle::EntryPoint::GLGetSamplerParameterivRobustANGLE,
   2881                                samplerPacked, pname, bufSize, length, params));
   2882        if (isCallValid)
   2883        {
   2884            context->getSamplerParameterivRobust(samplerPacked, pname, bufSize, length, params);
   2885        }
   2886        ANGLE_CAPTURE_GL(GetSamplerParameterivRobustANGLE, isCallValid, context, samplerPacked,
   2887                         pname, bufSize, length, params);
   2888    }
   2889    else
   2890    {
   2891        GenerateContextLostErrorOnCurrentGlobalContext();
   2892    }
   2893 }
   2894 
   2895 void GL_APIENTRY GL_GetSamplerParameterfvRobustANGLE(GLuint sampler,
   2896                                                     GLenum pname,
   2897                                                     GLsizei bufSize,
   2898                                                     GLsizei *length,
   2899                                                     GLfloat *params)
   2900 {
   2901    Context *context = GetValidGlobalContext();
   2902    EVENT(context, GLGetSamplerParameterfvRobustANGLE,
   2903          "context = %d, sampler = %u, pname = %s, bufSize = %d, length = 0x%016" PRIxPTR
   2904          ", params = 0x%016" PRIxPTR "",
   2905          CID(context), sampler, GLenumToString(GLESEnum::AllEnums, pname), bufSize,
   2906          (uintptr_t)length, (uintptr_t)params);
   2907 
   2908    if (context)
   2909    {
   2910        SamplerID samplerPacked = PackParam<SamplerID>(sampler);
   2911        SCOPED_SHARE_CONTEXT_LOCK(context);
   2912        bool isCallValid = (context->skipValidation() ||
   2913                            ValidateGetSamplerParameterfvRobustANGLE(
   2914                                context, angle::EntryPoint::GLGetSamplerParameterfvRobustANGLE,
   2915                                samplerPacked, pname, bufSize, length, params));
   2916        if (isCallValid)
   2917        {
   2918            context->getSamplerParameterfvRobust(samplerPacked, pname, bufSize, length, params);
   2919        }
   2920        ANGLE_CAPTURE_GL(GetSamplerParameterfvRobustANGLE, isCallValid, context, samplerPacked,
   2921                         pname, bufSize, length, params);
   2922    }
   2923    else
   2924    {
   2925        GenerateContextLostErrorOnCurrentGlobalContext();
   2926    }
   2927 }
   2928 
   2929 void GL_APIENTRY GL_GetFramebufferParameterivRobustANGLE(GLenum target,
   2930                                                         GLenum pname,
   2931                                                         GLsizei bufSize,
   2932                                                         GLsizei *length,
   2933                                                         GLint *params)
   2934 {
   2935    Context *context = GetValidGlobalContext();
   2936    EVENT(context, GLGetFramebufferParameterivRobustANGLE,
   2937          "context = %d, target = %s, pname = %s, bufSize = %d, length = 0x%016" PRIxPTR
   2938          ", params = 0x%016" PRIxPTR "",
   2939          CID(context), GLenumToString(GLESEnum::AllEnums, target),
   2940          GLenumToString(GLESEnum::AllEnums, pname), bufSize, (uintptr_t)length, (uintptr_t)params);
   2941 
   2942    if (context)
   2943    {
   2944        SCOPED_SHARE_CONTEXT_LOCK(context);
   2945        bool isCallValid = (context->skipValidation() ||
   2946                            ValidateGetFramebufferParameterivRobustANGLE(
   2947                                context, angle::EntryPoint::GLGetFramebufferParameterivRobustANGLE,
   2948                                target, pname, bufSize, length, params));
   2949        if (isCallValid)
   2950        {
   2951            context->getFramebufferParameterivRobust(target, pname, bufSize, length, params);
   2952        }
   2953        ANGLE_CAPTURE_GL(GetFramebufferParameterivRobustANGLE, isCallValid, context, target, pname,
   2954                         bufSize, length, params);
   2955    }
   2956    else
   2957    {
   2958        GenerateContextLostErrorOnCurrentGlobalContext();
   2959    }
   2960 }
   2961 
   2962 void GL_APIENTRY GL_GetProgramInterfaceivRobustANGLE(GLuint program,
   2963                                                     GLenum programInterface,
   2964                                                     GLenum pname,
   2965                                                     GLsizei bufSize,
   2966                                                     GLsizei *length,
   2967                                                     GLint *params)
   2968 {
   2969    Context *context = GetValidGlobalContext();
   2970    EVENT(context, GLGetProgramInterfaceivRobustANGLE,
   2971          "context = %d, program = %u, programInterface = %s, pname = %s, bufSize = %d, length = "
   2972          "0x%016" PRIxPTR ", params = 0x%016" PRIxPTR "",
   2973          CID(context), program, GLenumToString(GLESEnum::AllEnums, programInterface),
   2974          GLenumToString(GLESEnum::AllEnums, pname), bufSize, (uintptr_t)length, (uintptr_t)params);
   2975 
   2976    if (context)
   2977    {
   2978        ShaderProgramID programPacked = PackParam<ShaderProgramID>(program);
   2979        SCOPED_SHARE_CONTEXT_LOCK(context);
   2980        bool isCallValid = (context->skipValidation() ||
   2981                            ValidateGetProgramInterfaceivRobustANGLE(
   2982                                context, angle::EntryPoint::GLGetProgramInterfaceivRobustANGLE,
   2983                                programPacked, programInterface, pname, bufSize, length, params));
   2984        if (isCallValid)
   2985        {
   2986            context->getProgramInterfaceivRobust(programPacked, programInterface, pname, bufSize,
   2987                                                 length, params);
   2988        }
   2989        ANGLE_CAPTURE_GL(GetProgramInterfaceivRobustANGLE, isCallValid, context, programPacked,
   2990                         programInterface, pname, bufSize, length, params);
   2991    }
   2992    else
   2993    {
   2994        GenerateContextLostErrorOnCurrentGlobalContext();
   2995    }
   2996 }
   2997 
   2998 void GL_APIENTRY GL_GetBooleani_vRobustANGLE(GLenum target,
   2999                                             GLuint index,
   3000                                             GLsizei bufSize,
   3001                                             GLsizei *length,
   3002                                             GLboolean *data)
   3003 {
   3004    Context *context = GetValidGlobalContext();
   3005    EVENT(context, GLGetBooleani_vRobustANGLE,
   3006          "context = %d, target = %s, index = %u, bufSize = %d, length = 0x%016" PRIxPTR
   3007          ", data = 0x%016" PRIxPTR "",
   3008          CID(context), GLenumToString(GLESEnum::AllEnums, target), index, bufSize,
   3009          (uintptr_t)length, (uintptr_t)data);
   3010 
   3011    if (context)
   3012    {
   3013        SCOPED_SHARE_CONTEXT_LOCK(context);
   3014        bool isCallValid = (context->skipValidation() ||
   3015                            ValidateGetBooleani_vRobustANGLE(
   3016                                context, angle::EntryPoint::GLGetBooleani_vRobustANGLE, target,
   3017                                index, bufSize, length, data));
   3018        if (isCallValid)
   3019        {
   3020            context->getBooleani_vRobust(target, index, bufSize, length, data);
   3021        }
   3022        ANGLE_CAPTURE_GL(GetBooleani_vRobustANGLE, isCallValid, context, target, index, bufSize,
   3023                         length, data);
   3024    }
   3025    else
   3026    {
   3027        GenerateContextLostErrorOnCurrentGlobalContext();
   3028    }
   3029 }
   3030 
   3031 void GL_APIENTRY GL_GetMultisamplefvRobustANGLE(GLenum pname,
   3032                                                GLuint index,
   3033                                                GLsizei bufSize,
   3034                                                GLsizei *length,
   3035                                                GLfloat *val)
   3036 {
   3037    Context *context = GetValidGlobalContext();
   3038    EVENT(context, GLGetMultisamplefvRobustANGLE,
   3039          "context = %d, pname = %s, index = %u, bufSize = %d, length = 0x%016" PRIxPTR
   3040          ", val = 0x%016" PRIxPTR "",
   3041          CID(context), GLenumToString(GLESEnum::AllEnums, pname), index, bufSize,
   3042          (uintptr_t)length, (uintptr_t)val);
   3043 
   3044    if (context)
   3045    {
   3046        SCOPED_SHARE_CONTEXT_LOCK(context);
   3047        bool isCallValid = (context->skipValidation() ||
   3048                            ValidateGetMultisamplefvRobustANGLE(
   3049                                context, angle::EntryPoint::GLGetMultisamplefvRobustANGLE, pname,
   3050                                index, bufSize, length, val));
   3051        if (isCallValid)
   3052        {
   3053            context->getMultisamplefvRobust(pname, index, bufSize, length, val);
   3054        }
   3055        ANGLE_CAPTURE_GL(GetMultisamplefvRobustANGLE, isCallValid, context, pname, index, bufSize,
   3056                         length, val);
   3057    }
   3058    else
   3059    {
   3060        GenerateContextLostErrorOnCurrentGlobalContext();
   3061    }
   3062 }
   3063 
   3064 void GL_APIENTRY GL_GetTexLevelParameterivRobustANGLE(GLenum target,
   3065                                                      GLint level,
   3066                                                      GLenum pname,
   3067                                                      GLsizei bufSize,
   3068                                                      GLsizei *length,
   3069                                                      GLint *params)
   3070 {
   3071    Context *context = GetValidGlobalContext();
   3072    EVENT(context, GLGetTexLevelParameterivRobustANGLE,
   3073          "context = %d, target = %s, level = %d, pname = %s, bufSize = %d, length = 0x%016" PRIxPTR
   3074          ", params = 0x%016" PRIxPTR "",
   3075          CID(context), GLenumToString(GLESEnum::AllEnums, target), level,
   3076          GLenumToString(GLESEnum::AllEnums, pname), bufSize, (uintptr_t)length, (uintptr_t)params);
   3077 
   3078    if (context)
   3079    {
   3080        TextureTarget targetPacked = PackParam<TextureTarget>(target);
   3081        SCOPED_SHARE_CONTEXT_LOCK(context);
   3082        bool isCallValid = (context->skipValidation() ||
   3083                            ValidateGetTexLevelParameterivRobustANGLE(
   3084                                context, angle::EntryPoint::GLGetTexLevelParameterivRobustANGLE,
   3085                                targetPacked, level, pname, bufSize, length, params));
   3086        if (isCallValid)
   3087        {
   3088            context->getTexLevelParameterivRobust(targetPacked, level, pname, bufSize, length,
   3089                                                  params);
   3090        }
   3091        ANGLE_CAPTURE_GL(GetTexLevelParameterivRobustANGLE, isCallValid, context, targetPacked,
   3092                         level, pname, bufSize, length, params);
   3093    }
   3094    else
   3095    {
   3096        GenerateContextLostErrorOnCurrentGlobalContext();
   3097    }
   3098 }
   3099 
   3100 void GL_APIENTRY GL_GetTexLevelParameterfvRobustANGLE(GLenum target,
   3101                                                      GLint level,
   3102                                                      GLenum pname,
   3103                                                      GLsizei bufSize,
   3104                                                      GLsizei *length,
   3105                                                      GLfloat *params)
   3106 {
   3107    Context *context = GetValidGlobalContext();
   3108    EVENT(context, GLGetTexLevelParameterfvRobustANGLE,
   3109          "context = %d, target = %s, level = %d, pname = %s, bufSize = %d, length = 0x%016" PRIxPTR
   3110          ", params = 0x%016" PRIxPTR "",
   3111          CID(context), GLenumToString(GLESEnum::AllEnums, target), level,
   3112          GLenumToString(GLESEnum::AllEnums, pname), bufSize, (uintptr_t)length, (uintptr_t)params);
   3113 
   3114    if (context)
   3115    {
   3116        TextureTarget targetPacked = PackParam<TextureTarget>(target);
   3117        SCOPED_SHARE_CONTEXT_LOCK(context);
   3118        bool isCallValid = (context->skipValidation() ||
   3119                            ValidateGetTexLevelParameterfvRobustANGLE(
   3120                                context, angle::EntryPoint::GLGetTexLevelParameterfvRobustANGLE,
   3121                                targetPacked, level, pname, bufSize, length, params));
   3122        if (isCallValid)
   3123        {
   3124            context->getTexLevelParameterfvRobust(targetPacked, level, pname, bufSize, length,
   3125                                                  params);
   3126        }
   3127        ANGLE_CAPTURE_GL(GetTexLevelParameterfvRobustANGLE, isCallValid, context, targetPacked,
   3128                         level, pname, bufSize, length, params);
   3129    }
   3130    else
   3131    {
   3132        GenerateContextLostErrorOnCurrentGlobalContext();
   3133    }
   3134 }
   3135 
   3136 void GL_APIENTRY GL_GetPointervRobustANGLERobustANGLE(GLenum pname,
   3137                                                      GLsizei bufSize,
   3138                                                      GLsizei *length,
   3139                                                      void **params)
   3140 {
   3141    Context *context = GetValidGlobalContext();
   3142    EVENT(context, GLGetPointervRobustANGLERobustANGLE,
   3143          "context = %d, pname = %s, bufSize = %d, length = 0x%016" PRIxPTR
   3144          ", params = 0x%016" PRIxPTR "",
   3145          CID(context), GLenumToString(GLESEnum::AllEnums, pname), bufSize, (uintptr_t)length,
   3146          (uintptr_t)params);
   3147 
   3148    if (context)
   3149    {
   3150        SCOPED_SHARE_CONTEXT_LOCK(context);
   3151        bool isCallValid = (context->skipValidation() ||
   3152                            ValidateGetPointervRobustANGLERobustANGLE(
   3153                                context, angle::EntryPoint::GLGetPointervRobustANGLERobustANGLE,
   3154                                pname, bufSize, length, params));
   3155        if (isCallValid)
   3156        {
   3157            context->getPointervRobustANGLERobust(pname, bufSize, length, params);
   3158        }
   3159        ANGLE_CAPTURE_GL(GetPointervRobustANGLERobustANGLE, isCallValid, context, pname, bufSize,
   3160                         length, params);
   3161    }
   3162    else
   3163    {
   3164        GenerateContextLostErrorOnCurrentGlobalContext();
   3165    }
   3166 }
   3167 
   3168 void GL_APIENTRY GL_ReadnPixelsRobustANGLE(GLint x,
   3169                                           GLint y,
   3170                                           GLsizei width,
   3171                                           GLsizei height,
   3172                                           GLenum format,
   3173                                           GLenum type,
   3174                                           GLsizei bufSize,
   3175                                           GLsizei *length,
   3176                                           GLsizei *columns,
   3177                                           GLsizei *rows,
   3178                                           void *data)
   3179 {
   3180    Context *context = GetValidGlobalContext();
   3181    EVENT(context, GLReadnPixelsRobustANGLE,
   3182          "context = %d, x = %d, y = %d, width = %d, height = %d, format = %s, type = %s, bufSize "
   3183          "= %d, length = 0x%016" PRIxPTR ", columns = 0x%016" PRIxPTR ", rows = 0x%016" PRIxPTR
   3184          ", data = 0x%016" PRIxPTR "",
   3185          CID(context), x, y, width, height, GLenumToString(GLESEnum::AllEnums, format),
   3186          GLenumToString(GLESEnum::AllEnums, type), bufSize, (uintptr_t)length, (uintptr_t)columns,
   3187          (uintptr_t)rows, (uintptr_t)data);
   3188 
   3189    if (context)
   3190    {
   3191        SCOPED_SHARE_CONTEXT_LOCK(context);
   3192        bool isCallValid = (context->skipValidation() ||
   3193                            ValidateReadnPixelsRobustANGLE(
   3194                                context, angle::EntryPoint::GLReadnPixelsRobustANGLE, x, y, width,
   3195                                height, format, type, bufSize, length, columns, rows, data));
   3196        if (isCallValid)
   3197        {
   3198            context->readnPixelsRobust(x, y, width, height, format, type, bufSize, length, columns,
   3199                                       rows, data);
   3200        }
   3201        ANGLE_CAPTURE_GL(ReadnPixelsRobustANGLE, isCallValid, context, x, y, width, height, format,
   3202                         type, bufSize, length, columns, rows, data);
   3203    }
   3204    else
   3205    {
   3206        GenerateContextLostErrorOnCurrentGlobalContext();
   3207    }
   3208 }
   3209 
   3210 void GL_APIENTRY GL_GetnUniformfvRobustANGLE(GLuint program,
   3211                                             GLint location,
   3212                                             GLsizei bufSize,
   3213                                             GLsizei *length,
   3214                                             GLfloat *params)
   3215 {
   3216    Context *context = GetValidGlobalContext();
   3217    EVENT(context, GLGetnUniformfvRobustANGLE,
   3218          "context = %d, program = %u, location = %d, bufSize = %d, length = 0x%016" PRIxPTR
   3219          ", params = 0x%016" PRIxPTR "",
   3220          CID(context), program, location, bufSize, (uintptr_t)length, (uintptr_t)params);
   3221 
   3222    if (context)
   3223    {
   3224        ShaderProgramID programPacked  = PackParam<ShaderProgramID>(program);
   3225        UniformLocation locationPacked = PackParam<UniformLocation>(location);
   3226        SCOPED_SHARE_CONTEXT_LOCK(context);
   3227        bool isCallValid = (context->skipValidation() ||
   3228                            ValidateGetnUniformfvRobustANGLE(
   3229                                context, angle::EntryPoint::GLGetnUniformfvRobustANGLE,
   3230                                programPacked, locationPacked, bufSize, length, params));
   3231        if (isCallValid)
   3232        {
   3233            context->getnUniformfvRobust(programPacked, locationPacked, bufSize, length, params);
   3234        }
   3235        ANGLE_CAPTURE_GL(GetnUniformfvRobustANGLE, isCallValid, context, programPacked,
   3236                         locationPacked, bufSize, length, params);
   3237    }
   3238    else
   3239    {
   3240        GenerateContextLostErrorOnCurrentGlobalContext();
   3241    }
   3242 }
   3243 
   3244 void GL_APIENTRY GL_GetnUniformivRobustANGLE(GLuint program,
   3245                                             GLint location,
   3246                                             GLsizei bufSize,
   3247                                             GLsizei *length,
   3248                                             GLint *params)
   3249 {
   3250    Context *context = GetValidGlobalContext();
   3251    EVENT(context, GLGetnUniformivRobustANGLE,
   3252          "context = %d, program = %u, location = %d, bufSize = %d, length = 0x%016" PRIxPTR
   3253          ", params = 0x%016" PRIxPTR "",
   3254          CID(context), program, location, bufSize, (uintptr_t)length, (uintptr_t)params);
   3255 
   3256    if (context)
   3257    {
   3258        ShaderProgramID programPacked  = PackParam<ShaderProgramID>(program);
   3259        UniformLocation locationPacked = PackParam<UniformLocation>(location);
   3260        SCOPED_SHARE_CONTEXT_LOCK(context);
   3261        bool isCallValid = (context->skipValidation() ||
   3262                            ValidateGetnUniformivRobustANGLE(
   3263                                context, angle::EntryPoint::GLGetnUniformivRobustANGLE,
   3264                                programPacked, locationPacked, bufSize, length, params));
   3265        if (isCallValid)
   3266        {
   3267            context->getnUniformivRobust(programPacked, locationPacked, bufSize, length, params);
   3268        }
   3269        ANGLE_CAPTURE_GL(GetnUniformivRobustANGLE, isCallValid, context, programPacked,
   3270                         locationPacked, bufSize, length, params);
   3271    }
   3272    else
   3273    {
   3274        GenerateContextLostErrorOnCurrentGlobalContext();
   3275    }
   3276 }
   3277 
   3278 void GL_APIENTRY GL_GetnUniformuivRobustANGLE(GLuint program,
   3279                                              GLint location,
   3280                                              GLsizei bufSize,
   3281                                              GLsizei *length,
   3282                                              GLuint *params)
   3283 {
   3284    Context *context = GetValidGlobalContext();
   3285    EVENT(context, GLGetnUniformuivRobustANGLE,
   3286          "context = %d, program = %u, location = %d, bufSize = %d, length = 0x%016" PRIxPTR
   3287          ", params = 0x%016" PRIxPTR "",
   3288          CID(context), program, location, bufSize, (uintptr_t)length, (uintptr_t)params);
   3289 
   3290    if (context)
   3291    {
   3292        ShaderProgramID programPacked  = PackParam<ShaderProgramID>(program);
   3293        UniformLocation locationPacked = PackParam<UniformLocation>(location);
   3294        SCOPED_SHARE_CONTEXT_LOCK(context);
   3295        bool isCallValid = (context->skipValidation() ||
   3296                            ValidateGetnUniformuivRobustANGLE(
   3297                                context, angle::EntryPoint::GLGetnUniformuivRobustANGLE,
   3298                                programPacked, locationPacked, bufSize, length, params));
   3299        if (isCallValid)
   3300        {
   3301            context->getnUniformuivRobust(programPacked, locationPacked, bufSize, length, params);
   3302        }
   3303        ANGLE_CAPTURE_GL(GetnUniformuivRobustANGLE, isCallValid, context, programPacked,
   3304                         locationPacked, bufSize, length, params);
   3305    }
   3306    else
   3307    {
   3308        GenerateContextLostErrorOnCurrentGlobalContext();
   3309    }
   3310 }
   3311 
   3312 void GL_APIENTRY GL_TexParameterIivRobustANGLE(GLenum target,
   3313                                               GLenum pname,
   3314                                               GLsizei bufSize,
   3315                                               const GLint *params)
   3316 {
   3317    Context *context = GetValidGlobalContext();
   3318    EVENT(context, GLTexParameterIivRobustANGLE,
   3319          "context = %d, target = %s, pname = %s, bufSize = %d, params = 0x%016" PRIxPTR "",
   3320          CID(context), GLenumToString(GLESEnum::AllEnums, target),
   3321          GLenumToString(GLESEnum::AllEnums, pname), bufSize, (uintptr_t)params);
   3322 
   3323    if (context)
   3324    {
   3325        TextureType targetPacked = PackParam<TextureType>(target);
   3326        SCOPED_SHARE_CONTEXT_LOCK(context);
   3327        bool isCallValid = (context->skipValidation() ||
   3328                            ValidateTexParameterIivRobustANGLE(
   3329                                context, angle::EntryPoint::GLTexParameterIivRobustANGLE,
   3330                                targetPacked, pname, bufSize, params));
   3331        if (isCallValid)
   3332        {
   3333            context->texParameterIivRobust(targetPacked, pname, bufSize, params);
   3334        }
   3335        ANGLE_CAPTURE_GL(TexParameterIivRobustANGLE, isCallValid, context, targetPacked, pname,
   3336                         bufSize, params);
   3337    }
   3338    else
   3339    {
   3340        GenerateContextLostErrorOnCurrentGlobalContext();
   3341    }
   3342 }
   3343 
   3344 void GL_APIENTRY GL_TexParameterIuivRobustANGLE(GLenum target,
   3345                                                GLenum pname,
   3346                                                GLsizei bufSize,
   3347                                                const GLuint *params)
   3348 {
   3349    Context *context = GetValidGlobalContext();
   3350    EVENT(context, GLTexParameterIuivRobustANGLE,
   3351          "context = %d, target = %s, pname = %s, bufSize = %d, params = 0x%016" PRIxPTR "",
   3352          CID(context), GLenumToString(GLESEnum::AllEnums, target),
   3353          GLenumToString(GLESEnum::AllEnums, pname), bufSize, (uintptr_t)params);
   3354 
   3355    if (context)
   3356    {
   3357        TextureType targetPacked = PackParam<TextureType>(target);
   3358        SCOPED_SHARE_CONTEXT_LOCK(context);
   3359        bool isCallValid = (context->skipValidation() ||
   3360                            ValidateTexParameterIuivRobustANGLE(
   3361                                context, angle::EntryPoint::GLTexParameterIuivRobustANGLE,
   3362                                targetPacked, pname, bufSize, params));
   3363        if (isCallValid)
   3364        {
   3365            context->texParameterIuivRobust(targetPacked, pname, bufSize, params);
   3366        }
   3367        ANGLE_CAPTURE_GL(TexParameterIuivRobustANGLE, isCallValid, context, targetPacked, pname,
   3368                         bufSize, params);
   3369    }
   3370    else
   3371    {
   3372        GenerateContextLostErrorOnCurrentGlobalContext();
   3373    }
   3374 }
   3375 
   3376 void GL_APIENTRY GL_GetTexParameterIivRobustANGLE(GLenum target,
   3377                                                  GLenum pname,
   3378                                                  GLsizei bufSize,
   3379                                                  GLsizei *length,
   3380                                                  GLint *params)
   3381 {
   3382    Context *context = GetValidGlobalContext();
   3383    EVENT(context, GLGetTexParameterIivRobustANGLE,
   3384          "context = %d, target = %s, pname = %s, bufSize = %d, length = 0x%016" PRIxPTR
   3385          ", params = 0x%016" PRIxPTR "",
   3386          CID(context), GLenumToString(GLESEnum::AllEnums, target),
   3387          GLenumToString(GLESEnum::AllEnums, pname), bufSize, (uintptr_t)length, (uintptr_t)params);
   3388 
   3389    if (context)
   3390    {
   3391        TextureType targetPacked = PackParam<TextureType>(target);
   3392        SCOPED_SHARE_CONTEXT_LOCK(context);
   3393        bool isCallValid = (context->skipValidation() ||
   3394                            ValidateGetTexParameterIivRobustANGLE(
   3395                                context, angle::EntryPoint::GLGetTexParameterIivRobustANGLE,
   3396                                targetPacked, pname, bufSize, length, params));
   3397        if (isCallValid)
   3398        {
   3399            context->getTexParameterIivRobust(targetPacked, pname, bufSize, length, params);
   3400        }
   3401        ANGLE_CAPTURE_GL(GetTexParameterIivRobustANGLE, isCallValid, context, targetPacked, pname,
   3402                         bufSize, length, params);
   3403    }
   3404    else
   3405    {
   3406        GenerateContextLostErrorOnCurrentGlobalContext();
   3407    }
   3408 }
   3409 
   3410 void GL_APIENTRY GL_GetTexParameterIuivRobustANGLE(GLenum target,
   3411                                                   GLenum pname,
   3412                                                   GLsizei bufSize,
   3413                                                   GLsizei *length,
   3414                                                   GLuint *params)
   3415 {
   3416    Context *context = GetValidGlobalContext();
   3417    EVENT(context, GLGetTexParameterIuivRobustANGLE,
   3418          "context = %d, target = %s, pname = %s, bufSize = %d, length = 0x%016" PRIxPTR
   3419          ", params = 0x%016" PRIxPTR "",
   3420          CID(context), GLenumToString(GLESEnum::AllEnums, target),
   3421          GLenumToString(GLESEnum::AllEnums, pname), bufSize, (uintptr_t)length, (uintptr_t)params);
   3422 
   3423    if (context)
   3424    {
   3425        TextureType targetPacked = PackParam<TextureType>(target);
   3426        SCOPED_SHARE_CONTEXT_LOCK(context);
   3427        bool isCallValid = (context->skipValidation() ||
   3428                            ValidateGetTexParameterIuivRobustANGLE(
   3429                                context, angle::EntryPoint::GLGetTexParameterIuivRobustANGLE,
   3430                                targetPacked, pname, bufSize, length, params));
   3431        if (isCallValid)
   3432        {
   3433            context->getTexParameterIuivRobust(targetPacked, pname, bufSize, length, params);
   3434        }
   3435        ANGLE_CAPTURE_GL(GetTexParameterIuivRobustANGLE, isCallValid, context, targetPacked, pname,
   3436                         bufSize, length, params);
   3437    }
   3438    else
   3439    {
   3440        GenerateContextLostErrorOnCurrentGlobalContext();
   3441    }
   3442 }
   3443 
   3444 void GL_APIENTRY GL_SamplerParameterIivRobustANGLE(GLuint sampler,
   3445                                                   GLenum pname,
   3446                                                   GLsizei bufSize,
   3447                                                   const GLint *param)
   3448 {
   3449    Context *context = GetValidGlobalContext();
   3450    EVENT(context, GLSamplerParameterIivRobustANGLE,
   3451          "context = %d, sampler = %u, pname = %s, bufSize = %d, param = 0x%016" PRIxPTR "",
   3452          CID(context), sampler, GLenumToString(GLESEnum::AllEnums, pname), bufSize,
   3453          (uintptr_t)param);
   3454 
   3455    if (context)
   3456    {
   3457        SamplerID samplerPacked = PackParam<SamplerID>(sampler);
   3458        SCOPED_SHARE_CONTEXT_LOCK(context);
   3459        bool isCallValid = (context->skipValidation() ||
   3460                            ValidateSamplerParameterIivRobustANGLE(
   3461                                context, angle::EntryPoint::GLSamplerParameterIivRobustANGLE,
   3462                                samplerPacked, pname, bufSize, param));
   3463        if (isCallValid)
   3464        {
   3465            context->samplerParameterIivRobust(samplerPacked, pname, bufSize, param);
   3466        }
   3467        ANGLE_CAPTURE_GL(SamplerParameterIivRobustANGLE, isCallValid, context, samplerPacked, pname,
   3468                         bufSize, param);
   3469    }
   3470    else
   3471    {
   3472        GenerateContextLostErrorOnCurrentGlobalContext();
   3473    }
   3474 }
   3475 
   3476 void GL_APIENTRY GL_SamplerParameterIuivRobustANGLE(GLuint sampler,
   3477                                                    GLenum pname,
   3478                                                    GLsizei bufSize,
   3479                                                    const GLuint *param)
   3480 {
   3481    Context *context = GetValidGlobalContext();
   3482    EVENT(context, GLSamplerParameterIuivRobustANGLE,
   3483          "context = %d, sampler = %u, pname = %s, bufSize = %d, param = 0x%016" PRIxPTR "",
   3484          CID(context), sampler, GLenumToString(GLESEnum::AllEnums, pname), bufSize,
   3485          (uintptr_t)param);
   3486 
   3487    if (context)
   3488    {
   3489        SamplerID samplerPacked = PackParam<SamplerID>(sampler);
   3490        SCOPED_SHARE_CONTEXT_LOCK(context);
   3491        bool isCallValid = (context->skipValidation() ||
   3492                            ValidateSamplerParameterIuivRobustANGLE(
   3493                                context, angle::EntryPoint::GLSamplerParameterIuivRobustANGLE,
   3494                                samplerPacked, pname, bufSize, param));
   3495        if (isCallValid)
   3496        {
   3497            context->samplerParameterIuivRobust(samplerPacked, pname, bufSize, param);
   3498        }
   3499        ANGLE_CAPTURE_GL(SamplerParameterIuivRobustANGLE, isCallValid, context, samplerPacked,
   3500                         pname, bufSize, param);
   3501    }
   3502    else
   3503    {
   3504        GenerateContextLostErrorOnCurrentGlobalContext();
   3505    }
   3506 }
   3507 
   3508 void GL_APIENTRY GL_GetSamplerParameterIivRobustANGLE(GLuint sampler,
   3509                                                      GLenum pname,
   3510                                                      GLsizei bufSize,
   3511                                                      GLsizei *length,
   3512                                                      GLint *params)
   3513 {
   3514    Context *context = GetValidGlobalContext();
   3515    EVENT(context, GLGetSamplerParameterIivRobustANGLE,
   3516          "context = %d, sampler = %u, pname = %s, bufSize = %d, length = 0x%016" PRIxPTR
   3517          ", params = 0x%016" PRIxPTR "",
   3518          CID(context), sampler, GLenumToString(GLESEnum::AllEnums, pname), bufSize,
   3519          (uintptr_t)length, (uintptr_t)params);
   3520 
   3521    if (context)
   3522    {
   3523        SamplerID samplerPacked = PackParam<SamplerID>(sampler);
   3524        SCOPED_SHARE_CONTEXT_LOCK(context);
   3525        bool isCallValid = (context->skipValidation() ||
   3526                            ValidateGetSamplerParameterIivRobustANGLE(
   3527                                context, angle::EntryPoint::GLGetSamplerParameterIivRobustANGLE,
   3528                                samplerPacked, pname, bufSize, length, params));
   3529        if (isCallValid)
   3530        {
   3531            context->getSamplerParameterIivRobust(samplerPacked, pname, bufSize, length, params);
   3532        }
   3533        ANGLE_CAPTURE_GL(GetSamplerParameterIivRobustANGLE, isCallValid, context, samplerPacked,
   3534                         pname, bufSize, length, params);
   3535    }
   3536    else
   3537    {
   3538        GenerateContextLostErrorOnCurrentGlobalContext();
   3539    }
   3540 }
   3541 
   3542 void GL_APIENTRY GL_GetSamplerParameterIuivRobustANGLE(GLuint sampler,
   3543                                                       GLenum pname,
   3544                                                       GLsizei bufSize,
   3545                                                       GLsizei *length,
   3546                                                       GLuint *params)
   3547 {
   3548    Context *context = GetValidGlobalContext();
   3549    EVENT(context, GLGetSamplerParameterIuivRobustANGLE,
   3550          "context = %d, sampler = %u, pname = %s, bufSize = %d, length = 0x%016" PRIxPTR
   3551          ", params = 0x%016" PRIxPTR "",
   3552          CID(context), sampler, GLenumToString(GLESEnum::AllEnums, pname), bufSize,
   3553          (uintptr_t)length, (uintptr_t)params);
   3554 
   3555    if (context)
   3556    {
   3557        SamplerID samplerPacked = PackParam<SamplerID>(sampler);
   3558        SCOPED_SHARE_CONTEXT_LOCK(context);
   3559        bool isCallValid = (context->skipValidation() ||
   3560                            ValidateGetSamplerParameterIuivRobustANGLE(
   3561                                context, angle::EntryPoint::GLGetSamplerParameterIuivRobustANGLE,
   3562                                samplerPacked, pname, bufSize, length, params));
   3563        if (isCallValid)
   3564        {
   3565            context->getSamplerParameterIuivRobust(samplerPacked, pname, bufSize, length, params);
   3566        }
   3567        ANGLE_CAPTURE_GL(GetSamplerParameterIuivRobustANGLE, isCallValid, context, samplerPacked,
   3568                         pname, bufSize, length, params);
   3569    }
   3570    else
   3571    {
   3572        GenerateContextLostErrorOnCurrentGlobalContext();
   3573    }
   3574 }
   3575 
   3576 void GL_APIENTRY GL_GetQueryObjectivRobustANGLE(GLuint id,
   3577                                                GLenum pname,
   3578                                                GLsizei bufSize,
   3579                                                GLsizei *length,
   3580                                                GLint *params)
   3581 {
   3582    Context *context = GetGlobalContext();
   3583    EVENT(context, GLGetQueryObjectivRobustANGLE,
   3584          "context = %d, id = %u, pname = %s, bufSize = %d, length = 0x%016" PRIxPTR
   3585          ", params = 0x%016" PRIxPTR "",
   3586          CID(context), id, GLenumToString(GLESEnum::AllEnums, pname), bufSize, (uintptr_t)length,
   3587          (uintptr_t)params);
   3588 
   3589    if (context)
   3590    {
   3591        QueryID idPacked = PackParam<QueryID>(id);
   3592        SCOPED_SHARE_CONTEXT_LOCK(context);
   3593        bool isCallValid = (context->skipValidation() ||
   3594                            ValidateGetQueryObjectivRobustANGLE(
   3595                                context, angle::EntryPoint::GLGetQueryObjectivRobustANGLE, idPacked,
   3596                                pname, bufSize, length, params));
   3597        if (isCallValid)
   3598        {
   3599            context->getQueryObjectivRobust(idPacked, pname, bufSize, length, params);
   3600        }
   3601        ANGLE_CAPTURE_GL(GetQueryObjectivRobustANGLE, isCallValid, context, idPacked, pname,
   3602                         bufSize, length, params);
   3603    }
   3604    else
   3605    {}
   3606 }
   3607 
   3608 void GL_APIENTRY GL_GetQueryObjecti64vRobustANGLE(GLuint id,
   3609                                                  GLenum pname,
   3610                                                  GLsizei bufSize,
   3611                                                  GLsizei *length,
   3612                                                  GLint64 *params)
   3613 {
   3614    Context *context = GetGlobalContext();
   3615    EVENT(context, GLGetQueryObjecti64vRobustANGLE,
   3616          "context = %d, id = %u, pname = %s, bufSize = %d, length = 0x%016" PRIxPTR
   3617          ", params = 0x%016" PRIxPTR "",
   3618          CID(context), id, GLenumToString(GLESEnum::AllEnums, pname), bufSize, (uintptr_t)length,
   3619          (uintptr_t)params);
   3620 
   3621    if (context)
   3622    {
   3623        QueryID idPacked = PackParam<QueryID>(id);
   3624        SCOPED_SHARE_CONTEXT_LOCK(context);
   3625        bool isCallValid = (context->skipValidation() ||
   3626                            ValidateGetQueryObjecti64vRobustANGLE(
   3627                                context, angle::EntryPoint::GLGetQueryObjecti64vRobustANGLE,
   3628                                idPacked, pname, bufSize, length, params));
   3629        if (isCallValid)
   3630        {
   3631            context->getQueryObjecti64vRobust(idPacked, pname, bufSize, length, params);
   3632        }
   3633        ANGLE_CAPTURE_GL(GetQueryObjecti64vRobustANGLE, isCallValid, context, idPacked, pname,
   3634                         bufSize, length, params);
   3635    }
   3636    else
   3637    {}
   3638 }
   3639 
   3640 void GL_APIENTRY GL_GetQueryObjectui64vRobustANGLE(GLuint id,
   3641                                                   GLenum pname,
   3642                                                   GLsizei bufSize,
   3643                                                   GLsizei *length,
   3644                                                   GLuint64 *params)
   3645 {
   3646    Context *context = GetValidGlobalContext();
   3647    EVENT(context, GLGetQueryObjectui64vRobustANGLE,
   3648          "context = %d, id = %u, pname = %s, bufSize = %d, length = 0x%016" PRIxPTR
   3649          ", params = 0x%016" PRIxPTR "",
   3650          CID(context), id, GLenumToString(GLESEnum::AllEnums, pname), bufSize, (uintptr_t)length,
   3651          (uintptr_t)params);
   3652 
   3653    if (context)
   3654    {
   3655        QueryID idPacked = PackParam<QueryID>(id);
   3656        SCOPED_SHARE_CONTEXT_LOCK(context);
   3657        bool isCallValid = (context->skipValidation() ||
   3658                            ValidateGetQueryObjectui64vRobustANGLE(
   3659                                context, angle::EntryPoint::GLGetQueryObjectui64vRobustANGLE,
   3660                                idPacked, pname, bufSize, length, params));
   3661        if (isCallValid)
   3662        {
   3663            context->getQueryObjectui64vRobust(idPacked, pname, bufSize, length, params);
   3664        }
   3665        ANGLE_CAPTURE_GL(GetQueryObjectui64vRobustANGLE, isCallValid, context, idPacked, pname,
   3666                         bufSize, length, params);
   3667    }
   3668    else
   3669    {
   3670        GenerateContextLostErrorOnCurrentGlobalContext();
   3671    }
   3672 }
   3673 
   3674 // GL_ANGLE_robust_resource_initialization
   3675 
   3676 // GL_ANGLE_semaphore_fuchsia
   3677 void GL_APIENTRY GL_ImportSemaphoreZirconHandleANGLE(GLuint semaphore,
   3678                                                     GLenum handleType,
   3679                                                     GLuint handle)
   3680 {
   3681    Context *context = GetValidGlobalContext();
   3682    EVENT(context, GLImportSemaphoreZirconHandleANGLE,
   3683          "context = %d, semaphore = %u, handleType = %s, handle = %u", CID(context), semaphore,
   3684          GLenumToString(GLESEnum::ExternalHandleType, handleType), handle);
   3685 
   3686    if (context)
   3687    {
   3688        SemaphoreID semaphorePacked = PackParam<SemaphoreID>(semaphore);
   3689        HandleType handleTypePacked = PackParam<HandleType>(handleType);
   3690        SCOPED_SHARE_CONTEXT_LOCK(context);
   3691        bool isCallValid = (context->skipValidation() ||
   3692                            ValidateImportSemaphoreZirconHandleANGLE(
   3693                                context, angle::EntryPoint::GLImportSemaphoreZirconHandleANGLE,
   3694                                semaphorePacked, handleTypePacked, handle));
   3695        if (isCallValid)
   3696        {
   3697            context->importSemaphoreZirconHandle(semaphorePacked, handleTypePacked, handle);
   3698        }
   3699        ANGLE_CAPTURE_GL(ImportSemaphoreZirconHandleANGLE, isCallValid, context, semaphorePacked,
   3700                         handleTypePacked, handle);
   3701    }
   3702    else
   3703    {
   3704        GenerateContextLostErrorOnCurrentGlobalContext();
   3705    }
   3706 }
   3707 
   3708 // GL_ANGLE_shader_pixel_local_storage
   3709 void GL_APIENTRY GL_FramebufferMemorylessPixelLocalStorageANGLE(GLint plane, GLenum internalformat)
   3710 {
   3711    Context *context = GetValidGlobalContext();
   3712    EVENT(context, GLFramebufferMemorylessPixelLocalStorageANGLE,
   3713          "context = %d, plane = %d, internalformat = %s", CID(context), plane,
   3714          GLenumToString(GLESEnum::AllEnums, internalformat));
   3715 
   3716    if (context)
   3717    {
   3718        SCOPED_SHARE_CONTEXT_LOCK(context);
   3719        bool isCallValid =
   3720            (context->skipValidation() ||
   3721             ValidateFramebufferMemorylessPixelLocalStorageANGLE(
   3722                 context, angle::EntryPoint::GLFramebufferMemorylessPixelLocalStorageANGLE, plane,
   3723                 internalformat));
   3724        if (isCallValid)
   3725        {
   3726            context->framebufferMemorylessPixelLocalStorage(plane, internalformat);
   3727        }
   3728        ANGLE_CAPTURE_GL(FramebufferMemorylessPixelLocalStorageANGLE, isCallValid, context, plane,
   3729                         internalformat);
   3730    }
   3731    else
   3732    {
   3733        GenerateContextLostErrorOnCurrentGlobalContext();
   3734    }
   3735 }
   3736 
   3737 void GL_APIENTRY GL_FramebufferTexturePixelLocalStorageANGLE(GLint plane,
   3738                                                             GLuint backingtexture,
   3739                                                             GLint level,
   3740                                                             GLint layer)
   3741 {
   3742    Context *context = GetValidGlobalContext();
   3743    EVENT(context, GLFramebufferTexturePixelLocalStorageANGLE,
   3744          "context = %d, plane = %d, backingtexture = %u, level = %d, layer = %d", CID(context),
   3745          plane, backingtexture, level, layer);
   3746 
   3747    if (context)
   3748    {
   3749        TextureID backingtexturePacked = PackParam<TextureID>(backingtexture);
   3750        SCOPED_SHARE_CONTEXT_LOCK(context);
   3751        bool isCallValid =
   3752            (context->skipValidation() ||
   3753             ValidateFramebufferTexturePixelLocalStorageANGLE(
   3754                 context, angle::EntryPoint::GLFramebufferTexturePixelLocalStorageANGLE, plane,
   3755                 backingtexturePacked, level, layer));
   3756        if (isCallValid)
   3757        {
   3758            context->framebufferTexturePixelLocalStorage(plane, backingtexturePacked, level, layer);
   3759        }
   3760        ANGLE_CAPTURE_GL(FramebufferTexturePixelLocalStorageANGLE, isCallValid, context, plane,
   3761                         backingtexturePacked, level, layer);
   3762    }
   3763    else
   3764    {
   3765        GenerateContextLostErrorOnCurrentGlobalContext();
   3766    }
   3767 }
   3768 
   3769 void GL_APIENTRY GL_BeginPixelLocalStorageANGLE(GLsizei planes,
   3770                                                const GLenum *loadops,
   3771                                                const void *cleardata)
   3772 {
   3773    Context *context = GetValidGlobalContext();
   3774    EVENT(context, GLBeginPixelLocalStorageANGLE,
   3775          "context = %d, planes = %d, loadops = 0x%016" PRIxPTR ", cleardata = 0x%016" PRIxPTR "",
   3776          CID(context), planes, (uintptr_t)loadops, (uintptr_t)cleardata);
   3777 
   3778    if (context)
   3779    {
   3780        SCOPED_SHARE_CONTEXT_LOCK(context);
   3781        bool isCallValid = (context->skipValidation() ||
   3782                            ValidateBeginPixelLocalStorageANGLE(
   3783                                context, angle::EntryPoint::GLBeginPixelLocalStorageANGLE, planes,
   3784                                loadops, cleardata));
   3785        if (isCallValid)
   3786        {
   3787            context->beginPixelLocalStorage(planes, loadops, cleardata);
   3788        }
   3789        ANGLE_CAPTURE_GL(BeginPixelLocalStorageANGLE, isCallValid, context, planes, loadops,
   3790                         cleardata);
   3791    }
   3792    else
   3793    {
   3794        GenerateContextLostErrorOnCurrentGlobalContext();
   3795    }
   3796 }
   3797 
   3798 void GL_APIENTRY GL_EndPixelLocalStorageANGLE()
   3799 {
   3800    Context *context = GetValidGlobalContext();
   3801    EVENT(context, GLEndPixelLocalStorageANGLE, "context = %d", CID(context));
   3802 
   3803    if (context)
   3804    {
   3805        SCOPED_SHARE_CONTEXT_LOCK(context);
   3806        bool isCallValid = (context->skipValidation() ||
   3807                            ValidateEndPixelLocalStorageANGLE(
   3808                                context, angle::EntryPoint::GLEndPixelLocalStorageANGLE));
   3809        if (isCallValid)
   3810        {
   3811            context->endPixelLocalStorage();
   3812        }
   3813        ANGLE_CAPTURE_GL(EndPixelLocalStorageANGLE, isCallValid, context);
   3814    }
   3815    else
   3816    {
   3817        GenerateContextLostErrorOnCurrentGlobalContext();
   3818    }
   3819 }
   3820 
   3821 void GL_APIENTRY GL_PixelLocalStorageBarrierANGLE()
   3822 {
   3823    Context *context = GetValidGlobalContext();
   3824    EVENT(context, GLPixelLocalStorageBarrierANGLE, "context = %d", CID(context));
   3825 
   3826    if (context)
   3827    {
   3828        SCOPED_SHARE_CONTEXT_LOCK(context);
   3829        bool isCallValid = (context->skipValidation() ||
   3830                            ValidatePixelLocalStorageBarrierANGLE(
   3831                                context, angle::EntryPoint::GLPixelLocalStorageBarrierANGLE));
   3832        if (isCallValid)
   3833        {
   3834            context->pixelLocalStorageBarrier();
   3835        }
   3836        ANGLE_CAPTURE_GL(PixelLocalStorageBarrierANGLE, isCallValid, context);
   3837    }
   3838    else
   3839    {
   3840        GenerateContextLostErrorOnCurrentGlobalContext();
   3841    }
   3842 }
   3843 
   3844 // GL_ANGLE_texture_compression_dxt3
   3845 
   3846 // GL_ANGLE_texture_compression_dxt5
   3847 
   3848 // GL_ANGLE_texture_external_update
   3849 void GL_APIENTRY GL_TexImage2DExternalANGLE(GLenum target,
   3850                                            GLint level,
   3851                                            GLint internalformat,
   3852                                            GLsizei width,
   3853                                            GLsizei height,
   3854                                            GLint border,
   3855                                            GLenum format,
   3856                                            GLenum type)
   3857 {
   3858    Context *context = GetValidGlobalContext();
   3859    EVENT(context, GLTexImage2DExternalANGLE,
   3860          "context = %d, target = %s, level = %d, internalformat = %d, width = %d, height = %d, "
   3861          "border = %d, format = %s, type = %s",
   3862          CID(context), GLenumToString(GLESEnum::TextureTarget, target), level, internalformat,
   3863          width, height, border, GLenumToString(GLESEnum::PixelFormat, format),
   3864          GLenumToString(GLESEnum::PixelType, type));
   3865 
   3866    if (context)
   3867    {
   3868        TextureTarget targetPacked = PackParam<TextureTarget>(target);
   3869        SCOPED_SHARE_CONTEXT_LOCK(context);
   3870        bool isCallValid = (context->skipValidation() ||
   3871                            ValidateTexImage2DExternalANGLE(
   3872                                context, angle::EntryPoint::GLTexImage2DExternalANGLE, targetPacked,
   3873                                level, internalformat, width, height, border, format, type));
   3874        if (isCallValid)
   3875        {
   3876            context->texImage2DExternal(targetPacked, level, internalformat, width, height, border,
   3877                                        format, type);
   3878        }
   3879        ANGLE_CAPTURE_GL(TexImage2DExternalANGLE, isCallValid, context, targetPacked, level,
   3880                         internalformat, width, height, border, format, type);
   3881    }
   3882    else
   3883    {
   3884        GenerateContextLostErrorOnCurrentGlobalContext();
   3885    }
   3886 }
   3887 
   3888 void GL_APIENTRY GL_InvalidateTextureANGLE(GLenum target)
   3889 {
   3890    Context *context = GetValidGlobalContext();
   3891    EVENT(context, GLInvalidateTextureANGLE, "context = %d, target = %s", CID(context),
   3892          GLenumToString(GLESEnum::TextureTarget, target));
   3893 
   3894    if (context)
   3895    {
   3896        TextureType targetPacked = PackParam<TextureType>(target);
   3897        SCOPED_SHARE_CONTEXT_LOCK(context);
   3898        bool isCallValid =
   3899            (context->skipValidation() ||
   3900             ValidateInvalidateTextureANGLE(context, angle::EntryPoint::GLInvalidateTextureANGLE,
   3901                                            targetPacked));
   3902        if (isCallValid)
   3903        {
   3904            context->invalidateTexture(targetPacked);
   3905        }
   3906        ANGLE_CAPTURE_GL(InvalidateTextureANGLE, isCallValid, context, targetPacked);
   3907    }
   3908    else
   3909    {
   3910        GenerateContextLostErrorOnCurrentGlobalContext();
   3911    }
   3912 }
   3913 
   3914 // GL_ANGLE_texture_multisample
   3915 void GL_APIENTRY GL_TexStorage2DMultisampleANGLE(GLenum target,
   3916                                                 GLsizei samples,
   3917                                                 GLenum internalformat,
   3918                                                 GLsizei width,
   3919                                                 GLsizei height,
   3920                                                 GLboolean fixedsamplelocations)
   3921 {
   3922    Context *context = GetValidGlobalContext();
   3923    EVENT(context, GLTexStorage2DMultisampleANGLE,
   3924          "context = %d, target = %s, samples = %d, internalformat = %s, width = %d, height = %d, "
   3925          "fixedsamplelocations = %s",
   3926          CID(context), GLenumToString(GLESEnum::AllEnums, target), samples,
   3927          GLenumToString(GLESEnum::AllEnums, internalformat), width, height,
   3928          GLbooleanToString(fixedsamplelocations));
   3929 
   3930    if (context)
   3931    {
   3932        TextureType targetPacked = PackParam<TextureType>(target);
   3933        SCOPED_SHARE_CONTEXT_LOCK(context);
   3934        bool isCallValid =
   3935            (context->skipValidation() ||
   3936             ValidateTexStorage2DMultisampleANGLE(
   3937                 context, angle::EntryPoint::GLTexStorage2DMultisampleANGLE, targetPacked, samples,
   3938                 internalformat, width, height, fixedsamplelocations));
   3939        if (isCallValid)
   3940        {
   3941            context->texStorage2DMultisample(targetPacked, samples, internalformat, width, height,
   3942                                             fixedsamplelocations);
   3943        }
   3944        ANGLE_CAPTURE_GL(TexStorage2DMultisampleANGLE, isCallValid, context, targetPacked, samples,
   3945                         internalformat, width, height, fixedsamplelocations);
   3946    }
   3947    else
   3948    {
   3949        GenerateContextLostErrorOnCurrentGlobalContext();
   3950    }
   3951 }
   3952 
   3953 void GL_APIENTRY GL_GetMultisamplefvANGLE(GLenum pname, GLuint index, GLfloat *val)
   3954 {
   3955    Context *context = GetValidGlobalContext();
   3956    EVENT(context, GLGetMultisamplefvANGLE,
   3957          "context = %d, pname = %s, index = %u, val = 0x%016" PRIxPTR "", CID(context),
   3958          GLenumToString(GLESEnum::AllEnums, pname), index, (uintptr_t)val);
   3959 
   3960    if (context)
   3961    {
   3962        SCOPED_SHARE_CONTEXT_LOCK(context);
   3963        bool isCallValid =
   3964            (context->skipValidation() ||
   3965             ValidateGetMultisamplefvANGLE(context, angle::EntryPoint::GLGetMultisamplefvANGLE,
   3966                                           pname, index, val));
   3967        if (isCallValid)
   3968        {
   3969            context->getMultisamplefv(pname, index, val);
   3970        }
   3971        ANGLE_CAPTURE_GL(GetMultisamplefvANGLE, isCallValid, context, pname, index, val);
   3972    }
   3973    else
   3974    {
   3975        GenerateContextLostErrorOnCurrentGlobalContext();
   3976    }
   3977 }
   3978 
   3979 void GL_APIENTRY GL_SampleMaskiANGLE(GLuint maskNumber, GLbitfield mask)
   3980 {
   3981    Context *context = GetValidGlobalContext();
   3982    EVENT(context, GLSampleMaskiANGLE, "context = %d, maskNumber = %u, mask = %s", CID(context),
   3983          maskNumber, GLbitfieldToString(GLESEnum::AllEnums, mask).c_str());
   3984 
   3985    if (context)
   3986    {
   3987        SCOPED_SHARE_CONTEXT_LOCK(context);
   3988        bool isCallValid = (context->skipValidation() ||
   3989                            ValidateSampleMaskiANGLE(context, angle::EntryPoint::GLSampleMaskiANGLE,
   3990                                                     maskNumber, mask));
   3991        if (isCallValid)
   3992        {
   3993            context->sampleMaski(maskNumber, mask);
   3994        }
   3995        ANGLE_CAPTURE_GL(SampleMaskiANGLE, isCallValid, context, maskNumber, mask);
   3996    }
   3997    else
   3998    {
   3999        GenerateContextLostErrorOnCurrentGlobalContext();
   4000    }
   4001 }
   4002 
   4003 // GetTexLevelParameterfvANGLE is already defined.
   4004 
   4005 // GetTexLevelParameterivANGLE is already defined.
   4006 
   4007 // GL_ANGLE_texture_usage
   4008 
   4009 // GL_ANGLE_translated_shader_source
   4010 void GL_APIENTRY GL_GetTranslatedShaderSourceANGLE(GLuint shader,
   4011                                                   GLsizei bufSize,
   4012                                                   GLsizei *length,
   4013                                                   GLchar *source)
   4014 {
   4015    Context *context = GetValidGlobalContext();
   4016    EVENT(context, GLGetTranslatedShaderSourceANGLE,
   4017          "context = %d, shader = %u, bufSize = %d, length = 0x%016" PRIxPTR
   4018          ", source = 0x%016" PRIxPTR "",
   4019          CID(context), shader, bufSize, (uintptr_t)length, (uintptr_t)source);
   4020 
   4021    if (context)
   4022    {
   4023        ShaderProgramID shaderPacked = PackParam<ShaderProgramID>(shader);
   4024        SCOPED_SHARE_CONTEXT_LOCK(context);
   4025        bool isCallValid = (context->skipValidation() ||
   4026                            ValidateGetTranslatedShaderSourceANGLE(
   4027                                context, angle::EntryPoint::GLGetTranslatedShaderSourceANGLE,
   4028                                shaderPacked, bufSize, length, source));
   4029        if (isCallValid)
   4030        {
   4031            context->getTranslatedShaderSource(shaderPacked, bufSize, length, source);
   4032        }
   4033        ANGLE_CAPTURE_GL(GetTranslatedShaderSourceANGLE, isCallValid, context, shaderPacked,
   4034                         bufSize, length, source);
   4035    }
   4036    else
   4037    {
   4038        GenerateContextLostErrorOnCurrentGlobalContext();
   4039    }
   4040 }
   4041 
   4042 // GL_ANGLE_vulkan_image
   4043 void GL_APIENTRY GL_AcquireTexturesANGLE(GLuint numTextures,
   4044                                         const GLuint *textures,
   4045                                         const GLenum *layouts)
   4046 {
   4047    Context *context = GetValidGlobalContext();
   4048    EVENT(context, GLAcquireTexturesANGLE,
   4049          "context = %d, numTextures = %u, textures = 0x%016" PRIxPTR ", layouts = 0x%016" PRIxPTR
   4050          "",
   4051          CID(context), numTextures, (uintptr_t)textures, (uintptr_t)layouts);
   4052 
   4053    if (context)
   4054    {
   4055        const TextureID *texturesPacked = PackParam<const TextureID *>(textures);
   4056        SCOPED_SHARE_CONTEXT_LOCK(context);
   4057        bool isCallValid =
   4058            (context->skipValidation() ||
   4059             ValidateAcquireTexturesANGLE(context, angle::EntryPoint::GLAcquireTexturesANGLE,
   4060                                          numTextures, texturesPacked, layouts));
   4061        if (isCallValid)
   4062        {
   4063            context->acquireTextures(numTextures, texturesPacked, layouts);
   4064        }
   4065        ANGLE_CAPTURE_GL(AcquireTexturesANGLE, isCallValid, context, numTextures, texturesPacked,
   4066                         layouts);
   4067    }
   4068    else
   4069    {
   4070        GenerateContextLostErrorOnCurrentGlobalContext();
   4071    }
   4072 }
   4073 
   4074 void GL_APIENTRY GL_ReleaseTexturesANGLE(GLuint numTextures,
   4075                                         const GLuint *textures,
   4076                                         GLenum *layouts)
   4077 {
   4078    Context *context = GetValidGlobalContext();
   4079    EVENT(context, GLReleaseTexturesANGLE,
   4080          "context = %d, numTextures = %u, textures = 0x%016" PRIxPTR ", layouts = 0x%016" PRIxPTR
   4081          "",
   4082          CID(context), numTextures, (uintptr_t)textures, (uintptr_t)layouts);
   4083 
   4084    if (context)
   4085    {
   4086        const TextureID *texturesPacked = PackParam<const TextureID *>(textures);
   4087        SCOPED_SHARE_CONTEXT_LOCK(context);
   4088        bool isCallValid =
   4089            (context->skipValidation() ||
   4090             ValidateReleaseTexturesANGLE(context, angle::EntryPoint::GLReleaseTexturesANGLE,
   4091                                          numTextures, texturesPacked, layouts));
   4092        if (isCallValid)
   4093        {
   4094            context->releaseTextures(numTextures, texturesPacked, layouts);
   4095        }
   4096        ANGLE_CAPTURE_GL(ReleaseTexturesANGLE, isCallValid, context, numTextures, texturesPacked,
   4097                         layouts);
   4098    }
   4099    else
   4100    {
   4101        GenerateContextLostErrorOnCurrentGlobalContext();
   4102    }
   4103 }
   4104 
   4105 // GL_APPLE_clip_distance
   4106 
   4107 // GL_ARB_sync
   4108 // ClientWaitSync is already defined.
   4109 
   4110 // DeleteSync is already defined.
   4111 
   4112 // FenceSync is already defined.
   4113 
   4114 // GetInteger64v is already defined.
   4115 
   4116 // GetSynciv is already defined.
   4117 
   4118 // IsSync is already defined.
   4119 
   4120 // WaitSync is already defined.
   4121 
   4122 // GL_CHROMIUM_bind_uniform_location
   4123 void GL_APIENTRY GL_BindUniformLocationCHROMIUM(GLuint program, GLint location, const GLchar *name)
   4124 {
   4125    Context *context = GetValidGlobalContext();
   4126    EVENT(context, GLBindUniformLocationCHROMIUM,
   4127          "context = %d, program = %u, location = %d, name = 0x%016" PRIxPTR "", CID(context),
   4128          program, location, (uintptr_t)name);
   4129 
   4130    if (context)
   4131    {
   4132        ShaderProgramID programPacked  = PackParam<ShaderProgramID>(program);
   4133        UniformLocation locationPacked = PackParam<UniformLocation>(location);
   4134        SCOPED_SHARE_CONTEXT_LOCK(context);
   4135        bool isCallValid = (context->skipValidation() ||
   4136                            ValidateBindUniformLocationCHROMIUM(
   4137                                context, angle::EntryPoint::GLBindUniformLocationCHROMIUM,
   4138                                programPacked, locationPacked, name));
   4139        if (isCallValid)
   4140        {
   4141            context->bindUniformLocation(programPacked, locationPacked, name);
   4142        }
   4143        ANGLE_CAPTURE_GL(BindUniformLocationCHROMIUM, isCallValid, context, programPacked,
   4144                         locationPacked, name);
   4145    }
   4146    else
   4147    {
   4148        GenerateContextLostErrorOnCurrentGlobalContext();
   4149    }
   4150 }
   4151 
   4152 // GL_CHROMIUM_copy_compressed_texture
   4153 void GL_APIENTRY GL_CompressedCopyTextureCHROMIUM(GLuint sourceId, GLuint destId)
   4154 {
   4155    Context *context = GetValidGlobalContext();
   4156    EVENT(context, GLCompressedCopyTextureCHROMIUM, "context = %d, sourceId = %u, destId = %u",
   4157          CID(context), sourceId, destId);
   4158 
   4159    if (context)
   4160    {
   4161        TextureID sourceIdPacked = PackParam<TextureID>(sourceId);
   4162        TextureID destIdPacked   = PackParam<TextureID>(destId);
   4163        SCOPED_SHARE_CONTEXT_LOCK(context);
   4164        bool isCallValid = (context->skipValidation() ||
   4165                            ValidateCompressedCopyTextureCHROMIUM(
   4166                                context, angle::EntryPoint::GLCompressedCopyTextureCHROMIUM,
   4167                                sourceIdPacked, destIdPacked));
   4168        if (isCallValid)
   4169        {
   4170            context->compressedCopyTexture(sourceIdPacked, destIdPacked);
   4171        }
   4172        ANGLE_CAPTURE_GL(CompressedCopyTextureCHROMIUM, isCallValid, context, sourceIdPacked,
   4173                         destIdPacked);
   4174    }
   4175    else
   4176    {
   4177        GenerateContextLostErrorOnCurrentGlobalContext();
   4178    }
   4179 }
   4180 
   4181 // GL_CHROMIUM_copy_texture
   4182 void GL_APIENTRY GL_CopyTextureCHROMIUM(GLuint sourceId,
   4183                                        GLint sourceLevel,
   4184                                        GLenum destTarget,
   4185                                        GLuint destId,
   4186                                        GLint destLevel,
   4187                                        GLint internalFormat,
   4188                                        GLenum destType,
   4189                                        GLboolean unpackFlipY,
   4190                                        GLboolean unpackPremultiplyAlpha,
   4191                                        GLboolean unpackUnmultiplyAlpha)
   4192 {
   4193    Context *context = GetValidGlobalContext();
   4194    EVENT(context, GLCopyTextureCHROMIUM,
   4195          "context = %d, sourceId = %u, sourceLevel = %d, destTarget = %s, destId = %u, destLevel "
   4196          "= %d, internalFormat = %d, destType = %s, unpackFlipY = %s, unpackPremultiplyAlpha = "
   4197          "%s, unpackUnmultiplyAlpha = %s",
   4198          CID(context), sourceId, sourceLevel, GLenumToString(GLESEnum::AllEnums, destTarget),
   4199          destId, destLevel, internalFormat, GLenumToString(GLESEnum::AllEnums, destType),
   4200          GLbooleanToString(unpackFlipY), GLbooleanToString(unpackPremultiplyAlpha),
   4201          GLbooleanToString(unpackUnmultiplyAlpha));
   4202 
   4203    if (context)
   4204    {
   4205        TextureID sourceIdPacked       = PackParam<TextureID>(sourceId);
   4206        TextureTarget destTargetPacked = PackParam<TextureTarget>(destTarget);
   4207        TextureID destIdPacked         = PackParam<TextureID>(destId);
   4208        SCOPED_SHARE_CONTEXT_LOCK(context);
   4209        bool isCallValid =
   4210            (context->skipValidation() ||
   4211             ValidateCopyTextureCHROMIUM(
   4212                 context, angle::EntryPoint::GLCopyTextureCHROMIUM, sourceIdPacked, sourceLevel,
   4213                 destTargetPacked, destIdPacked, destLevel, internalFormat, destType, unpackFlipY,
   4214                 unpackPremultiplyAlpha, unpackUnmultiplyAlpha));
   4215        if (isCallValid)
   4216        {
   4217            context->copyTexture(sourceIdPacked, sourceLevel, destTargetPacked, destIdPacked,
   4218                                 destLevel, internalFormat, destType, unpackFlipY,
   4219                                 unpackPremultiplyAlpha, unpackUnmultiplyAlpha);
   4220        }
   4221        ANGLE_CAPTURE_GL(CopyTextureCHROMIUM, isCallValid, context, sourceIdPacked, sourceLevel,
   4222                         destTargetPacked, destIdPacked, destLevel, internalFormat, destType,
   4223                         unpackFlipY, unpackPremultiplyAlpha, unpackUnmultiplyAlpha);
   4224    }
   4225    else
   4226    {
   4227        GenerateContextLostErrorOnCurrentGlobalContext();
   4228    }
   4229 }
   4230 
   4231 void GL_APIENTRY GL_CopySubTextureCHROMIUM(GLuint sourceId,
   4232                                           GLint sourceLevel,
   4233                                           GLenum destTarget,
   4234                                           GLuint destId,
   4235                                           GLint destLevel,
   4236                                           GLint xoffset,
   4237                                           GLint yoffset,
   4238                                           GLint x,
   4239                                           GLint y,
   4240                                           GLint width,
   4241                                           GLint height,
   4242                                           GLboolean unpackFlipY,
   4243                                           GLboolean unpackPremultiplyAlpha,
   4244                                           GLboolean unpackUnmultiplyAlpha)
   4245 {
   4246    Context *context = GetValidGlobalContext();
   4247    EVENT(context, GLCopySubTextureCHROMIUM,
   4248          "context = %d, sourceId = %u, sourceLevel = %d, destTarget = %s, destId = %u, destLevel "
   4249          "= %d, xoffset = %d, yoffset = %d, x = %d, y = %d, width = %d, height = %d, unpackFlipY "
   4250          "= %s, unpackPremultiplyAlpha = %s, unpackUnmultiplyAlpha = %s",
   4251          CID(context), sourceId, sourceLevel, GLenumToString(GLESEnum::AllEnums, destTarget),
   4252          destId, destLevel, xoffset, yoffset, x, y, width, height, GLbooleanToString(unpackFlipY),
   4253          GLbooleanToString(unpackPremultiplyAlpha), GLbooleanToString(unpackUnmultiplyAlpha));
   4254 
   4255    if (context)
   4256    {
   4257        TextureID sourceIdPacked       = PackParam<TextureID>(sourceId);
   4258        TextureTarget destTargetPacked = PackParam<TextureTarget>(destTarget);
   4259        TextureID destIdPacked         = PackParam<TextureID>(destId);
   4260        SCOPED_SHARE_CONTEXT_LOCK(context);
   4261        bool isCallValid =
   4262            (context->skipValidation() ||
   4263             ValidateCopySubTextureCHROMIUM(
   4264                 context, angle::EntryPoint::GLCopySubTextureCHROMIUM, sourceIdPacked, sourceLevel,
   4265                 destTargetPacked, destIdPacked, destLevel, xoffset, yoffset, x, y, width, height,
   4266                 unpackFlipY, unpackPremultiplyAlpha, unpackUnmultiplyAlpha));
   4267        if (isCallValid)
   4268        {
   4269            context->copySubTexture(sourceIdPacked, sourceLevel, destTargetPacked, destIdPacked,
   4270                                    destLevel, xoffset, yoffset, x, y, width, height, unpackFlipY,
   4271                                    unpackPremultiplyAlpha, unpackUnmultiplyAlpha);
   4272        }
   4273        ANGLE_CAPTURE_GL(CopySubTextureCHROMIUM, isCallValid, context, sourceIdPacked, sourceLevel,
   4274                         destTargetPacked, destIdPacked, destLevel, xoffset, yoffset, x, y, width,
   4275                         height, unpackFlipY, unpackPremultiplyAlpha, unpackUnmultiplyAlpha);
   4276    }
   4277    else
   4278    {
   4279        GenerateContextLostErrorOnCurrentGlobalContext();
   4280    }
   4281 }
   4282 
   4283 // GL_CHROMIUM_framebuffer_mixed_samples
   4284 void GL_APIENTRY GL_CoverageModulationCHROMIUM(GLenum components)
   4285 {
   4286    Context *context = GetValidGlobalContext();
   4287    EVENT(context, GLCoverageModulationCHROMIUM, "context = %d, components = %s", CID(context),
   4288          GLenumToString(GLESEnum::AllEnums, components));
   4289 
   4290    if (context)
   4291    {
   4292        SCOPED_SHARE_CONTEXT_LOCK(context);
   4293        bool isCallValid =
   4294            (context->skipValidation() ||
   4295             ValidateCoverageModulationCHROMIUM(
   4296                 context, angle::EntryPoint::GLCoverageModulationCHROMIUM, components));
   4297        if (isCallValid)
   4298        {
   4299            context->coverageModulation(components);
   4300        }
   4301        ANGLE_CAPTURE_GL(CoverageModulationCHROMIUM, isCallValid, context, components);
   4302    }
   4303    else
   4304    {
   4305        GenerateContextLostErrorOnCurrentGlobalContext();
   4306    }
   4307 }
   4308 
   4309 // GL_CHROMIUM_lose_context
   4310 void GL_APIENTRY GL_LoseContextCHROMIUM(GLenum current, GLenum other)
   4311 {
   4312    Context *context = GetValidGlobalContext();
   4313    EVENT(context, GLLoseContextCHROMIUM, "context = %d, current = %s, other = %s", CID(context),
   4314          GLenumToString(GLESEnum::GraphicsResetStatus, current),
   4315          GLenumToString(GLESEnum::GraphicsResetStatus, other));
   4316 
   4317    if (context)
   4318    {
   4319        GraphicsResetStatus currentPacked = PackParam<GraphicsResetStatus>(current);
   4320        GraphicsResetStatus otherPacked   = PackParam<GraphicsResetStatus>(other);
   4321        SCOPED_SHARE_CONTEXT_LOCK(context);
   4322        bool isCallValid =
   4323            (context->skipValidation() ||
   4324             ValidateLoseContextCHROMIUM(context, angle::EntryPoint::GLLoseContextCHROMIUM,
   4325                                         currentPacked, otherPacked));
   4326        if (isCallValid)
   4327        {
   4328            context->loseContext(currentPacked, otherPacked);
   4329        }
   4330        ANGLE_CAPTURE_GL(LoseContextCHROMIUM, isCallValid, context, currentPacked, otherPacked);
   4331    }
   4332    else
   4333    {
   4334        GenerateContextLostErrorOnCurrentGlobalContext();
   4335    }
   4336 }
   4337 
   4338 // GL_EXT_EGL_image_array
   4339 
   4340 // GL_EXT_EGL_image_storage
   4341 void GL_APIENTRY GL_EGLImageTargetTexStorageEXT(GLenum target,
   4342                                                GLeglImageOES image,
   4343                                                const GLint *attrib_list)
   4344 {
   4345    Context *context = GetValidGlobalContext();
   4346    EVENT(context, GLEGLImageTargetTexStorageEXT,
   4347          "context = %d, target = %s, image = 0x%016" PRIxPTR ", attrib_list = 0x%016" PRIxPTR "",
   4348          CID(context), GLenumToString(GLESEnum::AllEnums, target), (uintptr_t)image,
   4349          (uintptr_t)attrib_list);
   4350 
   4351    if (context)
   4352    {
   4353        SCOPED_SHARE_CONTEXT_LOCK(context);
   4354        bool isCallValid = (context->skipValidation() ||
   4355                            ValidateEGLImageTargetTexStorageEXT(
   4356                                context, angle::EntryPoint::GLEGLImageTargetTexStorageEXT, target,
   4357                                image, attrib_list));
   4358        if (isCallValid)
   4359        {
   4360            context->eGLImageTargetTexStorage(target, image, attrib_list);
   4361        }
   4362        ANGLE_CAPTURE_GL(EGLImageTargetTexStorageEXT, isCallValid, context, target, image,
   4363                         attrib_list);
   4364    }
   4365    else
   4366    {
   4367        GenerateContextLostErrorOnCurrentGlobalContext();
   4368    }
   4369 }
   4370 
   4371 void GL_APIENTRY GL_EGLImageTargetTextureStorageEXT(GLuint texture,
   4372                                                    GLeglImageOES image,
   4373                                                    const GLint *attrib_list)
   4374 {
   4375    Context *context = GetValidGlobalContext();
   4376    EVENT(context, GLEGLImageTargetTextureStorageEXT,
   4377          "context = %d, texture = %u, image = 0x%016" PRIxPTR ", attrib_list = 0x%016" PRIxPTR "",
   4378          CID(context), texture, (uintptr_t)image, (uintptr_t)attrib_list);
   4379 
   4380    if (context)
   4381    {
   4382        SCOPED_SHARE_CONTEXT_LOCK(context);
   4383        bool isCallValid = (context->skipValidation() ||
   4384                            ValidateEGLImageTargetTextureStorageEXT(
   4385                                context, angle::EntryPoint::GLEGLImageTargetTextureStorageEXT,
   4386                                texture, image, attrib_list));
   4387        if (isCallValid)
   4388        {
   4389            context->eGLImageTargetTextureStorage(texture, image, attrib_list);
   4390        }
   4391        ANGLE_CAPTURE_GL(EGLImageTargetTextureStorageEXT, isCallValid, context, texture, image,
   4392                         attrib_list);
   4393    }
   4394    else
   4395    {
   4396        GenerateContextLostErrorOnCurrentGlobalContext();
   4397    }
   4398 }
   4399 
   4400 // GL_EXT_YUV_target
   4401 
   4402 // GL_EXT_base_instance
   4403 void GL_APIENTRY GL_DrawArraysInstancedBaseInstanceEXT(GLenum mode,
   4404                                                       GLint first,
   4405                                                       GLsizei count,
   4406                                                       GLsizei instancecount,
   4407                                                       GLuint baseinstance)
   4408 {
   4409    Context *context = GetValidGlobalContext();
   4410    EVENT(context, GLDrawArraysInstancedBaseInstanceEXT,
   4411          "context = %d, mode = %s, first = %d, count = %d, instancecount = %d, baseinstance = %u",
   4412          CID(context), GLenumToString(GLESEnum::PrimitiveType, mode), first, count, instancecount,
   4413          baseinstance);
   4414 
   4415    if (context)
   4416    {
   4417        PrimitiveMode modePacked = PackParam<PrimitiveMode>(mode);
   4418        SCOPED_SHARE_CONTEXT_LOCK(context);
   4419        bool isCallValid = (context->skipValidation() ||
   4420                            ValidateDrawArraysInstancedBaseInstanceEXT(
   4421                                context, angle::EntryPoint::GLDrawArraysInstancedBaseInstanceEXT,
   4422                                modePacked, first, count, instancecount, baseinstance));
   4423        if (isCallValid)
   4424        {
   4425            context->drawArraysInstancedBaseInstance(modePacked, first, count, instancecount,
   4426                                                     baseinstance);
   4427        }
   4428        ANGLE_CAPTURE_GL(DrawArraysInstancedBaseInstanceEXT, isCallValid, context, modePacked,
   4429                         first, count, instancecount, baseinstance);
   4430    }
   4431    else
   4432    {
   4433        GenerateContextLostErrorOnCurrentGlobalContext();
   4434    }
   4435 }
   4436 
   4437 void GL_APIENTRY GL_DrawElementsInstancedBaseInstanceEXT(GLenum mode,
   4438                                                         GLsizei count,
   4439                                                         GLenum type,
   4440                                                         const void *indices,
   4441                                                         GLsizei instancecount,
   4442                                                         GLuint baseinstance)
   4443 {
   4444    Context *context = GetValidGlobalContext();
   4445    EVENT(context, GLDrawElementsInstancedBaseInstanceEXT,
   4446          "context = %d, mode = %s, count = %d, type = %s, indices = 0x%016" PRIxPTR
   4447          ", instancecount = %d, baseinstance = %u",
   4448          CID(context), GLenumToString(GLESEnum::PrimitiveType, mode), count,
   4449          GLenumToString(GLESEnum::PrimitiveType, type), (uintptr_t)indices, instancecount,
   4450          baseinstance);
   4451 
   4452    if (context)
   4453    {
   4454        PrimitiveMode modePacked    = PackParam<PrimitiveMode>(mode);
   4455        DrawElementsType typePacked = PackParam<DrawElementsType>(type);
   4456        SCOPED_SHARE_CONTEXT_LOCK(context);
   4457        bool isCallValid =
   4458            (context->skipValidation() ||
   4459             ValidateDrawElementsInstancedBaseInstanceEXT(
   4460                 context, angle::EntryPoint::GLDrawElementsInstancedBaseInstanceEXT, modePacked,
   4461                 count, typePacked, indices, instancecount, baseinstance));
   4462        if (isCallValid)
   4463        {
   4464            context->drawElementsInstancedBaseInstance(modePacked, count, typePacked, indices,
   4465                                                       instancecount, baseinstance);
   4466        }
   4467        ANGLE_CAPTURE_GL(DrawElementsInstancedBaseInstanceEXT, isCallValid, context, modePacked,
   4468                         count, typePacked, indices, instancecount, baseinstance);
   4469    }
   4470    else
   4471    {
   4472        GenerateContextLostErrorOnCurrentGlobalContext();
   4473    }
   4474 }
   4475 
   4476 void GL_APIENTRY GL_DrawElementsInstancedBaseVertexBaseInstanceEXT(GLenum mode,
   4477                                                                   GLsizei count,
   4478                                                                   GLenum type,
   4479                                                                   const void *indices,
   4480                                                                   GLsizei instancecount,
   4481                                                                   GLint basevertex,
   4482                                                                   GLuint baseinstance)
   4483 {
   4484    Context *context = GetValidGlobalContext();
   4485    EVENT(context, GLDrawElementsInstancedBaseVertexBaseInstanceEXT,
   4486          "context = %d, mode = %s, count = %d, type = %s, indices = 0x%016" PRIxPTR
   4487          ", instancecount = %d, basevertex = %d, baseinstance = %u",
   4488          CID(context), GLenumToString(GLESEnum::PrimitiveType, mode), count,
   4489          GLenumToString(GLESEnum::DrawElementsType, type), (uintptr_t)indices, instancecount,
   4490          basevertex, baseinstance);
   4491 
   4492    if (context)
   4493    {
   4494        PrimitiveMode modePacked    = PackParam<PrimitiveMode>(mode);
   4495        DrawElementsType typePacked = PackParam<DrawElementsType>(type);
   4496        SCOPED_SHARE_CONTEXT_LOCK(context);
   4497        bool isCallValid =
   4498            (context->skipValidation() ||
   4499             ValidateDrawElementsInstancedBaseVertexBaseInstanceEXT(
   4500                 context, angle::EntryPoint::GLDrawElementsInstancedBaseVertexBaseInstanceEXT,
   4501                 modePacked, count, typePacked, indices, instancecount, basevertex, baseinstance));
   4502        if (isCallValid)
   4503        {
   4504            context->drawElementsInstancedBaseVertexBaseInstance(
   4505                modePacked, count, typePacked, indices, instancecount, basevertex, baseinstance);
   4506        }
   4507        ANGLE_CAPTURE_GL(DrawElementsInstancedBaseVertexBaseInstanceEXT, isCallValid, context,
   4508                         modePacked, count, typePacked, indices, instancecount, basevertex,
   4509                         baseinstance);
   4510    }
   4511    else
   4512    {
   4513        GenerateContextLostErrorOnCurrentGlobalContext();
   4514    }
   4515 }
   4516 
   4517 // GL_EXT_blend_func_extended
   4518 void GL_APIENTRY GL_BindFragDataLocationEXT(GLuint program, GLuint color, const GLchar *name)
   4519 {
   4520    Context *context = GetValidGlobalContext();
   4521    EVENT(context, GLBindFragDataLocationEXT,
   4522          "context = %d, program = %u, color = %u, name = 0x%016" PRIxPTR "", CID(context), program,
   4523          color, (uintptr_t)name);
   4524 
   4525    if (context)
   4526    {
   4527        ShaderProgramID programPacked = PackParam<ShaderProgramID>(program);
   4528        SCOPED_SHARE_CONTEXT_LOCK(context);
   4529        bool isCallValid =
   4530            (context->skipValidation() ||
   4531             ValidateBindFragDataLocationEXT(context, angle::EntryPoint::GLBindFragDataLocationEXT,
   4532                                             programPacked, color, name));
   4533        if (isCallValid)
   4534        {
   4535            context->bindFragDataLocation(programPacked, color, name);
   4536        }
   4537        ANGLE_CAPTURE_GL(BindFragDataLocationEXT, isCallValid, context, programPacked, color, name);
   4538    }
   4539    else
   4540    {
   4541        GenerateContextLostErrorOnCurrentGlobalContext();
   4542    }
   4543 }
   4544 
   4545 void GL_APIENTRY GL_BindFragDataLocationIndexedEXT(GLuint program,
   4546                                                   GLuint colorNumber,
   4547                                                   GLuint index,
   4548                                                   const GLchar *name)
   4549 {
   4550    Context *context = GetValidGlobalContext();
   4551    EVENT(context, GLBindFragDataLocationIndexedEXT,
   4552          "context = %d, program = %u, colorNumber = %u, index = %u, name = 0x%016" PRIxPTR "",
   4553          CID(context), program, colorNumber, index, (uintptr_t)name);
   4554 
   4555    if (context)
   4556    {
   4557        ShaderProgramID programPacked = PackParam<ShaderProgramID>(program);
   4558        SCOPED_SHARE_CONTEXT_LOCK(context);
   4559        bool isCallValid = (context->skipValidation() ||
   4560                            ValidateBindFragDataLocationIndexedEXT(
   4561                                context, angle::EntryPoint::GLBindFragDataLocationIndexedEXT,
   4562                                programPacked, colorNumber, index, name));
   4563        if (isCallValid)
   4564        {
   4565            context->bindFragDataLocationIndexed(programPacked, colorNumber, index, name);
   4566        }
   4567        ANGLE_CAPTURE_GL(BindFragDataLocationIndexedEXT, isCallValid, context, programPacked,
   4568                         colorNumber, index, name);
   4569    }
   4570    else
   4571    {
   4572        GenerateContextLostErrorOnCurrentGlobalContext();
   4573    }
   4574 }
   4575 
   4576 GLint GL_APIENTRY GL_GetFragDataIndexEXT(GLuint program, const GLchar *name)
   4577 {
   4578    Context *context = GetValidGlobalContext();
   4579    EVENT(context, GLGetFragDataIndexEXT, "context = %d, program = %u, name = 0x%016" PRIxPTR "",
   4580          CID(context), program, (uintptr_t)name);
   4581 
   4582    GLint returnValue;
   4583    if (context)
   4584    {
   4585        ShaderProgramID programPacked = PackParam<ShaderProgramID>(program);
   4586        SCOPED_SHARE_CONTEXT_LOCK(context);
   4587        bool isCallValid =
   4588            (context->skipValidation() ||
   4589             ValidateGetFragDataIndexEXT(context, angle::EntryPoint::GLGetFragDataIndexEXT,
   4590                                         programPacked, name));
   4591        if (isCallValid)
   4592        {
   4593            returnValue = context->getFragDataIndex(programPacked, name);
   4594        }
   4595        else
   4596        {
   4597            returnValue = GetDefaultReturnValue<angle::EntryPoint::GLGetFragDataIndexEXT, GLint>();
   4598        }
   4599        ANGLE_CAPTURE_GL(GetFragDataIndexEXT, isCallValid, context, programPacked, name,
   4600                         returnValue);
   4601    }
   4602    else
   4603    {
   4604        GenerateContextLostErrorOnCurrentGlobalContext();
   4605        returnValue = GetDefaultReturnValue<angle::EntryPoint::GLGetFragDataIndexEXT, GLint>();
   4606    }
   4607    return returnValue;
   4608 }
   4609 
   4610 GLint GL_APIENTRY GL_GetProgramResourceLocationIndexEXT(GLuint program,
   4611                                                        GLenum programInterface,
   4612                                                        const GLchar *name)
   4613 {
   4614    Context *context = GetValidGlobalContext();
   4615    EVENT(context, GLGetProgramResourceLocationIndexEXT,
   4616          "context = %d, program = %u, programInterface = %s, name = 0x%016" PRIxPTR "",
   4617          CID(context), program, GLenumToString(GLESEnum::ProgramInterface, programInterface),
   4618          (uintptr_t)name);
   4619 
   4620    GLint returnValue;
   4621    if (context)
   4622    {
   4623        ShaderProgramID programPacked = PackParam<ShaderProgramID>(program);
   4624        SCOPED_SHARE_CONTEXT_LOCK(context);
   4625        bool isCallValid = (context->skipValidation() ||
   4626                            ValidateGetProgramResourceLocationIndexEXT(
   4627                                context, angle::EntryPoint::GLGetProgramResourceLocationIndexEXT,
   4628                                programPacked, programInterface, name));
   4629        if (isCallValid)
   4630        {
   4631            returnValue =
   4632                context->getProgramResourceLocationIndex(programPacked, programInterface, name);
   4633        }
   4634        else
   4635        {
   4636            returnValue =
   4637                GetDefaultReturnValue<angle::EntryPoint::GLGetProgramResourceLocationIndexEXT,
   4638                                      GLint>();
   4639        }
   4640        ANGLE_CAPTURE_GL(GetProgramResourceLocationIndexEXT, isCallValid, context, programPacked,
   4641                         programInterface, name, returnValue);
   4642    }
   4643    else
   4644    {
   4645        GenerateContextLostErrorOnCurrentGlobalContext();
   4646        returnValue =
   4647            GetDefaultReturnValue<angle::EntryPoint::GLGetProgramResourceLocationIndexEXT, GLint>();
   4648    }
   4649    return returnValue;
   4650 }
   4651 
   4652 // GL_EXT_blend_minmax
   4653 
   4654 // GL_EXT_buffer_storage
   4655 void GL_APIENTRY GL_BufferStorageEXT(GLenum target,
   4656                                     GLsizeiptr size,
   4657                                     const void *data,
   4658                                     GLbitfield flags)
   4659 {
   4660    Context *context = GetValidGlobalContext();
   4661    EVENT(context, GLBufferStorageEXT,
   4662          "context = %d, target = %s, size = %llu, data = 0x%016" PRIxPTR ", flags = %s",
   4663          CID(context), GLenumToString(GLESEnum::BufferStorageTarget, target),
   4664          static_cast<unsigned long long>(size), (uintptr_t)data,
   4665          GLbitfieldToString(GLESEnum::BufferStorageMask, flags).c_str());
   4666 
   4667    if (context)
   4668    {
   4669        BufferBinding targetPacked = PackParam<BufferBinding>(target);
   4670        SCOPED_SHARE_CONTEXT_LOCK(context);
   4671        bool isCallValid = (context->skipValidation() ||
   4672                            ValidateBufferStorageEXT(context, angle::EntryPoint::GLBufferStorageEXT,
   4673                                                     targetPacked, size, data, flags));
   4674        if (isCallValid)
   4675        {
   4676            context->bufferStorage(targetPacked, size, data, flags);
   4677        }
   4678        ANGLE_CAPTURE_GL(BufferStorageEXT, isCallValid, context, targetPacked, size, data, flags);
   4679    }
   4680    else
   4681    {
   4682        GenerateContextLostErrorOnCurrentGlobalContext();
   4683    }
   4684 }
   4685 
   4686 // GL_EXT_clip_control
   4687 void GL_APIENTRY GL_ClipControlEXT(GLenum origin, GLenum depth)
   4688 {
   4689    Context *context = GetValidGlobalContext();
   4690    EVENT(context, GLClipControlEXT, "context = %d, origin = %s, depth = %s", CID(context),
   4691          GLenumToString(GLESEnum::AllEnums, origin), GLenumToString(GLESEnum::AllEnums, depth));
   4692 
   4693    if (context)
   4694    {
   4695        SCOPED_SHARE_CONTEXT_LOCK(context);
   4696        bool isCallValid =
   4697            (context->skipValidation() ||
   4698             ValidateClipControlEXT(context, angle::EntryPoint::GLClipControlEXT, origin, depth));
   4699        if (isCallValid)
   4700        {
   4701            context->clipControl(origin, depth);
   4702        }
   4703        ANGLE_CAPTURE_GL(ClipControlEXT, isCallValid, context, origin, depth);
   4704    }
   4705    else
   4706    {
   4707        GenerateContextLostErrorOnCurrentGlobalContext();
   4708    }
   4709 }
   4710 
   4711 // GL_EXT_clip_cull_distance
   4712 
   4713 // GL_EXT_color_buffer_float
   4714 
   4715 // GL_EXT_color_buffer_half_float
   4716 
   4717 // GL_EXT_copy_image
   4718 void GL_APIENTRY GL_CopyImageSubDataEXT(GLuint srcName,
   4719                                        GLenum srcTarget,
   4720                                        GLint srcLevel,
   4721                                        GLint srcX,
   4722                                        GLint srcY,
   4723                                        GLint srcZ,
   4724                                        GLuint dstName,
   4725                                        GLenum dstTarget,
   4726                                        GLint dstLevel,
   4727                                        GLint dstX,
   4728                                        GLint dstY,
   4729                                        GLint dstZ,
   4730                                        GLsizei srcWidth,
   4731                                        GLsizei srcHeight,
   4732                                        GLsizei srcDepth)
   4733 {
   4734    Context *context = GetValidGlobalContext();
   4735    EVENT(context, GLCopyImageSubDataEXT,
   4736          "context = %d, srcName = %u, srcTarget = %s, srcLevel = %d, srcX = %d, srcY = %d, srcZ = "
   4737          "%d, dstName = %u, dstTarget = %s, dstLevel = %d, dstX = %d, dstY = %d, dstZ = %d, "
   4738          "srcWidth = %d, srcHeight = %d, srcDepth = %d",
   4739          CID(context), srcName, GLenumToString(GLESEnum::CopyBufferSubDataTarget, srcTarget),
   4740          srcLevel, srcX, srcY, srcZ, dstName,
   4741          GLenumToString(GLESEnum::CopyBufferSubDataTarget, dstTarget), dstLevel, dstX, dstY, dstZ,
   4742          srcWidth, srcHeight, srcDepth);
   4743 
   4744    if (context)
   4745    {
   4746        SCOPED_SHARE_CONTEXT_LOCK(context);
   4747        bool isCallValid = (context->skipValidation() ||
   4748                            ValidateCopyImageSubDataEXT(
   4749                                context, angle::EntryPoint::GLCopyImageSubDataEXT, srcName,
   4750                                srcTarget, srcLevel, srcX, srcY, srcZ, dstName, dstTarget, dstLevel,
   4751                                dstX, dstY, dstZ, srcWidth, srcHeight, srcDepth));
   4752        if (isCallValid)
   4753        {
   4754            context->copyImageSubData(srcName, srcTarget, srcLevel, srcX, srcY, srcZ, dstName,
   4755                                      dstTarget, dstLevel, dstX, dstY, dstZ, srcWidth, srcHeight,
   4756                                      srcDepth);
   4757        }
   4758        ANGLE_CAPTURE_GL(CopyImageSubDataEXT, isCallValid, context, srcName, srcTarget, srcLevel,
   4759                         srcX, srcY, srcZ, dstName, dstTarget, dstLevel, dstX, dstY, dstZ, srcWidth,
   4760                         srcHeight, srcDepth);
   4761    }
   4762    else
   4763    {
   4764        GenerateContextLostErrorOnCurrentGlobalContext();
   4765    }
   4766 }
   4767 
   4768 // GL_EXT_debug_label
   4769 void GL_APIENTRY
   4770 GL_GetObjectLabelEXT(GLenum type, GLuint object, GLsizei bufSize, GLsizei *length, GLchar *label)
   4771 {
   4772    Context *context = GetValidGlobalContext();
   4773    EVENT(context, GLGetObjectLabelEXT,
   4774          "context = %d, type = %s, object = %u, bufSize = %d, length = 0x%016" PRIxPTR
   4775          ", label = 0x%016" PRIxPTR "",
   4776          CID(context), GLenumToString(GLESEnum::AllEnums, type), object, bufSize,
   4777          (uintptr_t)length, (uintptr_t)label);
   4778 
   4779    if (context)
   4780    {
   4781        SCOPED_SHARE_CONTEXT_LOCK(context);
   4782        bool isCallValid =
   4783            (context->skipValidation() ||
   4784             ValidateGetObjectLabelEXT(context, angle::EntryPoint::GLGetObjectLabelEXT, type,
   4785                                       object, bufSize, length, label));
   4786        if (isCallValid)
   4787        {
   4788            context->getObjectLabel(type, object, bufSize, length, label);
   4789        }
   4790        ANGLE_CAPTURE_GL(GetObjectLabelEXT, isCallValid, context, type, object, bufSize, length,
   4791                         label);
   4792    }
   4793    else
   4794    {
   4795        GenerateContextLostErrorOnCurrentGlobalContext();
   4796    }
   4797 }
   4798 
   4799 void GL_APIENTRY GL_LabelObjectEXT(GLenum type, GLuint object, GLsizei length, const GLchar *label)
   4800 {
   4801    Context *context = GetValidGlobalContext();
   4802    EVENT(context, GLLabelObjectEXT,
   4803          "context = %d, type = %s, object = %u, length = %d, label = 0x%016" PRIxPTR "",
   4804          CID(context), GLenumToString(GLESEnum::AllEnums, type), object, length, (uintptr_t)label);
   4805 
   4806    if (context)
   4807    {
   4808        SCOPED_SHARE_CONTEXT_LOCK(context);
   4809        bool isCallValid = (context->skipValidation() ||
   4810                            ValidateLabelObjectEXT(context, angle::EntryPoint::GLLabelObjectEXT,
   4811                                                   type, object, length, label));
   4812        if (isCallValid)
   4813        {
   4814            context->labelObject(type, object, length, label);
   4815        }
   4816        ANGLE_CAPTURE_GL(LabelObjectEXT, isCallValid, context, type, object, length, label);
   4817    }
   4818    else
   4819    {
   4820        GenerateContextLostErrorOnCurrentGlobalContext();
   4821    }
   4822 }
   4823 
   4824 // GL_EXT_debug_marker
   4825 void GL_APIENTRY GL_InsertEventMarkerEXT(GLsizei length, const GLchar *marker)
   4826 {
   4827    Context *context = GetValidGlobalContext();
   4828    // Don't run the EVENT() macro on the EXT_debug_marker entry points.
   4829    // It can interfere with the debug events being set by the caller.
   4830    // EVENT(context, GLInsertEventMarkerEXT, "context = %d, length = %d, marker = 0x%016" PRIxPTR
   4831    // "", CID(context), length, (uintptr_t)marker);
   4832 
   4833    if (context)
   4834    {
   4835        SCOPED_SHARE_CONTEXT_LOCK(context);
   4836        bool isCallValid =
   4837            (context->skipValidation() ||
   4838             ValidateInsertEventMarkerEXT(context, angle::EntryPoint::GLInsertEventMarkerEXT,
   4839                                          length, marker));
   4840        if (isCallValid)
   4841        {
   4842            context->insertEventMarker(length, marker);
   4843        }
   4844        ANGLE_CAPTURE_GL(InsertEventMarkerEXT, isCallValid, context, length, marker);
   4845    }
   4846    else
   4847    {
   4848        GenerateContextLostErrorOnCurrentGlobalContext();
   4849    }
   4850 }
   4851 
   4852 void GL_APIENTRY GL_PopGroupMarkerEXT()
   4853 {
   4854    Context *context = GetValidGlobalContext();
   4855    // Don't run the EVENT() macro on the EXT_debug_marker entry points.
   4856    // It can interfere with the debug events being set by the caller.
   4857    // EVENT(context, GLPopGroupMarkerEXT, "context = %d", CID(context));
   4858 
   4859    if (context)
   4860    {
   4861        SCOPED_SHARE_CONTEXT_LOCK(context);
   4862        bool isCallValid =
   4863            (context->skipValidation() ||
   4864             ValidatePopGroupMarkerEXT(context, angle::EntryPoint::GLPopGroupMarkerEXT));
   4865        if (isCallValid)
   4866        {
   4867            context->popGroupMarker();
   4868        }
   4869        ANGLE_CAPTURE_GL(PopGroupMarkerEXT, isCallValid, context);
   4870    }
   4871    else
   4872    {
   4873        GenerateContextLostErrorOnCurrentGlobalContext();
   4874    }
   4875 }
   4876 
   4877 void GL_APIENTRY GL_PushGroupMarkerEXT(GLsizei length, const GLchar *marker)
   4878 {
   4879    Context *context = GetValidGlobalContext();
   4880    // Don't run the EVENT() macro on the EXT_debug_marker entry points.
   4881    // It can interfere with the debug events being set by the caller.
   4882    // EVENT(context, GLPushGroupMarkerEXT, "context = %d, length = %d, marker = 0x%016" PRIxPTR "",
   4883    // CID(context), length, (uintptr_t)marker);
   4884 
   4885    if (context)
   4886    {
   4887        SCOPED_SHARE_CONTEXT_LOCK(context);
   4888        bool isCallValid = (context->skipValidation() ||
   4889                            ValidatePushGroupMarkerEXT(
   4890                                context, angle::EntryPoint::GLPushGroupMarkerEXT, length, marker));
   4891        if (isCallValid)
   4892        {
   4893            context->pushGroupMarker(length, marker);
   4894        }
   4895        ANGLE_CAPTURE_GL(PushGroupMarkerEXT, isCallValid, context, length, marker);
   4896    }
   4897    else
   4898    {
   4899        GenerateContextLostErrorOnCurrentGlobalContext();
   4900    }
   4901 }
   4902 
   4903 // GL_EXT_discard_framebuffer
   4904 void GL_APIENTRY GL_DiscardFramebufferEXT(GLenum target,
   4905                                          GLsizei numAttachments,
   4906                                          const GLenum *attachments)
   4907 {
   4908    Context *context = GetValidGlobalContext();
   4909    EVENT(context, GLDiscardFramebufferEXT,
   4910          "context = %d, target = %s, numAttachments = %d, attachments = 0x%016" PRIxPTR "",
   4911          CID(context), GLenumToString(GLESEnum::FramebufferTarget, target), numAttachments,
   4912          (uintptr_t)attachments);
   4913 
   4914    if (context)
   4915    {
   4916        SCOPED_SHARE_CONTEXT_LOCK(context);
   4917        bool isCallValid =
   4918            (context->skipValidation() ||
   4919             ValidateDiscardFramebufferEXT(context, angle::EntryPoint::GLDiscardFramebufferEXT,
   4920                                           target, numAttachments, attachments));
   4921        if (isCallValid)
   4922        {
   4923            context->discardFramebuffer(target, numAttachments, attachments);
   4924        }
   4925        ANGLE_CAPTURE_GL(DiscardFramebufferEXT, isCallValid, context, target, numAttachments,
   4926                         attachments);
   4927    }
   4928    else
   4929    {
   4930        GenerateContextLostErrorOnCurrentGlobalContext();
   4931    }
   4932 }
   4933 
   4934 // GL_EXT_disjoint_timer_query
   4935 void GL_APIENTRY GL_BeginQueryEXT(GLenum target, GLuint id)
   4936 {
   4937    Context *context = GetValidGlobalContext();
   4938    EVENT(context, GLBeginQueryEXT, "context = %d, target = %s, id = %u", CID(context),
   4939          GLenumToString(GLESEnum::QueryTarget, target), id);
   4940 
   4941    if (context)
   4942    {
   4943        QueryType targetPacked = PackParam<QueryType>(target);
   4944        QueryID idPacked       = PackParam<QueryID>(id);
   4945        SCOPED_SHARE_CONTEXT_LOCK(context);
   4946        bool isCallValid = (context->skipValidation() ||
   4947                            ValidateBeginQueryEXT(context, angle::EntryPoint::GLBeginQueryEXT,
   4948                                                  targetPacked, idPacked));
   4949        if (isCallValid)
   4950        {
   4951            context->beginQuery(targetPacked, idPacked);
   4952        }
   4953        ANGLE_CAPTURE_GL(BeginQueryEXT, isCallValid, context, targetPacked, idPacked);
   4954    }
   4955    else
   4956    {
   4957        GenerateContextLostErrorOnCurrentGlobalContext();
   4958    }
   4959 }
   4960 
   4961 void GL_APIENTRY GL_DeleteQueriesEXT(GLsizei n, const GLuint *ids)
   4962 {
   4963    Context *context = GetValidGlobalContext();
   4964    EVENT(context, GLDeleteQueriesEXT, "context = %d, n = %d, ids = 0x%016" PRIxPTR "",
   4965          CID(context), n, (uintptr_t)ids);
   4966 
   4967    if (context)
   4968    {
   4969        const QueryID *idsPacked = PackParam<const QueryID *>(ids);
   4970        SCOPED_SHARE_CONTEXT_LOCK(context);
   4971        bool isCallValid = (context->skipValidation() ||
   4972                            ValidateDeleteQueriesEXT(context, angle::EntryPoint::GLDeleteQueriesEXT,
   4973                                                     n, idsPacked));
   4974        if (isCallValid)
   4975        {
   4976            context->deleteQueries(n, idsPacked);
   4977        }
   4978        ANGLE_CAPTURE_GL(DeleteQueriesEXT, isCallValid, context, n, idsPacked);
   4979    }
   4980    else
   4981    {
   4982        GenerateContextLostErrorOnCurrentGlobalContext();
   4983    }
   4984 }
   4985 
   4986 void GL_APIENTRY GL_EndQueryEXT(GLenum target)
   4987 {
   4988    Context *context = GetValidGlobalContext();
   4989    EVENT(context, GLEndQueryEXT, "context = %d, target = %s", CID(context),
   4990          GLenumToString(GLESEnum::QueryTarget, target));
   4991 
   4992    if (context)
   4993    {
   4994        QueryType targetPacked = PackParam<QueryType>(target);
   4995        SCOPED_SHARE_CONTEXT_LOCK(context);
   4996        bool isCallValid =
   4997            (context->skipValidation() ||
   4998             ValidateEndQueryEXT(context, angle::EntryPoint::GLEndQueryEXT, targetPacked));
   4999        if (isCallValid)
   5000        {
   5001            context->endQuery(targetPacked);
   5002        }
   5003        ANGLE_CAPTURE_GL(EndQueryEXT, isCallValid, context, targetPacked);
   5004    }
   5005    else
   5006    {
   5007        GenerateContextLostErrorOnCurrentGlobalContext();
   5008    }
   5009 }
   5010 
   5011 void GL_APIENTRY GL_GenQueriesEXT(GLsizei n, GLuint *ids)
   5012 {
   5013    Context *context = GetValidGlobalContext();
   5014    EVENT(context, GLGenQueriesEXT, "context = %d, n = %d, ids = 0x%016" PRIxPTR "", CID(context),
   5015          n, (uintptr_t)ids);
   5016 
   5017    if (context)
   5018    {
   5019        QueryID *idsPacked = PackParam<QueryID *>(ids);
   5020        SCOPED_SHARE_CONTEXT_LOCK(context);
   5021        bool isCallValid =
   5022            (context->skipValidation() ||
   5023             ValidateGenQueriesEXT(context, angle::EntryPoint::GLGenQueriesEXT, n, idsPacked));
   5024        if (isCallValid)
   5025        {
   5026            context->genQueries(n, idsPacked);
   5027        }
   5028        ANGLE_CAPTURE_GL(GenQueriesEXT, isCallValid, context, n, idsPacked);
   5029    }
   5030    else
   5031    {
   5032        GenerateContextLostErrorOnCurrentGlobalContext();
   5033    }
   5034 }
   5035 
   5036 void GL_APIENTRY GL_GetInteger64vEXT(GLenum pname, GLint64 *data)
   5037 {
   5038    Context *context = GetValidGlobalContext();
   5039    EVENT(context, GLGetInteger64vEXT, "context = %d, pname = %s, data = 0x%016" PRIxPTR "",
   5040          CID(context), GLenumToString(GLESEnum::GetPName, pname), (uintptr_t)data);
   5041 
   5042    if (context)
   5043    {
   5044        SCOPED_SHARE_CONTEXT_LOCK(context);
   5045        bool isCallValid =
   5046            (context->skipValidation() ||
   5047             ValidateGetInteger64vEXT(context, angle::EntryPoint::GLGetInteger64vEXT, pname, data));
   5048        if (isCallValid)
   5049        {
   5050            context->getInteger64v(pname, data);
   5051        }
   5052        ANGLE_CAPTURE_GL(GetInteger64vEXT, isCallValid, context, pname, data);
   5053    }
   5054    else
   5055    {
   5056        GenerateContextLostErrorOnCurrentGlobalContext();
   5057    }
   5058 }
   5059 
   5060 void GL_APIENTRY GL_GetQueryObjecti64vEXT(GLuint id, GLenum pname, GLint64 *params)
   5061 {
   5062    Context *context = GetGlobalContext();
   5063    EVENT(context, GLGetQueryObjecti64vEXT,
   5064          "context = %d, id = %u, pname = %s, params = 0x%016" PRIxPTR "", CID(context), id,
   5065          GLenumToString(GLESEnum::QueryObjectParameterName, pname), (uintptr_t)params);
   5066 
   5067    if (context)
   5068    {
   5069        QueryID idPacked = PackParam<QueryID>(id);
   5070        SCOPED_SHARE_CONTEXT_LOCK(context);
   5071        bool isCallValid =
   5072            (context->skipValidation() ||
   5073             ValidateGetQueryObjecti64vEXT(context, angle::EntryPoint::GLGetQueryObjecti64vEXT,
   5074                                           idPacked, pname, params));
   5075        if (isCallValid)
   5076        {
   5077            context->getQueryObjecti64v(idPacked, pname, params);
   5078        }
   5079        ANGLE_CAPTURE_GL(GetQueryObjecti64vEXT, isCallValid, context, idPacked, pname, params);
   5080    }
   5081    else
   5082    {}
   5083 }
   5084 
   5085 void GL_APIENTRY GL_GetQueryObjectivEXT(GLuint id, GLenum pname, GLint *params)
   5086 {
   5087    Context *context = GetGlobalContext();
   5088    EVENT(context, GLGetQueryObjectivEXT,
   5089          "context = %d, id = %u, pname = %s, params = 0x%016" PRIxPTR "", CID(context), id,
   5090          GLenumToString(GLESEnum::QueryObjectParameterName, pname), (uintptr_t)params);
   5091 
   5092    if (context)
   5093    {
   5094        QueryID idPacked = PackParam<QueryID>(id);
   5095        SCOPED_SHARE_CONTEXT_LOCK(context);
   5096        bool isCallValid =
   5097            (context->skipValidation() ||
   5098             ValidateGetQueryObjectivEXT(context, angle::EntryPoint::GLGetQueryObjectivEXT,
   5099                                         idPacked, pname, params));
   5100        if (isCallValid)
   5101        {
   5102            context->getQueryObjectiv(idPacked, pname, params);
   5103        }
   5104        ANGLE_CAPTURE_GL(GetQueryObjectivEXT, isCallValid, context, idPacked, pname, params);
   5105    }
   5106    else
   5107    {}
   5108 }
   5109 
   5110 void GL_APIENTRY GL_GetQueryObjectui64vEXT(GLuint id, GLenum pname, GLuint64 *params)
   5111 {
   5112    Context *context = GetValidGlobalContext();
   5113    EVENT(context, GLGetQueryObjectui64vEXT,
   5114          "context = %d, id = %u, pname = %s, params = 0x%016" PRIxPTR "", CID(context), id,
   5115          GLenumToString(GLESEnum::QueryObjectParameterName, pname), (uintptr_t)params);
   5116 
   5117    if (context)
   5118    {
   5119        QueryID idPacked = PackParam<QueryID>(id);
   5120        SCOPED_SHARE_CONTEXT_LOCK(context);
   5121        bool isCallValid =
   5122            (context->skipValidation() ||
   5123             ValidateGetQueryObjectui64vEXT(context, angle::EntryPoint::GLGetQueryObjectui64vEXT,
   5124                                            idPacked, pname, params));
   5125        if (isCallValid)
   5126        {
   5127            context->getQueryObjectui64v(idPacked, pname, params);
   5128        }
   5129        ANGLE_CAPTURE_GL(GetQueryObjectui64vEXT, isCallValid, context, idPacked, pname, params);
   5130    }
   5131    else
   5132    {
   5133        GenerateContextLostErrorOnCurrentGlobalContext();
   5134    }
   5135 }
   5136 
   5137 void GL_APIENTRY GL_GetQueryObjectuivEXT(GLuint id, GLenum pname, GLuint *params)
   5138 {
   5139    Context *context = GetValidGlobalContext();
   5140    EVENT(context, GLGetQueryObjectuivEXT,
   5141          "context = %d, id = %u, pname = %s, params = 0x%016" PRIxPTR "", CID(context), id,
   5142          GLenumToString(GLESEnum::QueryObjectParameterName, pname), (uintptr_t)params);
   5143 
   5144    if (context)
   5145    {
   5146        QueryID idPacked = PackParam<QueryID>(id);
   5147        SCOPED_SHARE_CONTEXT_LOCK(context);
   5148        bool isCallValid =
   5149            (context->skipValidation() ||
   5150             ValidateGetQueryObjectuivEXT(context, angle::EntryPoint::GLGetQueryObjectuivEXT,
   5151                                          idPacked, pname, params));
   5152        if (isCallValid)
   5153        {
   5154            context->getQueryObjectuiv(idPacked, pname, params);
   5155        }
   5156        ANGLE_CAPTURE_GL(GetQueryObjectuivEXT, isCallValid, context, idPacked, pname, params);
   5157    }
   5158    else
   5159    {
   5160        GenerateContextLostErrorOnCurrentGlobalContext();
   5161    }
   5162 }
   5163 
   5164 void GL_APIENTRY GL_GetQueryivEXT(GLenum target, GLenum pname, GLint *params)
   5165 {
   5166    Context *context = GetValidGlobalContext();
   5167    EVENT(context, GLGetQueryivEXT,
   5168          "context = %d, target = %s, pname = %s, params = 0x%016" PRIxPTR "", CID(context),
   5169          GLenumToString(GLESEnum::QueryTarget, target),
   5170          GLenumToString(GLESEnum::QueryParameterName, pname), (uintptr_t)params);
   5171 
   5172    if (context)
   5173    {
   5174        QueryType targetPacked = PackParam<QueryType>(target);
   5175        SCOPED_SHARE_CONTEXT_LOCK(context);
   5176        bool isCallValid = (context->skipValidation() ||
   5177                            ValidateGetQueryivEXT(context, angle::EntryPoint::GLGetQueryivEXT,
   5178                                                  targetPacked, pname, params));
   5179        if (isCallValid)
   5180        {
   5181            context->getQueryiv(targetPacked, pname, params);
   5182        }
   5183        ANGLE_CAPTURE_GL(GetQueryivEXT, isCallValid, context, targetPacked, pname, params);
   5184    }
   5185    else
   5186    {
   5187        GenerateContextLostErrorOnCurrentGlobalContext();
   5188    }
   5189 }
   5190 
   5191 GLboolean GL_APIENTRY GL_IsQueryEXT(GLuint id)
   5192 {
   5193    Context *context = GetValidGlobalContext();
   5194    EVENT(context, GLIsQueryEXT, "context = %d, id = %u", CID(context), id);
   5195 
   5196    GLboolean returnValue;
   5197    if (context)
   5198    {
   5199        QueryID idPacked = PackParam<QueryID>(id);
   5200        SCOPED_SHARE_CONTEXT_LOCK(context);
   5201        bool isCallValid = (context->skipValidation() ||
   5202                            ValidateIsQueryEXT(context, angle::EntryPoint::GLIsQueryEXT, idPacked));
   5203        if (isCallValid)
   5204        {
   5205            returnValue = context->isQuery(idPacked);
   5206        }
   5207        else
   5208        {
   5209            returnValue = GetDefaultReturnValue<angle::EntryPoint::GLIsQueryEXT, GLboolean>();
   5210        }
   5211        ANGLE_CAPTURE_GL(IsQueryEXT, isCallValid, context, idPacked, returnValue);
   5212    }
   5213    else
   5214    {
   5215        GenerateContextLostErrorOnCurrentGlobalContext();
   5216        returnValue = GetDefaultReturnValue<angle::EntryPoint::GLIsQueryEXT, GLboolean>();
   5217    }
   5218    return returnValue;
   5219 }
   5220 
   5221 void GL_APIENTRY GL_QueryCounterEXT(GLuint id, GLenum target)
   5222 {
   5223    Context *context = GetValidGlobalContext();
   5224    EVENT(context, GLQueryCounterEXT, "context = %d, id = %u, target = %s", CID(context), id,
   5225          GLenumToString(GLESEnum::QueryCounterTarget, target));
   5226 
   5227    if (context)
   5228    {
   5229        QueryID idPacked       = PackParam<QueryID>(id);
   5230        QueryType targetPacked = PackParam<QueryType>(target);
   5231        SCOPED_SHARE_CONTEXT_LOCK(context);
   5232        bool isCallValid = (context->skipValidation() ||
   5233                            ValidateQueryCounterEXT(context, angle::EntryPoint::GLQueryCounterEXT,
   5234                                                    idPacked, targetPacked));
   5235        if (isCallValid)
   5236        {
   5237            context->queryCounter(idPacked, targetPacked);
   5238        }
   5239        ANGLE_CAPTURE_GL(QueryCounterEXT, isCallValid, context, idPacked, targetPacked);
   5240    }
   5241    else
   5242    {
   5243        GenerateContextLostErrorOnCurrentGlobalContext();
   5244    }
   5245 }
   5246 
   5247 // GL_EXT_draw_buffers
   5248 void GL_APIENTRY GL_DrawBuffersEXT(GLsizei n, const GLenum *bufs)
   5249 {
   5250    Context *context = GetValidGlobalContext();
   5251    EVENT(context, GLDrawBuffersEXT, "context = %d, n = %d, bufs = 0x%016" PRIxPTR "", CID(context),
   5252          n, (uintptr_t)bufs);
   5253 
   5254    if (context)
   5255    {
   5256        SCOPED_SHARE_CONTEXT_LOCK(context);
   5257        bool isCallValid =
   5258            (context->skipValidation() ||
   5259             ValidateDrawBuffersEXT(context, angle::EntryPoint::GLDrawBuffersEXT, n, bufs));
   5260        if (isCallValid)
   5261        {
   5262            context->drawBuffers(n, bufs);
   5263        }
   5264        ANGLE_CAPTURE_GL(DrawBuffersEXT, isCallValid, context, n, bufs);
   5265    }
   5266    else
   5267    {
   5268        GenerateContextLostErrorOnCurrentGlobalContext();
   5269    }
   5270 }
   5271 
   5272 // GL_EXT_draw_buffers_indexed
   5273 void GL_APIENTRY GL_BlendEquationSeparateiEXT(GLuint buf, GLenum modeRGB, GLenum modeAlpha)
   5274 {
   5275    Context *context = GetValidGlobalContext();
   5276    EVENT(context, GLBlendEquationSeparateiEXT,
   5277          "context = %d, buf = %u, modeRGB = %s, modeAlpha = %s", CID(context), buf,
   5278          GLenumToString(GLESEnum::BlendEquationModeEXT, modeRGB),
   5279          GLenumToString(GLESEnum::BlendEquationModeEXT, modeAlpha));
   5280 
   5281    if (context)
   5282    {
   5283        SCOPED_SHARE_CONTEXT_LOCK(context);
   5284        bool isCallValid =
   5285            (context->skipValidation() ||
   5286             ValidateBlendEquationSeparateiEXT(
   5287                 context, angle::EntryPoint::GLBlendEquationSeparateiEXT, buf, modeRGB, modeAlpha));
   5288        if (isCallValid)
   5289        {
   5290            context->blendEquationSeparatei(buf, modeRGB, modeAlpha);
   5291        }
   5292        ANGLE_CAPTURE_GL(BlendEquationSeparateiEXT, isCallValid, context, buf, modeRGB, modeAlpha);
   5293    }
   5294    else
   5295    {
   5296        GenerateContextLostErrorOnCurrentGlobalContext();
   5297    }
   5298 }
   5299 
   5300 void GL_APIENTRY GL_BlendEquationiEXT(GLuint buf, GLenum mode)
   5301 {
   5302    Context *context = GetValidGlobalContext();
   5303    EVENT(context, GLBlendEquationiEXT, "context = %d, buf = %u, mode = %s", CID(context), buf,
   5304          GLenumToString(GLESEnum::BlendEquationModeEXT, mode));
   5305 
   5306    if (context)
   5307    {
   5308        SCOPED_SHARE_CONTEXT_LOCK(context);
   5309        bool isCallValid =
   5310            (context->skipValidation() ||
   5311             ValidateBlendEquationiEXT(context, angle::EntryPoint::GLBlendEquationiEXT, buf, mode));
   5312        if (isCallValid)
   5313        {
   5314            context->blendEquationi(buf, mode);
   5315        }
   5316        ANGLE_CAPTURE_GL(BlendEquationiEXT, isCallValid, context, buf, mode);
   5317    }
   5318    else
   5319    {
   5320        GenerateContextLostErrorOnCurrentGlobalContext();
   5321    }
   5322 }
   5323 
   5324 void GL_APIENTRY
   5325 GL_BlendFuncSeparateiEXT(GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)
   5326 {
   5327    Context *context = GetValidGlobalContext();
   5328    EVENT(context, GLBlendFuncSeparateiEXT,
   5329          "context = %d, buf = %u, srcRGB = %s, dstRGB = %s, srcAlpha = %s, dstAlpha = %s",
   5330          CID(context), buf, GLenumToString(GLESEnum::BlendingFactor, srcRGB),
   5331          GLenumToString(GLESEnum::BlendingFactor, dstRGB),
   5332          GLenumToString(GLESEnum::BlendingFactor, srcAlpha),
   5333          GLenumToString(GLESEnum::BlendingFactor, dstAlpha));
   5334 
   5335    if (context)
   5336    {
   5337        SCOPED_SHARE_CONTEXT_LOCK(context);
   5338        bool isCallValid =
   5339            (context->skipValidation() ||
   5340             ValidateBlendFuncSeparateiEXT(context, angle::EntryPoint::GLBlendFuncSeparateiEXT, buf,
   5341                                           srcRGB, dstRGB, srcAlpha, dstAlpha));
   5342        if (isCallValid)
   5343        {
   5344            context->blendFuncSeparatei(buf, srcRGB, dstRGB, srcAlpha, dstAlpha);
   5345        }
   5346        ANGLE_CAPTURE_GL(BlendFuncSeparateiEXT, isCallValid, context, buf, srcRGB, dstRGB, srcAlpha,
   5347                         dstAlpha);
   5348    }
   5349    else
   5350    {
   5351        GenerateContextLostErrorOnCurrentGlobalContext();
   5352    }
   5353 }
   5354 
   5355 void GL_APIENTRY GL_BlendFunciEXT(GLuint buf, GLenum src, GLenum dst)
   5356 {
   5357    Context *context = GetValidGlobalContext();
   5358    EVENT(context, GLBlendFunciEXT, "context = %d, buf = %u, src = %s, dst = %s", CID(context), buf,
   5359          GLenumToString(GLESEnum::BlendingFactor, src),
   5360          GLenumToString(GLESEnum::BlendingFactor, dst));
   5361 
   5362    if (context)
   5363    {
   5364        SCOPED_SHARE_CONTEXT_LOCK(context);
   5365        bool isCallValid =
   5366            (context->skipValidation() ||
   5367             ValidateBlendFunciEXT(context, angle::EntryPoint::GLBlendFunciEXT, buf, src, dst));
   5368        if (isCallValid)
   5369        {
   5370            context->blendFunci(buf, src, dst);
   5371        }
   5372        ANGLE_CAPTURE_GL(BlendFunciEXT, isCallValid, context, buf, src, dst);
   5373    }
   5374    else
   5375    {
   5376        GenerateContextLostErrorOnCurrentGlobalContext();
   5377    }
   5378 }
   5379 
   5380 void GL_APIENTRY GL_ColorMaskiEXT(GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a)
   5381 {
   5382    Context *context = GetValidGlobalContext();
   5383    EVENT(context, GLColorMaskiEXT, "context = %d, index = %u, r = %s, g = %s, b = %s, a = %s",
   5384          CID(context), index, GLbooleanToString(r), GLbooleanToString(g), GLbooleanToString(b),
   5385          GLbooleanToString(a));
   5386 
   5387    if (context)
   5388    {
   5389        SCOPED_SHARE_CONTEXT_LOCK(context);
   5390        bool isCallValid =
   5391            (context->skipValidation() ||
   5392             ValidateColorMaskiEXT(context, angle::EntryPoint::GLColorMaskiEXT, index, r, g, b, a));
   5393        if (isCallValid)
   5394        {
   5395            context->colorMaski(index, r, g, b, a);
   5396        }
   5397        ANGLE_CAPTURE_GL(ColorMaskiEXT, isCallValid, context, index, r, g, b, a);
   5398    }
   5399    else
   5400    {
   5401        GenerateContextLostErrorOnCurrentGlobalContext();
   5402    }
   5403 }
   5404 
   5405 void GL_APIENTRY GL_DisableiEXT(GLenum target, GLuint index)
   5406 {
   5407    Context *context = GetValidGlobalContext();
   5408    EVENT(context, GLDisableiEXT, "context = %d, target = %s, index = %u", CID(context),
   5409          GLenumToString(GLESEnum::EnableCap, target), index);
   5410 
   5411    if (context)
   5412    {
   5413        SCOPED_SHARE_CONTEXT_LOCK(context);
   5414        bool isCallValid =
   5415            (context->skipValidation() ||
   5416             ValidateDisableiEXT(context, angle::EntryPoint::GLDisableiEXT, target, index));
   5417        if (isCallValid)
   5418        {
   5419            context->disablei(target, index);
   5420        }
   5421        ANGLE_CAPTURE_GL(DisableiEXT, isCallValid, context, target, index);
   5422    }
   5423    else
   5424    {
   5425        GenerateContextLostErrorOnCurrentGlobalContext();
   5426    }
   5427 }
   5428 
   5429 void GL_APIENTRY GL_EnableiEXT(GLenum target, GLuint index)
   5430 {
   5431    Context *context = GetValidGlobalContext();
   5432    EVENT(context, GLEnableiEXT, "context = %d, target = %s, index = %u", CID(context),
   5433          GLenumToString(GLESEnum::EnableCap, target), index);
   5434 
   5435    if (context)
   5436    {
   5437        SCOPED_SHARE_CONTEXT_LOCK(context);
   5438        bool isCallValid =
   5439            (context->skipValidation() ||
   5440             ValidateEnableiEXT(context, angle::EntryPoint::GLEnableiEXT, target, index));
   5441        if (isCallValid)
   5442        {
   5443            context->enablei(target, index);
   5444        }
   5445        ANGLE_CAPTURE_GL(EnableiEXT, isCallValid, context, target, index);
   5446    }
   5447    else
   5448    {
   5449        GenerateContextLostErrorOnCurrentGlobalContext();
   5450    }
   5451 }
   5452 
   5453 GLboolean GL_APIENTRY GL_IsEnablediEXT(GLenum target, GLuint index)
   5454 {
   5455    Context *context = GetValidGlobalContext();
   5456    EVENT(context, GLIsEnablediEXT, "context = %d, target = %s, index = %u", CID(context),
   5457          GLenumToString(GLESEnum::EnableCap, target), index);
   5458 
   5459    GLboolean returnValue;
   5460    if (context)
   5461    {
   5462        SCOPED_SHARE_CONTEXT_LOCK(context);
   5463        bool isCallValid =
   5464            (context->skipValidation() ||
   5465             ValidateIsEnablediEXT(context, angle::EntryPoint::GLIsEnablediEXT, target, index));
   5466        if (isCallValid)
   5467        {
   5468            returnValue = context->isEnabledi(target, index);
   5469        }
   5470        else
   5471        {
   5472            returnValue = GetDefaultReturnValue<angle::EntryPoint::GLIsEnablediEXT, GLboolean>();
   5473        }
   5474        ANGLE_CAPTURE_GL(IsEnablediEXT, isCallValid, context, target, index, returnValue);
   5475    }
   5476    else
   5477    {
   5478        GenerateContextLostErrorOnCurrentGlobalContext();
   5479        returnValue = GetDefaultReturnValue<angle::EntryPoint::GLIsEnablediEXT, GLboolean>();
   5480    }
   5481    return returnValue;
   5482 }
   5483 
   5484 // GL_EXT_draw_elements_base_vertex
   5485 void GL_APIENTRY GL_DrawElementsBaseVertexEXT(GLenum mode,
   5486                                              GLsizei count,
   5487                                              GLenum type,
   5488                                              const void *indices,
   5489                                              GLint basevertex)
   5490 {
   5491    Context *context = GetValidGlobalContext();
   5492    EVENT(context, GLDrawElementsBaseVertexEXT,
   5493          "context = %d, mode = %s, count = %d, type = %s, indices = 0x%016" PRIxPTR
   5494          ", basevertex = %d",
   5495          CID(context), GLenumToString(GLESEnum::PrimitiveType, mode), count,
   5496          GLenumToString(GLESEnum::DrawElementsType, type), (uintptr_t)indices, basevertex);
   5497 
   5498    if (context)
   5499    {
   5500        PrimitiveMode modePacked    = PackParam<PrimitiveMode>(mode);
   5501        DrawElementsType typePacked = PackParam<DrawElementsType>(type);
   5502        SCOPED_SHARE_CONTEXT_LOCK(context);
   5503        bool isCallValid = (context->skipValidation() ||
   5504                            ValidateDrawElementsBaseVertexEXT(
   5505                                context, angle::EntryPoint::GLDrawElementsBaseVertexEXT, modePacked,
   5506                                count, typePacked, indices, basevertex));
   5507        if (isCallValid)
   5508        {
   5509            context->drawElementsBaseVertex(modePacked, count, typePacked, indices, basevertex);
   5510        }
   5511        ANGLE_CAPTURE_GL(DrawElementsBaseVertexEXT, isCallValid, context, modePacked, count,
   5512                         typePacked, indices, basevertex);
   5513    }
   5514    else
   5515    {
   5516        GenerateContextLostErrorOnCurrentGlobalContext();
   5517    }
   5518 }
   5519 
   5520 void GL_APIENTRY GL_DrawElementsInstancedBaseVertexEXT(GLenum mode,
   5521                                                       GLsizei count,
   5522                                                       GLenum type,
   5523                                                       const void *indices,
   5524                                                       GLsizei instancecount,
   5525                                                       GLint basevertex)
   5526 {
   5527    Context *context = GetValidGlobalContext();
   5528    EVENT(context, GLDrawElementsInstancedBaseVertexEXT,
   5529          "context = %d, mode = %s, count = %d, type = %s, indices = 0x%016" PRIxPTR
   5530          ", instancecount = %d, basevertex = %d",
   5531          CID(context), GLenumToString(GLESEnum::PrimitiveType, mode), count,
   5532          GLenumToString(GLESEnum::DrawElementsType, type), (uintptr_t)indices, instancecount,
   5533          basevertex);
   5534 
   5535    if (context)
   5536    {
   5537        PrimitiveMode modePacked    = PackParam<PrimitiveMode>(mode);
   5538        DrawElementsType typePacked = PackParam<DrawElementsType>(type);
   5539        SCOPED_SHARE_CONTEXT_LOCK(context);
   5540        bool isCallValid = (context->skipValidation() ||
   5541                            ValidateDrawElementsInstancedBaseVertexEXT(
   5542                                context, angle::EntryPoint::GLDrawElementsInstancedBaseVertexEXT,
   5543                                modePacked, count, typePacked, indices, instancecount, basevertex));
   5544        if (isCallValid)
   5545        {
   5546            context->drawElementsInstancedBaseVertex(modePacked, count, typePacked, indices,
   5547                                                     instancecount, basevertex);
   5548        }
   5549        ANGLE_CAPTURE_GL(DrawElementsInstancedBaseVertexEXT, isCallValid, context, modePacked,
   5550                         count, typePacked, indices, instancecount, basevertex);
   5551    }
   5552    else
   5553    {
   5554        GenerateContextLostErrorOnCurrentGlobalContext();
   5555    }
   5556 }
   5557 
   5558 void GL_APIENTRY GL_DrawRangeElementsBaseVertexEXT(GLenum mode,
   5559                                                   GLuint start,
   5560                                                   GLuint end,
   5561                                                   GLsizei count,
   5562                                                   GLenum type,
   5563                                                   const void *indices,
   5564                                                   GLint basevertex)
   5565 {
   5566    Context *context = GetValidGlobalContext();
   5567    EVENT(context, GLDrawRangeElementsBaseVertexEXT,
   5568          "context = %d, mode = %s, start = %u, end = %u, count = %d, type = %s, indices = "
   5569          "0x%016" PRIxPTR ", basevertex = %d",
   5570          CID(context), GLenumToString(GLESEnum::PrimitiveType, mode), start, end, count,
   5571          GLenumToString(GLESEnum::DrawElementsType, type), (uintptr_t)indices, basevertex);
   5572 
   5573    if (context)
   5574    {
   5575        PrimitiveMode modePacked    = PackParam<PrimitiveMode>(mode);
   5576        DrawElementsType typePacked = PackParam<DrawElementsType>(type);
   5577        SCOPED_SHARE_CONTEXT_LOCK(context);
   5578        bool isCallValid = (context->skipValidation() ||
   5579                            ValidateDrawRangeElementsBaseVertexEXT(
   5580                                context, angle::EntryPoint::GLDrawRangeElementsBaseVertexEXT,
   5581                                modePacked, start, end, count, typePacked, indices, basevertex));
   5582        if (isCallValid)
   5583        {
   5584            context->drawRangeElementsBaseVertex(modePacked, start, end, count, typePacked, indices,
   5585                                                 basevertex);
   5586        }
   5587        ANGLE_CAPTURE_GL(DrawRangeElementsBaseVertexEXT, isCallValid, context, modePacked, start,
   5588                         end, count, typePacked, indices, basevertex);
   5589    }
   5590    else
   5591    {
   5592        GenerateContextLostErrorOnCurrentGlobalContext();
   5593    }
   5594 }
   5595 
   5596 void GL_APIENTRY GL_MultiDrawElementsBaseVertexEXT(GLenum mode,
   5597                                                   const GLsizei *count,
   5598                                                   GLenum type,
   5599                                                   const void *const *indices,
   5600                                                   GLsizei drawcount,
   5601                                                   const GLint *basevertex)
   5602 {
   5603    Context *context = GetValidGlobalContext();
   5604    EVENT(context, GLMultiDrawElementsBaseVertexEXT,
   5605          "context = %d, mode = %s, count = 0x%016" PRIxPTR ", type = %s, indices = 0x%016" PRIxPTR
   5606          ", drawcount = %d, basevertex = 0x%016" PRIxPTR "",
   5607          CID(context), GLenumToString(GLESEnum::PrimitiveType, mode), (uintptr_t)count,
   5608          GLenumToString(GLESEnum::DrawElementsType, type), (uintptr_t)indices, drawcount,
   5609          (uintptr_t)basevertex);
   5610 
   5611    if (context)
   5612    {
   5613        PrimitiveMode modePacked    = PackParam<PrimitiveMode>(mode);
   5614        DrawElementsType typePacked = PackParam<DrawElementsType>(type);
   5615        SCOPED_SHARE_CONTEXT_LOCK(context);
   5616        bool isCallValid = (context->skipValidation() ||
   5617                            ValidateMultiDrawElementsBaseVertexEXT(
   5618                                context, angle::EntryPoint::GLMultiDrawElementsBaseVertexEXT,
   5619                                modePacked, count, typePacked, indices, drawcount, basevertex));
   5620        if (isCallValid)
   5621        {
   5622            context->multiDrawElementsBaseVertex(modePacked, count, typePacked, indices, drawcount,
   5623                                                 basevertex);
   5624        }
   5625        ANGLE_CAPTURE_GL(MultiDrawElementsBaseVertexEXT, isCallValid, context, modePacked, count,
   5626                         typePacked, indices, drawcount, basevertex);
   5627    }
   5628    else
   5629    {
   5630        GenerateContextLostErrorOnCurrentGlobalContext();
   5631    }
   5632 }
   5633 
   5634 // GL_EXT_external_buffer
   5635 void GL_APIENTRY GL_BufferStorageExternalEXT(GLenum target,
   5636                                             GLintptr offset,
   5637                                             GLsizeiptr size,
   5638                                             GLeglClientBufferEXT clientBuffer,
   5639                                             GLbitfield flags)
   5640 {
   5641    Context *context = GetValidGlobalContext();
   5642    EVENT(context, GLBufferStorageExternalEXT,
   5643          "context = %d, target = %s, offset = %llu, size = %llu, clientBuffer = 0x%016" PRIxPTR
   5644          ", flags = %s",
   5645          CID(context), GLenumToString(GLESEnum::AllEnums, target),
   5646          static_cast<unsigned long long>(offset), static_cast<unsigned long long>(size),
   5647          (uintptr_t)clientBuffer, GLbitfieldToString(GLESEnum::BufferStorageMask, flags).c_str());
   5648 
   5649    if (context)
   5650    {
   5651        BufferBinding targetPacked = PackParam<BufferBinding>(target);
   5652        SCOPED_SHARE_CONTEXT_LOCK(context);
   5653        bool isCallValid = (context->skipValidation() ||
   5654                            ValidateBufferStorageExternalEXT(
   5655                                context, angle::EntryPoint::GLBufferStorageExternalEXT,
   5656                                targetPacked, offset, size, clientBuffer, flags));
   5657        if (isCallValid)
   5658        {
   5659            context->bufferStorageExternal(targetPacked, offset, size, clientBuffer, flags);
   5660        }
   5661        ANGLE_CAPTURE_GL(BufferStorageExternalEXT, isCallValid, context, targetPacked, offset, size,
   5662                         clientBuffer, flags);
   5663    }
   5664    else
   5665    {
   5666        GenerateContextLostErrorOnCurrentGlobalContext();
   5667    }
   5668 }
   5669 
   5670 void GL_APIENTRY GL_NamedBufferStorageExternalEXT(GLuint buffer,
   5671                                                  GLintptr offset,
   5672                                                  GLsizeiptr size,
   5673                                                  GLeglClientBufferEXT clientBuffer,
   5674                                                  GLbitfield flags)
   5675 {
   5676    Context *context = GetValidGlobalContext();
   5677    EVENT(context, GLNamedBufferStorageExternalEXT,
   5678          "context = %d, buffer = %u, offset = %llu, size = %llu, clientBuffer = 0x%016" PRIxPTR
   5679          ", flags = %s",
   5680          CID(context), buffer, static_cast<unsigned long long>(offset),
   5681          static_cast<unsigned long long>(size), (uintptr_t)clientBuffer,
   5682          GLbitfieldToString(GLESEnum::BufferStorageMask, flags).c_str());
   5683 
   5684    if (context)
   5685    {
   5686        SCOPED_SHARE_CONTEXT_LOCK(context);
   5687        bool isCallValid = (context->skipValidation() ||
   5688                            ValidateNamedBufferStorageExternalEXT(
   5689                                context, angle::EntryPoint::GLNamedBufferStorageExternalEXT, buffer,
   5690                                offset, size, clientBuffer, flags));
   5691        if (isCallValid)
   5692        {
   5693            context->namedBufferStorageExternal(buffer, offset, size, clientBuffer, flags);
   5694        }
   5695        ANGLE_CAPTURE_GL(NamedBufferStorageExternalEXT, isCallValid, context, buffer, offset, size,
   5696                         clientBuffer, flags);
   5697    }
   5698    else
   5699    {
   5700        GenerateContextLostErrorOnCurrentGlobalContext();
   5701    }
   5702 }
   5703 
   5704 // GL_EXT_float_blend
   5705 
   5706 // GL_EXT_geometry_shader
   5707 void GL_APIENTRY GL_FramebufferTextureEXT(GLenum target,
   5708                                          GLenum attachment,
   5709                                          GLuint texture,
   5710                                          GLint level)
   5711 {
   5712    Context *context = GetValidGlobalContext();
   5713    EVENT(context, GLFramebufferTextureEXT,
   5714          "context = %d, target = %s, attachment = %s, texture = %u, level = %d", CID(context),
   5715          GLenumToString(GLESEnum::FramebufferTarget, target),
   5716          GLenumToString(GLESEnum::FramebufferAttachment, attachment), texture, level);
   5717 
   5718    if (context)
   5719    {
   5720        TextureID texturePacked = PackParam<TextureID>(texture);
   5721        SCOPED_SHARE_CONTEXT_LOCK(context);
   5722        bool isCallValid =
   5723            (context->skipValidation() ||
   5724             ValidateFramebufferTextureEXT(context, angle::EntryPoint::GLFramebufferTextureEXT,
   5725                                           target, attachment, texturePacked, level));
   5726        if (isCallValid)
   5727        {
   5728            context->framebufferTexture(target, attachment, texturePacked, level);
   5729        }
   5730        ANGLE_CAPTURE_GL(FramebufferTextureEXT, isCallValid, context, target, attachment,
   5731                         texturePacked, level);
   5732    }
   5733    else
   5734    {
   5735        GenerateContextLostErrorOnCurrentGlobalContext();
   5736    }
   5737 }
   5738 
   5739 // GL_EXT_gpu_shader5
   5740 
   5741 // GL_EXT_instanced_arrays
   5742 void GL_APIENTRY GL_DrawArraysInstancedEXT(GLenum mode,
   5743                                           GLint start,
   5744                                           GLsizei count,
   5745                                           GLsizei primcount)
   5746 {
   5747    Context *context = GetValidGlobalContext();
   5748    EVENT(context, GLDrawArraysInstancedEXT,
   5749          "context = %d, mode = %s, start = %d, count = %d, primcount = %d", CID(context),
   5750          GLenumToString(GLESEnum::PrimitiveType, mode), start, count, primcount);
   5751 
   5752    if (context)
   5753    {
   5754        PrimitiveMode modePacked = PackParam<PrimitiveMode>(mode);
   5755        SCOPED_SHARE_CONTEXT_LOCK(context);
   5756        bool isCallValid =
   5757            (context->skipValidation() ||
   5758             ValidateDrawArraysInstancedEXT(context, angle::EntryPoint::GLDrawArraysInstancedEXT,
   5759                                            modePacked, start, count, primcount));
   5760        if (isCallValid)
   5761        {
   5762            context->drawArraysInstanced(modePacked, start, count, primcount);
   5763        }
   5764        ANGLE_CAPTURE_GL(DrawArraysInstancedEXT, isCallValid, context, modePacked, start, count,
   5765                         primcount);
   5766    }
   5767    else
   5768    {
   5769        GenerateContextLostErrorOnCurrentGlobalContext();
   5770    }
   5771 }
   5772 
   5773 void GL_APIENTRY GL_DrawElementsInstancedEXT(GLenum mode,
   5774                                             GLsizei count,
   5775                                             GLenum type,
   5776                                             const void *indices,
   5777                                             GLsizei primcount)
   5778 {
   5779    Context *context = GetValidGlobalContext();
   5780    EVENT(context, GLDrawElementsInstancedEXT,
   5781          "context = %d, mode = %s, count = %d, type = %s, indices = 0x%016" PRIxPTR
   5782          ", primcount = %d",
   5783          CID(context), GLenumToString(GLESEnum::PrimitiveType, mode), count,
   5784          GLenumToString(GLESEnum::DrawElementsType, type), (uintptr_t)indices, primcount);
   5785 
   5786    if (context)
   5787    {
   5788        PrimitiveMode modePacked    = PackParam<PrimitiveMode>(mode);
   5789        DrawElementsType typePacked = PackParam<DrawElementsType>(type);
   5790        SCOPED_SHARE_CONTEXT_LOCK(context);
   5791        bool isCallValid = (context->skipValidation() ||
   5792                            ValidateDrawElementsInstancedEXT(
   5793                                context, angle::EntryPoint::GLDrawElementsInstancedEXT, modePacked,
   5794                                count, typePacked, indices, primcount));
   5795        if (isCallValid)
   5796        {
   5797            context->drawElementsInstanced(modePacked, count, typePacked, indices, primcount);
   5798        }
   5799        ANGLE_CAPTURE_GL(DrawElementsInstancedEXT, isCallValid, context, modePacked, count,
   5800                         typePacked, indices, primcount);
   5801    }
   5802    else
   5803    {
   5804        GenerateContextLostErrorOnCurrentGlobalContext();
   5805    }
   5806 }
   5807 
   5808 void GL_APIENTRY GL_VertexAttribDivisorEXT(GLuint index, GLuint divisor)
   5809 {
   5810    Context *context = GetValidGlobalContext();
   5811    EVENT(context, GLVertexAttribDivisorEXT, "context = %d, index = %u, divisor = %u", CID(context),
   5812          index, divisor);
   5813 
   5814    if (context)
   5815    {
   5816        SCOPED_SHARE_CONTEXT_LOCK(context);
   5817        bool isCallValid =
   5818            (context->skipValidation() ||
   5819             ValidateVertexAttribDivisorEXT(context, angle::EntryPoint::GLVertexAttribDivisorEXT,
   5820                                            index, divisor));
   5821        if (isCallValid)
   5822        {
   5823            context->vertexAttribDivisor(index, divisor);
   5824        }
   5825        ANGLE_CAPTURE_GL(VertexAttribDivisorEXT, isCallValid, context, index, divisor);
   5826    }
   5827    else
   5828    {
   5829        GenerateContextLostErrorOnCurrentGlobalContext();
   5830    }
   5831 }
   5832 
   5833 // GL_EXT_map_buffer_range
   5834 void GL_APIENTRY GL_FlushMappedBufferRangeEXT(GLenum target, GLintptr offset, GLsizeiptr length)
   5835 {
   5836    Context *context = GetValidGlobalContext();
   5837    EVENT(context, GLFlushMappedBufferRangeEXT,
   5838          "context = %d, target = %s, offset = %llu, length = %llu", CID(context),
   5839          GLenumToString(GLESEnum::BufferTargetARB, target),
   5840          static_cast<unsigned long long>(offset), static_cast<unsigned long long>(length));
   5841 
   5842    if (context)
   5843    {
   5844        BufferBinding targetPacked = PackParam<BufferBinding>(target);
   5845        SCOPED_SHARE_CONTEXT_LOCK(context);
   5846        bool isCallValid = (context->skipValidation() ||
   5847                            ValidateFlushMappedBufferRangeEXT(
   5848                                context, angle::EntryPoint::GLFlushMappedBufferRangeEXT,
   5849                                targetPacked, offset, length));
   5850        if (isCallValid)
   5851        {
   5852            context->flushMappedBufferRange(targetPacked, offset, length);
   5853        }
   5854        ANGLE_CAPTURE_GL(FlushMappedBufferRangeEXT, isCallValid, context, targetPacked, offset,
   5855                         length);
   5856    }
   5857    else
   5858    {
   5859        GenerateContextLostErrorOnCurrentGlobalContext();
   5860    }
   5861 }
   5862 
   5863 void *GL_APIENTRY GL_MapBufferRangeEXT(GLenum target,
   5864                                       GLintptr offset,
   5865                                       GLsizeiptr length,
   5866                                       GLbitfield access)
   5867 {
   5868    Context *context = GetValidGlobalContext();
   5869    EVENT(context, GLMapBufferRangeEXT,
   5870          "context = %d, target = %s, offset = %llu, length = %llu, access = %s", CID(context),
   5871          GLenumToString(GLESEnum::BufferTargetARB, target),
   5872          static_cast<unsigned long long>(offset), static_cast<unsigned long long>(length),
   5873          GLbitfieldToString(GLESEnum::MapBufferAccessMask, access).c_str());
   5874 
   5875    void *returnValue;
   5876    if (context)
   5877    {
   5878        BufferBinding targetPacked = PackParam<BufferBinding>(target);
   5879        SCOPED_SHARE_CONTEXT_LOCK(context);
   5880        bool isCallValid =
   5881            (context->skipValidation() ||
   5882             ValidateMapBufferRangeEXT(context, angle::EntryPoint::GLMapBufferRangeEXT,
   5883                                       targetPacked, offset, length, access));
   5884        if (isCallValid)
   5885        {
   5886            returnValue = context->mapBufferRange(targetPacked, offset, length, access);
   5887        }
   5888        else
   5889        {
   5890            returnValue = GetDefaultReturnValue<angle::EntryPoint::GLMapBufferRangeEXT, void *>();
   5891        }
   5892        ANGLE_CAPTURE_GL(MapBufferRangeEXT, isCallValid, context, targetPacked, offset, length,
   5893                         access, returnValue);
   5894    }
   5895    else
   5896    {
   5897        GenerateContextLostErrorOnCurrentGlobalContext();
   5898        returnValue = GetDefaultReturnValue<angle::EntryPoint::GLMapBufferRangeEXT, void *>();
   5899    }
   5900    return returnValue;
   5901 }
   5902 
   5903 // GL_EXT_memory_object
   5904 void GL_APIENTRY GL_BufferStorageMemEXT(GLenum target,
   5905                                        GLsizeiptr size,
   5906                                        GLuint memory,
   5907                                        GLuint64 offset)
   5908 {
   5909    Context *context = GetValidGlobalContext();
   5910    EVENT(context, GLBufferStorageMemEXT,
   5911          "context = %d, target = %s, size = %llu, memory = %u, offset = %llu", CID(context),
   5912          GLenumToString(GLESEnum::BufferTargetARB, target), static_cast<unsigned long long>(size),
   5913          memory, static_cast<unsigned long long>(offset));
   5914 
   5915    if (context)
   5916    {
   5917        TextureType targetPacked    = PackParam<TextureType>(target);
   5918        MemoryObjectID memoryPacked = PackParam<MemoryObjectID>(memory);
   5919        SCOPED_SHARE_CONTEXT_LOCK(context);
   5920        bool isCallValid =
   5921            (context->skipValidation() ||
   5922             ValidateBufferStorageMemEXT(context, angle::EntryPoint::GLBufferStorageMemEXT,
   5923                                         targetPacked, size, memoryPacked, offset));
   5924        if (isCallValid)
   5925        {
   5926            context->bufferStorageMem(targetPacked, size, memoryPacked, offset);
   5927        }
   5928        ANGLE_CAPTURE_GL(BufferStorageMemEXT, isCallValid, context, targetPacked, size,
   5929                         memoryPacked, offset);
   5930    }
   5931    else
   5932    {
   5933        GenerateContextLostErrorOnCurrentGlobalContext();
   5934    }
   5935 }
   5936 
   5937 void GL_APIENTRY GL_CreateMemoryObjectsEXT(GLsizei n, GLuint *memoryObjects)
   5938 {
   5939    Context *context = GetValidGlobalContext();
   5940    EVENT(context, GLCreateMemoryObjectsEXT,
   5941          "context = %d, n = %d, memoryObjects = 0x%016" PRIxPTR "", CID(context), n,
   5942          (uintptr_t)memoryObjects);
   5943 
   5944    if (context)
   5945    {
   5946        MemoryObjectID *memoryObjectsPacked = PackParam<MemoryObjectID *>(memoryObjects);
   5947        SCOPED_SHARE_CONTEXT_LOCK(context);
   5948        bool isCallValid =
   5949            (context->skipValidation() ||
   5950             ValidateCreateMemoryObjectsEXT(context, angle::EntryPoint::GLCreateMemoryObjectsEXT, n,
   5951                                            memoryObjectsPacked));
   5952        if (isCallValid)
   5953        {
   5954            context->createMemoryObjects(n, memoryObjectsPacked);
   5955        }
   5956        ANGLE_CAPTURE_GL(CreateMemoryObjectsEXT, isCallValid, context, n, memoryObjectsPacked);
   5957    }
   5958    else
   5959    {
   5960        GenerateContextLostErrorOnCurrentGlobalContext();
   5961    }
   5962 }
   5963 
   5964 void GL_APIENTRY GL_DeleteMemoryObjectsEXT(GLsizei n, const GLuint *memoryObjects)
   5965 {
   5966    Context *context = GetValidGlobalContext();
   5967    EVENT(context, GLDeleteMemoryObjectsEXT,
   5968          "context = %d, n = %d, memoryObjects = 0x%016" PRIxPTR "", CID(context), n,
   5969          (uintptr_t)memoryObjects);
   5970 
   5971    if (context)
   5972    {
   5973        const MemoryObjectID *memoryObjectsPacked =
   5974            PackParam<const MemoryObjectID *>(memoryObjects);
   5975        SCOPED_SHARE_CONTEXT_LOCK(context);
   5976        bool isCallValid =
   5977            (context->skipValidation() ||
   5978             ValidateDeleteMemoryObjectsEXT(context, angle::EntryPoint::GLDeleteMemoryObjectsEXT, n,
   5979                                            memoryObjectsPacked));
   5980        if (isCallValid)
   5981        {
   5982            context->deleteMemoryObjects(n, memoryObjectsPacked);
   5983        }
   5984        ANGLE_CAPTURE_GL(DeleteMemoryObjectsEXT, isCallValid, context, n, memoryObjectsPacked);
   5985    }
   5986    else
   5987    {
   5988        GenerateContextLostErrorOnCurrentGlobalContext();
   5989    }
   5990 }
   5991 
   5992 void GL_APIENTRY GL_GetMemoryObjectParameterivEXT(GLuint memoryObject, GLenum pname, GLint *params)
   5993 {
   5994    Context *context = GetValidGlobalContext();
   5995    EVENT(context, GLGetMemoryObjectParameterivEXT,
   5996          "context = %d, memoryObject = %u, pname = %s, params = 0x%016" PRIxPTR "", CID(context),
   5997          memoryObject, GLenumToString(GLESEnum::MemoryObjectParameterName, pname),
   5998          (uintptr_t)params);
   5999 
   6000    if (context)
   6001    {
   6002        MemoryObjectID memoryObjectPacked = PackParam<MemoryObjectID>(memoryObject);
   6003        SCOPED_SHARE_CONTEXT_LOCK(context);
   6004        bool isCallValid = (context->skipValidation() ||
   6005                            ValidateGetMemoryObjectParameterivEXT(
   6006                                context, angle::EntryPoint::GLGetMemoryObjectParameterivEXT,
   6007                                memoryObjectPacked, pname, params));
   6008        if (isCallValid)
   6009        {
   6010            context->getMemoryObjectParameteriv(memoryObjectPacked, pname, params);
   6011        }
   6012        ANGLE_CAPTURE_GL(GetMemoryObjectParameterivEXT, isCallValid, context, memoryObjectPacked,
   6013                         pname, params);
   6014    }
   6015    else
   6016    {
   6017        GenerateContextLostErrorOnCurrentGlobalContext();
   6018    }
   6019 }
   6020 
   6021 void GL_APIENTRY GL_GetUnsignedBytevEXT(GLenum pname, GLubyte *data)
   6022 {
   6023    Context *context = GetValidGlobalContext();
   6024    EVENT(context, GLGetUnsignedBytevEXT, "context = %d, pname = %s, data = 0x%016" PRIxPTR "",
   6025          CID(context), GLenumToString(GLESEnum::GetPName, pname), (uintptr_t)data);
   6026 
   6027    if (context)
   6028    {
   6029        SCOPED_SHARE_CONTEXT_LOCK(context);
   6030        bool isCallValid = (context->skipValidation() ||
   6031                            ValidateGetUnsignedBytevEXT(
   6032                                context, angle::EntryPoint::GLGetUnsignedBytevEXT, pname, data));
   6033        if (isCallValid)
   6034        {
   6035            context->getUnsignedBytev(pname, data);
   6036        }
   6037        ANGLE_CAPTURE_GL(GetUnsignedBytevEXT, isCallValid, context, pname, data);
   6038    }
   6039    else
   6040    {
   6041        GenerateContextLostErrorOnCurrentGlobalContext();
   6042    }
   6043 }
   6044 
   6045 void GL_APIENTRY GL_GetUnsignedBytei_vEXT(GLenum target, GLuint index, GLubyte *data)
   6046 {
   6047    Context *context = GetValidGlobalContext();
   6048    EVENT(context, GLGetUnsignedBytei_vEXT,
   6049          "context = %d, target = %s, index = %u, data = 0x%016" PRIxPTR "", CID(context),
   6050          GLenumToString(GLESEnum::AllEnums, target), index, (uintptr_t)data);
   6051 
   6052    if (context)
   6053    {
   6054        SCOPED_SHARE_CONTEXT_LOCK(context);
   6055        bool isCallValid =
   6056            (context->skipValidation() ||
   6057             ValidateGetUnsignedBytei_vEXT(context, angle::EntryPoint::GLGetUnsignedBytei_vEXT,
   6058                                           target, index, data));
   6059        if (isCallValid)
   6060        {
   6061            context->getUnsignedBytei_v(target, index, data);
   6062        }
   6063        ANGLE_CAPTURE_GL(GetUnsignedBytei_vEXT, isCallValid, context, target, index, data);
   6064    }
   6065    else
   6066    {
   6067        GenerateContextLostErrorOnCurrentGlobalContext();
   6068    }
   6069 }
   6070 
   6071 GLboolean GL_APIENTRY GL_IsMemoryObjectEXT(GLuint memoryObject)
   6072 {
   6073    Context *context = GetValidGlobalContext();
   6074    EVENT(context, GLIsMemoryObjectEXT, "context = %d, memoryObject = %u", CID(context),
   6075          memoryObject);
   6076 
   6077    GLboolean returnValue;
   6078    if (context)
   6079    {
   6080        MemoryObjectID memoryObjectPacked = PackParam<MemoryObjectID>(memoryObject);
   6081        SCOPED_SHARE_CONTEXT_LOCK(context);
   6082        bool isCallValid =
   6083            (context->skipValidation() ||
   6084             ValidateIsMemoryObjectEXT(context, angle::EntryPoint::GLIsMemoryObjectEXT,
   6085                                       memoryObjectPacked));
   6086        if (isCallValid)
   6087        {
   6088            returnValue = context->isMemoryObject(memoryObjectPacked);
   6089        }
   6090        else
   6091        {
   6092            returnValue =
   6093                GetDefaultReturnValue<angle::EntryPoint::GLIsMemoryObjectEXT, GLboolean>();
   6094        }
   6095        ANGLE_CAPTURE_GL(IsMemoryObjectEXT, isCallValid, context, memoryObjectPacked, returnValue);
   6096    }
   6097    else
   6098    {
   6099        GenerateContextLostErrorOnCurrentGlobalContext();
   6100        returnValue = GetDefaultReturnValue<angle::EntryPoint::GLIsMemoryObjectEXT, GLboolean>();
   6101    }
   6102    return returnValue;
   6103 }
   6104 
   6105 void GL_APIENTRY GL_MemoryObjectParameterivEXT(GLuint memoryObject,
   6106                                               GLenum pname,
   6107                                               const GLint *params)
   6108 {
   6109    Context *context = GetValidGlobalContext();
   6110    EVENT(context, GLMemoryObjectParameterivEXT,
   6111          "context = %d, memoryObject = %u, pname = %s, params = 0x%016" PRIxPTR "", CID(context),
   6112          memoryObject, GLenumToString(GLESEnum::MemoryObjectParameterName, pname),
   6113          (uintptr_t)params);
   6114 
   6115    if (context)
   6116    {
   6117        MemoryObjectID memoryObjectPacked = PackParam<MemoryObjectID>(memoryObject);
   6118        SCOPED_SHARE_CONTEXT_LOCK(context);
   6119        bool isCallValid = (context->skipValidation() ||
   6120                            ValidateMemoryObjectParameterivEXT(
   6121                                context, angle::EntryPoint::GLMemoryObjectParameterivEXT,
   6122                                memoryObjectPacked, pname, params));
   6123        if (isCallValid)
   6124        {
   6125            context->memoryObjectParameteriv(memoryObjectPacked, pname, params);
   6126        }
   6127        ANGLE_CAPTURE_GL(MemoryObjectParameterivEXT, isCallValid, context, memoryObjectPacked,
   6128                         pname, params);
   6129    }
   6130    else
   6131    {
   6132        GenerateContextLostErrorOnCurrentGlobalContext();
   6133    }
   6134 }
   6135 
   6136 void GL_APIENTRY GL_TexStorageMem2DEXT(GLenum target,
   6137                                       GLsizei levels,
   6138                                       GLenum internalFormat,
   6139                                       GLsizei width,
   6140                                       GLsizei height,
   6141                                       GLuint memory,
   6142                                       GLuint64 offset)
   6143 {
   6144    Context *context = GetValidGlobalContext();
   6145    EVENT(context, GLTexStorageMem2DEXT,
   6146          "context = %d, target = %s, levels = %d, internalFormat = %s, width = %d, height = %d, "
   6147          "memory = %u, offset = %llu",
   6148          CID(context), GLenumToString(GLESEnum::TextureTarget, target), levels,
   6149          GLenumToString(GLESEnum::SizedInternalFormat, internalFormat), width, height, memory,
   6150          static_cast<unsigned long long>(offset));
   6151 
   6152    if (context)
   6153    {
   6154        TextureType targetPacked    = PackParam<TextureType>(target);
   6155        MemoryObjectID memoryPacked = PackParam<MemoryObjectID>(memory);
   6156        SCOPED_SHARE_CONTEXT_LOCK(context);
   6157        bool isCallValid = (context->skipValidation() ||
   6158                            ValidateTexStorageMem2DEXT(
   6159                                context, angle::EntryPoint::GLTexStorageMem2DEXT, targetPacked,
   6160                                levels, internalFormat, width, height, memoryPacked, offset));
   6161        if (isCallValid)
   6162        {
   6163            context->texStorageMem2D(targetPacked, levels, internalFormat, width, height,
   6164                                     memoryPacked, offset);
   6165        }
   6166        ANGLE_CAPTURE_GL(TexStorageMem2DEXT, isCallValid, context, targetPacked, levels,
   6167                         internalFormat, width, height, memoryPacked, offset);
   6168    }
   6169    else
   6170    {
   6171        GenerateContextLostErrorOnCurrentGlobalContext();
   6172    }
   6173 }
   6174 
   6175 void GL_APIENTRY GL_TexStorageMem2DMultisampleEXT(GLenum target,
   6176                                                  GLsizei samples,
   6177                                                  GLenum internalFormat,
   6178                                                  GLsizei width,
   6179                                                  GLsizei height,
   6180                                                  GLboolean fixedSampleLocations,
   6181                                                  GLuint memory,
   6182                                                  GLuint64 offset)
   6183 {
   6184    Context *context = GetValidGlobalContext();
   6185    EVENT(context, GLTexStorageMem2DMultisampleEXT,
   6186          "context = %d, target = %s, samples = %d, internalFormat = %s, width = %d, height = %d, "
   6187          "fixedSampleLocations = %s, memory = %u, offset = %llu",
   6188          CID(context), GLenumToString(GLESEnum::TextureTarget, target), samples,
   6189          GLenumToString(GLESEnum::SizedInternalFormat, internalFormat), width, height,
   6190          GLbooleanToString(fixedSampleLocations), memory, static_cast<unsigned long long>(offset));
   6191 
   6192    if (context)
   6193    {
   6194        TextureType targetPacked    = PackParam<TextureType>(target);
   6195        MemoryObjectID memoryPacked = PackParam<MemoryObjectID>(memory);
   6196        SCOPED_SHARE_CONTEXT_LOCK(context);
   6197        bool isCallValid =
   6198            (context->skipValidation() ||
   6199             ValidateTexStorageMem2DMultisampleEXT(
   6200                 context, angle::EntryPoint::GLTexStorageMem2DMultisampleEXT, targetPacked, samples,
   6201                 internalFormat, width, height, fixedSampleLocations, memoryPacked, offset));
   6202        if (isCallValid)
   6203        {
   6204            context->texStorageMem2DMultisample(targetPacked, samples, internalFormat, width,
   6205                                                height, fixedSampleLocations, memoryPacked, offset);
   6206        }
   6207        ANGLE_CAPTURE_GL(TexStorageMem2DMultisampleEXT, isCallValid, context, targetPacked, samples,
   6208                         internalFormat, width, height, fixedSampleLocations, memoryPacked, offset);
   6209    }
   6210    else
   6211    {
   6212        GenerateContextLostErrorOnCurrentGlobalContext();
   6213    }
   6214 }
   6215 
   6216 void GL_APIENTRY GL_TexStorageMem3DEXT(GLenum target,
   6217                                       GLsizei levels,
   6218                                       GLenum internalFormat,
   6219                                       GLsizei width,
   6220                                       GLsizei height,
   6221                                       GLsizei depth,
   6222                                       GLuint memory,
   6223                                       GLuint64 offset)
   6224 {
   6225    Context *context = GetValidGlobalContext();
   6226    EVENT(context, GLTexStorageMem3DEXT,
   6227          "context = %d, target = %s, levels = %d, internalFormat = %s, width = %d, height = %d, "
   6228          "depth = %d, memory = %u, offset = %llu",
   6229          CID(context), GLenumToString(GLESEnum::TextureTarget, target), levels,
   6230          GLenumToString(GLESEnum::SizedInternalFormat, internalFormat), width, height, depth,
   6231          memory, static_cast<unsigned long long>(offset));
   6232 
   6233    if (context)
   6234    {
   6235        TextureType targetPacked    = PackParam<TextureType>(target);
   6236        MemoryObjectID memoryPacked = PackParam<MemoryObjectID>(memory);
   6237        SCOPED_SHARE_CONTEXT_LOCK(context);
   6238        bool isCallValid =
   6239            (context->skipValidation() ||
   6240             ValidateTexStorageMem3DEXT(context, angle::EntryPoint::GLTexStorageMem3DEXT,
   6241                                        targetPacked, levels, internalFormat, width, height, depth,
   6242                                        memoryPacked, offset));
   6243        if (isCallValid)
   6244        {
   6245            context->texStorageMem3D(targetPacked, levels, internalFormat, width, height, depth,
   6246                                     memoryPacked, offset);
   6247        }
   6248        ANGLE_CAPTURE_GL(TexStorageMem3DEXT, isCallValid, context, targetPacked, levels,
   6249                         internalFormat, width, height, depth, memoryPacked, offset);
   6250    }
   6251    else
   6252    {
   6253        GenerateContextLostErrorOnCurrentGlobalContext();
   6254    }
   6255 }
   6256 
   6257 void GL_APIENTRY GL_TexStorageMem3DMultisampleEXT(GLenum target,
   6258                                                  GLsizei samples,
   6259                                                  GLenum internalFormat,
   6260                                                  GLsizei width,
   6261                                                  GLsizei height,
   6262                                                  GLsizei depth,
   6263                                                  GLboolean fixedSampleLocations,
   6264                                                  GLuint memory,
   6265                                                  GLuint64 offset)
   6266 {
   6267    Context *context = GetValidGlobalContext();
   6268    EVENT(context, GLTexStorageMem3DMultisampleEXT,
   6269          "context = %d, target = %s, samples = %d, internalFormat = %s, width = %d, height = %d, "
   6270          "depth = %d, fixedSampleLocations = %s, memory = %u, offset = %llu",
   6271          CID(context), GLenumToString(GLESEnum::TextureTarget, target), samples,
   6272          GLenumToString(GLESEnum::SizedInternalFormat, internalFormat), width, height, depth,
   6273          GLbooleanToString(fixedSampleLocations), memory, static_cast<unsigned long long>(offset));
   6274 
   6275    if (context)
   6276    {
   6277        TextureType targetPacked    = PackParam<TextureType>(target);
   6278        MemoryObjectID memoryPacked = PackParam<MemoryObjectID>(memory);
   6279        SCOPED_SHARE_CONTEXT_LOCK(context);
   6280        bool isCallValid =
   6281            (context->skipValidation() ||
   6282             ValidateTexStorageMem3DMultisampleEXT(
   6283                 context, angle::EntryPoint::GLTexStorageMem3DMultisampleEXT, targetPacked, samples,
   6284                 internalFormat, width, height, depth, fixedSampleLocations, memoryPacked, offset));
   6285        if (isCallValid)
   6286        {
   6287            context->texStorageMem3DMultisample(targetPacked, samples, internalFormat, width,
   6288                                                height, depth, fixedSampleLocations, memoryPacked,
   6289                                                offset);
   6290        }
   6291        ANGLE_CAPTURE_GL(TexStorageMem3DMultisampleEXT, isCallValid, context, targetPacked, samples,
   6292                         internalFormat, width, height, depth, fixedSampleLocations, memoryPacked,
   6293                         offset);
   6294    }
   6295    else
   6296    {
   6297        GenerateContextLostErrorOnCurrentGlobalContext();
   6298    }
   6299 }
   6300 
   6301 // GL_EXT_memory_object_fd
   6302 void GL_APIENTRY GL_ImportMemoryFdEXT(GLuint memory, GLuint64 size, GLenum handleType, GLint fd)
   6303 {
   6304    Context *context = GetValidGlobalContext();
   6305    EVENT(context, GLImportMemoryFdEXT,
   6306          "context = %d, memory = %u, size = %llu, handleType = %s, fd = %d", CID(context), memory,
   6307          static_cast<unsigned long long>(size),
   6308          GLenumToString(GLESEnum::ExternalHandleType, handleType), fd);
   6309 
   6310    if (context)
   6311    {
   6312        MemoryObjectID memoryPacked = PackParam<MemoryObjectID>(memory);
   6313        HandleType handleTypePacked = PackParam<HandleType>(handleType);
   6314        SCOPED_SHARE_CONTEXT_LOCK(context);
   6315        bool isCallValid =
   6316            (context->skipValidation() ||
   6317             ValidateImportMemoryFdEXT(context, angle::EntryPoint::GLImportMemoryFdEXT,
   6318                                       memoryPacked, size, handleTypePacked, fd));
   6319        if (isCallValid)
   6320        {
   6321            context->importMemoryFd(memoryPacked, size, handleTypePacked, fd);
   6322        }
   6323        ANGLE_CAPTURE_GL(ImportMemoryFdEXT, isCallValid, context, memoryPacked, size,
   6324                         handleTypePacked, fd);
   6325    }
   6326    else
   6327    {
   6328        GenerateContextLostErrorOnCurrentGlobalContext();
   6329    }
   6330 }
   6331 
   6332 // GL_EXT_multi_draw_indirect
   6333 void GL_APIENTRY GL_MultiDrawArraysIndirectEXT(GLenum mode,
   6334                                               const void *indirect,
   6335                                               GLsizei drawcount,
   6336                                               GLsizei stride)
   6337 {
   6338    Context *context = GetValidGlobalContext();
   6339    EVENT(context, GLMultiDrawArraysIndirectEXT,
   6340          "context = %d, mode = %s, indirect = 0x%016" PRIxPTR ", drawcount = %d, stride = %d",
   6341          CID(context), GLenumToString(GLESEnum::PrimitiveType, mode), (uintptr_t)indirect,
   6342          drawcount, stride);
   6343 
   6344    if (context)
   6345    {
   6346        PrimitiveMode modePacked = PackParam<PrimitiveMode>(mode);
   6347        SCOPED_SHARE_CONTEXT_LOCK(context);
   6348        bool isCallValid = (context->skipValidation() ||
   6349                            ValidateMultiDrawArraysIndirectEXT(
   6350                                context, angle::EntryPoint::GLMultiDrawArraysIndirectEXT,
   6351                                modePacked, indirect, drawcount, stride));
   6352        if (isCallValid)
   6353        {
   6354            context->multiDrawArraysIndirect(modePacked, indirect, drawcount, stride);
   6355        }
   6356        ANGLE_CAPTURE_GL(MultiDrawArraysIndirectEXT, isCallValid, context, modePacked, indirect,
   6357                         drawcount, stride);
   6358    }
   6359    else
   6360    {
   6361        GenerateContextLostErrorOnCurrentGlobalContext();
   6362    }
   6363 }
   6364 
   6365 void GL_APIENTRY GL_MultiDrawElementsIndirectEXT(GLenum mode,
   6366                                                 GLenum type,
   6367                                                 const void *indirect,
   6368                                                 GLsizei drawcount,
   6369                                                 GLsizei stride)
   6370 {
   6371    Context *context = GetValidGlobalContext();
   6372    EVENT(context, GLMultiDrawElementsIndirectEXT,
   6373          "context = %d, mode = %s, type = %s, indirect = 0x%016" PRIxPTR
   6374          ", drawcount = %d, stride = %d",
   6375          CID(context), GLenumToString(GLESEnum::PrimitiveType, mode),
   6376          GLenumToString(GLESEnum::DrawElementsType, type), (uintptr_t)indirect, drawcount, stride);
   6377 
   6378    if (context)
   6379    {
   6380        PrimitiveMode modePacked    = PackParam<PrimitiveMode>(mode);
   6381        DrawElementsType typePacked = PackParam<DrawElementsType>(type);
   6382        SCOPED_SHARE_CONTEXT_LOCK(context);
   6383        bool isCallValid = (context->skipValidation() ||
   6384                            ValidateMultiDrawElementsIndirectEXT(
   6385                                context, angle::EntryPoint::GLMultiDrawElementsIndirectEXT,
   6386                                modePacked, typePacked, indirect, drawcount, stride));
   6387        if (isCallValid)
   6388        {
   6389            context->multiDrawElementsIndirect(modePacked, typePacked, indirect, drawcount, stride);
   6390        }
   6391        ANGLE_CAPTURE_GL(MultiDrawElementsIndirectEXT, isCallValid, context, modePacked, typePacked,
   6392                         indirect, drawcount, stride);
   6393    }
   6394    else
   6395    {
   6396        GenerateContextLostErrorOnCurrentGlobalContext();
   6397    }
   6398 }
   6399 
   6400 // GL_EXT_multisampled_render_to_texture
   6401 void GL_APIENTRY GL_FramebufferTexture2DMultisampleEXT(GLenum target,
   6402                                                       GLenum attachment,
   6403                                                       GLenum textarget,
   6404                                                       GLuint texture,
   6405                                                       GLint level,
   6406                                                       GLsizei samples)
   6407 {
   6408    Context *context = GetValidGlobalContext();
   6409    EVENT(context, GLFramebufferTexture2DMultisampleEXT,
   6410          "context = %d, target = %s, attachment = %s, textarget = %s, texture = %u, level = %d, "
   6411          "samples = %d",
   6412          CID(context), GLenumToString(GLESEnum::FramebufferTarget, target),
   6413          GLenumToString(GLESEnum::FramebufferAttachment, attachment),
   6414          GLenumToString(GLESEnum::TextureTarget, textarget), texture, level, samples);
   6415 
   6416    if (context)
   6417    {
   6418        TextureTarget textargetPacked = PackParam<TextureTarget>(textarget);
   6419        TextureID texturePacked       = PackParam<TextureID>(texture);
   6420        SCOPED_SHARE_CONTEXT_LOCK(context);
   6421        bool isCallValid =
   6422            (context->skipValidation() ||
   6423             ValidateFramebufferTexture2DMultisampleEXT(
   6424                 context, angle::EntryPoint::GLFramebufferTexture2DMultisampleEXT, target,
   6425                 attachment, textargetPacked, texturePacked, level, samples));
   6426        if (isCallValid)
   6427        {
   6428            context->framebufferTexture2DMultisample(target, attachment, textargetPacked,
   6429                                                     texturePacked, level, samples);
   6430        }
   6431        ANGLE_CAPTURE_GL(FramebufferTexture2DMultisampleEXT, isCallValid, context, target,
   6432                         attachment, textargetPacked, texturePacked, level, samples);
   6433    }
   6434    else
   6435    {
   6436        GenerateContextLostErrorOnCurrentGlobalContext();
   6437    }
   6438 }
   6439 
   6440 void GL_APIENTRY GL_RenderbufferStorageMultisampleEXT(GLenum target,
   6441                                                      GLsizei samples,
   6442                                                      GLenum internalformat,
   6443                                                      GLsizei width,
   6444                                                      GLsizei height)
   6445 {
   6446    Context *context = GetValidGlobalContext();
   6447    EVENT(context, GLRenderbufferStorageMultisampleEXT,
   6448          "context = %d, target = %s, samples = %d, internalformat = %s, width = %d, height = %d",
   6449          CID(context), GLenumToString(GLESEnum::RenderbufferTarget, target), samples,
   6450          GLenumToString(GLESEnum::InternalFormat, internalformat), width, height);
   6451 
   6452    if (context)
   6453    {
   6454        SCOPED_SHARE_CONTEXT_LOCK(context);
   6455        bool isCallValid = (context->skipValidation() ||
   6456                            ValidateRenderbufferStorageMultisampleEXT(
   6457                                context, angle::EntryPoint::GLRenderbufferStorageMultisampleEXT,
   6458                                target, samples, internalformat, width, height));
   6459        if (isCallValid)
   6460        {
   6461            context->renderbufferStorageMultisampleEXT(target, samples, internalformat, width,
   6462                                                       height);
   6463        }
   6464        ANGLE_CAPTURE_GL(RenderbufferStorageMultisampleEXT, isCallValid, context, target, samples,
   6465                         internalformat, width, height);
   6466    }
   6467    else
   6468    {
   6469        GenerateContextLostErrorOnCurrentGlobalContext();
   6470    }
   6471 }
   6472 
   6473 // GL_EXT_multisampled_render_to_texture2
   6474 
   6475 // GL_EXT_occlusion_query_boolean
   6476 // BeginQueryEXT is already defined.
   6477 
   6478 // DeleteQueriesEXT is already defined.
   6479 
   6480 // EndQueryEXT is already defined.
   6481 
   6482 // GenQueriesEXT is already defined.
   6483 
   6484 // GetQueryObjectuivEXT is already defined.
   6485 
   6486 // GetQueryivEXT is already defined.
   6487 
   6488 // IsQueryEXT is already defined.
   6489 
   6490 // GL_EXT_primitive_bounding_box
   6491 void GL_APIENTRY GL_PrimitiveBoundingBoxEXT(GLfloat minX,
   6492                                            GLfloat minY,
   6493                                            GLfloat minZ,
   6494                                            GLfloat minW,
   6495                                            GLfloat maxX,
   6496                                            GLfloat maxY,
   6497                                            GLfloat maxZ,
   6498                                            GLfloat maxW)
   6499 {
   6500    Context *context = GetValidGlobalContext();
   6501    EVENT(context, GLPrimitiveBoundingBoxEXT,
   6502          "context = %d, minX = %f, minY = %f, minZ = %f, minW = %f, maxX = %f, maxY = %f, maxZ = "
   6503          "%f, maxW = %f",
   6504          CID(context), minX, minY, minZ, minW, maxX, maxY, maxZ, maxW);
   6505 
   6506    if (context)
   6507    {
   6508        SCOPED_SHARE_CONTEXT_LOCK(context);
   6509        bool isCallValid =
   6510            (context->skipValidation() ||
   6511             ValidatePrimitiveBoundingBoxEXT(context, angle::EntryPoint::GLPrimitiveBoundingBoxEXT,
   6512                                             minX, minY, minZ, minW, maxX, maxY, maxZ, maxW));
   6513        if (isCallValid)
   6514        {
   6515            context->primitiveBoundingBox(minX, minY, minZ, minW, maxX, maxY, maxZ, maxW);
   6516        }
   6517        ANGLE_CAPTURE_GL(PrimitiveBoundingBoxEXT, isCallValid, context, minX, minY, minZ, minW,
   6518                         maxX, maxY, maxZ, maxW);
   6519    }
   6520    else
   6521    {
   6522        GenerateContextLostErrorOnCurrentGlobalContext();
   6523    }
   6524 }
   6525 
   6526 // GL_EXT_protected_textures
   6527 
   6528 // GL_EXT_pvrtc_sRGB
   6529 
   6530 // GL_EXT_read_format_bgra
   6531 
   6532 // GL_EXT_robustness
   6533 GLenum GL_APIENTRY GL_GetGraphicsResetStatusEXT()
   6534 {
   6535    Context *context = GetGlobalContext();
   6536    EVENT(context, GLGetGraphicsResetStatusEXT, "context = %d", CID(context));
   6537 
   6538    GLenum returnValue;
   6539    if (context)
   6540    {
   6541        SCOPED_SHARE_CONTEXT_LOCK(context);
   6542        bool isCallValid = (context->skipValidation() ||
   6543                            ValidateGetGraphicsResetStatusEXT(
   6544                                context, angle::EntryPoint::GLGetGraphicsResetStatusEXT));
   6545        if (isCallValid)
   6546        {
   6547            returnValue = context->getGraphicsResetStatus();
   6548        }
   6549        else
   6550        {
   6551            returnValue =
   6552                GetDefaultReturnValue<angle::EntryPoint::GLGetGraphicsResetStatusEXT, GLenum>();
   6553        }
   6554        ANGLE_CAPTURE_GL(GetGraphicsResetStatusEXT, isCallValid, context, returnValue);
   6555    }
   6556    else
   6557    {
   6558 
   6559        returnValue =
   6560            GetDefaultReturnValue<angle::EntryPoint::GLGetGraphicsResetStatusEXT, GLenum>();
   6561    }
   6562    return returnValue;
   6563 }
   6564 
   6565 void GL_APIENTRY GL_GetnUniformfvEXT(GLuint program,
   6566                                     GLint location,
   6567                                     GLsizei bufSize,
   6568                                     GLfloat *params)
   6569 {
   6570    Context *context = GetValidGlobalContext();
   6571    EVENT(context, GLGetnUniformfvEXT,
   6572          "context = %d, program = %u, location = %d, bufSize = %d, params = 0x%016" PRIxPTR "",
   6573          CID(context), program, location, bufSize, (uintptr_t)params);
   6574 
   6575    if (context)
   6576    {
   6577        ShaderProgramID programPacked  = PackParam<ShaderProgramID>(program);
   6578        UniformLocation locationPacked = PackParam<UniformLocation>(location);
   6579        SCOPED_SHARE_CONTEXT_LOCK(context);
   6580        bool isCallValid =
   6581            (context->skipValidation() ||
   6582             ValidateGetnUniformfvEXT(context, angle::EntryPoint::GLGetnUniformfvEXT, programPacked,
   6583                                      locationPacked, bufSize, params));
   6584        if (isCallValid)
   6585        {
   6586            context->getnUniformfv(programPacked, locationPacked, bufSize, params);
   6587        }
   6588        ANGLE_CAPTURE_GL(GetnUniformfvEXT, isCallValid, context, programPacked, locationPacked,
   6589                         bufSize, params);
   6590    }
   6591    else
   6592    {
   6593        GenerateContextLostErrorOnCurrentGlobalContext();
   6594    }
   6595 }
   6596 
   6597 void GL_APIENTRY GL_GetnUniformivEXT(GLuint program, GLint location, GLsizei bufSize, GLint *params)
   6598 {
   6599    Context *context = GetValidGlobalContext();
   6600    EVENT(context, GLGetnUniformivEXT,
   6601          "context = %d, program = %u, location = %d, bufSize = %d, params = 0x%016" PRIxPTR "",
   6602          CID(context), program, location, bufSize, (uintptr_t)params);
   6603 
   6604    if (context)
   6605    {
   6606        ShaderProgramID programPacked  = PackParam<ShaderProgramID>(program);
   6607        UniformLocation locationPacked = PackParam<UniformLocation>(location);
   6608        SCOPED_SHARE_CONTEXT_LOCK(context);
   6609        bool isCallValid =
   6610            (context->skipValidation() ||
   6611             ValidateGetnUniformivEXT(context, angle::EntryPoint::GLGetnUniformivEXT, programPacked,
   6612                                      locationPacked, bufSize, params));
   6613        if (isCallValid)
   6614        {
   6615            context->getnUniformiv(programPacked, locationPacked, bufSize, params);
   6616        }
   6617        ANGLE_CAPTURE_GL(GetnUniformivEXT, isCallValid, context, programPacked, locationPacked,
   6618                         bufSize, params);
   6619    }
   6620    else
   6621    {
   6622        GenerateContextLostErrorOnCurrentGlobalContext();
   6623    }
   6624 }
   6625 
   6626 void GL_APIENTRY GL_ReadnPixelsEXT(GLint x,
   6627                                   GLint y,
   6628                                   GLsizei width,
   6629                                   GLsizei height,
   6630                                   GLenum format,
   6631                                   GLenum type,
   6632                                   GLsizei bufSize,
   6633                                   void *data)
   6634 {
   6635    Context *context = GetValidGlobalContext();
   6636    EVENT(context, GLReadnPixelsEXT,
   6637          "context = %d, x = %d, y = %d, width = %d, height = %d, format = %s, type = %s, bufSize "
   6638          "= %d, data = 0x%016" PRIxPTR "",
   6639          CID(context), x, y, width, height, GLenumToString(GLESEnum::PixelFormat, format),
   6640          GLenumToString(GLESEnum::PixelType, type), bufSize, (uintptr_t)data);
   6641 
   6642    if (context)
   6643    {
   6644        SCOPED_SHARE_CONTEXT_LOCK(context);
   6645        bool isCallValid = (context->skipValidation() ||
   6646                            ValidateReadnPixelsEXT(context, angle::EntryPoint::GLReadnPixelsEXT, x,
   6647                                                   y, width, height, format, type, bufSize, data));
   6648        if (isCallValid)
   6649        {
   6650            context->readnPixels(x, y, width, height, format, type, bufSize, data);
   6651        }
   6652        ANGLE_CAPTURE_GL(ReadnPixelsEXT, isCallValid, context, x, y, width, height, format, type,
   6653                         bufSize, data);
   6654    }
   6655    else
   6656    {
   6657        GenerateContextLostErrorOnCurrentGlobalContext();
   6658    }
   6659 }
   6660 
   6661 // GL_EXT_sRGB
   6662 
   6663 // GL_EXT_sRGB_write_control
   6664 
   6665 // GL_EXT_semaphore
   6666 void GL_APIENTRY GL_DeleteSemaphoresEXT(GLsizei n, const GLuint *semaphores)
   6667 {
   6668    Context *context = GetValidGlobalContext();
   6669    EVENT(context, GLDeleteSemaphoresEXT, "context = %d, n = %d, semaphores = 0x%016" PRIxPTR "",
   6670          CID(context), n, (uintptr_t)semaphores);
   6671 
   6672    if (context)
   6673    {
   6674        const SemaphoreID *semaphoresPacked = PackParam<const SemaphoreID *>(semaphores);
   6675        SCOPED_SHARE_CONTEXT_LOCK(context);
   6676        bool isCallValid =
   6677            (context->skipValidation() ||
   6678             ValidateDeleteSemaphoresEXT(context, angle::EntryPoint::GLDeleteSemaphoresEXT, n,
   6679                                         semaphoresPacked));
   6680        if (isCallValid)
   6681        {
   6682            context->deleteSemaphores(n, semaphoresPacked);
   6683        }
   6684        ANGLE_CAPTURE_GL(DeleteSemaphoresEXT, isCallValid, context, n, semaphoresPacked);
   6685    }
   6686    else
   6687    {
   6688        GenerateContextLostErrorOnCurrentGlobalContext();
   6689    }
   6690 }
   6691 
   6692 void GL_APIENTRY GL_GenSemaphoresEXT(GLsizei n, GLuint *semaphores)
   6693 {
   6694    Context *context = GetValidGlobalContext();
   6695    EVENT(context, GLGenSemaphoresEXT, "context = %d, n = %d, semaphores = 0x%016" PRIxPTR "",
   6696          CID(context), n, (uintptr_t)semaphores);
   6697 
   6698    if (context)
   6699    {
   6700        SemaphoreID *semaphoresPacked = PackParam<SemaphoreID *>(semaphores);
   6701        SCOPED_SHARE_CONTEXT_LOCK(context);
   6702        bool isCallValid = (context->skipValidation() ||
   6703                            ValidateGenSemaphoresEXT(context, angle::EntryPoint::GLGenSemaphoresEXT,
   6704                                                     n, semaphoresPacked));
   6705        if (isCallValid)
   6706        {
   6707            context->genSemaphores(n, semaphoresPacked);
   6708        }
   6709        ANGLE_CAPTURE_GL(GenSemaphoresEXT, isCallValid, context, n, semaphoresPacked);
   6710    }
   6711    else
   6712    {
   6713        GenerateContextLostErrorOnCurrentGlobalContext();
   6714    }
   6715 }
   6716 
   6717 void GL_APIENTRY GL_GetSemaphoreParameterui64vEXT(GLuint semaphore, GLenum pname, GLuint64 *params)
   6718 {
   6719    Context *context = GetValidGlobalContext();
   6720    EVENT(context, GLGetSemaphoreParameterui64vEXT,
   6721          "context = %d, semaphore = %u, pname = %s, params = 0x%016" PRIxPTR "", CID(context),
   6722          semaphore, GLenumToString(GLESEnum::SemaphoreParameterName, pname), (uintptr_t)params);
   6723 
   6724    if (context)
   6725    {
   6726        SemaphoreID semaphorePacked = PackParam<SemaphoreID>(semaphore);
   6727        SCOPED_SHARE_CONTEXT_LOCK(context);
   6728        bool isCallValid = (context->skipValidation() ||
   6729                            ValidateGetSemaphoreParameterui64vEXT(
   6730                                context, angle::EntryPoint::GLGetSemaphoreParameterui64vEXT,
   6731                                semaphorePacked, pname, params));
   6732        if (isCallValid)
   6733        {
   6734            context->getSemaphoreParameterui64v(semaphorePacked, pname, params);
   6735        }
   6736        ANGLE_CAPTURE_GL(GetSemaphoreParameterui64vEXT, isCallValid, context, semaphorePacked,
   6737                         pname, params);
   6738    }
   6739    else
   6740    {
   6741        GenerateContextLostErrorOnCurrentGlobalContext();
   6742    }
   6743 }
   6744 
   6745 GLboolean GL_APIENTRY GL_IsSemaphoreEXT(GLuint semaphore)
   6746 {
   6747    Context *context = GetValidGlobalContext();
   6748    EVENT(context, GLIsSemaphoreEXT, "context = %d, semaphore = %u", CID(context), semaphore);
   6749 
   6750    GLboolean returnValue;
   6751    if (context)
   6752    {
   6753        SemaphoreID semaphorePacked = PackParam<SemaphoreID>(semaphore);
   6754        SCOPED_SHARE_CONTEXT_LOCK(context);
   6755        bool isCallValid =
   6756            (context->skipValidation() ||
   6757             ValidateIsSemaphoreEXT(context, angle::EntryPoint::GLIsSemaphoreEXT, semaphorePacked));
   6758        if (isCallValid)
   6759        {
   6760            returnValue = context->isSemaphore(semaphorePacked);
   6761        }
   6762        else
   6763        {
   6764            returnValue = GetDefaultReturnValue<angle::EntryPoint::GLIsSemaphoreEXT, GLboolean>();
   6765        }
   6766        ANGLE_CAPTURE_GL(IsSemaphoreEXT, isCallValid, context, semaphorePacked, returnValue);
   6767    }
   6768    else
   6769    {
   6770        GenerateContextLostErrorOnCurrentGlobalContext();
   6771        returnValue = GetDefaultReturnValue<angle::EntryPoint::GLIsSemaphoreEXT, GLboolean>();
   6772    }
   6773    return returnValue;
   6774 }
   6775 
   6776 void GL_APIENTRY GL_SemaphoreParameterui64vEXT(GLuint semaphore,
   6777                                               GLenum pname,
   6778                                               const GLuint64 *params)
   6779 {
   6780    Context *context = GetValidGlobalContext();
   6781    EVENT(context, GLSemaphoreParameterui64vEXT,
   6782          "context = %d, semaphore = %u, pname = %s, params = 0x%016" PRIxPTR "", CID(context),
   6783          semaphore, GLenumToString(GLESEnum::SemaphoreParameterName, pname), (uintptr_t)params);
   6784 
   6785    if (context)
   6786    {
   6787        SemaphoreID semaphorePacked = PackParam<SemaphoreID>(semaphore);
   6788        SCOPED_SHARE_CONTEXT_LOCK(context);
   6789        bool isCallValid = (context->skipValidation() ||
   6790                            ValidateSemaphoreParameterui64vEXT(
   6791                                context, angle::EntryPoint::GLSemaphoreParameterui64vEXT,
   6792                                semaphorePacked, pname, params));
   6793        if (isCallValid)
   6794        {
   6795            context->semaphoreParameterui64v(semaphorePacked, pname, params);
   6796        }
   6797        ANGLE_CAPTURE_GL(SemaphoreParameterui64vEXT, isCallValid, context, semaphorePacked, pname,
   6798                         params);
   6799    }
   6800    else
   6801    {
   6802        GenerateContextLostErrorOnCurrentGlobalContext();
   6803    }
   6804 }
   6805 
   6806 void GL_APIENTRY GL_SignalSemaphoreEXT(GLuint semaphore,
   6807                                       GLuint numBufferBarriers,
   6808                                       const GLuint *buffers,
   6809                                       GLuint numTextureBarriers,
   6810                                       const GLuint *textures,
   6811                                       const GLenum *dstLayouts)
   6812 {
   6813    Context *context = GetValidGlobalContext();
   6814    EVENT(context, GLSignalSemaphoreEXT,
   6815          "context = %d, semaphore = %u, numBufferBarriers = %u, buffers = 0x%016" PRIxPTR
   6816          ", numTextureBarriers = %u, textures = 0x%016" PRIxPTR ", dstLayouts = 0x%016" PRIxPTR "",
   6817          CID(context), semaphore, numBufferBarriers, (uintptr_t)buffers, numTextureBarriers,
   6818          (uintptr_t)textures, (uintptr_t)dstLayouts);
   6819 
   6820    if (context)
   6821    {
   6822        SemaphoreID semaphorePacked     = PackParam<SemaphoreID>(semaphore);
   6823        const BufferID *buffersPacked   = PackParam<const BufferID *>(buffers);
   6824        const TextureID *texturesPacked = PackParam<const TextureID *>(textures);
   6825        SCOPED_SHARE_CONTEXT_LOCK(context);
   6826        bool isCallValid =
   6827            (context->skipValidation() ||
   6828             ValidateSignalSemaphoreEXT(context, angle::EntryPoint::GLSignalSemaphoreEXT,
   6829                                        semaphorePacked, numBufferBarriers, buffersPacked,
   6830                                        numTextureBarriers, texturesPacked, dstLayouts));
   6831        if (isCallValid)
   6832        {
   6833            context->signalSemaphore(semaphorePacked, numBufferBarriers, buffersPacked,
   6834                                     numTextureBarriers, texturesPacked, dstLayouts);
   6835        }
   6836        ANGLE_CAPTURE_GL(SignalSemaphoreEXT, isCallValid, context, semaphorePacked,
   6837                         numBufferBarriers, buffersPacked, numTextureBarriers, texturesPacked,
   6838                         dstLayouts);
   6839    }
   6840    else
   6841    {
   6842        GenerateContextLostErrorOnCurrentGlobalContext();
   6843    }
   6844 }
   6845 
   6846 void GL_APIENTRY GL_WaitSemaphoreEXT(GLuint semaphore,
   6847                                     GLuint numBufferBarriers,
   6848                                     const GLuint *buffers,
   6849                                     GLuint numTextureBarriers,
   6850                                     const GLuint *textures,
   6851                                     const GLenum *srcLayouts)
   6852 {
   6853    Context *context = GetValidGlobalContext();
   6854    EVENT(context, GLWaitSemaphoreEXT,
   6855          "context = %d, semaphore = %u, numBufferBarriers = %u, buffers = 0x%016" PRIxPTR
   6856          ", numTextureBarriers = %u, textures = 0x%016" PRIxPTR ", srcLayouts = 0x%016" PRIxPTR "",
   6857          CID(context), semaphore, numBufferBarriers, (uintptr_t)buffers, numTextureBarriers,
   6858          (uintptr_t)textures, (uintptr_t)srcLayouts);
   6859 
   6860    if (context)
   6861    {
   6862        SemaphoreID semaphorePacked     = PackParam<SemaphoreID>(semaphore);
   6863        const BufferID *buffersPacked   = PackParam<const BufferID *>(buffers);
   6864        const TextureID *texturesPacked = PackParam<const TextureID *>(textures);
   6865        SCOPED_SHARE_CONTEXT_LOCK(context);
   6866        bool isCallValid =
   6867            (context->skipValidation() ||
   6868             ValidateWaitSemaphoreEXT(context, angle::EntryPoint::GLWaitSemaphoreEXT,
   6869                                      semaphorePacked, numBufferBarriers, buffersPacked,
   6870                                      numTextureBarriers, texturesPacked, srcLayouts));
   6871        if (isCallValid)
   6872        {
   6873            context->waitSemaphore(semaphorePacked, numBufferBarriers, buffersPacked,
   6874                                   numTextureBarriers, texturesPacked, srcLayouts);
   6875        }
   6876        ANGLE_CAPTURE_GL(WaitSemaphoreEXT, isCallValid, context, semaphorePacked, numBufferBarriers,
   6877                         buffersPacked, numTextureBarriers, texturesPacked, srcLayouts);
   6878    }
   6879    else
   6880    {
   6881        GenerateContextLostErrorOnCurrentGlobalContext();
   6882    }
   6883 }
   6884 
   6885 // GetUnsignedBytei_vEXT is already defined.
   6886 
   6887 // GetUnsignedBytevEXT is already defined.
   6888 
   6889 // GL_EXT_semaphore_fd
   6890 void GL_APIENTRY GL_ImportSemaphoreFdEXT(GLuint semaphore, GLenum handleType, GLint fd)
   6891 {
   6892    Context *context = GetValidGlobalContext();
   6893    EVENT(context, GLImportSemaphoreFdEXT, "context = %d, semaphore = %u, handleType = %s, fd = %d",
   6894          CID(context), semaphore, GLenumToString(GLESEnum::ExternalHandleType, handleType), fd);
   6895 
   6896    if (context)
   6897    {
   6898        SemaphoreID semaphorePacked = PackParam<SemaphoreID>(semaphore);
   6899        HandleType handleTypePacked = PackParam<HandleType>(handleType);
   6900        SCOPED_SHARE_CONTEXT_LOCK(context);
   6901        bool isCallValid =
   6902            (context->skipValidation() ||
   6903             ValidateImportSemaphoreFdEXT(context, angle::EntryPoint::GLImportSemaphoreFdEXT,
   6904                                          semaphorePacked, handleTypePacked, fd));
   6905        if (isCallValid)
   6906        {
   6907            context->importSemaphoreFd(semaphorePacked, handleTypePacked, fd);
   6908        }
   6909        ANGLE_CAPTURE_GL(ImportSemaphoreFdEXT, isCallValid, context, semaphorePacked,
   6910                         handleTypePacked, fd);
   6911    }
   6912    else
   6913    {
   6914        GenerateContextLostErrorOnCurrentGlobalContext();
   6915    }
   6916 }
   6917 
   6918 // GL_EXT_separate_shader_objects
   6919 void GL_APIENTRY GL_ActiveShaderProgramEXT(GLuint pipeline, GLuint program)
   6920 {
   6921    Context *context = GetValidGlobalContext();
   6922    EVENT(context, GLActiveShaderProgramEXT, "context = %d, pipeline = %u, program = %u",
   6923          CID(context), pipeline, program);
   6924 
   6925    if (context)
   6926    {
   6927        ProgramPipelineID pipelinePacked = PackParam<ProgramPipelineID>(pipeline);
   6928        ShaderProgramID programPacked    = PackParam<ShaderProgramID>(program);
   6929        SCOPED_SHARE_CONTEXT_LOCK(context);
   6930        bool isCallValid =
   6931            (context->skipValidation() ||
   6932             ValidateActiveShaderProgramEXT(context, angle::EntryPoint::GLActiveShaderProgramEXT,
   6933                                            pipelinePacked, programPacked));
   6934        if (isCallValid)
   6935        {
   6936            context->activeShaderProgram(pipelinePacked, programPacked);
   6937        }
   6938        ANGLE_CAPTURE_GL(ActiveShaderProgramEXT, isCallValid, context, pipelinePacked,
   6939                         programPacked);
   6940    }
   6941    else
   6942    {
   6943        GenerateContextLostErrorOnCurrentGlobalContext();
   6944    }
   6945 }
   6946 
   6947 void GL_APIENTRY GL_BindProgramPipelineEXT(GLuint pipeline)
   6948 {
   6949    Context *context = GetValidGlobalContext();
   6950    EVENT(context, GLBindProgramPipelineEXT, "context = %d, pipeline = %u", CID(context), pipeline);
   6951 
   6952    if (context)
   6953    {
   6954        ProgramPipelineID pipelinePacked = PackParam<ProgramPipelineID>(pipeline);
   6955        SCOPED_SHARE_CONTEXT_LOCK(context);
   6956        bool isCallValid =
   6957            (context->skipValidation() ||
   6958             ValidateBindProgramPipelineEXT(context, angle::EntryPoint::GLBindProgramPipelineEXT,
   6959                                            pipelinePacked));
   6960        if (isCallValid)
   6961        {
   6962            context->bindProgramPipeline(pipelinePacked);
   6963        }
   6964        ANGLE_CAPTURE_GL(BindProgramPipelineEXT, isCallValid, context, pipelinePacked);
   6965    }
   6966    else
   6967    {
   6968        GenerateContextLostErrorOnCurrentGlobalContext();
   6969    }
   6970 }
   6971 
   6972 GLuint GL_APIENTRY GL_CreateShaderProgramvEXT(GLenum type, GLsizei count, const GLchar **strings)
   6973 {
   6974    Context *context = GetValidGlobalContext();
   6975    EVENT(context, GLCreateShaderProgramvEXT,
   6976          "context = %d, type = %s, count = %d, strings = 0x%016" PRIxPTR "", CID(context),
   6977          GLenumToString(GLESEnum::ShaderType, type), count, (uintptr_t)strings);
   6978 
   6979    GLuint returnValue;
   6980    if (context)
   6981    {
   6982        ShaderType typePacked = PackParam<ShaderType>(type);
   6983        SCOPED_SHARE_CONTEXT_LOCK(context);
   6984        bool isCallValid =
   6985            (context->skipValidation() ||
   6986             ValidateCreateShaderProgramvEXT(context, angle::EntryPoint::GLCreateShaderProgramvEXT,
   6987                                             typePacked, count, strings));
   6988        if (isCallValid)
   6989        {
   6990            returnValue = context->createShaderProgramv(typePacked, count, strings);
   6991        }
   6992        else
   6993        {
   6994            returnValue =
   6995                GetDefaultReturnValue<angle::EntryPoint::GLCreateShaderProgramvEXT, GLuint>();
   6996        }
   6997        ANGLE_CAPTURE_GL(CreateShaderProgramvEXT, isCallValid, context, typePacked, count, strings,
   6998                         returnValue);
   6999    }
   7000    else
   7001    {
   7002        GenerateContextLostErrorOnCurrentGlobalContext();
   7003        returnValue = GetDefaultReturnValue<angle::EntryPoint::GLCreateShaderProgramvEXT, GLuint>();
   7004    }
   7005    return returnValue;
   7006 }
   7007 
   7008 void GL_APIENTRY GL_DeleteProgramPipelinesEXT(GLsizei n, const GLuint *pipelines)
   7009 {
   7010    Context *context = GetValidGlobalContext();
   7011    EVENT(context, GLDeleteProgramPipelinesEXT,
   7012          "context = %d, n = %d, pipelines = 0x%016" PRIxPTR "", CID(context), n,
   7013          (uintptr_t)pipelines);
   7014 
   7015    if (context)
   7016    {
   7017        const ProgramPipelineID *pipelinesPacked = PackParam<const ProgramPipelineID *>(pipelines);
   7018        SCOPED_SHARE_CONTEXT_LOCK(context);
   7019        bool isCallValid =
   7020            (context->skipValidation() ||
   7021             ValidateDeleteProgramPipelinesEXT(
   7022                 context, angle::EntryPoint::GLDeleteProgramPipelinesEXT, n, pipelinesPacked));
   7023        if (isCallValid)
   7024        {
   7025            context->deleteProgramPipelines(n, pipelinesPacked);
   7026        }
   7027        ANGLE_CAPTURE_GL(DeleteProgramPipelinesEXT, isCallValid, context, n, pipelinesPacked);
   7028    }
   7029    else
   7030    {
   7031        GenerateContextLostErrorOnCurrentGlobalContext();
   7032    }
   7033 }
   7034 
   7035 void GL_APIENTRY GL_GenProgramPipelinesEXT(GLsizei n, GLuint *pipelines)
   7036 {
   7037    Context *context = GetValidGlobalContext();
   7038    EVENT(context, GLGenProgramPipelinesEXT, "context = %d, n = %d, pipelines = 0x%016" PRIxPTR "",
   7039          CID(context), n, (uintptr_t)pipelines);
   7040 
   7041    if (context)
   7042    {
   7043        ProgramPipelineID *pipelinesPacked = PackParam<ProgramPipelineID *>(pipelines);
   7044        SCOPED_SHARE_CONTEXT_LOCK(context);
   7045        bool isCallValid =
   7046            (context->skipValidation() ||
   7047             ValidateGenProgramPipelinesEXT(context, angle::EntryPoint::GLGenProgramPipelinesEXT, n,
   7048                                            pipelinesPacked));
   7049        if (isCallValid)
   7050        {
   7051            context->genProgramPipelines(n, pipelinesPacked);
   7052        }
   7053        ANGLE_CAPTURE_GL(GenProgramPipelinesEXT, isCallValid, context, n, pipelinesPacked);
   7054    }
   7055    else
   7056    {
   7057        GenerateContextLostErrorOnCurrentGlobalContext();
   7058    }
   7059 }
   7060 
   7061 void GL_APIENTRY GL_GetProgramPipelineInfoLogEXT(GLuint pipeline,
   7062                                                 GLsizei bufSize,
   7063                                                 GLsizei *length,
   7064                                                 GLchar *infoLog)
   7065 {
   7066    Context *context = GetValidGlobalContext();
   7067    EVENT(context, GLGetProgramPipelineInfoLogEXT,
   7068          "context = %d, pipeline = %u, bufSize = %d, length = 0x%016" PRIxPTR
   7069          ", infoLog = 0x%016" PRIxPTR "",
   7070          CID(context), pipeline, bufSize, (uintptr_t)length, (uintptr_t)infoLog);
   7071 
   7072    if (context)
   7073    {
   7074        ProgramPipelineID pipelinePacked = PackParam<ProgramPipelineID>(pipeline);
   7075        SCOPED_SHARE_CONTEXT_LOCK(context);
   7076        bool isCallValid = (context->skipValidation() ||
   7077                            ValidateGetProgramPipelineInfoLogEXT(
   7078                                context, angle::EntryPoint::GLGetProgramPipelineInfoLogEXT,
   7079                                pipelinePacked, bufSize, length, infoLog));
   7080        if (isCallValid)
   7081        {
   7082            context->getProgramPipelineInfoLog(pipelinePacked, bufSize, length, infoLog);
   7083        }
   7084        ANGLE_CAPTURE_GL(GetProgramPipelineInfoLogEXT, isCallValid, context, pipelinePacked,
   7085                         bufSize, length, infoLog);
   7086    }
   7087    else
   7088    {
   7089        GenerateContextLostErrorOnCurrentGlobalContext();
   7090    }
   7091 }
   7092 
   7093 void GL_APIENTRY GL_GetProgramPipelineivEXT(GLuint pipeline, GLenum pname, GLint *params)
   7094 {
   7095    Context *context = GetValidGlobalContext();
   7096    EVENT(context, GLGetProgramPipelineivEXT,
   7097          "context = %d, pipeline = %u, pname = %s, params = 0x%016" PRIxPTR "", CID(context),
   7098          pipeline, GLenumToString(GLESEnum::PipelineParameterName, pname), (uintptr_t)params);
   7099 
   7100    if (context)
   7101    {
   7102        ProgramPipelineID pipelinePacked = PackParam<ProgramPipelineID>(pipeline);
   7103        SCOPED_SHARE_CONTEXT_LOCK(context);
   7104        bool isCallValid =
   7105            (context->skipValidation() ||
   7106             ValidateGetProgramPipelineivEXT(context, angle::EntryPoint::GLGetProgramPipelineivEXT,
   7107                                             pipelinePacked, pname, params));
   7108        if (isCallValid)
   7109        {
   7110            context->getProgramPipelineiv(pipelinePacked, pname, params);
   7111        }
   7112        ANGLE_CAPTURE_GL(GetProgramPipelineivEXT, isCallValid, context, pipelinePacked, pname,
   7113                         params);
   7114    }
   7115    else
   7116    {
   7117        GenerateContextLostErrorOnCurrentGlobalContext();
   7118    }
   7119 }
   7120 
   7121 GLboolean GL_APIENTRY GL_IsProgramPipelineEXT(GLuint pipeline)
   7122 {
   7123    Context *context = GetValidGlobalContext();
   7124    EVENT(context, GLIsProgramPipelineEXT, "context = %d, pipeline = %u", CID(context), pipeline);
   7125 
   7126    GLboolean returnValue;
   7127    if (context)
   7128    {
   7129        ProgramPipelineID pipelinePacked = PackParam<ProgramPipelineID>(pipeline);
   7130        SCOPED_SHARE_CONTEXT_LOCK(context);
   7131        bool isCallValid =
   7132            (context->skipValidation() ||
   7133             ValidateIsProgramPipelineEXT(context, angle::EntryPoint::GLIsProgramPipelineEXT,
   7134                                          pipelinePacked));
   7135        if (isCallValid)
   7136        {
   7137            returnValue = context->isProgramPipeline(pipelinePacked);
   7138        }
   7139        else
   7140        {
   7141            returnValue =
   7142                GetDefaultReturnValue<angle::EntryPoint::GLIsProgramPipelineEXT, GLboolean>();
   7143        }
   7144        ANGLE_CAPTURE_GL(IsProgramPipelineEXT, isCallValid, context, pipelinePacked, returnValue);
   7145    }
   7146    else
   7147    {
   7148        GenerateContextLostErrorOnCurrentGlobalContext();
   7149        returnValue = GetDefaultReturnValue<angle::EntryPoint::GLIsProgramPipelineEXT, GLboolean>();
   7150    }
   7151    return returnValue;
   7152 }
   7153 
   7154 void GL_APIENTRY GL_ProgramParameteriEXT(GLuint program, GLenum pname, GLint value)
   7155 {
   7156    Context *context = GetValidGlobalContext();
   7157    EVENT(context, GLProgramParameteriEXT, "context = %d, program = %u, pname = %s, value = %d",
   7158          CID(context), program, GLenumToString(GLESEnum::ProgramParameterPName, pname), value);
   7159 
   7160    if (context)
   7161    {
   7162        ShaderProgramID programPacked = PackParam<ShaderProgramID>(program);
   7163        SCOPED_SHARE_CONTEXT_LOCK(context);
   7164        bool isCallValid =
   7165            (context->skipValidation() ||
   7166             ValidateProgramParameteriEXT(context, angle::EntryPoint::GLProgramParameteriEXT,
   7167                                          programPacked, pname, value));
   7168        if (isCallValid)
   7169        {
   7170            context->programParameteri(programPacked, pname, value);
   7171        }
   7172        ANGLE_CAPTURE_GL(ProgramParameteriEXT, isCallValid, context, programPacked, pname, value);
   7173    }
   7174    else
   7175    {
   7176        GenerateContextLostErrorOnCurrentGlobalContext();
   7177    }
   7178 }
   7179 
   7180 void GL_APIENTRY GL_ProgramUniform1fEXT(GLuint program, GLint location, GLfloat v0)
   7181 {
   7182    Context *context = GetValidGlobalContext();
   7183    EVENT(context, GLProgramUniform1fEXT, "context = %d, program = %u, location = %d, v0 = %f",
   7184          CID(context), program, location, v0);
   7185 
   7186    if (context)
   7187    {
   7188        ShaderProgramID programPacked  = PackParam<ShaderProgramID>(program);
   7189        UniformLocation locationPacked = PackParam<UniformLocation>(location);
   7190        SCOPED_SHARE_CONTEXT_LOCK(context);
   7191        bool isCallValid =
   7192            (context->skipValidation() ||
   7193             ValidateProgramUniform1fEXT(context, angle::EntryPoint::GLProgramUniform1fEXT,
   7194                                         programPacked, locationPacked, v0));
   7195        if (isCallValid)
   7196        {
   7197            context->programUniform1f(programPacked, locationPacked, v0);
   7198        }
   7199        ANGLE_CAPTURE_GL(ProgramUniform1fEXT, isCallValid, context, programPacked, locationPacked,
   7200                         v0);
   7201    }
   7202    else
   7203    {
   7204        GenerateContextLostErrorOnCurrentGlobalContext();
   7205    }
   7206 }
   7207 
   7208 void GL_APIENTRY GL_ProgramUniform1fvEXT(GLuint program,
   7209                                         GLint location,
   7210                                         GLsizei count,
   7211                                         const GLfloat *value)
   7212 {
   7213    Context *context = GetValidGlobalContext();
   7214    EVENT(context, GLProgramUniform1fvEXT,
   7215          "context = %d, program = %u, location = %d, count = %d, value = 0x%016" PRIxPTR "",
   7216          CID(context), program, location, count, (uintptr_t)value);
   7217 
   7218    if (context)
   7219    {
   7220        ShaderProgramID programPacked  = PackParam<ShaderProgramID>(program);
   7221        UniformLocation locationPacked = PackParam<UniformLocation>(location);
   7222        SCOPED_SHARE_CONTEXT_LOCK(context);
   7223        bool isCallValid =
   7224            (context->skipValidation() ||
   7225             ValidateProgramUniform1fvEXT(context, angle::EntryPoint::GLProgramUniform1fvEXT,
   7226                                          programPacked, locationPacked, count, value));
   7227        if (isCallValid)
   7228        {
   7229            context->programUniform1fv(programPacked, locationPacked, count, value);
   7230        }
   7231        ANGLE_CAPTURE_GL(ProgramUniform1fvEXT, isCallValid, context, programPacked, locationPacked,
   7232                         count, value);
   7233    }
   7234    else
   7235    {
   7236        GenerateContextLostErrorOnCurrentGlobalContext();
   7237    }
   7238 }
   7239 
   7240 void GL_APIENTRY GL_ProgramUniform1iEXT(GLuint program, GLint location, GLint v0)
   7241 {
   7242    Context *context = GetValidGlobalContext();
   7243    EVENT(context, GLProgramUniform1iEXT, "context = %d, program = %u, location = %d, v0 = %d",
   7244          CID(context), program, location, v0);
   7245 
   7246    if (context)
   7247    {
   7248        ShaderProgramID programPacked  = PackParam<ShaderProgramID>(program);
   7249        UniformLocation locationPacked = PackParam<UniformLocation>(location);
   7250        SCOPED_SHARE_CONTEXT_LOCK(context);
   7251        bool isCallValid =
   7252            (context->skipValidation() ||
   7253             ValidateProgramUniform1iEXT(context, angle::EntryPoint::GLProgramUniform1iEXT,
   7254                                         programPacked, locationPacked, v0));
   7255        if (isCallValid)
   7256        {
   7257            context->programUniform1i(programPacked, locationPacked, v0);
   7258        }
   7259        ANGLE_CAPTURE_GL(ProgramUniform1iEXT, isCallValid, context, programPacked, locationPacked,
   7260                         v0);
   7261    }
   7262    else
   7263    {
   7264        GenerateContextLostErrorOnCurrentGlobalContext();
   7265    }
   7266 }
   7267 
   7268 void GL_APIENTRY GL_ProgramUniform1ivEXT(GLuint program,
   7269                                         GLint location,
   7270                                         GLsizei count,
   7271                                         const GLint *value)
   7272 {
   7273    Context *context = GetValidGlobalContext();
   7274    EVENT(context, GLProgramUniform1ivEXT,
   7275          "context = %d, program = %u, location = %d, count = %d, value = 0x%016" PRIxPTR "",
   7276          CID(context), program, location, count, (uintptr_t)value);
   7277 
   7278    if (context)
   7279    {
   7280        ShaderProgramID programPacked  = PackParam<ShaderProgramID>(program);
   7281        UniformLocation locationPacked = PackParam<UniformLocation>(location);
   7282        SCOPED_SHARE_CONTEXT_LOCK(context);
   7283        bool isCallValid =
   7284            (context->skipValidation() ||
   7285             ValidateProgramUniform1ivEXT(context, angle::EntryPoint::GLProgramUniform1ivEXT,
   7286                                          programPacked, locationPacked, count, value));
   7287        if (isCallValid)
   7288        {
   7289            context->programUniform1iv(programPacked, locationPacked, count, value);
   7290        }
   7291        ANGLE_CAPTURE_GL(ProgramUniform1ivEXT, isCallValid, context, programPacked, locationPacked,
   7292                         count, value);
   7293    }
   7294    else
   7295    {
   7296        GenerateContextLostErrorOnCurrentGlobalContext();
   7297    }
   7298 }
   7299 
   7300 void GL_APIENTRY GL_ProgramUniform1uiEXT(GLuint program, GLint location, GLuint v0)
   7301 {
   7302    Context *context = GetValidGlobalContext();
   7303    EVENT(context, GLProgramUniform1uiEXT, "context = %d, program = %u, location = %d, v0 = %u",
   7304          CID(context), program, location, v0);
   7305 
   7306    if (context)
   7307    {
   7308        ShaderProgramID programPacked  = PackParam<ShaderProgramID>(program);
   7309        UniformLocation locationPacked = PackParam<UniformLocation>(location);
   7310        SCOPED_SHARE_CONTEXT_LOCK(context);
   7311        bool isCallValid =
   7312            (context->skipValidation() ||
   7313             ValidateProgramUniform1uiEXT(context, angle::EntryPoint::GLProgramUniform1uiEXT,
   7314                                          programPacked, locationPacked, v0));
   7315        if (isCallValid)
   7316        {
   7317            context->programUniform1ui(programPacked, locationPacked, v0);
   7318        }
   7319        ANGLE_CAPTURE_GL(ProgramUniform1uiEXT, isCallValid, context, programPacked, locationPacked,
   7320                         v0);
   7321    }
   7322    else
   7323    {
   7324        GenerateContextLostErrorOnCurrentGlobalContext();
   7325    }
   7326 }
   7327 
   7328 void GL_APIENTRY GL_ProgramUniform1uivEXT(GLuint program,
   7329                                          GLint location,
   7330                                          GLsizei count,
   7331                                          const GLuint *value)
   7332 {
   7333    Context *context = GetValidGlobalContext();
   7334    EVENT(context, GLProgramUniform1uivEXT,
   7335          "context = %d, program = %u, location = %d, count = %d, value = 0x%016" PRIxPTR "",
   7336          CID(context), program, location, count, (uintptr_t)value);
   7337 
   7338    if (context)
   7339    {
   7340        ShaderProgramID programPacked  = PackParam<ShaderProgramID>(program);
   7341        UniformLocation locationPacked = PackParam<UniformLocation>(location);
   7342        SCOPED_SHARE_CONTEXT_LOCK(context);
   7343        bool isCallValid =
   7344            (context->skipValidation() ||
   7345             ValidateProgramUniform1uivEXT(context, angle::EntryPoint::GLProgramUniform1uivEXT,
   7346                                           programPacked, locationPacked, count, value));
   7347        if (isCallValid)
   7348        {
   7349            context->programUniform1uiv(programPacked, locationPacked, count, value);
   7350        }
   7351        ANGLE_CAPTURE_GL(ProgramUniform1uivEXT, isCallValid, context, programPacked, locationPacked,
   7352                         count, value);
   7353    }
   7354    else
   7355    {
   7356        GenerateContextLostErrorOnCurrentGlobalContext();
   7357    }
   7358 }
   7359 
   7360 void GL_APIENTRY GL_ProgramUniform2fEXT(GLuint program, GLint location, GLfloat v0, GLfloat v1)
   7361 {
   7362    Context *context = GetValidGlobalContext();
   7363    EVENT(context, GLProgramUniform2fEXT,
   7364          "context = %d, program = %u, location = %d, v0 = %f, v1 = %f", CID(context), program,
   7365          location, v0, v1);
   7366 
   7367    if (context)
   7368    {
   7369        ShaderProgramID programPacked  = PackParam<ShaderProgramID>(program);
   7370        UniformLocation locationPacked = PackParam<UniformLocation>(location);
   7371        SCOPED_SHARE_CONTEXT_LOCK(context);
   7372        bool isCallValid =
   7373            (context->skipValidation() ||
   7374             ValidateProgramUniform2fEXT(context, angle::EntryPoint::GLProgramUniform2fEXT,
   7375                                         programPacked, locationPacked, v0, v1));
   7376        if (isCallValid)
   7377        {
   7378            context->programUniform2f(programPacked, locationPacked, v0, v1);
   7379        }
   7380        ANGLE_CAPTURE_GL(ProgramUniform2fEXT, isCallValid, context, programPacked, locationPacked,
   7381                         v0, v1);
   7382    }
   7383    else
   7384    {
   7385        GenerateContextLostErrorOnCurrentGlobalContext();
   7386    }
   7387 }
   7388 
   7389 void GL_APIENTRY GL_ProgramUniform2fvEXT(GLuint program,
   7390                                         GLint location,
   7391                                         GLsizei count,
   7392                                         const GLfloat *value)
   7393 {
   7394    Context *context = GetValidGlobalContext();
   7395    EVENT(context, GLProgramUniform2fvEXT,
   7396          "context = %d, program = %u, location = %d, count = %d, value = 0x%016" PRIxPTR "",
   7397          CID(context), program, location, count, (uintptr_t)value);
   7398 
   7399    if (context)
   7400    {
   7401        ShaderProgramID programPacked  = PackParam<ShaderProgramID>(program);
   7402        UniformLocation locationPacked = PackParam<UniformLocation>(location);
   7403        SCOPED_SHARE_CONTEXT_LOCK(context);
   7404        bool isCallValid =
   7405            (context->skipValidation() ||
   7406             ValidateProgramUniform2fvEXT(context, angle::EntryPoint::GLProgramUniform2fvEXT,
   7407                                          programPacked, locationPacked, count, value));
   7408        if (isCallValid)
   7409        {
   7410            context->programUniform2fv(programPacked, locationPacked, count, value);
   7411        }
   7412        ANGLE_CAPTURE_GL(ProgramUniform2fvEXT, isCallValid, context, programPacked, locationPacked,
   7413                         count, value);
   7414    }
   7415    else
   7416    {
   7417        GenerateContextLostErrorOnCurrentGlobalContext();
   7418    }
   7419 }
   7420 
   7421 void GL_APIENTRY GL_ProgramUniform2iEXT(GLuint program, GLint location, GLint v0, GLint v1)
   7422 {
   7423    Context *context = GetValidGlobalContext();
   7424    EVENT(context, GLProgramUniform2iEXT,
   7425          "context = %d, program = %u, location = %d, v0 = %d, v1 = %d", CID(context), program,
   7426          location, v0, v1);
   7427 
   7428    if (context)
   7429    {
   7430        ShaderProgramID programPacked  = PackParam<ShaderProgramID>(program);
   7431        UniformLocation locationPacked = PackParam<UniformLocation>(location);
   7432        SCOPED_SHARE_CONTEXT_LOCK(context);
   7433        bool isCallValid =
   7434            (context->skipValidation() ||
   7435             ValidateProgramUniform2iEXT(context, angle::EntryPoint::GLProgramUniform2iEXT,
   7436                                         programPacked, locationPacked, v0, v1));
   7437        if (isCallValid)
   7438        {
   7439            context->programUniform2i(programPacked, locationPacked, v0, v1);
   7440        }
   7441        ANGLE_CAPTURE_GL(ProgramUniform2iEXT, isCallValid, context, programPacked, locationPacked,
   7442                         v0, v1);
   7443    }
   7444    else
   7445    {
   7446        GenerateContextLostErrorOnCurrentGlobalContext();
   7447    }
   7448 }
   7449 
   7450 void GL_APIENTRY GL_ProgramUniform2ivEXT(GLuint program,
   7451                                         GLint location,
   7452                                         GLsizei count,
   7453                                         const GLint *value)
   7454 {
   7455    Context *context = GetValidGlobalContext();
   7456    EVENT(context, GLProgramUniform2ivEXT,
   7457          "context = %d, program = %u, location = %d, count = %d, value = 0x%016" PRIxPTR "",
   7458          CID(context), program, location, count, (uintptr_t)value);
   7459 
   7460    if (context)
   7461    {
   7462        ShaderProgramID programPacked  = PackParam<ShaderProgramID>(program);
   7463        UniformLocation locationPacked = PackParam<UniformLocation>(location);
   7464        SCOPED_SHARE_CONTEXT_LOCK(context);
   7465        bool isCallValid =
   7466            (context->skipValidation() ||
   7467             ValidateProgramUniform2ivEXT(context, angle::EntryPoint::GLProgramUniform2ivEXT,
   7468                                          programPacked, locationPacked, count, value));
   7469        if (isCallValid)
   7470        {
   7471            context->programUniform2iv(programPacked, locationPacked, count, value);
   7472        }
   7473        ANGLE_CAPTURE_GL(ProgramUniform2ivEXT, isCallValid, context, programPacked, locationPacked,
   7474                         count, value);
   7475    }
   7476    else
   7477    {
   7478        GenerateContextLostErrorOnCurrentGlobalContext();
   7479    }
   7480 }
   7481 
   7482 void GL_APIENTRY GL_ProgramUniform2uiEXT(GLuint program, GLint location, GLuint v0, GLuint v1)
   7483 {
   7484    Context *context = GetValidGlobalContext();
   7485    EVENT(context, GLProgramUniform2uiEXT,
   7486          "context = %d, program = %u, location = %d, v0 = %u, v1 = %u", CID(context), program,
   7487          location, v0, v1);
   7488 
   7489    if (context)
   7490    {
   7491        ShaderProgramID programPacked  = PackParam<ShaderProgramID>(program);
   7492        UniformLocation locationPacked = PackParam<UniformLocation>(location);
   7493        SCOPED_SHARE_CONTEXT_LOCK(context);
   7494        bool isCallValid =
   7495            (context->skipValidation() ||
   7496             ValidateProgramUniform2uiEXT(context, angle::EntryPoint::GLProgramUniform2uiEXT,
   7497                                          programPacked, locationPacked, v0, v1));
   7498        if (isCallValid)
   7499        {
   7500            context->programUniform2ui(programPacked, locationPacked, v0, v1);
   7501        }
   7502        ANGLE_CAPTURE_GL(ProgramUniform2uiEXT, isCallValid, context, programPacked, locationPacked,
   7503                         v0, v1);
   7504    }
   7505    else
   7506    {
   7507        GenerateContextLostErrorOnCurrentGlobalContext();
   7508    }
   7509 }
   7510 
   7511 void GL_APIENTRY GL_ProgramUniform2uivEXT(GLuint program,
   7512                                          GLint location,
   7513                                          GLsizei count,
   7514                                          const GLuint *value)
   7515 {
   7516    Context *context = GetValidGlobalContext();
   7517    EVENT(context, GLProgramUniform2uivEXT,
   7518          "context = %d, program = %u, location = %d, count = %d, value = 0x%016" PRIxPTR "",
   7519          CID(context), program, location, count, (uintptr_t)value);
   7520 
   7521    if (context)
   7522    {
   7523        ShaderProgramID programPacked  = PackParam<ShaderProgramID>(program);
   7524        UniformLocation locationPacked = PackParam<UniformLocation>(location);
   7525        SCOPED_SHARE_CONTEXT_LOCK(context);
   7526        bool isCallValid =
   7527            (context->skipValidation() ||
   7528             ValidateProgramUniform2uivEXT(context, angle::EntryPoint::GLProgramUniform2uivEXT,
   7529                                           programPacked, locationPacked, count, value));
   7530        if (isCallValid)
   7531        {
   7532            context->programUniform2uiv(programPacked, locationPacked, count, value);
   7533        }
   7534        ANGLE_CAPTURE_GL(ProgramUniform2uivEXT, isCallValid, context, programPacked, locationPacked,
   7535                         count, value);
   7536    }
   7537    else
   7538    {
   7539        GenerateContextLostErrorOnCurrentGlobalContext();
   7540    }
   7541 }
   7542 
   7543 void GL_APIENTRY
   7544 GL_ProgramUniform3fEXT(GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2)
   7545 {
   7546    Context *context = GetValidGlobalContext();
   7547    EVENT(context, GLProgramUniform3fEXT,
   7548          "context = %d, program = %u, location = %d, v0 = %f, v1 = %f, v2 = %f", CID(context),
   7549          program, location, v0, v1, v2);
   7550 
   7551    if (context)
   7552    {
   7553        ShaderProgramID programPacked  = PackParam<ShaderProgramID>(program);
   7554        UniformLocation locationPacked = PackParam<UniformLocation>(location);
   7555        SCOPED_SHARE_CONTEXT_LOCK(context);
   7556        bool isCallValid =
   7557            (context->skipValidation() ||
   7558             ValidateProgramUniform3fEXT(context, angle::EntryPoint::GLProgramUniform3fEXT,
   7559                                         programPacked, locationPacked, v0, v1, v2));
   7560        if (isCallValid)
   7561        {
   7562            context->programUniform3f(programPacked, locationPacked, v0, v1, v2);
   7563        }
   7564        ANGLE_CAPTURE_GL(ProgramUniform3fEXT, isCallValid, context, programPacked, locationPacked,
   7565                         v0, v1, v2);
   7566    }
   7567    else
   7568    {
   7569        GenerateContextLostErrorOnCurrentGlobalContext();
   7570    }
   7571 }
   7572 
   7573 void GL_APIENTRY GL_ProgramUniform3fvEXT(GLuint program,
   7574                                         GLint location,
   7575                                         GLsizei count,
   7576                                         const GLfloat *value)
   7577 {
   7578    Context *context = GetValidGlobalContext();
   7579    EVENT(context, GLProgramUniform3fvEXT,
   7580          "context = %d, program = %u, location = %d, count = %d, value = 0x%016" PRIxPTR "",
   7581          CID(context), program, location, count, (uintptr_t)value);
   7582 
   7583    if (context)
   7584    {
   7585        ShaderProgramID programPacked  = PackParam<ShaderProgramID>(program);
   7586        UniformLocation locationPacked = PackParam<UniformLocation>(location);
   7587        SCOPED_SHARE_CONTEXT_LOCK(context);
   7588        bool isCallValid =
   7589            (context->skipValidation() ||
   7590             ValidateProgramUniform3fvEXT(context, angle::EntryPoint::GLProgramUniform3fvEXT,
   7591                                          programPacked, locationPacked, count, value));
   7592        if (isCallValid)
   7593        {
   7594            context->programUniform3fv(programPacked, locationPacked, count, value);
   7595        }
   7596        ANGLE_CAPTURE_GL(ProgramUniform3fvEXT, isCallValid, context, programPacked, locationPacked,
   7597                         count, value);
   7598    }
   7599    else
   7600    {
   7601        GenerateContextLostErrorOnCurrentGlobalContext();
   7602    }
   7603 }
   7604 
   7605 void GL_APIENTRY
   7606 GL_ProgramUniform3iEXT(GLuint program, GLint location, GLint v0, GLint v1, GLint v2)
   7607 {
   7608    Context *context = GetValidGlobalContext();
   7609    EVENT(context, GLProgramUniform3iEXT,
   7610          "context = %d, program = %u, location = %d, v0 = %d, v1 = %d, v2 = %d", CID(context),
   7611          program, location, v0, v1, v2);
   7612 
   7613    if (context)
   7614    {
   7615        ShaderProgramID programPacked  = PackParam<ShaderProgramID>(program);
   7616        UniformLocation locationPacked = PackParam<UniformLocation>(location);
   7617        SCOPED_SHARE_CONTEXT_LOCK(context);
   7618        bool isCallValid =
   7619            (context->skipValidation() ||
   7620             ValidateProgramUniform3iEXT(context, angle::EntryPoint::GLProgramUniform3iEXT,
   7621                                         programPacked, locationPacked, v0, v1, v2));
   7622        if (isCallValid)
   7623        {
   7624            context->programUniform3i(programPacked, locationPacked, v0, v1, v2);
   7625        }
   7626        ANGLE_CAPTURE_GL(ProgramUniform3iEXT, isCallValid, context, programPacked, locationPacked,
   7627                         v0, v1, v2);
   7628    }
   7629    else
   7630    {
   7631        GenerateContextLostErrorOnCurrentGlobalContext();
   7632    }
   7633 }
   7634 
   7635 void GL_APIENTRY GL_ProgramUniform3ivEXT(GLuint program,
   7636                                         GLint location,
   7637                                         GLsizei count,
   7638                                         const GLint *value)
   7639 {
   7640    Context *context = GetValidGlobalContext();
   7641    EVENT(context, GLProgramUniform3ivEXT,
   7642          "context = %d, program = %u, location = %d, count = %d, value = 0x%016" PRIxPTR "",
   7643          CID(context), program, location, count, (uintptr_t)value);
   7644 
   7645    if (context)
   7646    {
   7647        ShaderProgramID programPacked  = PackParam<ShaderProgramID>(program);
   7648        UniformLocation locationPacked = PackParam<UniformLocation>(location);
   7649        SCOPED_SHARE_CONTEXT_LOCK(context);
   7650        bool isCallValid =
   7651            (context->skipValidation() ||
   7652             ValidateProgramUniform3ivEXT(context, angle::EntryPoint::GLProgramUniform3ivEXT,
   7653                                          programPacked, locationPacked, count, value));
   7654        if (isCallValid)
   7655        {
   7656            context->programUniform3iv(programPacked, locationPacked, count, value);
   7657        }
   7658        ANGLE_CAPTURE_GL(ProgramUniform3ivEXT, isCallValid, context, programPacked, locationPacked,
   7659                         count, value);
   7660    }
   7661    else
   7662    {
   7663        GenerateContextLostErrorOnCurrentGlobalContext();
   7664    }
   7665 }
   7666 
   7667 void GL_APIENTRY
   7668 GL_ProgramUniform3uiEXT(GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2)
   7669 {
   7670    Context *context = GetValidGlobalContext();
   7671    EVENT(context, GLProgramUniform3uiEXT,
   7672          "context = %d, program = %u, location = %d, v0 = %u, v1 = %u, v2 = %u", CID(context),
   7673          program, location, v0, v1, v2);
   7674 
   7675    if (context)
   7676    {
   7677        ShaderProgramID programPacked  = PackParam<ShaderProgramID>(program);
   7678        UniformLocation locationPacked = PackParam<UniformLocation>(location);
   7679        SCOPED_SHARE_CONTEXT_LOCK(context);
   7680        bool isCallValid =
   7681            (context->skipValidation() ||
   7682             ValidateProgramUniform3uiEXT(context, angle::EntryPoint::GLProgramUniform3uiEXT,
   7683                                          programPacked, locationPacked, v0, v1, v2));
   7684        if (isCallValid)
   7685        {
   7686            context->programUniform3ui(programPacked, locationPacked, v0, v1, v2);
   7687        }
   7688        ANGLE_CAPTURE_GL(ProgramUniform3uiEXT, isCallValid, context, programPacked, locationPacked,
   7689                         v0, v1, v2);
   7690    }
   7691    else
   7692    {
   7693        GenerateContextLostErrorOnCurrentGlobalContext();
   7694    }
   7695 }
   7696 
   7697 void GL_APIENTRY GL_ProgramUniform3uivEXT(GLuint program,
   7698                                          GLint location,
   7699                                          GLsizei count,
   7700                                          const GLuint *value)
   7701 {
   7702    Context *context = GetValidGlobalContext();
   7703    EVENT(context, GLProgramUniform3uivEXT,
   7704          "context = %d, program = %u, location = %d, count = %d, value = 0x%016" PRIxPTR "",
   7705          CID(context), program, location, count, (uintptr_t)value);
   7706 
   7707    if (context)
   7708    {
   7709        ShaderProgramID programPacked  = PackParam<ShaderProgramID>(program);
   7710        UniformLocation locationPacked = PackParam<UniformLocation>(location);
   7711        SCOPED_SHARE_CONTEXT_LOCK(context);
   7712        bool isCallValid =
   7713            (context->skipValidation() ||
   7714             ValidateProgramUniform3uivEXT(context, angle::EntryPoint::GLProgramUniform3uivEXT,
   7715                                           programPacked, locationPacked, count, value));
   7716        if (isCallValid)
   7717        {
   7718            context->programUniform3uiv(programPacked, locationPacked, count, value);
   7719        }
   7720        ANGLE_CAPTURE_GL(ProgramUniform3uivEXT, isCallValid, context, programPacked, locationPacked,
   7721                         count, value);
   7722    }
   7723    else
   7724    {
   7725        GenerateContextLostErrorOnCurrentGlobalContext();
   7726    }
   7727 }
   7728 
   7729 void GL_APIENTRY GL_ProgramUniform4fEXT(GLuint program,
   7730                                        GLint location,
   7731                                        GLfloat v0,
   7732                                        GLfloat v1,
   7733                                        GLfloat v2,
   7734                                        GLfloat v3)
   7735 {
   7736    Context *context = GetValidGlobalContext();
   7737    EVENT(context, GLProgramUniform4fEXT,
   7738          "context = %d, program = %u, location = %d, v0 = %f, v1 = %f, v2 = %f, v3 = %f",
   7739          CID(context), program, location, v0, v1, v2, v3);
   7740 
   7741    if (context)
   7742    {
   7743        ShaderProgramID programPacked  = PackParam<ShaderProgramID>(program);
   7744        UniformLocation locationPacked = PackParam<UniformLocation>(location);
   7745        SCOPED_SHARE_CONTEXT_LOCK(context);
   7746        bool isCallValid =
   7747            (context->skipValidation() ||
   7748             ValidateProgramUniform4fEXT(context, angle::EntryPoint::GLProgramUniform4fEXT,
   7749                                         programPacked, locationPacked, v0, v1, v2, v3));
   7750        if (isCallValid)
   7751        {
   7752            context->programUniform4f(programPacked, locationPacked, v0, v1, v2, v3);
   7753        }
   7754        ANGLE_CAPTURE_GL(ProgramUniform4fEXT, isCallValid, context, programPacked, locationPacked,
   7755                         v0, v1, v2, v3);
   7756    }
   7757    else
   7758    {
   7759        GenerateContextLostErrorOnCurrentGlobalContext();
   7760    }
   7761 }
   7762 
   7763 void GL_APIENTRY GL_ProgramUniform4fvEXT(GLuint program,
   7764                                         GLint location,
   7765                                         GLsizei count,
   7766                                         const GLfloat *value)
   7767 {
   7768    Context *context = GetValidGlobalContext();
   7769    EVENT(context, GLProgramUniform4fvEXT,
   7770          "context = %d, program = %u, location = %d, count = %d, value = 0x%016" PRIxPTR "",
   7771          CID(context), program, location, count, (uintptr_t)value);
   7772 
   7773    if (context)
   7774    {
   7775        ShaderProgramID programPacked  = PackParam<ShaderProgramID>(program);
   7776        UniformLocation locationPacked = PackParam<UniformLocation>(location);
   7777        SCOPED_SHARE_CONTEXT_LOCK(context);
   7778        bool isCallValid =
   7779            (context->skipValidation() ||
   7780             ValidateProgramUniform4fvEXT(context, angle::EntryPoint::GLProgramUniform4fvEXT,
   7781                                          programPacked, locationPacked, count, value));
   7782        if (isCallValid)
   7783        {
   7784            context->programUniform4fv(programPacked, locationPacked, count, value);
   7785        }
   7786        ANGLE_CAPTURE_GL(ProgramUniform4fvEXT, isCallValid, context, programPacked, locationPacked,
   7787                         count, value);
   7788    }
   7789    else
   7790    {
   7791        GenerateContextLostErrorOnCurrentGlobalContext();
   7792    }
   7793 }
   7794 
   7795 void GL_APIENTRY
   7796 GL_ProgramUniform4iEXT(GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3)
   7797 {
   7798    Context *context = GetValidGlobalContext();
   7799    EVENT(context, GLProgramUniform4iEXT,
   7800          "context = %d, program = %u, location = %d, v0 = %d, v1 = %d, v2 = %d, v3 = %d",
   7801          CID(context), program, location, v0, v1, v2, v3);
   7802 
   7803    if (context)
   7804    {
   7805        ShaderProgramID programPacked  = PackParam<ShaderProgramID>(program);
   7806        UniformLocation locationPacked = PackParam<UniformLocation>(location);
   7807        SCOPED_SHARE_CONTEXT_LOCK(context);
   7808        bool isCallValid =
   7809            (context->skipValidation() ||
   7810             ValidateProgramUniform4iEXT(context, angle::EntryPoint::GLProgramUniform4iEXT,
   7811                                         programPacked, locationPacked, v0, v1, v2, v3));
   7812        if (isCallValid)
   7813        {
   7814            context->programUniform4i(programPacked, locationPacked, v0, v1, v2, v3);
   7815        }
   7816        ANGLE_CAPTURE_GL(ProgramUniform4iEXT, isCallValid, context, programPacked, locationPacked,
   7817                         v0, v1, v2, v3);
   7818    }
   7819    else
   7820    {
   7821        GenerateContextLostErrorOnCurrentGlobalContext();
   7822    }
   7823 }
   7824 
   7825 void GL_APIENTRY GL_ProgramUniform4ivEXT(GLuint program,
   7826                                         GLint location,
   7827                                         GLsizei count,
   7828                                         const GLint *value)
   7829 {
   7830    Context *context = GetValidGlobalContext();
   7831    EVENT(context, GLProgramUniform4ivEXT,
   7832          "context = %d, program = %u, location = %d, count = %d, value = 0x%016" PRIxPTR "",
   7833          CID(context), program, location, count, (uintptr_t)value);
   7834 
   7835    if (context)
   7836    {
   7837        ShaderProgramID programPacked  = PackParam<ShaderProgramID>(program);
   7838        UniformLocation locationPacked = PackParam<UniformLocation>(location);
   7839        SCOPED_SHARE_CONTEXT_LOCK(context);
   7840        bool isCallValid =
   7841            (context->skipValidation() ||
   7842             ValidateProgramUniform4ivEXT(context, angle::EntryPoint::GLProgramUniform4ivEXT,
   7843                                          programPacked, locationPacked, count, value));
   7844        if (isCallValid)
   7845        {
   7846            context->programUniform4iv(programPacked, locationPacked, count, value);
   7847        }
   7848        ANGLE_CAPTURE_GL(ProgramUniform4ivEXT, isCallValid, context, programPacked, locationPacked,
   7849                         count, value);
   7850    }
   7851    else
   7852    {
   7853        GenerateContextLostErrorOnCurrentGlobalContext();
   7854    }
   7855 }
   7856 
   7857 void GL_APIENTRY
   7858 GL_ProgramUniform4uiEXT(GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3)
   7859 {
   7860    Context *context = GetValidGlobalContext();
   7861    EVENT(context, GLProgramUniform4uiEXT,
   7862          "context = %d, program = %u, location = %d, v0 = %u, v1 = %u, v2 = %u, v3 = %u",
   7863          CID(context), program, location, v0, v1, v2, v3);
   7864 
   7865    if (context)
   7866    {
   7867        ShaderProgramID programPacked  = PackParam<ShaderProgramID>(program);
   7868        UniformLocation locationPacked = PackParam<UniformLocation>(location);
   7869        SCOPED_SHARE_CONTEXT_LOCK(context);
   7870        bool isCallValid =
   7871            (context->skipValidation() ||
   7872             ValidateProgramUniform4uiEXT(context, angle::EntryPoint::GLProgramUniform4uiEXT,
   7873                                          programPacked, locationPacked, v0, v1, v2, v3));
   7874        if (isCallValid)
   7875        {
   7876            context->programUniform4ui(programPacked, locationPacked, v0, v1, v2, v3);
   7877        }
   7878        ANGLE_CAPTURE_GL(ProgramUniform4uiEXT, isCallValid, context, programPacked, locationPacked,
   7879                         v0, v1, v2, v3);
   7880    }
   7881    else
   7882    {
   7883        GenerateContextLostErrorOnCurrentGlobalContext();
   7884    }
   7885 }
   7886 
   7887 void GL_APIENTRY GL_ProgramUniform4uivEXT(GLuint program,
   7888                                          GLint location,
   7889                                          GLsizei count,
   7890                                          const GLuint *value)
   7891 {
   7892    Context *context = GetValidGlobalContext();
   7893    EVENT(context, GLProgramUniform4uivEXT,
   7894          "context = %d, program = %u, location = %d, count = %d, value = 0x%016" PRIxPTR "",
   7895          CID(context), program, location, count, (uintptr_t)value);
   7896 
   7897    if (context)
   7898    {
   7899        ShaderProgramID programPacked  = PackParam<ShaderProgramID>(program);
   7900        UniformLocation locationPacked = PackParam<UniformLocation>(location);
   7901        SCOPED_SHARE_CONTEXT_LOCK(context);
   7902        bool isCallValid =
   7903            (context->skipValidation() ||
   7904             ValidateProgramUniform4uivEXT(context, angle::EntryPoint::GLProgramUniform4uivEXT,
   7905                                           programPacked, locationPacked, count, value));
   7906        if (isCallValid)
   7907        {
   7908            context->programUniform4uiv(programPacked, locationPacked, count, value);
   7909        }
   7910        ANGLE_CAPTURE_GL(ProgramUniform4uivEXT, isCallValid, context, programPacked, locationPacked,
   7911                         count, value);
   7912    }
   7913    else
   7914    {
   7915        GenerateContextLostErrorOnCurrentGlobalContext();
   7916    }
   7917 }
   7918 
   7919 void GL_APIENTRY GL_ProgramUniformMatrix2fvEXT(GLuint program,
   7920                                               GLint location,
   7921                                               GLsizei count,
   7922                                               GLboolean transpose,
   7923                                               const GLfloat *value)
   7924 {
   7925    Context *context = GetValidGlobalContext();
   7926    EVENT(context, GLProgramUniformMatrix2fvEXT,
   7927          "context = %d, program = %u, location = %d, count = %d, transpose = %s, value = "
   7928          "0x%016" PRIxPTR "",
   7929          CID(context), program, location, count, GLbooleanToString(transpose), (uintptr_t)value);
   7930 
   7931    if (context)
   7932    {
   7933        ShaderProgramID programPacked  = PackParam<ShaderProgramID>(program);
   7934        UniformLocation locationPacked = PackParam<UniformLocation>(location);
   7935        SCOPED_SHARE_CONTEXT_LOCK(context);
   7936        bool isCallValid = (context->skipValidation() ||
   7937                            ValidateProgramUniformMatrix2fvEXT(
   7938                                context, angle::EntryPoint::GLProgramUniformMatrix2fvEXT,
   7939                                programPacked, locationPacked, count, transpose, value));
   7940        if (isCallValid)
   7941        {
   7942            context->programUniformMatrix2fv(programPacked, locationPacked, count, transpose,
   7943                                             value);
   7944        }
   7945        ANGLE_CAPTURE_GL(ProgramUniformMatrix2fvEXT, isCallValid, context, programPacked,
   7946                         locationPacked, count, transpose, value);
   7947    }
   7948    else
   7949    {
   7950        GenerateContextLostErrorOnCurrentGlobalContext();
   7951    }
   7952 }
   7953 
   7954 void GL_APIENTRY GL_ProgramUniformMatrix2x3fvEXT(GLuint program,
   7955                                                 GLint location,
   7956                                                 GLsizei count,
   7957                                                 GLboolean transpose,
   7958                                                 const GLfloat *value)
   7959 {
   7960    Context *context = GetValidGlobalContext();
   7961    EVENT(context, GLProgramUniformMatrix2x3fvEXT,
   7962          "context = %d, program = %u, location = %d, count = %d, transpose = %s, value = "
   7963          "0x%016" PRIxPTR "",
   7964          CID(context), program, location, count, GLbooleanToString(transpose), (uintptr_t)value);
   7965 
   7966    if (context)
   7967    {
   7968        ShaderProgramID programPacked  = PackParam<ShaderProgramID>(program);
   7969        UniformLocation locationPacked = PackParam<UniformLocation>(location);
   7970        SCOPED_SHARE_CONTEXT_LOCK(context);
   7971        bool isCallValid = (context->skipValidation() ||
   7972                            ValidateProgramUniformMatrix2x3fvEXT(
   7973                                context, angle::EntryPoint::GLProgramUniformMatrix2x3fvEXT,
   7974                                programPacked, locationPacked, count, transpose, value));
   7975        if (isCallValid)
   7976        {
   7977            context->programUniformMatrix2x3fv(programPacked, locationPacked, count, transpose,
   7978                                               value);
   7979        }
   7980        ANGLE_CAPTURE_GL(ProgramUniformMatrix2x3fvEXT, isCallValid, context, programPacked,
   7981                         locationPacked, count, transpose, value);
   7982    }
   7983    else
   7984    {
   7985        GenerateContextLostErrorOnCurrentGlobalContext();
   7986    }
   7987 }
   7988 
   7989 void GL_APIENTRY GL_ProgramUniformMatrix2x4fvEXT(GLuint program,
   7990                                                 GLint location,
   7991                                                 GLsizei count,
   7992                                                 GLboolean transpose,
   7993                                                 const GLfloat *value)
   7994 {
   7995    Context *context = GetValidGlobalContext();
   7996    EVENT(context, GLProgramUniformMatrix2x4fvEXT,
   7997          "context = %d, program = %u, location = %d, count = %d, transpose = %s, value = "
   7998          "0x%016" PRIxPTR "",
   7999          CID(context), program, location, count, GLbooleanToString(transpose), (uintptr_t)value);
   8000 
   8001    if (context)
   8002    {
   8003        ShaderProgramID programPacked  = PackParam<ShaderProgramID>(program);
   8004        UniformLocation locationPacked = PackParam<UniformLocation>(location);
   8005        SCOPED_SHARE_CONTEXT_LOCK(context);
   8006        bool isCallValid = (context->skipValidation() ||
   8007                            ValidateProgramUniformMatrix2x4fvEXT(
   8008                                context, angle::EntryPoint::GLProgramUniformMatrix2x4fvEXT,
   8009                                programPacked, locationPacked, count, transpose, value));
   8010        if (isCallValid)
   8011        {
   8012            context->programUniformMatrix2x4fv(programPacked, locationPacked, count, transpose,
   8013                                               value);
   8014        }
   8015        ANGLE_CAPTURE_GL(ProgramUniformMatrix2x4fvEXT, isCallValid, context, programPacked,
   8016                         locationPacked, count, transpose, value);
   8017    }
   8018    else
   8019    {
   8020        GenerateContextLostErrorOnCurrentGlobalContext();
   8021    }
   8022 }
   8023 
   8024 void GL_APIENTRY GL_ProgramUniformMatrix3fvEXT(GLuint program,
   8025                                               GLint location,
   8026                                               GLsizei count,
   8027                                               GLboolean transpose,
   8028                                               const GLfloat *value)
   8029 {
   8030    Context *context = GetValidGlobalContext();
   8031    EVENT(context, GLProgramUniformMatrix3fvEXT,
   8032          "context = %d, program = %u, location = %d, count = %d, transpose = %s, value = "
   8033          "0x%016" PRIxPTR "",
   8034          CID(context), program, location, count, GLbooleanToString(transpose), (uintptr_t)value);
   8035 
   8036    if (context)
   8037    {
   8038        ShaderProgramID programPacked  = PackParam<ShaderProgramID>(program);
   8039        UniformLocation locationPacked = PackParam<UniformLocation>(location);
   8040        SCOPED_SHARE_CONTEXT_LOCK(context);
   8041        bool isCallValid = (context->skipValidation() ||
   8042                            ValidateProgramUniformMatrix3fvEXT(
   8043                                context, angle::EntryPoint::GLProgramUniformMatrix3fvEXT,
   8044                                programPacked, locationPacked, count, transpose, value));
   8045        if (isCallValid)
   8046        {
   8047            context->programUniformMatrix3fv(programPacked, locationPacked, count, transpose,
   8048                                             value);
   8049        }
   8050        ANGLE_CAPTURE_GL(ProgramUniformMatrix3fvEXT, isCallValid, context, programPacked,
   8051                         locationPacked, count, transpose, value);
   8052    }
   8053    else
   8054    {
   8055        GenerateContextLostErrorOnCurrentGlobalContext();
   8056    }
   8057 }
   8058 
   8059 void GL_APIENTRY GL_ProgramUniformMatrix3x2fvEXT(GLuint program,
   8060                                                 GLint location,
   8061                                                 GLsizei count,
   8062                                                 GLboolean transpose,
   8063                                                 const GLfloat *value)
   8064 {
   8065    Context *context = GetValidGlobalContext();
   8066    EVENT(context, GLProgramUniformMatrix3x2fvEXT,
   8067          "context = %d, program = %u, location = %d, count = %d, transpose = %s, value = "
   8068          "0x%016" PRIxPTR "",
   8069          CID(context), program, location, count, GLbooleanToString(transpose), (uintptr_t)value);
   8070 
   8071    if (context)
   8072    {
   8073        ShaderProgramID programPacked  = PackParam<ShaderProgramID>(program);
   8074        UniformLocation locationPacked = PackParam<UniformLocation>(location);
   8075        SCOPED_SHARE_CONTEXT_LOCK(context);
   8076        bool isCallValid = (context->skipValidation() ||
   8077                            ValidateProgramUniformMatrix3x2fvEXT(
   8078                                context, angle::EntryPoint::GLProgramUniformMatrix3x2fvEXT,
   8079                                programPacked, locationPacked, count, transpose, value));
   8080        if (isCallValid)
   8081        {
   8082            context->programUniformMatrix3x2fv(programPacked, locationPacked, count, transpose,
   8083                                               value);
   8084        }
   8085        ANGLE_CAPTURE_GL(ProgramUniformMatrix3x2fvEXT, isCallValid, context, programPacked,
   8086                         locationPacked, count, transpose, value);
   8087    }
   8088    else
   8089    {
   8090        GenerateContextLostErrorOnCurrentGlobalContext();
   8091    }
   8092 }
   8093 
   8094 void GL_APIENTRY GL_ProgramUniformMatrix3x4fvEXT(GLuint program,
   8095                                                 GLint location,
   8096                                                 GLsizei count,
   8097                                                 GLboolean transpose,
   8098                                                 const GLfloat *value)
   8099 {
   8100    Context *context = GetValidGlobalContext();
   8101    EVENT(context, GLProgramUniformMatrix3x4fvEXT,
   8102          "context = %d, program = %u, location = %d, count = %d, transpose = %s, value = "
   8103          "0x%016" PRIxPTR "",
   8104          CID(context), program, location, count, GLbooleanToString(transpose), (uintptr_t)value);
   8105 
   8106    if (context)
   8107    {
   8108        ShaderProgramID programPacked  = PackParam<ShaderProgramID>(program);
   8109        UniformLocation locationPacked = PackParam<UniformLocation>(location);
   8110        SCOPED_SHARE_CONTEXT_LOCK(context);
   8111        bool isCallValid = (context->skipValidation() ||
   8112                            ValidateProgramUniformMatrix3x4fvEXT(
   8113                                context, angle::EntryPoint::GLProgramUniformMatrix3x4fvEXT,
   8114                                programPacked, locationPacked, count, transpose, value));
   8115        if (isCallValid)
   8116        {
   8117            context->programUniformMatrix3x4fv(programPacked, locationPacked, count, transpose,
   8118                                               value);
   8119        }
   8120        ANGLE_CAPTURE_GL(ProgramUniformMatrix3x4fvEXT, isCallValid, context, programPacked,
   8121                         locationPacked, count, transpose, value);
   8122    }
   8123    else
   8124    {
   8125        GenerateContextLostErrorOnCurrentGlobalContext();
   8126    }
   8127 }
   8128 
   8129 void GL_APIENTRY GL_ProgramUniformMatrix4fvEXT(GLuint program,
   8130                                               GLint location,
   8131                                               GLsizei count,
   8132                                               GLboolean transpose,
   8133                                               const GLfloat *value)
   8134 {
   8135    Context *context = GetValidGlobalContext();
   8136    EVENT(context, GLProgramUniformMatrix4fvEXT,
   8137          "context = %d, program = %u, location = %d, count = %d, transpose = %s, value = "
   8138          "0x%016" PRIxPTR "",
   8139          CID(context), program, location, count, GLbooleanToString(transpose), (uintptr_t)value);
   8140 
   8141    if (context)
   8142    {
   8143        ShaderProgramID programPacked  = PackParam<ShaderProgramID>(program);
   8144        UniformLocation locationPacked = PackParam<UniformLocation>(location);
   8145        SCOPED_SHARE_CONTEXT_LOCK(context);
   8146        bool isCallValid = (context->skipValidation() ||
   8147                            ValidateProgramUniformMatrix4fvEXT(
   8148                                context, angle::EntryPoint::GLProgramUniformMatrix4fvEXT,
   8149                                programPacked, locationPacked, count, transpose, value));
   8150        if (isCallValid)
   8151        {
   8152            context->programUniformMatrix4fv(programPacked, locationPacked, count, transpose,
   8153                                             value);
   8154        }
   8155        ANGLE_CAPTURE_GL(ProgramUniformMatrix4fvEXT, isCallValid, context, programPacked,
   8156                         locationPacked, count, transpose, value);
   8157    }
   8158    else
   8159    {
   8160        GenerateContextLostErrorOnCurrentGlobalContext();
   8161    }
   8162 }
   8163 
   8164 void GL_APIENTRY GL_ProgramUniformMatrix4x2fvEXT(GLuint program,
   8165                                                 GLint location,
   8166                                                 GLsizei count,
   8167                                                 GLboolean transpose,
   8168                                                 const GLfloat *value)
   8169 {
   8170    Context *context = GetValidGlobalContext();
   8171    EVENT(context, GLProgramUniformMatrix4x2fvEXT,
   8172          "context = %d, program = %u, location = %d, count = %d, transpose = %s, value = "
   8173          "0x%016" PRIxPTR "",
   8174          CID(context), program, location, count, GLbooleanToString(transpose), (uintptr_t)value);
   8175 
   8176    if (context)
   8177    {
   8178        ShaderProgramID programPacked  = PackParam<ShaderProgramID>(program);
   8179        UniformLocation locationPacked = PackParam<UniformLocation>(location);
   8180        SCOPED_SHARE_CONTEXT_LOCK(context);
   8181        bool isCallValid = (context->skipValidation() ||
   8182                            ValidateProgramUniformMatrix4x2fvEXT(
   8183                                context, angle::EntryPoint::GLProgramUniformMatrix4x2fvEXT,
   8184                                programPacked, locationPacked, count, transpose, value));
   8185        if (isCallValid)
   8186        {
   8187            context->programUniformMatrix4x2fv(programPacked, locationPacked, count, transpose,
   8188                                               value);
   8189        }
   8190        ANGLE_CAPTURE_GL(ProgramUniformMatrix4x2fvEXT, isCallValid, context, programPacked,
   8191                         locationPacked, count, transpose, value);
   8192    }
   8193    else
   8194    {
   8195        GenerateContextLostErrorOnCurrentGlobalContext();
   8196    }
   8197 }
   8198 
   8199 void GL_APIENTRY GL_ProgramUniformMatrix4x3fvEXT(GLuint program,
   8200                                                 GLint location,
   8201                                                 GLsizei count,
   8202                                                 GLboolean transpose,
   8203                                                 const GLfloat *value)
   8204 {
   8205    Context *context = GetValidGlobalContext();
   8206    EVENT(context, GLProgramUniformMatrix4x3fvEXT,
   8207          "context = %d, program = %u, location = %d, count = %d, transpose = %s, value = "
   8208          "0x%016" PRIxPTR "",
   8209          CID(context), program, location, count, GLbooleanToString(transpose), (uintptr_t)value);
   8210 
   8211    if (context)
   8212    {
   8213        ShaderProgramID programPacked  = PackParam<ShaderProgramID>(program);
   8214        UniformLocation locationPacked = PackParam<UniformLocation>(location);
   8215        SCOPED_SHARE_CONTEXT_LOCK(context);
   8216        bool isCallValid = (context->skipValidation() ||
   8217                            ValidateProgramUniformMatrix4x3fvEXT(
   8218                                context, angle::EntryPoint::GLProgramUniformMatrix4x3fvEXT,
   8219                                programPacked, locationPacked, count, transpose, value));
   8220        if (isCallValid)
   8221        {
   8222            context->programUniformMatrix4x3fv(programPacked, locationPacked, count, transpose,
   8223                                               value);
   8224        }
   8225        ANGLE_CAPTURE_GL(ProgramUniformMatrix4x3fvEXT, isCallValid, context, programPacked,
   8226                         locationPacked, count, transpose, value);
   8227    }
   8228    else
   8229    {
   8230        GenerateContextLostErrorOnCurrentGlobalContext();
   8231    }
   8232 }
   8233 
   8234 void GL_APIENTRY GL_UseProgramStagesEXT(GLuint pipeline, GLbitfield stages, GLuint program)
   8235 {
   8236    Context *context = GetValidGlobalContext();
   8237    EVENT(context, GLUseProgramStagesEXT, "context = %d, pipeline = %u, stages = %s, program = %u",
   8238          CID(context), pipeline, GLbitfieldToString(GLESEnum::UseProgramStageMask, stages).c_str(),
   8239          program);
   8240 
   8241    if (context)
   8242    {
   8243        ProgramPipelineID pipelinePacked = PackParam<ProgramPipelineID>(pipeline);
   8244        ShaderProgramID programPacked    = PackParam<ShaderProgramID>(program);
   8245        SCOPED_SHARE_CONTEXT_LOCK(context);
   8246        bool isCallValid =
   8247            (context->skipValidation() ||
   8248             ValidateUseProgramStagesEXT(context, angle::EntryPoint::GLUseProgramStagesEXT,
   8249                                         pipelinePacked, stages, programPacked));
   8250        if (isCallValid)
   8251        {
   8252            context->useProgramStages(pipelinePacked, stages, programPacked);
   8253        }
   8254        ANGLE_CAPTURE_GL(UseProgramStagesEXT, isCallValid, context, pipelinePacked, stages,
   8255                         programPacked);
   8256    }
   8257    else
   8258    {
   8259        GenerateContextLostErrorOnCurrentGlobalContext();
   8260    }
   8261 }
   8262 
   8263 void GL_APIENTRY GL_ValidateProgramPipelineEXT(GLuint pipeline)
   8264 {
   8265    Context *context = GetValidGlobalContext();
   8266    EVENT(context, GLValidateProgramPipelineEXT, "context = %d, pipeline = %u", CID(context),
   8267          pipeline);
   8268 
   8269    if (context)
   8270    {
   8271        ProgramPipelineID pipelinePacked = PackParam<ProgramPipelineID>(pipeline);
   8272        SCOPED_SHARE_CONTEXT_LOCK(context);
   8273        bool isCallValid =
   8274            (context->skipValidation() ||
   8275             ValidateValidateProgramPipelineEXT(
   8276                 context, angle::EntryPoint::GLValidateProgramPipelineEXT, pipelinePacked));
   8277        if (isCallValid)
   8278        {
   8279            context->validateProgramPipeline(pipelinePacked);
   8280        }
   8281        ANGLE_CAPTURE_GL(ValidateProgramPipelineEXT, isCallValid, context, pipelinePacked);
   8282    }
   8283    else
   8284    {
   8285        GenerateContextLostErrorOnCurrentGlobalContext();
   8286    }
   8287 }
   8288 
   8289 // GL_EXT_shader_framebuffer_fetch
   8290 
   8291 // GL_EXT_shader_framebuffer_fetch_non_coherent
   8292 void GL_APIENTRY GL_FramebufferFetchBarrierEXT()
   8293 {
   8294    Context *context = GetValidGlobalContext();
   8295    EVENT(context, GLFramebufferFetchBarrierEXT, "context = %d", CID(context));
   8296 
   8297    if (context)
   8298    {
   8299        SCOPED_SHARE_CONTEXT_LOCK(context);
   8300        bool isCallValid = (context->skipValidation() ||
   8301                            ValidateFramebufferFetchBarrierEXT(
   8302                                context, angle::EntryPoint::GLFramebufferFetchBarrierEXT));
   8303        if (isCallValid)
   8304        {
   8305            context->framebufferFetchBarrier();
   8306        }
   8307        ANGLE_CAPTURE_GL(FramebufferFetchBarrierEXT, isCallValid, context);
   8308    }
   8309    else
   8310    {
   8311        GenerateContextLostErrorOnCurrentGlobalContext();
   8312    }
   8313 }
   8314 
   8315 // GL_EXT_shader_io_blocks
   8316 
   8317 // GL_EXT_shader_non_constant_global_initializers
   8318 
   8319 // GL_EXT_shader_texture_lod
   8320 
   8321 // GL_EXT_shadow_samplers
   8322 
   8323 // GL_EXT_tessellation_shader
   8324 void GL_APIENTRY GL_PatchParameteriEXT(GLenum pname, GLint value)
   8325 {
   8326    Context *context = GetValidGlobalContext();
   8327    EVENT(context, GLPatchParameteriEXT, "context = %d, pname = %s, value = %d", CID(context),
   8328          GLenumToString(GLESEnum::PatchParameterName, pname), value);
   8329 
   8330    if (context)
   8331    {
   8332        SCOPED_SHARE_CONTEXT_LOCK(context);
   8333        bool isCallValid = (context->skipValidation() ||
   8334                            ValidatePatchParameteriEXT(
   8335                                context, angle::EntryPoint::GLPatchParameteriEXT, pname, value));
   8336        if (isCallValid)
   8337        {
   8338            context->patchParameteri(pname, value);
   8339        }
   8340        ANGLE_CAPTURE_GL(PatchParameteriEXT, isCallValid, context, pname, value);
   8341    }
   8342    else
   8343    {
   8344        GenerateContextLostErrorOnCurrentGlobalContext();
   8345    }
   8346 }
   8347 
   8348 // GL_EXT_texture_border_clamp
   8349 void GL_APIENTRY GL_GetSamplerParameterIivEXT(GLuint sampler, GLenum pname, GLint *params)
   8350 {
   8351    Context *context = GetValidGlobalContext();
   8352    EVENT(context, GLGetSamplerParameterIivEXT,
   8353          "context = %d, sampler = %u, pname = %s, params = 0x%016" PRIxPTR "", CID(context),
   8354          sampler, GLenumToString(GLESEnum::SamplerParameterI, pname), (uintptr_t)params);
   8355 
   8356    if (context)
   8357    {
   8358        SamplerID samplerPacked = PackParam<SamplerID>(sampler);
   8359        SCOPED_SHARE_CONTEXT_LOCK(context);
   8360        bool isCallValid = (context->skipValidation() ||
   8361                            ValidateGetSamplerParameterIivEXT(
   8362                                context, angle::EntryPoint::GLGetSamplerParameterIivEXT,
   8363                                samplerPacked, pname, params));
   8364        if (isCallValid)
   8365        {
   8366            context->getSamplerParameterIiv(samplerPacked, pname, params);
   8367        }
   8368        ANGLE_CAPTURE_GL(GetSamplerParameterIivEXT, isCallValid, context, samplerPacked, pname,
   8369                         params);
   8370    }
   8371    else
   8372    {
   8373        GenerateContextLostErrorOnCurrentGlobalContext();
   8374    }
   8375 }
   8376 
   8377 void GL_APIENTRY GL_GetSamplerParameterIuivEXT(GLuint sampler, GLenum pname, GLuint *params)
   8378 {
   8379    Context *context = GetValidGlobalContext();
   8380    EVENT(context, GLGetSamplerParameterIuivEXT,
   8381          "context = %d, sampler = %u, pname = %s, params = 0x%016" PRIxPTR "", CID(context),
   8382          sampler, GLenumToString(GLESEnum::SamplerParameterI, pname), (uintptr_t)params);
   8383 
   8384    if (context)
   8385    {
   8386        SamplerID samplerPacked = PackParam<SamplerID>(sampler);
   8387        SCOPED_SHARE_CONTEXT_LOCK(context);
   8388        bool isCallValid = (context->skipValidation() ||
   8389                            ValidateGetSamplerParameterIuivEXT(
   8390                                context, angle::EntryPoint::GLGetSamplerParameterIuivEXT,
   8391                                samplerPacked, pname, params));
   8392        if (isCallValid)
   8393        {
   8394            context->getSamplerParameterIuiv(samplerPacked, pname, params);
   8395        }
   8396        ANGLE_CAPTURE_GL(GetSamplerParameterIuivEXT, isCallValid, context, samplerPacked, pname,
   8397                         params);
   8398    }
   8399    else
   8400    {
   8401        GenerateContextLostErrorOnCurrentGlobalContext();
   8402    }
   8403 }
   8404 
   8405 void GL_APIENTRY GL_GetTexParameterIivEXT(GLenum target, GLenum pname, GLint *params)
   8406 {
   8407    Context *context = GetValidGlobalContext();
   8408    EVENT(context, GLGetTexParameterIivEXT,
   8409          "context = %d, target = %s, pname = %s, params = 0x%016" PRIxPTR "", CID(context),
   8410          GLenumToString(GLESEnum::TextureTarget, target),
   8411          GLenumToString(GLESEnum::GetTextureParameter, pname), (uintptr_t)params);
   8412 
   8413    if (context)
   8414    {
   8415        TextureType targetPacked = PackParam<TextureType>(target);
   8416        SCOPED_SHARE_CONTEXT_LOCK(context);
   8417        bool isCallValid =
   8418            (context->skipValidation() ||
   8419             ValidateGetTexParameterIivEXT(context, angle::EntryPoint::GLGetTexParameterIivEXT,
   8420                                           targetPacked, pname, params));
   8421        if (isCallValid)
   8422        {
   8423            context->getTexParameterIiv(targetPacked, pname, params);
   8424        }
   8425        ANGLE_CAPTURE_GL(GetTexParameterIivEXT, isCallValid, context, targetPacked, pname, params);
   8426    }
   8427    else
   8428    {
   8429        GenerateContextLostErrorOnCurrentGlobalContext();
   8430    }
   8431 }
   8432 
   8433 void GL_APIENTRY GL_GetTexParameterIuivEXT(GLenum target, GLenum pname, GLuint *params)
   8434 {
   8435    Context *context = GetValidGlobalContext();
   8436    EVENT(context, GLGetTexParameterIuivEXT,
   8437          "context = %d, target = %s, pname = %s, params = 0x%016" PRIxPTR "", CID(context),
   8438          GLenumToString(GLESEnum::TextureTarget, target),
   8439          GLenumToString(GLESEnum::GetTextureParameter, pname), (uintptr_t)params);
   8440 
   8441    if (context)
   8442    {
   8443        TextureType targetPacked = PackParam<TextureType>(target);
   8444        SCOPED_SHARE_CONTEXT_LOCK(context);
   8445        bool isCallValid =
   8446            (context->skipValidation() ||
   8447             ValidateGetTexParameterIuivEXT(context, angle::EntryPoint::GLGetTexParameterIuivEXT,
   8448                                            targetPacked, pname, params));
   8449        if (isCallValid)
   8450        {
   8451            context->getTexParameterIuiv(targetPacked, pname, params);
   8452        }
   8453        ANGLE_CAPTURE_GL(GetTexParameterIuivEXT, isCallValid, context, targetPacked, pname, params);
   8454    }
   8455    else
   8456    {
   8457        GenerateContextLostErrorOnCurrentGlobalContext();
   8458    }
   8459 }
   8460 
   8461 void GL_APIENTRY GL_SamplerParameterIivEXT(GLuint sampler, GLenum pname, const GLint *param)
   8462 {
   8463    Context *context = GetValidGlobalContext();
   8464    EVENT(context, GLSamplerParameterIivEXT,
   8465          "context = %d, sampler = %u, pname = %s, param = 0x%016" PRIxPTR "", CID(context),
   8466          sampler, GLenumToString(GLESEnum::SamplerParameterI, pname), (uintptr_t)param);
   8467 
   8468    if (context)
   8469    {
   8470        SamplerID samplerPacked = PackParam<SamplerID>(sampler);
   8471        SCOPED_SHARE_CONTEXT_LOCK(context);
   8472        bool isCallValid =
   8473            (context->skipValidation() ||
   8474             ValidateSamplerParameterIivEXT(context, angle::EntryPoint::GLSamplerParameterIivEXT,
   8475                                            samplerPacked, pname, param));
   8476        if (isCallValid)
   8477        {
   8478            context->samplerParameterIiv(samplerPacked, pname, param);
   8479        }
   8480        ANGLE_CAPTURE_GL(SamplerParameterIivEXT, isCallValid, context, samplerPacked, pname, param);
   8481    }
   8482    else
   8483    {
   8484        GenerateContextLostErrorOnCurrentGlobalContext();
   8485    }
   8486 }
   8487 
   8488 void GL_APIENTRY GL_SamplerParameterIuivEXT(GLuint sampler, GLenum pname, const GLuint *param)
   8489 {
   8490    Context *context = GetValidGlobalContext();
   8491    EVENT(context, GLSamplerParameterIuivEXT,
   8492          "context = %d, sampler = %u, pname = %s, param = 0x%016" PRIxPTR "", CID(context),
   8493          sampler, GLenumToString(GLESEnum::SamplerParameterI, pname), (uintptr_t)param);
   8494 
   8495    if (context)
   8496    {
   8497        SamplerID samplerPacked = PackParam<SamplerID>(sampler);
   8498        SCOPED_SHARE_CONTEXT_LOCK(context);
   8499        bool isCallValid =
   8500            (context->skipValidation() ||
   8501             ValidateSamplerParameterIuivEXT(context, angle::EntryPoint::GLSamplerParameterIuivEXT,
   8502                                             samplerPacked, pname, param));
   8503        if (isCallValid)
   8504        {
   8505            context->samplerParameterIuiv(samplerPacked, pname, param);
   8506        }
   8507        ANGLE_CAPTURE_GL(SamplerParameterIuivEXT, isCallValid, context, samplerPacked, pname,
   8508                         param);
   8509    }
   8510    else
   8511    {
   8512        GenerateContextLostErrorOnCurrentGlobalContext();
   8513    }
   8514 }
   8515 
   8516 void GL_APIENTRY GL_TexParameterIivEXT(GLenum target, GLenum pname, const GLint *params)
   8517 {
   8518    Context *context = GetValidGlobalContext();
   8519    EVENT(context, GLTexParameterIivEXT,
   8520          "context = %d, target = %s, pname = %s, params = 0x%016" PRIxPTR "", CID(context),
   8521          GLenumToString(GLESEnum::TextureTarget, target),
   8522          GLenumToString(GLESEnum::TextureParameterName, pname), (uintptr_t)params);
   8523 
   8524    if (context)
   8525    {
   8526        TextureType targetPacked = PackParam<TextureType>(target);
   8527        SCOPED_SHARE_CONTEXT_LOCK(context);
   8528        bool isCallValid =
   8529            (context->skipValidation() ||
   8530             ValidateTexParameterIivEXT(context, angle::EntryPoint::GLTexParameterIivEXT,
   8531                                        targetPacked, pname, params));
   8532        if (isCallValid)
   8533        {
   8534            context->texParameterIiv(targetPacked, pname, params);
   8535        }
   8536        ANGLE_CAPTURE_GL(TexParameterIivEXT, isCallValid, context, targetPacked, pname, params);
   8537    }
   8538    else
   8539    {
   8540        GenerateContextLostErrorOnCurrentGlobalContext();
   8541    }
   8542 }
   8543 
   8544 void GL_APIENTRY GL_TexParameterIuivEXT(GLenum target, GLenum pname, const GLuint *params)
   8545 {
   8546    Context *context = GetValidGlobalContext();
   8547    EVENT(context, GLTexParameterIuivEXT,
   8548          "context = %d, target = %s, pname = %s, params = 0x%016" PRIxPTR "", CID(context),
   8549          GLenumToString(GLESEnum::TextureTarget, target),
   8550          GLenumToString(GLESEnum::TextureParameterName, pname), (uintptr_t)params);
   8551 
   8552    if (context)
   8553    {
   8554        TextureType targetPacked = PackParam<TextureType>(target);
   8555        SCOPED_SHARE_CONTEXT_LOCK(context);
   8556        bool isCallValid =
   8557            (context->skipValidation() ||
   8558             ValidateTexParameterIuivEXT(context, angle::EntryPoint::GLTexParameterIuivEXT,
   8559                                         targetPacked, pname, params));
   8560        if (isCallValid)
   8561        {
   8562            context->texParameterIuiv(targetPacked, pname, params);
   8563        }
   8564        ANGLE_CAPTURE_GL(TexParameterIuivEXT, isCallValid, context, targetPacked, pname, params);
   8565    }
   8566    else
   8567    {
   8568        GenerateContextLostErrorOnCurrentGlobalContext();
   8569    }
   8570 }
   8571 
   8572 // GL_EXT_texture_buffer
   8573 void GL_APIENTRY GL_TexBufferEXT(GLenum target, GLenum internalformat, GLuint buffer)
   8574 {
   8575    Context *context = GetValidGlobalContext();
   8576    EVENT(context, GLTexBufferEXT, "context = %d, target = %s, internalformat = %s, buffer = %u",
   8577          CID(context), GLenumToString(GLESEnum::TextureTarget, target),
   8578          GLenumToString(GLESEnum::SizedInternalFormat, internalformat), buffer);
   8579 
   8580    if (context)
   8581    {
   8582        TextureType targetPacked = PackParam<TextureType>(target);
   8583        BufferID bufferPacked    = PackParam<BufferID>(buffer);
   8584        SCOPED_SHARE_CONTEXT_LOCK(context);
   8585        bool isCallValid = (context->skipValidation() ||
   8586                            ValidateTexBufferEXT(context, angle::EntryPoint::GLTexBufferEXT,
   8587                                                 targetPacked, internalformat, bufferPacked));
   8588        if (isCallValid)
   8589        {
   8590            context->texBuffer(targetPacked, internalformat, bufferPacked);
   8591        }
   8592        ANGLE_CAPTURE_GL(TexBufferEXT, isCallValid, context, targetPacked, internalformat,
   8593                         bufferPacked);
   8594    }
   8595    else
   8596    {
   8597        GenerateContextLostErrorOnCurrentGlobalContext();
   8598    }
   8599 }
   8600 
   8601 void GL_APIENTRY GL_TexBufferRangeEXT(GLenum target,
   8602                                      GLenum internalformat,
   8603                                      GLuint buffer,
   8604                                      GLintptr offset,
   8605                                      GLsizeiptr size)
   8606 {
   8607    Context *context = GetValidGlobalContext();
   8608    EVENT(context, GLTexBufferRangeEXT,
   8609          "context = %d, target = %s, internalformat = %s, buffer = %u, offset = %llu, size = %llu",
   8610          CID(context), GLenumToString(GLESEnum::TextureTarget, target),
   8611          GLenumToString(GLESEnum::SizedInternalFormat, internalformat), buffer,
   8612          static_cast<unsigned long long>(offset), static_cast<unsigned long long>(size));
   8613 
   8614    if (context)
   8615    {
   8616        TextureType targetPacked = PackParam<TextureType>(target);
   8617        BufferID bufferPacked    = PackParam<BufferID>(buffer);
   8618        SCOPED_SHARE_CONTEXT_LOCK(context);
   8619        bool isCallValid =
   8620            (context->skipValidation() ||
   8621             ValidateTexBufferRangeEXT(context, angle::EntryPoint::GLTexBufferRangeEXT,
   8622                                       targetPacked, internalformat, bufferPacked, offset, size));
   8623        if (isCallValid)
   8624        {
   8625            context->texBufferRange(targetPacked, internalformat, bufferPacked, offset, size);
   8626        }
   8627        ANGLE_CAPTURE_GL(TexBufferRangeEXT, isCallValid, context, targetPacked, internalformat,
   8628                         bufferPacked, offset, size);
   8629    }
   8630    else
   8631    {
   8632        GenerateContextLostErrorOnCurrentGlobalContext();
   8633    }
   8634 }
   8635 
   8636 // GL_EXT_texture_compression_bptc
   8637 
   8638 // GL_EXT_texture_compression_dxt1
   8639 
   8640 // GL_EXT_texture_compression_rgtc
   8641 
   8642 // GL_EXT_texture_compression_s3tc
   8643 
   8644 // GL_EXT_texture_compression_s3tc_srgb
   8645 
   8646 // GL_EXT_texture_cube_map_array
   8647 
   8648 // GL_EXT_texture_filter_anisotropic
   8649 
   8650 // GL_EXT_texture_format_BGRA8888
   8651 
   8652 // GL_EXT_texture_format_sRGB_override
   8653 
   8654 // GL_EXT_texture_norm16
   8655 
   8656 // GL_EXT_texture_rg
   8657 
   8658 // GL_EXT_texture_sRGB_R8
   8659 
   8660 // GL_EXT_texture_sRGB_RG8
   8661 
   8662 // GL_EXT_texture_sRGB_decode
   8663 
   8664 // GL_EXT_texture_storage
   8665 void GL_APIENTRY GL_TexStorage1DEXT(GLenum target,
   8666                                    GLsizei levels,
   8667                                    GLenum internalformat,
   8668                                    GLsizei width)
   8669 {
   8670    Context *context = GetValidGlobalContext();
   8671    EVENT(context, GLTexStorage1DEXT,
   8672          "context = %d, target = %s, levels = %d, internalformat = %s, width = %d", CID(context),
   8673          GLenumToString(GLESEnum::TextureTarget, target), levels,
   8674          GLenumToString(GLESEnum::SizedInternalFormat, internalformat), width);
   8675 
   8676    if (context)
   8677    {
   8678        SCOPED_SHARE_CONTEXT_LOCK(context);
   8679        bool isCallValid = (context->skipValidation() ||
   8680                            ValidateTexStorage1DEXT(context, angle::EntryPoint::GLTexStorage1DEXT,
   8681                                                    target, levels, internalformat, width));
   8682        if (isCallValid)
   8683        {
   8684            context->texStorage1D(target, levels, internalformat, width);
   8685        }
   8686        ANGLE_CAPTURE_GL(TexStorage1DEXT, isCallValid, context, target, levels, internalformat,
   8687                         width);
   8688    }
   8689    else
   8690    {
   8691        GenerateContextLostErrorOnCurrentGlobalContext();
   8692    }
   8693 }
   8694 
   8695 void GL_APIENTRY GL_TexStorage2DEXT(GLenum target,
   8696                                    GLsizei levels,
   8697                                    GLenum internalformat,
   8698                                    GLsizei width,
   8699                                    GLsizei height)
   8700 {
   8701    Context *context = GetValidGlobalContext();
   8702    EVENT(context, GLTexStorage2DEXT,
   8703          "context = %d, target = %s, levels = %d, internalformat = %s, width = %d, height = %d",
   8704          CID(context), GLenumToString(GLESEnum::TextureTarget, target), levels,
   8705          GLenumToString(GLESEnum::SizedInternalFormat, internalformat), width, height);
   8706 
   8707    if (context)
   8708    {
   8709        TextureType targetPacked = PackParam<TextureType>(target);
   8710        SCOPED_SHARE_CONTEXT_LOCK(context);
   8711        bool isCallValid =
   8712            (context->skipValidation() ||
   8713             ValidateTexStorage2DEXT(context, angle::EntryPoint::GLTexStorage2DEXT, targetPacked,
   8714                                     levels, internalformat, width, height));
   8715        if (isCallValid)
   8716        {
   8717            context->texStorage2D(targetPacked, levels, internalformat, width, height);
   8718        }
   8719        ANGLE_CAPTURE_GL(TexStorage2DEXT, isCallValid, context, targetPacked, levels,
   8720                         internalformat, width, height);
   8721    }
   8722    else
   8723    {
   8724        GenerateContextLostErrorOnCurrentGlobalContext();
   8725    }
   8726 }
   8727 
   8728 void GL_APIENTRY GL_TexStorage3DEXT(GLenum target,
   8729                                    GLsizei levels,
   8730                                    GLenum internalformat,
   8731                                    GLsizei width,
   8732                                    GLsizei height,
   8733                                    GLsizei depth)
   8734 {
   8735    Context *context = GetValidGlobalContext();
   8736    EVENT(context, GLTexStorage3DEXT,
   8737          "context = %d, target = %s, levels = %d, internalformat = %s, width = %d, height = %d, "
   8738          "depth = %d",
   8739          CID(context), GLenumToString(GLESEnum::TextureTarget, target), levels,
   8740          GLenumToString(GLESEnum::SizedInternalFormat, internalformat), width, height, depth);
   8741 
   8742    if (context)
   8743    {
   8744        TextureType targetPacked = PackParam<TextureType>(target);
   8745        SCOPED_SHARE_CONTEXT_LOCK(context);
   8746        bool isCallValid =
   8747            (context->skipValidation() ||
   8748             ValidateTexStorage3DEXT(context, angle::EntryPoint::GLTexStorage3DEXT, targetPacked,
   8749                                     levels, internalformat, width, height, depth));
   8750        if (isCallValid)
   8751        {
   8752            context->texStorage3D(targetPacked, levels, internalformat, width, height, depth);
   8753        }
   8754        ANGLE_CAPTURE_GL(TexStorage3DEXT, isCallValid, context, targetPacked, levels,
   8755                         internalformat, width, height, depth);
   8756    }
   8757    else
   8758    {
   8759        GenerateContextLostErrorOnCurrentGlobalContext();
   8760    }
   8761 }
   8762 
   8763 // GL_EXT_texture_type_2_10_10_10_REV
   8764 
   8765 // GL_EXT_unpack_subimage
   8766 
   8767 // GL_IMG_texture_compression_pvrtc
   8768 
   8769 // GL_IMG_texture_compression_pvrtc2
   8770 
   8771 // GL_KHR_blend_equation_advanced
   8772 void GL_APIENTRY GL_BlendBarrierKHR()
   8773 {
   8774    Context *context = GetValidGlobalContext();
   8775    EVENT(context, GLBlendBarrierKHR, "context = %d", CID(context));
   8776 
   8777    if (context)
   8778    {
   8779        SCOPED_SHARE_CONTEXT_LOCK(context);
   8780        bool isCallValid = (context->skipValidation() ||
   8781                            ValidateBlendBarrierKHR(context, angle::EntryPoint::GLBlendBarrierKHR));
   8782        if (isCallValid)
   8783        {
   8784            context->blendBarrier();
   8785        }
   8786        ANGLE_CAPTURE_GL(BlendBarrierKHR, isCallValid, context);
   8787    }
   8788    else
   8789    {
   8790        GenerateContextLostErrorOnCurrentGlobalContext();
   8791    }
   8792 }
   8793 
   8794 // GL_KHR_debug
   8795 void GL_APIENTRY GL_DebugMessageCallbackKHR(GLDEBUGPROCKHR callback, const void *userParam)
   8796 {
   8797    Context *context = GetValidGlobalContext();
   8798    EVENT(context, GLDebugMessageCallbackKHR,
   8799          "context = %d, callback = 0x%016" PRIxPTR ", userParam = 0x%016" PRIxPTR "", CID(context),
   8800          (uintptr_t)callback, (uintptr_t)userParam);
   8801 
   8802    if (context)
   8803    {
   8804        SCOPED_SHARE_CONTEXT_LOCK(context);
   8805        bool isCallValid =
   8806            (context->skipValidation() ||
   8807             ValidateDebugMessageCallbackKHR(context, angle::EntryPoint::GLDebugMessageCallbackKHR,
   8808                                             callback, userParam));
   8809        if (isCallValid)
   8810        {
   8811            context->debugMessageCallback(callback, userParam);
   8812        }
   8813        ANGLE_CAPTURE_GL(DebugMessageCallbackKHR, isCallValid, context, callback, userParam);
   8814    }
   8815    else
   8816    {
   8817        GenerateContextLostErrorOnCurrentGlobalContext();
   8818    }
   8819 }
   8820 
   8821 void GL_APIENTRY GL_DebugMessageControlKHR(GLenum source,
   8822                                           GLenum type,
   8823                                           GLenum severity,
   8824                                           GLsizei count,
   8825                                           const GLuint *ids,
   8826                                           GLboolean enabled)
   8827 {
   8828    Context *context = GetValidGlobalContext();
   8829    EVENT(context, GLDebugMessageControlKHR,
   8830          "context = %d, source = %s, type = %s, severity = %s, count = %d, ids = 0x%016" PRIxPTR
   8831          ", enabled = %s",
   8832          CID(context), GLenumToString(GLESEnum::DebugSource, source),
   8833          GLenumToString(GLESEnum::DebugType, type),
   8834          GLenumToString(GLESEnum::DebugSeverity, severity), count, (uintptr_t)ids,
   8835          GLbooleanToString(enabled));
   8836 
   8837    if (context)
   8838    {
   8839        SCOPED_SHARE_CONTEXT_LOCK(context);
   8840        bool isCallValid =
   8841            (context->skipValidation() ||
   8842             ValidateDebugMessageControlKHR(context, angle::EntryPoint::GLDebugMessageControlKHR,
   8843                                            source, type, severity, count, ids, enabled));
   8844        if (isCallValid)
   8845        {
   8846            context->debugMessageControl(source, type, severity, count, ids, enabled);
   8847        }
   8848        ANGLE_CAPTURE_GL(DebugMessageControlKHR, isCallValid, context, source, type, severity,
   8849                         count, ids, enabled);
   8850    }
   8851    else
   8852    {
   8853        GenerateContextLostErrorOnCurrentGlobalContext();
   8854    }
   8855 }
   8856 
   8857 void GL_APIENTRY GL_DebugMessageInsertKHR(GLenum source,
   8858                                          GLenum type,
   8859                                          GLuint id,
   8860                                          GLenum severity,
   8861                                          GLsizei length,
   8862                                          const GLchar *buf)
   8863 {
   8864    Context *context = GetValidGlobalContext();
   8865    EVENT(context, GLDebugMessageInsertKHR,
   8866          "context = %d, source = %s, type = %s, id = %u, severity = %s, length = %d, buf = "
   8867          "0x%016" PRIxPTR "",
   8868          CID(context), GLenumToString(GLESEnum::DebugSource, source),
   8869          GLenumToString(GLESEnum::DebugType, type), id,
   8870          GLenumToString(GLESEnum::DebugSeverity, severity), length, (uintptr_t)buf);
   8871 
   8872    if (context)
   8873    {
   8874        SCOPED_SHARE_CONTEXT_LOCK(context);
   8875        bool isCallValid =
   8876            (context->skipValidation() ||
   8877             ValidateDebugMessageInsertKHR(context, angle::EntryPoint::GLDebugMessageInsertKHR,
   8878                                           source, type, id, severity, length, buf));
   8879        if (isCallValid)
   8880        {
   8881            context->debugMessageInsert(source, type, id, severity, length, buf);
   8882        }
   8883        ANGLE_CAPTURE_GL(DebugMessageInsertKHR, isCallValid, context, source, type, id, severity,
   8884                         length, buf);
   8885    }
   8886    else
   8887    {
   8888        GenerateContextLostErrorOnCurrentGlobalContext();
   8889    }
   8890 }
   8891 
   8892 GLuint GL_APIENTRY GL_GetDebugMessageLogKHR(GLuint count,
   8893                                            GLsizei bufSize,
   8894                                            GLenum *sources,
   8895                                            GLenum *types,
   8896                                            GLuint *ids,
   8897                                            GLenum *severities,
   8898                                            GLsizei *lengths,
   8899                                            GLchar *messageLog)
   8900 {
   8901    Context *context = GetValidGlobalContext();
   8902    EVENT(context, GLGetDebugMessageLogKHR,
   8903          "context = %d, count = %u, bufSize = %d, sources = 0x%016" PRIxPTR
   8904          ", types = 0x%016" PRIxPTR ", ids = 0x%016" PRIxPTR ", severities = 0x%016" PRIxPTR
   8905          ", lengths = 0x%016" PRIxPTR ", messageLog = 0x%016" PRIxPTR "",
   8906          CID(context), count, bufSize, (uintptr_t)sources, (uintptr_t)types, (uintptr_t)ids,
   8907          (uintptr_t)severities, (uintptr_t)lengths, (uintptr_t)messageLog);
   8908 
   8909    GLuint returnValue;
   8910    if (context)
   8911    {
   8912        SCOPED_SHARE_CONTEXT_LOCK(context);
   8913        bool isCallValid = (context->skipValidation() ||
   8914                            ValidateGetDebugMessageLogKHR(
   8915                                context, angle::EntryPoint::GLGetDebugMessageLogKHR, count, bufSize,
   8916                                sources, types, ids, severities, lengths, messageLog));
   8917        if (isCallValid)
   8918        {
   8919            returnValue = context->getDebugMessageLog(count, bufSize, sources, types, ids,
   8920                                                      severities, lengths, messageLog);
   8921        }
   8922        else
   8923        {
   8924            returnValue =
   8925                GetDefaultReturnValue<angle::EntryPoint::GLGetDebugMessageLogKHR, GLuint>();
   8926        }
   8927        ANGLE_CAPTURE_GL(GetDebugMessageLogKHR, isCallValid, context, count, bufSize, sources,
   8928                         types, ids, severities, lengths, messageLog, returnValue);
   8929    }
   8930    else
   8931    {
   8932        GenerateContextLostErrorOnCurrentGlobalContext();
   8933        returnValue = GetDefaultReturnValue<angle::EntryPoint::GLGetDebugMessageLogKHR, GLuint>();
   8934    }
   8935    return returnValue;
   8936 }
   8937 
   8938 void GL_APIENTRY GL_GetObjectLabelKHR(GLenum identifier,
   8939                                      GLuint name,
   8940                                      GLsizei bufSize,
   8941                                      GLsizei *length,
   8942                                      GLchar *label)
   8943 {
   8944    Context *context = GetValidGlobalContext();
   8945    EVENT(context, GLGetObjectLabelKHR,
   8946          "context = %d, identifier = %s, name = %u, bufSize = %d, length = 0x%016" PRIxPTR
   8947          ", label = 0x%016" PRIxPTR "",
   8948          CID(context), GLenumToString(GLESEnum::AllEnums, identifier), name, bufSize,
   8949          (uintptr_t)length, (uintptr_t)label);
   8950 
   8951    if (context)
   8952    {
   8953        SCOPED_SHARE_CONTEXT_LOCK(context);
   8954        bool isCallValid =
   8955            (context->skipValidation() ||
   8956             ValidateGetObjectLabelKHR(context, angle::EntryPoint::GLGetObjectLabelKHR, identifier,
   8957                                       name, bufSize, length, label));
   8958        if (isCallValid)
   8959        {
   8960            context->getObjectLabel(identifier, name, bufSize, length, label);
   8961        }
   8962        ANGLE_CAPTURE_GL(GetObjectLabelKHR, isCallValid, context, identifier, name, bufSize, length,
   8963                         label);
   8964    }
   8965    else
   8966    {
   8967        GenerateContextLostErrorOnCurrentGlobalContext();
   8968    }
   8969 }
   8970 
   8971 void GL_APIENTRY GL_GetObjectPtrLabelKHR(const void *ptr,
   8972                                         GLsizei bufSize,
   8973                                         GLsizei *length,
   8974                                         GLchar *label)
   8975 {
   8976    Context *context = GetValidGlobalContext();
   8977    EVENT(context, GLGetObjectPtrLabelKHR,
   8978          "context = %d, ptr = 0x%016" PRIxPTR ", bufSize = %d, length = 0x%016" PRIxPTR
   8979          ", label = 0x%016" PRIxPTR "",
   8980          CID(context), (uintptr_t)ptr, bufSize, (uintptr_t)length, (uintptr_t)label);
   8981 
   8982    if (context)
   8983    {
   8984        SCOPED_SHARE_CONTEXT_LOCK(context);
   8985        bool isCallValid =
   8986            (context->skipValidation() ||
   8987             ValidateGetObjectPtrLabelKHR(context, angle::EntryPoint::GLGetObjectPtrLabelKHR, ptr,
   8988                                          bufSize, length, label));
   8989        if (isCallValid)
   8990        {
   8991            context->getObjectPtrLabel(ptr, bufSize, length, label);
   8992        }
   8993        ANGLE_CAPTURE_GL(GetObjectPtrLabelKHR, isCallValid, context, ptr, bufSize, length, label);
   8994    }
   8995    else
   8996    {
   8997        GenerateContextLostErrorOnCurrentGlobalContext();
   8998    }
   8999 }
   9000 
   9001 void GL_APIENTRY GL_GetPointervKHR(GLenum pname, void **params)
   9002 {
   9003    Context *context = GetValidGlobalContext();
   9004    EVENT(context, GLGetPointervKHR, "context = %d, pname = %s, params = 0x%016" PRIxPTR "",
   9005          CID(context), GLenumToString(GLESEnum::AllEnums, pname), (uintptr_t)params);
   9006 
   9007    if (context)
   9008    {
   9009        SCOPED_SHARE_CONTEXT_LOCK(context);
   9010        bool isCallValid =
   9011            (context->skipValidation() ||
   9012             ValidateGetPointervKHR(context, angle::EntryPoint::GLGetPointervKHR, pname, params));
   9013        if (isCallValid)
   9014        {
   9015            context->getPointerv(pname, params);
   9016        }
   9017        ANGLE_CAPTURE_GL(GetPointervKHR, isCallValid, context, pname, params);
   9018    }
   9019    else
   9020    {
   9021        GenerateContextLostErrorOnCurrentGlobalContext();
   9022    }
   9023 }
   9024 
   9025 void GL_APIENTRY GL_ObjectLabelKHR(GLenum identifier,
   9026                                   GLuint name,
   9027                                   GLsizei length,
   9028                                   const GLchar *label)
   9029 {
   9030    Context *context = GetValidGlobalContext();
   9031    EVENT(context, GLObjectLabelKHR,
   9032          "context = %d, identifier = %s, name = %u, length = %d, label = 0x%016" PRIxPTR "",
   9033          CID(context), GLenumToString(GLESEnum::ObjectIdentifier, identifier), name, length,
   9034          (uintptr_t)label);
   9035 
   9036    if (context)
   9037    {
   9038        SCOPED_SHARE_CONTEXT_LOCK(context);
   9039        bool isCallValid = (context->skipValidation() ||
   9040                            ValidateObjectLabelKHR(context, angle::EntryPoint::GLObjectLabelKHR,
   9041                                                   identifier, name, length, label));
   9042        if (isCallValid)
   9043        {
   9044            context->objectLabel(identifier, name, length, label);
   9045        }
   9046        ANGLE_CAPTURE_GL(ObjectLabelKHR, isCallValid, context, identifier, name, length, label);
   9047    }
   9048    else
   9049    {
   9050        GenerateContextLostErrorOnCurrentGlobalContext();
   9051    }
   9052 }
   9053 
   9054 void GL_APIENTRY GL_ObjectPtrLabelKHR(const void *ptr, GLsizei length, const GLchar *label)
   9055 {
   9056    Context *context = GetValidGlobalContext();
   9057    EVENT(context, GLObjectPtrLabelKHR,
   9058          "context = %d, ptr = 0x%016" PRIxPTR ", length = %d, label = 0x%016" PRIxPTR "",
   9059          CID(context), (uintptr_t)ptr, length, (uintptr_t)label);
   9060 
   9061    if (context)
   9062    {
   9063        SCOPED_SHARE_CONTEXT_LOCK(context);
   9064        bool isCallValid =
   9065            (context->skipValidation() ||
   9066             ValidateObjectPtrLabelKHR(context, angle::EntryPoint::GLObjectPtrLabelKHR, ptr, length,
   9067                                       label));
   9068        if (isCallValid)
   9069        {
   9070            context->objectPtrLabel(ptr, length, label);
   9071        }
   9072        ANGLE_CAPTURE_GL(ObjectPtrLabelKHR, isCallValid, context, ptr, length, label);
   9073    }
   9074    else
   9075    {
   9076        GenerateContextLostErrorOnCurrentGlobalContext();
   9077    }
   9078 }
   9079 
   9080 void GL_APIENTRY GL_PopDebugGroupKHR()
   9081 {
   9082    Context *context = GetValidGlobalContext();
   9083    EVENT(context, GLPopDebugGroupKHR, "context = %d", CID(context));
   9084 
   9085    if (context)
   9086    {
   9087        SCOPED_SHARE_CONTEXT_LOCK(context);
   9088        bool isCallValid =
   9089            (context->skipValidation() ||
   9090             ValidatePopDebugGroupKHR(context, angle::EntryPoint::GLPopDebugGroupKHR));
   9091        if (isCallValid)
   9092        {
   9093            context->popDebugGroup();
   9094        }
   9095        ANGLE_CAPTURE_GL(PopDebugGroupKHR, isCallValid, context);
   9096    }
   9097    else
   9098    {
   9099        GenerateContextLostErrorOnCurrentGlobalContext();
   9100    }
   9101 }
   9102 
   9103 void GL_APIENTRY GL_PushDebugGroupKHR(GLenum source,
   9104                                      GLuint id,
   9105                                      GLsizei length,
   9106                                      const GLchar *message)
   9107 {
   9108    Context *context = GetValidGlobalContext();
   9109    EVENT(context, GLPushDebugGroupKHR,
   9110          "context = %d, source = %s, id = %u, length = %d, message = 0x%016" PRIxPTR "",
   9111          CID(context), GLenumToString(GLESEnum::DebugSource, source), id, length,
   9112          (uintptr_t)message);
   9113 
   9114    if (context)
   9115    {
   9116        SCOPED_SHARE_CONTEXT_LOCK(context);
   9117        bool isCallValid =
   9118            (context->skipValidation() ||
   9119             ValidatePushDebugGroupKHR(context, angle::EntryPoint::GLPushDebugGroupKHR, source, id,
   9120                                       length, message));
   9121        if (isCallValid)
   9122        {
   9123            context->pushDebugGroup(source, id, length, message);
   9124        }
   9125        ANGLE_CAPTURE_GL(PushDebugGroupKHR, isCallValid, context, source, id, length, message);
   9126    }
   9127    else
   9128    {
   9129        GenerateContextLostErrorOnCurrentGlobalContext();
   9130    }
   9131 }
   9132 
   9133 // GL_KHR_no_error
   9134 
   9135 // GL_KHR_parallel_shader_compile
   9136 void GL_APIENTRY GL_MaxShaderCompilerThreadsKHR(GLuint count)
   9137 {
   9138    Context *context = GetValidGlobalContext();
   9139    EVENT(context, GLMaxShaderCompilerThreadsKHR, "context = %d, count = %u", CID(context), count);
   9140 
   9141    if (context)
   9142    {
   9143        SCOPED_SHARE_CONTEXT_LOCK(context);
   9144        bool isCallValid = (context->skipValidation() ||
   9145                            ValidateMaxShaderCompilerThreadsKHR(
   9146                                context, angle::EntryPoint::GLMaxShaderCompilerThreadsKHR, count));
   9147        if (isCallValid)
   9148        {
   9149            context->maxShaderCompilerThreads(count);
   9150        }
   9151        ANGLE_CAPTURE_GL(MaxShaderCompilerThreadsKHR, isCallValid, context, count);
   9152    }
   9153    else
   9154    {
   9155        GenerateContextLostErrorOnCurrentGlobalContext();
   9156    }
   9157 }
   9158 
   9159 // GL_KHR_robust_buffer_access_behavior
   9160 
   9161 // GL_KHR_texture_compression_astc_hdr
   9162 
   9163 // GL_KHR_texture_compression_astc_ldr
   9164 
   9165 // GL_KHR_texture_compression_astc_sliced_3d
   9166 
   9167 // GL_MESA_framebuffer_flip_y
   9168 void GL_APIENTRY GL_FramebufferParameteriMESA(GLenum target, GLenum pname, GLint param)
   9169 {
   9170    Context *context = GetValidGlobalContext();
   9171    EVENT(context, GLFramebufferParameteriMESA, "context = %d, target = %s, pname = %s, param = %d",
   9172          CID(context), GLenumToString(GLESEnum::FramebufferTarget, target),
   9173          GLenumToString(GLESEnum::FramebufferParameterName, pname), param);
   9174 
   9175    if (context)
   9176    {
   9177        SCOPED_SHARE_CONTEXT_LOCK(context);
   9178        bool isCallValid =
   9179            (context->skipValidation() ||
   9180             ValidateFramebufferParameteriMESA(
   9181                 context, angle::EntryPoint::GLFramebufferParameteriMESA, target, pname, param));
   9182        if (isCallValid)
   9183        {
   9184            context->framebufferParameteriMESA(target, pname, param);
   9185        }
   9186        ANGLE_CAPTURE_GL(FramebufferParameteriMESA, isCallValid, context, target, pname, param);
   9187    }
   9188    else
   9189    {
   9190        GenerateContextLostErrorOnCurrentGlobalContext();
   9191    }
   9192 }
   9193 
   9194 void GL_APIENTRY GL_GetFramebufferParameterivMESA(GLenum target, GLenum pname, GLint *params)
   9195 {
   9196    Context *context = GetValidGlobalContext();
   9197    EVENT(context, GLGetFramebufferParameterivMESA,
   9198          "context = %d, target = %s, pname = %s, params = 0x%016" PRIxPTR "", CID(context),
   9199          GLenumToString(GLESEnum::FramebufferTarget, target),
   9200          GLenumToString(GLESEnum::FramebufferAttachmentParameterName, pname), (uintptr_t)params);
   9201 
   9202    if (context)
   9203    {
   9204        SCOPED_SHARE_CONTEXT_LOCK(context);
   9205        bool isCallValid = (context->skipValidation() ||
   9206                            ValidateGetFramebufferParameterivMESA(
   9207                                context, angle::EntryPoint::GLGetFramebufferParameterivMESA, target,
   9208                                pname, params));
   9209        if (isCallValid)
   9210        {
   9211            context->getFramebufferParameterivMESA(target, pname, params);
   9212        }
   9213        ANGLE_CAPTURE_GL(GetFramebufferParameterivMESA, isCallValid, context, target, pname,
   9214                         params);
   9215    }
   9216    else
   9217    {
   9218        GenerateContextLostErrorOnCurrentGlobalContext();
   9219    }
   9220 }
   9221 
   9222 // GL_NV_fence
   9223 void GL_APIENTRY GL_DeleteFencesNV(GLsizei n, const GLuint *fences)
   9224 {
   9225    Context *context = GetValidGlobalContext();
   9226    EVENT(context, GLDeleteFencesNV, "context = %d, n = %d, fences = 0x%016" PRIxPTR "",
   9227          CID(context), n, (uintptr_t)fences);
   9228 
   9229    if (context)
   9230    {
   9231        const FenceNVID *fencesPacked = PackParam<const FenceNVID *>(fences);
   9232        SCOPED_SHARE_CONTEXT_LOCK(context);
   9233        bool isCallValid =
   9234            (context->skipValidation() ||
   9235             ValidateDeleteFencesNV(context, angle::EntryPoint::GLDeleteFencesNV, n, fencesPacked));
   9236        if (isCallValid)
   9237        {
   9238            context->deleteFencesNV(n, fencesPacked);
   9239        }
   9240        ANGLE_CAPTURE_GL(DeleteFencesNV, isCallValid, context, n, fencesPacked);
   9241    }
   9242    else
   9243    {
   9244        GenerateContextLostErrorOnCurrentGlobalContext();
   9245    }
   9246 }
   9247 
   9248 void GL_APIENTRY GL_FinishFenceNV(GLuint fence)
   9249 {
   9250    Context *context = GetValidGlobalContext();
   9251    EVENT(context, GLFinishFenceNV, "context = %d, fence = %u", CID(context), fence);
   9252 
   9253    if (context)
   9254    {
   9255        FenceNVID fencePacked = PackParam<FenceNVID>(fence);
   9256        SCOPED_SHARE_CONTEXT_LOCK(context);
   9257        bool isCallValid =
   9258            (context->skipValidation() ||
   9259             ValidateFinishFenceNV(context, angle::EntryPoint::GLFinishFenceNV, fencePacked));
   9260        if (isCallValid)
   9261        {
   9262            context->finishFenceNV(fencePacked);
   9263        }
   9264        ANGLE_CAPTURE_GL(FinishFenceNV, isCallValid, context, fencePacked);
   9265    }
   9266    else
   9267    {
   9268        GenerateContextLostErrorOnCurrentGlobalContext();
   9269    }
   9270 }
   9271 
   9272 void GL_APIENTRY GL_GenFencesNV(GLsizei n, GLuint *fences)
   9273 {
   9274    Context *context = GetValidGlobalContext();
   9275    EVENT(context, GLGenFencesNV, "context = %d, n = %d, fences = 0x%016" PRIxPTR "", CID(context),
   9276          n, (uintptr_t)fences);
   9277 
   9278    if (context)
   9279    {
   9280        FenceNVID *fencesPacked = PackParam<FenceNVID *>(fences);
   9281        SCOPED_SHARE_CONTEXT_LOCK(context);
   9282        bool isCallValid =
   9283            (context->skipValidation() ||
   9284             ValidateGenFencesNV(context, angle::EntryPoint::GLGenFencesNV, n, fencesPacked));
   9285        if (isCallValid)
   9286        {
   9287            context->genFencesNV(n, fencesPacked);
   9288        }
   9289        ANGLE_CAPTURE_GL(GenFencesNV, isCallValid, context, n, fencesPacked);
   9290    }
   9291    else
   9292    {
   9293        GenerateContextLostErrorOnCurrentGlobalContext();
   9294    }
   9295 }
   9296 
   9297 void GL_APIENTRY GL_GetFenceivNV(GLuint fence, GLenum pname, GLint *params)
   9298 {
   9299    Context *context = GetValidGlobalContext();
   9300    EVENT(context, GLGetFenceivNV,
   9301          "context = %d, fence = %u, pname = %s, params = 0x%016" PRIxPTR "", CID(context), fence,
   9302          GLenumToString(GLESEnum::AllEnums, pname), (uintptr_t)params);
   9303 
   9304    if (context)
   9305    {
   9306        FenceNVID fencePacked = PackParam<FenceNVID>(fence);
   9307        SCOPED_SHARE_CONTEXT_LOCK(context);
   9308        bool isCallValid = (context->skipValidation() ||
   9309                            ValidateGetFenceivNV(context, angle::EntryPoint::GLGetFenceivNV,
   9310                                                 fencePacked, pname, params));
   9311        if (isCallValid)
   9312        {
   9313            context->getFenceivNV(fencePacked, pname, params);
   9314        }
   9315        ANGLE_CAPTURE_GL(GetFenceivNV, isCallValid, context, fencePacked, pname, params);
   9316    }
   9317    else
   9318    {
   9319        GenerateContextLostErrorOnCurrentGlobalContext();
   9320    }
   9321 }
   9322 
   9323 GLboolean GL_APIENTRY GL_IsFenceNV(GLuint fence)
   9324 {
   9325    Context *context = GetValidGlobalContext();
   9326    EVENT(context, GLIsFenceNV, "context = %d, fence = %u", CID(context), fence);
   9327 
   9328    GLboolean returnValue;
   9329    if (context)
   9330    {
   9331        FenceNVID fencePacked = PackParam<FenceNVID>(fence);
   9332        SCOPED_SHARE_CONTEXT_LOCK(context);
   9333        bool isCallValid =
   9334            (context->skipValidation() ||
   9335             ValidateIsFenceNV(context, angle::EntryPoint::GLIsFenceNV, fencePacked));
   9336        if (isCallValid)
   9337        {
   9338            returnValue = context->isFenceNV(fencePacked);
   9339        }
   9340        else
   9341        {
   9342            returnValue = GetDefaultReturnValue<angle::EntryPoint::GLIsFenceNV, GLboolean>();
   9343        }
   9344        ANGLE_CAPTURE_GL(IsFenceNV, isCallValid, context, fencePacked, returnValue);
   9345    }
   9346    else
   9347    {
   9348        GenerateContextLostErrorOnCurrentGlobalContext();
   9349        returnValue = GetDefaultReturnValue<angle::EntryPoint::GLIsFenceNV, GLboolean>();
   9350    }
   9351    return returnValue;
   9352 }
   9353 
   9354 void GL_APIENTRY GL_SetFenceNV(GLuint fence, GLenum condition)
   9355 {
   9356    Context *context = GetValidGlobalContext();
   9357    EVENT(context, GLSetFenceNV, "context = %d, fence = %u, condition = %s", CID(context), fence,
   9358          GLenumToString(GLESEnum::AllEnums, condition));
   9359 
   9360    if (context)
   9361    {
   9362        FenceNVID fencePacked = PackParam<FenceNVID>(fence);
   9363        SCOPED_SHARE_CONTEXT_LOCK(context);
   9364        bool isCallValid =
   9365            (context->skipValidation() ||
   9366             ValidateSetFenceNV(context, angle::EntryPoint::GLSetFenceNV, fencePacked, condition));
   9367        if (isCallValid)
   9368        {
   9369            context->setFenceNV(fencePacked, condition);
   9370        }
   9371        ANGLE_CAPTURE_GL(SetFenceNV, isCallValid, context, fencePacked, condition);
   9372    }
   9373    else
   9374    {
   9375        GenerateContextLostErrorOnCurrentGlobalContext();
   9376    }
   9377 }
   9378 
   9379 GLboolean GL_APIENTRY GL_TestFenceNV(GLuint fence)
   9380 {
   9381    Context *context = GetValidGlobalContext();
   9382    EVENT(context, GLTestFenceNV, "context = %d, fence = %u", CID(context), fence);
   9383 
   9384    GLboolean returnValue;
   9385    if (context)
   9386    {
   9387        FenceNVID fencePacked = PackParam<FenceNVID>(fence);
   9388        SCOPED_SHARE_CONTEXT_LOCK(context);
   9389        bool isCallValid =
   9390            (context->skipValidation() ||
   9391             ValidateTestFenceNV(context, angle::EntryPoint::GLTestFenceNV, fencePacked));
   9392        if (isCallValid)
   9393        {
   9394            returnValue = context->testFenceNV(fencePacked);
   9395        }
   9396        else
   9397        {
   9398            returnValue = GetDefaultReturnValue<angle::EntryPoint::GLTestFenceNV, GLboolean>();
   9399        }
   9400        ANGLE_CAPTURE_GL(TestFenceNV, isCallValid, context, fencePacked, returnValue);
   9401    }
   9402    else
   9403    {
   9404        GenerateContextLostErrorOnCurrentGlobalContext();
   9405        returnValue = GetDefaultReturnValue<angle::EntryPoint::GLTestFenceNV, GLboolean>();
   9406    }
   9407    return returnValue;
   9408 }
   9409 
   9410 // GL_NV_framebuffer_blit
   9411 void GL_APIENTRY GL_BlitFramebufferNV(GLint srcX0,
   9412                                      GLint srcY0,
   9413                                      GLint srcX1,
   9414                                      GLint srcY1,
   9415                                      GLint dstX0,
   9416                                      GLint dstY0,
   9417                                      GLint dstX1,
   9418                                      GLint dstY1,
   9419                                      GLbitfield mask,
   9420                                      GLenum filter)
   9421 {
   9422    Context *context = GetValidGlobalContext();
   9423    EVENT(context, GLBlitFramebufferNV,
   9424          "context = %d, srcX0 = %d, srcY0 = %d, srcX1 = %d, srcY1 = %d, dstX0 = %d, dstY0 = %d, "
   9425          "dstX1 = %d, dstY1 = %d, mask = %s, filter = %s",
   9426          CID(context), srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1,
   9427          GLbitfieldToString(GLESEnum::ClearBufferMask, mask).c_str(),
   9428          GLenumToString(GLESEnum::BlitFramebufferFilter, filter));
   9429 
   9430    if (context)
   9431    {
   9432        SCOPED_SHARE_CONTEXT_LOCK(context);
   9433        bool isCallValid = (context->skipValidation() ||
   9434                            ValidateBlitFramebufferNV(
   9435                                context, angle::EntryPoint::GLBlitFramebufferNV, srcX0, srcY0,
   9436                                srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter));
   9437        if (isCallValid)
   9438        {
   9439            context->blitFramebufferNV(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask,
   9440                                       filter);
   9441        }
   9442        ANGLE_CAPTURE_GL(BlitFramebufferNV, isCallValid, context, srcX0, srcY0, srcX1, srcY1, dstX0,
   9443                         dstY0, dstX1, dstY1, mask, filter);
   9444    }
   9445    else
   9446    {
   9447        GenerateContextLostErrorOnCurrentGlobalContext();
   9448    }
   9449 }
   9450 
   9451 // GL_NV_pixel_buffer_object
   9452 
   9453 // GL_NV_read_depth
   9454 
   9455 // GL_NV_read_depth_stencil
   9456 
   9457 // GL_NV_read_stencil
   9458 
   9459 // GL_NV_robustness_video_memory_purge
   9460 
   9461 // GL_NV_shader_noperspective_interpolation
   9462 
   9463 // GL_OES_EGL_image
   9464 void GL_APIENTRY GL_EGLImageTargetRenderbufferStorageOES(GLenum target, GLeglImageOES image)
   9465 {
   9466    Context *context = GetValidGlobalContext();
   9467    EVENT(context, GLEGLImageTargetRenderbufferStorageOES,
   9468          "context = %d, target = %s, image = 0x%016" PRIxPTR "", CID(context),
   9469          GLenumToString(GLESEnum::AllEnums, target), (uintptr_t)image);
   9470 
   9471    if (context)
   9472    {
   9473        SCOPED_SHARE_CONTEXT_LOCK(context);
   9474        bool isCallValid = (context->skipValidation() ||
   9475                            ValidateEGLImageTargetRenderbufferStorageOES(
   9476                                context, angle::EntryPoint::GLEGLImageTargetRenderbufferStorageOES,
   9477                                target, image));
   9478        if (isCallValid)
   9479        {
   9480            context->eGLImageTargetRenderbufferStorage(target, image);
   9481        }
   9482        ANGLE_CAPTURE_GL(EGLImageTargetRenderbufferStorageOES, isCallValid, context, target, image);
   9483    }
   9484    else
   9485    {
   9486        GenerateContextLostErrorOnCurrentGlobalContext();
   9487    }
   9488 }
   9489 
   9490 void GL_APIENTRY GL_EGLImageTargetTexture2DOES(GLenum target, GLeglImageOES image)
   9491 {
   9492    Context *context = GetValidGlobalContext();
   9493    EVENT(context, GLEGLImageTargetTexture2DOES,
   9494          "context = %d, target = %s, image = 0x%016" PRIxPTR "", CID(context),
   9495          GLenumToString(GLESEnum::AllEnums, target), (uintptr_t)image);
   9496 
   9497    if (context)
   9498    {
   9499        TextureType targetPacked = PackParam<TextureType>(target);
   9500        SCOPED_SHARE_CONTEXT_LOCK(context);
   9501        bool isCallValid =
   9502            (context->skipValidation() ||
   9503             ValidateEGLImageTargetTexture2DOES(
   9504                 context, angle::EntryPoint::GLEGLImageTargetTexture2DOES, targetPacked, image));
   9505        if (isCallValid)
   9506        {
   9507            context->eGLImageTargetTexture2D(targetPacked, image);
   9508        }
   9509        ANGLE_CAPTURE_GL(EGLImageTargetTexture2DOES, isCallValid, context, targetPacked, image);
   9510    }
   9511    else
   9512    {
   9513        GenerateContextLostErrorOnCurrentGlobalContext();
   9514    }
   9515 }
   9516 
   9517 // GL_OES_EGL_image_external
   9518 
   9519 // GL_OES_EGL_image_external_essl3
   9520 
   9521 // GL_OES_compressed_ETC1_RGB8_texture
   9522 
   9523 // GL_OES_compressed_paletted_texture
   9524 
   9525 // GL_OES_copy_image
   9526 void GL_APIENTRY GL_CopyImageSubDataOES(GLuint srcName,
   9527                                        GLenum srcTarget,
   9528                                        GLint srcLevel,
   9529                                        GLint srcX,
   9530                                        GLint srcY,
   9531                                        GLint srcZ,
   9532                                        GLuint dstName,
   9533                                        GLenum dstTarget,
   9534                                        GLint dstLevel,
   9535                                        GLint dstX,
   9536                                        GLint dstY,
   9537                                        GLint dstZ,
   9538                                        GLsizei srcWidth,
   9539                                        GLsizei srcHeight,
   9540                                        GLsizei srcDepth)
   9541 {
   9542    Context *context = GetValidGlobalContext();
   9543    EVENT(context, GLCopyImageSubDataOES,
   9544          "context = %d, srcName = %u, srcTarget = %s, srcLevel = %d, srcX = %d, srcY = %d, srcZ = "
   9545          "%d, dstName = %u, dstTarget = %s, dstLevel = %d, dstX = %d, dstY = %d, dstZ = %d, "
   9546          "srcWidth = %d, srcHeight = %d, srcDepth = %d",
   9547          CID(context), srcName, GLenumToString(GLESEnum::CopyBufferSubDataTarget, srcTarget),
   9548          srcLevel, srcX, srcY, srcZ, dstName,
   9549          GLenumToString(GLESEnum::CopyBufferSubDataTarget, dstTarget), dstLevel, dstX, dstY, dstZ,
   9550          srcWidth, srcHeight, srcDepth);
   9551 
   9552    if (context)
   9553    {
   9554        SCOPED_SHARE_CONTEXT_LOCK(context);
   9555        bool isCallValid = (context->skipValidation() ||
   9556                            ValidateCopyImageSubDataOES(
   9557                                context, angle::EntryPoint::GLCopyImageSubDataOES, srcName,
   9558                                srcTarget, srcLevel, srcX, srcY, srcZ, dstName, dstTarget, dstLevel,
   9559                                dstX, dstY, dstZ, srcWidth, srcHeight, srcDepth));
   9560        if (isCallValid)
   9561        {
   9562            context->copyImageSubData(srcName, srcTarget, srcLevel, srcX, srcY, srcZ, dstName,
   9563                                      dstTarget, dstLevel, dstX, dstY, dstZ, srcWidth, srcHeight,
   9564                                      srcDepth);
   9565        }
   9566        ANGLE_CAPTURE_GL(CopyImageSubDataOES, isCallValid, context, srcName, srcTarget, srcLevel,
   9567                         srcX, srcY, srcZ, dstName, dstTarget, dstLevel, dstX, dstY, dstZ, srcWidth,
   9568                         srcHeight, srcDepth);
   9569    }
   9570    else
   9571    {
   9572        GenerateContextLostErrorOnCurrentGlobalContext();
   9573    }
   9574 }
   9575 
   9576 // GL_OES_depth24
   9577 
   9578 // GL_OES_depth32
   9579 
   9580 // GL_OES_depth_texture
   9581 
   9582 // GL_OES_draw_buffers_indexed
   9583 void GL_APIENTRY GL_BlendEquationSeparateiOES(GLuint buf, GLenum modeRGB, GLenum modeAlpha)
   9584 {
   9585    Context *context = GetValidGlobalContext();
   9586    EVENT(context, GLBlendEquationSeparateiOES,
   9587          "context = %d, buf = %u, modeRGB = %s, modeAlpha = %s", CID(context), buf,
   9588          GLenumToString(GLESEnum::BlendEquationModeEXT, modeRGB),
   9589          GLenumToString(GLESEnum::BlendEquationModeEXT, modeAlpha));
   9590 
   9591    if (context)
   9592    {
   9593        SCOPED_SHARE_CONTEXT_LOCK(context);
   9594        bool isCallValid =
   9595            (context->skipValidation() ||
   9596             ValidateBlendEquationSeparateiOES(
   9597                 context, angle::EntryPoint::GLBlendEquationSeparateiOES, buf, modeRGB, modeAlpha));
   9598        if (isCallValid)
   9599        {
   9600            context->blendEquationSeparatei(buf, modeRGB, modeAlpha);
   9601        }
   9602        ANGLE_CAPTURE_GL(BlendEquationSeparateiOES, isCallValid, context, buf, modeRGB, modeAlpha);
   9603    }
   9604    else
   9605    {
   9606        GenerateContextLostErrorOnCurrentGlobalContext();
   9607    }
   9608 }
   9609 
   9610 void GL_APIENTRY GL_BlendEquationiOES(GLuint buf, GLenum mode)
   9611 {
   9612    Context *context = GetValidGlobalContext();
   9613    EVENT(context, GLBlendEquationiOES, "context = %d, buf = %u, mode = %s", CID(context), buf,
   9614          GLenumToString(GLESEnum::BlendEquationModeEXT, mode));
   9615 
   9616    if (context)
   9617    {
   9618        SCOPED_SHARE_CONTEXT_LOCK(context);
   9619        bool isCallValid =
   9620            (context->skipValidation() ||
   9621             ValidateBlendEquationiOES(context, angle::EntryPoint::GLBlendEquationiOES, buf, mode));
   9622        if (isCallValid)
   9623        {
   9624            context->blendEquationi(buf, mode);
   9625        }
   9626        ANGLE_CAPTURE_GL(BlendEquationiOES, isCallValid, context, buf, mode);
   9627    }
   9628    else
   9629    {
   9630        GenerateContextLostErrorOnCurrentGlobalContext();
   9631    }
   9632 }
   9633 
   9634 void GL_APIENTRY
   9635 GL_BlendFuncSeparateiOES(GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)
   9636 {
   9637    Context *context = GetValidGlobalContext();
   9638    EVENT(context, GLBlendFuncSeparateiOES,
   9639          "context = %d, buf = %u, srcRGB = %s, dstRGB = %s, srcAlpha = %s, dstAlpha = %s",
   9640          CID(context), buf, GLenumToString(GLESEnum::BlendingFactor, srcRGB),
   9641          GLenumToString(GLESEnum::BlendingFactor, dstRGB),
   9642          GLenumToString(GLESEnum::BlendingFactor, srcAlpha),
   9643          GLenumToString(GLESEnum::BlendingFactor, dstAlpha));
   9644 
   9645    if (context)
   9646    {
   9647        SCOPED_SHARE_CONTEXT_LOCK(context);
   9648        bool isCallValid =
   9649            (context->skipValidation() ||
   9650             ValidateBlendFuncSeparateiOES(context, angle::EntryPoint::GLBlendFuncSeparateiOES, buf,
   9651                                           srcRGB, dstRGB, srcAlpha, dstAlpha));
   9652        if (isCallValid)
   9653        {
   9654            context->blendFuncSeparatei(buf, srcRGB, dstRGB, srcAlpha, dstAlpha);
   9655        }
   9656        ANGLE_CAPTURE_GL(BlendFuncSeparateiOES, isCallValid, context, buf, srcRGB, dstRGB, srcAlpha,
   9657                         dstAlpha);
   9658    }
   9659    else
   9660    {
   9661        GenerateContextLostErrorOnCurrentGlobalContext();
   9662    }
   9663 }
   9664 
   9665 void GL_APIENTRY GL_BlendFunciOES(GLuint buf, GLenum src, GLenum dst)
   9666 {
   9667    Context *context = GetValidGlobalContext();
   9668    EVENT(context, GLBlendFunciOES, "context = %d, buf = %u, src = %s, dst = %s", CID(context), buf,
   9669          GLenumToString(GLESEnum::BlendingFactor, src),
   9670          GLenumToString(GLESEnum::BlendingFactor, dst));
   9671 
   9672    if (context)
   9673    {
   9674        SCOPED_SHARE_CONTEXT_LOCK(context);
   9675        bool isCallValid =
   9676            (context->skipValidation() ||
   9677             ValidateBlendFunciOES(context, angle::EntryPoint::GLBlendFunciOES, buf, src, dst));
   9678        if (isCallValid)
   9679        {
   9680            context->blendFunci(buf, src, dst);
   9681        }
   9682        ANGLE_CAPTURE_GL(BlendFunciOES, isCallValid, context, buf, src, dst);
   9683    }
   9684    else
   9685    {
   9686        GenerateContextLostErrorOnCurrentGlobalContext();
   9687    }
   9688 }
   9689 
   9690 void GL_APIENTRY GL_ColorMaskiOES(GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a)
   9691 {
   9692    Context *context = GetValidGlobalContext();
   9693    EVENT(context, GLColorMaskiOES, "context = %d, index = %u, r = %s, g = %s, b = %s, a = %s",
   9694          CID(context), index, GLbooleanToString(r), GLbooleanToString(g), GLbooleanToString(b),
   9695          GLbooleanToString(a));
   9696 
   9697    if (context)
   9698    {
   9699        SCOPED_SHARE_CONTEXT_LOCK(context);
   9700        bool isCallValid =
   9701            (context->skipValidation() ||
   9702             ValidateColorMaskiOES(context, angle::EntryPoint::GLColorMaskiOES, index, r, g, b, a));
   9703        if (isCallValid)
   9704        {
   9705            context->colorMaski(index, r, g, b, a);
   9706        }
   9707        ANGLE_CAPTURE_GL(ColorMaskiOES, isCallValid, context, index, r, g, b, a);
   9708    }
   9709    else
   9710    {
   9711        GenerateContextLostErrorOnCurrentGlobalContext();
   9712    }
   9713 }
   9714 
   9715 void GL_APIENTRY GL_DisableiOES(GLenum target, GLuint index)
   9716 {
   9717    Context *context = GetValidGlobalContext();
   9718    EVENT(context, GLDisableiOES, "context = %d, target = %s, index = %u", CID(context),
   9719          GLenumToString(GLESEnum::EnableCap, target), index);
   9720 
   9721    if (context)
   9722    {
   9723        SCOPED_SHARE_CONTEXT_LOCK(context);
   9724        bool isCallValid =
   9725            (context->skipValidation() ||
   9726             ValidateDisableiOES(context, angle::EntryPoint::GLDisableiOES, target, index));
   9727        if (isCallValid)
   9728        {
   9729            context->disablei(target, index);
   9730        }
   9731        ANGLE_CAPTURE_GL(DisableiOES, isCallValid, context, target, index);
   9732    }
   9733    else
   9734    {
   9735        GenerateContextLostErrorOnCurrentGlobalContext();
   9736    }
   9737 }
   9738 
   9739 void GL_APIENTRY GL_EnableiOES(GLenum target, GLuint index)
   9740 {
   9741    Context *context = GetValidGlobalContext();
   9742    EVENT(context, GLEnableiOES, "context = %d, target = %s, index = %u", CID(context),
   9743          GLenumToString(GLESEnum::EnableCap, target), index);
   9744 
   9745    if (context)
   9746    {
   9747        SCOPED_SHARE_CONTEXT_LOCK(context);
   9748        bool isCallValid =
   9749            (context->skipValidation() ||
   9750             ValidateEnableiOES(context, angle::EntryPoint::GLEnableiOES, target, index));
   9751        if (isCallValid)
   9752        {
   9753            context->enablei(target, index);
   9754        }
   9755        ANGLE_CAPTURE_GL(EnableiOES, isCallValid, context, target, index);
   9756    }
   9757    else
   9758    {
   9759        GenerateContextLostErrorOnCurrentGlobalContext();
   9760    }
   9761 }
   9762 
   9763 GLboolean GL_APIENTRY GL_IsEnablediOES(GLenum target, GLuint index)
   9764 {
   9765    Context *context = GetValidGlobalContext();
   9766    EVENT(context, GLIsEnablediOES, "context = %d, target = %s, index = %u", CID(context),
   9767          GLenumToString(GLESEnum::EnableCap, target), index);
   9768 
   9769    GLboolean returnValue;
   9770    if (context)
   9771    {
   9772        SCOPED_SHARE_CONTEXT_LOCK(context);
   9773        bool isCallValid =
   9774            (context->skipValidation() ||
   9775             ValidateIsEnablediOES(context, angle::EntryPoint::GLIsEnablediOES, target, index));
   9776        if (isCallValid)
   9777        {
   9778            returnValue = context->isEnabledi(target, index);
   9779        }
   9780        else
   9781        {
   9782            returnValue = GetDefaultReturnValue<angle::EntryPoint::GLIsEnablediOES, GLboolean>();
   9783        }
   9784        ANGLE_CAPTURE_GL(IsEnablediOES, isCallValid, context, target, index, returnValue);
   9785    }
   9786    else
   9787    {
   9788        GenerateContextLostErrorOnCurrentGlobalContext();
   9789        returnValue = GetDefaultReturnValue<angle::EntryPoint::GLIsEnablediOES, GLboolean>();
   9790    }
   9791    return returnValue;
   9792 }
   9793 
   9794 // GL_OES_draw_elements_base_vertex
   9795 void GL_APIENTRY GL_DrawElementsBaseVertexOES(GLenum mode,
   9796                                              GLsizei count,
   9797                                              GLenum type,
   9798                                              const void *indices,
   9799                                              GLint basevertex)
   9800 {
   9801    Context *context = GetValidGlobalContext();
   9802    EVENT(context, GLDrawElementsBaseVertexOES,
   9803          "context = %d, mode = %s, count = %d, type = %s, indices = 0x%016" PRIxPTR
   9804          ", basevertex = %d",
   9805          CID(context), GLenumToString(GLESEnum::PrimitiveType, mode), count,
   9806          GLenumToString(GLESEnum::DrawElementsType, type), (uintptr_t)indices, basevertex);
   9807 
   9808    if (context)
   9809    {
   9810        PrimitiveMode modePacked    = PackParam<PrimitiveMode>(mode);
   9811        DrawElementsType typePacked = PackParam<DrawElementsType>(type);
   9812        SCOPED_SHARE_CONTEXT_LOCK(context);
   9813        bool isCallValid = (context->skipValidation() ||
   9814                            ValidateDrawElementsBaseVertexOES(
   9815                                context, angle::EntryPoint::GLDrawElementsBaseVertexOES, modePacked,
   9816                                count, typePacked, indices, basevertex));
   9817        if (isCallValid)
   9818        {
   9819            context->drawElementsBaseVertex(modePacked, count, typePacked, indices, basevertex);
   9820        }
   9821        ANGLE_CAPTURE_GL(DrawElementsBaseVertexOES, isCallValid, context, modePacked, count,
   9822                         typePacked, indices, basevertex);
   9823    }
   9824    else
   9825    {
   9826        GenerateContextLostErrorOnCurrentGlobalContext();
   9827    }
   9828 }
   9829 
   9830 void GL_APIENTRY GL_DrawElementsInstancedBaseVertexOES(GLenum mode,
   9831                                                       GLsizei count,
   9832                                                       GLenum type,
   9833                                                       const void *indices,
   9834                                                       GLsizei instancecount,
   9835                                                       GLint basevertex)
   9836 {
   9837    Context *context = GetValidGlobalContext();
   9838    EVENT(context, GLDrawElementsInstancedBaseVertexOES,
   9839          "context = %d, mode = %s, count = %d, type = %s, indices = 0x%016" PRIxPTR
   9840          ", instancecount = %d, basevertex = %d",
   9841          CID(context), GLenumToString(GLESEnum::PrimitiveType, mode), count,
   9842          GLenumToString(GLESEnum::DrawElementsType, type), (uintptr_t)indices, instancecount,
   9843          basevertex);
   9844 
   9845    if (context)
   9846    {
   9847        PrimitiveMode modePacked    = PackParam<PrimitiveMode>(mode);
   9848        DrawElementsType typePacked = PackParam<DrawElementsType>(type);
   9849        SCOPED_SHARE_CONTEXT_LOCK(context);
   9850        bool isCallValid = (context->skipValidation() ||
   9851                            ValidateDrawElementsInstancedBaseVertexOES(
   9852                                context, angle::EntryPoint::GLDrawElementsInstancedBaseVertexOES,
   9853                                modePacked, count, typePacked, indices, instancecount, basevertex));
   9854        if (isCallValid)
   9855        {
   9856            context->drawElementsInstancedBaseVertex(modePacked, count, typePacked, indices,
   9857                                                     instancecount, basevertex);
   9858        }
   9859        ANGLE_CAPTURE_GL(DrawElementsInstancedBaseVertexOES, isCallValid, context, modePacked,
   9860                         count, typePacked, indices, instancecount, basevertex);
   9861    }
   9862    else
   9863    {
   9864        GenerateContextLostErrorOnCurrentGlobalContext();
   9865    }
   9866 }
   9867 
   9868 void GL_APIENTRY GL_DrawRangeElementsBaseVertexOES(GLenum mode,
   9869                                                   GLuint start,
   9870                                                   GLuint end,
   9871                                                   GLsizei count,
   9872                                                   GLenum type,
   9873                                                   const void *indices,
   9874                                                   GLint basevertex)
   9875 {
   9876    Context *context = GetValidGlobalContext();
   9877    EVENT(context, GLDrawRangeElementsBaseVertexOES,
   9878          "context = %d, mode = %s, start = %u, end = %u, count = %d, type = %s, indices = "
   9879          "0x%016" PRIxPTR ", basevertex = %d",
   9880          CID(context), GLenumToString(GLESEnum::PrimitiveType, mode), start, end, count,
   9881          GLenumToString(GLESEnum::DrawElementsType, type), (uintptr_t)indices, basevertex);
   9882 
   9883    if (context)
   9884    {
   9885        PrimitiveMode modePacked    = PackParam<PrimitiveMode>(mode);
   9886        DrawElementsType typePacked = PackParam<DrawElementsType>(type);
   9887        SCOPED_SHARE_CONTEXT_LOCK(context);
   9888        bool isCallValid = (context->skipValidation() ||
   9889                            ValidateDrawRangeElementsBaseVertexOES(
   9890                                context, angle::EntryPoint::GLDrawRangeElementsBaseVertexOES,
   9891                                modePacked, start, end, count, typePacked, indices, basevertex));
   9892        if (isCallValid)
   9893        {
   9894            context->drawRangeElementsBaseVertex(modePacked, start, end, count, typePacked, indices,
   9895                                                 basevertex);
   9896        }
   9897        ANGLE_CAPTURE_GL(DrawRangeElementsBaseVertexOES, isCallValid, context, modePacked, start,
   9898                         end, count, typePacked, indices, basevertex);
   9899    }
   9900    else
   9901    {
   9902        GenerateContextLostErrorOnCurrentGlobalContext();
   9903    }
   9904 }
   9905 
   9906 // MultiDrawElementsBaseVertexEXT is already defined.
   9907 
   9908 // GL_OES_draw_texture
   9909 void GL_APIENTRY GL_DrawTexfOES(GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height)
   9910 {
   9911    Context *context = GetValidGlobalContext();
   9912    EVENT(context, GLDrawTexfOES, "context = %d, x = %f, y = %f, z = %f, width = %f, height = %f",
   9913          CID(context), x, y, z, width, height);
   9914 
   9915    if (context)
   9916    {
   9917        SCOPED_SHARE_CONTEXT_LOCK(context);
   9918        bool isCallValid = (context->skipValidation() ||
   9919                            ValidateDrawTexfOES(context, angle::EntryPoint::GLDrawTexfOES, x, y, z,
   9920                                                width, height));
   9921        if (isCallValid)
   9922        {
   9923            context->drawTexf(x, y, z, width, height);
   9924        }
   9925        ANGLE_CAPTURE_GL(DrawTexfOES, isCallValid, context, x, y, z, width, height);
   9926    }
   9927    else
   9928    {
   9929        GenerateContextLostErrorOnCurrentGlobalContext();
   9930    }
   9931 }
   9932 
   9933 void GL_APIENTRY GL_DrawTexfvOES(const GLfloat *coords)
   9934 {
   9935    Context *context = GetValidGlobalContext();
   9936    EVENT(context, GLDrawTexfvOES, "context = %d, coords = 0x%016" PRIxPTR "", CID(context),
   9937          (uintptr_t)coords);
   9938 
   9939    if (context)
   9940    {
   9941        SCOPED_SHARE_CONTEXT_LOCK(context);
   9942        bool isCallValid =
   9943            (context->skipValidation() ||
   9944             ValidateDrawTexfvOES(context, angle::EntryPoint::GLDrawTexfvOES, coords));
   9945        if (isCallValid)
   9946        {
   9947            context->drawTexfv(coords);
   9948        }
   9949        ANGLE_CAPTURE_GL(DrawTexfvOES, isCallValid, context, coords);
   9950    }
   9951    else
   9952    {
   9953        GenerateContextLostErrorOnCurrentGlobalContext();
   9954    }
   9955 }
   9956 
   9957 void GL_APIENTRY GL_DrawTexiOES(GLint x, GLint y, GLint z, GLint width, GLint height)
   9958 {
   9959    Context *context = GetValidGlobalContext();
   9960    EVENT(context, GLDrawTexiOES, "context = %d, x = %d, y = %d, z = %d, width = %d, height = %d",
   9961          CID(context), x, y, z, width, height);
   9962 
   9963    if (context)
   9964    {
   9965        SCOPED_SHARE_CONTEXT_LOCK(context);
   9966        bool isCallValid = (context->skipValidation() ||
   9967                            ValidateDrawTexiOES(context, angle::EntryPoint::GLDrawTexiOES, x, y, z,
   9968                                                width, height));
   9969        if (isCallValid)
   9970        {
   9971            context->drawTexi(x, y, z, width, height);
   9972        }
   9973        ANGLE_CAPTURE_GL(DrawTexiOES, isCallValid, context, x, y, z, width, height);
   9974    }
   9975    else
   9976    {
   9977        GenerateContextLostErrorOnCurrentGlobalContext();
   9978    }
   9979 }
   9980 
   9981 void GL_APIENTRY GL_DrawTexivOES(const GLint *coords)
   9982 {
   9983    Context *context = GetValidGlobalContext();
   9984    EVENT(context, GLDrawTexivOES, "context = %d, coords = 0x%016" PRIxPTR "", CID(context),
   9985          (uintptr_t)coords);
   9986 
   9987    if (context)
   9988    {
   9989        SCOPED_SHARE_CONTEXT_LOCK(context);
   9990        bool isCallValid =
   9991            (context->skipValidation() ||
   9992             ValidateDrawTexivOES(context, angle::EntryPoint::GLDrawTexivOES, coords));
   9993        if (isCallValid)
   9994        {
   9995            context->drawTexiv(coords);
   9996        }
   9997        ANGLE_CAPTURE_GL(DrawTexivOES, isCallValid, context, coords);
   9998    }
   9999    else
  10000    {
  10001        GenerateContextLostErrorOnCurrentGlobalContext();
  10002    }
  10003 }
  10004 
  10005 void GL_APIENTRY GL_DrawTexsOES(GLshort x, GLshort y, GLshort z, GLshort width, GLshort height)
  10006 {
  10007    Context *context = GetValidGlobalContext();
  10008    EVENT(context, GLDrawTexsOES, "context = %d, x = %d, y = %d, z = %d, width = %d, height = %d",
  10009          CID(context), x, y, z, width, height);
  10010 
  10011    if (context)
  10012    {
  10013        SCOPED_SHARE_CONTEXT_LOCK(context);
  10014        bool isCallValid = (context->skipValidation() ||
  10015                            ValidateDrawTexsOES(context, angle::EntryPoint::GLDrawTexsOES, x, y, z,
  10016                                                width, height));
  10017        if (isCallValid)
  10018        {
  10019            context->drawTexs(x, y, z, width, height);
  10020        }
  10021        ANGLE_CAPTURE_GL(DrawTexsOES, isCallValid, context, x, y, z, width, height);
  10022    }
  10023    else
  10024    {
  10025        GenerateContextLostErrorOnCurrentGlobalContext();
  10026    }
  10027 }
  10028 
  10029 void GL_APIENTRY GL_DrawTexsvOES(const GLshort *coords)
  10030 {
  10031    Context *context = GetValidGlobalContext();
  10032    EVENT(context, GLDrawTexsvOES, "context = %d, coords = 0x%016" PRIxPTR "", CID(context),
  10033          (uintptr_t)coords);
  10034 
  10035    if (context)
  10036    {
  10037        SCOPED_SHARE_CONTEXT_LOCK(context);
  10038        bool isCallValid =
  10039            (context->skipValidation() ||
  10040             ValidateDrawTexsvOES(context, angle::EntryPoint::GLDrawTexsvOES, coords));
  10041        if (isCallValid)
  10042        {
  10043            context->drawTexsv(coords);
  10044        }
  10045        ANGLE_CAPTURE_GL(DrawTexsvOES, isCallValid, context, coords);
  10046    }
  10047    else
  10048    {
  10049        GenerateContextLostErrorOnCurrentGlobalContext();
  10050    }
  10051 }
  10052 
  10053 void GL_APIENTRY GL_DrawTexxOES(GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height)
  10054 {
  10055    Context *context = GetValidGlobalContext();
  10056    EVENT(context, GLDrawTexxOES,
  10057          "context = %d, x = 0x%X, y = 0x%X, z = 0x%X, width = 0x%X, height = 0x%X", CID(context),
  10058          x, y, z, width, height);
  10059 
  10060    if (context)
  10061    {
  10062        SCOPED_SHARE_CONTEXT_LOCK(context);
  10063        bool isCallValid = (context->skipValidation() ||
  10064                            ValidateDrawTexxOES(context, angle::EntryPoint::GLDrawTexxOES, x, y, z,
  10065                                                width, height));
  10066        if (isCallValid)
  10067        {
  10068            context->drawTexx(x, y, z, width, height);
  10069        }
  10070        ANGLE_CAPTURE_GL(DrawTexxOES, isCallValid, context, x, y, z, width, height);
  10071    }
  10072    else
  10073    {
  10074        GenerateContextLostErrorOnCurrentGlobalContext();
  10075    }
  10076 }
  10077 
  10078 void GL_APIENTRY GL_DrawTexxvOES(const GLfixed *coords)
  10079 {
  10080    Context *context = GetValidGlobalContext();
  10081    EVENT(context, GLDrawTexxvOES, "context = %d, coords = 0x%016" PRIxPTR "", CID(context),
  10082          (uintptr_t)coords);
  10083 
  10084    if (context)
  10085    {
  10086        SCOPED_SHARE_CONTEXT_LOCK(context);
  10087        bool isCallValid =
  10088            (context->skipValidation() ||
  10089             ValidateDrawTexxvOES(context, angle::EntryPoint::GLDrawTexxvOES, coords));
  10090        if (isCallValid)
  10091        {
  10092            context->drawTexxv(coords);
  10093        }
  10094        ANGLE_CAPTURE_GL(DrawTexxvOES, isCallValid, context, coords);
  10095    }
  10096    else
  10097    {
  10098        GenerateContextLostErrorOnCurrentGlobalContext();
  10099    }
  10100 }
  10101 
  10102 // GL_OES_element_index_uint
  10103 
  10104 // GL_OES_fbo_render_mipmap
  10105 
  10106 // GL_OES_framebuffer_object
  10107 void GL_APIENTRY GL_BindFramebufferOES(GLenum target, GLuint framebuffer)
  10108 {
  10109    Context *context = GetValidGlobalContext();
  10110    EVENT(context, GLBindFramebufferOES, "context = %d, target = %s, framebuffer = %u",
  10111          CID(context), GLenumToString(GLESEnum::FramebufferTarget, target), framebuffer);
  10112 
  10113    if (context)
  10114    {
  10115        FramebufferID framebufferPacked = PackParam<FramebufferID>(framebuffer);
  10116        SCOPED_SHARE_CONTEXT_LOCK(context);
  10117        bool isCallValid =
  10118            (context->skipValidation() ||
  10119             ValidateBindFramebufferOES(context, angle::EntryPoint::GLBindFramebufferOES, target,
  10120                                        framebufferPacked));
  10121        if (isCallValid)
  10122        {
  10123            context->bindFramebuffer(target, framebufferPacked);
  10124        }
  10125        ANGLE_CAPTURE_GL(BindFramebufferOES, isCallValid, context, target, framebufferPacked);
  10126    }
  10127    else
  10128    {
  10129        GenerateContextLostErrorOnCurrentGlobalContext();
  10130    }
  10131 }
  10132 
  10133 void GL_APIENTRY GL_BindRenderbufferOES(GLenum target, GLuint renderbuffer)
  10134 {
  10135    Context *context = GetValidGlobalContext();
  10136    EVENT(context, GLBindRenderbufferOES, "context = %d, target = %s, renderbuffer = %u",
  10137          CID(context), GLenumToString(GLESEnum::RenderbufferTarget, target), renderbuffer);
  10138 
  10139    if (context)
  10140    {
  10141        RenderbufferID renderbufferPacked = PackParam<RenderbufferID>(renderbuffer);
  10142        SCOPED_SHARE_CONTEXT_LOCK(context);
  10143        bool isCallValid =
  10144            (context->skipValidation() ||
  10145             ValidateBindRenderbufferOES(context, angle::EntryPoint::GLBindRenderbufferOES, target,
  10146                                         renderbufferPacked));
  10147        if (isCallValid)
  10148        {
  10149            context->bindRenderbuffer(target, renderbufferPacked);
  10150        }
  10151        ANGLE_CAPTURE_GL(BindRenderbufferOES, isCallValid, context, target, renderbufferPacked);
  10152    }
  10153    else
  10154    {
  10155        GenerateContextLostErrorOnCurrentGlobalContext();
  10156    }
  10157 }
  10158 
  10159 GLenum GL_APIENTRY GL_CheckFramebufferStatusOES(GLenum target)
  10160 {
  10161    Context *context = GetValidGlobalContext();
  10162    EVENT(context, GLCheckFramebufferStatusOES, "context = %d, target = %s", CID(context),
  10163          GLenumToString(GLESEnum::FramebufferTarget, target));
  10164 
  10165    GLenum returnValue;
  10166    if (context)
  10167    {
  10168        SCOPED_SHARE_CONTEXT_LOCK(context);
  10169        bool isCallValid = (context->skipValidation() ||
  10170                            ValidateCheckFramebufferStatusOES(
  10171                                context, angle::EntryPoint::GLCheckFramebufferStatusOES, target));
  10172        if (isCallValid)
  10173        {
  10174            returnValue = context->checkFramebufferStatus(target);
  10175        }
  10176        else
  10177        {
  10178            returnValue =
  10179                GetDefaultReturnValue<angle::EntryPoint::GLCheckFramebufferStatusOES, GLenum>();
  10180        }
  10181        ANGLE_CAPTURE_GL(CheckFramebufferStatusOES, isCallValid, context, target, returnValue);
  10182    }
  10183    else
  10184    {
  10185        GenerateContextLostErrorOnCurrentGlobalContext();
  10186        returnValue =
  10187            GetDefaultReturnValue<angle::EntryPoint::GLCheckFramebufferStatusOES, GLenum>();
  10188    }
  10189    return returnValue;
  10190 }
  10191 
  10192 void GL_APIENTRY GL_DeleteFramebuffersOES(GLsizei n, const GLuint *framebuffers)
  10193 {
  10194    Context *context = GetValidGlobalContext();
  10195    EVENT(context, GLDeleteFramebuffersOES,
  10196          "context = %d, n = %d, framebuffers = 0x%016" PRIxPTR "", CID(context), n,
  10197          (uintptr_t)framebuffers);
  10198 
  10199    if (context)
  10200    {
  10201        const FramebufferID *framebuffersPacked = PackParam<const FramebufferID *>(framebuffers);
  10202        SCOPED_SHARE_CONTEXT_LOCK(context);
  10203        bool isCallValid =
  10204            (context->skipValidation() ||
  10205             ValidateDeleteFramebuffersOES(context, angle::EntryPoint::GLDeleteFramebuffersOES, n,
  10206                                           framebuffersPacked));
  10207        if (isCallValid)
  10208        {
  10209            context->deleteFramebuffers(n, framebuffersPacked);
  10210        }
  10211        ANGLE_CAPTURE_GL(DeleteFramebuffersOES, isCallValid, context, n, framebuffersPacked);
  10212    }
  10213    else
  10214    {
  10215        GenerateContextLostErrorOnCurrentGlobalContext();
  10216    }
  10217 }
  10218 
  10219 void GL_APIENTRY GL_DeleteRenderbuffersOES(GLsizei n, const GLuint *renderbuffers)
  10220 {
  10221    Context *context = GetValidGlobalContext();
  10222    EVENT(context, GLDeleteRenderbuffersOES,
  10223          "context = %d, n = %d, renderbuffers = 0x%016" PRIxPTR "", CID(context), n,
  10224          (uintptr_t)renderbuffers);
  10225 
  10226    if (context)
  10227    {
  10228        const RenderbufferID *renderbuffersPacked =
  10229            PackParam<const RenderbufferID *>(renderbuffers);
  10230        SCOPED_SHARE_CONTEXT_LOCK(context);
  10231        bool isCallValid =
  10232            (context->skipValidation() ||
  10233             ValidateDeleteRenderbuffersOES(context, angle::EntryPoint::GLDeleteRenderbuffersOES, n,
  10234                                            renderbuffersPacked));
  10235        if (isCallValid)
  10236        {
  10237            context->deleteRenderbuffers(n, renderbuffersPacked);
  10238        }
  10239        ANGLE_CAPTURE_GL(DeleteRenderbuffersOES, isCallValid, context, n, renderbuffersPacked);
  10240    }
  10241    else
  10242    {
  10243        GenerateContextLostErrorOnCurrentGlobalContext();
  10244    }
  10245 }
  10246 
  10247 void GL_APIENTRY GL_FramebufferRenderbufferOES(GLenum target,
  10248                                               GLenum attachment,
  10249                                               GLenum renderbuffertarget,
  10250                                               GLuint renderbuffer)
  10251 {
  10252    Context *context = GetValidGlobalContext();
  10253    EVENT(context, GLFramebufferRenderbufferOES,
  10254          "context = %d, target = %s, attachment = %s, renderbuffertarget = %s, renderbuffer = %u",
  10255          CID(context), GLenumToString(GLESEnum::FramebufferTarget, target),
  10256          GLenumToString(GLESEnum::FramebufferAttachment, attachment),
  10257          GLenumToString(GLESEnum::RenderbufferTarget, renderbuffertarget), renderbuffer);
  10258 
  10259    if (context)
  10260    {
  10261        RenderbufferID renderbufferPacked = PackParam<RenderbufferID>(renderbuffer);
  10262        SCOPED_SHARE_CONTEXT_LOCK(context);
  10263        bool isCallValid = (context->skipValidation() ||
  10264                            ValidateFramebufferRenderbufferOES(
  10265                                context, angle::EntryPoint::GLFramebufferRenderbufferOES, target,
  10266                                attachment, renderbuffertarget, renderbufferPacked));
  10267        if (isCallValid)
  10268        {
  10269            context->framebufferRenderbuffer(target, attachment, renderbuffertarget,
  10270                                             renderbufferPacked);
  10271        }
  10272        ANGLE_CAPTURE_GL(FramebufferRenderbufferOES, isCallValid, context, target, attachment,
  10273                         renderbuffertarget, renderbufferPacked);
  10274    }
  10275    else
  10276    {
  10277        GenerateContextLostErrorOnCurrentGlobalContext();
  10278    }
  10279 }
  10280 
  10281 void GL_APIENTRY GL_FramebufferTexture2DOES(GLenum target,
  10282                                            GLenum attachment,
  10283                                            GLenum textarget,
  10284                                            GLuint texture,
  10285                                            GLint level)
  10286 {
  10287    Context *context = GetValidGlobalContext();
  10288    EVENT(context, GLFramebufferTexture2DOES,
  10289          "context = %d, target = %s, attachment = %s, textarget = %s, texture = %u, level = %d",
  10290          CID(context), GLenumToString(GLESEnum::FramebufferTarget, target),
  10291          GLenumToString(GLESEnum::FramebufferAttachment, attachment),
  10292          GLenumToString(GLESEnum::TextureTarget, textarget), texture, level);
  10293 
  10294    if (context)
  10295    {
  10296        TextureTarget textargetPacked = PackParam<TextureTarget>(textarget);
  10297        TextureID texturePacked       = PackParam<TextureID>(texture);
  10298        SCOPED_SHARE_CONTEXT_LOCK(context);
  10299        bool isCallValid = (context->skipValidation() ||
  10300                            ValidateFramebufferTexture2DOES(
  10301                                context, angle::EntryPoint::GLFramebufferTexture2DOES, target,
  10302                                attachment, textargetPacked, texturePacked, level));
  10303        if (isCallValid)
  10304        {
  10305            context->framebufferTexture2D(target, attachment, textargetPacked, texturePacked,
  10306                                          level);
  10307        }
  10308        ANGLE_CAPTURE_GL(FramebufferTexture2DOES, isCallValid, context, target, attachment,
  10309                         textargetPacked, texturePacked, level);
  10310    }
  10311    else
  10312    {
  10313        GenerateContextLostErrorOnCurrentGlobalContext();
  10314    }
  10315 }
  10316 
  10317 void GL_APIENTRY GL_GenFramebuffersOES(GLsizei n, GLuint *framebuffers)
  10318 {
  10319    Context *context = GetValidGlobalContext();
  10320    EVENT(context, GLGenFramebuffersOES, "context = %d, n = %d, framebuffers = 0x%016" PRIxPTR "",
  10321          CID(context), n, (uintptr_t)framebuffers);
  10322 
  10323    if (context)
  10324    {
  10325        FramebufferID *framebuffersPacked = PackParam<FramebufferID *>(framebuffers);
  10326        SCOPED_SHARE_CONTEXT_LOCK(context);
  10327        bool isCallValid =
  10328            (context->skipValidation() ||
  10329             ValidateGenFramebuffersOES(context, angle::EntryPoint::GLGenFramebuffersOES, n,
  10330                                        framebuffersPacked));
  10331        if (isCallValid)
  10332        {
  10333            context->genFramebuffers(n, framebuffersPacked);
  10334        }
  10335        ANGLE_CAPTURE_GL(GenFramebuffersOES, isCallValid, context, n, framebuffersPacked);
  10336    }
  10337    else
  10338    {
  10339        GenerateContextLostErrorOnCurrentGlobalContext();
  10340    }
  10341 }
  10342 
  10343 void GL_APIENTRY GL_GenRenderbuffersOES(GLsizei n, GLuint *renderbuffers)
  10344 {
  10345    Context *context = GetValidGlobalContext();
  10346    EVENT(context, GLGenRenderbuffersOES, "context = %d, n = %d, renderbuffers = 0x%016" PRIxPTR "",
  10347          CID(context), n, (uintptr_t)renderbuffers);
  10348 
  10349    if (context)
  10350    {
  10351        RenderbufferID *renderbuffersPacked = PackParam<RenderbufferID *>(renderbuffers);
  10352        SCOPED_SHARE_CONTEXT_LOCK(context);
  10353        bool isCallValid =
  10354            (context->skipValidation() ||
  10355             ValidateGenRenderbuffersOES(context, angle::EntryPoint::GLGenRenderbuffersOES, n,
  10356                                         renderbuffersPacked));
  10357        if (isCallValid)
  10358        {
  10359            context->genRenderbuffers(n, renderbuffersPacked);
  10360        }
  10361        ANGLE_CAPTURE_GL(GenRenderbuffersOES, isCallValid, context, n, renderbuffersPacked);
  10362    }
  10363    else
  10364    {
  10365        GenerateContextLostErrorOnCurrentGlobalContext();
  10366    }
  10367 }
  10368 
  10369 void GL_APIENTRY GL_GenerateMipmapOES(GLenum target)
  10370 {
  10371    Context *context = GetValidGlobalContext();
  10372    EVENT(context, GLGenerateMipmapOES, "context = %d, target = %s", CID(context),
  10373          GLenumToString(GLESEnum::TextureTarget, target));
  10374 
  10375    if (context)
  10376    {
  10377        TextureType targetPacked = PackParam<TextureType>(target);
  10378        SCOPED_SHARE_CONTEXT_LOCK(context);
  10379        bool isCallValid = (context->skipValidation() ||
  10380                            ValidateGenerateMipmapOES(
  10381                                context, angle::EntryPoint::GLGenerateMipmapOES, targetPacked));
  10382        if (isCallValid)
  10383        {
  10384            context->generateMipmap(targetPacked);
  10385        }
  10386        ANGLE_CAPTURE_GL(GenerateMipmapOES, isCallValid, context, targetPacked);
  10387    }
  10388    else
  10389    {
  10390        GenerateContextLostErrorOnCurrentGlobalContext();
  10391    }
  10392 }
  10393 
  10394 void GL_APIENTRY GL_GetFramebufferAttachmentParameterivOES(GLenum target,
  10395                                                           GLenum attachment,
  10396                                                           GLenum pname,
  10397                                                           GLint *params)
  10398 {
  10399    Context *context = GetValidGlobalContext();
  10400    EVENT(context, GLGetFramebufferAttachmentParameterivOES,
  10401          "context = %d, target = %s, attachment = %s, pname = %s, params = 0x%016" PRIxPTR "",
  10402          CID(context), GLenumToString(GLESEnum::FramebufferTarget, target),
  10403          GLenumToString(GLESEnum::FramebufferAttachment, attachment),
  10404          GLenumToString(GLESEnum::FramebufferAttachmentParameterName, pname), (uintptr_t)params);
  10405 
  10406    if (context)
  10407    {
  10408        SCOPED_SHARE_CONTEXT_LOCK(context);
  10409        bool isCallValid =
  10410            (context->skipValidation() ||
  10411             ValidateGetFramebufferAttachmentParameterivOES(
  10412                 context, angle::EntryPoint::GLGetFramebufferAttachmentParameterivOES, target,
  10413                 attachment, pname, params));
  10414        if (isCallValid)
  10415        {
  10416            context->getFramebufferAttachmentParameteriv(target, attachment, pname, params);
  10417        }
  10418        ANGLE_CAPTURE_GL(GetFramebufferAttachmentParameterivOES, isCallValid, context, target,
  10419                         attachment, pname, params);
  10420    }
  10421    else
  10422    {
  10423        GenerateContextLostErrorOnCurrentGlobalContext();
  10424    }
  10425 }
  10426 
  10427 void GL_APIENTRY GL_GetRenderbufferParameterivOES(GLenum target, GLenum pname, GLint *params)
  10428 {
  10429    Context *context = GetValidGlobalContext();
  10430    EVENT(context, GLGetRenderbufferParameterivOES,
  10431          "context = %d, target = %s, pname = %s, params = 0x%016" PRIxPTR "", CID(context),
  10432          GLenumToString(GLESEnum::RenderbufferTarget, target),
  10433          GLenumToString(GLESEnum::RenderbufferParameterName, pname), (uintptr_t)params);
  10434 
  10435    if (context)
  10436    {
  10437        SCOPED_SHARE_CONTEXT_LOCK(context);
  10438        bool isCallValid = (context->skipValidation() ||
  10439                            ValidateGetRenderbufferParameterivOES(
  10440                                context, angle::EntryPoint::GLGetRenderbufferParameterivOES, target,
  10441                                pname, params));
  10442        if (isCallValid)
  10443        {
  10444            context->getRenderbufferParameteriv(target, pname, params);
  10445        }
  10446        ANGLE_CAPTURE_GL(GetRenderbufferParameterivOES, isCallValid, context, target, pname,
  10447                         params);
  10448    }
  10449    else
  10450    {
  10451        GenerateContextLostErrorOnCurrentGlobalContext();
  10452    }
  10453 }
  10454 
  10455 GLboolean GL_APIENTRY GL_IsFramebufferOES(GLuint framebuffer)
  10456 {
  10457    Context *context = GetValidGlobalContext();
  10458    EVENT(context, GLIsFramebufferOES, "context = %d, framebuffer = %u", CID(context), framebuffer);
  10459 
  10460    GLboolean returnValue;
  10461    if (context)
  10462    {
  10463        FramebufferID framebufferPacked = PackParam<FramebufferID>(framebuffer);
  10464        SCOPED_SHARE_CONTEXT_LOCK(context);
  10465        bool isCallValid = (context->skipValidation() ||
  10466                            ValidateIsFramebufferOES(context, angle::EntryPoint::GLIsFramebufferOES,
  10467                                                     framebufferPacked));
  10468        if (isCallValid)
  10469        {
  10470            returnValue = context->isFramebuffer(framebufferPacked);
  10471        }
  10472        else
  10473        {
  10474            returnValue = GetDefaultReturnValue<angle::EntryPoint::GLIsFramebufferOES, GLboolean>();
  10475        }
  10476        ANGLE_CAPTURE_GL(IsFramebufferOES, isCallValid, context, framebufferPacked, returnValue);
  10477    }
  10478    else
  10479    {
  10480        GenerateContextLostErrorOnCurrentGlobalContext();
  10481        returnValue = GetDefaultReturnValue<angle::EntryPoint::GLIsFramebufferOES, GLboolean>();
  10482    }
  10483    return returnValue;
  10484 }
  10485 
  10486 GLboolean GL_APIENTRY GL_IsRenderbufferOES(GLuint renderbuffer)
  10487 {
  10488    Context *context = GetValidGlobalContext();
  10489    EVENT(context, GLIsRenderbufferOES, "context = %d, renderbuffer = %u", CID(context),
  10490          renderbuffer);
  10491 
  10492    GLboolean returnValue;
  10493    if (context)
  10494    {
  10495        RenderbufferID renderbufferPacked = PackParam<RenderbufferID>(renderbuffer);
  10496        SCOPED_SHARE_CONTEXT_LOCK(context);
  10497        bool isCallValid =
  10498            (context->skipValidation() ||
  10499             ValidateIsRenderbufferOES(context, angle::EntryPoint::GLIsRenderbufferOES,
  10500                                       renderbufferPacked));
  10501        if (isCallValid)
  10502        {
  10503            returnValue = context->isRenderbuffer(renderbufferPacked);
  10504        }
  10505        else
  10506        {
  10507            returnValue =
  10508                GetDefaultReturnValue<angle::EntryPoint::GLIsRenderbufferOES, GLboolean>();
  10509        }
  10510        ANGLE_CAPTURE_GL(IsRenderbufferOES, isCallValid, context, renderbufferPacked, returnValue);
  10511    }
  10512    else
  10513    {
  10514        GenerateContextLostErrorOnCurrentGlobalContext();
  10515        returnValue = GetDefaultReturnValue<angle::EntryPoint::GLIsRenderbufferOES, GLboolean>();
  10516    }
  10517    return returnValue;
  10518 }
  10519 
  10520 void GL_APIENTRY GL_RenderbufferStorageOES(GLenum target,
  10521                                           GLenum internalformat,
  10522                                           GLsizei width,
  10523                                           GLsizei height)
  10524 {
  10525    Context *context = GetValidGlobalContext();
  10526    EVENT(context, GLRenderbufferStorageOES,
  10527          "context = %d, target = %s, internalformat = %s, width = %d, height = %d", CID(context),
  10528          GLenumToString(GLESEnum::RenderbufferTarget, target),
  10529          GLenumToString(GLESEnum::InternalFormat, internalformat), width, height);
  10530 
  10531    if (context)
  10532    {
  10533        SCOPED_SHARE_CONTEXT_LOCK(context);
  10534        bool isCallValid =
  10535            (context->skipValidation() ||
  10536             ValidateRenderbufferStorageOES(context, angle::EntryPoint::GLRenderbufferStorageOES,
  10537                                            target, internalformat, width, height));
  10538        if (isCallValid)
  10539        {
  10540            context->renderbufferStorage(target, internalformat, width, height);
  10541        }
  10542        ANGLE_CAPTURE_GL(RenderbufferStorageOES, isCallValid, context, target, internalformat,
  10543                         width, height);
  10544    }
  10545    else
  10546    {
  10547        GenerateContextLostErrorOnCurrentGlobalContext();
  10548    }
  10549 }
  10550 
  10551 // GL_OES_geometry_shader
  10552 void GL_APIENTRY GL_FramebufferTextureOES(GLenum target,
  10553                                          GLenum attachment,
  10554                                          GLuint texture,
  10555                                          GLint level)
  10556 {
  10557    Context *context = GetValidGlobalContext();
  10558    EVENT(context, GLFramebufferTextureOES,
  10559          "context = %d, target = %s, attachment = %s, texture = %u, level = %d", CID(context),
  10560          GLenumToString(GLESEnum::FramebufferTarget, target),
  10561          GLenumToString(GLESEnum::FramebufferAttachment, attachment), texture, level);
  10562 
  10563    if (context)
  10564    {
  10565        TextureID texturePacked = PackParam<TextureID>(texture);
  10566        SCOPED_SHARE_CONTEXT_LOCK(context);
  10567        bool isCallValid =
  10568            (context->skipValidation() ||
  10569             ValidateFramebufferTextureOES(context, angle::EntryPoint::GLFramebufferTextureOES,
  10570                                           target, attachment, texturePacked, level));
  10571        if (isCallValid)
  10572        {
  10573            context->framebufferTexture(target, attachment, texturePacked, level);
  10574        }
  10575        ANGLE_CAPTURE_GL(FramebufferTextureOES, isCallValid, context, target, attachment,
  10576                         texturePacked, level);
  10577    }
  10578    else
  10579    {
  10580        GenerateContextLostErrorOnCurrentGlobalContext();
  10581    }
  10582 }
  10583 
  10584 // GL_OES_get_program_binary
  10585 void GL_APIENTRY GL_GetProgramBinaryOES(GLuint program,
  10586                                        GLsizei bufSize,
  10587                                        GLsizei *length,
  10588                                        GLenum *binaryFormat,
  10589                                        void *binary)
  10590 {
  10591    Context *context = GetValidGlobalContext();
  10592    EVENT(context, GLGetProgramBinaryOES,
  10593          "context = %d, program = %u, bufSize = %d, length = 0x%016" PRIxPTR
  10594          ", binaryFormat = 0x%016" PRIxPTR ", binary = 0x%016" PRIxPTR "",
  10595          CID(context), program, bufSize, (uintptr_t)length, (uintptr_t)binaryFormat,
  10596          (uintptr_t)binary);
  10597 
  10598    if (context)
  10599    {
  10600        ShaderProgramID programPacked = PackParam<ShaderProgramID>(program);
  10601        SCOPED_SHARE_CONTEXT_LOCK(context);
  10602        bool isCallValid =
  10603            (context->skipValidation() ||
  10604             ValidateGetProgramBinaryOES(context, angle::EntryPoint::GLGetProgramBinaryOES,
  10605                                         programPacked, bufSize, length, binaryFormat, binary));
  10606        if (isCallValid)
  10607        {
  10608            context->getProgramBinary(programPacked, bufSize, length, binaryFormat, binary);
  10609        }
  10610        ANGLE_CAPTURE_GL(GetProgramBinaryOES, isCallValid, context, programPacked, bufSize, length,
  10611                         binaryFormat, binary);
  10612    }
  10613    else
  10614    {
  10615        GenerateContextLostErrorOnCurrentGlobalContext();
  10616    }
  10617 }
  10618 
  10619 void GL_APIENTRY GL_ProgramBinaryOES(GLuint program,
  10620                                     GLenum binaryFormat,
  10621                                     const void *binary,
  10622                                     GLint length)
  10623 {
  10624    Context *context = GetValidGlobalContext();
  10625    EVENT(context, GLProgramBinaryOES,
  10626          "context = %d, program = %u, binaryFormat = %s, binary = 0x%016" PRIxPTR ", length = %d",
  10627          CID(context), program, GLenumToString(GLESEnum::AllEnums, binaryFormat),
  10628          (uintptr_t)binary, length);
  10629 
  10630    if (context)
  10631    {
  10632        ShaderProgramID programPacked = PackParam<ShaderProgramID>(program);
  10633        SCOPED_SHARE_CONTEXT_LOCK(context);
  10634        bool isCallValid = (context->skipValidation() ||
  10635                            ValidateProgramBinaryOES(context, angle::EntryPoint::GLProgramBinaryOES,
  10636                                                     programPacked, binaryFormat, binary, length));
  10637        if (isCallValid)
  10638        {
  10639            context->programBinary(programPacked, binaryFormat, binary, length);
  10640        }
  10641        ANGLE_CAPTURE_GL(ProgramBinaryOES, isCallValid, context, programPacked, binaryFormat,
  10642                         binary, length);
  10643    }
  10644    else
  10645    {
  10646        GenerateContextLostErrorOnCurrentGlobalContext();
  10647    }
  10648 }
  10649 
  10650 // GL_OES_mapbuffer
  10651 void GL_APIENTRY GL_GetBufferPointervOES(GLenum target, GLenum pname, void **params)
  10652 {
  10653    Context *context = GetValidGlobalContext();
  10654    EVENT(context, GLGetBufferPointervOES,
  10655          "context = %d, target = %s, pname = %s, params = 0x%016" PRIxPTR "", CID(context),
  10656          GLenumToString(GLESEnum::BufferTargetARB, target),
  10657          GLenumToString(GLESEnum::AllEnums, pname), (uintptr_t)params);
  10658 
  10659    if (context)
  10660    {
  10661        BufferBinding targetPacked = PackParam<BufferBinding>(target);
  10662        SCOPED_SHARE_CONTEXT_LOCK(context);
  10663        bool isCallValid =
  10664            (context->skipValidation() ||
  10665             ValidateGetBufferPointervOES(context, angle::EntryPoint::GLGetBufferPointervOES,
  10666                                          targetPacked, pname, params));
  10667        if (isCallValid)
  10668        {
  10669            context->getBufferPointerv(targetPacked, pname, params);
  10670        }
  10671        ANGLE_CAPTURE_GL(GetBufferPointervOES, isCallValid, context, targetPacked, pname, params);
  10672    }
  10673    else
  10674    {
  10675        GenerateContextLostErrorOnCurrentGlobalContext();
  10676    }
  10677 }
  10678 
  10679 void *GL_APIENTRY GL_MapBufferOES(GLenum target, GLenum access)
  10680 {
  10681    Context *context = GetValidGlobalContext();
  10682    EVENT(context, GLMapBufferOES, "context = %d, target = %s, access = %s", CID(context),
  10683          GLenumToString(GLESEnum::BufferTargetARB, target),
  10684          GLenumToString(GLESEnum::BufferAccessARB, access));
  10685 
  10686    void *returnValue;
  10687    if (context)
  10688    {
  10689        BufferBinding targetPacked = PackParam<BufferBinding>(target);
  10690        SCOPED_SHARE_CONTEXT_LOCK(context);
  10691        bool isCallValid = (context->skipValidation() ||
  10692                            ValidateMapBufferOES(context, angle::EntryPoint::GLMapBufferOES,
  10693                                                 targetPacked, access));
  10694        if (isCallValid)
  10695        {
  10696            returnValue = context->mapBuffer(targetPacked, access);
  10697        }
  10698        else
  10699        {
  10700            returnValue = GetDefaultReturnValue<angle::EntryPoint::GLMapBufferOES, void *>();
  10701        }
  10702        ANGLE_CAPTURE_GL(MapBufferOES, isCallValid, context, targetPacked, access, returnValue);
  10703    }
  10704    else
  10705    {
  10706        GenerateContextLostErrorOnCurrentGlobalContext();
  10707        returnValue = GetDefaultReturnValue<angle::EntryPoint::GLMapBufferOES, void *>();
  10708    }
  10709    return returnValue;
  10710 }
  10711 
  10712 GLboolean GL_APIENTRY GL_UnmapBufferOES(GLenum target)
  10713 {
  10714    Context *context = GetValidGlobalContext();
  10715    EVENT(context, GLUnmapBufferOES, "context = %d, target = %s", CID(context),
  10716          GLenumToString(GLESEnum::AllEnums, target));
  10717 
  10718    GLboolean returnValue;
  10719    if (context)
  10720    {
  10721        BufferBinding targetPacked = PackParam<BufferBinding>(target);
  10722        SCOPED_SHARE_CONTEXT_LOCK(context);
  10723        bool isCallValid =
  10724            (context->skipValidation() ||
  10725             ValidateUnmapBufferOES(context, angle::EntryPoint::GLUnmapBufferOES, targetPacked));
  10726        if (isCallValid)
  10727        {
  10728            returnValue = context->unmapBuffer(targetPacked);
  10729        }
  10730        else
  10731        {
  10732            returnValue = GetDefaultReturnValue<angle::EntryPoint::GLUnmapBufferOES, GLboolean>();
  10733        }
  10734        ANGLE_CAPTURE_GL(UnmapBufferOES, isCallValid, context, targetPacked, returnValue);
  10735    }
  10736    else
  10737    {
  10738        GenerateContextLostErrorOnCurrentGlobalContext();
  10739        returnValue = GetDefaultReturnValue<angle::EntryPoint::GLUnmapBufferOES, GLboolean>();
  10740    }
  10741    return returnValue;
  10742 }
  10743 
  10744 // GL_OES_matrix_palette
  10745 void GL_APIENTRY GL_CurrentPaletteMatrixOES(GLuint matrixpaletteindex)
  10746 {
  10747    Context *context = GetValidGlobalContext();
  10748    EVENT(context, GLCurrentPaletteMatrixOES, "context = %d, matrixpaletteindex = %u", CID(context),
  10749          matrixpaletteindex);
  10750 
  10751    if (context)
  10752    {
  10753        SCOPED_SHARE_CONTEXT_LOCK(context);
  10754        bool isCallValid =
  10755            (context->skipValidation() ||
  10756             ValidateCurrentPaletteMatrixOES(context, angle::EntryPoint::GLCurrentPaletteMatrixOES,
  10757                                             matrixpaletteindex));
  10758        if (isCallValid)
  10759        {
  10760            context->currentPaletteMatrix(matrixpaletteindex);
  10761        }
  10762        ANGLE_CAPTURE_GL(CurrentPaletteMatrixOES, isCallValid, context, matrixpaletteindex);
  10763    }
  10764    else
  10765    {
  10766        GenerateContextLostErrorOnCurrentGlobalContext();
  10767    }
  10768 }
  10769 
  10770 void GL_APIENTRY GL_LoadPaletteFromModelViewMatrixOES()
  10771 {
  10772    Context *context = GetValidGlobalContext();
  10773    EVENT(context, GLLoadPaletteFromModelViewMatrixOES, "context = %d", CID(context));
  10774 
  10775    if (context)
  10776    {
  10777        SCOPED_SHARE_CONTEXT_LOCK(context);
  10778        bool isCallValid = (context->skipValidation() ||
  10779                            ValidateLoadPaletteFromModelViewMatrixOES(
  10780                                context, angle::EntryPoint::GLLoadPaletteFromModelViewMatrixOES));
  10781        if (isCallValid)
  10782        {
  10783            context->loadPaletteFromModelViewMatrix();
  10784        }
  10785        ANGLE_CAPTURE_GL(LoadPaletteFromModelViewMatrixOES, isCallValid, context);
  10786    }
  10787    else
  10788    {
  10789        GenerateContextLostErrorOnCurrentGlobalContext();
  10790    }
  10791 }
  10792 
  10793 void GL_APIENTRY GL_MatrixIndexPointerOES(GLint size,
  10794                                          GLenum type,
  10795                                          GLsizei stride,
  10796                                          const void *pointer)
  10797 {
  10798    Context *context = GetValidGlobalContext();
  10799    EVENT(context, GLMatrixIndexPointerOES,
  10800          "context = %d, size = %d, type = %s, stride = %d, pointer = 0x%016" PRIxPTR "",
  10801          CID(context), size, GLenumToString(GLESEnum::AllEnums, type), stride, (uintptr_t)pointer);
  10802 
  10803    if (context)
  10804    {
  10805        SCOPED_SHARE_CONTEXT_LOCK(context);
  10806        bool isCallValid =
  10807            (context->skipValidation() ||
  10808             ValidateMatrixIndexPointerOES(context, angle::EntryPoint::GLMatrixIndexPointerOES,
  10809                                           size, type, stride, pointer));
  10810        if (isCallValid)
  10811        {
  10812            context->matrixIndexPointer(size, type, stride, pointer);
  10813        }
  10814        ANGLE_CAPTURE_GL(MatrixIndexPointerOES, isCallValid, context, size, type, stride, pointer);
  10815    }
  10816    else
  10817    {
  10818        GenerateContextLostErrorOnCurrentGlobalContext();
  10819    }
  10820 }
  10821 
  10822 void GL_APIENTRY GL_WeightPointerOES(GLint size, GLenum type, GLsizei stride, const void *pointer)
  10823 {
  10824    Context *context = GetValidGlobalContext();
  10825    EVENT(context, GLWeightPointerOES,
  10826          "context = %d, size = %d, type = %s, stride = %d, pointer = 0x%016" PRIxPTR "",
  10827          CID(context), size, GLenumToString(GLESEnum::AllEnums, type), stride, (uintptr_t)pointer);
  10828 
  10829    if (context)
  10830    {
  10831        SCOPED_SHARE_CONTEXT_LOCK(context);
  10832        bool isCallValid = (context->skipValidation() ||
  10833                            ValidateWeightPointerOES(context, angle::EntryPoint::GLWeightPointerOES,
  10834                                                     size, type, stride, pointer));
  10835        if (isCallValid)
  10836        {
  10837            context->weightPointer(size, type, stride, pointer);
  10838        }
  10839        ANGLE_CAPTURE_GL(WeightPointerOES, isCallValid, context, size, type, stride, pointer);
  10840    }
  10841    else
  10842    {
  10843        GenerateContextLostErrorOnCurrentGlobalContext();
  10844    }
  10845 }
  10846 
  10847 // GL_OES_packed_depth_stencil
  10848 
  10849 // GL_OES_point_size_array
  10850 void GL_APIENTRY GL_PointSizePointerOES(GLenum type, GLsizei stride, const void *pointer)
  10851 {
  10852    Context *context = GetValidGlobalContext();
  10853    EVENT(context, GLPointSizePointerOES,
  10854          "context = %d, type = %s, stride = %d, pointer = 0x%016" PRIxPTR "", CID(context),
  10855          GLenumToString(GLESEnum::AllEnums, type), stride, (uintptr_t)pointer);
  10856 
  10857    if (context)
  10858    {
  10859        VertexAttribType typePacked = PackParam<VertexAttribType>(type);
  10860        SCOPED_SHARE_CONTEXT_LOCK(context);
  10861        bool isCallValid =
  10862            (context->skipValidation() ||
  10863             ValidatePointSizePointerOES(context, angle::EntryPoint::GLPointSizePointerOES,
  10864                                         typePacked, stride, pointer));
  10865        if (isCallValid)
  10866        {
  10867            context->pointSizePointer(typePacked, stride, pointer);
  10868        }
  10869        ANGLE_CAPTURE_GL(PointSizePointerOES, isCallValid, context, typePacked, stride, pointer);
  10870    }
  10871    else
  10872    {
  10873        GenerateContextLostErrorOnCurrentGlobalContext();
  10874    }
  10875 }
  10876 
  10877 // GL_OES_point_sprite
  10878 
  10879 // GL_OES_primitive_bounding_box
  10880 void GL_APIENTRY GL_PrimitiveBoundingBoxOES(GLfloat minX,
  10881                                            GLfloat minY,
  10882                                            GLfloat minZ,
  10883                                            GLfloat minW,
  10884                                            GLfloat maxX,
  10885                                            GLfloat maxY,
  10886                                            GLfloat maxZ,
  10887                                            GLfloat maxW)
  10888 {
  10889    Context *context = GetValidGlobalContext();
  10890    EVENT(context, GLPrimitiveBoundingBoxOES,
  10891          "context = %d, minX = %f, minY = %f, minZ = %f, minW = %f, maxX = %f, maxY = %f, maxZ = "
  10892          "%f, maxW = %f",
  10893          CID(context), minX, minY, minZ, minW, maxX, maxY, maxZ, maxW);
  10894 
  10895    if (context)
  10896    {
  10897        SCOPED_SHARE_CONTEXT_LOCK(context);
  10898        bool isCallValid =
  10899            (context->skipValidation() ||
  10900             ValidatePrimitiveBoundingBoxOES(context, angle::EntryPoint::GLPrimitiveBoundingBoxOES,
  10901                                             minX, minY, minZ, minW, maxX, maxY, maxZ, maxW));
  10902        if (isCallValid)
  10903        {
  10904            context->primitiveBoundingBox(minX, minY, minZ, minW, maxX, maxY, maxZ, maxW);
  10905        }
  10906        ANGLE_CAPTURE_GL(PrimitiveBoundingBoxOES, isCallValid, context, minX, minY, minZ, minW,
  10907                         maxX, maxY, maxZ, maxW);
  10908    }
  10909    else
  10910    {
  10911        GenerateContextLostErrorOnCurrentGlobalContext();
  10912    }
  10913 }
  10914 
  10915 // GL_OES_query_matrix
  10916 GLbitfield GL_APIENTRY GL_QueryMatrixxOES(GLfixed *mantissa, GLint *exponent)
  10917 {
  10918    Context *context = GetValidGlobalContext();
  10919    EVENT(context, GLQueryMatrixxOES,
  10920          "context = %d, mantissa = 0x%016" PRIxPTR ", exponent = 0x%016" PRIxPTR "", CID(context),
  10921          (uintptr_t)mantissa, (uintptr_t)exponent);
  10922 
  10923    GLbitfield returnValue;
  10924    if (context)
  10925    {
  10926        SCOPED_SHARE_CONTEXT_LOCK(context);
  10927        bool isCallValid = (context->skipValidation() ||
  10928                            ValidateQueryMatrixxOES(context, angle::EntryPoint::GLQueryMatrixxOES,
  10929                                                    mantissa, exponent));
  10930        if (isCallValid)
  10931        {
  10932            returnValue = context->queryMatrixx(mantissa, exponent);
  10933        }
  10934        else
  10935        {
  10936            returnValue = GetDefaultReturnValue<angle::EntryPoint::GLQueryMatrixxOES, GLbitfield>();
  10937        }
  10938        ANGLE_CAPTURE_GL(QueryMatrixxOES, isCallValid, context, mantissa, exponent, returnValue);
  10939    }
  10940    else
  10941    {
  10942        GenerateContextLostErrorOnCurrentGlobalContext();
  10943        returnValue = GetDefaultReturnValue<angle::EntryPoint::GLQueryMatrixxOES, GLbitfield>();
  10944    }
  10945    return returnValue;
  10946 }
  10947 
  10948 // GL_OES_rgb8_rgba8
  10949 
  10950 // GL_OES_sample_shading
  10951 void GL_APIENTRY GL_MinSampleShadingOES(GLfloat value)
  10952 {
  10953    Context *context = GetValidGlobalContext();
  10954    EVENT(context, GLMinSampleShadingOES, "context = %d, value = %f", CID(context), value);
  10955 
  10956    if (context)
  10957    {
  10958        SCOPED_SHARE_CONTEXT_LOCK(context);
  10959        bool isCallValid =
  10960            (context->skipValidation() ||
  10961             ValidateMinSampleShadingOES(context, angle::EntryPoint::GLMinSampleShadingOES, value));
  10962        if (isCallValid)
  10963        {
  10964            context->minSampleShading(value);
  10965        }
  10966        ANGLE_CAPTURE_GL(MinSampleShadingOES, isCallValid, context, value);
  10967    }
  10968    else
  10969    {
  10970        GenerateContextLostErrorOnCurrentGlobalContext();
  10971    }
  10972 }
  10973 
  10974 // GL_OES_sample_variables
  10975 
  10976 // GL_OES_shader_image_atomic
  10977 
  10978 // GL_OES_shader_io_blocks
  10979 
  10980 // GL_OES_shader_multisample_interpolation
  10981 
  10982 // GL_OES_standard_derivatives
  10983 
  10984 // GL_OES_surfaceless_context
  10985 
  10986 // GL_OES_texture_3D
  10987 void GL_APIENTRY GL_CompressedTexImage3DOES(GLenum target,
  10988                                            GLint level,
  10989                                            GLenum internalformat,
  10990                                            GLsizei width,
  10991                                            GLsizei height,
  10992                                            GLsizei depth,
  10993                                            GLint border,
  10994                                            GLsizei imageSize,
  10995                                            const void *data)
  10996 {
  10997    Context *context = GetValidGlobalContext();
  10998    EVENT(context, GLCompressedTexImage3DOES,
  10999          "context = %d, target = %s, level = %d, internalformat = %s, width = %d, height = %d, "
  11000          "depth = %d, border = %d, imageSize = %d, data = 0x%016" PRIxPTR "",
  11001          CID(context), GLenumToString(GLESEnum::TextureTarget, target), level,
  11002          GLenumToString(GLESEnum::InternalFormat, internalformat), width, height, depth, border,
  11003          imageSize, (uintptr_t)data);
  11004 
  11005    if (context)
  11006    {
  11007        TextureTarget targetPacked = PackParam<TextureTarget>(target);
  11008        SCOPED_SHARE_CONTEXT_LOCK(context);
  11009        bool isCallValid =
  11010            (context->skipValidation() ||
  11011             ValidateCompressedTexImage3DOES(context, angle::EntryPoint::GLCompressedTexImage3DOES,
  11012                                             targetPacked, level, internalformat, width, height,
  11013                                             depth, border, imageSize, data));
  11014        if (isCallValid)
  11015        {
  11016            context->compressedTexImage3D(targetPacked, level, internalformat, width, height, depth,
  11017                                          border, imageSize, data);
  11018        }
  11019        ANGLE_CAPTURE_GL(CompressedTexImage3DOES, isCallValid, context, targetPacked, level,
  11020                         internalformat, width, height, depth, border, imageSize, data);
  11021    }
  11022    else
  11023    {
  11024        GenerateContextLostErrorOnCurrentGlobalContext();
  11025    }
  11026 }
  11027 
  11028 void GL_APIENTRY GL_CompressedTexSubImage3DOES(GLenum target,
  11029                                               GLint level,
  11030                                               GLint xoffset,
  11031                                               GLint yoffset,
  11032                                               GLint zoffset,
  11033                                               GLsizei width,
  11034                                               GLsizei height,
  11035                                               GLsizei depth,
  11036                                               GLenum format,
  11037                                               GLsizei imageSize,
  11038                                               const void *data)
  11039 {
  11040    Context *context = GetValidGlobalContext();
  11041    EVENT(context, GLCompressedTexSubImage3DOES,
  11042          "context = %d, target = %s, level = %d, xoffset = %d, yoffset = %d, zoffset = %d, width "
  11043          "= %d, height = %d, depth = %d, format = %s, imageSize = %d, data = 0x%016" PRIxPTR "",
  11044          CID(context), GLenumToString(GLESEnum::TextureTarget, target), level, xoffset, yoffset,
  11045          zoffset, width, height, depth, GLenumToString(GLESEnum::InternalFormat, format),
  11046          imageSize, (uintptr_t)data);
  11047 
  11048    if (context)
  11049    {
  11050        TextureTarget targetPacked = PackParam<TextureTarget>(target);
  11051        SCOPED_SHARE_CONTEXT_LOCK(context);
  11052        bool isCallValid =
  11053            (context->skipValidation() ||
  11054             ValidateCompressedTexSubImage3DOES(
  11055                 context, angle::EntryPoint::GLCompressedTexSubImage3DOES, targetPacked, level,
  11056                 xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data));
  11057        if (isCallValid)
  11058        {
  11059            context->compressedTexSubImage3D(targetPacked, level, xoffset, yoffset, zoffset, width,
  11060                                             height, depth, format, imageSize, data);
  11061        }
  11062        ANGLE_CAPTURE_GL(CompressedTexSubImage3DOES, isCallValid, context, targetPacked, level,
  11063                         xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data);
  11064    }
  11065    else
  11066    {
  11067        GenerateContextLostErrorOnCurrentGlobalContext();
  11068    }
  11069 }
  11070 
  11071 void GL_APIENTRY GL_CopyTexSubImage3DOES(GLenum target,
  11072                                         GLint level,
  11073                                         GLint xoffset,
  11074                                         GLint yoffset,
  11075                                         GLint zoffset,
  11076                                         GLint x,
  11077                                         GLint y,
  11078                                         GLsizei width,
  11079                                         GLsizei height)
  11080 {
  11081    Context *context = GetValidGlobalContext();
  11082    EVENT(context, GLCopyTexSubImage3DOES,
  11083          "context = %d, target = %s, level = %d, xoffset = %d, yoffset = %d, zoffset = %d, x = "
  11084          "%d, y = %d, width = %d, height = %d",
  11085          CID(context), GLenumToString(GLESEnum::AllEnums, target), level, xoffset, yoffset,
  11086          zoffset, x, y, width, height);
  11087 
  11088    if (context)
  11089    {
  11090        TextureTarget targetPacked = PackParam<TextureTarget>(target);
  11091        SCOPED_SHARE_CONTEXT_LOCK(context);
  11092        bool isCallValid = (context->skipValidation() ||
  11093                            ValidateCopyTexSubImage3DOES(
  11094                                context, angle::EntryPoint::GLCopyTexSubImage3DOES, targetPacked,
  11095                                level, xoffset, yoffset, zoffset, x, y, width, height));
  11096        if (isCallValid)
  11097        {
  11098            context->copyTexSubImage3D(targetPacked, level, xoffset, yoffset, zoffset, x, y, width,
  11099                                       height);
  11100        }
  11101        ANGLE_CAPTURE_GL(CopyTexSubImage3DOES, isCallValid, context, targetPacked, level, xoffset,
  11102                         yoffset, zoffset, x, y, width, height);
  11103    }
  11104    else
  11105    {
  11106        GenerateContextLostErrorOnCurrentGlobalContext();
  11107    }
  11108 }
  11109 
  11110 void GL_APIENTRY GL_FramebufferTexture3DOES(GLenum target,
  11111                                            GLenum attachment,
  11112                                            GLenum textarget,
  11113                                            GLuint texture,
  11114                                            GLint level,
  11115                                            GLint zoffset)
  11116 {
  11117    Context *context = GetValidGlobalContext();
  11118    EVENT(context, GLFramebufferTexture3DOES,
  11119          "context = %d, target = %s, attachment = %s, textarget = %s, texture = %u, level = %d, "
  11120          "zoffset = %d",
  11121          CID(context), GLenumToString(GLESEnum::FramebufferTarget, target),
  11122          GLenumToString(GLESEnum::FramebufferAttachment, attachment),
  11123          GLenumToString(GLESEnum::TextureTarget, textarget), texture, level, zoffset);
  11124 
  11125    if (context)
  11126    {
  11127        TextureTarget textargetPacked = PackParam<TextureTarget>(textarget);
  11128        TextureID texturePacked       = PackParam<TextureID>(texture);
  11129        SCOPED_SHARE_CONTEXT_LOCK(context);
  11130        bool isCallValid = (context->skipValidation() ||
  11131                            ValidateFramebufferTexture3DOES(
  11132                                context, angle::EntryPoint::GLFramebufferTexture3DOES, target,
  11133                                attachment, textargetPacked, texturePacked, level, zoffset));
  11134        if (isCallValid)
  11135        {
  11136            context->framebufferTexture3D(target, attachment, textargetPacked, texturePacked, level,
  11137                                          zoffset);
  11138        }
  11139        ANGLE_CAPTURE_GL(FramebufferTexture3DOES, isCallValid, context, target, attachment,
  11140                         textargetPacked, texturePacked, level, zoffset);
  11141    }
  11142    else
  11143    {
  11144        GenerateContextLostErrorOnCurrentGlobalContext();
  11145    }
  11146 }
  11147 
  11148 void GL_APIENTRY GL_TexImage3DOES(GLenum target,
  11149                                  GLint level,
  11150                                  GLenum internalformat,
  11151                                  GLsizei width,
  11152                                  GLsizei height,
  11153                                  GLsizei depth,
  11154                                  GLint border,
  11155                                  GLenum format,
  11156                                  GLenum type,
  11157                                  const void *pixels)
  11158 {
  11159    Context *context = GetValidGlobalContext();
  11160    EVENT(context, GLTexImage3DOES,
  11161          "context = %d, target = %s, level = %d, internalformat = %s, width = %d, height = %d, "
  11162          "depth = %d, border = %d, format = %s, type = %s, pixels = 0x%016" PRIxPTR "",
  11163          CID(context), GLenumToString(GLESEnum::TextureTarget, target), level,
  11164          GLenumToString(GLESEnum::InternalFormat, internalformat), width, height, depth, border,
  11165          GLenumToString(GLESEnum::PixelFormat, format), GLenumToString(GLESEnum::PixelType, type),
  11166          (uintptr_t)pixels);
  11167 
  11168    if (context)
  11169    {
  11170        TextureTarget targetPacked = PackParam<TextureTarget>(target);
  11171        SCOPED_SHARE_CONTEXT_LOCK(context);
  11172        bool isCallValid = (context->skipValidation() ||
  11173                            ValidateTexImage3DOES(context, angle::EntryPoint::GLTexImage3DOES,
  11174                                                  targetPacked, level, internalformat, width,
  11175                                                  height, depth, border, format, type, pixels));
  11176        if (isCallValid)
  11177        {
  11178            context->texImage3D(targetPacked, level, internalformat, width, height, depth, border,
  11179                                format, type, pixels);
  11180        }
  11181        ANGLE_CAPTURE_GL(TexImage3DOES, isCallValid, context, targetPacked, level, internalformat,
  11182                         width, height, depth, border, format, type, pixels);
  11183    }
  11184    else
  11185    {
  11186        GenerateContextLostErrorOnCurrentGlobalContext();
  11187    }
  11188 }
  11189 
  11190 void GL_APIENTRY GL_TexSubImage3DOES(GLenum target,
  11191                                     GLint level,
  11192                                     GLint xoffset,
  11193                                     GLint yoffset,
  11194                                     GLint zoffset,
  11195                                     GLsizei width,
  11196                                     GLsizei height,
  11197                                     GLsizei depth,
  11198                                     GLenum format,
  11199                                     GLenum type,
  11200                                     const void *pixels)
  11201 {
  11202    Context *context = GetValidGlobalContext();
  11203    EVENT(context, GLTexSubImage3DOES,
  11204          "context = %d, target = %s, level = %d, xoffset = %d, yoffset = %d, zoffset = %d, width "
  11205          "= %d, height = %d, depth = %d, format = %s, type = %s, pixels = 0x%016" PRIxPTR "",
  11206          CID(context), GLenumToString(GLESEnum::TextureTarget, target), level, xoffset, yoffset,
  11207          zoffset, width, height, depth, GLenumToString(GLESEnum::PixelFormat, format),
  11208          GLenumToString(GLESEnum::PixelType, type), (uintptr_t)pixels);
  11209 
  11210    if (context)
  11211    {
  11212        TextureTarget targetPacked = PackParam<TextureTarget>(target);
  11213        SCOPED_SHARE_CONTEXT_LOCK(context);
  11214        bool isCallValid = (context->skipValidation() ||
  11215                            ValidateTexSubImage3DOES(context, angle::EntryPoint::GLTexSubImage3DOES,
  11216                                                     targetPacked, level, xoffset, yoffset, zoffset,
  11217                                                     width, height, depth, format, type, pixels));
  11218        if (isCallValid)
  11219        {
  11220            context->texSubImage3D(targetPacked, level, xoffset, yoffset, zoffset, width, height,
  11221                                   depth, format, type, pixels);
  11222        }
  11223        ANGLE_CAPTURE_GL(TexSubImage3DOES, isCallValid, context, targetPacked, level, xoffset,
  11224                         yoffset, zoffset, width, height, depth, format, type, pixels);
  11225    }
  11226    else
  11227    {
  11228        GenerateContextLostErrorOnCurrentGlobalContext();
  11229    }
  11230 }
  11231 
  11232 // GL_OES_texture_border_clamp
  11233 void GL_APIENTRY GL_GetSamplerParameterIivOES(GLuint sampler, GLenum pname, GLint *params)
  11234 {
  11235    Context *context = GetValidGlobalContext();
  11236    EVENT(context, GLGetSamplerParameterIivOES,
  11237          "context = %d, sampler = %u, pname = %s, params = 0x%016" PRIxPTR "", CID(context),
  11238          sampler, GLenumToString(GLESEnum::SamplerParameterI, pname), (uintptr_t)params);
  11239 
  11240    if (context)
  11241    {
  11242        SamplerID samplerPacked = PackParam<SamplerID>(sampler);
  11243        SCOPED_SHARE_CONTEXT_LOCK(context);
  11244        bool isCallValid = (context->skipValidation() ||
  11245                            ValidateGetSamplerParameterIivOES(
  11246                                context, angle::EntryPoint::GLGetSamplerParameterIivOES,
  11247                                samplerPacked, pname, params));
  11248        if (isCallValid)
  11249        {
  11250            context->getSamplerParameterIiv(samplerPacked, pname, params);
  11251        }
  11252        ANGLE_CAPTURE_GL(GetSamplerParameterIivOES, isCallValid, context, samplerPacked, pname,
  11253                         params);
  11254    }
  11255    else
  11256    {
  11257        GenerateContextLostErrorOnCurrentGlobalContext();
  11258    }
  11259 }
  11260 
  11261 void GL_APIENTRY GL_GetSamplerParameterIuivOES(GLuint sampler, GLenum pname, GLuint *params)
  11262 {
  11263    Context *context = GetValidGlobalContext();
  11264    EVENT(context, GLGetSamplerParameterIuivOES,
  11265          "context = %d, sampler = %u, pname = %s, params = 0x%016" PRIxPTR "", CID(context),
  11266          sampler, GLenumToString(GLESEnum::SamplerParameterI, pname), (uintptr_t)params);
  11267 
  11268    if (context)
  11269    {
  11270        SamplerID samplerPacked = PackParam<SamplerID>(sampler);
  11271        SCOPED_SHARE_CONTEXT_LOCK(context);
  11272        bool isCallValid = (context->skipValidation() ||
  11273                            ValidateGetSamplerParameterIuivOES(
  11274                                context, angle::EntryPoint::GLGetSamplerParameterIuivOES,
  11275                                samplerPacked, pname, params));
  11276        if (isCallValid)
  11277        {
  11278            context->getSamplerParameterIuiv(samplerPacked, pname, params);
  11279        }
  11280        ANGLE_CAPTURE_GL(GetSamplerParameterIuivOES, isCallValid, context, samplerPacked, pname,
  11281                         params);
  11282    }
  11283    else
  11284    {
  11285        GenerateContextLostErrorOnCurrentGlobalContext();
  11286    }
  11287 }
  11288 
  11289 void GL_APIENTRY GL_GetTexParameterIivOES(GLenum target, GLenum pname, GLint *params)
  11290 {
  11291    Context *context = GetValidGlobalContext();
  11292    EVENT(context, GLGetTexParameterIivOES,
  11293          "context = %d, target = %s, pname = %s, params = 0x%016" PRIxPTR "", CID(context),
  11294          GLenumToString(GLESEnum::TextureTarget, target),
  11295          GLenumToString(GLESEnum::GetTextureParameter, pname), (uintptr_t)params);
  11296 
  11297    if (context)
  11298    {
  11299        TextureType targetPacked = PackParam<TextureType>(target);
  11300        SCOPED_SHARE_CONTEXT_LOCK(context);
  11301        bool isCallValid =
  11302            (context->skipValidation() ||
  11303             ValidateGetTexParameterIivOES(context, angle::EntryPoint::GLGetTexParameterIivOES,
  11304                                           targetPacked, pname, params));
  11305        if (isCallValid)
  11306        {
  11307            context->getTexParameterIiv(targetPacked, pname, params);
  11308        }
  11309        ANGLE_CAPTURE_GL(GetTexParameterIivOES, isCallValid, context, targetPacked, pname, params);
  11310    }
  11311    else
  11312    {
  11313        GenerateContextLostErrorOnCurrentGlobalContext();
  11314    }
  11315 }
  11316 
  11317 void GL_APIENTRY GL_GetTexParameterIuivOES(GLenum target, GLenum pname, GLuint *params)
  11318 {
  11319    Context *context = GetValidGlobalContext();
  11320    EVENT(context, GLGetTexParameterIuivOES,
  11321          "context = %d, target = %s, pname = %s, params = 0x%016" PRIxPTR "", CID(context),
  11322          GLenumToString(GLESEnum::TextureTarget, target),
  11323          GLenumToString(GLESEnum::GetTextureParameter, pname), (uintptr_t)params);
  11324 
  11325    if (context)
  11326    {
  11327        TextureType targetPacked = PackParam<TextureType>(target);
  11328        SCOPED_SHARE_CONTEXT_LOCK(context);
  11329        bool isCallValid =
  11330            (context->skipValidation() ||
  11331             ValidateGetTexParameterIuivOES(context, angle::EntryPoint::GLGetTexParameterIuivOES,
  11332                                            targetPacked, pname, params));
  11333        if (isCallValid)
  11334        {
  11335            context->getTexParameterIuiv(targetPacked, pname, params);
  11336        }
  11337        ANGLE_CAPTURE_GL(GetTexParameterIuivOES, isCallValid, context, targetPacked, pname, params);
  11338    }
  11339    else
  11340    {
  11341        GenerateContextLostErrorOnCurrentGlobalContext();
  11342    }
  11343 }
  11344 
  11345 void GL_APIENTRY GL_SamplerParameterIivOES(GLuint sampler, GLenum pname, const GLint *param)
  11346 {
  11347    Context *context = GetValidGlobalContext();
  11348    EVENT(context, GLSamplerParameterIivOES,
  11349          "context = %d, sampler = %u, pname = %s, param = 0x%016" PRIxPTR "", CID(context),
  11350          sampler, GLenumToString(GLESEnum::SamplerParameterI, pname), (uintptr_t)param);
  11351 
  11352    if (context)
  11353    {
  11354        SamplerID samplerPacked = PackParam<SamplerID>(sampler);
  11355        SCOPED_SHARE_CONTEXT_LOCK(context);
  11356        bool isCallValid =
  11357            (context->skipValidation() ||
  11358             ValidateSamplerParameterIivOES(context, angle::EntryPoint::GLSamplerParameterIivOES,
  11359                                            samplerPacked, pname, param));
  11360        if (isCallValid)
  11361        {
  11362            context->samplerParameterIiv(samplerPacked, pname, param);
  11363        }
  11364        ANGLE_CAPTURE_GL(SamplerParameterIivOES, isCallValid, context, samplerPacked, pname, param);
  11365    }
  11366    else
  11367    {
  11368        GenerateContextLostErrorOnCurrentGlobalContext();
  11369    }
  11370 }
  11371 
  11372 void GL_APIENTRY GL_SamplerParameterIuivOES(GLuint sampler, GLenum pname, const GLuint *param)
  11373 {
  11374    Context *context = GetValidGlobalContext();
  11375    EVENT(context, GLSamplerParameterIuivOES,
  11376          "context = %d, sampler = %u, pname = %s, param = 0x%016" PRIxPTR "", CID(context),
  11377          sampler, GLenumToString(GLESEnum::SamplerParameterI, pname), (uintptr_t)param);
  11378 
  11379    if (context)
  11380    {
  11381        SamplerID samplerPacked = PackParam<SamplerID>(sampler);
  11382        SCOPED_SHARE_CONTEXT_LOCK(context);
  11383        bool isCallValid =
  11384            (context->skipValidation() ||
  11385             ValidateSamplerParameterIuivOES(context, angle::EntryPoint::GLSamplerParameterIuivOES,
  11386                                             samplerPacked, pname, param));
  11387        if (isCallValid)
  11388        {
  11389            context->samplerParameterIuiv(samplerPacked, pname, param);
  11390        }
  11391        ANGLE_CAPTURE_GL(SamplerParameterIuivOES, isCallValid, context, samplerPacked, pname,
  11392                         param);
  11393    }
  11394    else
  11395    {
  11396        GenerateContextLostErrorOnCurrentGlobalContext();
  11397    }
  11398 }
  11399 
  11400 void GL_APIENTRY GL_TexParameterIivOES(GLenum target, GLenum pname, const GLint *params)
  11401 {
  11402    Context *context = GetValidGlobalContext();
  11403    EVENT(context, GLTexParameterIivOES,
  11404          "context = %d, target = %s, pname = %s, params = 0x%016" PRIxPTR "", CID(context),
  11405          GLenumToString(GLESEnum::TextureTarget, target),
  11406          GLenumToString(GLESEnum::TextureParameterName, pname), (uintptr_t)params);
  11407 
  11408    if (context)
  11409    {
  11410        TextureType targetPacked = PackParam<TextureType>(target);
  11411        SCOPED_SHARE_CONTEXT_LOCK(context);
  11412        bool isCallValid =
  11413            (context->skipValidation() ||
  11414             ValidateTexParameterIivOES(context, angle::EntryPoint::GLTexParameterIivOES,
  11415                                        targetPacked, pname, params));
  11416        if (isCallValid)
  11417        {
  11418            context->texParameterIiv(targetPacked, pname, params);
  11419        }
  11420        ANGLE_CAPTURE_GL(TexParameterIivOES, isCallValid, context, targetPacked, pname, params);
  11421    }
  11422    else
  11423    {
  11424        GenerateContextLostErrorOnCurrentGlobalContext();
  11425    }
  11426 }
  11427 
  11428 void GL_APIENTRY GL_TexParameterIuivOES(GLenum target, GLenum pname, const GLuint *params)
  11429 {
  11430    Context *context = GetValidGlobalContext();
  11431    EVENT(context, GLTexParameterIuivOES,
  11432          "context = %d, target = %s, pname = %s, params = 0x%016" PRIxPTR "", CID(context),
  11433          GLenumToString(GLESEnum::TextureTarget, target),
  11434          GLenumToString(GLESEnum::TextureParameterName, pname), (uintptr_t)params);
  11435 
  11436    if (context)
  11437    {
  11438        TextureType targetPacked = PackParam<TextureType>(target);
  11439        SCOPED_SHARE_CONTEXT_LOCK(context);
  11440        bool isCallValid =
  11441            (context->skipValidation() ||
  11442             ValidateTexParameterIuivOES(context, angle::EntryPoint::GLTexParameterIuivOES,
  11443                                         targetPacked, pname, params));
  11444        if (isCallValid)
  11445        {
  11446            context->texParameterIuiv(targetPacked, pname, params);
  11447        }
  11448        ANGLE_CAPTURE_GL(TexParameterIuivOES, isCallValid, context, targetPacked, pname, params);
  11449    }
  11450    else
  11451    {
  11452        GenerateContextLostErrorOnCurrentGlobalContext();
  11453    }
  11454 }
  11455 
  11456 // GL_OES_texture_buffer
  11457 void GL_APIENTRY GL_TexBufferOES(GLenum target, GLenum internalformat, GLuint buffer)
  11458 {
  11459    Context *context = GetValidGlobalContext();
  11460    EVENT(context, GLTexBufferOES, "context = %d, target = %s, internalformat = %s, buffer = %u",
  11461          CID(context), GLenumToString(GLESEnum::TextureTarget, target),
  11462          GLenumToString(GLESEnum::SizedInternalFormat, internalformat), buffer);
  11463 
  11464    if (context)
  11465    {
  11466        TextureType targetPacked = PackParam<TextureType>(target);
  11467        BufferID bufferPacked    = PackParam<BufferID>(buffer);
  11468        SCOPED_SHARE_CONTEXT_LOCK(context);
  11469        bool isCallValid = (context->skipValidation() ||
  11470                            ValidateTexBufferOES(context, angle::EntryPoint::GLTexBufferOES,
  11471                                                 targetPacked, internalformat, bufferPacked));
  11472        if (isCallValid)
  11473        {
  11474            context->texBuffer(targetPacked, internalformat, bufferPacked);
  11475        }
  11476        ANGLE_CAPTURE_GL(TexBufferOES, isCallValid, context, targetPacked, internalformat,
  11477                         bufferPacked);
  11478    }
  11479    else
  11480    {
  11481        GenerateContextLostErrorOnCurrentGlobalContext();
  11482    }
  11483 }
  11484 
  11485 void GL_APIENTRY GL_TexBufferRangeOES(GLenum target,
  11486                                      GLenum internalformat,
  11487                                      GLuint buffer,
  11488                                      GLintptr offset,
  11489                                      GLsizeiptr size)
  11490 {
  11491    Context *context = GetValidGlobalContext();
  11492    EVENT(context, GLTexBufferRangeOES,
  11493          "context = %d, target = %s, internalformat = %s, buffer = %u, offset = %llu, size = %llu",
  11494          CID(context), GLenumToString(GLESEnum::TextureTarget, target),
  11495          GLenumToString(GLESEnum::SizedInternalFormat, internalformat), buffer,
  11496          static_cast<unsigned long long>(offset), static_cast<unsigned long long>(size));
  11497 
  11498    if (context)
  11499    {
  11500        TextureType targetPacked = PackParam<TextureType>(target);
  11501        BufferID bufferPacked    = PackParam<BufferID>(buffer);
  11502        SCOPED_SHARE_CONTEXT_LOCK(context);
  11503        bool isCallValid =
  11504            (context->skipValidation() ||
  11505             ValidateTexBufferRangeOES(context, angle::EntryPoint::GLTexBufferRangeOES,
  11506                                       targetPacked, internalformat, bufferPacked, offset, size));
  11507        if (isCallValid)
  11508        {
  11509            context->texBufferRange(targetPacked, internalformat, bufferPacked, offset, size);
  11510        }
  11511        ANGLE_CAPTURE_GL(TexBufferRangeOES, isCallValid, context, targetPacked, internalformat,
  11512                         bufferPacked, offset, size);
  11513    }
  11514    else
  11515    {
  11516        GenerateContextLostErrorOnCurrentGlobalContext();
  11517    }
  11518 }
  11519 
  11520 // GL_OES_texture_compression_astc
  11521 
  11522 // GL_OES_texture_cube_map
  11523 void GL_APIENTRY GL_GetTexGenfvOES(GLenum coord, GLenum pname, GLfloat *params)
  11524 {
  11525    Context *context = GetValidGlobalContext();
  11526    EVENT(context, GLGetTexGenfvOES,
  11527          "context = %d, coord = %s, pname = %s, params = 0x%016" PRIxPTR "", CID(context),
  11528          GLenumToString(GLESEnum::TextureCoordName, coord),
  11529          GLenumToString(GLESEnum::TextureGenParameter, pname), (uintptr_t)params);
  11530 
  11531    if (context)
  11532    {
  11533        SCOPED_SHARE_CONTEXT_LOCK(context);
  11534        bool isCallValid = (context->skipValidation() ||
  11535                            ValidateGetTexGenfvOES(context, angle::EntryPoint::GLGetTexGenfvOES,
  11536                                                   coord, pname, params));
  11537        if (isCallValid)
  11538        {
  11539            context->getTexGenfv(coord, pname, params);
  11540        }
  11541        ANGLE_CAPTURE_GL(GetTexGenfvOES, isCallValid, context, coord, pname, params);
  11542    }
  11543    else
  11544    {
  11545        GenerateContextLostErrorOnCurrentGlobalContext();
  11546    }
  11547 }
  11548 
  11549 void GL_APIENTRY GL_GetTexGenivOES(GLenum coord, GLenum pname, GLint *params)
  11550 {
  11551    Context *context = GetValidGlobalContext();
  11552    EVENT(context, GLGetTexGenivOES,
  11553          "context = %d, coord = %s, pname = %s, params = 0x%016" PRIxPTR "", CID(context),
  11554          GLenumToString(GLESEnum::TextureCoordName, coord),
  11555          GLenumToString(GLESEnum::TextureGenParameter, pname), (uintptr_t)params);
  11556 
  11557    if (context)
  11558    {
  11559        SCOPED_SHARE_CONTEXT_LOCK(context);
  11560        bool isCallValid = (context->skipValidation() ||
  11561                            ValidateGetTexGenivOES(context, angle::EntryPoint::GLGetTexGenivOES,
  11562                                                   coord, pname, params));
  11563        if (isCallValid)
  11564        {
  11565            context->getTexGeniv(coord, pname, params);
  11566        }
  11567        ANGLE_CAPTURE_GL(GetTexGenivOES, isCallValid, context, coord, pname, params);
  11568    }
  11569    else
  11570    {
  11571        GenerateContextLostErrorOnCurrentGlobalContext();
  11572    }
  11573 }
  11574 
  11575 void GL_APIENTRY GL_GetTexGenxvOES(GLenum coord, GLenum pname, GLfixed *params)
  11576 {
  11577    Context *context = GetValidGlobalContext();
  11578    EVENT(context, GLGetTexGenxvOES,
  11579          "context = %d, coord = %s, pname = %s, params = 0x%016" PRIxPTR "", CID(context),
  11580          GLenumToString(GLESEnum::TextureCoordName, coord),
  11581          GLenumToString(GLESEnum::TextureGenParameter, pname), (uintptr_t)params);
  11582 
  11583    if (context)
  11584    {
  11585        SCOPED_SHARE_CONTEXT_LOCK(context);
  11586        bool isCallValid = (context->skipValidation() ||
  11587                            ValidateGetTexGenxvOES(context, angle::EntryPoint::GLGetTexGenxvOES,
  11588                                                   coord, pname, params));
  11589        if (isCallValid)
  11590        {
  11591            context->getTexGenxv(coord, pname, params);
  11592        }
  11593        ANGLE_CAPTURE_GL(GetTexGenxvOES, isCallValid, context, coord, pname, params);
  11594    }
  11595    else
  11596    {
  11597        GenerateContextLostErrorOnCurrentGlobalContext();
  11598    }
  11599 }
  11600 
  11601 void GL_APIENTRY GL_TexGenfOES(GLenum coord, GLenum pname, GLfloat param)
  11602 {
  11603    Context *context = GetValidGlobalContext();
  11604    EVENT(context, GLTexGenfOES, "context = %d, coord = %s, pname = %s, param = %f", CID(context),
  11605          GLenumToString(GLESEnum::TextureCoordName, coord),
  11606          GLenumToString(GLESEnum::TextureGenParameter, pname), param);
  11607 
  11608    if (context)
  11609    {
  11610        SCOPED_SHARE_CONTEXT_LOCK(context);
  11611        bool isCallValid =
  11612            (context->skipValidation() ||
  11613             ValidateTexGenfOES(context, angle::EntryPoint::GLTexGenfOES, coord, pname, param));
  11614        if (isCallValid)
  11615        {
  11616            context->texGenf(coord, pname, param);
  11617        }
  11618        ANGLE_CAPTURE_GL(TexGenfOES, isCallValid, context, coord, pname, param);
  11619    }
  11620    else
  11621    {
  11622        GenerateContextLostErrorOnCurrentGlobalContext();
  11623    }
  11624 }
  11625 
  11626 void GL_APIENTRY GL_TexGenfvOES(GLenum coord, GLenum pname, const GLfloat *params)
  11627 {
  11628    Context *context = GetValidGlobalContext();
  11629    EVENT(context, GLTexGenfvOES,
  11630          "context = %d, coord = %s, pname = %s, params = 0x%016" PRIxPTR "", CID(context),
  11631          GLenumToString(GLESEnum::TextureCoordName, coord),
  11632          GLenumToString(GLESEnum::TextureGenParameter, pname), (uintptr_t)params);
  11633 
  11634    if (context)
  11635    {
  11636        SCOPED_SHARE_CONTEXT_LOCK(context);
  11637        bool isCallValid =
  11638            (context->skipValidation() ||
  11639             ValidateTexGenfvOES(context, angle::EntryPoint::GLTexGenfvOES, coord, pname, params));
  11640        if (isCallValid)
  11641        {
  11642            context->texGenfv(coord, pname, params);
  11643        }
  11644        ANGLE_CAPTURE_GL(TexGenfvOES, isCallValid, context, coord, pname, params);
  11645    }
  11646    else
  11647    {
  11648        GenerateContextLostErrorOnCurrentGlobalContext();
  11649    }
  11650 }
  11651 
  11652 void GL_APIENTRY GL_TexGeniOES(GLenum coord, GLenum pname, GLint param)
  11653 {
  11654    Context *context = GetValidGlobalContext();
  11655    EVENT(context, GLTexGeniOES, "context = %d, coord = %s, pname = %s, param = %d", CID(context),
  11656          GLenumToString(GLESEnum::TextureCoordName, coord),
  11657          GLenumToString(GLESEnum::TextureGenParameter, pname), param);
  11658 
  11659    if (context)
  11660    {
  11661        SCOPED_SHARE_CONTEXT_LOCK(context);
  11662        bool isCallValid =
  11663            (context->skipValidation() ||
  11664             ValidateTexGeniOES(context, angle::EntryPoint::GLTexGeniOES, coord, pname, param));
  11665        if (isCallValid)
  11666        {
  11667            context->texGeni(coord, pname, param);
  11668        }
  11669        ANGLE_CAPTURE_GL(TexGeniOES, isCallValid, context, coord, pname, param);
  11670    }
  11671    else
  11672    {
  11673        GenerateContextLostErrorOnCurrentGlobalContext();
  11674    }
  11675 }
  11676 
  11677 void GL_APIENTRY GL_TexGenivOES(GLenum coord, GLenum pname, const GLint *params)
  11678 {
  11679    Context *context = GetValidGlobalContext();
  11680    EVENT(context, GLTexGenivOES,
  11681          "context = %d, coord = %s, pname = %s, params = 0x%016" PRIxPTR "", CID(context),
  11682          GLenumToString(GLESEnum::TextureCoordName, coord),
  11683          GLenumToString(GLESEnum::TextureGenParameter, pname), (uintptr_t)params);
  11684 
  11685    if (context)
  11686    {
  11687        SCOPED_SHARE_CONTEXT_LOCK(context);
  11688        bool isCallValid =
  11689            (context->skipValidation() ||
  11690             ValidateTexGenivOES(context, angle::EntryPoint::GLTexGenivOES, coord, pname, params));
  11691        if (isCallValid)
  11692        {
  11693            context->texGeniv(coord, pname, params);
  11694        }
  11695        ANGLE_CAPTURE_GL(TexGenivOES, isCallValid, context, coord, pname, params);
  11696    }
  11697    else
  11698    {
  11699        GenerateContextLostErrorOnCurrentGlobalContext();
  11700    }
  11701 }
  11702 
  11703 void GL_APIENTRY GL_TexGenxOES(GLenum coord, GLenum pname, GLfixed param)
  11704 {
  11705    Context *context = GetValidGlobalContext();
  11706    EVENT(context, GLTexGenxOES, "context = %d, coord = %s, pname = %s, param = 0x%X", CID(context),
  11707          GLenumToString(GLESEnum::TextureCoordName, coord),
  11708          GLenumToString(GLESEnum::TextureGenParameter, pname), param);
  11709 
  11710    if (context)
  11711    {
  11712        SCOPED_SHARE_CONTEXT_LOCK(context);
  11713        bool isCallValid =
  11714            (context->skipValidation() ||
  11715             ValidateTexGenxOES(context, angle::EntryPoint::GLTexGenxOES, coord, pname, param));
  11716        if (isCallValid)
  11717        {
  11718            context->texGenx(coord, pname, param);
  11719        }
  11720        ANGLE_CAPTURE_GL(TexGenxOES, isCallValid, context, coord, pname, param);
  11721    }
  11722    else
  11723    {
  11724        GenerateContextLostErrorOnCurrentGlobalContext();
  11725    }
  11726 }
  11727 
  11728 void GL_APIENTRY GL_TexGenxvOES(GLenum coord, GLenum pname, const GLfixed *params)
  11729 {
  11730    Context *context = GetValidGlobalContext();
  11731    EVENT(context, GLTexGenxvOES,
  11732          "context = %d, coord = %s, pname = %s, params = 0x%016" PRIxPTR "", CID(context),
  11733          GLenumToString(GLESEnum::TextureCoordName, coord),
  11734          GLenumToString(GLESEnum::TextureGenParameter, pname), (uintptr_t)params);
  11735 
  11736    if (context)
  11737    {
  11738        SCOPED_SHARE_CONTEXT_LOCK(context);
  11739        bool isCallValid =
  11740            (context->skipValidation() ||
  11741             ValidateTexGenxvOES(context, angle::EntryPoint::GLTexGenxvOES, coord, pname, params));
  11742        if (isCallValid)
  11743        {
  11744            context->texGenxv(coord, pname, params);
  11745        }
  11746        ANGLE_CAPTURE_GL(TexGenxvOES, isCallValid, context, coord, pname, params);
  11747    }
  11748    else
  11749    {
  11750        GenerateContextLostErrorOnCurrentGlobalContext();
  11751    }
  11752 }
  11753 
  11754 // GL_OES_texture_cube_map_array
  11755 
  11756 // GL_OES_texture_float
  11757 
  11758 // GL_OES_texture_float_linear
  11759 
  11760 // GL_OES_texture_half_float
  11761 
  11762 // GL_OES_texture_half_float_linear
  11763 
  11764 // GL_OES_texture_npot
  11765 
  11766 // GL_OES_texture_stencil8
  11767 
  11768 // GL_OES_texture_storage_multisample_2d_array
  11769 void GL_APIENTRY GL_TexStorage3DMultisampleOES(GLenum target,
  11770                                               GLsizei samples,
  11771                                               GLenum internalformat,
  11772                                               GLsizei width,
  11773                                               GLsizei height,
  11774                                               GLsizei depth,
  11775                                               GLboolean fixedsamplelocations)
  11776 {
  11777    Context *context = GetValidGlobalContext();
  11778    EVENT(context, GLTexStorage3DMultisampleOES,
  11779          "context = %d, target = %s, samples = %d, internalformat = %s, width = %d, height = %d, "
  11780          "depth = %d, fixedsamplelocations = %s",
  11781          CID(context), GLenumToString(GLESEnum::TextureTarget, target), samples,
  11782          GLenumToString(GLESEnum::SizedInternalFormat, internalformat), width, height, depth,
  11783          GLbooleanToString(fixedsamplelocations));
  11784 
  11785    if (context)
  11786    {
  11787        TextureType targetPacked = PackParam<TextureType>(target);
  11788        SCOPED_SHARE_CONTEXT_LOCK(context);
  11789        bool isCallValid =
  11790            (context->skipValidation() ||
  11791             ValidateTexStorage3DMultisampleOES(
  11792                 context, angle::EntryPoint::GLTexStorage3DMultisampleOES, targetPacked, samples,
  11793                 internalformat, width, height, depth, fixedsamplelocations));
  11794        if (isCallValid)
  11795        {
  11796            context->texStorage3DMultisample(targetPacked, samples, internalformat, width, height,
  11797                                             depth, fixedsamplelocations);
  11798        }
  11799        ANGLE_CAPTURE_GL(TexStorage3DMultisampleOES, isCallValid, context, targetPacked, samples,
  11800                         internalformat, width, height, depth, fixedsamplelocations);
  11801    }
  11802    else
  11803    {
  11804        GenerateContextLostErrorOnCurrentGlobalContext();
  11805    }
  11806 }
  11807 
  11808 // GL_OES_vertex_array_object
  11809 void GL_APIENTRY GL_BindVertexArrayOES(GLuint array)
  11810 {
  11811    Context *context = GetValidGlobalContext();
  11812    EVENT(context, GLBindVertexArrayOES, "context = %d, array = %u", CID(context), array);
  11813 
  11814    if (context)
  11815    {
  11816        VertexArrayID arrayPacked = PackParam<VertexArrayID>(array);
  11817        SCOPED_SHARE_CONTEXT_LOCK(context);
  11818        bool isCallValid = (context->skipValidation() ||
  11819                            ValidateBindVertexArrayOES(
  11820                                context, angle::EntryPoint::GLBindVertexArrayOES, arrayPacked));
  11821        if (isCallValid)
  11822        {
  11823            context->bindVertexArray(arrayPacked);
  11824        }
  11825        ANGLE_CAPTURE_GL(BindVertexArrayOES, isCallValid, context, arrayPacked);
  11826    }
  11827    else
  11828    {
  11829        GenerateContextLostErrorOnCurrentGlobalContext();
  11830    }
  11831 }
  11832 
  11833 void GL_APIENTRY GL_DeleteVertexArraysOES(GLsizei n, const GLuint *arrays)
  11834 {
  11835    Context *context = GetValidGlobalContext();
  11836    EVENT(context, GLDeleteVertexArraysOES, "context = %d, n = %d, arrays = 0x%016" PRIxPTR "",
  11837          CID(context), n, (uintptr_t)arrays);
  11838 
  11839    if (context)
  11840    {
  11841        const VertexArrayID *arraysPacked = PackParam<const VertexArrayID *>(arrays);
  11842        SCOPED_SHARE_CONTEXT_LOCK(context);
  11843        bool isCallValid =
  11844            (context->skipValidation() ||
  11845             ValidateDeleteVertexArraysOES(context, angle::EntryPoint::GLDeleteVertexArraysOES, n,
  11846                                           arraysPacked));
  11847        if (isCallValid)
  11848        {
  11849            context->deleteVertexArrays(n, arraysPacked);
  11850        }
  11851        ANGLE_CAPTURE_GL(DeleteVertexArraysOES, isCallValid, context, n, arraysPacked);
  11852    }
  11853    else
  11854    {
  11855        GenerateContextLostErrorOnCurrentGlobalContext();
  11856    }
  11857 }
  11858 
  11859 void GL_APIENTRY GL_GenVertexArraysOES(GLsizei n, GLuint *arrays)
  11860 {
  11861    Context *context = GetValidGlobalContext();
  11862    EVENT(context, GLGenVertexArraysOES, "context = %d, n = %d, arrays = 0x%016" PRIxPTR "",
  11863          CID(context), n, (uintptr_t)arrays);
  11864 
  11865    if (context)
  11866    {
  11867        VertexArrayID *arraysPacked = PackParam<VertexArrayID *>(arrays);
  11868        SCOPED_SHARE_CONTEXT_LOCK(context);
  11869        bool isCallValid = (context->skipValidation() ||
  11870                            ValidateGenVertexArraysOES(
  11871                                context, angle::EntryPoint::GLGenVertexArraysOES, n, arraysPacked));
  11872        if (isCallValid)
  11873        {
  11874            context->genVertexArrays(n, arraysPacked);
  11875        }
  11876        ANGLE_CAPTURE_GL(GenVertexArraysOES, isCallValid, context, n, arraysPacked);
  11877    }
  11878    else
  11879    {
  11880        GenerateContextLostErrorOnCurrentGlobalContext();
  11881    }
  11882 }
  11883 
  11884 GLboolean GL_APIENTRY GL_IsVertexArrayOES(GLuint array)
  11885 {
  11886    Context *context = GetValidGlobalContext();
  11887    EVENT(context, GLIsVertexArrayOES, "context = %d, array = %u", CID(context), array);
  11888 
  11889    GLboolean returnValue;
  11890    if (context)
  11891    {
  11892        VertexArrayID arrayPacked = PackParam<VertexArrayID>(array);
  11893        SCOPED_SHARE_CONTEXT_LOCK(context);
  11894        bool isCallValid =
  11895            (context->skipValidation() ||
  11896             ValidateIsVertexArrayOES(context, angle::EntryPoint::GLIsVertexArrayOES, arrayPacked));
  11897        if (isCallValid)
  11898        {
  11899            returnValue = context->isVertexArray(arrayPacked);
  11900        }
  11901        else
  11902        {
  11903            returnValue = GetDefaultReturnValue<angle::EntryPoint::GLIsVertexArrayOES, GLboolean>();
  11904        }
  11905        ANGLE_CAPTURE_GL(IsVertexArrayOES, isCallValid, context, arrayPacked, returnValue);
  11906    }
  11907    else
  11908    {
  11909        GenerateContextLostErrorOnCurrentGlobalContext();
  11910        returnValue = GetDefaultReturnValue<angle::EntryPoint::GLIsVertexArrayOES, GLboolean>();
  11911    }
  11912    return returnValue;
  11913 }
  11914 
  11915 // GL_OES_vertex_half_float
  11916 
  11917 // GL_OES_vertex_type_10_10_10_2
  11918 
  11919 // GL_OVR_multiview
  11920 void GL_APIENTRY GL_FramebufferTextureMultiviewOVR(GLenum target,
  11921                                                   GLenum attachment,
  11922                                                   GLuint texture,
  11923                                                   GLint level,
  11924                                                   GLint baseViewIndex,
  11925                                                   GLsizei numViews)
  11926 {
  11927    Context *context = GetValidGlobalContext();
  11928    EVENT(context, GLFramebufferTextureMultiviewOVR,
  11929          "context = %d, target = %s, attachment = %s, texture = %u, level = %d, baseViewIndex = "
  11930          "%d, numViews = %d",
  11931          CID(context), GLenumToString(GLESEnum::FramebufferTarget, target),
  11932          GLenumToString(GLESEnum::FramebufferAttachment, attachment), texture, level,
  11933          baseViewIndex, numViews);
  11934 
  11935    if (context)
  11936    {
  11937        TextureID texturePacked = PackParam<TextureID>(texture);
  11938        SCOPED_SHARE_CONTEXT_LOCK(context);
  11939        bool isCallValid = (context->skipValidation() ||
  11940                            ValidateFramebufferTextureMultiviewOVR(
  11941                                context, angle::EntryPoint::GLFramebufferTextureMultiviewOVR,
  11942                                target, attachment, texturePacked, level, baseViewIndex, numViews));
  11943        if (isCallValid)
  11944        {
  11945            context->framebufferTextureMultiview(target, attachment, texturePacked, level,
  11946                                                 baseViewIndex, numViews);
  11947        }
  11948        ANGLE_CAPTURE_GL(FramebufferTextureMultiviewOVR, isCallValid, context, target, attachment,
  11949                         texturePacked, level, baseViewIndex, numViews);
  11950    }
  11951    else
  11952    {
  11953        GenerateContextLostErrorOnCurrentGlobalContext();
  11954    }
  11955 }
  11956 
  11957 // GL_OVR_multiview2
  11958 
  11959 // GL_QCOM_shading_rate
  11960 void GL_APIENTRY GL_ShadingRateQCOM(GLenum rate)
  11961 {
  11962    Context *context = GetValidGlobalContext();
  11963    EVENT(context, GLShadingRateQCOM, "context = %d, rate = %s", CID(context),
  11964          GLenumToString(GLESEnum::ShadingRateQCOM, rate));
  11965 
  11966    if (context)
  11967    {
  11968        SCOPED_SHARE_CONTEXT_LOCK(context);
  11969        bool isCallValid =
  11970            (context->skipValidation() ||
  11971             ValidateShadingRateQCOM(context, angle::EntryPoint::GLShadingRateQCOM, rate));
  11972        if (isCallValid)
  11973        {
  11974            context->shadingRateQCOM(rate);
  11975        }
  11976        ANGLE_CAPTURE_GL(ShadingRateQCOM, isCallValid, context, rate);
  11977    }
  11978    else
  11979    {
  11980        GenerateContextLostErrorOnCurrentGlobalContext();
  11981    }
  11982 }
  11983 
  11984 }  // extern "C"