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

#include "libANGLE/capture_gles_3_0_autogen.h"

#include "libANGLE/Context.h"
#include "libANGLE/FrameCapture.h"
#include "libANGLE/validationES3.h"

using namespace angle;

namespace gl
{

void CaptureBeginQuery(Context *context, QueryType targetPacked, GLuint id)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidateBeginQuery(context, targetPacked, id);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("targetPacked", ParamType::TQueryType, targetPacked);
    paramBuffer.addValueParam("id", ParamType::TGLuint, id);

    frameCapture->captureCall(context, "glBeginQuery", std::move(paramBuffer), isCallValid);
}

void CaptureBeginTransformFeedback(Context *context, PrimitiveMode primitiveModePacked)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidateBeginTransformFeedback(context, primitiveModePacked);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("primitiveModePacked", ParamType::TPrimitiveMode,
                              primitiveModePacked);

    frameCapture->captureCall(context, "glBeginTransformFeedback", std::move(paramBuffer),
                              isCallValid);
}

void CaptureBindBufferBase(Context *context,
                           BufferBinding targetPacked,
                           GLuint index,
                           GLuint buffer)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidateBindBufferBase(context, targetPacked, index, buffer);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("targetPacked", ParamType::TBufferBinding, targetPacked);
    paramBuffer.addValueParam("index", ParamType::TGLuint, index);
    paramBuffer.addValueParam("buffer", ParamType::TGLuint, buffer);

    frameCapture->captureCall(context, "glBindBufferBase", std::move(paramBuffer), isCallValid);
}

void CaptureBindBufferRange(Context *context,
                            BufferBinding targetPacked,
                            GLuint index,
                            GLuint buffer,
                            GLintptr offset,
                            GLsizeiptr size)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidateBindBufferRange(context, targetPacked, index, buffer, offset, size);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("targetPacked", ParamType::TBufferBinding, targetPacked);
    paramBuffer.addValueParam("index", ParamType::TGLuint, index);
    paramBuffer.addValueParam("buffer", ParamType::TGLuint, buffer);
    paramBuffer.addValueParam("offset", ParamType::TGLintptr, offset);
    paramBuffer.addValueParam("size", ParamType::TGLsizeiptr, size);

    frameCapture->captureCall(context, "glBindBufferRange", std::move(paramBuffer), isCallValid);
}

void CaptureBindSampler(Context *context, GLuint unit, GLuint sampler)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidateBindSampler(context, unit, sampler);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("unit", ParamType::TGLuint, unit);
    paramBuffer.addValueParam("sampler", ParamType::TGLuint, sampler);

    frameCapture->captureCall(context, "glBindSampler", std::move(paramBuffer), isCallValid);
}

void CaptureBindTransformFeedback(Context *context, GLenum target, GLuint id)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidateBindTransformFeedback(context, target, id);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("target", ParamType::TGLenum, target);
    paramBuffer.addValueParam("id", ParamType::TGLuint, id);

    frameCapture->captureCall(context, "glBindTransformFeedback", std::move(paramBuffer),
                              isCallValid);
}

void CaptureBindVertexArray(Context *context, GLuint array)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidateBindVertexArray(context, array);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("array", ParamType::TGLuint, array);

    frameCapture->captureCall(context, "glBindVertexArray", std::move(paramBuffer), isCallValid);
}

void CaptureBlitFramebuffer(Context *context,
                            GLint srcX0,
                            GLint srcY0,
                            GLint srcX1,
                            GLint srcY1,
                            GLint dstX0,
                            GLint dstY0,
                            GLint dstX1,
                            GLint dstY1,
                            GLbitfield mask,
                            GLenum filter)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidateBlitFramebuffer(context, srcX0, srcY0, srcX1, srcY1, dstX0, dstY0,
                                               dstX1, dstY1, mask, filter);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("srcX0", ParamType::TGLint, srcX0);
    paramBuffer.addValueParam("srcY0", ParamType::TGLint, srcY0);
    paramBuffer.addValueParam("srcX1", ParamType::TGLint, srcX1);
    paramBuffer.addValueParam("srcY1", ParamType::TGLint, srcY1);
    paramBuffer.addValueParam("dstX0", ParamType::TGLint, dstX0);
    paramBuffer.addValueParam("dstY0", ParamType::TGLint, dstY0);
    paramBuffer.addValueParam("dstX1", ParamType::TGLint, dstX1);
    paramBuffer.addValueParam("dstY1", ParamType::TGLint, dstY1);
    paramBuffer.addValueParam("mask", ParamType::TGLbitfield, mask);
    paramBuffer.addValueParam("filter", ParamType::TGLenum, filter);

    frameCapture->captureCall(context, "glBlitFramebuffer", std::move(paramBuffer), isCallValid);
}

void CaptureClearBufferfi(Context *context,
                          GLenum buffer,
                          GLint drawbuffer,
                          GLfloat depth,
                          GLint stencil)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidateClearBufferfi(context, buffer, drawbuffer, depth, stencil);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("buffer", ParamType::TGLenum, buffer);
    paramBuffer.addValueParam("drawbuffer", ParamType::TGLint, drawbuffer);
    paramBuffer.addValueParam("depth", ParamType::TGLfloat, depth);
    paramBuffer.addValueParam("stencil", ParamType::TGLint, stencil);

    frameCapture->captureCall(context, "glClearBufferfi", std::move(paramBuffer), isCallValid);
}

void CaptureClearBufferfv(Context *context, GLenum buffer, GLint drawbuffer, const GLfloat *value)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidateClearBufferfv(context, buffer, drawbuffer, value);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("buffer", ParamType::TGLenum, buffer);
    paramBuffer.addValueParam("drawbuffer", ParamType::TGLint, drawbuffer);

    ParamCapture valueParam("value", ParamType::TGLfloatConstPointer);
    InitParamValue(ParamType::TGLfloatConstPointer, value, &valueParam.value);
    CaptureClearBufferfv_value(context, buffer, drawbuffer, value, isCallValid, &valueParam);
    paramBuffer.addParam(std::move(valueParam));

    frameCapture->captureCall(context, "glClearBufferfv", std::move(paramBuffer), isCallValid);
}

void CaptureClearBufferiv(Context *context, GLenum buffer, GLint drawbuffer, const GLint *value)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidateClearBufferiv(context, buffer, drawbuffer, value);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("buffer", ParamType::TGLenum, buffer);
    paramBuffer.addValueParam("drawbuffer", ParamType::TGLint, drawbuffer);

    ParamCapture valueParam("value", ParamType::TGLintConstPointer);
    InitParamValue(ParamType::TGLintConstPointer, value, &valueParam.value);
    CaptureClearBufferiv_value(context, buffer, drawbuffer, value, isCallValid, &valueParam);
    paramBuffer.addParam(std::move(valueParam));

    frameCapture->captureCall(context, "glClearBufferiv", std::move(paramBuffer), isCallValid);
}

void CaptureClearBufferuiv(Context *context, GLenum buffer, GLint drawbuffer, const GLuint *value)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidateClearBufferuiv(context, buffer, drawbuffer, value);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("buffer", ParamType::TGLenum, buffer);
    paramBuffer.addValueParam("drawbuffer", ParamType::TGLint, drawbuffer);

    ParamCapture valueParam("value", ParamType::TGLuintConstPointer);
    InitParamValue(ParamType::TGLuintConstPointer, value, &valueParam.value);
    CaptureClearBufferuiv_value(context, buffer, drawbuffer, value, isCallValid, &valueParam);
    paramBuffer.addParam(std::move(valueParam));

    frameCapture->captureCall(context, "glClearBufferuiv", std::move(paramBuffer), isCallValid);
}

void CaptureClientWaitSync(Context *context, GLsync sync, GLbitfield flags, GLuint64 timeout)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidateClientWaitSync(context, sync, flags, timeout);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("sync", ParamType::TGLsync, sync);
    paramBuffer.addValueParam("flags", ParamType::TGLbitfield, flags);
    paramBuffer.addValueParam("timeout", ParamType::TGLuint64, timeout);

    frameCapture->captureCall(context, "glClientWaitSync", std::move(paramBuffer), isCallValid);
}

void CaptureCompressedTexImage3D(Context *context,
                                 TextureTarget targetPacked,
                                 GLint level,
                                 GLenum internalformat,
                                 GLsizei width,
                                 GLsizei height,
                                 GLsizei depth,
                                 GLint border,
                                 GLsizei imageSize,
                                 const void *data)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidateCompressedTexImage3D(context, targetPacked, level, internalformat,
                                                    width, height, depth, border, imageSize, data);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("targetPacked", ParamType::TTextureTarget, targetPacked);
    paramBuffer.addValueParam("level", ParamType::TGLint, level);
    paramBuffer.addValueParam("internalformat", ParamType::TGLenum, internalformat);
    paramBuffer.addValueParam("width", ParamType::TGLsizei, width);
    paramBuffer.addValueParam("height", ParamType::TGLsizei, height);
    paramBuffer.addValueParam("depth", ParamType::TGLsizei, depth);
    paramBuffer.addValueParam("border", ParamType::TGLint, border);
    paramBuffer.addValueParam("imageSize", ParamType::TGLsizei, imageSize);

    ParamCapture dataParam("data", ParamType::TvoidConstPointer);
    InitParamValue(ParamType::TvoidConstPointer, data, &dataParam.value);
    CaptureCompressedTexImage3D_data(context, targetPacked, level, internalformat, width, height,
                                     depth, border, imageSize, data, isCallValid, &dataParam);
    paramBuffer.addParam(std::move(dataParam));

    frameCapture->captureCall(context, "glCompressedTexImage3D", std::move(paramBuffer),
                              isCallValid);
}

