• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // GENERATED FILE - DO NOT EDIT.
2 // Generated by generate_entry_points.py using data from gl.xml and gl_angle_ext.xml.
3 //
4 // Copyright 2020 The ANGLE Project Authors. All rights reserved.
5 // Use of this source code is governed by a BSD-style license that can be
6 // found in the LICENSE file.
7 //
8 // capture_gles_2_0_autogen.cpp:
9 //   Capture functions for the OpenGL ES 2.0 entry points.
10 
11 #include "libANGLE/capture_gles_2_0_autogen.h"
12 
13 #include "libANGLE/Context.h"
14 #include "libANGLE/FrameCapture.h"
15 #include "libANGLE/gl_enum_utils.h"
16 #include "libANGLE/validationES2.h"
17 
18 using namespace angle;
19 
20 namespace gl
21 {
22 
CaptureActiveTexture(const State & glState,bool isCallValid,GLenum texture)23 CallCapture CaptureActiveTexture(const State &glState, bool isCallValid, GLenum texture)
24 {
25     ParamBuffer paramBuffer;
26 
27     paramBuffer.addEnumParam("texture", GLenumGroup::TextureUnit, ParamType::TGLenum, texture);
28 
29     return CallCapture(gl::EntryPoint::ActiveTexture, std::move(paramBuffer));
30 }
31 
CaptureAttachShader(const State & glState,bool isCallValid,ShaderProgramID programPacked,ShaderProgramID shaderPacked)32 CallCapture CaptureAttachShader(const State &glState,
33                                 bool isCallValid,
34                                 ShaderProgramID programPacked,
35                                 ShaderProgramID shaderPacked)
36 {
37     ParamBuffer paramBuffer;
38 
39     paramBuffer.addValueParam("programPacked", ParamType::TShaderProgramID, programPacked);
40     paramBuffer.addValueParam("shaderPacked", ParamType::TShaderProgramID, shaderPacked);
41 
42     return CallCapture(gl::EntryPoint::AttachShader, std::move(paramBuffer));
43 }
44 
CaptureBindAttribLocation(const State & glState,bool isCallValid,ShaderProgramID programPacked,GLuint index,const GLchar * name)45 CallCapture CaptureBindAttribLocation(const State &glState,
46                                       bool isCallValid,
47                                       ShaderProgramID programPacked,
48                                       GLuint index,
49                                       const GLchar *name)
50 {
51     ParamBuffer paramBuffer;
52 
53     paramBuffer.addValueParam("programPacked", ParamType::TShaderProgramID, programPacked);
54     paramBuffer.addValueParam("index", ParamType::TGLuint, index);
55 
56     ParamCapture nameParam("name", ParamType::TGLcharConstPointer);
57     InitParamValue(ParamType::TGLcharConstPointer, name, &nameParam.value);
58     CaptureBindAttribLocation_name(glState, isCallValid, programPacked, index, name, &nameParam);
59     paramBuffer.addParam(std::move(nameParam));
60 
61     return CallCapture(gl::EntryPoint::BindAttribLocation, std::move(paramBuffer));
62 }
63 
CaptureBindBuffer(const State & glState,bool isCallValid,BufferBinding targetPacked,BufferID bufferPacked)64 CallCapture CaptureBindBuffer(const State &glState,
65                               bool isCallValid,
66                               BufferBinding targetPacked,
67                               BufferID bufferPacked)
68 {
69     ParamBuffer paramBuffer;
70 
71     paramBuffer.addValueParam("targetPacked", ParamType::TBufferBinding, targetPacked);
72     paramBuffer.addValueParam("bufferPacked", ParamType::TBufferID, bufferPacked);
73 
74     return CallCapture(gl::EntryPoint::BindBuffer, std::move(paramBuffer));
75 }
76 
CaptureBindFramebuffer(const State & glState,bool isCallValid,GLenum target,FramebufferID framebufferPacked)77 CallCapture CaptureBindFramebuffer(const State &glState,
78                                    bool isCallValid,
79                                    GLenum target,
80                                    FramebufferID framebufferPacked)
81 {
82     ParamBuffer paramBuffer;
83 
84     paramBuffer.addEnumParam("target", GLenumGroup::FramebufferTarget, ParamType::TGLenum, target);
85     paramBuffer.addValueParam("framebufferPacked", ParamType::TFramebufferID, framebufferPacked);
86 
87     return CallCapture(gl::EntryPoint::BindFramebuffer, std::move(paramBuffer));
88 }
89 
CaptureBindRenderbuffer(const State & glState,bool isCallValid,GLenum target,RenderbufferID renderbufferPacked)90 CallCapture CaptureBindRenderbuffer(const State &glState,
91                                     bool isCallValid,
92                                     GLenum target,
93                                     RenderbufferID renderbufferPacked)
94 {
95     ParamBuffer paramBuffer;
96 
97     paramBuffer.addEnumParam("target", GLenumGroup::RenderbufferTarget, ParamType::TGLenum, target);
98     paramBuffer.addValueParam("renderbufferPacked", ParamType::TRenderbufferID, renderbufferPacked);
99 
100     return CallCapture(gl::EntryPoint::BindRenderbuffer, std::move(paramBuffer));
101 }
102 
CaptureBindTexture(const State & glState,bool isCallValid,TextureType targetPacked,TextureID texturePacked)103 CallCapture CaptureBindTexture(const State &glState,
104                                bool isCallValid,
105                                TextureType targetPacked,
106                                TextureID texturePacked)
107 {
108     ParamBuffer paramBuffer;
109 
110     paramBuffer.addValueParam("targetPacked", ParamType::TTextureType, targetPacked);
111     paramBuffer.addValueParam("texturePacked", ParamType::TTextureID, texturePacked);
112 
113     return CallCapture(gl::EntryPoint::BindTexture, std::move(paramBuffer));
114 }
115 
CaptureBlendColor(const State & glState,bool isCallValid,GLfloat red,GLfloat green,GLfloat blue,GLfloat alpha)116 CallCapture CaptureBlendColor(const State &glState,
117                               bool isCallValid,
118                               GLfloat red,
119                               GLfloat green,
120                               GLfloat blue,
121                               GLfloat alpha)
122 {
123     ParamBuffer paramBuffer;
124 
125     paramBuffer.addValueParam("red", ParamType::TGLfloat, red);
126     paramBuffer.addValueParam("green", ParamType::TGLfloat, green);
127     paramBuffer.addValueParam("blue", ParamType::TGLfloat, blue);
128     paramBuffer.addValueParam("alpha", ParamType::TGLfloat, alpha);
129 
130     return CallCapture(gl::EntryPoint::BlendColor, std::move(paramBuffer));
131 }
132 
CaptureBlendEquation(const State & glState,bool isCallValid,GLenum mode)133 CallCapture CaptureBlendEquation(const State &glState, bool isCallValid, GLenum mode)
134 {
135     ParamBuffer paramBuffer;
136 
137     paramBuffer.addEnumParam("mode", GLenumGroup::BlendEquationModeEXT, ParamType::TGLenum, mode);
138 
139     return CallCapture(gl::EntryPoint::BlendEquation, std::move(paramBuffer));
140 }
141 
CaptureBlendEquationSeparate(const State & glState,bool isCallValid,GLenum modeRGB,GLenum modeAlpha)142 CallCapture CaptureBlendEquationSeparate(const State &glState,
143                                          bool isCallValid,
144                                          GLenum modeRGB,
145                                          GLenum modeAlpha)
146 {
147     ParamBuffer paramBuffer;
148 
149     paramBuffer.addEnumParam("modeRGB", GLenumGroup::BlendEquationModeEXT, ParamType::TGLenum,
150                              modeRGB);
151     paramBuffer.addEnumParam("modeAlpha", GLenumGroup::BlendEquationModeEXT, ParamType::TGLenum,
152                              modeAlpha);
153 
154     return CallCapture(gl::EntryPoint::BlendEquationSeparate, std::move(paramBuffer));
155 }
156 
CaptureBlendFunc(const State & glState,bool isCallValid,GLenum sfactor,GLenum dfactor)157 CallCapture CaptureBlendFunc(const State &glState, bool isCallValid, GLenum sfactor, GLenum dfactor)
158 {
159     ParamBuffer paramBuffer;
160 
161     paramBuffer.addEnumParam("sfactor", GLenumGroup::BlendingFactor, ParamType::TGLenum, sfactor);
162     paramBuffer.addEnumParam("dfactor", GLenumGroup::BlendingFactor, ParamType::TGLenum, dfactor);
163 
164     return CallCapture(gl::EntryPoint::BlendFunc, std::move(paramBuffer));
165 }
166 
CaptureBlendFuncSeparate(const State & glState,bool isCallValid,GLenum sfactorRGB,GLenum dfactorRGB,GLenum sfactorAlpha,GLenum dfactorAlpha)167 CallCapture CaptureBlendFuncSeparate(const State &glState,
168                                      bool isCallValid,
169                                      GLenum sfactorRGB,
170                                      GLenum dfactorRGB,
171                                      GLenum sfactorAlpha,
172                                      GLenum dfactorAlpha)
173 {
174     ParamBuffer paramBuffer;
175 
176     paramBuffer.addEnumParam("sfactorRGB", GLenumGroup::BlendingFactor, ParamType::TGLenum,
177                              sfactorRGB);
178     paramBuffer.addEnumParam("dfactorRGB", GLenumGroup::BlendingFactor, ParamType::TGLenum,
179                              dfactorRGB);
180     paramBuffer.addEnumParam("sfactorAlpha", GLenumGroup::BlendingFactor, ParamType::TGLenum,
181                              sfactorAlpha);
182     paramBuffer.addEnumParam("dfactorAlpha", GLenumGroup::BlendingFactor, ParamType::TGLenum,
183                              dfactorAlpha);
184 
185     return CallCapture(gl::EntryPoint::BlendFuncSeparate, std::move(paramBuffer));
186 }
187 
CaptureBufferData(const State & glState,bool isCallValid,BufferBinding targetPacked,GLsizeiptr size,const void * data,BufferUsage usagePacked)188 CallCapture CaptureBufferData(const State &glState,
189                               bool isCallValid,
190                               BufferBinding targetPacked,
191                               GLsizeiptr size,
192                               const void *data,
193                               BufferUsage usagePacked)
194 {
195     ParamBuffer paramBuffer;
196 
197     paramBuffer.addValueParam("targetPacked", ParamType::TBufferBinding, targetPacked);
198     paramBuffer.addValueParam("size", ParamType::TGLsizeiptr, size);
199 
200     ParamCapture dataParam("data", ParamType::TvoidConstPointer);
201     InitParamValue(ParamType::TvoidConstPointer, data, &dataParam.value);
202     CaptureBufferData_data(glState, isCallValid, targetPacked, size, data, usagePacked, &dataParam);
203     paramBuffer.addParam(std::move(dataParam));
204 
205     paramBuffer.addValueParam("usagePacked", ParamType::TBufferUsage, usagePacked);
206 
207     return CallCapture(gl::EntryPoint::BufferData, std::move(paramBuffer));
208 }
209 
CaptureBufferSubData(const State & glState,bool isCallValid,BufferBinding targetPacked,GLintptr offset,GLsizeiptr size,const void * data)210 CallCapture CaptureBufferSubData(const State &glState,
211                                  bool isCallValid,
212                                  BufferBinding targetPacked,
213                                  GLintptr offset,
214                                  GLsizeiptr size,
215                                  const void *data)
216 {
217     ParamBuffer paramBuffer;
218 
219     paramBuffer.addValueParam("targetPacked", ParamType::TBufferBinding, targetPacked);
220     paramBuffer.addValueParam("offset", ParamType::TGLintptr, offset);
221     paramBuffer.addValueParam("size", ParamType::TGLsizeiptr, size);
222 
223     ParamCapture dataParam("data", ParamType::TvoidConstPointer);
224     InitParamValue(ParamType::TvoidConstPointer, data, &dataParam.value);
225     CaptureBufferSubData_data(glState, isCallValid, targetPacked, offset, size, data, &dataParam);
226     paramBuffer.addParam(std::move(dataParam));
227 
228     return CallCapture(gl::EntryPoint::BufferSubData, std::move(paramBuffer));
229 }
230 
CaptureCheckFramebufferStatus(const State & glState,bool isCallValid,GLenum target,GLenum returnValue)231 CallCapture CaptureCheckFramebufferStatus(const State &glState,
232                                           bool isCallValid,
233                                           GLenum target,
234                                           GLenum returnValue)
235 {
236     ParamBuffer paramBuffer;
237 
238     paramBuffer.addEnumParam("target", GLenumGroup::FramebufferTarget, ParamType::TGLenum, target);
239 
240     ParamCapture returnValueCapture("returnValue", ParamType::TGLenum);
241     InitParamValue(ParamType::TGLenum, returnValue, &returnValueCapture.value);
242     paramBuffer.addReturnValue(std::move(returnValueCapture));
243 
244     return CallCapture(gl::EntryPoint::CheckFramebufferStatus, std::move(paramBuffer));
245 }
246 
CaptureClear(const State & glState,bool isCallValid,GLbitfield mask)247 CallCapture CaptureClear(const State &glState, bool isCallValid, GLbitfield mask)
248 {
249     ParamBuffer paramBuffer;
250 
251     paramBuffer.addEnumParam("mask", GLenumGroup::ClearBufferMask, ParamType::TGLbitfield, mask);
252 
253     return CallCapture(gl::EntryPoint::Clear, std::move(paramBuffer));
254 }
255 
CaptureClearColor(const State & glState,bool isCallValid,GLfloat red,GLfloat green,GLfloat blue,GLfloat alpha)256 CallCapture CaptureClearColor(const State &glState,
257                               bool isCallValid,
258                               GLfloat red,
259                               GLfloat green,
260                               GLfloat blue,
261                               GLfloat alpha)
262 {
263     ParamBuffer paramBuffer;
264 
265     paramBuffer.addValueParam("red", ParamType::TGLfloat, red);
266     paramBuffer.addValueParam("green", ParamType::TGLfloat, green);
267     paramBuffer.addValueParam("blue", ParamType::TGLfloat, blue);
268     paramBuffer.addValueParam("alpha", ParamType::TGLfloat, alpha);
269 
270     return CallCapture(gl::EntryPoint::ClearColor, std::move(paramBuffer));
271 }
272 
CaptureClearDepthf(const State & glState,bool isCallValid,GLfloat d)273 CallCapture CaptureClearDepthf(const State &glState, bool isCallValid, GLfloat d)
274 {
275     ParamBuffer paramBuffer;
276 
277     paramBuffer.addValueParam("d", ParamType::TGLfloat, d);
278 
279     return CallCapture(gl::EntryPoint::ClearDepthf, std::move(paramBuffer));
280 }
281 
CaptureClearStencil(const State & glState,bool isCallValid,GLint s)282 CallCapture CaptureClearStencil(const State &glState, bool isCallValid, GLint s)
283 {
284     ParamBuffer paramBuffer;
285 
286     paramBuffer.addValueParam("s", ParamType::TGLint, s);
287 
288     return CallCapture(gl::EntryPoint::ClearStencil, std::move(paramBuffer));
289 }
290 
CaptureColorMask(const State & glState,bool isCallValid,GLboolean red,GLboolean green,GLboolean blue,GLboolean alpha)291 CallCapture CaptureColorMask(const State &glState,
292                              bool isCallValid,
293                              GLboolean red,
294                              GLboolean green,
295                              GLboolean blue,
296                              GLboolean alpha)
297 {
298     ParamBuffer paramBuffer;
299 
300     paramBuffer.addValueParam("red", ParamType::TGLboolean, red);
301     paramBuffer.addValueParam("green", ParamType::TGLboolean, green);
302     paramBuffer.addValueParam("blue", ParamType::TGLboolean, blue);
303     paramBuffer.addValueParam("alpha", ParamType::TGLboolean, alpha);
304 
305     return CallCapture(gl::EntryPoint::ColorMask, std::move(paramBuffer));
306 }
307 
CaptureCompileShader(const State & glState,bool isCallValid,ShaderProgramID shaderPacked)308 CallCapture CaptureCompileShader(const State &glState,
309                                  bool isCallValid,
310                                  ShaderProgramID shaderPacked)
311 {
312     ParamBuffer paramBuffer;
313 
314     paramBuffer.addValueParam("shaderPacked", ParamType::TShaderProgramID, shaderPacked);
315 
316     return CallCapture(gl::EntryPoint::CompileShader, std::move(paramBuffer));
317 }
318 
CaptureCompressedTexImage2D(const State & glState,bool isCallValid,TextureTarget targetPacked,GLint level,GLenum internalformat,GLsizei width,GLsizei height,GLint border,GLsizei imageSize,const void * data)319 CallCapture CaptureCompressedTexImage2D(const State &glState,
320                                         bool isCallValid,
321                                         TextureTarget targetPacked,
322                                         GLint level,
323                                         GLenum internalformat,
324                                         GLsizei width,
325                                         GLsizei height,
326                                         GLint border,
327                                         GLsizei imageSize,
328                                         const void *data)
329 {
330     ParamBuffer paramBuffer;
331 
332     paramBuffer.addValueParam("targetPacked", ParamType::TTextureTarget, targetPacked);
333     paramBuffer.addValueParam("level", ParamType::TGLint, level);
334     paramBuffer.addEnumParam("internalformat", GLenumGroup::InternalFormat, ParamType::TGLenum,
335                              internalformat);
336     paramBuffer.addValueParam("width", ParamType::TGLsizei, width);
337     paramBuffer.addValueParam("height", ParamType::TGLsizei, height);
338     paramBuffer.addValueParam("border", ParamType::TGLint, border);
339     paramBuffer.addValueParam("imageSize", ParamType::TGLsizei, imageSize);
340 
341     ParamCapture dataParam("data", ParamType::TvoidConstPointer);
342     InitParamValue(ParamType::TvoidConstPointer, data, &dataParam.value);
343     CaptureCompressedTexImage2D_data(glState, isCallValid, targetPacked, level, internalformat,
344                                      width, height, border, imageSize, data, &dataParam);
345     paramBuffer.addParam(std::move(dataParam));
346 
347     return CallCapture(gl::EntryPoint::CompressedTexImage2D, std::move(paramBuffer));
348 }
349 
CaptureCompressedTexSubImage2D(const State & glState,bool isCallValid,TextureTarget targetPacked,GLint level,GLint xoffset,GLint yoffset,GLsizei width,GLsizei height,GLenum format,GLsizei imageSize,const void * data)350 CallCapture CaptureCompressedTexSubImage2D(const State &glState,
351                                            bool isCallValid,
352                                            TextureTarget targetPacked,
353                                            GLint level,
354                                            GLint xoffset,
355                                            GLint yoffset,
356                                            GLsizei width,
357                                            GLsizei height,
358                                            GLenum format,
359                                            GLsizei imageSize,
360                                            const void *data)
361 {
362     ParamBuffer paramBuffer;
363 
364     paramBuffer.addValueParam("targetPacked", ParamType::TTextureTarget, targetPacked);
365     paramBuffer.addValueParam("level", ParamType::TGLint, level);
366     paramBuffer.addValueParam("xoffset", ParamType::TGLint, xoffset);
367     paramBuffer.addValueParam("yoffset", ParamType::TGLint, yoffset);
368     paramBuffer.addValueParam("width", ParamType::TGLsizei, width);
369     paramBuffer.addValueParam("height", ParamType::TGLsizei, height);
370     paramBuffer.addEnumParam("format", GLenumGroup::PixelFormat, ParamType::TGLenum, format);
371     paramBuffer.addValueParam("imageSize", ParamType::TGLsizei, imageSize);
372 
373     ParamCapture dataParam("data", ParamType::TvoidConstPointer);
374     InitParamValue(ParamType::TvoidConstPointer, data, &dataParam.value);
375     CaptureCompressedTexSubImage2D_data(glState, isCallValid, targetPacked, level, xoffset, yoffset,
376                                         width, height, format, imageSize, data, &dataParam);
377     paramBuffer.addParam(std::move(dataParam));
378 
379     return CallCapture(gl::EntryPoint::CompressedTexSubImage2D, std::move(paramBuffer));
380 }
381 
CaptureCopyTexImage2D(const State & glState,bool isCallValid,TextureTarget targetPacked,GLint level,GLenum internalformat,GLint x,GLint y,GLsizei width,GLsizei height,GLint border)382 CallCapture CaptureCopyTexImage2D(const State &glState,
383                                   bool isCallValid,
384                                   TextureTarget targetPacked,
385                                   GLint level,
386                                   GLenum internalformat,
387                                   GLint x,
388                                   GLint y,
389                                   GLsizei width,
390                                   GLsizei height,
391                                   GLint border)
392 {
393     ParamBuffer paramBuffer;
394 
395     paramBuffer.addValueParam("targetPacked", ParamType::TTextureTarget, targetPacked);
396     paramBuffer.addValueParam("level", ParamType::TGLint, level);
397     paramBuffer.addEnumParam("internalformat", GLenumGroup::InternalFormat, ParamType::TGLenum,
398                              internalformat);
399     paramBuffer.addValueParam("x", ParamType::TGLint, x);
400     paramBuffer.addValueParam("y", ParamType::TGLint, y);
401     paramBuffer.addValueParam("width", ParamType::TGLsizei, width);
402     paramBuffer.addValueParam("height", ParamType::TGLsizei, height);
403     paramBuffer.addValueParam("border", ParamType::TGLint, border);
404 
405     return CallCapture(gl::EntryPoint::CopyTexImage2D, std::move(paramBuffer));
406 }
407 
CaptureCopyTexSubImage2D(const State & glState,bool isCallValid,TextureTarget targetPacked,GLint level,GLint xoffset,GLint yoffset,GLint x,GLint y,GLsizei width,GLsizei height)408 CallCapture CaptureCopyTexSubImage2D(const State &glState,
409                                      bool isCallValid,
410                                      TextureTarget targetPacked,
411                                      GLint level,
412                                      GLint xoffset,
413                                      GLint yoffset,
414                                      GLint x,
415                                      GLint y,
416                                      GLsizei width,
417                                      GLsizei height)
418 {
419     ParamBuffer paramBuffer;
420 
421     paramBuffer.addValueParam("targetPacked", ParamType::TTextureTarget, targetPacked);
422     paramBuffer.addValueParam("level", ParamType::TGLint, level);
423     paramBuffer.addValueParam("xoffset", ParamType::TGLint, xoffset);
424     paramBuffer.addValueParam("yoffset", ParamType::TGLint, yoffset);
425     paramBuffer.addValueParam("x", ParamType::TGLint, x);
426     paramBuffer.addValueParam("y", ParamType::TGLint, y);
427     paramBuffer.addValueParam("width", ParamType::TGLsizei, width);
428     paramBuffer.addValueParam("height", ParamType::TGLsizei, height);
429 
430     return CallCapture(gl::EntryPoint::CopyTexSubImage2D, std::move(paramBuffer));
431 }
432 
CaptureCreateProgram(const State & glState,bool isCallValid,GLuint returnValue)433 CallCapture CaptureCreateProgram(const State &glState, bool isCallValid, GLuint returnValue)
434 {
435     ParamBuffer paramBuffer;
436 
437     ParamCapture returnValueCapture("returnValue", ParamType::TGLuint);
438     InitParamValue(ParamType::TGLuint, returnValue, &returnValueCapture.value);
439     paramBuffer.addReturnValue(std::move(returnValueCapture));
440 
441     return CallCapture(gl::EntryPoint::CreateProgram, std::move(paramBuffer));
442 }
443 
CaptureCreateShader(const State & glState,bool isCallValid,ShaderType typePacked,GLuint returnValue)444 CallCapture CaptureCreateShader(const State &glState,
445                                 bool isCallValid,
446                                 ShaderType typePacked,
447                                 GLuint returnValue)
448 {
449     ParamBuffer paramBuffer;
450 
451     paramBuffer.addValueParam("typePacked", ParamType::TShaderType, typePacked);
452 
453     ParamCapture returnValueCapture("returnValue", ParamType::TGLuint);
454     InitParamValue(ParamType::TGLuint, returnValue, &returnValueCapture.value);
455     paramBuffer.addReturnValue(std::move(returnValueCapture));
456 
457     return CallCapture(gl::EntryPoint::CreateShader, std::move(paramBuffer));
458 }
459 
CaptureCullFace(const State & glState,bool isCallValid,CullFaceMode modePacked)460 CallCapture CaptureCullFace(const State &glState, bool isCallValid, CullFaceMode modePacked)
461 {
462     ParamBuffer paramBuffer;
463 
464     paramBuffer.addValueParam("modePacked", ParamType::TCullFaceMode, modePacked);
465 
466     return CallCapture(gl::EntryPoint::CullFace, std::move(paramBuffer));
467 }
468 
CaptureDeleteBuffers(const State & glState,bool isCallValid,GLsizei n,const BufferID * buffersPacked)469 CallCapture CaptureDeleteBuffers(const State &glState,
470                                  bool isCallValid,
471                                  GLsizei n,
472                                  const BufferID *buffersPacked)
473 {
474     ParamBuffer paramBuffer;
475 
476     paramBuffer.addValueParam("n", ParamType::TGLsizei, n);
477 
478     ParamCapture buffersPackedParam("buffersPacked", ParamType::TBufferIDConstPointer);
479     InitParamValue(ParamType::TBufferIDConstPointer, buffersPacked, &buffersPackedParam.value);
480     CaptureDeleteBuffers_buffersPacked(glState, isCallValid, n, buffersPacked, &buffersPackedParam);
481     paramBuffer.addParam(std::move(buffersPackedParam));
482 
483     return CallCapture(gl::EntryPoint::DeleteBuffers, std::move(paramBuffer));
484 }
485 
CaptureDeleteFramebuffers(const State & glState,bool isCallValid,GLsizei n,const FramebufferID * framebuffersPacked)486 CallCapture CaptureDeleteFramebuffers(const State &glState,
487                                       bool isCallValid,
488                                       GLsizei n,
489                                       const FramebufferID *framebuffersPacked)
490 {
491     ParamBuffer paramBuffer;
492 
493     paramBuffer.addValueParam("n", ParamType::TGLsizei, n);
494 
495     ParamCapture framebuffersPackedParam("framebuffersPacked",
496                                          ParamType::TFramebufferIDConstPointer);
497     InitParamValue(ParamType::TFramebufferIDConstPointer, framebuffersPacked,
498                    &framebuffersPackedParam.value);
499     CaptureDeleteFramebuffers_framebuffersPacked(glState, isCallValid, n, framebuffersPacked,
500                                                  &framebuffersPackedParam);
501     paramBuffer.addParam(std::move(framebuffersPackedParam));
502 
503     return CallCapture(gl::EntryPoint::DeleteFramebuffers, std::move(paramBuffer));
504 }
505 
CaptureDeleteProgram(const State & glState,bool isCallValid,ShaderProgramID programPacked)506 CallCapture CaptureDeleteProgram(const State &glState,
507                                  bool isCallValid,
508                                  ShaderProgramID programPacked)
509 {
510     ParamBuffer paramBuffer;
511 
512     paramBuffer.addValueParam("programPacked", ParamType::TShaderProgramID, programPacked);
513 
514     return CallCapture(gl::EntryPoint::DeleteProgram, std::move(paramBuffer));
515 }
516 
CaptureDeleteRenderbuffers(const State & glState,bool isCallValid,GLsizei n,const RenderbufferID * renderbuffersPacked)517 CallCapture CaptureDeleteRenderbuffers(const State &glState,
518                                        bool isCallValid,
519                                        GLsizei n,
520                                        const RenderbufferID *renderbuffersPacked)
521 {
522     ParamBuffer paramBuffer;
523 
524     paramBuffer.addValueParam("n", ParamType::TGLsizei, n);
525 
526     ParamCapture renderbuffersPackedParam("renderbuffersPacked",
527                                           ParamType::TRenderbufferIDConstPointer);
528     InitParamValue(ParamType::TRenderbufferIDConstPointer, renderbuffersPacked,
529                    &renderbuffersPackedParam.value);
530     CaptureDeleteRenderbuffers_renderbuffersPacked(glState, isCallValid, n, renderbuffersPacked,
531                                                    &renderbuffersPackedParam);
532     paramBuffer.addParam(std::move(renderbuffersPackedParam));
533 
534     return CallCapture(gl::EntryPoint::DeleteRenderbuffers, std::move(paramBuffer));
535 }
536 
CaptureDeleteShader(const State & glState,bool isCallValid,ShaderProgramID shaderPacked)537 CallCapture CaptureDeleteShader(const State &glState,
538                                 bool isCallValid,
539                                 ShaderProgramID shaderPacked)
540 {
541     ParamBuffer paramBuffer;
542 
543     paramBuffer.addValueParam("shaderPacked", ParamType::TShaderProgramID, shaderPacked);
544 
545     return CallCapture(gl::EntryPoint::DeleteShader, std::move(paramBuffer));
546 }
547 
CaptureDeleteTextures(const State & glState,bool isCallValid,GLsizei n,const TextureID * texturesPacked)548 CallCapture CaptureDeleteTextures(const State &glState,
549                                   bool isCallValid,
550                                   GLsizei n,
551                                   const TextureID *texturesPacked)
552 {
553     ParamBuffer paramBuffer;
554 
555     paramBuffer.addValueParam("n", ParamType::TGLsizei, n);
556 
557     ParamCapture texturesPackedParam("texturesPacked", ParamType::TTextureIDConstPointer);
558     InitParamValue(ParamType::TTextureIDConstPointer, texturesPacked, &texturesPackedParam.value);
559     CaptureDeleteTextures_texturesPacked(glState, isCallValid, n, texturesPacked,
560                                          &texturesPackedParam);
561     paramBuffer.addParam(std::move(texturesPackedParam));
562 
563     return CallCapture(gl::EntryPoint::DeleteTextures, std::move(paramBuffer));
564 }
565 
CaptureDepthFunc(const State & glState,bool isCallValid,GLenum func)566 CallCapture CaptureDepthFunc(const State &glState, bool isCallValid, GLenum func)
567 {
568     ParamBuffer paramBuffer;
569 
570     paramBuffer.addEnumParam("func", GLenumGroup::DepthFunction, ParamType::TGLenum, func);
571 
572     return CallCapture(gl::EntryPoint::DepthFunc, std::move(paramBuffer));
573 }
574 
CaptureDepthMask(const State & glState,bool isCallValid,GLboolean flag)575 CallCapture CaptureDepthMask(const State &glState, bool isCallValid, GLboolean flag)
576 {
577     ParamBuffer paramBuffer;
578 
579     paramBuffer.addValueParam("flag", ParamType::TGLboolean, flag);
580 
581     return CallCapture(gl::EntryPoint::DepthMask, std::move(paramBuffer));
582 }
583 
CaptureDepthRangef(const State & glState,bool isCallValid,GLfloat n,GLfloat f)584 CallCapture CaptureDepthRangef(const State &glState, bool isCallValid, GLfloat n, GLfloat f)
585 {
586     ParamBuffer paramBuffer;
587 
588     paramBuffer.addValueParam("n", ParamType::TGLfloat, n);
589     paramBuffer.addValueParam("f", ParamType::TGLfloat, f);
590 
591     return CallCapture(gl::EntryPoint::DepthRangef, std::move(paramBuffer));
592 }
593 
CaptureDetachShader(const State & glState,bool isCallValid,ShaderProgramID programPacked,ShaderProgramID shaderPacked)594 CallCapture CaptureDetachShader(const State &glState,
595                                 bool isCallValid,
596                                 ShaderProgramID programPacked,
597                                 ShaderProgramID shaderPacked)
598 {
599     ParamBuffer paramBuffer;
600 
601     paramBuffer.addValueParam("programPacked", ParamType::TShaderProgramID, programPacked);
602     paramBuffer.addValueParam("shaderPacked", ParamType::TShaderProgramID, shaderPacked);
603 
604     return CallCapture(gl::EntryPoint::DetachShader, std::move(paramBuffer));
605 }
606 
CaptureDisable(const State & glState,bool isCallValid,GLenum cap)607 CallCapture CaptureDisable(const State &glState, bool isCallValid, GLenum cap)
608 {
609     ParamBuffer paramBuffer;
610 
611     paramBuffer.addEnumParam("cap", GLenumGroup::EnableCap, ParamType::TGLenum, cap);
612 
613     return CallCapture(gl::EntryPoint::Disable, std::move(paramBuffer));
614 }
615 
CaptureDisableVertexAttribArray(const State & glState,bool isCallValid,GLuint index)616 CallCapture CaptureDisableVertexAttribArray(const State &glState, bool isCallValid, GLuint index)
617 {
618     ParamBuffer paramBuffer;
619 
620     paramBuffer.addValueParam("index", ParamType::TGLuint, index);
621 
622     return CallCapture(gl::EntryPoint::DisableVertexAttribArray, std::move(paramBuffer));
623 }
624 
CaptureDrawArrays(const State & glState,bool isCallValid,PrimitiveMode modePacked,GLint first,GLsizei count)625 CallCapture CaptureDrawArrays(const State &glState,
626                               bool isCallValid,
627                               PrimitiveMode modePacked,
628                               GLint first,
629                               GLsizei count)
630 {
631     ParamBuffer paramBuffer;
632 
633     paramBuffer.addValueParam("modePacked", ParamType::TPrimitiveMode, modePacked);
634     paramBuffer.addValueParam("first", ParamType::TGLint, first);
635     paramBuffer.addValueParam("count", ParamType::TGLsizei, count);
636 
637     return CallCapture(gl::EntryPoint::DrawArrays, std::move(paramBuffer));
638 }
639 
CaptureDrawElements(const State & glState,bool isCallValid,PrimitiveMode modePacked,GLsizei count,DrawElementsType typePacked,const void * indices)640 CallCapture CaptureDrawElements(const State &glState,
641                                 bool isCallValid,
642                                 PrimitiveMode modePacked,
643                                 GLsizei count,
644                                 DrawElementsType typePacked,
645                                 const void *indices)
646 {
647     ParamBuffer paramBuffer;
648 
649     paramBuffer.addValueParam("modePacked", ParamType::TPrimitiveMode, modePacked);
650     paramBuffer.addValueParam("count", ParamType::TGLsizei, count);
651     paramBuffer.addValueParam("typePacked", ParamType::TDrawElementsType, typePacked);
652 
653     ParamCapture indicesParam("indices", ParamType::TvoidConstPointer);
654     InitParamValue(ParamType::TvoidConstPointer, indices, &indicesParam.value);
655     CaptureDrawElements_indices(glState, isCallValid, modePacked, count, typePacked, indices,
656                                 &indicesParam);
657     paramBuffer.addParam(std::move(indicesParam));
658 
659     return CallCapture(gl::EntryPoint::DrawElements, std::move(paramBuffer));
660 }
661 
CaptureEnable(const State & glState,bool isCallValid,GLenum cap)662 CallCapture CaptureEnable(const State &glState, bool isCallValid, GLenum cap)
663 {
664     ParamBuffer paramBuffer;
665 
666     paramBuffer.addEnumParam("cap", GLenumGroup::EnableCap, ParamType::TGLenum, cap);
667 
668     return CallCapture(gl::EntryPoint::Enable, std::move(paramBuffer));
669 }
670 
CaptureEnableVertexAttribArray(const State & glState,bool isCallValid,GLuint index)671 CallCapture CaptureEnableVertexAttribArray(const State &glState, bool isCallValid, GLuint index)
672 {
673     ParamBuffer paramBuffer;
674 
675     paramBuffer.addValueParam("index", ParamType::TGLuint, index);
676 
677     return CallCapture(gl::EntryPoint::EnableVertexAttribArray, std::move(paramBuffer));
678 }
679 
CaptureFinish(const State & glState,bool isCallValid)680 CallCapture CaptureFinish(const State &glState, bool isCallValid)
681 {
682     ParamBuffer paramBuffer;
683 
684     return CallCapture(gl::EntryPoint::Finish, std::move(paramBuffer));
685 }
686 
CaptureFlush(const State & glState,bool isCallValid)687 CallCapture CaptureFlush(const State &glState, bool isCallValid)
688 {
689     ParamBuffer paramBuffer;
690 
691     return CallCapture(gl::EntryPoint::Flush, std::move(paramBuffer));
692 }
693 
CaptureFramebufferRenderbuffer(const State & glState,bool isCallValid,GLenum target,GLenum attachment,GLenum renderbuffertarget,RenderbufferID renderbufferPacked)694 CallCapture CaptureFramebufferRenderbuffer(const State &glState,
695                                            bool isCallValid,
696                                            GLenum target,
697                                            GLenum attachment,
698                                            GLenum renderbuffertarget,
699                                            RenderbufferID renderbufferPacked)
700 {
701     ParamBuffer paramBuffer;
702 
703     paramBuffer.addEnumParam("target", GLenumGroup::FramebufferTarget, ParamType::TGLenum, target);
704     paramBuffer.addEnumParam("attachment", GLenumGroup::FramebufferAttachment, ParamType::TGLenum,
705                              attachment);
706     paramBuffer.addEnumParam("renderbuffertarget", GLenumGroup::RenderbufferTarget,
707                              ParamType::TGLenum, renderbuffertarget);
708     paramBuffer.addValueParam("renderbufferPacked", ParamType::TRenderbufferID, renderbufferPacked);
709 
710     return CallCapture(gl::EntryPoint::FramebufferRenderbuffer, std::move(paramBuffer));
711 }
712 
CaptureFramebufferTexture2D(const State & glState,bool isCallValid,GLenum target,GLenum attachment,TextureTarget textargetPacked,TextureID texturePacked,GLint level)713 CallCapture CaptureFramebufferTexture2D(const State &glState,
714                                         bool isCallValid,
715                                         GLenum target,
716                                         GLenum attachment,
717                                         TextureTarget textargetPacked,
718                                         TextureID texturePacked,
719                                         GLint level)
720 {
721     ParamBuffer paramBuffer;
722 
723     paramBuffer.addEnumParam("target", GLenumGroup::FramebufferTarget, ParamType::TGLenum, target);
724     paramBuffer.addEnumParam("attachment", GLenumGroup::FramebufferAttachment, ParamType::TGLenum,
725                              attachment);
726     paramBuffer.addValueParam("textargetPacked", ParamType::TTextureTarget, textargetPacked);
727     paramBuffer.addValueParam("texturePacked", ParamType::TTextureID, texturePacked);
728     paramBuffer.addValueParam("level", ParamType::TGLint, level);
729 
730     return CallCapture(gl::EntryPoint::FramebufferTexture2D, std::move(paramBuffer));
731 }
732 
CaptureFrontFace(const State & glState,bool isCallValid,GLenum mode)733 CallCapture CaptureFrontFace(const State &glState, bool isCallValid, GLenum mode)
734 {
735     ParamBuffer paramBuffer;
736 
737     paramBuffer.addEnumParam("mode", GLenumGroup::FrontFaceDirection, ParamType::TGLenum, mode);
738 
739     return CallCapture(gl::EntryPoint::FrontFace, std::move(paramBuffer));
740 }
741 
CaptureGenBuffers(const State & glState,bool isCallValid,GLsizei n,BufferID * buffersPacked)742 CallCapture CaptureGenBuffers(const State &glState,
743                               bool isCallValid,
744                               GLsizei n,
745                               BufferID *buffersPacked)
746 {
747     ParamBuffer paramBuffer;
748 
749     paramBuffer.addValueParam("n", ParamType::TGLsizei, n);
750 
751     ParamCapture buffersPackedParam("buffersPacked", ParamType::TBufferIDPointer);
752     InitParamValue(ParamType::TBufferIDPointer, buffersPacked, &buffersPackedParam.value);
753     CaptureGenBuffers_buffersPacked(glState, isCallValid, n, buffersPacked, &buffersPackedParam);
754     paramBuffer.addParam(std::move(buffersPackedParam));
755 
756     return CallCapture(gl::EntryPoint::GenBuffers, std::move(paramBuffer));
757 }
758 
CaptureGenFramebuffers(const State & glState,bool isCallValid,GLsizei n,FramebufferID * framebuffersPacked)759 CallCapture CaptureGenFramebuffers(const State &glState,
760                                    bool isCallValid,
761                                    GLsizei n,
762                                    FramebufferID *framebuffersPacked)
763 {
764     ParamBuffer paramBuffer;
765 
766     paramBuffer.addValueParam("n", ParamType::TGLsizei, n);
767 
768     ParamCapture framebuffersPackedParam("framebuffersPacked", ParamType::TFramebufferIDPointer);
769     InitParamValue(ParamType::TFramebufferIDPointer, framebuffersPacked,
770                    &framebuffersPackedParam.value);
771     CaptureGenFramebuffers_framebuffersPacked(glState, isCallValid, n, framebuffersPacked,
772                                               &framebuffersPackedParam);
773     paramBuffer.addParam(std::move(framebuffersPackedParam));
774 
775     return CallCapture(gl::EntryPoint::GenFramebuffers, std::move(paramBuffer));
776 }
777 
CaptureGenRenderbuffers(const State & glState,bool isCallValid,GLsizei n,RenderbufferID * renderbuffersPacked)778 CallCapture CaptureGenRenderbuffers(const State &glState,
779                                     bool isCallValid,
780                                     GLsizei n,
781                                     RenderbufferID *renderbuffersPacked)
782 {
783     ParamBuffer paramBuffer;
784 
785     paramBuffer.addValueParam("n", ParamType::TGLsizei, n);
786 
787     ParamCapture renderbuffersPackedParam("renderbuffersPacked", ParamType::TRenderbufferIDPointer);
788     InitParamValue(ParamType::TRenderbufferIDPointer, renderbuffersPacked,
789                    &renderbuffersPackedParam.value);
790     CaptureGenRenderbuffers_renderbuffersPacked(glState, isCallValid, n, renderbuffersPacked,
791                                                 &renderbuffersPackedParam);
792     paramBuffer.addParam(std::move(renderbuffersPackedParam));
793 
794     return CallCapture(gl::EntryPoint::GenRenderbuffers, std::move(paramBuffer));
795 }
796 
CaptureGenTextures(const State & glState,bool isCallValid,GLsizei n,TextureID * texturesPacked)797 CallCapture CaptureGenTextures(const State &glState,
798                                bool isCallValid,
799                                GLsizei n,
800                                TextureID *texturesPacked)
801 {
802     ParamBuffer paramBuffer;
803 
804     paramBuffer.addValueParam("n", ParamType::TGLsizei, n);
805 
806     ParamCapture texturesPackedParam("texturesPacked", ParamType::TTextureIDPointer);
807     InitParamValue(ParamType::TTextureIDPointer, texturesPacked, &texturesPackedParam.value);
808     CaptureGenTextures_texturesPacked(glState, isCallValid, n, texturesPacked,
809                                       &texturesPackedParam);
810     paramBuffer.addParam(std::move(texturesPackedParam));
811 
812     return CallCapture(gl::EntryPoint::GenTextures, std::move(paramBuffer));
813 }
814 
CaptureGenerateMipmap(const State & glState,bool isCallValid,TextureType targetPacked)815 CallCapture CaptureGenerateMipmap(const State &glState, bool isCallValid, TextureType targetPacked)
816 {
817     ParamBuffer paramBuffer;
818 
819     paramBuffer.addValueParam("targetPacked", ParamType::TTextureType, targetPacked);
820 
821     return CallCapture(gl::EntryPoint::GenerateMipmap, std::move(paramBuffer));
822 }
823 
CaptureGetActiveAttrib(const State & glState,bool isCallValid,ShaderProgramID programPacked,GLuint index,GLsizei bufSize,GLsizei * length,GLint * size,GLenum * type,GLchar * name)824 CallCapture CaptureGetActiveAttrib(const State &glState,
825                                    bool isCallValid,
826                                    ShaderProgramID programPacked,
827                                    GLuint index,
828                                    GLsizei bufSize,
829                                    GLsizei *length,
830                                    GLint *size,
831                                    GLenum *type,
832                                    GLchar *name)
833 {
834     ParamBuffer paramBuffer;
835 
836     paramBuffer.addValueParam("programPacked", ParamType::TShaderProgramID, programPacked);
837     paramBuffer.addValueParam("index", ParamType::TGLuint, index);
838     paramBuffer.addValueParam("bufSize", ParamType::TGLsizei, bufSize);
839 
840     ParamCapture lengthParam("length", ParamType::TGLsizeiPointer);
841     InitParamValue(ParamType::TGLsizeiPointer, length, &lengthParam.value);
842     CaptureGetActiveAttrib_length(glState, isCallValid, programPacked, index, bufSize, length, size,
843                                   type, name, &lengthParam);
844     paramBuffer.addParam(std::move(lengthParam));
845 
846     ParamCapture sizeParam("size", ParamType::TGLintPointer);
847     InitParamValue(ParamType::TGLintPointer, size, &sizeParam.value);
848     CaptureGetActiveAttrib_size(glState, isCallValid, programPacked, index, bufSize, length, size,
849                                 type, name, &sizeParam);
850     paramBuffer.addParam(std::move(sizeParam));
851 
852     ParamCapture typeParam("type", ParamType::TGLenumPointer);
853     InitParamValue(ParamType::TGLenumPointer, type, &typeParam.value);
854     CaptureGetActiveAttrib_type(glState, isCallValid, programPacked, index, bufSize, length, size,
855                                 type, name, &typeParam);
856     paramBuffer.addParam(std::move(typeParam));
857 
858     ParamCapture nameParam("name", ParamType::TGLcharPointer);
859     InitParamValue(ParamType::TGLcharPointer, name, &nameParam.value);
860     CaptureGetActiveAttrib_name(glState, isCallValid, programPacked, index, bufSize, length, size,
861                                 type, name, &nameParam);
862     paramBuffer.addParam(std::move(nameParam));
863 
864     return CallCapture(gl::EntryPoint::GetActiveAttrib, std::move(paramBuffer));
865 }
866 
CaptureGetActiveUniform(const State & glState,bool isCallValid,ShaderProgramID programPacked,GLuint index,GLsizei bufSize,GLsizei * length,GLint * size,GLenum * type,GLchar * name)867 CallCapture CaptureGetActiveUniform(const State &glState,
868                                     bool isCallValid,
869                                     ShaderProgramID programPacked,
870                                     GLuint index,
871                                     GLsizei bufSize,
872                                     GLsizei *length,
873                                     GLint *size,
874                                     GLenum *type,
875                                     GLchar *name)
876 {
877     ParamBuffer paramBuffer;
878 
879     paramBuffer.addValueParam("programPacked", ParamType::TShaderProgramID, programPacked);
880     paramBuffer.addValueParam("index", ParamType::TGLuint, index);
881     paramBuffer.addValueParam("bufSize", ParamType::TGLsizei, bufSize);
882 
883     ParamCapture lengthParam("length", ParamType::TGLsizeiPointer);
884     InitParamValue(ParamType::TGLsizeiPointer, length, &lengthParam.value);
885     CaptureGetActiveUniform_length(glState, isCallValid, programPacked, index, bufSize, length,
886                                    size, type, name, &lengthParam);
887     paramBuffer.addParam(std::move(lengthParam));
888 
889     ParamCapture sizeParam("size", ParamType::TGLintPointer);
890     InitParamValue(ParamType::TGLintPointer, size, &sizeParam.value);
891     CaptureGetActiveUniform_size(glState, isCallValid, programPacked, index, bufSize, length, size,
892                                  type, name, &sizeParam);
893     paramBuffer.addParam(std::move(sizeParam));
894 
895     ParamCapture typeParam("type", ParamType::TGLenumPointer);
896     InitParamValue(ParamType::TGLenumPointer, type, &typeParam.value);
897     CaptureGetActiveUniform_type(glState, isCallValid, programPacked, index, bufSize, length, size,
898                                  type, name, &typeParam);
899     paramBuffer.addParam(std::move(typeParam));
900 
901     ParamCapture nameParam("name", ParamType::TGLcharPointer);
902     InitParamValue(ParamType::TGLcharPointer, name, &nameParam.value);
903     CaptureGetActiveUniform_name(glState, isCallValid, programPacked, index, bufSize, length, size,
904                                  type, name, &nameParam);
905     paramBuffer.addParam(std::move(nameParam));
906 
907     return CallCapture(gl::EntryPoint::GetActiveUniform, std::move(paramBuffer));
908 }
909 
CaptureGetAttachedShaders(const State & glState,bool isCallValid,ShaderProgramID programPacked,GLsizei maxCount,GLsizei * count,ShaderProgramID * shadersPacked)910 CallCapture CaptureGetAttachedShaders(const State &glState,
911                                       bool isCallValid,
912                                       ShaderProgramID programPacked,
913                                       GLsizei maxCount,
914                                       GLsizei *count,
915                                       ShaderProgramID *shadersPacked)
916 {
917     ParamBuffer paramBuffer;
918 
919     paramBuffer.addValueParam("programPacked", ParamType::TShaderProgramID, programPacked);
920     paramBuffer.addValueParam("maxCount", ParamType::TGLsizei, maxCount);
921 
922     ParamCapture countParam("count", ParamType::TGLsizeiPointer);
923     InitParamValue(ParamType::TGLsizeiPointer, count, &countParam.value);
924     CaptureGetAttachedShaders_count(glState, isCallValid, programPacked, maxCount, count,
925                                     shadersPacked, &countParam);
926     paramBuffer.addParam(std::move(countParam));
927 
928     ParamCapture shadersPackedParam("shadersPacked", ParamType::TShaderProgramIDPointer);
929     InitParamValue(ParamType::TShaderProgramIDPointer, shadersPacked, &shadersPackedParam.value);
930     CaptureGetAttachedShaders_shadersPacked(glState, isCallValid, programPacked, maxCount, count,
931                                             shadersPacked, &shadersPackedParam);
932     paramBuffer.addParam(std::move(shadersPackedParam));
933 
934     return CallCapture(gl::EntryPoint::GetAttachedShaders, std::move(paramBuffer));
935 }
936 
CaptureGetAttribLocation(const State & glState,bool isCallValid,ShaderProgramID programPacked,const GLchar * name,GLint returnValue)937 CallCapture CaptureGetAttribLocation(const State &glState,
938                                      bool isCallValid,
939                                      ShaderProgramID programPacked,
940                                      const GLchar *name,
941                                      GLint returnValue)
942 {
943     ParamBuffer paramBuffer;
944 
945     paramBuffer.addValueParam("programPacked", ParamType::TShaderProgramID, programPacked);
946 
947     ParamCapture nameParam("name", ParamType::TGLcharConstPointer);
948     InitParamValue(ParamType::TGLcharConstPointer, name, &nameParam.value);
949     CaptureGetAttribLocation_name(glState, isCallValid, programPacked, name, &nameParam);
950     paramBuffer.addParam(std::move(nameParam));
951 
952     ParamCapture returnValueCapture("returnValue", ParamType::TGLint);
953     InitParamValue(ParamType::TGLint, returnValue, &returnValueCapture.value);
954     paramBuffer.addReturnValue(std::move(returnValueCapture));
955 
956     return CallCapture(gl::EntryPoint::GetAttribLocation, std::move(paramBuffer));
957 }
958 
CaptureGetBooleanv(const State & glState,bool isCallValid,GLenum pname,GLboolean * data)959 CallCapture CaptureGetBooleanv(const State &glState,
960                                bool isCallValid,
961                                GLenum pname,
962                                GLboolean *data)
963 {
964     ParamBuffer paramBuffer;
965 
966     paramBuffer.addEnumParam("pname", GLenumGroup::GetPName, ParamType::TGLenum, pname);
967 
968     ParamCapture dataParam("data", ParamType::TGLbooleanPointer);
969     InitParamValue(ParamType::TGLbooleanPointer, data, &dataParam.value);
970     CaptureGetBooleanv_data(glState, isCallValid, pname, data, &dataParam);
971     paramBuffer.addParam(std::move(dataParam));
972 
973     return CallCapture(gl::EntryPoint::GetBooleanv, std::move(paramBuffer));
974 }
975 
CaptureGetBufferParameteriv(const State & glState,bool isCallValid,BufferBinding targetPacked,GLenum pname,GLint * params)976 CallCapture CaptureGetBufferParameteriv(const State &glState,
977                                         bool isCallValid,
978                                         BufferBinding targetPacked,
979                                         GLenum pname,
980                                         GLint *params)
981 {
982     ParamBuffer paramBuffer;
983 
984     paramBuffer.addValueParam("targetPacked", ParamType::TBufferBinding, targetPacked);
985     paramBuffer.addEnumParam("pname", GLenumGroup::DefaultGroup, ParamType::TGLenum, pname);
986 
987     ParamCapture paramsParam("params", ParamType::TGLintPointer);
988     InitParamValue(ParamType::TGLintPointer, params, &paramsParam.value);
989     CaptureGetBufferParameteriv_params(glState, isCallValid, targetPacked, pname, params,
990                                        &paramsParam);
991     paramBuffer.addParam(std::move(paramsParam));
992 
993     return CallCapture(gl::EntryPoint::GetBufferParameteriv, std::move(paramBuffer));
994 }
995 
CaptureGetError(const State & glState,bool isCallValid,GLenum returnValue)996 CallCapture CaptureGetError(const State &glState, bool isCallValid, GLenum returnValue)
997 {
998     ParamBuffer paramBuffer;
999 
1000     ParamCapture returnValueCapture("returnValue", ParamType::TGLenum);
1001     InitParamValue(ParamType::TGLenum, returnValue, &returnValueCapture.value);
1002     paramBuffer.addReturnValue(std::move(returnValueCapture));
1003 
1004     return CallCapture(gl::EntryPoint::GetError, std::move(paramBuffer));
1005 }
1006 
CaptureGetFloatv(const State & glState,bool isCallValid,GLenum pname,GLfloat * data)1007 CallCapture CaptureGetFloatv(const State &glState, bool isCallValid, GLenum pname, GLfloat *data)
1008 {
1009     ParamBuffer paramBuffer;
1010 
1011     paramBuffer.addEnumParam("pname", GLenumGroup::GetPName, ParamType::TGLenum, pname);
1012 
1013     ParamCapture dataParam("data", ParamType::TGLfloatPointer);
1014     InitParamValue(ParamType::TGLfloatPointer, data, &dataParam.value);
1015     CaptureGetFloatv_data(glState, isCallValid, pname, data, &dataParam);
1016     paramBuffer.addParam(std::move(dataParam));
1017 
1018     return CallCapture(gl::EntryPoint::GetFloatv, std::move(paramBuffer));
1019 }
1020 
CaptureGetFramebufferAttachmentParameteriv(const State & glState,bool isCallValid,GLenum target,GLenum attachment,GLenum pname,GLint * params)1021 CallCapture CaptureGetFramebufferAttachmentParameteriv(const State &glState,
1022                                                        bool isCallValid,
1023                                                        GLenum target,
1024                                                        GLenum attachment,
1025                                                        GLenum pname,
1026                                                        GLint *params)
1027 {
1028     ParamBuffer paramBuffer;
1029 
1030     paramBuffer.addEnumParam("target", GLenumGroup::FramebufferTarget, ParamType::TGLenum, target);
1031     paramBuffer.addEnumParam("attachment", GLenumGroup::FramebufferAttachment, ParamType::TGLenum,
1032                              attachment);
1033     paramBuffer.addEnumParam("pname", GLenumGroup::FramebufferAttachmentParameterName,
1034                              ParamType::TGLenum, pname);
1035 
1036     ParamCapture paramsParam("params", ParamType::TGLintPointer);
1037     InitParamValue(ParamType::TGLintPointer, params, &paramsParam.value);
1038     CaptureGetFramebufferAttachmentParameteriv_params(glState, isCallValid, target, attachment,
1039                                                       pname, params, &paramsParam);
1040     paramBuffer.addParam(std::move(paramsParam));
1041 
1042     return CallCapture(gl::EntryPoint::GetFramebufferAttachmentParameteriv, std::move(paramBuffer));
1043 }
1044 
CaptureGetIntegerv(const State & glState,bool isCallValid,GLenum pname,GLint * data)1045 CallCapture CaptureGetIntegerv(const State &glState, bool isCallValid, GLenum pname, GLint *data)
1046 {
1047     ParamBuffer paramBuffer;
1048 
1049     paramBuffer.addEnumParam("pname", GLenumGroup::GetPName, ParamType::TGLenum, pname);
1050 
1051     ParamCapture dataParam("data", ParamType::TGLintPointer);
1052     InitParamValue(ParamType::TGLintPointer, data, &dataParam.value);
1053     CaptureGetIntegerv_data(glState, isCallValid, pname, data, &dataParam);
1054     paramBuffer.addParam(std::move(dataParam));
1055 
1056     return CallCapture(gl::EntryPoint::GetIntegerv, std::move(paramBuffer));
1057 }
1058 
CaptureGetProgramInfoLog(const State & glState,bool isCallValid,ShaderProgramID programPacked,GLsizei bufSize,GLsizei * length,GLchar * infoLog)1059 CallCapture CaptureGetProgramInfoLog(const State &glState,
1060                                      bool isCallValid,
1061                                      ShaderProgramID programPacked,
1062                                      GLsizei bufSize,
1063                                      GLsizei *length,
1064                                      GLchar *infoLog)
1065 {
1066     ParamBuffer paramBuffer;
1067 
1068     paramBuffer.addValueParam("programPacked", ParamType::TShaderProgramID, programPacked);
1069     paramBuffer.addValueParam("bufSize", ParamType::TGLsizei, bufSize);
1070 
1071     ParamCapture lengthParam("length", ParamType::TGLsizeiPointer);
1072     InitParamValue(ParamType::TGLsizeiPointer, length, &lengthParam.value);
1073     CaptureGetProgramInfoLog_length(glState, isCallValid, programPacked, bufSize, length, infoLog,
1074                                     &lengthParam);
1075     paramBuffer.addParam(std::move(lengthParam));
1076 
1077     ParamCapture infoLogParam("infoLog", ParamType::TGLcharPointer);
1078     InitParamValue(ParamType::TGLcharPointer, infoLog, &infoLogParam.value);
1079     CaptureGetProgramInfoLog_infoLog(glState, isCallValid, programPacked, bufSize, length, infoLog,
1080                                      &infoLogParam);
1081     paramBuffer.addParam(std::move(infoLogParam));
1082 
1083     return CallCapture(gl::EntryPoint::GetProgramInfoLog, std::move(paramBuffer));
1084 }
1085 
CaptureGetProgramiv(const State & glState,bool isCallValid,ShaderProgramID programPacked,GLenum pname,GLint * params)1086 CallCapture CaptureGetProgramiv(const State &glState,
1087                                 bool isCallValid,
1088                                 ShaderProgramID programPacked,
1089                                 GLenum pname,
1090                                 GLint *params)
1091 {
1092     ParamBuffer paramBuffer;
1093 
1094     paramBuffer.addValueParam("programPacked", ParamType::TShaderProgramID, programPacked);
1095     paramBuffer.addEnumParam("pname", GLenumGroup::ProgramPropertyARB, ParamType::TGLenum, pname);
1096 
1097     ParamCapture paramsParam("params", ParamType::TGLintPointer);
1098     InitParamValue(ParamType::TGLintPointer, params, &paramsParam.value);
1099     CaptureGetProgramiv_params(glState, isCallValid, programPacked, pname, params, &paramsParam);
1100     paramBuffer.addParam(std::move(paramsParam));
1101 
1102     return CallCapture(gl::EntryPoint::GetProgramiv, std::move(paramBuffer));
1103 }
1104 
CaptureGetRenderbufferParameteriv(const State & glState,bool isCallValid,GLenum target,GLenum pname,GLint * params)1105 CallCapture CaptureGetRenderbufferParameteriv(const State &glState,
1106                                               bool isCallValid,
1107                                               GLenum target,
1108                                               GLenum pname,
1109                                               GLint *params)
1110 {
1111     ParamBuffer paramBuffer;
1112 
1113     paramBuffer.addEnumParam("target", GLenumGroup::RenderbufferTarget, ParamType::TGLenum, target);
1114     paramBuffer.addEnumParam("pname", GLenumGroup::RenderbufferParameterName, ParamType::TGLenum,
1115                              pname);
1116 
1117     ParamCapture paramsParam("params", ParamType::TGLintPointer);
1118     InitParamValue(ParamType::TGLintPointer, params, &paramsParam.value);
1119     CaptureGetRenderbufferParameteriv_params(glState, isCallValid, target, pname, params,
1120                                              &paramsParam);
1121     paramBuffer.addParam(std::move(paramsParam));
1122 
1123     return CallCapture(gl::EntryPoint::GetRenderbufferParameteriv, std::move(paramBuffer));
1124 }
1125 
CaptureGetShaderInfoLog(const State & glState,bool isCallValid,ShaderProgramID shaderPacked,GLsizei bufSize,GLsizei * length,GLchar * infoLog)1126 CallCapture CaptureGetShaderInfoLog(const State &glState,
1127                                     bool isCallValid,
1128                                     ShaderProgramID shaderPacked,
1129                                     GLsizei bufSize,
1130                                     GLsizei *length,
1131                                     GLchar *infoLog)
1132 {
1133     ParamBuffer paramBuffer;
1134 
1135     paramBuffer.addValueParam("shaderPacked", ParamType::TShaderProgramID, shaderPacked);
1136     paramBuffer.addValueParam("bufSize", ParamType::TGLsizei, bufSize);
1137 
1138     ParamCapture lengthParam("length", ParamType::TGLsizeiPointer);
1139     InitParamValue(ParamType::TGLsizeiPointer, length, &lengthParam.value);
1140     CaptureGetShaderInfoLog_length(glState, isCallValid, shaderPacked, bufSize, length, infoLog,
1141                                    &lengthParam);
1142     paramBuffer.addParam(std::move(lengthParam));
1143 
1144     ParamCapture infoLogParam("infoLog", ParamType::TGLcharPointer);
1145     InitParamValue(ParamType::TGLcharPointer, infoLog, &infoLogParam.value);
1146     CaptureGetShaderInfoLog_infoLog(glState, isCallValid, shaderPacked, bufSize, length, infoLog,
1147                                     &infoLogParam);
1148     paramBuffer.addParam(std::move(infoLogParam));
1149 
1150     return CallCapture(gl::EntryPoint::GetShaderInfoLog, std::move(paramBuffer));
1151 }
1152 
CaptureGetShaderPrecisionFormat(const State & glState,bool isCallValid,GLenum shadertype,GLenum precisiontype,GLint * range,GLint * precision)1153 CallCapture CaptureGetShaderPrecisionFormat(const State &glState,
1154                                             bool isCallValid,
1155                                             GLenum shadertype,
1156                                             GLenum precisiontype,
1157                                             GLint *range,
1158                                             GLint *precision)
1159 {
1160     ParamBuffer paramBuffer;
1161 
1162     paramBuffer.addEnumParam("shadertype", GLenumGroup::ShaderType, ParamType::TGLenum, shadertype);
1163     paramBuffer.addEnumParam("precisiontype", GLenumGroup::PrecisionType, ParamType::TGLenum,
1164                              precisiontype);
1165 
1166     ParamCapture rangeParam("range", ParamType::TGLintPointer);
1167     InitParamValue(ParamType::TGLintPointer, range, &rangeParam.value);
1168     CaptureGetShaderPrecisionFormat_range(glState, isCallValid, shadertype, precisiontype, range,
1169                                           precision, &rangeParam);
1170     paramBuffer.addParam(std::move(rangeParam));
1171 
1172     ParamCapture precisionParam("precision", ParamType::TGLintPointer);
1173     InitParamValue(ParamType::TGLintPointer, precision, &precisionParam.value);
1174     CaptureGetShaderPrecisionFormat_precision(glState, isCallValid, shadertype, precisiontype,
1175                                               range, precision, &precisionParam);
1176     paramBuffer.addParam(std::move(precisionParam));
1177 
1178     return CallCapture(gl::EntryPoint::GetShaderPrecisionFormat, std::move(paramBuffer));
1179 }
1180 
CaptureGetShaderSource(const State & glState,bool isCallValid,ShaderProgramID shaderPacked,GLsizei bufSize,GLsizei * length,GLchar * source)1181 CallCapture CaptureGetShaderSource(const State &glState,
1182                                    bool isCallValid,
1183                                    ShaderProgramID shaderPacked,
1184                                    GLsizei bufSize,
1185                                    GLsizei *length,
1186                                    GLchar *source)
1187 {
1188     ParamBuffer paramBuffer;
1189 
1190     paramBuffer.addValueParam("shaderPacked", ParamType::TShaderProgramID, shaderPacked);
1191     paramBuffer.addValueParam("bufSize", ParamType::TGLsizei, bufSize);
1192 
1193     ParamCapture lengthParam("length", ParamType::TGLsizeiPointer);
1194     InitParamValue(ParamType::TGLsizeiPointer, length, &lengthParam.value);
1195     CaptureGetShaderSource_length(glState, isCallValid, shaderPacked, bufSize, length, source,
1196                                   &lengthParam);
1197     paramBuffer.addParam(std::move(lengthParam));
1198 
1199     ParamCapture sourceParam("source", ParamType::TGLcharPointer);
1200     InitParamValue(ParamType::TGLcharPointer, source, &sourceParam.value);
1201     CaptureGetShaderSource_source(glState, isCallValid, shaderPacked, bufSize, length, source,
1202                                   &sourceParam);
1203     paramBuffer.addParam(std::move(sourceParam));
1204 
1205     return CallCapture(gl::EntryPoint::GetShaderSource, std::move(paramBuffer));
1206 }
1207 
CaptureGetShaderiv(const State & glState,bool isCallValid,ShaderProgramID shaderPacked,GLenum pname,GLint * params)1208 CallCapture CaptureGetShaderiv(const State &glState,
1209                                bool isCallValid,
1210                                ShaderProgramID shaderPacked,
1211                                GLenum pname,
1212                                GLint *params)
1213 {
1214     ParamBuffer paramBuffer;
1215 
1216     paramBuffer.addValueParam("shaderPacked", ParamType::TShaderProgramID, shaderPacked);
1217     paramBuffer.addEnumParam("pname", GLenumGroup::ShaderParameterName, ParamType::TGLenum, pname);
1218 
1219     ParamCapture paramsParam("params", ParamType::TGLintPointer);
1220     InitParamValue(ParamType::TGLintPointer, params, &paramsParam.value);
1221     CaptureGetShaderiv_params(glState, isCallValid, shaderPacked, pname, params, &paramsParam);
1222     paramBuffer.addParam(std::move(paramsParam));
1223 
1224     return CallCapture(gl::EntryPoint::GetShaderiv, std::move(paramBuffer));
1225 }
1226 
CaptureGetString(const State & glState,bool isCallValid,GLenum name,const GLubyte * returnValue)1227 CallCapture CaptureGetString(const State &glState,
1228                              bool isCallValid,
1229                              GLenum name,
1230                              const GLubyte *returnValue)
1231 {
1232     ParamBuffer paramBuffer;
1233 
1234     paramBuffer.addEnumParam("name", GLenumGroup::StringName, ParamType::TGLenum, name);
1235 
1236     ParamCapture returnValueCapture("returnValue", ParamType::TGLubyteConstPointer);
1237     InitParamValue(ParamType::TGLubyteConstPointer, returnValue, &returnValueCapture.value);
1238     paramBuffer.addReturnValue(std::move(returnValueCapture));
1239 
1240     return CallCapture(gl::EntryPoint::GetString, std::move(paramBuffer));
1241 }
1242 
CaptureGetTexParameterfv(const State & glState,bool isCallValid,TextureType targetPacked,GLenum pname,GLfloat * params)1243 CallCapture CaptureGetTexParameterfv(const State &glState,
1244                                      bool isCallValid,
1245                                      TextureType targetPacked,
1246                                      GLenum pname,
1247                                      GLfloat *params)
1248 {
1249     ParamBuffer paramBuffer;
1250 
1251     paramBuffer.addValueParam("targetPacked", ParamType::TTextureType, targetPacked);
1252     paramBuffer.addEnumParam("pname", GLenumGroup::GetTextureParameter, ParamType::TGLenum, pname);
1253 
1254     ParamCapture paramsParam("params", ParamType::TGLfloatPointer);
1255     InitParamValue(ParamType::TGLfloatPointer, params, &paramsParam.value);
1256     CaptureGetTexParameterfv_params(glState, isCallValid, targetPacked, pname, params,
1257                                     &paramsParam);
1258     paramBuffer.addParam(std::move(paramsParam));
1259 
1260     return CallCapture(gl::EntryPoint::GetTexParameterfv, std::move(paramBuffer));
1261 }
1262 
CaptureGetTexParameteriv(const State & glState,bool isCallValid,TextureType targetPacked,GLenum pname,GLint * params)1263 CallCapture CaptureGetTexParameteriv(const State &glState,
1264                                      bool isCallValid,
1265                                      TextureType targetPacked,
1266                                      GLenum pname,
1267                                      GLint *params)
1268 {
1269     ParamBuffer paramBuffer;
1270 
1271     paramBuffer.addValueParam("targetPacked", ParamType::TTextureType, targetPacked);
1272     paramBuffer.addEnumParam("pname", GLenumGroup::GetTextureParameter, ParamType::TGLenum, pname);
1273 
1274     ParamCapture paramsParam("params", ParamType::TGLintPointer);
1275     InitParamValue(ParamType::TGLintPointer, params, &paramsParam.value);
1276     CaptureGetTexParameteriv_params(glState, isCallValid, targetPacked, pname, params,
1277                                     &paramsParam);
1278     paramBuffer.addParam(std::move(paramsParam));
1279 
1280     return CallCapture(gl::EntryPoint::GetTexParameteriv, std::move(paramBuffer));
1281 }
1282 
CaptureGetUniformLocation(const State & glState,bool isCallValid,ShaderProgramID programPacked,const GLchar * name,GLint returnValue)1283 CallCapture CaptureGetUniformLocation(const State &glState,
1284                                       bool isCallValid,
1285                                       ShaderProgramID programPacked,
1286                                       const GLchar *name,
1287                                       GLint returnValue)
1288 {
1289     ParamBuffer paramBuffer;
1290 
1291     paramBuffer.addValueParam("programPacked", ParamType::TShaderProgramID, programPacked);
1292 
1293     ParamCapture nameParam("name", ParamType::TGLcharConstPointer);
1294     InitParamValue(ParamType::TGLcharConstPointer, name, &nameParam.value);
1295     CaptureGetUniformLocation_name(glState, isCallValid, programPacked, name, &nameParam);
1296     paramBuffer.addParam(std::move(nameParam));
1297 
1298     ParamCapture returnValueCapture("returnValue", ParamType::TGLint);
1299     InitParamValue(ParamType::TGLint, returnValue, &returnValueCapture.value);
1300     paramBuffer.addReturnValue(std::move(returnValueCapture));
1301 
1302     return CallCapture(gl::EntryPoint::GetUniformLocation, std::move(paramBuffer));
1303 }
1304 
CaptureGetUniformfv(const State & glState,bool isCallValid,ShaderProgramID programPacked,UniformLocation locationPacked,GLfloat * params)1305 CallCapture CaptureGetUniformfv(const State &glState,
1306                                 bool isCallValid,
1307                                 ShaderProgramID programPacked,
1308                                 UniformLocation locationPacked,
1309                                 GLfloat *params)
1310 {
1311     ParamBuffer paramBuffer;
1312 
1313     paramBuffer.addValueParam("programPacked", ParamType::TShaderProgramID, programPacked);
1314     paramBuffer.addValueParam("locationPacked", ParamType::TUniformLocation, locationPacked);
1315 
1316     ParamCapture paramsParam("params", ParamType::TGLfloatPointer);
1317     InitParamValue(ParamType::TGLfloatPointer, params, &paramsParam.value);
1318     CaptureGetUniformfv_params(glState, isCallValid, programPacked, locationPacked, params,
1319                                &paramsParam);
1320     paramBuffer.addParam(std::move(paramsParam));
1321 
1322     return CallCapture(gl::EntryPoint::GetUniformfv, std::move(paramBuffer));
1323 }
1324 
CaptureGetUniformiv(const State & glState,bool isCallValid,ShaderProgramID programPacked,UniformLocation locationPacked,GLint * params)1325 CallCapture CaptureGetUniformiv(const State &glState,
1326                                 bool isCallValid,
1327                                 ShaderProgramID programPacked,
1328                                 UniformLocation locationPacked,
1329                                 GLint *params)
1330 {
1331     ParamBuffer paramBuffer;
1332 
1333     paramBuffer.addValueParam("programPacked", ParamType::TShaderProgramID, programPacked);
1334     paramBuffer.addValueParam("locationPacked", ParamType::TUniformLocation, locationPacked);
1335 
1336     ParamCapture paramsParam("params", ParamType::TGLintPointer);
1337     InitParamValue(ParamType::TGLintPointer, params, &paramsParam.value);
1338     CaptureGetUniformiv_params(glState, isCallValid, programPacked, locationPacked, params,
1339                                &paramsParam);
1340     paramBuffer.addParam(std::move(paramsParam));
1341 
1342     return CallCapture(gl::EntryPoint::GetUniformiv, std::move(paramBuffer));
1343 }
1344 
CaptureGetVertexAttribPointerv(const State & glState,bool isCallValid,GLuint index,GLenum pname,void ** pointer)1345 CallCapture CaptureGetVertexAttribPointerv(const State &glState,
1346                                            bool isCallValid,
1347                                            GLuint index,
1348                                            GLenum pname,
1349                                            void **pointer)
1350 {
1351     ParamBuffer paramBuffer;
1352 
1353     paramBuffer.addValueParam("index", ParamType::TGLuint, index);
1354     paramBuffer.addEnumParam("pname", GLenumGroup::DefaultGroup, ParamType::TGLenum, pname);
1355 
1356     ParamCapture pointerParam("pointer", ParamType::TvoidPointerPointer);
1357     InitParamValue(ParamType::TvoidPointerPointer, pointer, &pointerParam.value);
1358     CaptureGetVertexAttribPointerv_pointer(glState, isCallValid, index, pname, pointer,
1359                                            &pointerParam);
1360     paramBuffer.addParam(std::move(pointerParam));
1361 
1362     return CallCapture(gl::EntryPoint::GetVertexAttribPointerv, std::move(paramBuffer));
1363 }
1364 
CaptureGetVertexAttribfv(const State & glState,bool isCallValid,GLuint index,GLenum pname,GLfloat * params)1365 CallCapture CaptureGetVertexAttribfv(const State &glState,
1366                                      bool isCallValid,
1367                                      GLuint index,
1368                                      GLenum pname,
1369                                      GLfloat *params)
1370 {
1371     ParamBuffer paramBuffer;
1372 
1373     paramBuffer.addValueParam("index", ParamType::TGLuint, index);
1374     paramBuffer.addEnumParam("pname", GLenumGroup::DefaultGroup, ParamType::TGLenum, pname);
1375 
1376     ParamCapture paramsParam("params", ParamType::TGLfloatPointer);
1377     InitParamValue(ParamType::TGLfloatPointer, params, &paramsParam.value);
1378     CaptureGetVertexAttribfv_params(glState, isCallValid, index, pname, params, &paramsParam);
1379     paramBuffer.addParam(std::move(paramsParam));
1380 
1381     return CallCapture(gl::EntryPoint::GetVertexAttribfv, std::move(paramBuffer));
1382 }
1383 
CaptureGetVertexAttribiv(const State & glState,bool isCallValid,GLuint index,GLenum pname,GLint * params)1384 CallCapture CaptureGetVertexAttribiv(const State &glState,
1385                                      bool isCallValid,
1386                                      GLuint index,
1387                                      GLenum pname,
1388                                      GLint *params)
1389 {
1390     ParamBuffer paramBuffer;
1391 
1392     paramBuffer.addValueParam("index", ParamType::TGLuint, index);
1393     paramBuffer.addEnumParam("pname", GLenumGroup::DefaultGroup, ParamType::TGLenum, pname);
1394 
1395     ParamCapture paramsParam("params", ParamType::TGLintPointer);
1396     InitParamValue(ParamType::TGLintPointer, params, &paramsParam.value);
1397     CaptureGetVertexAttribiv_params(glState, isCallValid, index, pname, params, &paramsParam);
1398     paramBuffer.addParam(std::move(paramsParam));
1399 
1400     return CallCapture(gl::EntryPoint::GetVertexAttribiv, std::move(paramBuffer));
1401 }
1402 
CaptureHint(const State & glState,bool isCallValid,GLenum target,GLenum mode)1403 CallCapture CaptureHint(const State &glState, bool isCallValid, GLenum target, GLenum mode)
1404 {
1405     ParamBuffer paramBuffer;
1406 
1407     paramBuffer.addEnumParam("target", GLenumGroup::HintTarget, ParamType::TGLenum, target);
1408     paramBuffer.addEnumParam("mode", GLenumGroup::HintMode, ParamType::TGLenum, mode);
1409 
1410     return CallCapture(gl::EntryPoint::Hint, std::move(paramBuffer));
1411 }
1412 
CaptureIsBuffer(const State & glState,bool isCallValid,BufferID bufferPacked,GLboolean returnValue)1413 CallCapture CaptureIsBuffer(const State &glState,
1414                             bool isCallValid,
1415                             BufferID bufferPacked,
1416                             GLboolean returnValue)
1417 {
1418     ParamBuffer paramBuffer;
1419 
1420     paramBuffer.addValueParam("bufferPacked", ParamType::TBufferID, bufferPacked);
1421 
1422     ParamCapture returnValueCapture("returnValue", ParamType::TGLboolean);
1423     InitParamValue(ParamType::TGLboolean, returnValue, &returnValueCapture.value);
1424     paramBuffer.addReturnValue(std::move(returnValueCapture));
1425 
1426     return CallCapture(gl::EntryPoint::IsBuffer, std::move(paramBuffer));
1427 }
1428 
CaptureIsEnabled(const State & glState,bool isCallValid,GLenum cap,GLboolean returnValue)1429 CallCapture CaptureIsEnabled(const State &glState,
1430                              bool isCallValid,
1431                              GLenum cap,
1432                              GLboolean returnValue)
1433 {
1434     ParamBuffer paramBuffer;
1435 
1436     paramBuffer.addEnumParam("cap", GLenumGroup::EnableCap, ParamType::TGLenum, cap);
1437 
1438     ParamCapture returnValueCapture("returnValue", ParamType::TGLboolean);
1439     InitParamValue(ParamType::TGLboolean, returnValue, &returnValueCapture.value);
1440     paramBuffer.addReturnValue(std::move(returnValueCapture));
1441 
1442     return CallCapture(gl::EntryPoint::IsEnabled, std::move(paramBuffer));
1443 }
1444 
CaptureIsFramebuffer(const State & glState,bool isCallValid,FramebufferID framebufferPacked,GLboolean returnValue)1445 CallCapture CaptureIsFramebuffer(const State &glState,
1446                                  bool isCallValid,
1447                                  FramebufferID framebufferPacked,
1448                                  GLboolean returnValue)
1449 {
1450     ParamBuffer paramBuffer;
1451 
1452     paramBuffer.addValueParam("framebufferPacked", ParamType::TFramebufferID, framebufferPacked);
1453 
1454     ParamCapture returnValueCapture("returnValue", ParamType::TGLboolean);
1455     InitParamValue(ParamType::TGLboolean, returnValue, &returnValueCapture.value);
1456     paramBuffer.addReturnValue(std::move(returnValueCapture));
1457 
1458     return CallCapture(gl::EntryPoint::IsFramebuffer, std::move(paramBuffer));
1459 }
1460 
CaptureIsProgram(const State & glState,bool isCallValid,ShaderProgramID programPacked,GLboolean returnValue)1461 CallCapture CaptureIsProgram(const State &glState,
1462                              bool isCallValid,
1463                              ShaderProgramID programPacked,
1464                              GLboolean returnValue)
1465 {
1466     ParamBuffer paramBuffer;
1467 
1468     paramBuffer.addValueParam("programPacked", ParamType::TShaderProgramID, programPacked);
1469 
1470     ParamCapture returnValueCapture("returnValue", ParamType::TGLboolean);
1471     InitParamValue(ParamType::TGLboolean, returnValue, &returnValueCapture.value);
1472     paramBuffer.addReturnValue(std::move(returnValueCapture));
1473 
1474     return CallCapture(gl::EntryPoint::IsProgram, std::move(paramBuffer));
1475 }
1476 
CaptureIsRenderbuffer(const State & glState,bool isCallValid,RenderbufferID renderbufferPacked,GLboolean returnValue)1477 CallCapture CaptureIsRenderbuffer(const State &glState,
1478                                   bool isCallValid,
1479                                   RenderbufferID renderbufferPacked,
1480                                   GLboolean returnValue)
1481 {
1482     ParamBuffer paramBuffer;
1483 
1484     paramBuffer.addValueParam("renderbufferPacked", ParamType::TRenderbufferID, renderbufferPacked);
1485 
1486     ParamCapture returnValueCapture("returnValue", ParamType::TGLboolean);
1487     InitParamValue(ParamType::TGLboolean, returnValue, &returnValueCapture.value);
1488     paramBuffer.addReturnValue(std::move(returnValueCapture));
1489 
1490     return CallCapture(gl::EntryPoint::IsRenderbuffer, std::move(paramBuffer));
1491 }
1492 
CaptureIsShader(const State & glState,bool isCallValid,ShaderProgramID shaderPacked,GLboolean returnValue)1493 CallCapture CaptureIsShader(const State &glState,
1494                             bool isCallValid,
1495                             ShaderProgramID shaderPacked,
1496                             GLboolean returnValue)
1497 {
1498     ParamBuffer paramBuffer;
1499 
1500     paramBuffer.addValueParam("shaderPacked", ParamType::TShaderProgramID, shaderPacked);
1501 
1502     ParamCapture returnValueCapture("returnValue", ParamType::TGLboolean);
1503     InitParamValue(ParamType::TGLboolean, returnValue, &returnValueCapture.value);
1504     paramBuffer.addReturnValue(std::move(returnValueCapture));
1505 
1506     return CallCapture(gl::EntryPoint::IsShader, std::move(paramBuffer));
1507 }
1508 
CaptureIsTexture(const State & glState,bool isCallValid,TextureID texturePacked,GLboolean returnValue)1509 CallCapture CaptureIsTexture(const State &glState,
1510                              bool isCallValid,
1511                              TextureID texturePacked,
1512                              GLboolean returnValue)
1513 {
1514     ParamBuffer paramBuffer;
1515 
1516     paramBuffer.addValueParam("texturePacked", ParamType::TTextureID, texturePacked);
1517 
1518     ParamCapture returnValueCapture("returnValue", ParamType::TGLboolean);
1519     InitParamValue(ParamType::TGLboolean, returnValue, &returnValueCapture.value);
1520     paramBuffer.addReturnValue(std::move(returnValueCapture));
1521 
1522     return CallCapture(gl::EntryPoint::IsTexture, std::move(paramBuffer));
1523 }
1524 
CaptureLineWidth(const State & glState,bool isCallValid,GLfloat width)1525 CallCapture CaptureLineWidth(const State &glState, bool isCallValid, GLfloat width)
1526 {
1527     ParamBuffer paramBuffer;
1528 
1529     paramBuffer.addValueParam("width", ParamType::TGLfloat, width);
1530 
1531     return CallCapture(gl::EntryPoint::LineWidth, std::move(paramBuffer));
1532 }
1533 
CaptureLinkProgram(const State & glState,bool isCallValid,ShaderProgramID programPacked)1534 CallCapture CaptureLinkProgram(const State &glState,
1535                                bool isCallValid,
1536                                ShaderProgramID programPacked)
1537 {
1538     ParamBuffer paramBuffer;
1539 
1540     paramBuffer.addValueParam("programPacked", ParamType::TShaderProgramID, programPacked);
1541 
1542     return CallCapture(gl::EntryPoint::LinkProgram, std::move(paramBuffer));
1543 }
1544 
CapturePixelStorei(const State & glState,bool isCallValid,GLenum pname,GLint param)1545 CallCapture CapturePixelStorei(const State &glState, bool isCallValid, GLenum pname, GLint param)
1546 {
1547     ParamBuffer paramBuffer;
1548 
1549     paramBuffer.addEnumParam("pname", GLenumGroup::PixelStoreParameter, ParamType::TGLenum, pname);
1550     paramBuffer.addValueParam("param", ParamType::TGLint, param);
1551 
1552     return CallCapture(gl::EntryPoint::PixelStorei, std::move(paramBuffer));
1553 }
1554 
CapturePolygonOffset(const State & glState,bool isCallValid,GLfloat factor,GLfloat units)1555 CallCapture CapturePolygonOffset(const State &glState,
1556                                  bool isCallValid,
1557                                  GLfloat factor,
1558                                  GLfloat units)
1559 {
1560     ParamBuffer paramBuffer;
1561 
1562     paramBuffer.addValueParam("factor", ParamType::TGLfloat, factor);
1563     paramBuffer.addValueParam("units", ParamType::TGLfloat, units);
1564 
1565     return CallCapture(gl::EntryPoint::PolygonOffset, std::move(paramBuffer));
1566 }
1567 
CaptureReadPixels(const State & glState,bool isCallValid,GLint x,GLint y,GLsizei width,GLsizei height,GLenum format,GLenum type,void * pixels)1568 CallCapture CaptureReadPixels(const State &glState,
1569                               bool isCallValid,
1570                               GLint x,
1571                               GLint y,
1572                               GLsizei width,
1573                               GLsizei height,
1574                               GLenum format,
1575                               GLenum type,
1576                               void *pixels)
1577 {
1578     ParamBuffer paramBuffer;
1579 
1580     paramBuffer.addValueParam("x", ParamType::TGLint, x);
1581     paramBuffer.addValueParam("y", ParamType::TGLint, y);
1582     paramBuffer.addValueParam("width", ParamType::TGLsizei, width);
1583     paramBuffer.addValueParam("height", ParamType::TGLsizei, height);
1584     paramBuffer.addEnumParam("format", GLenumGroup::PixelFormat, ParamType::TGLenum, format);
1585     paramBuffer.addEnumParam("type", GLenumGroup::PixelType, ParamType::TGLenum, type);
1586 
1587     ParamCapture pixelsParam("pixels", ParamType::TvoidPointer);
1588     InitParamValue(ParamType::TvoidPointer, pixels, &pixelsParam.value);
1589     CaptureReadPixels_pixels(glState, isCallValid, x, y, width, height, format, type, pixels,
1590                              &pixelsParam);
1591     paramBuffer.addParam(std::move(pixelsParam));
1592 
1593     return CallCapture(gl::EntryPoint::ReadPixels, std::move(paramBuffer));
1594 }
1595 
CaptureReleaseShaderCompiler(const State & glState,bool isCallValid)1596 CallCapture CaptureReleaseShaderCompiler(const State &glState, bool isCallValid)
1597 {
1598     ParamBuffer paramBuffer;
1599 
1600     return CallCapture(gl::EntryPoint::ReleaseShaderCompiler, std::move(paramBuffer));
1601 }
1602 
CaptureRenderbufferStorage(const State & glState,bool isCallValid,GLenum target,GLenum internalformat,GLsizei width,GLsizei height)1603 CallCapture CaptureRenderbufferStorage(const State &glState,
1604                                        bool isCallValid,
1605                                        GLenum target,
1606                                        GLenum internalformat,
1607                                        GLsizei width,
1608                                        GLsizei height)
1609 {
1610     ParamBuffer paramBuffer;
1611 
1612     paramBuffer.addEnumParam("target", GLenumGroup::RenderbufferTarget, ParamType::TGLenum, target);
1613     paramBuffer.addEnumParam("internalformat", GLenumGroup::InternalFormat, ParamType::TGLenum,
1614                              internalformat);
1615     paramBuffer.addValueParam("width", ParamType::TGLsizei, width);
1616     paramBuffer.addValueParam("height", ParamType::TGLsizei, height);
1617 
1618     return CallCapture(gl::EntryPoint::RenderbufferStorage, std::move(paramBuffer));
1619 }
1620 
CaptureSampleCoverage(const State & glState,bool isCallValid,GLfloat value,GLboolean invert)1621 CallCapture CaptureSampleCoverage(const State &glState,
1622                                   bool isCallValid,
1623                                   GLfloat value,
1624                                   GLboolean invert)
1625 {
1626     ParamBuffer paramBuffer;
1627 
1628     paramBuffer.addValueParam("value", ParamType::TGLfloat, value);
1629     paramBuffer.addValueParam("invert", ParamType::TGLboolean, invert);
1630 
1631     return CallCapture(gl::EntryPoint::SampleCoverage, std::move(paramBuffer));
1632 }
1633 
CaptureScissor(const State & glState,bool isCallValid,GLint x,GLint y,GLsizei width,GLsizei height)1634 CallCapture CaptureScissor(const State &glState,
1635                            bool isCallValid,
1636                            GLint x,
1637                            GLint y,
1638                            GLsizei width,
1639                            GLsizei height)
1640 {
1641     ParamBuffer paramBuffer;
1642 
1643     paramBuffer.addValueParam("x", ParamType::TGLint, x);
1644     paramBuffer.addValueParam("y", ParamType::TGLint, y);
1645     paramBuffer.addValueParam("width", ParamType::TGLsizei, width);
1646     paramBuffer.addValueParam("height", ParamType::TGLsizei, height);
1647 
1648     return CallCapture(gl::EntryPoint::Scissor, std::move(paramBuffer));
1649 }
1650 
CaptureShaderBinary(const State & glState,bool isCallValid,GLsizei count,const ShaderProgramID * shadersPacked,GLenum binaryformat,const void * binary,GLsizei length)1651 CallCapture CaptureShaderBinary(const State &glState,
1652                                 bool isCallValid,
1653                                 GLsizei count,
1654                                 const ShaderProgramID *shadersPacked,
1655                                 GLenum binaryformat,
1656                                 const void *binary,
1657                                 GLsizei length)
1658 {
1659     ParamBuffer paramBuffer;
1660 
1661     paramBuffer.addValueParam("count", ParamType::TGLsizei, count);
1662 
1663     ParamCapture shadersPackedParam("shadersPacked", ParamType::TShaderProgramIDConstPointer);
1664     InitParamValue(ParamType::TShaderProgramIDConstPointer, shadersPacked,
1665                    &shadersPackedParam.value);
1666     CaptureShaderBinary_shadersPacked(glState, isCallValid, count, shadersPacked, binaryformat,
1667                                       binary, length, &shadersPackedParam);
1668     paramBuffer.addParam(std::move(shadersPackedParam));
1669 
1670     paramBuffer.addEnumParam("binaryformat", GLenumGroup::DefaultGroup, ParamType::TGLenum,
1671                              binaryformat);
1672 
1673     ParamCapture binaryParam("binary", ParamType::TvoidConstPointer);
1674     InitParamValue(ParamType::TvoidConstPointer, binary, &binaryParam.value);
1675     CaptureShaderBinary_binary(glState, isCallValid, count, shadersPacked, binaryformat, binary,
1676                                length, &binaryParam);
1677     paramBuffer.addParam(std::move(binaryParam));
1678 
1679     paramBuffer.addValueParam("length", ParamType::TGLsizei, length);
1680 
1681     return CallCapture(gl::EntryPoint::ShaderBinary, std::move(paramBuffer));
1682 }
1683 
CaptureShaderSource(const State & glState,bool isCallValid,ShaderProgramID shaderPacked,GLsizei count,const GLchar * const * string,const GLint * length)1684 CallCapture CaptureShaderSource(const State &glState,
1685                                 bool isCallValid,
1686                                 ShaderProgramID shaderPacked,
1687                                 GLsizei count,
1688                                 const GLchar *const *string,
1689                                 const GLint *length)
1690 {
1691     ParamBuffer paramBuffer;
1692 
1693     paramBuffer.addValueParam("shaderPacked", ParamType::TShaderProgramID, shaderPacked);
1694     paramBuffer.addValueParam("count", ParamType::TGLsizei, count);
1695 
1696     ParamCapture stringParam("string", ParamType::TGLcharConstPointerPointer);
1697     InitParamValue(ParamType::TGLcharConstPointerPointer, string, &stringParam.value);
1698     CaptureShaderSource_string(glState, isCallValid, shaderPacked, count, string, length,
1699                                &stringParam);
1700     paramBuffer.addParam(std::move(stringParam));
1701 
1702     ParamCapture lengthParam("length", ParamType::TGLintConstPointer);
1703     InitParamValue(ParamType::TGLintConstPointer, length, &lengthParam.value);
1704     CaptureShaderSource_length(glState, isCallValid, shaderPacked, count, string, length,
1705                                &lengthParam);
1706     paramBuffer.addParam(std::move(lengthParam));
1707 
1708     return CallCapture(gl::EntryPoint::ShaderSource, std::move(paramBuffer));
1709 }
1710 
CaptureStencilFunc(const State & glState,bool isCallValid,GLenum func,GLint ref,GLuint mask)1711 CallCapture CaptureStencilFunc(const State &glState,
1712                                bool isCallValid,
1713                                GLenum func,
1714                                GLint ref,
1715                                GLuint mask)
1716 {
1717     ParamBuffer paramBuffer;
1718 
1719     paramBuffer.addEnumParam("func", GLenumGroup::StencilFunction, ParamType::TGLenum, func);
1720     paramBuffer.addValueParam("ref", ParamType::TGLint, ref);
1721     paramBuffer.addValueParam("mask", ParamType::TGLuint, mask);
1722 
1723     return CallCapture(gl::EntryPoint::StencilFunc, std::move(paramBuffer));
1724 }
1725 
CaptureStencilFuncSeparate(const State & glState,bool isCallValid,GLenum face,GLenum func,GLint ref,GLuint mask)1726 CallCapture CaptureStencilFuncSeparate(const State &glState,
1727                                        bool isCallValid,
1728                                        GLenum face,
1729                                        GLenum func,
1730                                        GLint ref,
1731                                        GLuint mask)
1732 {
1733     ParamBuffer paramBuffer;
1734 
1735     paramBuffer.addEnumParam("face", GLenumGroup::StencilFaceDirection, ParamType::TGLenum, face);
1736     paramBuffer.addEnumParam("func", GLenumGroup::StencilFunction, ParamType::TGLenum, func);
1737     paramBuffer.addValueParam("ref", ParamType::TGLint, ref);
1738     paramBuffer.addValueParam("mask", ParamType::TGLuint, mask);
1739 
1740     return CallCapture(gl::EntryPoint::StencilFuncSeparate, std::move(paramBuffer));
1741 }
1742 
CaptureStencilMask(const State & glState,bool isCallValid,GLuint mask)1743 CallCapture CaptureStencilMask(const State &glState, bool isCallValid, GLuint mask)
1744 {
1745     ParamBuffer paramBuffer;
1746 
1747     paramBuffer.addValueParam("mask", ParamType::TGLuint, mask);
1748 
1749     return CallCapture(gl::EntryPoint::StencilMask, std::move(paramBuffer));
1750 }
1751 
CaptureStencilMaskSeparate(const State & glState,bool isCallValid,GLenum face,GLuint mask)1752 CallCapture CaptureStencilMaskSeparate(const State &glState,
1753                                        bool isCallValid,
1754                                        GLenum face,
1755                                        GLuint mask)
1756 {
1757     ParamBuffer paramBuffer;
1758 
1759     paramBuffer.addEnumParam("face", GLenumGroup::StencilFaceDirection, ParamType::TGLenum, face);
1760     paramBuffer.addValueParam("mask", ParamType::TGLuint, mask);
1761 
1762     return CallCapture(gl::EntryPoint::StencilMaskSeparate, std::move(paramBuffer));
1763 }
1764 
CaptureStencilOp(const State & glState,bool isCallValid,GLenum fail,GLenum zfail,GLenum zpass)1765 CallCapture CaptureStencilOp(const State &glState,
1766                              bool isCallValid,
1767                              GLenum fail,
1768                              GLenum zfail,
1769                              GLenum zpass)
1770 {
1771     ParamBuffer paramBuffer;
1772 
1773     paramBuffer.addEnumParam("fail", GLenumGroup::StencilOp, ParamType::TGLenum, fail);
1774     paramBuffer.addEnumParam("zfail", GLenumGroup::StencilOp, ParamType::TGLenum, zfail);
1775     paramBuffer.addEnumParam("zpass", GLenumGroup::StencilOp, ParamType::TGLenum, zpass);
1776 
1777     return CallCapture(gl::EntryPoint::StencilOp, std::move(paramBuffer));
1778 }
1779 
CaptureStencilOpSeparate(const State & glState,bool isCallValid,GLenum face,GLenum sfail,GLenum dpfail,GLenum dppass)1780 CallCapture CaptureStencilOpSeparate(const State &glState,
1781                                      bool isCallValid,
1782                                      GLenum face,
1783                                      GLenum sfail,
1784                                      GLenum dpfail,
1785                                      GLenum dppass)
1786 {
1787     ParamBuffer paramBuffer;
1788 
1789     paramBuffer.addEnumParam("face", GLenumGroup::StencilFaceDirection, ParamType::TGLenum, face);
1790     paramBuffer.addEnumParam("sfail", GLenumGroup::StencilOp, ParamType::TGLenum, sfail);
1791     paramBuffer.addEnumParam("dpfail", GLenumGroup::StencilOp, ParamType::TGLenum, dpfail);
1792     paramBuffer.addEnumParam("dppass", GLenumGroup::StencilOp, ParamType::TGLenum, dppass);
1793 
1794     return CallCapture(gl::EntryPoint::StencilOpSeparate, std::move(paramBuffer));
1795 }
1796 
CaptureTexImage2D(const State & glState,bool isCallValid,TextureTarget targetPacked,GLint level,GLint internalformat,GLsizei width,GLsizei height,GLint border,GLenum format,GLenum type,const void * pixels)1797 CallCapture CaptureTexImage2D(const State &glState,
1798                               bool isCallValid,
1799                               TextureTarget targetPacked,
1800                               GLint level,
1801                               GLint internalformat,
1802                               GLsizei width,
1803                               GLsizei height,
1804                               GLint border,
1805                               GLenum format,
1806                               GLenum type,
1807                               const void *pixels)
1808 {
1809     ParamBuffer paramBuffer;
1810 
1811     paramBuffer.addValueParam("targetPacked", ParamType::TTextureTarget, targetPacked);
1812     paramBuffer.addValueParam("level", ParamType::TGLint, level);
1813     paramBuffer.addValueParam("internalformat", ParamType::TGLint, internalformat);
1814     paramBuffer.addValueParam("width", ParamType::TGLsizei, width);
1815     paramBuffer.addValueParam("height", ParamType::TGLsizei, height);
1816     paramBuffer.addValueParam("border", ParamType::TGLint, border);
1817     paramBuffer.addEnumParam("format", GLenumGroup::PixelFormat, ParamType::TGLenum, format);
1818     paramBuffer.addEnumParam("type", GLenumGroup::PixelType, ParamType::TGLenum, type);
1819 
1820     ParamCapture pixelsParam("pixels", ParamType::TvoidConstPointer);
1821     InitParamValue(ParamType::TvoidConstPointer, pixels, &pixelsParam.value);
1822     CaptureTexImage2D_pixels(glState, isCallValid, targetPacked, level, internalformat, width,
1823                              height, border, format, type, pixels, &pixelsParam);
1824     paramBuffer.addParam(std::move(pixelsParam));
1825 
1826     return CallCapture(gl::EntryPoint::TexImage2D, std::move(paramBuffer));
1827 }
1828 
CaptureTexParameterf(const State & glState,bool isCallValid,TextureType targetPacked,GLenum pname,GLfloat param)1829 CallCapture CaptureTexParameterf(const State &glState,
1830                                  bool isCallValid,
1831                                  TextureType targetPacked,
1832                                  GLenum pname,
1833                                  GLfloat param)
1834 {
1835     ParamBuffer paramBuffer;
1836 
1837     paramBuffer.addValueParam("targetPacked", ParamType::TTextureType, targetPacked);
1838     paramBuffer.addEnumParam("pname", GLenumGroup::TextureParameterName, ParamType::TGLenum, pname);
1839     paramBuffer.addValueParam("param", ParamType::TGLfloat, param);
1840 
1841     return CallCapture(gl::EntryPoint::TexParameterf, std::move(paramBuffer));
1842 }
1843 
CaptureTexParameterfv(const State & glState,bool isCallValid,TextureType targetPacked,GLenum pname,const GLfloat * params)1844 CallCapture CaptureTexParameterfv(const State &glState,
1845                                   bool isCallValid,
1846                                   TextureType targetPacked,
1847                                   GLenum pname,
1848                                   const GLfloat *params)
1849 {
1850     ParamBuffer paramBuffer;
1851 
1852     paramBuffer.addValueParam("targetPacked", ParamType::TTextureType, targetPacked);
1853     paramBuffer.addEnumParam("pname", GLenumGroup::TextureParameterName, ParamType::TGLenum, pname);
1854 
1855     ParamCapture paramsParam("params", ParamType::TGLfloatConstPointer);
1856     InitParamValue(ParamType::TGLfloatConstPointer, params, &paramsParam.value);
1857     CaptureTexParameterfv_params(glState, isCallValid, targetPacked, pname, params, &paramsParam);
1858     paramBuffer.addParam(std::move(paramsParam));
1859 
1860     return CallCapture(gl::EntryPoint::TexParameterfv, std::move(paramBuffer));
1861 }
1862 
CaptureTexParameteri(const State & glState,bool isCallValid,TextureType targetPacked,GLenum pname,GLint param)1863 CallCapture CaptureTexParameteri(const State &glState,
1864                                  bool isCallValid,
1865                                  TextureType targetPacked,
1866                                  GLenum pname,
1867                                  GLint param)
1868 {
1869     ParamBuffer paramBuffer;
1870 
1871     paramBuffer.addValueParam("targetPacked", ParamType::TTextureType, targetPacked);
1872     paramBuffer.addEnumParam("pname", GLenumGroup::TextureParameterName, ParamType::TGLenum, pname);
1873     paramBuffer.addValueParam("param", ParamType::TGLint, param);
1874 
1875     return CallCapture(gl::EntryPoint::TexParameteri, std::move(paramBuffer));
1876 }
1877 
CaptureTexParameteriv(const State & glState,bool isCallValid,TextureType targetPacked,GLenum pname,const GLint * params)1878 CallCapture CaptureTexParameteriv(const State &glState,
1879                                   bool isCallValid,
1880                                   TextureType targetPacked,
1881                                   GLenum pname,
1882                                   const GLint *params)
1883 {
1884     ParamBuffer paramBuffer;
1885 
1886     paramBuffer.addValueParam("targetPacked", ParamType::TTextureType, targetPacked);
1887     paramBuffer.addEnumParam("pname", GLenumGroup::TextureParameterName, ParamType::TGLenum, pname);
1888 
1889     ParamCapture paramsParam("params", ParamType::TGLintConstPointer);
1890     InitParamValue(ParamType::TGLintConstPointer, params, &paramsParam.value);
1891     CaptureTexParameteriv_params(glState, isCallValid, targetPacked, pname, params, &paramsParam);
1892     paramBuffer.addParam(std::move(paramsParam));
1893 
1894     return CallCapture(gl::EntryPoint::TexParameteriv, std::move(paramBuffer));
1895 }
1896 
CaptureTexSubImage2D(const State & glState,bool isCallValid,TextureTarget targetPacked,GLint level,GLint xoffset,GLint yoffset,GLsizei width,GLsizei height,GLenum format,GLenum type,const void * pixels)1897 CallCapture CaptureTexSubImage2D(const State &glState,
1898                                  bool isCallValid,
1899                                  TextureTarget targetPacked,
1900                                  GLint level,
1901                                  GLint xoffset,
1902                                  GLint yoffset,
1903                                  GLsizei width,
1904                                  GLsizei height,
1905                                  GLenum format,
1906                                  GLenum type,
1907                                  const void *pixels)
1908 {
1909     ParamBuffer paramBuffer;
1910 
1911     paramBuffer.addValueParam("targetPacked", ParamType::TTextureTarget, targetPacked);
1912     paramBuffer.addValueParam("level", ParamType::TGLint, level);
1913     paramBuffer.addValueParam("xoffset", ParamType::TGLint, xoffset);
1914     paramBuffer.addValueParam("yoffset", ParamType::TGLint, yoffset);
1915     paramBuffer.addValueParam("width", ParamType::TGLsizei, width);
1916     paramBuffer.addValueParam("height", ParamType::TGLsizei, height);
1917     paramBuffer.addEnumParam("format", GLenumGroup::PixelFormat, ParamType::TGLenum, format);
1918     paramBuffer.addEnumParam("type", GLenumGroup::PixelType, ParamType::TGLenum, type);
1919 
1920     ParamCapture pixelsParam("pixels", ParamType::TvoidConstPointer);
1921     InitParamValue(ParamType::TvoidConstPointer, pixels, &pixelsParam.value);
1922     CaptureTexSubImage2D_pixels(glState, isCallValid, targetPacked, level, xoffset, yoffset, width,
1923                                 height, format, type, pixels, &pixelsParam);
1924     paramBuffer.addParam(std::move(pixelsParam));
1925 
1926     return CallCapture(gl::EntryPoint::TexSubImage2D, std::move(paramBuffer));
1927 }
1928 
CaptureUniform1f(const State & glState,bool isCallValid,UniformLocation locationPacked,GLfloat v0)1929 CallCapture CaptureUniform1f(const State &glState,
1930                              bool isCallValid,
1931                              UniformLocation locationPacked,
1932                              GLfloat v0)
1933 {
1934     ParamBuffer paramBuffer;
1935 
1936     paramBuffer.addValueParam("locationPacked", ParamType::TUniformLocation, locationPacked);
1937     paramBuffer.addValueParam("v0", ParamType::TGLfloat, v0);
1938 
1939     return CallCapture(gl::EntryPoint::Uniform1f, std::move(paramBuffer));
1940 }
1941 
CaptureUniform1fv(const State & glState,bool isCallValid,UniformLocation locationPacked,GLsizei count,const GLfloat * value)1942 CallCapture CaptureUniform1fv(const State &glState,
1943                               bool isCallValid,
1944                               UniformLocation locationPacked,
1945                               GLsizei count,
1946                               const GLfloat *value)
1947 {
1948     ParamBuffer paramBuffer;
1949 
1950     paramBuffer.addValueParam("locationPacked", ParamType::TUniformLocation, locationPacked);
1951     paramBuffer.addValueParam("count", ParamType::TGLsizei, count);
1952 
1953     ParamCapture valueParam("value", ParamType::TGLfloatConstPointer);
1954     InitParamValue(ParamType::TGLfloatConstPointer, value, &valueParam.value);
1955     CaptureUniform1fv_value(glState, isCallValid, locationPacked, count, value, &valueParam);
1956     paramBuffer.addParam(std::move(valueParam));
1957 
1958     return CallCapture(gl::EntryPoint::Uniform1fv, std::move(paramBuffer));
1959 }
1960 
CaptureUniform1i(const State & glState,bool isCallValid,UniformLocation locationPacked,GLint v0)1961 CallCapture CaptureUniform1i(const State &glState,
1962                              bool isCallValid,
1963                              UniformLocation locationPacked,
1964                              GLint v0)
1965 {
1966     ParamBuffer paramBuffer;
1967 
1968     paramBuffer.addValueParam("locationPacked", ParamType::TUniformLocation, locationPacked);
1969     paramBuffer.addValueParam("v0", ParamType::TGLint, v0);
1970 
1971     return CallCapture(gl::EntryPoint::Uniform1i, std::move(paramBuffer));
1972 }
1973 
CaptureUniform1iv(const State & glState,bool isCallValid,UniformLocation locationPacked,GLsizei count,const GLint * value)1974 CallCapture CaptureUniform1iv(const State &glState,
1975                               bool isCallValid,
1976                               UniformLocation locationPacked,
1977                               GLsizei count,
1978                               const GLint *value)
1979 {
1980     ParamBuffer paramBuffer;
1981 
1982     paramBuffer.addValueParam("locationPacked", ParamType::TUniformLocation, locationPacked);
1983     paramBuffer.addValueParam("count", ParamType::TGLsizei, count);
1984 
1985     ParamCapture valueParam("value", ParamType::TGLintConstPointer);
1986     InitParamValue(ParamType::TGLintConstPointer, value, &valueParam.value);
1987     CaptureUniform1iv_value(glState, isCallValid, locationPacked, count, value, &valueParam);
1988     paramBuffer.addParam(std::move(valueParam));
1989 
1990     return CallCapture(gl::EntryPoint::Uniform1iv, std::move(paramBuffer));
1991 }
1992 
CaptureUniform2f(const State & glState,bool isCallValid,UniformLocation locationPacked,GLfloat v0,GLfloat v1)1993 CallCapture CaptureUniform2f(const State &glState,
1994                              bool isCallValid,
1995                              UniformLocation locationPacked,
1996                              GLfloat v0,
1997                              GLfloat v1)
1998 {
1999     ParamBuffer paramBuffer;
2000 
2001     paramBuffer.addValueParam("locationPacked", ParamType::TUniformLocation, locationPacked);
2002     paramBuffer.addValueParam("v0", ParamType::TGLfloat, v0);
2003     paramBuffer.addValueParam("v1", ParamType::TGLfloat, v1);
2004 
2005     return CallCapture(gl::EntryPoint::Uniform2f, std::move(paramBuffer));
2006 }
2007 
CaptureUniform2fv(const State & glState,bool isCallValid,UniformLocation locationPacked,GLsizei count,const GLfloat * value)2008 CallCapture CaptureUniform2fv(const State &glState,
2009                               bool isCallValid,
2010                               UniformLocation locationPacked,
2011                               GLsizei count,
2012                               const GLfloat *value)
2013 {
2014     ParamBuffer paramBuffer;
2015 
2016     paramBuffer.addValueParam("locationPacked", ParamType::TUniformLocation, locationPacked);
2017     paramBuffer.addValueParam("count", ParamType::TGLsizei, count);
2018 
2019     ParamCapture valueParam("value", ParamType::TGLfloatConstPointer);
2020     InitParamValue(ParamType::TGLfloatConstPointer, value, &valueParam.value);
2021     CaptureUniform2fv_value(glState, isCallValid, locationPacked, count, value, &valueParam);
2022     paramBuffer.addParam(std::move(valueParam));
2023 
2024     return CallCapture(gl::EntryPoint::Uniform2fv, std::move(paramBuffer));
2025 }
2026 
CaptureUniform2i(const State & glState,bool isCallValid,UniformLocation locationPacked,GLint v0,GLint v1)2027 CallCapture CaptureUniform2i(const State &glState,
2028                              bool isCallValid,
2029                              UniformLocation locationPacked,
2030                              GLint v0,
2031                              GLint v1)
2032 {
2033     ParamBuffer paramBuffer;
2034 
2035     paramBuffer.addValueParam("locationPacked", ParamType::TUniformLocation, locationPacked);
2036     paramBuffer.addValueParam("v0", ParamType::TGLint, v0);
2037     paramBuffer.addValueParam("v1", ParamType::TGLint, v1);
2038 
2039     return CallCapture(gl::EntryPoint::Uniform2i, std::move(paramBuffer));
2040 }
2041 
CaptureUniform2iv(const State & glState,bool isCallValid,UniformLocation locationPacked,GLsizei count,const GLint * value)2042 CallCapture CaptureUniform2iv(const State &glState,
2043                               bool isCallValid,
2044                               UniformLocation locationPacked,
2045                               GLsizei count,
2046                               const GLint *value)
2047 {
2048     ParamBuffer paramBuffer;
2049 
2050     paramBuffer.addValueParam("locationPacked", ParamType::TUniformLocation, locationPacked);
2051     paramBuffer.addValueParam("count", ParamType::TGLsizei, count);
2052 
2053     ParamCapture valueParam("value", ParamType::TGLintConstPointer);
2054     InitParamValue(ParamType::TGLintConstPointer, value, &valueParam.value);
2055     CaptureUniform2iv_value(glState, isCallValid, locationPacked, count, value, &valueParam);
2056     paramBuffer.addParam(std::move(valueParam));
2057 
2058     return CallCapture(gl::EntryPoint::Uniform2iv, std::move(paramBuffer));
2059 }
2060 
CaptureUniform3f(const State & glState,bool isCallValid,UniformLocation locationPacked,GLfloat v0,GLfloat v1,GLfloat v2)2061 CallCapture CaptureUniform3f(const State &glState,
2062                              bool isCallValid,
2063                              UniformLocation locationPacked,
2064                              GLfloat v0,
2065                              GLfloat v1,
2066                              GLfloat v2)
2067 {
2068     ParamBuffer paramBuffer;
2069 
2070     paramBuffer.addValueParam("locationPacked", ParamType::TUniformLocation, locationPacked);
2071     paramBuffer.addValueParam("v0", ParamType::TGLfloat, v0);
2072     paramBuffer.addValueParam("v1", ParamType::TGLfloat, v1);
2073     paramBuffer.addValueParam("v2", ParamType::TGLfloat, v2);
2074 
2075     return CallCapture(gl::EntryPoint::Uniform3f, std::move(paramBuffer));
2076 }
2077 
CaptureUniform3fv(const State & glState,bool isCallValid,UniformLocation locationPacked,GLsizei count,const GLfloat * value)2078 CallCapture CaptureUniform3fv(const State &glState,
2079                               bool isCallValid,
2080                               UniformLocation locationPacked,
2081                               GLsizei count,
2082                               const GLfloat *value)
2083 {
2084     ParamBuffer paramBuffer;
2085 
2086     paramBuffer.addValueParam("locationPacked", ParamType::TUniformLocation, locationPacked);
2087     paramBuffer.addValueParam("count", ParamType::TGLsizei, count);
2088 
2089     ParamCapture valueParam("value", ParamType::TGLfloatConstPointer);
2090     InitParamValue(ParamType::TGLfloatConstPointer, value, &valueParam.value);
2091     CaptureUniform3fv_value(glState, isCallValid, locationPacked, count, value, &valueParam);
2092     paramBuffer.addParam(std::move(valueParam));
2093 
2094     return CallCapture(gl::EntryPoint::Uniform3fv, std::move(paramBuffer));
2095 }
2096 
CaptureUniform3i(const State & glState,bool isCallValid,UniformLocation locationPacked,GLint v0,GLint v1,GLint v2)2097 CallCapture CaptureUniform3i(const State &glState,
2098                              bool isCallValid,
2099                              UniformLocation locationPacked,
2100                              GLint v0,
2101                              GLint v1,
2102                              GLint v2)
2103 {
2104     ParamBuffer paramBuffer;
2105 
2106     paramBuffer.addValueParam("locationPacked", ParamType::TUniformLocation, locationPacked);
2107     paramBuffer.addValueParam("v0", ParamType::TGLint, v0);
2108     paramBuffer.addValueParam("v1", ParamType::TGLint, v1);
2109     paramBuffer.addValueParam("v2", ParamType::TGLint, v2);
2110 
2111     return CallCapture(gl::EntryPoint::Uniform3i, std::move(paramBuffer));
2112 }
2113 
CaptureUniform3iv(const State & glState,bool isCallValid,UniformLocation locationPacked,GLsizei count,const GLint * value)2114 CallCapture CaptureUniform3iv(const State &glState,
2115                               bool isCallValid,
2116                               UniformLocation locationPacked,
2117                               GLsizei count,
2118                               const GLint *value)
2119 {
2120     ParamBuffer paramBuffer;
2121 
2122     paramBuffer.addValueParam("locationPacked", ParamType::TUniformLocation, locationPacked);
2123     paramBuffer.addValueParam("count", ParamType::TGLsizei, count);
2124 
2125     ParamCapture valueParam("value", ParamType::TGLintConstPointer);
2126     InitParamValue(ParamType::TGLintConstPointer, value, &valueParam.value);
2127     CaptureUniform3iv_value(glState, isCallValid, locationPacked, count, value, &valueParam);
2128     paramBuffer.addParam(std::move(valueParam));
2129 
2130     return CallCapture(gl::EntryPoint::Uniform3iv, std::move(paramBuffer));
2131 }
2132 
CaptureUniform4f(const State & glState,bool isCallValid,UniformLocation locationPacked,GLfloat v0,GLfloat v1,GLfloat v2,GLfloat v3)2133 CallCapture CaptureUniform4f(const State &glState,
2134                              bool isCallValid,
2135                              UniformLocation locationPacked,
2136                              GLfloat v0,
2137                              GLfloat v1,
2138                              GLfloat v2,
2139                              GLfloat v3)
2140 {
2141     ParamBuffer paramBuffer;
2142 
2143     paramBuffer.addValueParam("locationPacked", ParamType::TUniformLocation, locationPacked);
2144     paramBuffer.addValueParam("v0", ParamType::TGLfloat, v0);
2145     paramBuffer.addValueParam("v1", ParamType::TGLfloat, v1);
2146     paramBuffer.addValueParam("v2", ParamType::TGLfloat, v2);
2147     paramBuffer.addValueParam("v3", ParamType::TGLfloat, v3);
2148 
2149     return CallCapture(gl::EntryPoint::Uniform4f, std::move(paramBuffer));
2150 }
2151 
CaptureUniform4fv(const State & glState,bool isCallValid,UniformLocation locationPacked,GLsizei count,const GLfloat * value)2152 CallCapture CaptureUniform4fv(const State &glState,
2153                               bool isCallValid,
2154                               UniformLocation locationPacked,
2155                               GLsizei count,
2156                               const GLfloat *value)
2157 {
2158     ParamBuffer paramBuffer;
2159 
2160     paramBuffer.addValueParam("locationPacked", ParamType::TUniformLocation, locationPacked);
2161     paramBuffer.addValueParam("count", ParamType::TGLsizei, count);
2162 
2163     ParamCapture valueParam("value", ParamType::TGLfloatConstPointer);
2164     InitParamValue(ParamType::TGLfloatConstPointer, value, &valueParam.value);
2165     CaptureUniform4fv_value(glState, isCallValid, locationPacked, count, value, &valueParam);
2166     paramBuffer.addParam(std::move(valueParam));
2167 
2168     return CallCapture(gl::EntryPoint::Uniform4fv, std::move(paramBuffer));
2169 }
2170 
CaptureUniform4i(const State & glState,bool isCallValid,UniformLocation locationPacked,GLint v0,GLint v1,GLint v2,GLint v3)2171 CallCapture CaptureUniform4i(const State &glState,
2172                              bool isCallValid,
2173                              UniformLocation locationPacked,
2174                              GLint v0,
2175                              GLint v1,
2176                              GLint v2,
2177                              GLint v3)
2178 {
2179     ParamBuffer paramBuffer;
2180 
2181     paramBuffer.addValueParam("locationPacked", ParamType::TUniformLocation, locationPacked);
2182     paramBuffer.addValueParam("v0", ParamType::TGLint, v0);
2183     paramBuffer.addValueParam("v1", ParamType::TGLint, v1);
2184     paramBuffer.addValueParam("v2", ParamType::TGLint, v2);
2185     paramBuffer.addValueParam("v3", ParamType::TGLint, v3);
2186 
2187     return CallCapture(gl::EntryPoint::Uniform4i, std::move(paramBuffer));
2188 }
2189 
CaptureUniform4iv(const State & glState,bool isCallValid,UniformLocation locationPacked,GLsizei count,const GLint * value)2190 CallCapture CaptureUniform4iv(const State &glState,
2191                               bool isCallValid,
2192                               UniformLocation locationPacked,
2193                               GLsizei count,
2194                               const GLint *value)
2195 {
2196     ParamBuffer paramBuffer;
2197 
2198     paramBuffer.addValueParam("locationPacked", ParamType::TUniformLocation, locationPacked);
2199     paramBuffer.addValueParam("count", ParamType::TGLsizei, count);
2200 
2201     ParamCapture valueParam("value", ParamType::TGLintConstPointer);
2202     InitParamValue(ParamType::TGLintConstPointer, value, &valueParam.value);
2203     CaptureUniform4iv_value(glState, isCallValid, locationPacked, count, value, &valueParam);
2204     paramBuffer.addParam(std::move(valueParam));
2205 
2206     return CallCapture(gl::EntryPoint::Uniform4iv, std::move(paramBuffer));
2207 }
2208 
CaptureUniformMatrix2fv(const State & glState,bool isCallValid,UniformLocation locationPacked,GLsizei count,GLboolean transpose,const GLfloat * value)2209 CallCapture CaptureUniformMatrix2fv(const State &glState,
2210                                     bool isCallValid,
2211                                     UniformLocation locationPacked,
2212                                     GLsizei count,
2213                                     GLboolean transpose,
2214                                     const GLfloat *value)
2215 {
2216     ParamBuffer paramBuffer;
2217 
2218     paramBuffer.addValueParam("locationPacked", ParamType::TUniformLocation, locationPacked);
2219     paramBuffer.addValueParam("count", ParamType::TGLsizei, count);
2220     paramBuffer.addValueParam("transpose", ParamType::TGLboolean, transpose);
2221 
2222     ParamCapture valueParam("value", ParamType::TGLfloatConstPointer);
2223     InitParamValue(ParamType::TGLfloatConstPointer, value, &valueParam.value);
2224     CaptureUniformMatrix2fv_value(glState, isCallValid, locationPacked, count, transpose, value,
2225                                   &valueParam);
2226     paramBuffer.addParam(std::move(valueParam));
2227 
2228     return CallCapture(gl::EntryPoint::UniformMatrix2fv, std::move(paramBuffer));
2229 }
2230 
CaptureUniformMatrix3fv(const State & glState,bool isCallValid,UniformLocation locationPacked,GLsizei count,GLboolean transpose,const GLfloat * value)2231 CallCapture CaptureUniformMatrix3fv(const State &glState,
2232                                     bool isCallValid,
2233                                     UniformLocation locationPacked,
2234                                     GLsizei count,
2235                                     GLboolean transpose,
2236                                     const GLfloat *value)
2237 {
2238     ParamBuffer paramBuffer;
2239 
2240     paramBuffer.addValueParam("locationPacked", ParamType::TUniformLocation, locationPacked);
2241     paramBuffer.addValueParam("count", ParamType::TGLsizei, count);
2242     paramBuffer.addValueParam("transpose", ParamType::TGLboolean, transpose);
2243 
2244     ParamCapture valueParam("value", ParamType::TGLfloatConstPointer);
2245     InitParamValue(ParamType::TGLfloatConstPointer, value, &valueParam.value);
2246     CaptureUniformMatrix3fv_value(glState, isCallValid, locationPacked, count, transpose, value,
2247                                   &valueParam);
2248     paramBuffer.addParam(std::move(valueParam));
2249 
2250     return CallCapture(gl::EntryPoint::UniformMatrix3fv, std::move(paramBuffer));
2251 }
2252 
CaptureUniformMatrix4fv(const State & glState,bool isCallValid,UniformLocation locationPacked,GLsizei count,GLboolean transpose,const GLfloat * value)2253 CallCapture CaptureUniformMatrix4fv(const State &glState,
2254                                     bool isCallValid,
2255                                     UniformLocation locationPacked,
2256                                     GLsizei count,
2257                                     GLboolean transpose,
2258                                     const GLfloat *value)
2259 {
2260     ParamBuffer paramBuffer;
2261 
2262     paramBuffer.addValueParam("locationPacked", ParamType::TUniformLocation, locationPacked);
2263     paramBuffer.addValueParam("count", ParamType::TGLsizei, count);
2264     paramBuffer.addValueParam("transpose", ParamType::TGLboolean, transpose);
2265 
2266     ParamCapture valueParam("value", ParamType::TGLfloatConstPointer);
2267     InitParamValue(ParamType::TGLfloatConstPointer, value, &valueParam.value);
2268     CaptureUniformMatrix4fv_value(glState, isCallValid, locationPacked, count, transpose, value,
2269                                   &valueParam);
2270     paramBuffer.addParam(std::move(valueParam));
2271 
2272     return CallCapture(gl::EntryPoint::UniformMatrix4fv, std::move(paramBuffer));
2273 }
2274 
CaptureUseProgram(const State & glState,bool isCallValid,ShaderProgramID programPacked)2275 CallCapture CaptureUseProgram(const State &glState, bool isCallValid, ShaderProgramID programPacked)
2276 {
2277     ParamBuffer paramBuffer;
2278 
2279     paramBuffer.addValueParam("programPacked", ParamType::TShaderProgramID, programPacked);
2280 
2281     return CallCapture(gl::EntryPoint::UseProgram, std::move(paramBuffer));
2282 }
2283 
CaptureValidateProgram(const State & glState,bool isCallValid,ShaderProgramID programPacked)2284 CallCapture CaptureValidateProgram(const State &glState,
2285                                    bool isCallValid,
2286                                    ShaderProgramID programPacked)
2287 {
2288     ParamBuffer paramBuffer;
2289 
2290     paramBuffer.addValueParam("programPacked", ParamType::TShaderProgramID, programPacked);
2291 
2292     return CallCapture(gl::EntryPoint::ValidateProgram, std::move(paramBuffer));
2293 }
2294 
CaptureVertexAttrib1f(const State & glState,bool isCallValid,GLuint index,GLfloat x)2295 CallCapture CaptureVertexAttrib1f(const State &glState, bool isCallValid, GLuint index, GLfloat x)
2296 {
2297     ParamBuffer paramBuffer;
2298 
2299     paramBuffer.addValueParam("index", ParamType::TGLuint, index);
2300     paramBuffer.addValueParam("x", ParamType::TGLfloat, x);
2301 
2302     return CallCapture(gl::EntryPoint::VertexAttrib1f, std::move(paramBuffer));
2303 }
2304 
CaptureVertexAttrib1fv(const State & glState,bool isCallValid,GLuint index,const GLfloat * v)2305 CallCapture CaptureVertexAttrib1fv(const State &glState,
2306                                    bool isCallValid,
2307                                    GLuint index,
2308                                    const GLfloat *v)
2309 {
2310     ParamBuffer paramBuffer;
2311 
2312     paramBuffer.addValueParam("index", ParamType::TGLuint, index);
2313 
2314     ParamCapture vParam("v", ParamType::TGLfloatConstPointer);
2315     InitParamValue(ParamType::TGLfloatConstPointer, v, &vParam.value);
2316     CaptureVertexAttrib1fv_v(glState, isCallValid, index, v, &vParam);
2317     paramBuffer.addParam(std::move(vParam));
2318 
2319     return CallCapture(gl::EntryPoint::VertexAttrib1fv, std::move(paramBuffer));
2320 }
2321 
CaptureVertexAttrib2f(const State & glState,bool isCallValid,GLuint index,GLfloat x,GLfloat y)2322 CallCapture CaptureVertexAttrib2f(const State &glState,
2323                                   bool isCallValid,
2324                                   GLuint index,
2325                                   GLfloat x,
2326                                   GLfloat y)
2327 {
2328     ParamBuffer paramBuffer;
2329 
2330     paramBuffer.addValueParam("index", ParamType::TGLuint, index);
2331     paramBuffer.addValueParam("x", ParamType::TGLfloat, x);
2332     paramBuffer.addValueParam("y", ParamType::TGLfloat, y);
2333 
2334     return CallCapture(gl::EntryPoint::VertexAttrib2f, std::move(paramBuffer));
2335 }
2336 
CaptureVertexAttrib2fv(const State & glState,bool isCallValid,GLuint index,const GLfloat * v)2337 CallCapture CaptureVertexAttrib2fv(const State &glState,
2338                                    bool isCallValid,
2339                                    GLuint index,
2340                                    const GLfloat *v)
2341 {
2342     ParamBuffer paramBuffer;
2343 
2344     paramBuffer.addValueParam("index", ParamType::TGLuint, index);
2345 
2346     ParamCapture vParam("v", ParamType::TGLfloatConstPointer);
2347     InitParamValue(ParamType::TGLfloatConstPointer, v, &vParam.value);
2348     CaptureVertexAttrib2fv_v(glState, isCallValid, index, v, &vParam);
2349     paramBuffer.addParam(std::move(vParam));
2350 
2351     return CallCapture(gl::EntryPoint::VertexAttrib2fv, std::move(paramBuffer));
2352 }
2353 
CaptureVertexAttrib3f(const State & glState,bool isCallValid,GLuint index,GLfloat x,GLfloat y,GLfloat z)2354 CallCapture CaptureVertexAttrib3f(const State &glState,
2355                                   bool isCallValid,
2356                                   GLuint index,
2357                                   GLfloat x,
2358                                   GLfloat y,
2359                                   GLfloat z)
2360 {
2361     ParamBuffer paramBuffer;
2362 
2363     paramBuffer.addValueParam("index", ParamType::TGLuint, index);
2364     paramBuffer.addValueParam("x", ParamType::TGLfloat, x);
2365     paramBuffer.addValueParam("y", ParamType::TGLfloat, y);
2366     paramBuffer.addValueParam("z", ParamType::TGLfloat, z);
2367 
2368     return CallCapture(gl::EntryPoint::VertexAttrib3f, std::move(paramBuffer));
2369 }
2370 
CaptureVertexAttrib3fv(const State & glState,bool isCallValid,GLuint index,const GLfloat * v)2371 CallCapture CaptureVertexAttrib3fv(const State &glState,
2372                                    bool isCallValid,
2373                                    GLuint index,
2374                                    const GLfloat *v)
2375 {
2376     ParamBuffer paramBuffer;
2377 
2378     paramBuffer.addValueParam("index", ParamType::TGLuint, index);
2379 
2380     ParamCapture vParam("v", ParamType::TGLfloatConstPointer);
2381     InitParamValue(ParamType::TGLfloatConstPointer, v, &vParam.value);
2382     CaptureVertexAttrib3fv_v(glState, isCallValid, index, v, &vParam);
2383     paramBuffer.addParam(std::move(vParam));
2384 
2385     return CallCapture(gl::EntryPoint::VertexAttrib3fv, std::move(paramBuffer));
2386 }
2387 
CaptureVertexAttrib4f(const State & glState,bool isCallValid,GLuint index,GLfloat x,GLfloat y,GLfloat z,GLfloat w)2388 CallCapture CaptureVertexAttrib4f(const State &glState,
2389                                   bool isCallValid,
2390                                   GLuint index,
2391                                   GLfloat x,
2392                                   GLfloat y,
2393                                   GLfloat z,
2394                                   GLfloat w)
2395 {
2396     ParamBuffer paramBuffer;
2397 
2398     paramBuffer.addValueParam("index", ParamType::TGLuint, index);
2399     paramBuffer.addValueParam("x", ParamType::TGLfloat, x);
2400     paramBuffer.addValueParam("y", ParamType::TGLfloat, y);
2401     paramBuffer.addValueParam("z", ParamType::TGLfloat, z);
2402     paramBuffer.addValueParam("w", ParamType::TGLfloat, w);
2403 
2404     return CallCapture(gl::EntryPoint::VertexAttrib4f, std::move(paramBuffer));
2405 }
2406 
CaptureVertexAttrib4fv(const State & glState,bool isCallValid,GLuint index,const GLfloat * v)2407 CallCapture CaptureVertexAttrib4fv(const State &glState,
2408                                    bool isCallValid,
2409                                    GLuint index,
2410                                    const GLfloat *v)
2411 {
2412     ParamBuffer paramBuffer;
2413 
2414     paramBuffer.addValueParam("index", ParamType::TGLuint, index);
2415 
2416     ParamCapture vParam("v", ParamType::TGLfloatConstPointer);
2417     InitParamValue(ParamType::TGLfloatConstPointer, v, &vParam.value);
2418     CaptureVertexAttrib4fv_v(glState, isCallValid, index, v, &vParam);
2419     paramBuffer.addParam(std::move(vParam));
2420 
2421     return CallCapture(gl::EntryPoint::VertexAttrib4fv, std::move(paramBuffer));
2422 }
2423 
CaptureVertexAttribPointer(const State & glState,bool isCallValid,GLuint index,GLint size,VertexAttribType typePacked,GLboolean normalized,GLsizei stride,const void * pointer)2424 CallCapture CaptureVertexAttribPointer(const State &glState,
2425                                        bool isCallValid,
2426                                        GLuint index,
2427                                        GLint size,
2428                                        VertexAttribType typePacked,
2429                                        GLboolean normalized,
2430                                        GLsizei stride,
2431                                        const void *pointer)
2432 {
2433     ParamBuffer paramBuffer;
2434 
2435     paramBuffer.addValueParam("index", ParamType::TGLuint, index);
2436     paramBuffer.addValueParam("size", ParamType::TGLint, size);
2437     paramBuffer.addValueParam("typePacked", ParamType::TVertexAttribType, typePacked);
2438     paramBuffer.addValueParam("normalized", ParamType::TGLboolean, normalized);
2439     paramBuffer.addValueParam("stride", ParamType::TGLsizei, stride);
2440 
2441     ParamCapture pointerParam("pointer", ParamType::TvoidConstPointer);
2442     InitParamValue(ParamType::TvoidConstPointer, pointer, &pointerParam.value);
2443     CaptureVertexAttribPointer_pointer(glState, isCallValid, index, size, typePacked, normalized,
2444                                        stride, pointer, &pointerParam);
2445     paramBuffer.addParam(std::move(pointerParam));
2446 
2447     return CallCapture(gl::EntryPoint::VertexAttribPointer, std::move(paramBuffer));
2448 }
2449 
CaptureViewport(const State & glState,bool isCallValid,GLint x,GLint y,GLsizei width,GLsizei height)2450 CallCapture CaptureViewport(const State &glState,
2451                             bool isCallValid,
2452                             GLint x,
2453                             GLint y,
2454                             GLsizei width,
2455                             GLsizei height)
2456 {
2457     ParamBuffer paramBuffer;
2458 
2459     paramBuffer.addValueParam("x", ParamType::TGLint, x);
2460     paramBuffer.addValueParam("y", ParamType::TGLint, y);
2461     paramBuffer.addValueParam("width", ParamType::TGLsizei, width);
2462     paramBuffer.addValueParam("height", ParamType::TGLsizei, height);
2463 
2464     return CallCapture(gl::EntryPoint::Viewport, std::move(paramBuffer));
2465 }
2466 
2467 }  // namespace gl
2468