void CaptureCompressedTexSubImage3D(Context *context,
                                    TextureTarget targetPacked,
                                    GLint level,
                                    GLint xoffset,
                                    GLint yoffset,
                                    GLint zoffset,
                                    GLsizei width,
                                    GLsizei height,
                                    GLsizei depth,
                                    GLenum format,
                                    GLsizei imageSize,
                                    const void *data)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid =
        ValidateCompressedTexSubImage3D(context, targetPacked, level, xoffset, yoffset, zoffset,
                                        width, height, depth, format, imageSize, data);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("targetPacked", ParamType::TTextureTarget, targetPacked);
    paramBuffer.addValueParam("level", ParamType::TGLint, level);
    paramBuffer.addValueParam("xoffset", ParamType::TGLint, xoffset);
    paramBuffer.addValueParam("yoffset", ParamType::TGLint, yoffset);
    paramBuffer.addValueParam("zoffset", ParamType::TGLint, zoffset);
    paramBuffer.addValueParam("width", ParamType::TGLsizei, width);
    paramBuffer.addValueParam("height", ParamType::TGLsizei, height);
    paramBuffer.addValueParam("depth", ParamType::TGLsizei, depth);
    paramBuffer.addValueParam("format", ParamType::TGLenum, format);
    paramBuffer.addValueParam("imageSize", ParamType::TGLsizei, imageSize);

    ParamCapture dataParam("data", ParamType::TvoidConstPointer);
    InitParamValue(ParamType::TvoidConstPointer, data, &dataParam.value);
    CaptureCompressedTexSubImage3D_data(context, targetPacked, level, xoffset, yoffset, zoffset,
                                        width, height, depth, format, imageSize, data, isCallValid,
                                        &dataParam);
    paramBuffer.addParam(std::move(dataParam));

    frameCapture->captureCall(context, "glCompressedTexSubImage3D", std::move(paramBuffer),
                              isCallValid);
}

void CaptureCopyBufferSubData(Context *context,
                              BufferBinding readTargetPacked,
                              BufferBinding writeTargetPacked,
                              GLintptr readOffset,
                              GLintptr writeOffset,
                              GLsizeiptr size)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidateCopyBufferSubData(context, readTargetPacked, writeTargetPacked,
                                                 readOffset, writeOffset, size);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("readTargetPacked", ParamType::TBufferBinding, readTargetPacked);
    paramBuffer.addValueParam("writeTargetPacked", ParamType::TBufferBinding, writeTargetPacked);
    paramBuffer.addValueParam("readOffset", ParamType::TGLintptr, readOffset);
    paramBuffer.addValueParam("writeOffset", ParamType::TGLintptr, writeOffset);
    paramBuffer.addValueParam("size", ParamType::TGLsizeiptr, size);

    frameCapture->captureCall(context, "glCopyBufferSubData", std::move(paramBuffer), isCallValid);
}

void CaptureCopyTexSubImage3D(Context *context,
                              TextureTarget targetPacked,
                              GLint level,
                              GLint xoffset,
                              GLint yoffset,
                              GLint zoffset,
                              GLint x,
                              GLint y,
                              GLsizei width,
                              GLsizei height)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidateCopyTexSubImage3D(context, targetPacked, level, xoffset, yoffset,
                                                 zoffset, x, y, width, height);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("targetPacked", ParamType::TTextureTarget, targetPacked);
    paramBuffer.addValueParam("level", ParamType::TGLint, level);
    paramBuffer.addValueParam("xoffset", ParamType::TGLint, xoffset);
    paramBuffer.addValueParam("yoffset", ParamType::TGLint, yoffset);
    paramBuffer.addValueParam("zoffset", ParamType::TGLint, zoffset);
    paramBuffer.addValueParam("x", ParamType::TGLint, x);
    paramBuffer.addValueParam("y", ParamType::TGLint, y);
    paramBuffer.addValueParam("width", ParamType::TGLsizei, width);
    paramBuffer.addValueParam("height", ParamType::TGLsizei, height);

    frameCapture->captureCall(context, "glCopyTexSubImage3D", std::move(paramBuffer), isCallValid);
}

void CaptureDeleteQueries(Context *context, GLsizei n, const GLuint *ids)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidateDeleteQueries(context, n, ids);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("n", ParamType::TGLsizei, n);

    ParamCapture idsParam("ids", ParamType::TGLuintConstPointer);
    InitParamValue(ParamType::TGLuintConstPointer, ids, &idsParam.value);
    CaptureDeleteQueries_ids(context, n, ids, isCallValid, &idsParam);
    paramBuffer.addParam(std::move(idsParam));

    frameCapture->captureCall(context, "glDeleteQueries", std::move(paramBuffer), isCallValid);
}

void CaptureDeleteSamplers(Context *context, GLsizei count, const GLuint *samplers)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidateDeleteSamplers(context, count, samplers);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("count", ParamType::TGLsizei, count);

    ParamCapture samplersParam("samplers", ParamType::TGLuintConstPointer);
    InitParamValue(ParamType::TGLuintConstPointer, samplers, &samplersParam.value);
    CaptureDeleteSamplers_samplers(context, count, samplers, isCallValid, &samplersParam);
    paramBuffer.addParam(std::move(samplersParam));

    frameCapture->captureCall(context, "glDeleteSamplers", std::move(paramBuffer), isCallValid);
}

void CaptureDeleteSync(Context *context, GLsync sync)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidateDeleteSync(context, sync);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("sync", ParamType::TGLsync, sync);

    frameCapture->captureCall(context, "glDeleteSync", std::move(paramBuffer), isCallValid);
}

void CaptureDeleteTransformFeedbacks(Context *context, GLsizei n, const GLuint *ids)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidateDeleteTransformFeedbacks(context, n, ids);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("n", ParamType::TGLsizei, n);

    ParamCapture idsParam("ids", ParamType::TGLuintConstPointer);
    InitParamValue(ParamType::TGLuintConstPointer, ids, &idsParam.value);
    CaptureDeleteTransformFeedbacks_ids(context, n, ids, isCallValid, &idsParam);
    paramBuffer.addParam(std::move(idsParam));

    frameCapture->captureCall(context, "glDeleteTransformFeedbacks", std::move(paramBuffer),
                              isCallValid);
}

void CaptureDeleteVertexArrays(Context *context, GLsizei n, const GLuint *arrays)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidateDeleteVertexArrays(context, n, arrays);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("n", ParamType::TGLsizei, n);

    ParamCapture arraysParam("arrays", ParamType::TGLuintConstPointer);
    InitParamValue(ParamType::TGLuintConstPointer, arrays, &arraysParam.value);
    CaptureDeleteVertexArrays_arrays(context, n, arrays, isCallValid, &arraysParam);
    paramBuffer.addParam(std::move(arraysParam));

    frameCapture->captureCall(context, "glDeleteVertexArrays", std::move(paramBuffer), isCallValid);
}

void CaptureDrawArraysInstanced(Context *context,
                                PrimitiveMode modePacked,
                                GLint first,
                                GLsizei count,
                                GLsizei instancecount)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid =
        ValidateDrawArraysInstanced(context, modePacked, first, count, instancecount);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("modePacked", ParamType::TPrimitiveMode, modePacked);
    paramBuffer.addValueParam("first", ParamType::TGLint, first);
    paramBuffer.addValueParam("count", ParamType::TGLsizei, count);
    paramBuffer.addValueParam("instancecount", ParamType::TGLsizei, instancecount);

    frameCapture->captureCall(context, "glDrawArraysInstanced", std::move(paramBuffer),
                              isCallValid);
}

void CaptureDrawBuffers(Context *context, GLsizei n, const GLenum *bufs)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidateDrawBuffers(context, n, bufs);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("n", ParamType::TGLsizei, n);

    ParamCapture bufsParam("bufs", ParamType::TGLenumConstPointer);
    InitParamValue(ParamType::TGLenumConstPointer, bufs, &bufsParam.value);
    CaptureDrawBuffers_bufs(context, n, bufs, isCallValid, &bufsParam);
    paramBuffer.addParam(std::move(bufsParam));

    frameCapture->captureCall(context, "glDrawBuffers", std::move(paramBuffer), isCallValid);
}

void CaptureDrawElementsInstanced(Context *context,
                                  PrimitiveMode modePacked,
                                  GLsizei count,
                                  DrawElementsType typePacked,
                                  const void *indices,
                                  GLsizei instancecount)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidateDrawElementsInstanced(context, modePacked, count, typePacked,
                                                     indices, instancecount);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("modePacked", ParamType::TPrimitiveMode, modePacked);
    paramBuffer.addValueParam("count", ParamType::TGLsizei, count);
    paramBuffer.addValueParam("typePacked", ParamType::TDrawElementsType, typePacked);

    ParamCapture indicesParam("indices", ParamType::TvoidConstPointer);
    InitParamValue(ParamType::TvoidConstPointer, indices, &indicesParam.value);
    CaptureDrawElementsInstanced_indices(context, modePacked, count, typePacked, indices,
                                         instancecount, isCallValid, &indicesParam);
    paramBuffer.addParam(std::move(indicesParam));

    paramBuffer.addValueParam("instancecount", ParamType::TGLsizei, instancecount);

    frameCapture->captureCall(context, "glDrawElementsInstanced", std::move(paramBuffer),
                              isCallValid);
}

void CaptureDrawRangeElements(Context *context,
                              PrimitiveMode modePacked,
                              GLuint start,
                              GLuint end,
                              GLsizei count,
                              DrawElementsType typePacked,
                              const void *indices)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid =
        ValidateDrawRangeElements(context, modePacked, start, end, count, typePacked, indices);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("modePacked", ParamType::TPrimitiveMode, modePacked);
    paramBuffer.addValueParam("start", ParamType::TGLuint, start);
    paramBuffer.addValueParam("end", ParamType::TGLuint, end);
    paramBuffer.addValueParam("count", ParamType::TGLsizei, count);
    paramBuffer.addValueParam("typePacked", ParamType::TDrawElementsType, typePacked);

    ParamCapture indicesParam("indices", ParamType::TvoidConstPointer);
    InitParamValue(ParamType::TvoidConstPointer, indices, &indicesParam.value);
    CaptureDrawRangeElements_indices(context, modePacked, start, end, count, typePacked, indices,
                                     isCallValid, &indicesParam);
    paramBuffer.addParam(std::move(indicesParam));

    frameCapture->captureCall(context, "glDrawRangeElements", std::move(paramBuffer), isCallValid);
}

void CaptureEndQuery(Context *context, QueryType targetPacked)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidateEndQuery(context, targetPacked);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("targetPacked", ParamType::TQueryType, targetPacked);

    frameCapture->captureCall(context, "glEndQuery", std::move(paramBuffer), isCallValid);
}

void CaptureEndTransformFeedback(Context *context)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidateEndTransformFeedback(context);
    ParamBuffer paramBuffer;

    frameCapture->captureCall(context, "glEndTransformFeedback", std::move(paramBuffer),
                              isCallValid);
}

void CaptureFenceSync(Context *context, GLenum condition, GLbitfield flags)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidateFenceSync(context, condition, flags);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("condition", ParamType::TGLenum, condition);
    paramBuffer.addValueParam("flags", ParamType::TGLbitfield, flags);

    frameCapture->captureCall(context, "glFenceSync", std::move(paramBuffer), isCallValid);
}

void CaptureFlushMappedBufferRange(Context *context,
                                   BufferBinding targetPacked,
                                   GLintptr offset,
                                   GLsizeiptr length)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidateFlushMappedBufferRange(context, targetPacked, offset, length);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("targetPacked", ParamType::TBufferBinding, targetPacked);
    paramBuffer.addValueParam("offset", ParamType::TGLintptr, offset);
    paramBuffer.addValueParam("length", ParamType::TGLsizeiptr, length);

    frameCapture->captureCall(context, "glFlushMappedBufferRange", std::move(paramBuffer),
                              isCallValid);
}

void CaptureFramebufferTextureLayer(Context *context,
                                    GLenum target,
                                    GLenum attachment,
                                    GLuint texture,
                                    GLint level,
                                    GLint layer)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid =
        ValidateFramebufferTextureLayer(context, target, attachment, texture, level, layer);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("target", ParamType::TGLenum, target);
    paramBuffer.addValueParam("attachment", ParamType::TGLenum, attachment);
    paramBuffer.addValueParam("texture", ParamType::TGLuint, texture);
    paramBuffer.addValueParam("level", ParamType::TGLint, level);
    paramBuffer.addValueParam("layer", ParamType::TGLint, layer);

    frameCapture->captureCall(context, "glFramebufferTextureLayer", std::move(paramBuffer),
                              isCallValid);
}

void CaptureGenQueries(Context *context, GLsizei n, GLuint *ids)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidateGenQueries(context, n, ids);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("n", ParamType::TGLsizei, n);

    ParamCapture idsParam("ids", ParamType::TGLuintPointer);
    InitParamValue(ParamType::TGLuintPointer, ids, &idsParam.value);
    CaptureGenQueries_ids(context, n, ids, isCallValid, &idsParam);
    paramBuffer.addParam(std::move(idsParam));

    frameCapture->captureCall(context, "glGenQueries", std::move(paramBuffer), isCallValid);
}

void CaptureGenSamplers(Context *context, GLsizei count, GLuint *samplers)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidateGenSamplers(context, count, samplers);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("count", ParamType::TGLsizei, count);

    ParamCapture samplersParam("samplers", ParamType::TGLuintPointer);
    InitParamValue(ParamType::TGLuintPointer, samplers, &samplersParam.value);
    CaptureGenSamplers_samplers(context, count, samplers, isCallValid, &samplersParam);
    paramBuffer.addParam(std::move(samplersParam));

    frameCapture->captureCall(context, "glGenSamplers", std::move(paramBuffer), isCallValid);
}

void CaptureGenTransformFeedbacks(Context *context, GLsizei n, GLuint *ids)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidateGenTransformFeedbacks(context, n, ids);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("n", ParamType::TGLsizei, n);

    ParamCapture idsParam("ids", ParamType::TGLuintPointer);
    InitParamValue(ParamType::TGLuintPointer, ids, &idsParam.value);
    CaptureGenTransformFeedbacks_ids(context, n, ids, isCallValid, &idsParam);
    paramBuffer.addParam(std::move(idsParam));

    frameCapture->captureCall(context, "glGenTransformFeedbacks", std::move(paramBuffer),
                              isCallValid);
}

void CaptureGenVertexArrays(Context *context, GLsizei n, GLuint *arrays)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidateGenVertexArrays(context, n, arrays);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("n", ParamType::TGLsizei, n);

    ParamCapture arraysParam("arrays", ParamType::TGLuintPointer);
    InitParamValue(ParamType::TGLuintPointer, arrays, &arraysParam.value);
    CaptureGenVertexArrays_arrays(context, n, arrays, isCallValid, &arraysParam);
    paramBuffer.addParam(std::move(arraysParam));

    frameCapture->captureCall(context, "glGenVertexArrays", std::move(paramBuffer), isCallValid);
}

void CaptureGetActiveUniformBlockName(Context *context,
                                      GLuint program,
                                      GLuint uniformBlockIndex,
                                      GLsizei bufSize,
                                      GLsizei *length,
                                      GLchar *uniformBlockName)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidateGetActiveUniformBlockName(context, program, uniformBlockIndex,
                                                         bufSize, length, uniformBlockName);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("program", ParamType::TGLuint, program);
    paramBuffer.addValueParam("uniformBlockIndex", ParamType::TGLuint, uniformBlockIndex);
    paramBuffer.addValueParam("bufSize", ParamType::TGLsizei, bufSize);

    ParamCapture lengthParam("length", ParamType::TGLsizeiPointer);
    InitParamValue(ParamType::TGLsizeiPointer, length, &lengthParam.value);
    CaptureGetActiveUniformBlockName_length(context, program, uniformBlockIndex, bufSize, length,
                                            uniformBlockName, isCallValid, &lengthParam);
    paramBuffer.addParam(std::move(lengthParam));

    ParamCapture uniformBlockNameParam("uniformBlockName", ParamType::TGLcharPointer);
    InitParamValue(ParamType::TGLcharPointer, uniformBlockName, &uniformBlockNameParam.value);
    CaptureGetActiveUniformBlockName_uniformBlockName(context, program, uniformBlockIndex, bufSize,
                                                      length, uniformBlockName, isCallValid,
                                                      &uniformBlockNameParam);
    paramBuffer.addParam(std::move(uniformBlockNameParam));

    frameCapture->captureCall(context, "glGetActiveUniformBlockName", std::move(paramBuffer),
                              isCallValid);
}

void CaptureGetActiveUniformBlockiv(Context *context,
                                    GLuint program,
                                    GLuint uniformBlockIndex,
                                    GLenum pname,
                                    GLint *params)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid =
        ValidateGetActiveUniformBlockiv(context, program, uniformBlockIndex, pname, params);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("program", ParamType::TGLuint, program);
    paramBuffer.addValueParam("uniformBlockIndex", ParamType::TGLuint, uniformBlockIndex);
    paramBuffer.addValueParam("pname", ParamType::TGLenum, pname);

    ParamCapture paramsParam("params", ParamType::TGLintPointer);
    InitParamValue(ParamType::TGLintPointer, params, &paramsParam.value);
    CaptureGetActiveUniformBlockiv_params(context, program, uniformBlockIndex, pname, params,
                                          isCallValid, &paramsParam);
    paramBuffer.addParam(std::move(paramsParam));

    frameCapture->captureCall(context, "glGetActiveUniformBlockiv", std::move(paramBuffer),
                              isCallValid);
}

void CaptureGetActiveUniformsiv(Context *context,
                                GLuint program,
                                GLsizei uniformCount,
                                const GLuint *uniformIndices,
                                GLenum pname,
                                GLint *params)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid =
        ValidateGetActiveUniformsiv(context, program, uniformCount, uniformIndices, pname, params);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("program", ParamType::TGLuint, program);
    paramBuffer.addValueParam("uniformCount", ParamType::TGLsizei, uniformCount);

    ParamCapture uniformIndicesParam("uniformIndices", ParamType::TGLuintConstPointer);
    InitParamValue(ParamType::TGLuintConstPointer, uniformIndices, &uniformIndicesParam.value);
    CaptureGetActiveUniformsiv_uniformIndices(context, program, uniformCount, uniformIndices, pname,
                                              params, isCallValid, &uniformIndicesParam);
    paramBuffer.addParam(std::move(uniformIndicesParam));

    paramBuffer.addValueParam("pname", ParamType::TGLenum, pname);

    ParamCapture paramsParam("params", ParamType::TGLintPointer);
    InitParamValue(ParamType::TGLintPointer, params, &paramsParam.value);
    CaptureGetActiveUniformsiv_params(context, program, uniformCount, uniformIndices, pname, params,
                                      isCallValid, &paramsParam);
    paramBuffer.addParam(std::move(paramsParam));

    frameCapture->captureCall(context, "glGetActiveUniformsiv", std::move(paramBuffer),
                              isCallValid);
}

void CaptureGetBufferParameteri64v(Context *context,
                                   BufferBinding targetPacked,
                                   GLenum pname,
                                   GLint64 *params)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidateGetBufferParameteri64v(context, targetPacked, pname, params);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("targetPacked", ParamType::TBufferBinding, targetPacked);
    paramBuffer.addValueParam("pname", ParamType::TGLenum, pname);

    ParamCapture paramsParam("params", ParamType::TGLint64Pointer);
    InitParamValue(ParamType::TGLint64Pointer, params, &paramsParam.value);
    CaptureGetBufferParameteri64v_params(context, targetPacked, pname, params, isCallValid,
                                         &paramsParam);
    paramBuffer.addParam(std::move(paramsParam));

    frameCapture->captureCall(context, "glGetBufferParameteri64v", std::move(paramBuffer),
                              isCallValid);
}

void CaptureGetBufferPointerv(Context *context,
                              BufferBinding targetPacked,
                              GLenum pname,
                              void **params)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidateGetBufferPointerv(context, targetPacked, pname, params);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("targetPacked", ParamType::TBufferBinding, targetPacked);
    paramBuffer.addValueParam("pname", ParamType::TGLenum, pname);

    ParamCapture paramsParam("params", ParamType::TvoidPointerPointer);
    InitParamValue(ParamType::TvoidPointerPointer, params, &paramsParam.value);
    CaptureGetBufferPointerv_params(context, targetPacked, pname, params, isCallValid,
                                    &paramsParam);
    paramBuffer.addParam(std::move(paramsParam));

    frameCapture->captureCall(context, "glGetBufferPointerv", std::move(paramBuffer), isCallValid);
}

void CaptureGetFragDataLocation(Context *context, GLuint program, const GLchar *name)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidateGetFragDataLocation(context, program, name);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("program", ParamType::TGLuint, program);

    ParamCapture nameParam("name", ParamType::TGLcharConstPointer);
    InitParamValue(ParamType::TGLcharConstPointer, name, &nameParam.value);
    CaptureGetFragDataLocation_name(context, program, name, isCallValid, &nameParam);
    paramBuffer.addParam(std::move(nameParam));

    frameCapture->captureCall(context, "glGetFragDataLocation", std::move(paramBuffer),
                              isCallValid);
}

void CaptureGetInteger64i_v(Context *context, GLenum target, GLuint index, GLint64 *data)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidateGetInteger64i_v(context, target, index, data);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("target", ParamType::TGLenum, target);
    paramBuffer.addValueParam("index", ParamType::TGLuint, index);

    ParamCapture dataParam("data", ParamType::TGLint64Pointer);
    InitParamValue(ParamType::TGLint64Pointer, data, &dataParam.value);
    CaptureGetInteger64i_v_data(context, target, index, data, isCallValid, &dataParam);
    paramBuffer.addParam(std::move(dataParam));

    frameCapture->captureCall(context, "glGetInteger64i_v", std::move(paramBuffer), isCallValid);
}

void CaptureGetInteger64v(Context *context, GLenum pname, GLint64 *data)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidateGetInteger64v(context, pname, data);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("pname", ParamType::TGLenum, pname);

    ParamCapture dataParam("data", ParamType::TGLint64Pointer);
    InitParamValue(ParamType::TGLint64Pointer, data, &dataParam.value);
    CaptureGetInteger64v_data(context, pname, data, isCallValid, &dataParam);
    paramBuffer.addParam(std::move(dataParam));

    frameCapture->captureCall(context, "glGetInteger64v", std::move(paramBuffer), isCallValid);
}

void CaptureGetIntegeri_v(Context *context, GLenum target, GLuint index, GLint *data)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidateGetIntegeri_v(context, target, index, data);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("target", ParamType::TGLenum, target);
    paramBuffer.addValueParam("index", ParamType::TGLuint, index);

    ParamCapture dataParam("data", ParamType::TGLintPointer);
    InitParamValue(ParamType::TGLintPointer, data, &dataParam.value);
    CaptureGetIntegeri_v_data(context, target, index, data, isCallValid, &dataParam);
    paramBuffer.addParam(std::move(dataParam));

    frameCapture->captureCall(context, "glGetIntegeri_v", std::move(paramBuffer), isCallValid);
}

void CaptureGetInternalformativ(Context *context,
                                GLenum target,
                                GLenum internalformat,
                                GLenum pname,
                                GLsizei bufSize,
                                GLint *params)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid =
        ValidateGetInternalformativ(context, target, internalformat, pname, bufSize, params);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("target", ParamType::TGLenum, target);
    paramBuffer.addValueParam("internalformat", ParamType::TGLenum, internalformat);
    paramBuffer.addValueParam("pname", ParamType::TGLenum, pname);
    paramBuffer.addValueParam("bufSize", ParamType::TGLsizei, bufSize);

    ParamCapture paramsParam("params", ParamType::TGLintPointer);
    InitParamValue(ParamType::TGLintPointer, params, &paramsParam.value);
    CaptureGetInternalformativ_params(context, target, internalformat, pname, bufSize, params,
                                      isCallValid, &paramsParam);
    paramBuffer.addParam(std::move(paramsParam));

    frameCapture->captureCall(context, "glGetInternalformativ", std::move(paramBuffer),
                              isCallValid);
}

void CaptureGetProgramBinary(Context *context,
                             GLuint program,
                             GLsizei bufSize,
                             GLsizei *length,
                             GLenum *binaryFormat,
                             void *binary)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid =
        ValidateGetProgramBinary(context, program, bufSize, length, binaryFormat, binary);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("program", ParamType::TGLuint, program);
    paramBuffer.addValueParam("bufSize", ParamType::TGLsizei, bufSize);

    ParamCapture lengthParam("length", ParamType::TGLsizeiPointer);
    InitParamValue(ParamType::TGLsizeiPointer, length, &lengthParam.value);
    CaptureGetProgramBinary_length(context, program, bufSize, length, binaryFormat, binary,
                                   isCallValid, &lengthParam);
    paramBuffer.addParam(std::move(lengthParam));

    ParamCapture binaryFormatParam("binaryFormat", ParamType::TGLenumPointer);
    InitParamValue(ParamType::TGLenumPointer, binaryFormat, &binaryFormatParam.value);
    CaptureGetProgramBinary_binaryFormat(context, program, bufSize, length, binaryFormat, binary,
                                         isCallValid, &binaryFormatParam);
    paramBuffer.addParam(std::move(binaryFormatParam));

    ParamCapture binaryParam("binary", ParamType::TvoidPointer);
    InitParamValue(ParamType::TvoidPointer, binary, &binaryParam.value);
    CaptureGetProgramBinary_binary(context, program, bufSize, length, binaryFormat, binary,
                                   isCallValid, &binaryParam);
    paramBuffer.addParam(std::move(binaryParam));

    frameCapture->captureCall(context, "glGetProgramBinary", std::move(paramBuffer), isCallValid);
}

void CaptureGetQueryObjectuiv(Context *context, GLuint id, GLenum pname, GLuint *params)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidateGetQueryObjectuiv(context, id, pname, params);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("id", ParamType::TGLuint, id);
    paramBuffer.addValueParam("pname", ParamType::TGLenum, pname);

    ParamCapture paramsParam("params", ParamType::TGLuintPointer);
    InitParamValue(ParamType::TGLuintPointer, params, &paramsParam.value);
    CaptureGetQueryObjectuiv_params(context, id, pname, params, isCallValid, &paramsParam);
    paramBuffer.addParam(std::move(paramsParam));

    frameCapture->captureCall(context, "glGetQueryObjectuiv", std::move(paramBuffer), isCallValid);
}

void CaptureGetQueryiv(Context *context, QueryType targetPacked, GLenum pname, GLint *params)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidateGetQueryiv(context, targetPacked, pname, params);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("targetPacked", ParamType::TQueryType, targetPacked);
    paramBuffer.addValueParam("pname", ParamType::TGLenum, pname);

    ParamCapture paramsParam("params", ParamType::TGLintPointer);
    InitParamValue(ParamType::TGLintPointer, params, &paramsParam.value);
    CaptureGetQueryiv_params(context, targetPacked, pname, params, isCallValid, &paramsParam);
    paramBuffer.addParam(std::move(paramsParam));

    frameCapture->captureCall(context, "glGetQueryiv", std::move(paramBuffer), isCallValid);
}

void CaptureGetSamplerParameterfv(Context *context, GLuint sampler, GLenum pname, GLfloat *params)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidateGetSamplerParameterfv(context, sampler, pname, params);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("sampler", ParamType::TGLuint, sampler);
    paramBuffer.addValueParam("pname", ParamType::TGLenum, pname);

    ParamCapture paramsParam("params", ParamType::TGLfloatPointer);
    InitParamValue(ParamType::TGLfloatPointer, params, &paramsParam.value);
    CaptureGetSamplerParameterfv_params(context, sampler, pname, params, isCallValid, &paramsParam);
    paramBuffer.addParam(std::move(paramsParam));

    frameCapture->captureCall(context, "glGetSamplerParameterfv", std::move(paramBuffer),
                              isCallValid);
}

void CaptureGetSamplerParameteriv(Context *context, GLuint sampler, GLenum pname, GLint *params)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidateGetSamplerParameteriv(context, sampler, pname, params);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("sampler", ParamType::TGLuint, sampler);
    paramBuffer.addValueParam("pname", ParamType::TGLenum, pname);

    ParamCapture paramsParam("params", ParamType::TGLintPointer);
    InitParamValue(ParamType::TGLintPointer, params, &paramsParam.value);
    CaptureGetSamplerParameteriv_params(context, sampler, pname, params, isCallValid, &paramsParam);
    paramBuffer.addParam(std::move(paramsParam));

    frameCapture->captureCall(context, "glGetSamplerParameteriv", std::move(paramBuffer),
                              isCallValid);
}

void CaptureGetStringi(Context *context, GLenum name, GLuint index)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidateGetStringi(context, name, index);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("name", ParamType::TGLenum, name);
    paramBuffer.addValueParam("index", ParamType::TGLuint, index);

    frameCapture->captureCall(context, "glGetStringi", std::move(paramBuffer), isCallValid);
}

void CaptureGetSynciv(Context *context,
                      GLsync sync,
                      GLenum pname,
                      GLsizei bufSize,
                      GLsizei *length,
                      GLint *values)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidateGetSynciv(context, sync, pname, bufSize, length, values);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("sync", ParamType::TGLsync, sync);
    paramBuffer.addValueParam("pname", ParamType::TGLenum, pname);
    paramBuffer.addValueParam("bufSize", ParamType::TGLsizei, bufSize);

    ParamCapture lengthParam("length", ParamType::TGLsizeiPointer);
    InitParamValue(ParamType::TGLsizeiPointer, length, &lengthParam.value);
    CaptureGetSynciv_length(context, sync, pname, bufSize, length, values, isCallValid,
                            &lengthParam);
    paramBuffer.addParam(std::move(lengthParam));

    ParamCapture valuesParam("values", ParamType::TGLintPointer);
    InitParamValue(ParamType::TGLintPointer, values, &valuesParam.value);
    CaptureGetSynciv_values(context, sync, pname, bufSize, length, values, isCallValid,
                            &valuesParam);
    paramBuffer.addParam(std::move(valuesParam));

    frameCapture->captureCall(context, "glGetSynciv", std::move(paramBuffer), isCallValid);
}

void CaptureGetTransformFeedbackVarying(Context *context,
                                        GLuint program,
                                        GLuint index,
                                        GLsizei bufSize,
                                        GLsizei *length,
                                        GLsizei *size,
                                        GLenum *type,
                                        GLchar *name)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidateGetTransformFeedbackVarying(context, program, index, bufSize, length,
                                                           size, type, name);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("program", ParamType::TGLuint, program);
    paramBuffer.addValueParam("index", ParamType::TGLuint, index);
    paramBuffer.addValueParam("bufSize", ParamType::TGLsizei, bufSize);

    ParamCapture lengthParam("length", ParamType::TGLsizeiPointer);
    InitParamValue(ParamType::TGLsizeiPointer, length, &lengthParam.value);
    CaptureGetTransformFeedbackVarying_length(context, program, index, bufSize, length, size, type,
                                              name, isCallValid, &lengthParam);
    paramBuffer.addParam(std::move(lengthParam));

    ParamCapture sizeParam("size", ParamType::TGLsizeiPointer);
    InitParamValue(ParamType::TGLsizeiPointer, size, &sizeParam.value);
    CaptureGetTransformFeedbackVarying_size(context, program, index, bufSize, length, size, type,
                                            name, isCallValid, &sizeParam);
    paramBuffer.addParam(std::move(sizeParam));

    ParamCapture typeParam("type", ParamType::TGLenumPointer);
    InitParamValue(ParamType::TGLenumPointer, type, &typeParam.value);
    CaptureGetTransformFeedbackVarying_type(context, program, index, bufSize, length, size, type,
                                            name, isCallValid, &typeParam);
    paramBuffer.addParam(std::move(typeParam));

    ParamCapture nameParam("name", ParamType::TGLcharPointer);
    InitParamValue(ParamType::TGLcharPointer, name, &nameParam.value);
    CaptureGetTransformFeedbackVarying_name(context, program, index, bufSize, length, size, type,
                                            name, isCallValid, &nameParam);
    paramBuffer.addParam(std::move(nameParam));

    frameCapture->captureCall(context, "glGetTransformFeedbackVarying", std::move(paramBuffer),
                              isCallValid);
}

void CaptureGetUniformBlockIndex(Context *context, GLuint program, const GLchar *uniformBlockName)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidateGetUniformBlockIndex(context, program, uniformBlockName);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("program", ParamType::TGLuint, program);

    ParamCapture uniformBlockNameParam("uniformBlockName", ParamType::TGLcharConstPointer);
    InitParamValue(ParamType::TGLcharConstPointer, uniformBlockName, &uniformBlockNameParam.value);
    CaptureGetUniformBlockIndex_uniformBlockName(context, program, uniformBlockName, isCallValid,
                                                 &uniformBlockNameParam);
    paramBuffer.addParam(std::move(uniformBlockNameParam));

    frameCapture->captureCall(context, "glGetUniformBlockIndex", std::move(paramBuffer),
                              isCallValid);
}

void CaptureGetUniformIndices(Context *context,
                              GLuint program,
                              GLsizei uniformCount,
                              const GLchar *const *uniformNames,
                              GLuint *uniformIndices)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid =
        ValidateGetUniformIndices(context, program, uniformCount, uniformNames, uniformIndices);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("program", ParamType::TGLuint, program);
    paramBuffer.addValueParam("uniformCount", ParamType::TGLsizei, uniformCount);

    ParamCapture uniformNamesParam("uniformNames", ParamType::TGLcharConstPointerPointer);
    InitParamValue(ParamType::TGLcharConstPointerPointer, uniformNames, &uniformNamesParam.value);
    CaptureGetUniformIndices_uniformNames(context, program, uniformCount, uniformNames,
                                          uniformIndices, isCallValid, &uniformNamesParam);
    paramBuffer.addParam(std::move(uniformNamesParam));

    ParamCapture uniformIndicesParam("uniformIndices", ParamType::TGLuintPointer);
    InitParamValue(ParamType::TGLuintPointer, uniformIndices, &uniformIndicesParam.value);
    CaptureGetUniformIndices_uniformIndices(context, program, uniformCount, uniformNames,
                                            uniformIndices, isCallValid, &uniformIndicesParam);
    paramBuffer.addParam(std::move(uniformIndicesParam));

    frameCapture->captureCall(context, "glGetUniformIndices", std::move(paramBuffer), isCallValid);
}

void CaptureGetUniformuiv(Context *context, GLuint program, GLint location, GLuint *params)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidateGetUniformuiv(context, program, location, params);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("program", ParamType::TGLuint, program);
    paramBuffer.addValueParam("location", ParamType::TGLint, location);

    ParamCapture paramsParam("params", ParamType::TGLuintPointer);
    InitParamValue(ParamType::TGLuintPointer, params, &paramsParam.value);
    CaptureGetUniformuiv_params(context, program, location, params, isCallValid, &paramsParam);
    paramBuffer.addParam(std::move(paramsParam));

    frameCapture->captureCall(context, "glGetUniformuiv", std::move(paramBuffer), isCallValid);
}

void CaptureGetVertexAttribIiv(Context *context, GLuint index, GLenum pname, GLint *params)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidateGetVertexAttribIiv(context, index, pname, params);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("index", ParamType::TGLuint, index);
    paramBuffer.addValueParam("pname", ParamType::TGLenum, pname);

    ParamCapture paramsParam("params", ParamType::TGLintPointer);
    InitParamValue(ParamType::TGLintPointer, params, &paramsParam.value);
    CaptureGetVertexAttribIiv_params(context, index, pname, params, isCallValid, &paramsParam);
    paramBuffer.addParam(std::move(paramsParam));

    frameCapture->captureCall(context, "glGetVertexAttribIiv", std::move(paramBuffer), isCallValid);
}

void CaptureGetVertexAttribIuiv(Context *context, GLuint index, GLenum pname, GLuint *params)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidateGetVertexAttribIuiv(context, index, pname, params);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("index", ParamType::TGLuint, index);
    paramBuffer.addValueParam("pname", ParamType::TGLenum, pname);

    ParamCapture paramsParam("params", ParamType::TGLuintPointer);
    InitParamValue(ParamType::TGLuintPointer, params, &paramsParam.value);
    CaptureGetVertexAttribIuiv_params(context, index, pname, params, isCallValid, &paramsParam);
    paramBuffer.addParam(std::move(paramsParam));

    frameCapture->captureCall(context, "glGetVertexAttribIuiv", std::move(paramBuffer),
                              isCallValid);
}

void CaptureInvalidateFramebuffer(Context *context,
                                  GLenum target,
                                  GLsizei numAttachments,
                                  const GLenum *attachments)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidateInvalidateFramebuffer(context, target, numAttachments, attachments);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("target", ParamType::TGLenum, target);
    paramBuffer.addValueParam("numAttachments", ParamType::TGLsizei, numAttachments);

    ParamCapture attachmentsParam("attachments", ParamType::TGLenumConstPointer);
    InitParamValue(ParamType::TGLenumConstPointer, attachments, &attachmentsParam.value);
    CaptureInvalidateFramebuffer_attachments(context, target, numAttachments, attachments,
                                             isCallValid, &attachmentsParam);
    paramBuffer.addParam(std::move(attachmentsParam));

    frameCapture->captureCall(context, "glInvalidateFramebuffer", std::move(paramBuffer),
                              isCallValid);
}

void CaptureInvalidateSubFramebuffer(Context *context,
                                     GLenum target,
                                     GLsizei numAttachments,
                                     const GLenum *attachments,
                                     GLint x,
                                     GLint y,
                                     GLsizei width,
                                     GLsizei height)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidateInvalidateSubFramebuffer(context, target, numAttachments,
                                                        attachments, x, y, width, height);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("target", ParamType::TGLenum, target);
    paramBuffer.addValueParam("numAttachments", ParamType::TGLsizei, numAttachments);

    ParamCapture attachmentsParam("attachments", ParamType::TGLenumConstPointer);
    InitParamValue(ParamType::TGLenumConstPointer, attachments, &attachmentsParam.value);
    CaptureInvalidateSubFramebuffer_attachments(context, target, numAttachments, attachments, x, y,
                                                width, height, isCallValid, &attachmentsParam);
    paramBuffer.addParam(std::move(attachmentsParam));

    paramBuffer.addValueParam("x", ParamType::TGLint, x);
    paramBuffer.addValueParam("y", ParamType::TGLint, y);
    paramBuffer.addValueParam("width", ParamType::TGLsizei, width);
    paramBuffer.addValueParam("height", ParamType::TGLsizei, height);

    frameCapture->captureCall(context, "glInvalidateSubFramebuffer", std::move(paramBuffer),
                              isCallValid);
}

void CaptureIsQuery(Context *context, GLuint id)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidateIsQuery(context, id);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("id", ParamType::TGLuint, id);

    frameCapture->captureCall(context, "glIsQuery", std::move(paramBuffer), isCallValid);
}

void CaptureIsSampler(Context *context, GLuint sampler)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidateIsSampler(context, sampler);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("sampler", ParamType::TGLuint, sampler);

    frameCapture->captureCall(context, "glIsSampler", std::move(paramBuffer), isCallValid);
}

void CaptureIsSync(Context *context, GLsync sync)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidateIsSync(context, sync);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("sync", ParamType::TGLsync, sync);

    frameCapture->captureCall(context, "glIsSync", std::move(paramBuffer), isCallValid);
}

void CaptureIsTransformFeedback(Context *context, GLuint id)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidateIsTransformFeedback(context, id);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("id", ParamType::TGLuint, id);

    frameCapture->captureCall(context, "glIsTransformFeedback", std::move(paramBuffer),
                              isCallValid);
}

void CaptureIsVertexArray(Context *context, GLuint array)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidateIsVertexArray(context, array);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("array", ParamType::TGLuint, array);

    frameCapture->captureCall(context, "glIsVertexArray", std::move(paramBuffer), isCallValid);
}

void CaptureMapBufferRange(Context *context,
                           BufferBinding targetPacked,
                           GLintptr offset,
                           GLsizeiptr length,
                           GLbitfield access)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidateMapBufferRange(context, targetPacked, offset, length, access);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("targetPacked", ParamType::TBufferBinding, targetPacked);
    paramBuffer.addValueParam("offset", ParamType::TGLintptr, offset);
    paramBuffer.addValueParam("length", ParamType::TGLsizeiptr, length);
    paramBuffer.addValueParam("access", ParamType::TGLbitfield, access);

    frameCapture->captureCall(context, "glMapBufferRange", std::move(paramBuffer), isCallValid);
}

void CapturePauseTransformFeedback(Context *context)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidatePauseTransformFeedback(context);
    ParamBuffer paramBuffer;

    frameCapture->captureCall(context, "glPauseTransformFeedback", std::move(paramBuffer),
                              isCallValid);
}

void CaptureProgramBinary(Context *context,
                          GLuint program,
                          GLenum binaryFormat,
                          const void *binary,
                          GLsizei length)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidateProgramBinary(context, program, binaryFormat, binary, length);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("program", ParamType::TGLuint, program);
    paramBuffer.addValueParam("binaryFormat", ParamType::TGLenum, binaryFormat);

    ParamCapture binaryParam("binary", ParamType::TvoidConstPointer);
    InitParamValue(ParamType::TvoidConstPointer, binary, &binaryParam.value);
    CaptureProgramBinary_binary(context, program, binaryFormat, binary, length, isCallValid,
                                &binaryParam);
    paramBuffer.addParam(std::move(binaryParam));

    paramBuffer.addValueParam("length", ParamType::TGLsizei, length);

    frameCapture->captureCall(context, "glProgramBinary", std::move(paramBuffer), isCallValid);
}

void CaptureProgramParameteri(Context *context, GLuint program, GLenum pname, GLint value)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidateProgramParameteri(context, program, pname, value);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("program", ParamType::TGLuint, program);
    paramBuffer.addValueParam("pname", ParamType::TGLenum, pname);
    paramBuffer.addValueParam("value", ParamType::TGLint, value);

    frameCapture->captureCall(context, "glProgramParameteri", std::move(paramBuffer), isCallValid);
}

void CaptureReadBuffer(Context *context, GLenum src)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidateReadBuffer(context, src);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("src", ParamType::TGLenum, src);

    frameCapture->captureCall(context, "glReadBuffer", std::move(paramBuffer), isCallValid);
}

void CaptureRenderbufferStorageMultisample(Context *context,
                                           GLenum target,
                                           GLsizei samples,
                                           GLenum internalformat,
                                           GLsizei width,
                                           GLsizei height)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidateRenderbufferStorageMultisample(context, target, samples,
                                                              internalformat, width, height);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("target", ParamType::TGLenum, target);
    paramBuffer.addValueParam("samples", ParamType::TGLsizei, samples);
    paramBuffer.addValueParam("internalformat", ParamType::TGLenum, internalformat);
    paramBuffer.addValueParam("width", ParamType::TGLsizei, width);
    paramBuffer.addValueParam("height", ParamType::TGLsizei, height);

    frameCapture->captureCall(context, "glRenderbufferStorageMultisample", std::move(paramBuffer),
                              isCallValid);
}

void CaptureResumeTransformFeedback(Context *context)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidateResumeTransformFeedback(context);
    ParamBuffer paramBuffer;

    frameCapture->captureCall(context, "glResumeTransformFeedback", std::move(paramBuffer),
                              isCallValid);
}

void CaptureSamplerParameterf(Context *context, GLuint sampler, GLenum pname, GLfloat param)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidateSamplerParameterf(context, sampler, pname, param);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("sampler", ParamType::TGLuint, sampler);
    paramBuffer.addValueParam("pname", ParamType::TGLenum, pname);
    paramBuffer.addValueParam("param", ParamType::TGLfloat, param);

    frameCapture->captureCall(context, "glSamplerParameterf", std::move(paramBuffer), isCallValid);
}

void CaptureSamplerParameterfv(Context *context, GLuint sampler, GLenum pname, const GLfloat *param)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidateSamplerParameterfv(context, sampler, pname, param);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("sampler", ParamType::TGLuint, sampler);
    paramBuffer.addValueParam("pname", ParamType::TGLenum, pname);

    ParamCapture paramParam("param", ParamType::TGLfloatConstPointer);
    InitParamValue(ParamType::TGLfloatConstPointer, param, &paramParam.value);
    CaptureSamplerParameterfv_param(context, sampler, pname, param, isCallValid, &paramParam);
    paramBuffer.addParam(std::move(paramParam));

    frameCapture->captureCall(context, "glSamplerParameterfv", std::move(paramBuffer), isCallValid);
}

void CaptureSamplerParameteri(Context *context, GLuint sampler, GLenum pname, GLint param)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidateSamplerParameteri(context, sampler, pname, param);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("sampler", ParamType::TGLuint, sampler);
    paramBuffer.addValueParam("pname", ParamType::TGLenum, pname);
    paramBuffer.addValueParam("param", ParamType::TGLint, param);

    frameCapture->captureCall(context, "glSamplerParameteri", std::move(paramBuffer), isCallValid);
}

void CaptureSamplerParameteriv(Context *context, GLuint sampler, GLenum pname, const GLint *param)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidateSamplerParameteriv(context, sampler, pname, param);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("sampler", ParamType::TGLuint, sampler);
    paramBuffer.addValueParam("pname", ParamType::TGLenum, pname);

    ParamCapture paramParam("param", ParamType::TGLintConstPointer);
    InitParamValue(ParamType::TGLintConstPointer, param, &paramParam.value);
    CaptureSamplerParameteriv_param(context, sampler, pname, param, isCallValid, &paramParam);
    paramBuffer.addParam(std::move(paramParam));

    frameCapture->captureCall(context, "glSamplerParameteriv", std::move(paramBuffer), isCallValid);
}

void CaptureTexImage3D(Context *context,
                       TextureTarget targetPacked,
                       GLint level,
                       GLint internalformat,
                       GLsizei width,
                       GLsizei height,
                       GLsizei depth,
                       GLint border,
                       GLenum format,
                       GLenum type,
                       const void *pixels)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidateTexImage3D(context, targetPacked, level, internalformat, width,
                                          height, depth, border, format, type, pixels);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("targetPacked", ParamType::TTextureTarget, targetPacked);
    paramBuffer.addValueParam("level", ParamType::TGLint, level);
    paramBuffer.addValueParam("internalformat", ParamType::TGLint, internalformat);
    paramBuffer.addValueParam("width", ParamType::TGLsizei, width);
    paramBuffer.addValueParam("height", ParamType::TGLsizei, height);
    paramBuffer.addValueParam("depth", ParamType::TGLsizei, depth);
    paramBuffer.addValueParam("border", ParamType::TGLint, border);
    paramBuffer.addValueParam("format", ParamType::TGLenum, format);
    paramBuffer.addValueParam("type", ParamType::TGLenum, type);

    ParamCapture pixelsParam("pixels", ParamType::TvoidConstPointer);
    InitParamValue(ParamType::TvoidConstPointer, pixels, &pixelsParam.value);
    CaptureTexImage3D_pixels(context, targetPacked, level, internalformat, width, height, depth,
                             border, format, type, pixels, isCallValid, &pixelsParam);
    paramBuffer.addParam(std::move(pixelsParam));

    frameCapture->captureCall(context, "glTexImage3D", std::move(paramBuffer), isCallValid);
}

void CaptureTexStorage2D(Context *context,
                         TextureType targetPacked,
                         GLsizei levels,
                         GLenum internalformat,
                         GLsizei width,
                         GLsizei height)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid =
        ValidateTexStorage2D(context, targetPacked, levels, internalformat, width, height);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("targetPacked", ParamType::TTextureType, targetPacked);
    paramBuffer.addValueParam("levels", ParamType::TGLsizei, levels);
    paramBuffer.addValueParam("internalformat", ParamType::TGLenum, internalformat);
    paramBuffer.addValueParam("width", ParamType::TGLsizei, width);
    paramBuffer.addValueParam("height", ParamType::TGLsizei, height);

    frameCapture->captureCall(context, "glTexStorage2D", std::move(paramBuffer), isCallValid);
}

void CaptureTexStorage3D(Context *context,
                         TextureType targetPacked,
                         GLsizei levels,
                         GLenum internalformat,
                         GLsizei width,
                         GLsizei height,
                         GLsizei depth)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid =
        ValidateTexStorage3D(context, targetPacked, levels, internalformat, width, height, depth);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("targetPacked", ParamType::TTextureType, targetPacked);
    paramBuffer.addValueParam("levels", ParamType::TGLsizei, levels);
    paramBuffer.addValueParam("internalformat", ParamType::TGLenum, internalformat);
    paramBuffer.addValueParam("width", ParamType::TGLsizei, width);
    paramBuffer.addValueParam("height", ParamType::TGLsizei, height);
    paramBuffer.addValueParam("depth", ParamType::TGLsizei, depth);

    frameCapture->captureCall(context, "glTexStorage3D", std::move(paramBuffer), isCallValid);
}

void CaptureTexSubImage3D(Context *context,
                          TextureTarget targetPacked,
                          GLint level,
                          GLint xoffset,
                          GLint yoffset,
                          GLint zoffset,
                          GLsizei width,
                          GLsizei height,
                          GLsizei depth,
                          GLenum format,
                          GLenum type,
                          const void *pixels)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidateTexSubImage3D(context, targetPacked, level, xoffset, yoffset,
                                             zoffset, width, height, depth, format, type, pixels);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("targetPacked", ParamType::TTextureTarget, targetPacked);
    paramBuffer.addValueParam("level", ParamType::TGLint, level);
    paramBuffer.addValueParam("xoffset", ParamType::TGLint, xoffset);
    paramBuffer.addValueParam("yoffset", ParamType::TGLint, yoffset);
    paramBuffer.addValueParam("zoffset", ParamType::TGLint, zoffset);
    paramBuffer.addValueParam("width", ParamType::TGLsizei, width);
    paramBuffer.addValueParam("height", ParamType::TGLsizei, height);
    paramBuffer.addValueParam("depth", ParamType::TGLsizei, depth);
    paramBuffer.addValueParam("format", ParamType::TGLenum, format);
    paramBuffer.addValueParam("type", ParamType::TGLenum, type);

    ParamCapture pixelsParam("pixels", ParamType::TvoidConstPointer);
    InitParamValue(ParamType::TvoidConstPointer, pixels, &pixelsParam.value);
    CaptureTexSubImage3D_pixels(context, targetPacked, level, xoffset, yoffset, zoffset, width,
                                height, depth, format, type, pixels, isCallValid, &pixelsParam);
    paramBuffer.addParam(std::move(pixelsParam));

    frameCapture->captureCall(context, "glTexSubImage3D", std::move(paramBuffer), isCallValid);
}

void CaptureTransformFeedbackVaryings(Context *context,
                                      GLuint program,
                                      GLsizei count,
                                      const GLchar *const *varyings,
                                      GLenum bufferMode)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid =
        ValidateTransformFeedbackVaryings(context, program, count, varyings, bufferMode);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("program", ParamType::TGLuint, program);
    paramBuffer.addValueParam("count", ParamType::TGLsizei, count);

    ParamCapture varyingsParam("varyings", ParamType::TGLcharConstPointerPointer);
    InitParamValue(ParamType::TGLcharConstPointerPointer, varyings, &varyingsParam.value);
    CaptureTransformFeedbackVaryings_varyings(context, program, count, varyings, bufferMode,
                                              isCallValid, &varyingsParam);
    paramBuffer.addParam(std::move(varyingsParam));

    paramBuffer.addValueParam("bufferMode", ParamType::TGLenum, bufferMode);

    frameCapture->captureCall(context, "glTransformFeedbackVaryings", std::move(paramBuffer),
                              isCallValid);
}

void CaptureUniform1ui(Context *context, GLint location, GLuint v0)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidateUniform1ui(context, location, v0);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("location", ParamType::TGLint, location);
    paramBuffer.addValueParam("v0", ParamType::TGLuint, v0);

    frameCapture->captureCall(context, "glUniform1ui", std::move(paramBuffer), isCallValid);
}

void CaptureUniform1uiv(Context *context, GLint location, GLsizei count, const GLuint *value)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidateUniform1uiv(context, location, count, value);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("location", ParamType::TGLint, location);
    paramBuffer.addValueParam("count", ParamType::TGLsizei, count);

    ParamCapture valueParam("value", ParamType::TGLuintConstPointer);
    InitParamValue(ParamType::TGLuintConstPointer, value, &valueParam.value);
    CaptureUniform1uiv_value(context, location, count, value, isCallValid, &valueParam);
    paramBuffer.addParam(std::move(valueParam));

    frameCapture->captureCall(context, "glUniform1uiv", std::move(paramBuffer), isCallValid);
}

void CaptureUniform2ui(Context *context, GLint location, GLuint v0, GLuint v1)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidateUniform2ui(context, location, v0, v1);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("location", ParamType::TGLint, location);
    paramBuffer.addValueParam("v0", ParamType::TGLuint, v0);
    paramBuffer.addValueParam("v1", ParamType::TGLuint, v1);

    frameCapture->captureCall(context, "glUniform2ui", std::move(paramBuffer), isCallValid);
}

void CaptureUniform2uiv(Context *context, GLint location, GLsizei count, const GLuint *value)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidateUniform2uiv(context, location, count, value);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("location", ParamType::TGLint, location);
    paramBuffer.addValueParam("count", ParamType::TGLsizei, count);

    ParamCapture valueParam("value", ParamType::TGLuintConstPointer);
    InitParamValue(ParamType::TGLuintConstPointer, value, &valueParam.value);
    CaptureUniform2uiv_value(context, location, count, value, isCallValid, &valueParam);
    paramBuffer.addParam(std::move(valueParam));

    frameCapture->captureCall(context, "glUniform2uiv", std::move(paramBuffer), isCallValid);
}

void CaptureUniform3ui(Context *context, GLint location, GLuint v0, GLuint v1, GLuint v2)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidateUniform3ui(context, location, v0, v1, v2);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("location", ParamType::TGLint, location);
    paramBuffer.addValueParam("v0", ParamType::TGLuint, v0);
    paramBuffer.addValueParam("v1", ParamType::TGLuint, v1);
    paramBuffer.addValueParam("v2", ParamType::TGLuint, v2);

    frameCapture->captureCall(context, "glUniform3ui", std::move(paramBuffer), isCallValid);
}

void CaptureUniform3uiv(Context *context, GLint location, GLsizei count, const GLuint *value)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidateUniform3uiv(context, location, count, value);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("location", ParamType::TGLint, location);
    paramBuffer.addValueParam("count", ParamType::TGLsizei, count);

    ParamCapture valueParam("value", ParamType::TGLuintConstPointer);
    InitParamValue(ParamType::TGLuintConstPointer, value, &valueParam.value);
    CaptureUniform3uiv_value(context, location, count, value, isCallValid, &valueParam);
    paramBuffer.addParam(std::move(valueParam));

    frameCapture->captureCall(context, "glUniform3uiv", std::move(paramBuffer), isCallValid);
}

void CaptureUniform4ui(Context *context, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidateUniform4ui(context, location, v0, v1, v2, v3);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("location", ParamType::TGLint, location);
    paramBuffer.addValueParam("v0", ParamType::TGLuint, v0);
    paramBuffer.addValueParam("v1", ParamType::TGLuint, v1);
    paramBuffer.addValueParam("v2", ParamType::TGLuint, v2);
    paramBuffer.addValueParam("v3", ParamType::TGLuint, v3);

    frameCapture->captureCall(context, "glUniform4ui", std::move(paramBuffer), isCallValid);
}

void CaptureUniform4uiv(Context *context, GLint location, GLsizei count, const GLuint *value)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidateUniform4uiv(context, location, count, value);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("location", ParamType::TGLint, location);
    paramBuffer.addValueParam("count", ParamType::TGLsizei, count);

    ParamCapture valueParam("value", ParamType::TGLuintConstPointer);
    InitParamValue(ParamType::TGLuintConstPointer, value, &valueParam.value);
    CaptureUniform4uiv_value(context, location, count, value, isCallValid, &valueParam);
    paramBuffer.addParam(std::move(valueParam));

    frameCapture->captureCall(context, "glUniform4uiv", std::move(paramBuffer), isCallValid);
}

void CaptureUniformBlockBinding(Context *context,
                                GLuint program,
                                GLuint uniformBlockIndex,
                                GLuint uniformBlockBinding)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid =
        ValidateUniformBlockBinding(context, program, uniformBlockIndex, uniformBlockBinding);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("program", ParamType::TGLuint, program);
    paramBuffer.addValueParam("uniformBlockIndex", ParamType::TGLuint, uniformBlockIndex);
    paramBuffer.addValueParam("uniformBlockBinding", ParamType::TGLuint, uniformBlockBinding);

    frameCapture->captureCall(context, "glUniformBlockBinding", std::move(paramBuffer),
                              isCallValid);
}

void CaptureUniformMatrix2x3fv(Context *context,
                               GLint location,
                               GLsizei count,
                               GLboolean transpose,
                               const GLfloat *value)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidateUniformMatrix2x3fv(context, location, count, transpose, value);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("location", ParamType::TGLint, location);
    paramBuffer.addValueParam("count", ParamType::TGLsizei, count);
    paramBuffer.addValueParam("transpose", ParamType::TGLboolean, transpose);

    ParamCapture valueParam("value", ParamType::TGLfloatConstPointer);
    InitParamValue(ParamType::TGLfloatConstPointer, value, &valueParam.value);
    CaptureUniformMatrix2x3fv_value(context, location, count, transpose, value, isCallValid,
                                    &valueParam);
    paramBuffer.addParam(std::move(valueParam));

    frameCapture->captureCall(context, "glUniformMatrix2x3fv", std::move(paramBuffer), isCallValid);
}

void CaptureUniformMatrix2x4fv(Context *context,
                               GLint location,
                               GLsizei count,
                               GLboolean transpose,
                               const GLfloat *value)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidateUniformMatrix2x4fv(context, location, count, transpose, value);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("location", ParamType::TGLint, location);
    paramBuffer.addValueParam("count", ParamType::TGLsizei, count);
    paramBuffer.addValueParam("transpose", ParamType::TGLboolean, transpose);

    ParamCapture valueParam("value", ParamType::TGLfloatConstPointer);
    InitParamValue(ParamType::TGLfloatConstPointer, value, &valueParam.value);
    CaptureUniformMatrix2x4fv_value(context, location, count, transpose, value, isCallValid,
                                    &valueParam);
    paramBuffer.addParam(std::move(valueParam));

    frameCapture->captureCall(context, "glUniformMatrix2x4fv", std::move(paramBuffer), isCallValid);
}

void CaptureUniformMatrix3x2fv(Context *context,
                               GLint location,
                               GLsizei count,
                               GLboolean transpose,
                               const GLfloat *value)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidateUniformMatrix3x2fv(context, location, count, transpose, value);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("location", ParamType::TGLint, location);
    paramBuffer.addValueParam("count", ParamType::TGLsizei, count);
    paramBuffer.addValueParam("transpose", ParamType::TGLboolean, transpose);

    ParamCapture valueParam("value", ParamType::TGLfloatConstPointer);
    InitParamValue(ParamType::TGLfloatConstPointer, value, &valueParam.value);
    CaptureUniformMatrix3x2fv_value(context, location, count, transpose, value, isCallValid,
                                    &valueParam);
    paramBuffer.addParam(std::move(valueParam));

    frameCapture->captureCall(context, "glUniformMatrix3x2fv", std::move(paramBuffer), isCallValid);
}

void CaptureUniformMatrix3x4fv(Context *context,
                               GLint location,
                               GLsizei count,
                               GLboolean transpose,
                               const GLfloat *value)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidateUniformMatrix3x4fv(context, location, count, transpose, value);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("location", ParamType::TGLint, location);
    paramBuffer.addValueParam("count", ParamType::TGLsizei, count);
    paramBuffer.addValueParam("transpose", ParamType::TGLboolean, transpose);

    ParamCapture valueParam("value", ParamType::TGLfloatConstPointer);
    InitParamValue(ParamType::TGLfloatConstPointer, value, &valueParam.value);
    CaptureUniformMatrix3x4fv_value(context, location, count, transpose, value, isCallValid,
                                    &valueParam);
    paramBuffer.addParam(std::move(valueParam));

    frameCapture->captureCall(context, "glUniformMatrix3x4fv", std::move(paramBuffer), isCallValid);
}

void CaptureUniformMatrix4x2fv(Context *context,
                               GLint location,
                               GLsizei count,
                               GLboolean transpose,
                               const GLfloat *value)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidateUniformMatrix4x2fv(context, location, count, transpose, value);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("location", ParamType::TGLint, location);
    paramBuffer.addValueParam("count", ParamType::TGLsizei, count);
    paramBuffer.addValueParam("transpose", ParamType::TGLboolean, transpose);

    ParamCapture valueParam("value", ParamType::TGLfloatConstPointer);
    InitParamValue(ParamType::TGLfloatConstPointer, value, &valueParam.value);
    CaptureUniformMatrix4x2fv_value(context, location, count, transpose, value, isCallValid,
                                    &valueParam);
    paramBuffer.addParam(std::move(valueParam));

    frameCapture->captureCall(context, "glUniformMatrix4x2fv", std::move(paramBuffer), isCallValid);
}

void CaptureUniformMatrix4x3fv(Context *context,
                               GLint location,
                               GLsizei count,
                               GLboolean transpose,
                               const GLfloat *value)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidateUniformMatrix4x3fv(context, location, count, transpose, value);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("location", ParamType::TGLint, location);
    paramBuffer.addValueParam("count", ParamType::TGLsizei, count);
    paramBuffer.addValueParam("transpose", ParamType::TGLboolean, transpose);

    ParamCapture valueParam("value", ParamType::TGLfloatConstPointer);
    InitParamValue(ParamType::TGLfloatConstPointer, value, &valueParam.value);
    CaptureUniformMatrix4x3fv_value(context, location, count, transpose, value, isCallValid,
                                    &valueParam);
    paramBuffer.addParam(std::move(valueParam));

    frameCapture->captureCall(context, "glUniformMatrix4x3fv", std::move(paramBuffer), isCallValid);
}

void CaptureUnmapBuffer(Context *context, BufferBinding targetPacked)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidateUnmapBuffer(context, targetPacked);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("targetPacked", ParamType::TBufferBinding, targetPacked);

    frameCapture->captureCall(context, "glUnmapBuffer", std::move(paramBuffer), isCallValid);
}

void CaptureVertexAttribDivisor(Context *context, GLuint index, GLuint divisor)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidateVertexAttribDivisor(context, index, divisor);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("index", ParamType::TGLuint, index);
    paramBuffer.addValueParam("divisor", ParamType::TGLuint, divisor);

    frameCapture->captureCall(context, "glVertexAttribDivisor", std::move(paramBuffer),
                              isCallValid);
}

void CaptureVertexAttribI4i(Context *context, GLuint index, GLint x, GLint y, GLint z, GLint w)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidateVertexAttribI4i(context, index, x, y, z, w);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("index", ParamType::TGLuint, index);
    paramBuffer.addValueParam("x", ParamType::TGLint, x);
    paramBuffer.addValueParam("y", ParamType::TGLint, y);
    paramBuffer.addValueParam("z", ParamType::TGLint, z);
    paramBuffer.addValueParam("w", ParamType::TGLint, w);

    frameCapture->captureCall(context, "glVertexAttribI4i", std::move(paramBuffer), isCallValid);
}

void CaptureVertexAttribI4iv(Context *context, GLuint index, const GLint *v)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidateVertexAttribI4iv(context, index, v);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("index", ParamType::TGLuint, index);

    ParamCapture vParam("v", ParamType::TGLintConstPointer);
    InitParamValue(ParamType::TGLintConstPointer, v, &vParam.value);
    CaptureVertexAttribI4iv_v(context, index, v, isCallValid, &vParam);
    paramBuffer.addParam(std::move(vParam));

    frameCapture->captureCall(context, "glVertexAttribI4iv", std::move(paramBuffer), isCallValid);
}

void CaptureVertexAttribI4ui(Context *context, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidateVertexAttribI4ui(context, index, x, y, z, w);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("index", ParamType::TGLuint, index);
    paramBuffer.addValueParam("x", ParamType::TGLuint, x);
    paramBuffer.addValueParam("y", ParamType::TGLuint, y);
    paramBuffer.addValueParam("z", ParamType::TGLuint, z);
    paramBuffer.addValueParam("w", ParamType::TGLuint, w);

    frameCapture->captureCall(context, "glVertexAttribI4ui", std::move(paramBuffer), isCallValid);
}

void CaptureVertexAttribI4uiv(Context *context, GLuint index, const GLuint *v)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidateVertexAttribI4uiv(context, index, v);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("index", ParamType::TGLuint, index);

    ParamCapture vParam("v", ParamType::TGLuintConstPointer);
    InitParamValue(ParamType::TGLuintConstPointer, v, &vParam.value);
    CaptureVertexAttribI4uiv_v(context, index, v, isCallValid, &vParam);
    paramBuffer.addParam(std::move(vParam));

    frameCapture->captureCall(context, "glVertexAttribI4uiv", std::move(paramBuffer), isCallValid);
}

void CaptureVertexAttribIPointer(Context *context,
                                 GLuint index,
                                 GLint size,
                                 VertexAttribType typePacked,
                                 GLsizei stride,
                                 const void *pointer)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid =
        ValidateVertexAttribIPointer(context, index, size, typePacked, stride, pointer);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("index", ParamType::TGLuint, index);
    paramBuffer.addValueParam("size", ParamType::TGLint, size);
    paramBuffer.addValueParam("typePacked", ParamType::TVertexAttribType, typePacked);
    paramBuffer.addValueParam("stride", ParamType::TGLsizei, stride);

    ParamCapture pointerParam("pointer", ParamType::TvoidConstPointer);
    InitParamValue(ParamType::TvoidConstPointer, pointer, &pointerParam.value);
    CaptureVertexAttribIPointer_pointer(context, index, size, typePacked, stride, pointer,
                                        isCallValid, &pointerParam);
    paramBuffer.addParam(std::move(pointerParam));

    frameCapture->captureCall(context, "glVertexAttribIPointer", std::move(paramBuffer),
                              isCallValid);
}

void CaptureWaitSync(Context *context, GLsync sync, GLbitfield flags, GLuint64 timeout)
{
    FrameCapture *frameCapture = context->getFrameCapture();
    if (!frameCapture->enabled())
        return;

    bool isCallValid = ValidateWaitSync(context, sync, flags, timeout);
    ParamBuffer paramBuffer;
    paramBuffer.addValueParam("sync", ParamType::TGLsync, sync);
    paramBuffer.addValueParam("flags", ParamType::TGLbitfield, flags);
    paramBuffer.addValueParam("timeout", ParamType::TGLuint64, timeout);

    frameCapture->captureCall(context, "glWaitSync", std::move(paramBuffer), isCallValid);
}

}  // namespace gl
