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/capture_gles_2_0_autogen.h"
12
13 #include "common/gl_enum_utils.h"
14 #include "libANGLE/Context.h"
15 #include "libANGLE/capture/FrameCapture.h"
16 #include "libANGLE/validationES2.h"
17
18 using namespace angle;
19
20 namespace gl
21 {
CaptureActiveTexture(const State & glState,bool isCallValid,GLenum texture)22 CallCapture CaptureActiveTexture(const State &glState, bool isCallValid, GLenum texture)
23 {
24 ParamBuffer paramBuffer;
25
26 paramBuffer.addEnumParam("texture", GLESEnum::TextureUnit, ParamType::TGLenum, texture);
27
28 return CallCapture(angle::EntryPoint::GLActiveTexture, std::move(paramBuffer));
29 }
30
CaptureAttachShader(const State & glState,bool isCallValid,ShaderProgramID programPacked,ShaderProgramID shaderPacked)31 CallCapture CaptureAttachShader(const State &glState,
32 bool isCallValid,
33 ShaderProgramID programPacked,
34 ShaderProgramID shaderPacked)
35 {
36 ParamBuffer paramBuffer;
37
38 paramBuffer.addValueParam("programPacked", ParamType::TShaderProgramID, programPacked);
39 paramBuffer.addValueParam("shaderPacked", ParamType::TShaderProgramID, shaderPacked);
40
41 return CallCapture(angle::EntryPoint::GLAttachShader, std::move(paramBuffer));
42 }
43
CaptureBindAttribLocation(const State & glState,bool isCallValid,ShaderProgramID programPacked,GLuint index,const GLchar * name)44 CallCapture CaptureBindAttribLocation(const State &glState,
45 bool isCallValid,
46 ShaderProgramID programPacked,
47 GLuint index,
48 const GLchar *name)
49 {
50 ParamBuffer paramBuffer;
51
52 paramBuffer.addValueParam("programPacked", ParamType::TShaderProgramID, programPacked);
53 paramBuffer.addValueParam("index", ParamType::TGLuint, index);
54
55 if (isCallValid)
56 {
57 ParamCapture nameParam("name", ParamType::TGLcharConstPointer);
58 InitParamValue(ParamType::TGLcharConstPointer, name, &nameParam.value);
59 CaptureBindAttribLocation_name(glState, isCallValid, programPacked, index, name,
60 &nameParam);
61 paramBuffer.addParam(std::move(nameParam));
62 }
63 else
64 {
65 ParamCapture nameParam("name", ParamType::TGLcharConstPointer);
66 InitParamValue(ParamType::TGLcharConstPointer, static_cast<const GLchar *>(nullptr),
67 &nameParam.value);
68 paramBuffer.addParam(std::move(nameParam));
69 }
70
71 return CallCapture(angle::EntryPoint::GLBindAttribLocation, std::move(paramBuffer));
72 }
73
CaptureBindBuffer(const State & glState,bool isCallValid,BufferBinding targetPacked,BufferID bufferPacked)74 CallCapture CaptureBindBuffer(const State &glState,
75 bool isCallValid,
76 BufferBinding targetPacked,
77 BufferID bufferPacked)
78 {
79 ParamBuffer paramBuffer;
80
81 paramBuffer.addValueParam("targetPacked", ParamType::TBufferBinding, targetPacked);
82 paramBuffer.addValueParam("bufferPacked", ParamType::TBufferID, bufferPacked);
83
84 return CallCapture(angle::EntryPoint::GLBindBuffer, std::move(paramBuffer));
85 }
86
CaptureBindFramebuffer(const State & glState,bool isCallValid,GLenum target,FramebufferID framebufferPacked)87 CallCapture CaptureBindFramebuffer(const State &glState,
88 bool isCallValid,
89 GLenum target,
90 FramebufferID framebufferPacked)
91 {
92 ParamBuffer paramBuffer;
93
94 paramBuffer.addEnumParam("target", GLESEnum::FramebufferTarget, ParamType::TGLenum, target);
95 paramBuffer.addValueParam("framebufferPacked", ParamType::TFramebufferID, framebufferPacked);
96
97 return CallCapture(angle::EntryPoint::GLBindFramebuffer, std::move(paramBuffer));
98 }
99
CaptureBindRenderbuffer(const State & glState,bool isCallValid,GLenum target,RenderbufferID renderbufferPacked)100 CallCapture CaptureBindRenderbuffer(const State &glState,
101 bool isCallValid,
102 GLenum target,
103 RenderbufferID renderbufferPacked)
104 {
105 ParamBuffer paramBuffer;
106
107 paramBuffer.addEnumParam("target", GLESEnum::RenderbufferTarget, ParamType::TGLenum, target);
108 paramBuffer.addValueParam("renderbufferPacked", ParamType::TRenderbufferID, renderbufferPacked);
109
110 return CallCapture(angle::EntryPoint::GLBindRenderbuffer, std::move(paramBuffer));
111 }
112
CaptureBindTexture(const State & glState,bool isCallValid,TextureType targetPacked,TextureID texturePacked)113 CallCapture CaptureBindTexture(const State &glState,
114 bool isCallValid,
115 TextureType targetPacked,
116 TextureID texturePacked)
117 {
118 ParamBuffer paramBuffer;
119
120 paramBuffer.addValueParam("targetPacked", ParamType::TTextureType, targetPacked);
121 paramBuffer.addValueParam("texturePacked", ParamType::TTextureID, texturePacked);
122
123 return CallCapture(angle::EntryPoint::GLBindTexture, std::move(paramBuffer));
124 }
125
CaptureBlendColor(const State & glState,bool isCallValid,GLfloat red,GLfloat green,GLfloat blue,GLfloat alpha)126 CallCapture CaptureBlendColor(const State &glState,
127 bool isCallValid,
128 GLfloat red,
129 GLfloat green,
130 GLfloat blue,
131 GLfloat alpha)
132 {
133 ParamBuffer paramBuffer;
134
135 paramBuffer.addValueParam("red", ParamType::TGLfloat, red);
136 paramBuffer.addValueParam("green", ParamType::TGLfloat, green);
137 paramBuffer.addValueParam("blue", ParamType::TGLfloat, blue);
138 paramBuffer.addValueParam("alpha", ParamType::TGLfloat, alpha);
139
140 return CallCapture(angle::EntryPoint::GLBlendColor, std::move(paramBuffer));
141 }
142
CaptureBlendEquation(const State & glState,bool isCallValid,GLenum mode)143 CallCapture CaptureBlendEquation(const State &glState, bool isCallValid, GLenum mode)
144 {
145 ParamBuffer paramBuffer;
146
147 paramBuffer.addEnumParam("mode", GLESEnum::BlendEquationModeEXT, ParamType::TGLenum, mode);
148
149 return CallCapture(angle::EntryPoint::GLBlendEquation, std::move(paramBuffer));
150 }
151
CaptureBlendEquationSeparate(const State & glState,bool isCallValid,GLenum modeRGB,GLenum modeAlpha)152 CallCapture CaptureBlendEquationSeparate(const State &glState,
153 bool isCallValid,
154 GLenum modeRGB,
155 GLenum modeAlpha)
156 {
157 ParamBuffer paramBuffer;
158
159 paramBuffer.addEnumParam("modeRGB", GLESEnum::BlendEquationModeEXT, ParamType::TGLenum,
160 modeRGB);
161 paramBuffer.addEnumParam("modeAlpha", GLESEnum::BlendEquationModeEXT, ParamType::TGLenum,
162 modeAlpha);
163
164 return CallCapture(angle::EntryPoint::GLBlendEquationSeparate, std::move(paramBuffer));
165 }
166
CaptureBlendFunc(const State & glState,bool isCallValid,GLenum sfactor,GLenum dfactor)167 CallCapture CaptureBlendFunc(const State &glState, bool isCallValid, GLenum sfactor, GLenum dfactor)
168 {
169 ParamBuffer paramBuffer;
170
171 paramBuffer.addEnumParam("sfactor", GLESEnum::BlendingFactor, ParamType::TGLenum, sfactor);
172 paramBuffer.addEnumParam("dfactor", GLESEnum::BlendingFactor, ParamType::TGLenum, dfactor);
173
174 return CallCapture(angle::EntryPoint::GLBlendFunc, std::move(paramBuffer));
175 }
176
CaptureBlendFuncSeparate(const State & glState,bool isCallValid,GLenum sfactorRGB,GLenum dfactorRGB,GLenum sfactorAlpha,GLenum dfactorAlpha)177 CallCapture CaptureBlendFuncSeparate(const State &glState,
178 bool isCallValid,
179 GLenum sfactorRGB,
180 GLenum dfactorRGB,
181 GLenum sfactorAlpha,
182 GLenum dfactorAlpha)
183 {
184 ParamBuffer paramBuffer;
185
186 paramBuffer.addEnumParam("sfactorRGB", GLESEnum::BlendingFactor, ParamType::TGLenum,
187 sfactorRGB);
188 paramBuffer.addEnumParam("dfactorRGB", GLESEnum::BlendingFactor, ParamType::TGLenum,
189 dfactorRGB);
190 paramBuffer.addEnumParam("sfactorAlpha", GLESEnum::BlendingFactor, ParamType::TGLenum,
191 sfactorAlpha);
192 paramBuffer.addEnumParam("dfactorAlpha", GLESEnum::BlendingFactor, ParamType::TGLenum,
193 dfactorAlpha);
194
195 return CallCapture(angle::EntryPoint::GLBlendFuncSeparate, std::move(paramBuffer));
196 }
197
CaptureBufferData(const State & glState,bool isCallValid,BufferBinding targetPacked,GLsizeiptr size,const void * data,BufferUsage usagePacked)198 CallCapture CaptureBufferData(const State &glState,
199 bool isCallValid,
200 BufferBinding targetPacked,
201 GLsizeiptr size,
202 const void *data,
203 BufferUsage usagePacked)
204 {
205 ParamBuffer paramBuffer;
206
207 paramBuffer.addValueParam("targetPacked", ParamType::TBufferBinding, targetPacked);
208 paramBuffer.addValueParam("size", ParamType::TGLsizeiptr, size);
209
210 if (isCallValid)
211 {
212 ParamCapture dataParam("data", ParamType::TvoidConstPointer);
213 InitParamValue(ParamType::TvoidConstPointer, data, &dataParam.value);
214 CaptureBufferData_data(glState, isCallValid, targetPacked, size, data, usagePacked,
215 &dataParam);
216 paramBuffer.addParam(std::move(dataParam));
217 }
218 else
219 {
220 ParamCapture dataParam("data", ParamType::TvoidConstPointer);
221 InitParamValue(ParamType::TvoidConstPointer, static_cast<const void *>(nullptr),
222 &dataParam.value);
223 paramBuffer.addParam(std::move(dataParam));
224 }
225
226 paramBuffer.addValueParam("usagePacked", ParamType::TBufferUsage, usagePacked);
227
228 return CallCapture(angle::EntryPoint::GLBufferData, std::move(paramBuffer));
229 }
230
CaptureBufferSubData(const State & glState,bool isCallValid,BufferBinding targetPacked,GLintptr offset,GLsizeiptr size,const void * data)231 CallCapture CaptureBufferSubData(const State &glState,
232 bool isCallValid,
233 BufferBinding targetPacked,
234 GLintptr offset,
235 GLsizeiptr size,
236 const void *data)
237 {
238 ParamBuffer paramBuffer;
239
240 paramBuffer.addValueParam("targetPacked", ParamType::TBufferBinding, targetPacked);
241 paramBuffer.addValueParam("offset", ParamType::TGLintptr, offset);
242 paramBuffer.addValueParam("size", ParamType::TGLsizeiptr, size);
243
244 if (isCallValid)
245 {
246 ParamCapture dataParam("data", ParamType::TvoidConstPointer);
247 InitParamValue(ParamType::TvoidConstPointer, data, &dataParam.value);
248 CaptureBufferSubData_data(glState, isCallValid, targetPacked, offset, size, data,
249 &dataParam);
250 paramBuffer.addParam(std::move(dataParam));
251 }
252 else
253 {
254 ParamCapture dataParam("data", ParamType::TvoidConstPointer);
255 InitParamValue(ParamType::TvoidConstPointer, static_cast<const void *>(nullptr),
256 &dataParam.value);
257 paramBuffer.addParam(std::move(dataParam));
258 }
259
260 return CallCapture(angle::EntryPoint::GLBufferSubData, std::move(paramBuffer));
261 }
262
CaptureCheckFramebufferStatus(const State & glState,bool isCallValid,GLenum target,GLenum returnValue)263 CallCapture CaptureCheckFramebufferStatus(const State &glState,
264 bool isCallValid,
265 GLenum target,
266 GLenum returnValue)
267 {
268 ParamBuffer paramBuffer;
269
270 paramBuffer.addEnumParam("target", GLESEnum::FramebufferTarget, ParamType::TGLenum, target);
271
272 ParamCapture returnValueCapture("returnValue", ParamType::TGLenum);
273 InitParamValue(ParamType::TGLenum, returnValue, &returnValueCapture.value);
274 paramBuffer.addReturnValue(std::move(returnValueCapture));
275
276 return CallCapture(angle::EntryPoint::GLCheckFramebufferStatus, std::move(paramBuffer));
277 }
278
CaptureClear(const State & glState,bool isCallValid,GLbitfield mask)279 CallCapture CaptureClear(const State &glState, bool isCallValid, GLbitfield mask)
280 {
281 ParamBuffer paramBuffer;
282
283 paramBuffer.addEnumParam("mask", GLESEnum::ClearBufferMask, ParamType::TGLbitfield, mask);
284
285 return CallCapture(angle::EntryPoint::GLClear, std::move(paramBuffer));
286 }
287
CaptureClearColor(const State & glState,bool isCallValid,GLfloat red,GLfloat green,GLfloat blue,GLfloat alpha)288 CallCapture CaptureClearColor(const State &glState,
289 bool isCallValid,
290 GLfloat red,
291 GLfloat green,
292 GLfloat blue,
293 GLfloat alpha)
294 {
295 ParamBuffer paramBuffer;
296
297 paramBuffer.addValueParam("red", ParamType::TGLfloat, red);
298 paramBuffer.addValueParam("green", ParamType::TGLfloat, green);
299 paramBuffer.addValueParam("blue", ParamType::TGLfloat, blue);
300 paramBuffer.addValueParam("alpha", ParamType::TGLfloat, alpha);
301
302 return CallCapture(angle::EntryPoint::GLClearColor, std::move(paramBuffer));
303 }
304
CaptureClearDepthf(const State & glState,bool isCallValid,GLfloat d)305 CallCapture CaptureClearDepthf(const State &glState, bool isCallValid, GLfloat d)
306 {
307 ParamBuffer paramBuffer;
308
309 paramBuffer.addValueParam("d", ParamType::TGLfloat, d);
310
311 return CallCapture(angle::EntryPoint::GLClearDepthf, std::move(paramBuffer));
312 }
313
CaptureClearStencil(const State & glState,bool isCallValid,GLint s)314 CallCapture CaptureClearStencil(const State &glState, bool isCallValid, GLint s)
315 {
316 ParamBuffer paramBuffer;
317
318 paramBuffer.addValueParam("s", ParamType::TGLint, s);
319
320 return CallCapture(angle::EntryPoint::GLClearStencil, std::move(paramBuffer));
321 }
322
CaptureColorMask(const State & glState,bool isCallValid,GLboolean red,GLboolean green,GLboolean blue,GLboolean alpha)323 CallCapture CaptureColorMask(const State &glState,
324 bool isCallValid,
325 GLboolean red,
326 GLboolean green,
327 GLboolean blue,
328 GLboolean alpha)
329 {
330 ParamBuffer paramBuffer;
331
332 paramBuffer.addValueParam("red", ParamType::TGLboolean, red);
333 paramBuffer.addValueParam("green", ParamType::TGLboolean, green);
334 paramBuffer.addValueParam("blue", ParamType::TGLboolean, blue);
335 paramBuffer.addValueParam("alpha", ParamType::TGLboolean, alpha);
336
337 return CallCapture(angle::EntryPoint::GLColorMask, std::move(paramBuffer));
338 }
339
CaptureCompileShader(const State & glState,bool isCallValid,ShaderProgramID shaderPacked)340 CallCapture CaptureCompileShader(const State &glState,
341 bool isCallValid,
342 ShaderProgramID shaderPacked)
343 {
344 ParamBuffer paramBuffer;
345
346 paramBuffer.addValueParam("shaderPacked", ParamType::TShaderProgramID, shaderPacked);
347
348 return CallCapture(angle::EntryPoint::GLCompileShader, std::move(paramBuffer));
349 }
350
CaptureCompressedTexImage2D(const State & glState,bool isCallValid,TextureTarget targetPacked,GLint level,GLenum internalformat,GLsizei width,GLsizei height,GLint border,GLsizei imageSize,const void * data)351 CallCapture CaptureCompressedTexImage2D(const State &glState,
352 bool isCallValid,
353 TextureTarget targetPacked,
354 GLint level,
355 GLenum internalformat,
356 GLsizei width,
357 GLsizei height,
358 GLint border,
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.addEnumParam("internalformat", GLESEnum::InternalFormat, ParamType::TGLenum,
367 internalformat);
368 paramBuffer.addValueParam("width", ParamType::TGLsizei, width);
369 paramBuffer.addValueParam("height", ParamType::TGLsizei, height);
370 paramBuffer.addValueParam("border", ParamType::TGLint, border);
371 paramBuffer.addValueParam("imageSize", ParamType::TGLsizei, imageSize);
372
373 if (isCallValid)
374 {
375 ParamCapture dataParam("data", ParamType::TvoidConstPointer);
376 InitParamValue(ParamType::TvoidConstPointer, data, &dataParam.value);
377 CaptureCompressedTexImage2D_data(glState, isCallValid, targetPacked, level, internalformat,
378 width, height, border, imageSize, data, &dataParam);
379 paramBuffer.addParam(std::move(dataParam));
380 }
381 else
382 {
383 ParamCapture dataParam("data", ParamType::TvoidConstPointer);
384 InitParamValue(ParamType::TvoidConstPointer, static_cast<const void *>(nullptr),
385 &dataParam.value);
386 paramBuffer.addParam(std::move(dataParam));
387 }
388
389 return CallCapture(angle::EntryPoint::GLCompressedTexImage2D, std::move(paramBuffer));
390 }
391
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)392 CallCapture CaptureCompressedTexSubImage2D(const State &glState,
393 bool isCallValid,
394 TextureTarget targetPacked,
395 GLint level,
396 GLint xoffset,
397 GLint yoffset,
398 GLsizei width,
399 GLsizei height,
400 GLenum format,
401 GLsizei imageSize,
402 const void *data)
403 {
404 ParamBuffer paramBuffer;
405
406 paramBuffer.addValueParam("targetPacked", ParamType::TTextureTarget, targetPacked);
407 paramBuffer.addValueParam("level", ParamType::TGLint, level);
408 paramBuffer.addValueParam("xoffset", ParamType::TGLint, xoffset);
409 paramBuffer.addValueParam("yoffset", ParamType::TGLint, yoffset);
410 paramBuffer.addValueParam("width", ParamType::TGLsizei, width);
411 paramBuffer.addValueParam("height", ParamType::TGLsizei, height);
412 paramBuffer.addEnumParam("format", GLESEnum::InternalFormat, ParamType::TGLenum, format);
413 paramBuffer.addValueParam("imageSize", ParamType::TGLsizei, imageSize);
414
415 if (isCallValid)
416 {
417 ParamCapture dataParam("data", ParamType::TvoidConstPointer);
418 InitParamValue(ParamType::TvoidConstPointer, data, &dataParam.value);
419 CaptureCompressedTexSubImage2D_data(glState, isCallValid, targetPacked, level, xoffset,
420 yoffset, width, height, format, imageSize, data,
421 &dataParam);
422 paramBuffer.addParam(std::move(dataParam));
423 }
424 else
425 {
426 ParamCapture dataParam("data", ParamType::TvoidConstPointer);
427 InitParamValue(ParamType::TvoidConstPointer, static_cast<const void *>(nullptr),
428 &dataParam.value);
429 paramBuffer.addParam(std::move(dataParam));
430 }
431
432 return CallCapture(angle::EntryPoint::GLCompressedTexSubImage2D, std::move(paramBuffer));
433 }
434
CaptureCopyTexImage2D(const State & glState,bool isCallValid,TextureTarget targetPacked,GLint level,GLenum internalformat,GLint x,GLint y,GLsizei width,GLsizei height,GLint border)435 CallCapture CaptureCopyTexImage2D(const State &glState,
436 bool isCallValid,
437 TextureTarget targetPacked,
438 GLint level,
439 GLenum internalformat,
440 GLint x,
441 GLint y,
442 GLsizei width,
443 GLsizei height,
444 GLint border)
445 {
446 ParamBuffer paramBuffer;
447
448 paramBuffer.addValueParam("targetPacked", ParamType::TTextureTarget, targetPacked);
449 paramBuffer.addValueParam("level", ParamType::TGLint, level);
450 paramBuffer.addEnumParam("internalformat", GLESEnum::InternalFormat, ParamType::TGLenum,
451 internalformat);
452 paramBuffer.addValueParam("x", ParamType::TGLint, x);
453 paramBuffer.addValueParam("y", ParamType::TGLint, y);
454 paramBuffer.addValueParam("width", ParamType::TGLsizei, width);
455 paramBuffer.addValueParam("height", ParamType::TGLsizei, height);
456 paramBuffer.addValueParam("border", ParamType::TGLint, border);
457
458 return CallCapture(angle::EntryPoint::GLCopyTexImage2D, std::move(paramBuffer));
459 }
460
CaptureCopyTexSubImage2D(const State & glState,bool isCallValid,TextureTarget targetPacked,GLint level,GLint xoffset,GLint yoffset,GLint x,GLint y,GLsizei width,GLsizei height)461 CallCapture CaptureCopyTexSubImage2D(const State &glState,
462 bool isCallValid,
463 TextureTarget targetPacked,
464 GLint level,
465 GLint xoffset,
466 GLint yoffset,
467 GLint x,
468 GLint y,
469 GLsizei width,
470 GLsizei height)
471 {
472 ParamBuffer paramBuffer;
473
474 paramBuffer.addValueParam("targetPacked", ParamType::TTextureTarget, targetPacked);
475 paramBuffer.addValueParam("level", ParamType::TGLint, level);
476 paramBuffer.addValueParam("xoffset", ParamType::TGLint, xoffset);
477 paramBuffer.addValueParam("yoffset", ParamType::TGLint, yoffset);
478 paramBuffer.addValueParam("x", ParamType::TGLint, x);
479 paramBuffer.addValueParam("y", ParamType::TGLint, y);
480 paramBuffer.addValueParam("width", ParamType::TGLsizei, width);
481 paramBuffer.addValueParam("height", ParamType::TGLsizei, height);
482
483 return CallCapture(angle::EntryPoint::GLCopyTexSubImage2D, std::move(paramBuffer));
484 }
485
CaptureCreateProgram(const State & glState,bool isCallValid,GLuint returnValue)486 CallCapture CaptureCreateProgram(const State &glState, bool isCallValid, GLuint returnValue)
487 {
488 ParamBuffer paramBuffer;
489
490 ParamCapture returnValueCapture("returnValue", ParamType::TGLuint);
491 InitParamValue(ParamType::TGLuint, returnValue, &returnValueCapture.value);
492 paramBuffer.addReturnValue(std::move(returnValueCapture));
493
494 return CallCapture(angle::EntryPoint::GLCreateProgram, std::move(paramBuffer));
495 }
496
CaptureCreateShader(const State & glState,bool isCallValid,ShaderType typePacked,GLuint returnValue)497 CallCapture CaptureCreateShader(const State &glState,
498 bool isCallValid,
499 ShaderType typePacked,
500 GLuint returnValue)
501 {
502 ParamBuffer paramBuffer;
503
504 paramBuffer.addValueParam("typePacked", ParamType::TShaderType, typePacked);
505
506 ParamCapture returnValueCapture("returnValue", ParamType::TGLuint);
507 InitParamValue(ParamType::TGLuint, returnValue, &returnValueCapture.value);
508 paramBuffer.addReturnValue(std::move(returnValueCapture));
509
510 return CallCapture(angle::EntryPoint::GLCreateShader, std::move(paramBuffer));
511 }
512
CaptureCullFace(const State & glState,bool isCallValid,CullFaceMode modePacked)513 CallCapture CaptureCullFace(const State &glState, bool isCallValid, CullFaceMode modePacked)
514 {
515 ParamBuffer paramBuffer;
516
517 paramBuffer.addValueParam("modePacked", ParamType::TCullFaceMode, modePacked);
518
519 return CallCapture(angle::EntryPoint::GLCullFace, std::move(paramBuffer));
520 }
521
CaptureDeleteBuffers(const State & glState,bool isCallValid,GLsizei n,const BufferID * buffersPacked)522 CallCapture CaptureDeleteBuffers(const State &glState,
523 bool isCallValid,
524 GLsizei n,
525 const BufferID *buffersPacked)
526 {
527 ParamBuffer paramBuffer;
528
529 paramBuffer.addValueParam("n", ParamType::TGLsizei, n);
530
531 if (isCallValid)
532 {
533 ParamCapture buffersPackedParam("buffersPacked", ParamType::TBufferIDConstPointer);
534 InitParamValue(ParamType::TBufferIDConstPointer, buffersPacked, &buffersPackedParam.value);
535 CaptureDeleteBuffers_buffersPacked(glState, isCallValid, n, buffersPacked,
536 &buffersPackedParam);
537 paramBuffer.addParam(std::move(buffersPackedParam));
538 }
539 else
540 {
541 ParamCapture buffersPackedParam("buffersPacked", ParamType::TBufferIDConstPointer);
542 InitParamValue(ParamType::TBufferIDConstPointer, static_cast<const BufferID *>(nullptr),
543 &buffersPackedParam.value);
544 paramBuffer.addParam(std::move(buffersPackedParam));
545 }
546
547 return CallCapture(angle::EntryPoint::GLDeleteBuffers, std::move(paramBuffer));
548 }
549
CaptureDeleteFramebuffers(const State & glState,bool isCallValid,GLsizei n,const FramebufferID * framebuffersPacked)550 CallCapture CaptureDeleteFramebuffers(const State &glState,
551 bool isCallValid,
552 GLsizei n,
553 const FramebufferID *framebuffersPacked)
554 {
555 ParamBuffer paramBuffer;
556
557 paramBuffer.addValueParam("n", ParamType::TGLsizei, n);
558
559 if (isCallValid)
560 {
561 ParamCapture framebuffersPackedParam("framebuffersPacked",
562 ParamType::TFramebufferIDConstPointer);
563 InitParamValue(ParamType::TFramebufferIDConstPointer, framebuffersPacked,
564 &framebuffersPackedParam.value);
565 CaptureDeleteFramebuffers_framebuffersPacked(glState, isCallValid, n, framebuffersPacked,
566 &framebuffersPackedParam);
567 paramBuffer.addParam(std::move(framebuffersPackedParam));
568 }
569 else
570 {
571 ParamCapture framebuffersPackedParam("framebuffersPacked",
572 ParamType::TFramebufferIDConstPointer);
573 InitParamValue(ParamType::TFramebufferIDConstPointer,
574 static_cast<const FramebufferID *>(nullptr), &framebuffersPackedParam.value);
575 paramBuffer.addParam(std::move(framebuffersPackedParam));
576 }
577
578 return CallCapture(angle::EntryPoint::GLDeleteFramebuffers, std::move(paramBuffer));
579 }
580
CaptureDeleteProgram(const State & glState,bool isCallValid,ShaderProgramID programPacked)581 CallCapture CaptureDeleteProgram(const State &glState,
582 bool isCallValid,
583 ShaderProgramID programPacked)
584 {
585 ParamBuffer paramBuffer;
586
587 paramBuffer.addValueParam("programPacked", ParamType::TShaderProgramID, programPacked);
588
589 return CallCapture(angle::EntryPoint::GLDeleteProgram, std::move(paramBuffer));
590 }
591
CaptureDeleteRenderbuffers(const State & glState,bool isCallValid,GLsizei n,const RenderbufferID * renderbuffersPacked)592 CallCapture CaptureDeleteRenderbuffers(const State &glState,
593 bool isCallValid,
594 GLsizei n,
595 const RenderbufferID *renderbuffersPacked)
596 {
597 ParamBuffer paramBuffer;
598
599 paramBuffer.addValueParam("n", ParamType::TGLsizei, n);
600
601 if (isCallValid)
602 {
603 ParamCapture renderbuffersPackedParam("renderbuffersPacked",
604 ParamType::TRenderbufferIDConstPointer);
605 InitParamValue(ParamType::TRenderbufferIDConstPointer, renderbuffersPacked,
606 &renderbuffersPackedParam.value);
607 CaptureDeleteRenderbuffers_renderbuffersPacked(glState, isCallValid, n, renderbuffersPacked,
608 &renderbuffersPackedParam);
609 paramBuffer.addParam(std::move(renderbuffersPackedParam));
610 }
611 else
612 {
613 ParamCapture renderbuffersPackedParam("renderbuffersPacked",
614 ParamType::TRenderbufferIDConstPointer);
615 InitParamValue(ParamType::TRenderbufferIDConstPointer,
616 static_cast<const RenderbufferID *>(nullptr),
617 &renderbuffersPackedParam.value);
618 paramBuffer.addParam(std::move(renderbuffersPackedParam));
619 }
620
621 return CallCapture(angle::EntryPoint::GLDeleteRenderbuffers, std::move(paramBuffer));
622 }
623
CaptureDeleteShader(const State & glState,bool isCallValid,ShaderProgramID shaderPacked)624 CallCapture CaptureDeleteShader(const State &glState,
625 bool isCallValid,
626 ShaderProgramID shaderPacked)
627 {
628 ParamBuffer paramBuffer;
629
630 paramBuffer.addValueParam("shaderPacked", ParamType::TShaderProgramID, shaderPacked);
631
632 return CallCapture(angle::EntryPoint::GLDeleteShader, std::move(paramBuffer));
633 }
634
CaptureDeleteTextures(const State & glState,bool isCallValid,GLsizei n,const TextureID * texturesPacked)635 CallCapture CaptureDeleteTextures(const State &glState,
636 bool isCallValid,
637 GLsizei n,
638 const TextureID *texturesPacked)
639 {
640 ParamBuffer paramBuffer;
641
642 paramBuffer.addValueParam("n", ParamType::TGLsizei, n);
643
644 if (isCallValid)
645 {
646 ParamCapture texturesPackedParam("texturesPacked", ParamType::TTextureIDConstPointer);
647 InitParamValue(ParamType::TTextureIDConstPointer, texturesPacked,
648 &texturesPackedParam.value);
649 CaptureDeleteTextures_texturesPacked(glState, isCallValid, n, texturesPacked,
650 &texturesPackedParam);
651 paramBuffer.addParam(std::move(texturesPackedParam));
652 }
653 else
654 {
655 ParamCapture texturesPackedParam("texturesPacked", ParamType::TTextureIDConstPointer);
656 InitParamValue(ParamType::TTextureIDConstPointer, static_cast<const TextureID *>(nullptr),
657 &texturesPackedParam.value);
658 paramBuffer.addParam(std::move(texturesPackedParam));
659 }
660
661 return CallCapture(angle::EntryPoint::GLDeleteTextures, std::move(paramBuffer));
662 }
663
CaptureDepthFunc(const State & glState,bool isCallValid,GLenum func)664 CallCapture CaptureDepthFunc(const State &glState, bool isCallValid, GLenum func)
665 {
666 ParamBuffer paramBuffer;
667
668 paramBuffer.addEnumParam("func", GLESEnum::DepthFunction, ParamType::TGLenum, func);
669
670 return CallCapture(angle::EntryPoint::GLDepthFunc, std::move(paramBuffer));
671 }
672
CaptureDepthMask(const State & glState,bool isCallValid,GLboolean flag)673 CallCapture CaptureDepthMask(const State &glState, bool isCallValid, GLboolean flag)
674 {
675 ParamBuffer paramBuffer;
676
677 paramBuffer.addValueParam("flag", ParamType::TGLboolean, flag);
678
679 return CallCapture(angle::EntryPoint::GLDepthMask, std::move(paramBuffer));
680 }
681
CaptureDepthRangef(const State & glState,bool isCallValid,GLfloat n,GLfloat f)682 CallCapture CaptureDepthRangef(const State &glState, bool isCallValid, GLfloat n, GLfloat f)
683 {
684 ParamBuffer paramBuffer;
685
686 paramBuffer.addValueParam("n", ParamType::TGLfloat, n);
687 paramBuffer.addValueParam("f", ParamType::TGLfloat, f);
688
689 return CallCapture(angle::EntryPoint::GLDepthRangef, std::move(paramBuffer));
690 }
691
CaptureDetachShader(const State & glState,bool isCallValid,ShaderProgramID programPacked,ShaderProgramID shaderPacked)692 CallCapture CaptureDetachShader(const State &glState,
693 bool isCallValid,
694 ShaderProgramID programPacked,
695 ShaderProgramID shaderPacked)
696 {
697 ParamBuffer paramBuffer;
698
699 paramBuffer.addValueParam("programPacked", ParamType::TShaderProgramID, programPacked);
700 paramBuffer.addValueParam("shaderPacked", ParamType::TShaderProgramID, shaderPacked);
701
702 return CallCapture(angle::EntryPoint::GLDetachShader, std::move(paramBuffer));
703 }
704
CaptureDisable(const State & glState,bool isCallValid,GLenum cap)705 CallCapture CaptureDisable(const State &glState, bool isCallValid, GLenum cap)
706 {
707 ParamBuffer paramBuffer;
708
709 paramBuffer.addEnumParam("cap", GLESEnum::EnableCap, ParamType::TGLenum, cap);
710
711 return CallCapture(angle::EntryPoint::GLDisable, std::move(paramBuffer));
712 }
713
CaptureDisableVertexAttribArray(const State & glState,bool isCallValid,GLuint index)714 CallCapture CaptureDisableVertexAttribArray(const State &glState, bool isCallValid, GLuint index)
715 {
716 ParamBuffer paramBuffer;
717
718 paramBuffer.addValueParam("index", ParamType::TGLuint, index);
719
720 return CallCapture(angle::EntryPoint::GLDisableVertexAttribArray, std::move(paramBuffer));
721 }
722
CaptureDrawArrays(const State & glState,bool isCallValid,PrimitiveMode modePacked,GLint first,GLsizei count)723 CallCapture CaptureDrawArrays(const State &glState,
724 bool isCallValid,
725 PrimitiveMode modePacked,
726 GLint first,
727 GLsizei count)
728 {
729 ParamBuffer paramBuffer;
730
731 paramBuffer.addValueParam("modePacked", ParamType::TPrimitiveMode, modePacked);
732 paramBuffer.addValueParam("first", ParamType::TGLint, first);
733 paramBuffer.addValueParam("count", ParamType::TGLsizei, count);
734
735 return CallCapture(angle::EntryPoint::GLDrawArrays, std::move(paramBuffer));
736 }
737
CaptureDrawElements(const State & glState,bool isCallValid,PrimitiveMode modePacked,GLsizei count,DrawElementsType typePacked,const void * indices)738 CallCapture CaptureDrawElements(const State &glState,
739 bool isCallValid,
740 PrimitiveMode modePacked,
741 GLsizei count,
742 DrawElementsType typePacked,
743 const void *indices)
744 {
745 ParamBuffer paramBuffer;
746
747 paramBuffer.addValueParam("modePacked", ParamType::TPrimitiveMode, modePacked);
748 paramBuffer.addValueParam("count", ParamType::TGLsizei, count);
749 paramBuffer.addValueParam("typePacked", ParamType::TDrawElementsType, typePacked);
750
751 if (isCallValid)
752 {
753 ParamCapture indicesParam("indices", ParamType::TvoidConstPointer);
754 InitParamValue(ParamType::TvoidConstPointer, indices, &indicesParam.value);
755 CaptureDrawElements_indices(glState, isCallValid, modePacked, count, typePacked, indices,
756 &indicesParam);
757 paramBuffer.addParam(std::move(indicesParam));
758 }
759 else
760 {
761 ParamCapture indicesParam("indices", ParamType::TvoidConstPointer);
762 InitParamValue(ParamType::TvoidConstPointer, static_cast<const void *>(nullptr),
763 &indicesParam.value);
764 paramBuffer.addParam(std::move(indicesParam));
765 }
766
767 return CallCapture(angle::EntryPoint::GLDrawElements, std::move(paramBuffer));
768 }
769
CaptureEnable(const State & glState,bool isCallValid,GLenum cap)770 CallCapture CaptureEnable(const State &glState, bool isCallValid, GLenum cap)
771 {
772 ParamBuffer paramBuffer;
773
774 paramBuffer.addEnumParam("cap", GLESEnum::EnableCap, ParamType::TGLenum, cap);
775
776 return CallCapture(angle::EntryPoint::GLEnable, std::move(paramBuffer));
777 }
778
CaptureEnableVertexAttribArray(const State & glState,bool isCallValid,GLuint index)779 CallCapture CaptureEnableVertexAttribArray(const State &glState, bool isCallValid, GLuint index)
780 {
781 ParamBuffer paramBuffer;
782
783 paramBuffer.addValueParam("index", ParamType::TGLuint, index);
784
785 return CallCapture(angle::EntryPoint::GLEnableVertexAttribArray, std::move(paramBuffer));
786 }
787
CaptureFinish(const State & glState,bool isCallValid)788 CallCapture CaptureFinish(const State &glState, bool isCallValid)
789 {
790 ParamBuffer paramBuffer;
791
792 return CallCapture(angle::EntryPoint::GLFinish, std::move(paramBuffer));
793 }
794
CaptureFlush(const State & glState,bool isCallValid)795 CallCapture CaptureFlush(const State &glState, bool isCallValid)
796 {
797 ParamBuffer paramBuffer;
798
799 return CallCapture(angle::EntryPoint::GLFlush, std::move(paramBuffer));
800 }
801
CaptureFramebufferRenderbuffer(const State & glState,bool isCallValid,GLenum target,GLenum attachment,GLenum renderbuffertarget,RenderbufferID renderbufferPacked)802 CallCapture CaptureFramebufferRenderbuffer(const State &glState,
803 bool isCallValid,
804 GLenum target,
805 GLenum attachment,
806 GLenum renderbuffertarget,
807 RenderbufferID renderbufferPacked)
808 {
809 ParamBuffer paramBuffer;
810
811 paramBuffer.addEnumParam("target", GLESEnum::FramebufferTarget, ParamType::TGLenum, target);
812 paramBuffer.addEnumParam("attachment", GLESEnum::FramebufferAttachment, ParamType::TGLenum,
813 attachment);
814 paramBuffer.addEnumParam("renderbuffertarget", GLESEnum::RenderbufferTarget, ParamType::TGLenum,
815 renderbuffertarget);
816 paramBuffer.addValueParam("renderbufferPacked", ParamType::TRenderbufferID, renderbufferPacked);
817
818 return CallCapture(angle::EntryPoint::GLFramebufferRenderbuffer, std::move(paramBuffer));
819 }
820
CaptureFramebufferTexture2D(const State & glState,bool isCallValid,GLenum target,GLenum attachment,TextureTarget textargetPacked,TextureID texturePacked,GLint level)821 CallCapture CaptureFramebufferTexture2D(const State &glState,
822 bool isCallValid,
823 GLenum target,
824 GLenum attachment,
825 TextureTarget textargetPacked,
826 TextureID texturePacked,
827 GLint level)
828 {
829 ParamBuffer paramBuffer;
830
831 paramBuffer.addEnumParam("target", GLESEnum::FramebufferTarget, ParamType::TGLenum, target);
832 paramBuffer.addEnumParam("attachment", GLESEnum::FramebufferAttachment, ParamType::TGLenum,
833 attachment);
834 paramBuffer.addValueParam("textargetPacked", ParamType::TTextureTarget, textargetPacked);
835 paramBuffer.addValueParam("texturePacked", ParamType::TTextureID, texturePacked);
836 paramBuffer.addValueParam("level", ParamType::TGLint, level);
837
838 return CallCapture(angle::EntryPoint::GLFramebufferTexture2D, std::move(paramBuffer));
839 }
840
CaptureFrontFace(const State & glState,bool isCallValid,GLenum mode)841 CallCapture CaptureFrontFace(const State &glState, bool isCallValid, GLenum mode)
842 {
843 ParamBuffer paramBuffer;
844
845 paramBuffer.addEnumParam("mode", GLESEnum::FrontFaceDirection, ParamType::TGLenum, mode);
846
847 return CallCapture(angle::EntryPoint::GLFrontFace, std::move(paramBuffer));
848 }
849
CaptureGenBuffers(const State & glState,bool isCallValid,GLsizei n,BufferID * buffersPacked)850 CallCapture CaptureGenBuffers(const State &glState,
851 bool isCallValid,
852 GLsizei n,
853 BufferID *buffersPacked)
854 {
855 ParamBuffer paramBuffer;
856
857 paramBuffer.addValueParam("n", ParamType::TGLsizei, n);
858
859 if (isCallValid)
860 {
861 ParamCapture buffersPackedParam("buffersPacked", ParamType::TBufferIDPointer);
862 InitParamValue(ParamType::TBufferIDPointer, buffersPacked, &buffersPackedParam.value);
863 CaptureGenBuffers_buffersPacked(glState, isCallValid, n, buffersPacked,
864 &buffersPackedParam);
865 paramBuffer.addParam(std::move(buffersPackedParam));
866 }
867 else
868 {
869 ParamCapture buffersPackedParam("buffersPacked", ParamType::TBufferIDPointer);
870 InitParamValue(ParamType::TBufferIDPointer, static_cast<BufferID *>(nullptr),
871 &buffersPackedParam.value);
872 paramBuffer.addParam(std::move(buffersPackedParam));
873 }
874
875 return CallCapture(angle::EntryPoint::GLGenBuffers, std::move(paramBuffer));
876 }
877
CaptureGenFramebuffers(const State & glState,bool isCallValid,GLsizei n,FramebufferID * framebuffersPacked)878 CallCapture CaptureGenFramebuffers(const State &glState,
879 bool isCallValid,
880 GLsizei n,
881 FramebufferID *framebuffersPacked)
882 {
883 ParamBuffer paramBuffer;
884
885 paramBuffer.addValueParam("n", ParamType::TGLsizei, n);
886
887 if (isCallValid)
888 {
889 ParamCapture framebuffersPackedParam("framebuffersPacked",
890 ParamType::TFramebufferIDPointer);
891 InitParamValue(ParamType::TFramebufferIDPointer, framebuffersPacked,
892 &framebuffersPackedParam.value);
893 CaptureGenFramebuffers_framebuffersPacked(glState, isCallValid, n, framebuffersPacked,
894 &framebuffersPackedParam);
895 paramBuffer.addParam(std::move(framebuffersPackedParam));
896 }
897 else
898 {
899 ParamCapture framebuffersPackedParam("framebuffersPacked",
900 ParamType::TFramebufferIDPointer);
901 InitParamValue(ParamType::TFramebufferIDPointer, static_cast<FramebufferID *>(nullptr),
902 &framebuffersPackedParam.value);
903 paramBuffer.addParam(std::move(framebuffersPackedParam));
904 }
905
906 return CallCapture(angle::EntryPoint::GLGenFramebuffers, std::move(paramBuffer));
907 }
908
CaptureGenRenderbuffers(const State & glState,bool isCallValid,GLsizei n,RenderbufferID * renderbuffersPacked)909 CallCapture CaptureGenRenderbuffers(const State &glState,
910 bool isCallValid,
911 GLsizei n,
912 RenderbufferID *renderbuffersPacked)
913 {
914 ParamBuffer paramBuffer;
915
916 paramBuffer.addValueParam("n", ParamType::TGLsizei, n);
917
918 if (isCallValid)
919 {
920 ParamCapture renderbuffersPackedParam("renderbuffersPacked",
921 ParamType::TRenderbufferIDPointer);
922 InitParamValue(ParamType::TRenderbufferIDPointer, renderbuffersPacked,
923 &renderbuffersPackedParam.value);
924 CaptureGenRenderbuffers_renderbuffersPacked(glState, isCallValid, n, renderbuffersPacked,
925 &renderbuffersPackedParam);
926 paramBuffer.addParam(std::move(renderbuffersPackedParam));
927 }
928 else
929 {
930 ParamCapture renderbuffersPackedParam("renderbuffersPacked",
931 ParamType::TRenderbufferIDPointer);
932 InitParamValue(ParamType::TRenderbufferIDPointer, static_cast<RenderbufferID *>(nullptr),
933 &renderbuffersPackedParam.value);
934 paramBuffer.addParam(std::move(renderbuffersPackedParam));
935 }
936
937 return CallCapture(angle::EntryPoint::GLGenRenderbuffers, std::move(paramBuffer));
938 }
939
CaptureGenTextures(const State & glState,bool isCallValid,GLsizei n,TextureID * texturesPacked)940 CallCapture CaptureGenTextures(const State &glState,
941 bool isCallValid,
942 GLsizei n,
943 TextureID *texturesPacked)
944 {
945 ParamBuffer paramBuffer;
946
947 paramBuffer.addValueParam("n", ParamType::TGLsizei, n);
948
949 if (isCallValid)
950 {
951 ParamCapture texturesPackedParam("texturesPacked", ParamType::TTextureIDPointer);
952 InitParamValue(ParamType::TTextureIDPointer, texturesPacked, &texturesPackedParam.value);
953 CaptureGenTextures_texturesPacked(glState, isCallValid, n, texturesPacked,
954 &texturesPackedParam);
955 paramBuffer.addParam(std::move(texturesPackedParam));
956 }
957 else
958 {
959 ParamCapture texturesPackedParam("texturesPacked", ParamType::TTextureIDPointer);
960 InitParamValue(ParamType::TTextureIDPointer, static_cast<TextureID *>(nullptr),
961 &texturesPackedParam.value);
962 paramBuffer.addParam(std::move(texturesPackedParam));
963 }
964
965 return CallCapture(angle::EntryPoint::GLGenTextures, std::move(paramBuffer));
966 }
967
CaptureGenerateMipmap(const State & glState,bool isCallValid,TextureType targetPacked)968 CallCapture CaptureGenerateMipmap(const State &glState, bool isCallValid, TextureType targetPacked)
969 {
970 ParamBuffer paramBuffer;
971
972 paramBuffer.addValueParam("targetPacked", ParamType::TTextureType, targetPacked);
973
974 return CallCapture(angle::EntryPoint::GLGenerateMipmap, std::move(paramBuffer));
975 }
976
CaptureGetActiveAttrib(const State & glState,bool isCallValid,ShaderProgramID programPacked,GLuint index,GLsizei bufSize,GLsizei * length,GLint * size,GLenum * type,GLchar * name)977 CallCapture CaptureGetActiveAttrib(const State &glState,
978 bool isCallValid,
979 ShaderProgramID programPacked,
980 GLuint index,
981 GLsizei bufSize,
982 GLsizei *length,
983 GLint *size,
984 GLenum *type,
985 GLchar *name)
986 {
987 ParamBuffer paramBuffer;
988
989 paramBuffer.addValueParam("programPacked", ParamType::TShaderProgramID, programPacked);
990 paramBuffer.addValueParam("index", ParamType::TGLuint, index);
991 paramBuffer.addValueParam("bufSize", ParamType::TGLsizei, bufSize);
992
993 if (isCallValid)
994 {
995 ParamCapture lengthParam("length", ParamType::TGLsizeiPointer);
996 InitParamValue(ParamType::TGLsizeiPointer, length, &lengthParam.value);
997 CaptureGetActiveAttrib_length(glState, isCallValid, programPacked, index, bufSize, length,
998 size, type, name, &lengthParam);
999 paramBuffer.addParam(std::move(lengthParam));
1000 }
1001 else
1002 {
1003 ParamCapture lengthParam("length", ParamType::TGLsizeiPointer);
1004 InitParamValue(ParamType::TGLsizeiPointer, static_cast<GLsizei *>(nullptr),
1005 &lengthParam.value);
1006 paramBuffer.addParam(std::move(lengthParam));
1007 }
1008
1009 if (isCallValid)
1010 {
1011 ParamCapture sizeParam("size", ParamType::TGLintPointer);
1012 InitParamValue(ParamType::TGLintPointer, size, &sizeParam.value);
1013 CaptureGetActiveAttrib_size(glState, isCallValid, programPacked, index, bufSize, length,
1014 size, type, name, &sizeParam);
1015 paramBuffer.addParam(std::move(sizeParam));
1016 }
1017 else
1018 {
1019 ParamCapture sizeParam("size", ParamType::TGLintPointer);
1020 InitParamValue(ParamType::TGLintPointer, static_cast<GLint *>(nullptr), &sizeParam.value);
1021 paramBuffer.addParam(std::move(sizeParam));
1022 }
1023
1024 if (isCallValid)
1025 {
1026 ParamCapture typeParam("type", ParamType::TGLenumPointer);
1027 InitParamValue(ParamType::TGLenumPointer, type, &typeParam.value);
1028 CaptureGetActiveAttrib_type(glState, isCallValid, programPacked, index, bufSize, length,
1029 size, type, name, &typeParam);
1030 paramBuffer.addParam(std::move(typeParam));
1031 }
1032 else
1033 {
1034 ParamCapture typeParam("type", ParamType::TGLenumPointer);
1035 InitParamValue(ParamType::TGLenumPointer, static_cast<GLenum *>(nullptr), &typeParam.value);
1036 paramBuffer.addParam(std::move(typeParam));
1037 }
1038
1039 if (isCallValid)
1040 {
1041 ParamCapture nameParam("name", ParamType::TGLcharPointer);
1042 InitParamValue(ParamType::TGLcharPointer, name, &nameParam.value);
1043 CaptureGetActiveAttrib_name(glState, isCallValid, programPacked, index, bufSize, length,
1044 size, type, name, &nameParam);
1045 paramBuffer.addParam(std::move(nameParam));
1046 }
1047 else
1048 {
1049 ParamCapture nameParam("name", ParamType::TGLcharPointer);
1050 InitParamValue(ParamType::TGLcharPointer, static_cast<GLchar *>(nullptr), &nameParam.value);
1051 paramBuffer.addParam(std::move(nameParam));
1052 }
1053
1054 return CallCapture(angle::EntryPoint::GLGetActiveAttrib, std::move(paramBuffer));
1055 }
1056
CaptureGetActiveUniform(const State & glState,bool isCallValid,ShaderProgramID programPacked,GLuint index,GLsizei bufSize,GLsizei * length,GLint * size,GLenum * type,GLchar * name)1057 CallCapture CaptureGetActiveUniform(const State &glState,
1058 bool isCallValid,
1059 ShaderProgramID programPacked,
1060 GLuint index,
1061 GLsizei bufSize,
1062 GLsizei *length,
1063 GLint *size,
1064 GLenum *type,
1065 GLchar *name)
1066 {
1067 ParamBuffer paramBuffer;
1068
1069 paramBuffer.addValueParam("programPacked", ParamType::TShaderProgramID, programPacked);
1070 paramBuffer.addValueParam("index", ParamType::TGLuint, index);
1071 paramBuffer.addValueParam("bufSize", ParamType::TGLsizei, bufSize);
1072
1073 if (isCallValid)
1074 {
1075 ParamCapture lengthParam("length", ParamType::TGLsizeiPointer);
1076 InitParamValue(ParamType::TGLsizeiPointer, length, &lengthParam.value);
1077 CaptureGetActiveUniform_length(glState, isCallValid, programPacked, index, bufSize, length,
1078 size, type, name, &lengthParam);
1079 paramBuffer.addParam(std::move(lengthParam));
1080 }
1081 else
1082 {
1083 ParamCapture lengthParam("length", ParamType::TGLsizeiPointer);
1084 InitParamValue(ParamType::TGLsizeiPointer, static_cast<GLsizei *>(nullptr),
1085 &lengthParam.value);
1086 paramBuffer.addParam(std::move(lengthParam));
1087 }
1088
1089 if (isCallValid)
1090 {
1091 ParamCapture sizeParam("size", ParamType::TGLintPointer);
1092 InitParamValue(ParamType::TGLintPointer, size, &sizeParam.value);
1093 CaptureGetActiveUniform_size(glState, isCallValid, programPacked, index, bufSize, length,
1094 size, type, name, &sizeParam);
1095 paramBuffer.addParam(std::move(sizeParam));
1096 }
1097 else
1098 {
1099 ParamCapture sizeParam("size", ParamType::TGLintPointer);
1100 InitParamValue(ParamType::TGLintPointer, static_cast<GLint *>(nullptr), &sizeParam.value);
1101 paramBuffer.addParam(std::move(sizeParam));
1102 }
1103
1104 if (isCallValid)
1105 {
1106 ParamCapture typeParam("type", ParamType::TGLenumPointer);
1107 InitParamValue(ParamType::TGLenumPointer, type, &typeParam.value);
1108 CaptureGetActiveUniform_type(glState, isCallValid, programPacked, index, bufSize, length,
1109 size, type, name, &typeParam);
1110 paramBuffer.addParam(std::move(typeParam));
1111 }
1112 else
1113 {
1114 ParamCapture typeParam("type", ParamType::TGLenumPointer);
1115 InitParamValue(ParamType::TGLenumPointer, static_cast<GLenum *>(nullptr), &typeParam.value);
1116 paramBuffer.addParam(std::move(typeParam));
1117 }
1118
1119 if (isCallValid)
1120 {
1121 ParamCapture nameParam("name", ParamType::TGLcharPointer);
1122 InitParamValue(ParamType::TGLcharPointer, name, &nameParam.value);
1123 CaptureGetActiveUniform_name(glState, isCallValid, programPacked, index, bufSize, length,
1124 size, type, name, &nameParam);
1125 paramBuffer.addParam(std::move(nameParam));
1126 }
1127 else
1128 {
1129 ParamCapture nameParam("name", ParamType::TGLcharPointer);
1130 InitParamValue(ParamType::TGLcharPointer, static_cast<GLchar *>(nullptr), &nameParam.value);
1131 paramBuffer.addParam(std::move(nameParam));
1132 }
1133
1134 return CallCapture(angle::EntryPoint::GLGetActiveUniform, std::move(paramBuffer));
1135 }
1136
CaptureGetAttachedShaders(const State & glState,bool isCallValid,ShaderProgramID programPacked,GLsizei maxCount,GLsizei * count,ShaderProgramID * shadersPacked)1137 CallCapture CaptureGetAttachedShaders(const State &glState,
1138 bool isCallValid,
1139 ShaderProgramID programPacked,
1140 GLsizei maxCount,
1141 GLsizei *count,
1142 ShaderProgramID *shadersPacked)
1143 {
1144 ParamBuffer paramBuffer;
1145
1146 paramBuffer.addValueParam("programPacked", ParamType::TShaderProgramID, programPacked);
1147 paramBuffer.addValueParam("maxCount", ParamType::TGLsizei, maxCount);
1148
1149 if (isCallValid)
1150 {
1151 ParamCapture countParam("count", ParamType::TGLsizeiPointer);
1152 InitParamValue(ParamType::TGLsizeiPointer, count, &countParam.value);
1153 CaptureGetAttachedShaders_count(glState, isCallValid, programPacked, maxCount, count,
1154 shadersPacked, &countParam);
1155 paramBuffer.addParam(std::move(countParam));
1156 }
1157 else
1158 {
1159 ParamCapture countParam("count", ParamType::TGLsizeiPointer);
1160 InitParamValue(ParamType::TGLsizeiPointer, static_cast<GLsizei *>(nullptr),
1161 &countParam.value);
1162 paramBuffer.addParam(std::move(countParam));
1163 }
1164
1165 if (isCallValid)
1166 {
1167 ParamCapture shadersPackedParam("shadersPacked", ParamType::TShaderProgramIDPointer);
1168 InitParamValue(ParamType::TShaderProgramIDPointer, shadersPacked,
1169 &shadersPackedParam.value);
1170 CaptureGetAttachedShaders_shadersPacked(glState, isCallValid, programPacked, maxCount,
1171 count, shadersPacked, &shadersPackedParam);
1172 paramBuffer.addParam(std::move(shadersPackedParam));
1173 }
1174 else
1175 {
1176 ParamCapture shadersPackedParam("shadersPacked", ParamType::TShaderProgramIDPointer);
1177 InitParamValue(ParamType::TShaderProgramIDPointer, static_cast<ShaderProgramID *>(nullptr),
1178 &shadersPackedParam.value);
1179 paramBuffer.addParam(std::move(shadersPackedParam));
1180 }
1181
1182 return CallCapture(angle::EntryPoint::GLGetAttachedShaders, std::move(paramBuffer));
1183 }
1184
CaptureGetAttribLocation(const State & glState,bool isCallValid,ShaderProgramID programPacked,const GLchar * name,GLint returnValue)1185 CallCapture CaptureGetAttribLocation(const State &glState,
1186 bool isCallValid,
1187 ShaderProgramID programPacked,
1188 const GLchar *name,
1189 GLint returnValue)
1190 {
1191 ParamBuffer paramBuffer;
1192
1193 paramBuffer.addValueParam("programPacked", ParamType::TShaderProgramID, programPacked);
1194
1195 if (isCallValid)
1196 {
1197 ParamCapture nameParam("name", ParamType::TGLcharConstPointer);
1198 InitParamValue(ParamType::TGLcharConstPointer, name, &nameParam.value);
1199 CaptureGetAttribLocation_name(glState, isCallValid, programPacked, name, &nameParam);
1200 paramBuffer.addParam(std::move(nameParam));
1201 }
1202 else
1203 {
1204 ParamCapture nameParam("name", ParamType::TGLcharConstPointer);
1205 InitParamValue(ParamType::TGLcharConstPointer, static_cast<const GLchar *>(nullptr),
1206 &nameParam.value);
1207 paramBuffer.addParam(std::move(nameParam));
1208 }
1209
1210 ParamCapture returnValueCapture("returnValue", ParamType::TGLint);
1211 InitParamValue(ParamType::TGLint, returnValue, &returnValueCapture.value);
1212 paramBuffer.addReturnValue(std::move(returnValueCapture));
1213
1214 return CallCapture(angle::EntryPoint::GLGetAttribLocation, std::move(paramBuffer));
1215 }
1216
CaptureGetBooleanv(const State & glState,bool isCallValid,GLenum pname,GLboolean * data)1217 CallCapture CaptureGetBooleanv(const State &glState,
1218 bool isCallValid,
1219 GLenum pname,
1220 GLboolean *data)
1221 {
1222 ParamBuffer paramBuffer;
1223
1224 paramBuffer.addEnumParam("pname", GLESEnum::GetPName, ParamType::TGLenum, pname);
1225
1226 if (isCallValid)
1227 {
1228 ParamCapture dataParam("data", ParamType::TGLbooleanPointer);
1229 InitParamValue(ParamType::TGLbooleanPointer, data, &dataParam.value);
1230 CaptureGetBooleanv_data(glState, isCallValid, pname, data, &dataParam);
1231 paramBuffer.addParam(std::move(dataParam));
1232 }
1233 else
1234 {
1235 ParamCapture dataParam("data", ParamType::TGLbooleanPointer);
1236 InitParamValue(ParamType::TGLbooleanPointer, static_cast<GLboolean *>(nullptr),
1237 &dataParam.value);
1238 paramBuffer.addParam(std::move(dataParam));
1239 }
1240
1241 return CallCapture(angle::EntryPoint::GLGetBooleanv, std::move(paramBuffer));
1242 }
1243
CaptureGetBufferParameteriv(const State & glState,bool isCallValid,BufferBinding targetPacked,GLenum pname,GLint * params)1244 CallCapture CaptureGetBufferParameteriv(const State &glState,
1245 bool isCallValid,
1246 BufferBinding targetPacked,
1247 GLenum pname,
1248 GLint *params)
1249 {
1250 ParamBuffer paramBuffer;
1251
1252 paramBuffer.addValueParam("targetPacked", ParamType::TBufferBinding, targetPacked);
1253 paramBuffer.addEnumParam("pname", GLESEnum::AllEnums, ParamType::TGLenum, pname);
1254
1255 if (isCallValid)
1256 {
1257 ParamCapture paramsParam("params", ParamType::TGLintPointer);
1258 InitParamValue(ParamType::TGLintPointer, params, ¶msParam.value);
1259 CaptureGetBufferParameteriv_params(glState, isCallValid, targetPacked, pname, params,
1260 ¶msParam);
1261 paramBuffer.addParam(std::move(paramsParam));
1262 }
1263 else
1264 {
1265 ParamCapture paramsParam("params", ParamType::TGLintPointer);
1266 InitParamValue(ParamType::TGLintPointer, static_cast<GLint *>(nullptr), ¶msParam.value);
1267 paramBuffer.addParam(std::move(paramsParam));
1268 }
1269
1270 return CallCapture(angle::EntryPoint::GLGetBufferParameteriv, std::move(paramBuffer));
1271 }
1272
CaptureGetError(const State & glState,bool isCallValid,GLenum returnValue)1273 CallCapture CaptureGetError(const State &glState, bool isCallValid, GLenum returnValue)
1274 {
1275 ParamBuffer paramBuffer;
1276
1277 ParamCapture returnValueCapture("returnValue", ParamType::TGLenum);
1278 InitParamValue(ParamType::TGLenum, returnValue, &returnValueCapture.value);
1279 paramBuffer.addReturnValue(std::move(returnValueCapture));
1280
1281 return CallCapture(angle::EntryPoint::GLGetError, std::move(paramBuffer));
1282 }
1283
CaptureGetFloatv(const State & glState,bool isCallValid,GLenum pname,GLfloat * data)1284 CallCapture CaptureGetFloatv(const State &glState, bool isCallValid, GLenum pname, GLfloat *data)
1285 {
1286 ParamBuffer paramBuffer;
1287
1288 paramBuffer.addEnumParam("pname", GLESEnum::GetPName, ParamType::TGLenum, pname);
1289
1290 if (isCallValid)
1291 {
1292 ParamCapture dataParam("data", ParamType::TGLfloatPointer);
1293 InitParamValue(ParamType::TGLfloatPointer, data, &dataParam.value);
1294 CaptureGetFloatv_data(glState, isCallValid, pname, data, &dataParam);
1295 paramBuffer.addParam(std::move(dataParam));
1296 }
1297 else
1298 {
1299 ParamCapture dataParam("data", ParamType::TGLfloatPointer);
1300 InitParamValue(ParamType::TGLfloatPointer, static_cast<GLfloat *>(nullptr),
1301 &dataParam.value);
1302 paramBuffer.addParam(std::move(dataParam));
1303 }
1304
1305 return CallCapture(angle::EntryPoint::GLGetFloatv, std::move(paramBuffer));
1306 }
1307
CaptureGetFramebufferAttachmentParameteriv(const State & glState,bool isCallValid,GLenum target,GLenum attachment,GLenum pname,GLint * params)1308 CallCapture CaptureGetFramebufferAttachmentParameteriv(const State &glState,
1309 bool isCallValid,
1310 GLenum target,
1311 GLenum attachment,
1312 GLenum pname,
1313 GLint *params)
1314 {
1315 ParamBuffer paramBuffer;
1316
1317 paramBuffer.addEnumParam("target", GLESEnum::FramebufferTarget, ParamType::TGLenum, target);
1318 paramBuffer.addEnumParam("attachment", GLESEnum::FramebufferAttachment, ParamType::TGLenum,
1319 attachment);
1320 paramBuffer.addEnumParam("pname", GLESEnum::FramebufferAttachmentParameterName,
1321 ParamType::TGLenum, pname);
1322
1323 if (isCallValid)
1324 {
1325 ParamCapture paramsParam("params", ParamType::TGLintPointer);
1326 InitParamValue(ParamType::TGLintPointer, params, ¶msParam.value);
1327 CaptureGetFramebufferAttachmentParameteriv_params(glState, isCallValid, target, attachment,
1328 pname, params, ¶msParam);
1329 paramBuffer.addParam(std::move(paramsParam));
1330 }
1331 else
1332 {
1333 ParamCapture paramsParam("params", ParamType::TGLintPointer);
1334 InitParamValue(ParamType::TGLintPointer, static_cast<GLint *>(nullptr), ¶msParam.value);
1335 paramBuffer.addParam(std::move(paramsParam));
1336 }
1337
1338 return CallCapture(angle::EntryPoint::GLGetFramebufferAttachmentParameteriv,
1339 std::move(paramBuffer));
1340 }
1341
CaptureGetIntegerv(const State & glState,bool isCallValid,GLenum pname,GLint * data)1342 CallCapture CaptureGetIntegerv(const State &glState, bool isCallValid, GLenum pname, GLint *data)
1343 {
1344 ParamBuffer paramBuffer;
1345
1346 paramBuffer.addEnumParam("pname", GLESEnum::GetPName, ParamType::TGLenum, pname);
1347
1348 if (isCallValid)
1349 {
1350 ParamCapture dataParam("data", ParamType::TGLintPointer);
1351 InitParamValue(ParamType::TGLintPointer, data, &dataParam.value);
1352 CaptureGetIntegerv_data(glState, isCallValid, pname, data, &dataParam);
1353 paramBuffer.addParam(std::move(dataParam));
1354 }
1355 else
1356 {
1357 ParamCapture dataParam("data", ParamType::TGLintPointer);
1358 InitParamValue(ParamType::TGLintPointer, static_cast<GLint *>(nullptr), &dataParam.value);
1359 paramBuffer.addParam(std::move(dataParam));
1360 }
1361
1362 return CallCapture(angle::EntryPoint::GLGetIntegerv, std::move(paramBuffer));
1363 }
1364
CaptureGetProgramInfoLog(const State & glState,bool isCallValid,ShaderProgramID programPacked,GLsizei bufSize,GLsizei * length,GLchar * infoLog)1365 CallCapture CaptureGetProgramInfoLog(const State &glState,
1366 bool isCallValid,
1367 ShaderProgramID programPacked,
1368 GLsizei bufSize,
1369 GLsizei *length,
1370 GLchar *infoLog)
1371 {
1372 ParamBuffer paramBuffer;
1373
1374 paramBuffer.addValueParam("programPacked", ParamType::TShaderProgramID, programPacked);
1375 paramBuffer.addValueParam("bufSize", ParamType::TGLsizei, bufSize);
1376
1377 if (isCallValid)
1378 {
1379 ParamCapture lengthParam("length", ParamType::TGLsizeiPointer);
1380 InitParamValue(ParamType::TGLsizeiPointer, length, &lengthParam.value);
1381 CaptureGetProgramInfoLog_length(glState, isCallValid, programPacked, bufSize, length,
1382 infoLog, &lengthParam);
1383 paramBuffer.addParam(std::move(lengthParam));
1384 }
1385 else
1386 {
1387 ParamCapture lengthParam("length", ParamType::TGLsizeiPointer);
1388 InitParamValue(ParamType::TGLsizeiPointer, static_cast<GLsizei *>(nullptr),
1389 &lengthParam.value);
1390 paramBuffer.addParam(std::move(lengthParam));
1391 }
1392
1393 if (isCallValid)
1394 {
1395 ParamCapture infoLogParam("infoLog", ParamType::TGLcharPointer);
1396 InitParamValue(ParamType::TGLcharPointer, infoLog, &infoLogParam.value);
1397 CaptureGetProgramInfoLog_infoLog(glState, isCallValid, programPacked, bufSize, length,
1398 infoLog, &infoLogParam);
1399 paramBuffer.addParam(std::move(infoLogParam));
1400 }
1401 else
1402 {
1403 ParamCapture infoLogParam("infoLog", ParamType::TGLcharPointer);
1404 InitParamValue(ParamType::TGLcharPointer, static_cast<GLchar *>(nullptr),
1405 &infoLogParam.value);
1406 paramBuffer.addParam(std::move(infoLogParam));
1407 }
1408
1409 return CallCapture(angle::EntryPoint::GLGetProgramInfoLog, std::move(paramBuffer));
1410 }
1411
CaptureGetProgramiv(const State & glState,bool isCallValid,ShaderProgramID programPacked,GLenum pname,GLint * params)1412 CallCapture CaptureGetProgramiv(const State &glState,
1413 bool isCallValid,
1414 ShaderProgramID programPacked,
1415 GLenum pname,
1416 GLint *params)
1417 {
1418 ParamBuffer paramBuffer;
1419
1420 paramBuffer.addValueParam("programPacked", ParamType::TShaderProgramID, programPacked);
1421 paramBuffer.addEnumParam("pname", GLESEnum::ProgramPropertyARB, ParamType::TGLenum, pname);
1422
1423 if (isCallValid)
1424 {
1425 ParamCapture paramsParam("params", ParamType::TGLintPointer);
1426 InitParamValue(ParamType::TGLintPointer, params, ¶msParam.value);
1427 CaptureGetProgramiv_params(glState, isCallValid, programPacked, pname, params,
1428 ¶msParam);
1429 paramBuffer.addParam(std::move(paramsParam));
1430 }
1431 else
1432 {
1433 ParamCapture paramsParam("params", ParamType::TGLintPointer);
1434 InitParamValue(ParamType::TGLintPointer, static_cast<GLint *>(nullptr), ¶msParam.value);
1435 paramBuffer.addParam(std::move(paramsParam));
1436 }
1437
1438 return CallCapture(angle::EntryPoint::GLGetProgramiv, std::move(paramBuffer));
1439 }
1440
CaptureGetRenderbufferParameteriv(const State & glState,bool isCallValid,GLenum target,GLenum pname,GLint * params)1441 CallCapture CaptureGetRenderbufferParameteriv(const State &glState,
1442 bool isCallValid,
1443 GLenum target,
1444 GLenum pname,
1445 GLint *params)
1446 {
1447 ParamBuffer paramBuffer;
1448
1449 paramBuffer.addEnumParam("target", GLESEnum::RenderbufferTarget, ParamType::TGLenum, target);
1450 paramBuffer.addEnumParam("pname", GLESEnum::RenderbufferParameterName, ParamType::TGLenum,
1451 pname);
1452
1453 if (isCallValid)
1454 {
1455 ParamCapture paramsParam("params", ParamType::TGLintPointer);
1456 InitParamValue(ParamType::TGLintPointer, params, ¶msParam.value);
1457 CaptureGetRenderbufferParameteriv_params(glState, isCallValid, target, pname, params,
1458 ¶msParam);
1459 paramBuffer.addParam(std::move(paramsParam));
1460 }
1461 else
1462 {
1463 ParamCapture paramsParam("params", ParamType::TGLintPointer);
1464 InitParamValue(ParamType::TGLintPointer, static_cast<GLint *>(nullptr), ¶msParam.value);
1465 paramBuffer.addParam(std::move(paramsParam));
1466 }
1467
1468 return CallCapture(angle::EntryPoint::GLGetRenderbufferParameteriv, std::move(paramBuffer));
1469 }
1470
CaptureGetShaderInfoLog(const State & glState,bool isCallValid,ShaderProgramID shaderPacked,GLsizei bufSize,GLsizei * length,GLchar * infoLog)1471 CallCapture CaptureGetShaderInfoLog(const State &glState,
1472 bool isCallValid,
1473 ShaderProgramID shaderPacked,
1474 GLsizei bufSize,
1475 GLsizei *length,
1476 GLchar *infoLog)
1477 {
1478 ParamBuffer paramBuffer;
1479
1480 paramBuffer.addValueParam("shaderPacked", ParamType::TShaderProgramID, shaderPacked);
1481 paramBuffer.addValueParam("bufSize", ParamType::TGLsizei, bufSize);
1482
1483 if (isCallValid)
1484 {
1485 ParamCapture lengthParam("length", ParamType::TGLsizeiPointer);
1486 InitParamValue(ParamType::TGLsizeiPointer, length, &lengthParam.value);
1487 CaptureGetShaderInfoLog_length(glState, isCallValid, shaderPacked, bufSize, length, infoLog,
1488 &lengthParam);
1489 paramBuffer.addParam(std::move(lengthParam));
1490 }
1491 else
1492 {
1493 ParamCapture lengthParam("length", ParamType::TGLsizeiPointer);
1494 InitParamValue(ParamType::TGLsizeiPointer, static_cast<GLsizei *>(nullptr),
1495 &lengthParam.value);
1496 paramBuffer.addParam(std::move(lengthParam));
1497 }
1498
1499 if (isCallValid)
1500 {
1501 ParamCapture infoLogParam("infoLog", ParamType::TGLcharPointer);
1502 InitParamValue(ParamType::TGLcharPointer, infoLog, &infoLogParam.value);
1503 CaptureGetShaderInfoLog_infoLog(glState, isCallValid, shaderPacked, bufSize, length,
1504 infoLog, &infoLogParam);
1505 paramBuffer.addParam(std::move(infoLogParam));
1506 }
1507 else
1508 {
1509 ParamCapture infoLogParam("infoLog", ParamType::TGLcharPointer);
1510 InitParamValue(ParamType::TGLcharPointer, static_cast<GLchar *>(nullptr),
1511 &infoLogParam.value);
1512 paramBuffer.addParam(std::move(infoLogParam));
1513 }
1514
1515 return CallCapture(angle::EntryPoint::GLGetShaderInfoLog, std::move(paramBuffer));
1516 }
1517
CaptureGetShaderPrecisionFormat(const State & glState,bool isCallValid,GLenum shadertype,GLenum precisiontype,GLint * range,GLint * precision)1518 CallCapture CaptureGetShaderPrecisionFormat(const State &glState,
1519 bool isCallValid,
1520 GLenum shadertype,
1521 GLenum precisiontype,
1522 GLint *range,
1523 GLint *precision)
1524 {
1525 ParamBuffer paramBuffer;
1526
1527 paramBuffer.addEnumParam("shadertype", GLESEnum::ShaderType, ParamType::TGLenum, shadertype);
1528 paramBuffer.addEnumParam("precisiontype", GLESEnum::PrecisionType, ParamType::TGLenum,
1529 precisiontype);
1530
1531 if (isCallValid)
1532 {
1533 ParamCapture rangeParam("range", ParamType::TGLintPointer);
1534 InitParamValue(ParamType::TGLintPointer, range, &rangeParam.value);
1535 CaptureGetShaderPrecisionFormat_range(glState, isCallValid, shadertype, precisiontype,
1536 range, precision, &rangeParam);
1537 paramBuffer.addParam(std::move(rangeParam));
1538 }
1539 else
1540 {
1541 ParamCapture rangeParam("range", ParamType::TGLintPointer);
1542 InitParamValue(ParamType::TGLintPointer, static_cast<GLint *>(nullptr), &rangeParam.value);
1543 paramBuffer.addParam(std::move(rangeParam));
1544 }
1545
1546 if (isCallValid)
1547 {
1548 ParamCapture precisionParam("precision", ParamType::TGLintPointer);
1549 InitParamValue(ParamType::TGLintPointer, precision, &precisionParam.value);
1550 CaptureGetShaderPrecisionFormat_precision(glState, isCallValid, shadertype, precisiontype,
1551 range, precision, &precisionParam);
1552 paramBuffer.addParam(std::move(precisionParam));
1553 }
1554 else
1555 {
1556 ParamCapture precisionParam("precision", ParamType::TGLintPointer);
1557 InitParamValue(ParamType::TGLintPointer, static_cast<GLint *>(nullptr),
1558 &precisionParam.value);
1559 paramBuffer.addParam(std::move(precisionParam));
1560 }
1561
1562 return CallCapture(angle::EntryPoint::GLGetShaderPrecisionFormat, std::move(paramBuffer));
1563 }
1564
CaptureGetShaderSource(const State & glState,bool isCallValid,ShaderProgramID shaderPacked,GLsizei bufSize,GLsizei * length,GLchar * source)1565 CallCapture CaptureGetShaderSource(const State &glState,
1566 bool isCallValid,
1567 ShaderProgramID shaderPacked,
1568 GLsizei bufSize,
1569 GLsizei *length,
1570 GLchar *source)
1571 {
1572 ParamBuffer paramBuffer;
1573
1574 paramBuffer.addValueParam("shaderPacked", ParamType::TShaderProgramID, shaderPacked);
1575 paramBuffer.addValueParam("bufSize", ParamType::TGLsizei, bufSize);
1576
1577 if (isCallValid)
1578 {
1579 ParamCapture lengthParam("length", ParamType::TGLsizeiPointer);
1580 InitParamValue(ParamType::TGLsizeiPointer, length, &lengthParam.value);
1581 CaptureGetShaderSource_length(glState, isCallValid, shaderPacked, bufSize, length, source,
1582 &lengthParam);
1583 paramBuffer.addParam(std::move(lengthParam));
1584 }
1585 else
1586 {
1587 ParamCapture lengthParam("length", ParamType::TGLsizeiPointer);
1588 InitParamValue(ParamType::TGLsizeiPointer, static_cast<GLsizei *>(nullptr),
1589 &lengthParam.value);
1590 paramBuffer.addParam(std::move(lengthParam));
1591 }
1592
1593 if (isCallValid)
1594 {
1595 ParamCapture sourceParam("source", ParamType::TGLcharPointer);
1596 InitParamValue(ParamType::TGLcharPointer, source, &sourceParam.value);
1597 CaptureGetShaderSource_source(glState, isCallValid, shaderPacked, bufSize, length, source,
1598 &sourceParam);
1599 paramBuffer.addParam(std::move(sourceParam));
1600 }
1601 else
1602 {
1603 ParamCapture sourceParam("source", ParamType::TGLcharPointer);
1604 InitParamValue(ParamType::TGLcharPointer, static_cast<GLchar *>(nullptr),
1605 &sourceParam.value);
1606 paramBuffer.addParam(std::move(sourceParam));
1607 }
1608
1609 return CallCapture(angle::EntryPoint::GLGetShaderSource, std::move(paramBuffer));
1610 }
1611
CaptureGetShaderiv(const State & glState,bool isCallValid,ShaderProgramID shaderPacked,GLenum pname,GLint * params)1612 CallCapture CaptureGetShaderiv(const State &glState,
1613 bool isCallValid,
1614 ShaderProgramID shaderPacked,
1615 GLenum pname,
1616 GLint *params)
1617 {
1618 ParamBuffer paramBuffer;
1619
1620 paramBuffer.addValueParam("shaderPacked", ParamType::TShaderProgramID, shaderPacked);
1621 paramBuffer.addEnumParam("pname", GLESEnum::ShaderParameterName, ParamType::TGLenum, pname);
1622
1623 if (isCallValid)
1624 {
1625 ParamCapture paramsParam("params", ParamType::TGLintPointer);
1626 InitParamValue(ParamType::TGLintPointer, params, ¶msParam.value);
1627 CaptureGetShaderiv_params(glState, isCallValid, shaderPacked, pname, params, ¶msParam);
1628 paramBuffer.addParam(std::move(paramsParam));
1629 }
1630 else
1631 {
1632 ParamCapture paramsParam("params", ParamType::TGLintPointer);
1633 InitParamValue(ParamType::TGLintPointer, static_cast<GLint *>(nullptr), ¶msParam.value);
1634 paramBuffer.addParam(std::move(paramsParam));
1635 }
1636
1637 return CallCapture(angle::EntryPoint::GLGetShaderiv, std::move(paramBuffer));
1638 }
1639
CaptureGetString(const State & glState,bool isCallValid,GLenum name,const GLubyte * returnValue)1640 CallCapture CaptureGetString(const State &glState,
1641 bool isCallValid,
1642 GLenum name,
1643 const GLubyte *returnValue)
1644 {
1645 ParamBuffer paramBuffer;
1646
1647 paramBuffer.addEnumParam("name", GLESEnum::StringName, ParamType::TGLenum, name);
1648
1649 ParamCapture returnValueCapture("returnValue", ParamType::TGLubyteConstPointer);
1650 InitParamValue(ParamType::TGLubyteConstPointer, returnValue, &returnValueCapture.value);
1651 paramBuffer.addReturnValue(std::move(returnValueCapture));
1652
1653 return CallCapture(angle::EntryPoint::GLGetString, std::move(paramBuffer));
1654 }
1655
CaptureGetTexParameterfv(const State & glState,bool isCallValid,TextureType targetPacked,GLenum pname,GLfloat * params)1656 CallCapture CaptureGetTexParameterfv(const State &glState,
1657 bool isCallValid,
1658 TextureType targetPacked,
1659 GLenum pname,
1660 GLfloat *params)
1661 {
1662 ParamBuffer paramBuffer;
1663
1664 paramBuffer.addValueParam("targetPacked", ParamType::TTextureType, targetPacked);
1665 paramBuffer.addEnumParam("pname", GLESEnum::GetTextureParameter, ParamType::TGLenum, pname);
1666
1667 if (isCallValid)
1668 {
1669 ParamCapture paramsParam("params", ParamType::TGLfloatPointer);
1670 InitParamValue(ParamType::TGLfloatPointer, params, ¶msParam.value);
1671 CaptureGetTexParameterfv_params(glState, isCallValid, targetPacked, pname, params,
1672 ¶msParam);
1673 paramBuffer.addParam(std::move(paramsParam));
1674 }
1675 else
1676 {
1677 ParamCapture paramsParam("params", ParamType::TGLfloatPointer);
1678 InitParamValue(ParamType::TGLfloatPointer, static_cast<GLfloat *>(nullptr),
1679 ¶msParam.value);
1680 paramBuffer.addParam(std::move(paramsParam));
1681 }
1682
1683 return CallCapture(angle::EntryPoint::GLGetTexParameterfv, std::move(paramBuffer));
1684 }
1685
CaptureGetTexParameteriv(const State & glState,bool isCallValid,TextureType targetPacked,GLenum pname,GLint * params)1686 CallCapture CaptureGetTexParameteriv(const State &glState,
1687 bool isCallValid,
1688 TextureType targetPacked,
1689 GLenum pname,
1690 GLint *params)
1691 {
1692 ParamBuffer paramBuffer;
1693
1694 paramBuffer.addValueParam("targetPacked", ParamType::TTextureType, targetPacked);
1695 paramBuffer.addEnumParam("pname", GLESEnum::GetTextureParameter, ParamType::TGLenum, pname);
1696
1697 if (isCallValid)
1698 {
1699 ParamCapture paramsParam("params", ParamType::TGLintPointer);
1700 InitParamValue(ParamType::TGLintPointer, params, ¶msParam.value);
1701 CaptureGetTexParameteriv_params(glState, isCallValid, targetPacked, pname, params,
1702 ¶msParam);
1703 paramBuffer.addParam(std::move(paramsParam));
1704 }
1705 else
1706 {
1707 ParamCapture paramsParam("params", ParamType::TGLintPointer);
1708 InitParamValue(ParamType::TGLintPointer, static_cast<GLint *>(nullptr), ¶msParam.value);
1709 paramBuffer.addParam(std::move(paramsParam));
1710 }
1711
1712 return CallCapture(angle::EntryPoint::GLGetTexParameteriv, std::move(paramBuffer));
1713 }
1714
CaptureGetUniformLocation(const State & glState,bool isCallValid,ShaderProgramID programPacked,const GLchar * name,GLint returnValue)1715 CallCapture CaptureGetUniformLocation(const State &glState,
1716 bool isCallValid,
1717 ShaderProgramID programPacked,
1718 const GLchar *name,
1719 GLint returnValue)
1720 {
1721 ParamBuffer paramBuffer;
1722
1723 paramBuffer.addValueParam("programPacked", ParamType::TShaderProgramID, programPacked);
1724
1725 if (isCallValid)
1726 {
1727 ParamCapture nameParam("name", ParamType::TGLcharConstPointer);
1728 InitParamValue(ParamType::TGLcharConstPointer, name, &nameParam.value);
1729 CaptureGetUniformLocation_name(glState, isCallValid, programPacked, name, &nameParam);
1730 paramBuffer.addParam(std::move(nameParam));
1731 }
1732 else
1733 {
1734 ParamCapture nameParam("name", ParamType::TGLcharConstPointer);
1735 InitParamValue(ParamType::TGLcharConstPointer, static_cast<const GLchar *>(nullptr),
1736 &nameParam.value);
1737 paramBuffer.addParam(std::move(nameParam));
1738 }
1739
1740 ParamCapture returnValueCapture("returnValue", ParamType::TGLint);
1741 InitParamValue(ParamType::TGLint, returnValue, &returnValueCapture.value);
1742 paramBuffer.addReturnValue(std::move(returnValueCapture));
1743
1744 return CallCapture(angle::EntryPoint::GLGetUniformLocation, std::move(paramBuffer));
1745 }
1746
CaptureGetUniformfv(const State & glState,bool isCallValid,ShaderProgramID programPacked,UniformLocation locationPacked,GLfloat * params)1747 CallCapture CaptureGetUniformfv(const State &glState,
1748 bool isCallValid,
1749 ShaderProgramID programPacked,
1750 UniformLocation locationPacked,
1751 GLfloat *params)
1752 {
1753 ParamBuffer paramBuffer;
1754
1755 paramBuffer.addValueParam("programPacked", ParamType::TShaderProgramID, programPacked);
1756 paramBuffer.addValueParam("locationPacked", ParamType::TUniformLocation, locationPacked);
1757
1758 if (isCallValid)
1759 {
1760 ParamCapture paramsParam("params", ParamType::TGLfloatPointer);
1761 InitParamValue(ParamType::TGLfloatPointer, params, ¶msParam.value);
1762 CaptureGetUniformfv_params(glState, isCallValid, programPacked, locationPacked, params,
1763 ¶msParam);
1764 paramBuffer.addParam(std::move(paramsParam));
1765 }
1766 else
1767 {
1768 ParamCapture paramsParam("params", ParamType::TGLfloatPointer);
1769 InitParamValue(ParamType::TGLfloatPointer, static_cast<GLfloat *>(nullptr),
1770 ¶msParam.value);
1771 paramBuffer.addParam(std::move(paramsParam));
1772 }
1773
1774 return CallCapture(angle::EntryPoint::GLGetUniformfv, std::move(paramBuffer));
1775 }
1776
CaptureGetUniformiv(const State & glState,bool isCallValid,ShaderProgramID programPacked,UniformLocation locationPacked,GLint * params)1777 CallCapture CaptureGetUniformiv(const State &glState,
1778 bool isCallValid,
1779 ShaderProgramID programPacked,
1780 UniformLocation locationPacked,
1781 GLint *params)
1782 {
1783 ParamBuffer paramBuffer;
1784
1785 paramBuffer.addValueParam("programPacked", ParamType::TShaderProgramID, programPacked);
1786 paramBuffer.addValueParam("locationPacked", ParamType::TUniformLocation, locationPacked);
1787
1788 if (isCallValid)
1789 {
1790 ParamCapture paramsParam("params", ParamType::TGLintPointer);
1791 InitParamValue(ParamType::TGLintPointer, params, ¶msParam.value);
1792 CaptureGetUniformiv_params(glState, isCallValid, programPacked, locationPacked, params,
1793 ¶msParam);
1794 paramBuffer.addParam(std::move(paramsParam));
1795 }
1796 else
1797 {
1798 ParamCapture paramsParam("params", ParamType::TGLintPointer);
1799 InitParamValue(ParamType::TGLintPointer, static_cast<GLint *>(nullptr), ¶msParam.value);
1800 paramBuffer.addParam(std::move(paramsParam));
1801 }
1802
1803 return CallCapture(angle::EntryPoint::GLGetUniformiv, std::move(paramBuffer));
1804 }
1805
CaptureGetVertexAttribPointerv(const State & glState,bool isCallValid,GLuint index,GLenum pname,void ** pointer)1806 CallCapture CaptureGetVertexAttribPointerv(const State &glState,
1807 bool isCallValid,
1808 GLuint index,
1809 GLenum pname,
1810 void **pointer)
1811 {
1812 ParamBuffer paramBuffer;
1813
1814 paramBuffer.addValueParam("index", ParamType::TGLuint, index);
1815 paramBuffer.addEnumParam("pname", GLESEnum::AllEnums, ParamType::TGLenum, pname);
1816
1817 if (isCallValid)
1818 {
1819 ParamCapture pointerParam("pointer", ParamType::TvoidPointerPointer);
1820 InitParamValue(ParamType::TvoidPointerPointer, pointer, &pointerParam.value);
1821 CaptureGetVertexAttribPointerv_pointer(glState, isCallValid, index, pname, pointer,
1822 &pointerParam);
1823 paramBuffer.addParam(std::move(pointerParam));
1824 }
1825 else
1826 {
1827 ParamCapture pointerParam("pointer", ParamType::TvoidPointerPointer);
1828 InitParamValue(ParamType::TvoidPointerPointer, static_cast<void **>(nullptr),
1829 &pointerParam.value);
1830 paramBuffer.addParam(std::move(pointerParam));
1831 }
1832
1833 return CallCapture(angle::EntryPoint::GLGetVertexAttribPointerv, std::move(paramBuffer));
1834 }
1835
CaptureGetVertexAttribfv(const State & glState,bool isCallValid,GLuint index,GLenum pname,GLfloat * params)1836 CallCapture CaptureGetVertexAttribfv(const State &glState,
1837 bool isCallValid,
1838 GLuint index,
1839 GLenum pname,
1840 GLfloat *params)
1841 {
1842 ParamBuffer paramBuffer;
1843
1844 paramBuffer.addValueParam("index", ParamType::TGLuint, index);
1845 paramBuffer.addEnumParam("pname", GLESEnum::AllEnums, ParamType::TGLenum, pname);
1846
1847 if (isCallValid)
1848 {
1849 ParamCapture paramsParam("params", ParamType::TGLfloatPointer);
1850 InitParamValue(ParamType::TGLfloatPointer, params, ¶msParam.value);
1851 CaptureGetVertexAttribfv_params(glState, isCallValid, index, pname, params, ¶msParam);
1852 paramBuffer.addParam(std::move(paramsParam));
1853 }
1854 else
1855 {
1856 ParamCapture paramsParam("params", ParamType::TGLfloatPointer);
1857 InitParamValue(ParamType::TGLfloatPointer, static_cast<GLfloat *>(nullptr),
1858 ¶msParam.value);
1859 paramBuffer.addParam(std::move(paramsParam));
1860 }
1861
1862 return CallCapture(angle::EntryPoint::GLGetVertexAttribfv, std::move(paramBuffer));
1863 }
1864
CaptureGetVertexAttribiv(const State & glState,bool isCallValid,GLuint index,GLenum pname,GLint * params)1865 CallCapture CaptureGetVertexAttribiv(const State &glState,
1866 bool isCallValid,
1867 GLuint index,
1868 GLenum pname,
1869 GLint *params)
1870 {
1871 ParamBuffer paramBuffer;
1872
1873 paramBuffer.addValueParam("index", ParamType::TGLuint, index);
1874 paramBuffer.addEnumParam("pname", GLESEnum::AllEnums, ParamType::TGLenum, pname);
1875
1876 if (isCallValid)
1877 {
1878 ParamCapture paramsParam("params", ParamType::TGLintPointer);
1879 InitParamValue(ParamType::TGLintPointer, params, ¶msParam.value);
1880 CaptureGetVertexAttribiv_params(glState, isCallValid, index, pname, params, ¶msParam);
1881 paramBuffer.addParam(std::move(paramsParam));
1882 }
1883 else
1884 {
1885 ParamCapture paramsParam("params", ParamType::TGLintPointer);
1886 InitParamValue(ParamType::TGLintPointer, static_cast<GLint *>(nullptr), ¶msParam.value);
1887 paramBuffer.addParam(std::move(paramsParam));
1888 }
1889
1890 return CallCapture(angle::EntryPoint::GLGetVertexAttribiv, std::move(paramBuffer));
1891 }
1892
CaptureHint(const State & glState,bool isCallValid,GLenum target,GLenum mode)1893 CallCapture CaptureHint(const State &glState, bool isCallValid, GLenum target, GLenum mode)
1894 {
1895 ParamBuffer paramBuffer;
1896
1897 paramBuffer.addEnumParam("target", GLESEnum::HintTarget, ParamType::TGLenum, target);
1898 paramBuffer.addEnumParam("mode", GLESEnum::HintMode, ParamType::TGLenum, mode);
1899
1900 return CallCapture(angle::EntryPoint::GLHint, std::move(paramBuffer));
1901 }
1902
CaptureIsBuffer(const State & glState,bool isCallValid,BufferID bufferPacked,GLboolean returnValue)1903 CallCapture CaptureIsBuffer(const State &glState,
1904 bool isCallValid,
1905 BufferID bufferPacked,
1906 GLboolean returnValue)
1907 {
1908 ParamBuffer paramBuffer;
1909
1910 paramBuffer.addValueParam("bufferPacked", ParamType::TBufferID, bufferPacked);
1911
1912 ParamCapture returnValueCapture("returnValue", ParamType::TGLboolean);
1913 InitParamValue(ParamType::TGLboolean, returnValue, &returnValueCapture.value);
1914 paramBuffer.addReturnValue(std::move(returnValueCapture));
1915
1916 return CallCapture(angle::EntryPoint::GLIsBuffer, std::move(paramBuffer));
1917 }
1918
CaptureIsEnabled(const State & glState,bool isCallValid,GLenum cap,GLboolean returnValue)1919 CallCapture CaptureIsEnabled(const State &glState,
1920 bool isCallValid,
1921 GLenum cap,
1922 GLboolean returnValue)
1923 {
1924 ParamBuffer paramBuffer;
1925
1926 paramBuffer.addEnumParam("cap", GLESEnum::EnableCap, ParamType::TGLenum, cap);
1927
1928 ParamCapture returnValueCapture("returnValue", ParamType::TGLboolean);
1929 InitParamValue(ParamType::TGLboolean, returnValue, &returnValueCapture.value);
1930 paramBuffer.addReturnValue(std::move(returnValueCapture));
1931
1932 return CallCapture(angle::EntryPoint::GLIsEnabled, std::move(paramBuffer));
1933 }
1934
CaptureIsFramebuffer(const State & glState,bool isCallValid,FramebufferID framebufferPacked,GLboolean returnValue)1935 CallCapture CaptureIsFramebuffer(const State &glState,
1936 bool isCallValid,
1937 FramebufferID framebufferPacked,
1938 GLboolean returnValue)
1939 {
1940 ParamBuffer paramBuffer;
1941
1942 paramBuffer.addValueParam("framebufferPacked", ParamType::TFramebufferID, framebufferPacked);
1943
1944 ParamCapture returnValueCapture("returnValue", ParamType::TGLboolean);
1945 InitParamValue(ParamType::TGLboolean, returnValue, &returnValueCapture.value);
1946 paramBuffer.addReturnValue(std::move(returnValueCapture));
1947
1948 return CallCapture(angle::EntryPoint::GLIsFramebuffer, std::move(paramBuffer));
1949 }
1950
CaptureIsProgram(const State & glState,bool isCallValid,ShaderProgramID programPacked,GLboolean returnValue)1951 CallCapture CaptureIsProgram(const State &glState,
1952 bool isCallValid,
1953 ShaderProgramID programPacked,
1954 GLboolean returnValue)
1955 {
1956 ParamBuffer paramBuffer;
1957
1958 paramBuffer.addValueParam("programPacked", ParamType::TShaderProgramID, programPacked);
1959
1960 ParamCapture returnValueCapture("returnValue", ParamType::TGLboolean);
1961 InitParamValue(ParamType::TGLboolean, returnValue, &returnValueCapture.value);
1962 paramBuffer.addReturnValue(std::move(returnValueCapture));
1963
1964 return CallCapture(angle::EntryPoint::GLIsProgram, std::move(paramBuffer));
1965 }
1966
CaptureIsRenderbuffer(const State & glState,bool isCallValid,RenderbufferID renderbufferPacked,GLboolean returnValue)1967 CallCapture CaptureIsRenderbuffer(const State &glState,
1968 bool isCallValid,
1969 RenderbufferID renderbufferPacked,
1970 GLboolean returnValue)
1971 {
1972 ParamBuffer paramBuffer;
1973
1974 paramBuffer.addValueParam("renderbufferPacked", ParamType::TRenderbufferID, renderbufferPacked);
1975
1976 ParamCapture returnValueCapture("returnValue", ParamType::TGLboolean);
1977 InitParamValue(ParamType::TGLboolean, returnValue, &returnValueCapture.value);
1978 paramBuffer.addReturnValue(std::move(returnValueCapture));
1979
1980 return CallCapture(angle::EntryPoint::GLIsRenderbuffer, std::move(paramBuffer));
1981 }
1982
CaptureIsShader(const State & glState,bool isCallValid,ShaderProgramID shaderPacked,GLboolean returnValue)1983 CallCapture CaptureIsShader(const State &glState,
1984 bool isCallValid,
1985 ShaderProgramID shaderPacked,
1986 GLboolean returnValue)
1987 {
1988 ParamBuffer paramBuffer;
1989
1990 paramBuffer.addValueParam("shaderPacked", ParamType::TShaderProgramID, shaderPacked);
1991
1992 ParamCapture returnValueCapture("returnValue", ParamType::TGLboolean);
1993 InitParamValue(ParamType::TGLboolean, returnValue, &returnValueCapture.value);
1994 paramBuffer.addReturnValue(std::move(returnValueCapture));
1995
1996 return CallCapture(angle::EntryPoint::GLIsShader, std::move(paramBuffer));
1997 }
1998
CaptureIsTexture(const State & glState,bool isCallValid,TextureID texturePacked,GLboolean returnValue)1999 CallCapture CaptureIsTexture(const State &glState,
2000 bool isCallValid,
2001 TextureID texturePacked,
2002 GLboolean returnValue)
2003 {
2004 ParamBuffer paramBuffer;
2005
2006 paramBuffer.addValueParam("texturePacked", ParamType::TTextureID, texturePacked);
2007
2008 ParamCapture returnValueCapture("returnValue", ParamType::TGLboolean);
2009 InitParamValue(ParamType::TGLboolean, returnValue, &returnValueCapture.value);
2010 paramBuffer.addReturnValue(std::move(returnValueCapture));
2011
2012 return CallCapture(angle::EntryPoint::GLIsTexture, std::move(paramBuffer));
2013 }
2014
CaptureLineWidth(const State & glState,bool isCallValid,GLfloat width)2015 CallCapture CaptureLineWidth(const State &glState, bool isCallValid, GLfloat width)
2016 {
2017 ParamBuffer paramBuffer;
2018
2019 paramBuffer.addValueParam("width", ParamType::TGLfloat, width);
2020
2021 return CallCapture(angle::EntryPoint::GLLineWidth, std::move(paramBuffer));
2022 }
2023
CaptureLinkProgram(const State & glState,bool isCallValid,ShaderProgramID programPacked)2024 CallCapture CaptureLinkProgram(const State &glState,
2025 bool isCallValid,
2026 ShaderProgramID programPacked)
2027 {
2028 ParamBuffer paramBuffer;
2029
2030 paramBuffer.addValueParam("programPacked", ParamType::TShaderProgramID, programPacked);
2031
2032 return CallCapture(angle::EntryPoint::GLLinkProgram, std::move(paramBuffer));
2033 }
2034
CapturePixelStorei(const State & glState,bool isCallValid,GLenum pname,GLint param)2035 CallCapture CapturePixelStorei(const State &glState, bool isCallValid, GLenum pname, GLint param)
2036 {
2037 ParamBuffer paramBuffer;
2038
2039 paramBuffer.addEnumParam("pname", GLESEnum::PixelStoreParameter, ParamType::TGLenum, pname);
2040 paramBuffer.addValueParam("param", ParamType::TGLint, param);
2041
2042 return CallCapture(angle::EntryPoint::GLPixelStorei, std::move(paramBuffer));
2043 }
2044
CapturePolygonOffset(const State & glState,bool isCallValid,GLfloat factor,GLfloat units)2045 CallCapture CapturePolygonOffset(const State &glState,
2046 bool isCallValid,
2047 GLfloat factor,
2048 GLfloat units)
2049 {
2050 ParamBuffer paramBuffer;
2051
2052 paramBuffer.addValueParam("factor", ParamType::TGLfloat, factor);
2053 paramBuffer.addValueParam("units", ParamType::TGLfloat, units);
2054
2055 return CallCapture(angle::EntryPoint::GLPolygonOffset, std::move(paramBuffer));
2056 }
2057
CaptureReadPixels(const State & glState,bool isCallValid,GLint x,GLint y,GLsizei width,GLsizei height,GLenum format,GLenum type,void * pixels)2058 CallCapture CaptureReadPixels(const State &glState,
2059 bool isCallValid,
2060 GLint x,
2061 GLint y,
2062 GLsizei width,
2063 GLsizei height,
2064 GLenum format,
2065 GLenum type,
2066 void *pixels)
2067 {
2068 ParamBuffer paramBuffer;
2069
2070 paramBuffer.addValueParam("x", ParamType::TGLint, x);
2071 paramBuffer.addValueParam("y", ParamType::TGLint, y);
2072 paramBuffer.addValueParam("width", ParamType::TGLsizei, width);
2073 paramBuffer.addValueParam("height", ParamType::TGLsizei, height);
2074 paramBuffer.addEnumParam("format", GLESEnum::PixelFormat, ParamType::TGLenum, format);
2075 paramBuffer.addEnumParam("type", GLESEnum::PixelType, ParamType::TGLenum, type);
2076
2077 if (isCallValid)
2078 {
2079 ParamCapture pixelsParam("pixels", ParamType::TvoidPointer);
2080 InitParamValue(ParamType::TvoidPointer, pixels, &pixelsParam.value);
2081 CaptureReadPixels_pixels(glState, isCallValid, x, y, width, height, format, type, pixels,
2082 &pixelsParam);
2083 paramBuffer.addParam(std::move(pixelsParam));
2084 }
2085 else
2086 {
2087 ParamCapture pixelsParam("pixels", ParamType::TvoidPointer);
2088 InitParamValue(ParamType::TvoidPointer, static_cast<void *>(nullptr), &pixelsParam.value);
2089 paramBuffer.addParam(std::move(pixelsParam));
2090 }
2091
2092 return CallCapture(angle::EntryPoint::GLReadPixels, std::move(paramBuffer));
2093 }
2094
CaptureReleaseShaderCompiler(const State & glState,bool isCallValid)2095 CallCapture CaptureReleaseShaderCompiler(const State &glState, bool isCallValid)
2096 {
2097 ParamBuffer paramBuffer;
2098
2099 return CallCapture(angle::EntryPoint::GLReleaseShaderCompiler, std::move(paramBuffer));
2100 }
2101
CaptureRenderbufferStorage(const State & glState,bool isCallValid,GLenum target,GLenum internalformat,GLsizei width,GLsizei height)2102 CallCapture CaptureRenderbufferStorage(const State &glState,
2103 bool isCallValid,
2104 GLenum target,
2105 GLenum internalformat,
2106 GLsizei width,
2107 GLsizei height)
2108 {
2109 ParamBuffer paramBuffer;
2110
2111 paramBuffer.addEnumParam("target", GLESEnum::RenderbufferTarget, ParamType::TGLenum, target);
2112 paramBuffer.addEnumParam("internalformat", GLESEnum::InternalFormat, ParamType::TGLenum,
2113 internalformat);
2114 paramBuffer.addValueParam("width", ParamType::TGLsizei, width);
2115 paramBuffer.addValueParam("height", ParamType::TGLsizei, height);
2116
2117 return CallCapture(angle::EntryPoint::GLRenderbufferStorage, std::move(paramBuffer));
2118 }
2119
CaptureSampleCoverage(const State & glState,bool isCallValid,GLfloat value,GLboolean invert)2120 CallCapture CaptureSampleCoverage(const State &glState,
2121 bool isCallValid,
2122 GLfloat value,
2123 GLboolean invert)
2124 {
2125 ParamBuffer paramBuffer;
2126
2127 paramBuffer.addValueParam("value", ParamType::TGLfloat, value);
2128 paramBuffer.addValueParam("invert", ParamType::TGLboolean, invert);
2129
2130 return CallCapture(angle::EntryPoint::GLSampleCoverage, std::move(paramBuffer));
2131 }
2132
CaptureScissor(const State & glState,bool isCallValid,GLint x,GLint y,GLsizei width,GLsizei height)2133 CallCapture CaptureScissor(const State &glState,
2134 bool isCallValid,
2135 GLint x,
2136 GLint y,
2137 GLsizei width,
2138 GLsizei height)
2139 {
2140 ParamBuffer paramBuffer;
2141
2142 paramBuffer.addValueParam("x", ParamType::TGLint, x);
2143 paramBuffer.addValueParam("y", ParamType::TGLint, y);
2144 paramBuffer.addValueParam("width", ParamType::TGLsizei, width);
2145 paramBuffer.addValueParam("height", ParamType::TGLsizei, height);
2146
2147 return CallCapture(angle::EntryPoint::GLScissor, std::move(paramBuffer));
2148 }
2149
CaptureShaderBinary(const State & glState,bool isCallValid,GLsizei count,const ShaderProgramID * shadersPacked,GLenum binaryFormat,const void * binary,GLsizei length)2150 CallCapture CaptureShaderBinary(const State &glState,
2151 bool isCallValid,
2152 GLsizei count,
2153 const ShaderProgramID *shadersPacked,
2154 GLenum binaryFormat,
2155 const void *binary,
2156 GLsizei length)
2157 {
2158 ParamBuffer paramBuffer;
2159
2160 paramBuffer.addValueParam("count", ParamType::TGLsizei, count);
2161
2162 if (isCallValid)
2163 {
2164 ParamCapture shadersPackedParam("shadersPacked", ParamType::TShaderProgramIDConstPointer);
2165 InitParamValue(ParamType::TShaderProgramIDConstPointer, shadersPacked,
2166 &shadersPackedParam.value);
2167 CaptureShaderBinary_shadersPacked(glState, isCallValid, count, shadersPacked, binaryFormat,
2168 binary, length, &shadersPackedParam);
2169 paramBuffer.addParam(std::move(shadersPackedParam));
2170 }
2171 else
2172 {
2173 ParamCapture shadersPackedParam("shadersPacked", ParamType::TShaderProgramIDConstPointer);
2174 InitParamValue(ParamType::TShaderProgramIDConstPointer,
2175 static_cast<const ShaderProgramID *>(nullptr), &shadersPackedParam.value);
2176 paramBuffer.addParam(std::move(shadersPackedParam));
2177 }
2178
2179 paramBuffer.addEnumParam("binaryFormat", GLESEnum::ShaderBinaryFormat, ParamType::TGLenum,
2180 binaryFormat);
2181
2182 if (isCallValid)
2183 {
2184 ParamCapture binaryParam("binary", ParamType::TvoidConstPointer);
2185 InitParamValue(ParamType::TvoidConstPointer, binary, &binaryParam.value);
2186 CaptureShaderBinary_binary(glState, isCallValid, count, shadersPacked, binaryFormat, binary,
2187 length, &binaryParam);
2188 paramBuffer.addParam(std::move(binaryParam));
2189 }
2190 else
2191 {
2192 ParamCapture binaryParam("binary", ParamType::TvoidConstPointer);
2193 InitParamValue(ParamType::TvoidConstPointer, static_cast<const void *>(nullptr),
2194 &binaryParam.value);
2195 paramBuffer.addParam(std::move(binaryParam));
2196 }
2197
2198 paramBuffer.addValueParam("length", ParamType::TGLsizei, length);
2199
2200 return CallCapture(angle::EntryPoint::GLShaderBinary, std::move(paramBuffer));
2201 }
2202
CaptureShaderSource(const State & glState,bool isCallValid,ShaderProgramID shaderPacked,GLsizei count,const GLchar * const * string,const GLint * length)2203 CallCapture CaptureShaderSource(const State &glState,
2204 bool isCallValid,
2205 ShaderProgramID shaderPacked,
2206 GLsizei count,
2207 const GLchar *const *string,
2208 const GLint *length)
2209 {
2210 ParamBuffer paramBuffer;
2211
2212 paramBuffer.addValueParam("shaderPacked", ParamType::TShaderProgramID, shaderPacked);
2213 paramBuffer.addValueParam("count", ParamType::TGLsizei, count);
2214
2215 if (isCallValid)
2216 {
2217 ParamCapture stringParam("string", ParamType::TGLcharConstPointerPointer);
2218 InitParamValue(ParamType::TGLcharConstPointerPointer, string, &stringParam.value);
2219 CaptureShaderSource_string(glState, isCallValid, shaderPacked, count, string, length,
2220 &stringParam);
2221 paramBuffer.addParam(std::move(stringParam));
2222 }
2223 else
2224 {
2225 ParamCapture stringParam("string", ParamType::TGLcharConstPointerPointer);
2226 InitParamValue(ParamType::TGLcharConstPointerPointer,
2227 static_cast<const GLchar *const *>(nullptr), &stringParam.value);
2228 paramBuffer.addParam(std::move(stringParam));
2229 }
2230
2231 if (isCallValid)
2232 {
2233 ParamCapture lengthParam("length", ParamType::TGLintConstPointer);
2234 InitParamValue(ParamType::TGLintConstPointer, length, &lengthParam.value);
2235 CaptureShaderSource_length(glState, isCallValid, shaderPacked, count, string, length,
2236 &lengthParam);
2237 paramBuffer.addParam(std::move(lengthParam));
2238 }
2239 else
2240 {
2241 ParamCapture lengthParam("length", ParamType::TGLintConstPointer);
2242 InitParamValue(ParamType::TGLintConstPointer, static_cast<const GLint *>(nullptr),
2243 &lengthParam.value);
2244 paramBuffer.addParam(std::move(lengthParam));
2245 }
2246
2247 return CallCapture(angle::EntryPoint::GLShaderSource, std::move(paramBuffer));
2248 }
2249
CaptureStencilFunc(const State & glState,bool isCallValid,GLenum func,GLint ref,GLuint mask)2250 CallCapture CaptureStencilFunc(const State &glState,
2251 bool isCallValid,
2252 GLenum func,
2253 GLint ref,
2254 GLuint mask)
2255 {
2256 ParamBuffer paramBuffer;
2257
2258 paramBuffer.addEnumParam("func", GLESEnum::StencilFunction, ParamType::TGLenum, func);
2259 paramBuffer.addValueParam("ref", ParamType::TGLint, ref);
2260 paramBuffer.addValueParam("mask", ParamType::TGLuint, mask);
2261
2262 return CallCapture(angle::EntryPoint::GLStencilFunc, std::move(paramBuffer));
2263 }
2264
CaptureStencilFuncSeparate(const State & glState,bool isCallValid,GLenum face,GLenum func,GLint ref,GLuint mask)2265 CallCapture CaptureStencilFuncSeparate(const State &glState,
2266 bool isCallValid,
2267 GLenum face,
2268 GLenum func,
2269 GLint ref,
2270 GLuint mask)
2271 {
2272 ParamBuffer paramBuffer;
2273
2274 paramBuffer.addEnumParam("face", GLESEnum::TriangleFace, ParamType::TGLenum, face);
2275 paramBuffer.addEnumParam("func", GLESEnum::StencilFunction, ParamType::TGLenum, func);
2276 paramBuffer.addValueParam("ref", ParamType::TGLint, ref);
2277 paramBuffer.addValueParam("mask", ParamType::TGLuint, mask);
2278
2279 return CallCapture(angle::EntryPoint::GLStencilFuncSeparate, std::move(paramBuffer));
2280 }
2281
CaptureStencilMask(const State & glState,bool isCallValid,GLuint mask)2282 CallCapture CaptureStencilMask(const State &glState, bool isCallValid, GLuint mask)
2283 {
2284 ParamBuffer paramBuffer;
2285
2286 paramBuffer.addValueParam("mask", ParamType::TGLuint, mask);
2287
2288 return CallCapture(angle::EntryPoint::GLStencilMask, std::move(paramBuffer));
2289 }
2290
CaptureStencilMaskSeparate(const State & glState,bool isCallValid,GLenum face,GLuint mask)2291 CallCapture CaptureStencilMaskSeparate(const State &glState,
2292 bool isCallValid,
2293 GLenum face,
2294 GLuint mask)
2295 {
2296 ParamBuffer paramBuffer;
2297
2298 paramBuffer.addEnumParam("face", GLESEnum::TriangleFace, ParamType::TGLenum, face);
2299 paramBuffer.addValueParam("mask", ParamType::TGLuint, mask);
2300
2301 return CallCapture(angle::EntryPoint::GLStencilMaskSeparate, std::move(paramBuffer));
2302 }
2303
CaptureStencilOp(const State & glState,bool isCallValid,GLenum fail,GLenum zfail,GLenum zpass)2304 CallCapture CaptureStencilOp(const State &glState,
2305 bool isCallValid,
2306 GLenum fail,
2307 GLenum zfail,
2308 GLenum zpass)
2309 {
2310 ParamBuffer paramBuffer;
2311
2312 paramBuffer.addEnumParam("fail", GLESEnum::StencilOp, ParamType::TGLenum, fail);
2313 paramBuffer.addEnumParam("zfail", GLESEnum::StencilOp, ParamType::TGLenum, zfail);
2314 paramBuffer.addEnumParam("zpass", GLESEnum::StencilOp, ParamType::TGLenum, zpass);
2315
2316 return CallCapture(angle::EntryPoint::GLStencilOp, std::move(paramBuffer));
2317 }
2318
CaptureStencilOpSeparate(const State & glState,bool isCallValid,GLenum face,GLenum sfail,GLenum dpfail,GLenum dppass)2319 CallCapture CaptureStencilOpSeparate(const State &glState,
2320 bool isCallValid,
2321 GLenum face,
2322 GLenum sfail,
2323 GLenum dpfail,
2324 GLenum dppass)
2325 {
2326 ParamBuffer paramBuffer;
2327
2328 paramBuffer.addEnumParam("face", GLESEnum::TriangleFace, ParamType::TGLenum, face);
2329 paramBuffer.addEnumParam("sfail", GLESEnum::StencilOp, ParamType::TGLenum, sfail);
2330 paramBuffer.addEnumParam("dpfail", GLESEnum::StencilOp, ParamType::TGLenum, dpfail);
2331 paramBuffer.addEnumParam("dppass", GLESEnum::StencilOp, ParamType::TGLenum, dppass);
2332
2333 return CallCapture(angle::EntryPoint::GLStencilOpSeparate, std::move(paramBuffer));
2334 }
2335
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)2336 CallCapture CaptureTexImage2D(const State &glState,
2337 bool isCallValid,
2338 TextureTarget targetPacked,
2339 GLint level,
2340 GLint internalformat,
2341 GLsizei width,
2342 GLsizei height,
2343 GLint border,
2344 GLenum format,
2345 GLenum type,
2346 const void *pixels)
2347 {
2348 ParamBuffer paramBuffer;
2349
2350 paramBuffer.addValueParam("targetPacked", ParamType::TTextureTarget, targetPacked);
2351 paramBuffer.addValueParam("level", ParamType::TGLint, level);
2352 paramBuffer.addValueParam("internalformat", ParamType::TGLint, internalformat);
2353 paramBuffer.addValueParam("width", ParamType::TGLsizei, width);
2354 paramBuffer.addValueParam("height", ParamType::TGLsizei, height);
2355 paramBuffer.addValueParam("border", ParamType::TGLint, border);
2356 paramBuffer.addEnumParam("format", GLESEnum::PixelFormat, ParamType::TGLenum, format);
2357 paramBuffer.addEnumParam("type", GLESEnum::PixelType, ParamType::TGLenum, type);
2358
2359 if (isCallValid)
2360 {
2361 ParamCapture pixelsParam("pixels", ParamType::TvoidConstPointer);
2362 InitParamValue(ParamType::TvoidConstPointer, pixels, &pixelsParam.value);
2363 CaptureTexImage2D_pixels(glState, isCallValid, targetPacked, level, internalformat, width,
2364 height, border, format, type, pixels, &pixelsParam);
2365 paramBuffer.addParam(std::move(pixelsParam));
2366 }
2367 else
2368 {
2369 ParamCapture pixelsParam("pixels", ParamType::TvoidConstPointer);
2370 InitParamValue(ParamType::TvoidConstPointer, static_cast<const void *>(nullptr),
2371 &pixelsParam.value);
2372 paramBuffer.addParam(std::move(pixelsParam));
2373 }
2374
2375 return CallCapture(angle::EntryPoint::GLTexImage2D, std::move(paramBuffer));
2376 }
2377
CaptureTexParameterf(const State & glState,bool isCallValid,TextureType targetPacked,GLenum pname,GLfloat param)2378 CallCapture CaptureTexParameterf(const State &glState,
2379 bool isCallValid,
2380 TextureType targetPacked,
2381 GLenum pname,
2382 GLfloat param)
2383 {
2384 ParamBuffer paramBuffer;
2385
2386 paramBuffer.addValueParam("targetPacked", ParamType::TTextureType, targetPacked);
2387 paramBuffer.addEnumParam("pname", GLESEnum::TextureParameterName, ParamType::TGLenum, pname);
2388 paramBuffer.addValueParam("param", ParamType::TGLfloat, param);
2389
2390 return CallCapture(angle::EntryPoint::GLTexParameterf, std::move(paramBuffer));
2391 }
2392
CaptureTexParameterfv(const State & glState,bool isCallValid,TextureType targetPacked,GLenum pname,const GLfloat * params)2393 CallCapture CaptureTexParameterfv(const State &glState,
2394 bool isCallValid,
2395 TextureType targetPacked,
2396 GLenum pname,
2397 const GLfloat *params)
2398 {
2399 ParamBuffer paramBuffer;
2400
2401 paramBuffer.addValueParam("targetPacked", ParamType::TTextureType, targetPacked);
2402 paramBuffer.addEnumParam("pname", GLESEnum::TextureParameterName, ParamType::TGLenum, pname);
2403
2404 if (isCallValid)
2405 {
2406 ParamCapture paramsParam("params", ParamType::TGLfloatConstPointer);
2407 InitParamValue(ParamType::TGLfloatConstPointer, params, ¶msParam.value);
2408 CaptureTexParameterfv_params(glState, isCallValid, targetPacked, pname, params,
2409 ¶msParam);
2410 paramBuffer.addParam(std::move(paramsParam));
2411 }
2412 else
2413 {
2414 ParamCapture paramsParam("params", ParamType::TGLfloatConstPointer);
2415 InitParamValue(ParamType::TGLfloatConstPointer, static_cast<const GLfloat *>(nullptr),
2416 ¶msParam.value);
2417 paramBuffer.addParam(std::move(paramsParam));
2418 }
2419
2420 return CallCapture(angle::EntryPoint::GLTexParameterfv, std::move(paramBuffer));
2421 }
2422
CaptureTexParameteri(const State & glState,bool isCallValid,TextureType targetPacked,GLenum pname,GLint param)2423 CallCapture CaptureTexParameteri(const State &glState,
2424 bool isCallValid,
2425 TextureType targetPacked,
2426 GLenum pname,
2427 GLint param)
2428 {
2429 ParamBuffer paramBuffer;
2430
2431 paramBuffer.addValueParam("targetPacked", ParamType::TTextureType, targetPacked);
2432 paramBuffer.addEnumParam("pname", GLESEnum::TextureParameterName, ParamType::TGLenum, pname);
2433 paramBuffer.addValueParam("param", ParamType::TGLint, param);
2434
2435 return CallCapture(angle::EntryPoint::GLTexParameteri, std::move(paramBuffer));
2436 }
2437
CaptureTexParameteriv(const State & glState,bool isCallValid,TextureType targetPacked,GLenum pname,const GLint * params)2438 CallCapture CaptureTexParameteriv(const State &glState,
2439 bool isCallValid,
2440 TextureType targetPacked,
2441 GLenum pname,
2442 const GLint *params)
2443 {
2444 ParamBuffer paramBuffer;
2445
2446 paramBuffer.addValueParam("targetPacked", ParamType::TTextureType, targetPacked);
2447 paramBuffer.addEnumParam("pname", GLESEnum::TextureParameterName, ParamType::TGLenum, pname);
2448
2449 if (isCallValid)
2450 {
2451 ParamCapture paramsParam("params", ParamType::TGLintConstPointer);
2452 InitParamValue(ParamType::TGLintConstPointer, params, ¶msParam.value);
2453 CaptureTexParameteriv_params(glState, isCallValid, targetPacked, pname, params,
2454 ¶msParam);
2455 paramBuffer.addParam(std::move(paramsParam));
2456 }
2457 else
2458 {
2459 ParamCapture paramsParam("params", ParamType::TGLintConstPointer);
2460 InitParamValue(ParamType::TGLintConstPointer, static_cast<const GLint *>(nullptr),
2461 ¶msParam.value);
2462 paramBuffer.addParam(std::move(paramsParam));
2463 }
2464
2465 return CallCapture(angle::EntryPoint::GLTexParameteriv, std::move(paramBuffer));
2466 }
2467
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)2468 CallCapture CaptureTexSubImage2D(const State &glState,
2469 bool isCallValid,
2470 TextureTarget targetPacked,
2471 GLint level,
2472 GLint xoffset,
2473 GLint yoffset,
2474 GLsizei width,
2475 GLsizei height,
2476 GLenum format,
2477 GLenum type,
2478 const void *pixels)
2479 {
2480 ParamBuffer paramBuffer;
2481
2482 paramBuffer.addValueParam("targetPacked", ParamType::TTextureTarget, targetPacked);
2483 paramBuffer.addValueParam("level", ParamType::TGLint, level);
2484 paramBuffer.addValueParam("xoffset", ParamType::TGLint, xoffset);
2485 paramBuffer.addValueParam("yoffset", ParamType::TGLint, yoffset);
2486 paramBuffer.addValueParam("width", ParamType::TGLsizei, width);
2487 paramBuffer.addValueParam("height", ParamType::TGLsizei, height);
2488 paramBuffer.addEnumParam("format", GLESEnum::PixelFormat, ParamType::TGLenum, format);
2489 paramBuffer.addEnumParam("type", GLESEnum::PixelType, ParamType::TGLenum, type);
2490
2491 if (isCallValid)
2492 {
2493 ParamCapture pixelsParam("pixels", ParamType::TvoidConstPointer);
2494 InitParamValue(ParamType::TvoidConstPointer, pixels, &pixelsParam.value);
2495 CaptureTexSubImage2D_pixels(glState, isCallValid, targetPacked, level, xoffset, yoffset,
2496 width, height, format, type, pixels, &pixelsParam);
2497 paramBuffer.addParam(std::move(pixelsParam));
2498 }
2499 else
2500 {
2501 ParamCapture pixelsParam("pixels", ParamType::TvoidConstPointer);
2502 InitParamValue(ParamType::TvoidConstPointer, static_cast<const void *>(nullptr),
2503 &pixelsParam.value);
2504 paramBuffer.addParam(std::move(pixelsParam));
2505 }
2506
2507 return CallCapture(angle::EntryPoint::GLTexSubImage2D, std::move(paramBuffer));
2508 }
2509
CaptureUniform1f(const State & glState,bool isCallValid,UniformLocation locationPacked,GLfloat v0)2510 CallCapture CaptureUniform1f(const State &glState,
2511 bool isCallValid,
2512 UniformLocation locationPacked,
2513 GLfloat v0)
2514 {
2515 ParamBuffer paramBuffer;
2516
2517 paramBuffer.addValueParam("locationPacked", ParamType::TUniformLocation, locationPacked);
2518 paramBuffer.addValueParam("v0", ParamType::TGLfloat, v0);
2519
2520 return CallCapture(angle::EntryPoint::GLUniform1f, std::move(paramBuffer));
2521 }
2522
CaptureUniform1fv(const State & glState,bool isCallValid,UniformLocation locationPacked,GLsizei count,const GLfloat * value)2523 CallCapture CaptureUniform1fv(const State &glState,
2524 bool isCallValid,
2525 UniformLocation locationPacked,
2526 GLsizei count,
2527 const GLfloat *value)
2528 {
2529 ParamBuffer paramBuffer;
2530
2531 paramBuffer.addValueParam("locationPacked", ParamType::TUniformLocation, locationPacked);
2532 paramBuffer.addValueParam("count", ParamType::TGLsizei, count);
2533
2534 if (isCallValid)
2535 {
2536 ParamCapture valueParam("value", ParamType::TGLfloatConstPointer);
2537 InitParamValue(ParamType::TGLfloatConstPointer, value, &valueParam.value);
2538 CaptureUniform1fv_value(glState, isCallValid, locationPacked, count, value, &valueParam);
2539 paramBuffer.addParam(std::move(valueParam));
2540 }
2541 else
2542 {
2543 ParamCapture valueParam("value", ParamType::TGLfloatConstPointer);
2544 InitParamValue(ParamType::TGLfloatConstPointer, static_cast<const GLfloat *>(nullptr),
2545 &valueParam.value);
2546 paramBuffer.addParam(std::move(valueParam));
2547 }
2548
2549 return CallCapture(angle::EntryPoint::GLUniform1fv, std::move(paramBuffer));
2550 }
2551
CaptureUniform1i(const State & glState,bool isCallValid,UniformLocation locationPacked,GLint v0)2552 CallCapture CaptureUniform1i(const State &glState,
2553 bool isCallValid,
2554 UniformLocation locationPacked,
2555 GLint v0)
2556 {
2557 ParamBuffer paramBuffer;
2558
2559 paramBuffer.addValueParam("locationPacked", ParamType::TUniformLocation, locationPacked);
2560 paramBuffer.addValueParam("v0", ParamType::TGLint, v0);
2561
2562 return CallCapture(angle::EntryPoint::GLUniform1i, std::move(paramBuffer));
2563 }
2564
CaptureUniform1iv(const State & glState,bool isCallValid,UniformLocation locationPacked,GLsizei count,const GLint * value)2565 CallCapture CaptureUniform1iv(const State &glState,
2566 bool isCallValid,
2567 UniformLocation locationPacked,
2568 GLsizei count,
2569 const GLint *value)
2570 {
2571 ParamBuffer paramBuffer;
2572
2573 paramBuffer.addValueParam("locationPacked", ParamType::TUniformLocation, locationPacked);
2574 paramBuffer.addValueParam("count", ParamType::TGLsizei, count);
2575
2576 if (isCallValid)
2577 {
2578 ParamCapture valueParam("value", ParamType::TGLintConstPointer);
2579 InitParamValue(ParamType::TGLintConstPointer, value, &valueParam.value);
2580 CaptureUniform1iv_value(glState, isCallValid, locationPacked, count, value, &valueParam);
2581 paramBuffer.addParam(std::move(valueParam));
2582 }
2583 else
2584 {
2585 ParamCapture valueParam("value", ParamType::TGLintConstPointer);
2586 InitParamValue(ParamType::TGLintConstPointer, static_cast<const GLint *>(nullptr),
2587 &valueParam.value);
2588 paramBuffer.addParam(std::move(valueParam));
2589 }
2590
2591 return CallCapture(angle::EntryPoint::GLUniform1iv, std::move(paramBuffer));
2592 }
2593
CaptureUniform2f(const State & glState,bool isCallValid,UniformLocation locationPacked,GLfloat v0,GLfloat v1)2594 CallCapture CaptureUniform2f(const State &glState,
2595 bool isCallValid,
2596 UniformLocation locationPacked,
2597 GLfloat v0,
2598 GLfloat v1)
2599 {
2600 ParamBuffer paramBuffer;
2601
2602 paramBuffer.addValueParam("locationPacked", ParamType::TUniformLocation, locationPacked);
2603 paramBuffer.addValueParam("v0", ParamType::TGLfloat, v0);
2604 paramBuffer.addValueParam("v1", ParamType::TGLfloat, v1);
2605
2606 return CallCapture(angle::EntryPoint::GLUniform2f, std::move(paramBuffer));
2607 }
2608
CaptureUniform2fv(const State & glState,bool isCallValid,UniformLocation locationPacked,GLsizei count,const GLfloat * value)2609 CallCapture CaptureUniform2fv(const State &glState,
2610 bool isCallValid,
2611 UniformLocation locationPacked,
2612 GLsizei count,
2613 const GLfloat *value)
2614 {
2615 ParamBuffer paramBuffer;
2616
2617 paramBuffer.addValueParam("locationPacked", ParamType::TUniformLocation, locationPacked);
2618 paramBuffer.addValueParam("count", ParamType::TGLsizei, count);
2619
2620 if (isCallValid)
2621 {
2622 ParamCapture valueParam("value", ParamType::TGLfloatConstPointer);
2623 InitParamValue(ParamType::TGLfloatConstPointer, value, &valueParam.value);
2624 CaptureUniform2fv_value(glState, isCallValid, locationPacked, count, value, &valueParam);
2625 paramBuffer.addParam(std::move(valueParam));
2626 }
2627 else
2628 {
2629 ParamCapture valueParam("value", ParamType::TGLfloatConstPointer);
2630 InitParamValue(ParamType::TGLfloatConstPointer, static_cast<const GLfloat *>(nullptr),
2631 &valueParam.value);
2632 paramBuffer.addParam(std::move(valueParam));
2633 }
2634
2635 return CallCapture(angle::EntryPoint::GLUniform2fv, std::move(paramBuffer));
2636 }
2637
CaptureUniform2i(const State & glState,bool isCallValid,UniformLocation locationPacked,GLint v0,GLint v1)2638 CallCapture CaptureUniform2i(const State &glState,
2639 bool isCallValid,
2640 UniformLocation locationPacked,
2641 GLint v0,
2642 GLint v1)
2643 {
2644 ParamBuffer paramBuffer;
2645
2646 paramBuffer.addValueParam("locationPacked", ParamType::TUniformLocation, locationPacked);
2647 paramBuffer.addValueParam("v0", ParamType::TGLint, v0);
2648 paramBuffer.addValueParam("v1", ParamType::TGLint, v1);
2649
2650 return CallCapture(angle::EntryPoint::GLUniform2i, std::move(paramBuffer));
2651 }
2652
CaptureUniform2iv(const State & glState,bool isCallValid,UniformLocation locationPacked,GLsizei count,const GLint * value)2653 CallCapture CaptureUniform2iv(const State &glState,
2654 bool isCallValid,
2655 UniformLocation locationPacked,
2656 GLsizei count,
2657 const GLint *value)
2658 {
2659 ParamBuffer paramBuffer;
2660
2661 paramBuffer.addValueParam("locationPacked", ParamType::TUniformLocation, locationPacked);
2662 paramBuffer.addValueParam("count", ParamType::TGLsizei, count);
2663
2664 if (isCallValid)
2665 {
2666 ParamCapture valueParam("value", ParamType::TGLintConstPointer);
2667 InitParamValue(ParamType::TGLintConstPointer, value, &valueParam.value);
2668 CaptureUniform2iv_value(glState, isCallValid, locationPacked, count, value, &valueParam);
2669 paramBuffer.addParam(std::move(valueParam));
2670 }
2671 else
2672 {
2673 ParamCapture valueParam("value", ParamType::TGLintConstPointer);
2674 InitParamValue(ParamType::TGLintConstPointer, static_cast<const GLint *>(nullptr),
2675 &valueParam.value);
2676 paramBuffer.addParam(std::move(valueParam));
2677 }
2678
2679 return CallCapture(angle::EntryPoint::GLUniform2iv, std::move(paramBuffer));
2680 }
2681
CaptureUniform3f(const State & glState,bool isCallValid,UniformLocation locationPacked,GLfloat v0,GLfloat v1,GLfloat v2)2682 CallCapture CaptureUniform3f(const State &glState,
2683 bool isCallValid,
2684 UniformLocation locationPacked,
2685 GLfloat v0,
2686 GLfloat v1,
2687 GLfloat v2)
2688 {
2689 ParamBuffer paramBuffer;
2690
2691 paramBuffer.addValueParam("locationPacked", ParamType::TUniformLocation, locationPacked);
2692 paramBuffer.addValueParam("v0", ParamType::TGLfloat, v0);
2693 paramBuffer.addValueParam("v1", ParamType::TGLfloat, v1);
2694 paramBuffer.addValueParam("v2", ParamType::TGLfloat, v2);
2695
2696 return CallCapture(angle::EntryPoint::GLUniform3f, std::move(paramBuffer));
2697 }
2698
CaptureUniform3fv(const State & glState,bool isCallValid,UniformLocation locationPacked,GLsizei count,const GLfloat * value)2699 CallCapture CaptureUniform3fv(const State &glState,
2700 bool isCallValid,
2701 UniformLocation locationPacked,
2702 GLsizei count,
2703 const GLfloat *value)
2704 {
2705 ParamBuffer paramBuffer;
2706
2707 paramBuffer.addValueParam("locationPacked", ParamType::TUniformLocation, locationPacked);
2708 paramBuffer.addValueParam("count", ParamType::TGLsizei, count);
2709
2710 if (isCallValid)
2711 {
2712 ParamCapture valueParam("value", ParamType::TGLfloatConstPointer);
2713 InitParamValue(ParamType::TGLfloatConstPointer, value, &valueParam.value);
2714 CaptureUniform3fv_value(glState, isCallValid, locationPacked, count, value, &valueParam);
2715 paramBuffer.addParam(std::move(valueParam));
2716 }
2717 else
2718 {
2719 ParamCapture valueParam("value", ParamType::TGLfloatConstPointer);
2720 InitParamValue(ParamType::TGLfloatConstPointer, static_cast<const GLfloat *>(nullptr),
2721 &valueParam.value);
2722 paramBuffer.addParam(std::move(valueParam));
2723 }
2724
2725 return CallCapture(angle::EntryPoint::GLUniform3fv, std::move(paramBuffer));
2726 }
2727
CaptureUniform3i(const State & glState,bool isCallValid,UniformLocation locationPacked,GLint v0,GLint v1,GLint v2)2728 CallCapture CaptureUniform3i(const State &glState,
2729 bool isCallValid,
2730 UniformLocation locationPacked,
2731 GLint v0,
2732 GLint v1,
2733 GLint v2)
2734 {
2735 ParamBuffer paramBuffer;
2736
2737 paramBuffer.addValueParam("locationPacked", ParamType::TUniformLocation, locationPacked);
2738 paramBuffer.addValueParam("v0", ParamType::TGLint, v0);
2739 paramBuffer.addValueParam("v1", ParamType::TGLint, v1);
2740 paramBuffer.addValueParam("v2", ParamType::TGLint, v2);
2741
2742 return CallCapture(angle::EntryPoint::GLUniform3i, std::move(paramBuffer));
2743 }
2744
CaptureUniform3iv(const State & glState,bool isCallValid,UniformLocation locationPacked,GLsizei count,const GLint * value)2745 CallCapture CaptureUniform3iv(const State &glState,
2746 bool isCallValid,
2747 UniformLocation locationPacked,
2748 GLsizei count,
2749 const GLint *value)
2750 {
2751 ParamBuffer paramBuffer;
2752
2753 paramBuffer.addValueParam("locationPacked", ParamType::TUniformLocation, locationPacked);
2754 paramBuffer.addValueParam("count", ParamType::TGLsizei, count);
2755
2756 if (isCallValid)
2757 {
2758 ParamCapture valueParam("value", ParamType::TGLintConstPointer);
2759 InitParamValue(ParamType::TGLintConstPointer, value, &valueParam.value);
2760 CaptureUniform3iv_value(glState, isCallValid, locationPacked, count, value, &valueParam);
2761 paramBuffer.addParam(std::move(valueParam));
2762 }
2763 else
2764 {
2765 ParamCapture valueParam("value", ParamType::TGLintConstPointer);
2766 InitParamValue(ParamType::TGLintConstPointer, static_cast<const GLint *>(nullptr),
2767 &valueParam.value);
2768 paramBuffer.addParam(std::move(valueParam));
2769 }
2770
2771 return CallCapture(angle::EntryPoint::GLUniform3iv, std::move(paramBuffer));
2772 }
2773
CaptureUniform4f(const State & glState,bool isCallValid,UniformLocation locationPacked,GLfloat v0,GLfloat v1,GLfloat v2,GLfloat v3)2774 CallCapture CaptureUniform4f(const State &glState,
2775 bool isCallValid,
2776 UniformLocation locationPacked,
2777 GLfloat v0,
2778 GLfloat v1,
2779 GLfloat v2,
2780 GLfloat v3)
2781 {
2782 ParamBuffer paramBuffer;
2783
2784 paramBuffer.addValueParam("locationPacked", ParamType::TUniformLocation, locationPacked);
2785 paramBuffer.addValueParam("v0", ParamType::TGLfloat, v0);
2786 paramBuffer.addValueParam("v1", ParamType::TGLfloat, v1);
2787 paramBuffer.addValueParam("v2", ParamType::TGLfloat, v2);
2788 paramBuffer.addValueParam("v3", ParamType::TGLfloat, v3);
2789
2790 return CallCapture(angle::EntryPoint::GLUniform4f, std::move(paramBuffer));
2791 }
2792
CaptureUniform4fv(const State & glState,bool isCallValid,UniformLocation locationPacked,GLsizei count,const GLfloat * value)2793 CallCapture CaptureUniform4fv(const State &glState,
2794 bool isCallValid,
2795 UniformLocation locationPacked,
2796 GLsizei count,
2797 const GLfloat *value)
2798 {
2799 ParamBuffer paramBuffer;
2800
2801 paramBuffer.addValueParam("locationPacked", ParamType::TUniformLocation, locationPacked);
2802 paramBuffer.addValueParam("count", ParamType::TGLsizei, count);
2803
2804 if (isCallValid)
2805 {
2806 ParamCapture valueParam("value", ParamType::TGLfloatConstPointer);
2807 InitParamValue(ParamType::TGLfloatConstPointer, value, &valueParam.value);
2808 CaptureUniform4fv_value(glState, isCallValid, locationPacked, count, value, &valueParam);
2809 paramBuffer.addParam(std::move(valueParam));
2810 }
2811 else
2812 {
2813 ParamCapture valueParam("value", ParamType::TGLfloatConstPointer);
2814 InitParamValue(ParamType::TGLfloatConstPointer, static_cast<const GLfloat *>(nullptr),
2815 &valueParam.value);
2816 paramBuffer.addParam(std::move(valueParam));
2817 }
2818
2819 return CallCapture(angle::EntryPoint::GLUniform4fv, std::move(paramBuffer));
2820 }
2821
CaptureUniform4i(const State & glState,bool isCallValid,UniformLocation locationPacked,GLint v0,GLint v1,GLint v2,GLint v3)2822 CallCapture CaptureUniform4i(const State &glState,
2823 bool isCallValid,
2824 UniformLocation locationPacked,
2825 GLint v0,
2826 GLint v1,
2827 GLint v2,
2828 GLint v3)
2829 {
2830 ParamBuffer paramBuffer;
2831
2832 paramBuffer.addValueParam("locationPacked", ParamType::TUniformLocation, locationPacked);
2833 paramBuffer.addValueParam("v0", ParamType::TGLint, v0);
2834 paramBuffer.addValueParam("v1", ParamType::TGLint, v1);
2835 paramBuffer.addValueParam("v2", ParamType::TGLint, v2);
2836 paramBuffer.addValueParam("v3", ParamType::TGLint, v3);
2837
2838 return CallCapture(angle::EntryPoint::GLUniform4i, std::move(paramBuffer));
2839 }
2840
CaptureUniform4iv(const State & glState,bool isCallValid,UniformLocation locationPacked,GLsizei count,const GLint * value)2841 CallCapture CaptureUniform4iv(const State &glState,
2842 bool isCallValid,
2843 UniformLocation locationPacked,
2844 GLsizei count,
2845 const GLint *value)
2846 {
2847 ParamBuffer paramBuffer;
2848
2849 paramBuffer.addValueParam("locationPacked", ParamType::TUniformLocation, locationPacked);
2850 paramBuffer.addValueParam("count", ParamType::TGLsizei, count);
2851
2852 if (isCallValid)
2853 {
2854 ParamCapture valueParam("value", ParamType::TGLintConstPointer);
2855 InitParamValue(ParamType::TGLintConstPointer, value, &valueParam.value);
2856 CaptureUniform4iv_value(glState, isCallValid, locationPacked, count, value, &valueParam);
2857 paramBuffer.addParam(std::move(valueParam));
2858 }
2859 else
2860 {
2861 ParamCapture valueParam("value", ParamType::TGLintConstPointer);
2862 InitParamValue(ParamType::TGLintConstPointer, static_cast<const GLint *>(nullptr),
2863 &valueParam.value);
2864 paramBuffer.addParam(std::move(valueParam));
2865 }
2866
2867 return CallCapture(angle::EntryPoint::GLUniform4iv, std::move(paramBuffer));
2868 }
2869
CaptureUniformMatrix2fv(const State & glState,bool isCallValid,UniformLocation locationPacked,GLsizei count,GLboolean transpose,const GLfloat * value)2870 CallCapture CaptureUniformMatrix2fv(const State &glState,
2871 bool isCallValid,
2872 UniformLocation locationPacked,
2873 GLsizei count,
2874 GLboolean transpose,
2875 const GLfloat *value)
2876 {
2877 ParamBuffer paramBuffer;
2878
2879 paramBuffer.addValueParam("locationPacked", ParamType::TUniformLocation, locationPacked);
2880 paramBuffer.addValueParam("count", ParamType::TGLsizei, count);
2881 paramBuffer.addValueParam("transpose", ParamType::TGLboolean, transpose);
2882
2883 if (isCallValid)
2884 {
2885 ParamCapture valueParam("value", ParamType::TGLfloatConstPointer);
2886 InitParamValue(ParamType::TGLfloatConstPointer, value, &valueParam.value);
2887 CaptureUniformMatrix2fv_value(glState, isCallValid, locationPacked, count, transpose, value,
2888 &valueParam);
2889 paramBuffer.addParam(std::move(valueParam));
2890 }
2891 else
2892 {
2893 ParamCapture valueParam("value", ParamType::TGLfloatConstPointer);
2894 InitParamValue(ParamType::TGLfloatConstPointer, static_cast<const GLfloat *>(nullptr),
2895 &valueParam.value);
2896 paramBuffer.addParam(std::move(valueParam));
2897 }
2898
2899 return CallCapture(angle::EntryPoint::GLUniformMatrix2fv, std::move(paramBuffer));
2900 }
2901
CaptureUniformMatrix3fv(const State & glState,bool isCallValid,UniformLocation locationPacked,GLsizei count,GLboolean transpose,const GLfloat * value)2902 CallCapture CaptureUniformMatrix3fv(const State &glState,
2903 bool isCallValid,
2904 UniformLocation locationPacked,
2905 GLsizei count,
2906 GLboolean transpose,
2907 const GLfloat *value)
2908 {
2909 ParamBuffer paramBuffer;
2910
2911 paramBuffer.addValueParam("locationPacked", ParamType::TUniformLocation, locationPacked);
2912 paramBuffer.addValueParam("count", ParamType::TGLsizei, count);
2913 paramBuffer.addValueParam("transpose", ParamType::TGLboolean, transpose);
2914
2915 if (isCallValid)
2916 {
2917 ParamCapture valueParam("value", ParamType::TGLfloatConstPointer);
2918 InitParamValue(ParamType::TGLfloatConstPointer, value, &valueParam.value);
2919 CaptureUniformMatrix3fv_value(glState, isCallValid, locationPacked, count, transpose, value,
2920 &valueParam);
2921 paramBuffer.addParam(std::move(valueParam));
2922 }
2923 else
2924 {
2925 ParamCapture valueParam("value", ParamType::TGLfloatConstPointer);
2926 InitParamValue(ParamType::TGLfloatConstPointer, static_cast<const GLfloat *>(nullptr),
2927 &valueParam.value);
2928 paramBuffer.addParam(std::move(valueParam));
2929 }
2930
2931 return CallCapture(angle::EntryPoint::GLUniformMatrix3fv, std::move(paramBuffer));
2932 }
2933
CaptureUniformMatrix4fv(const State & glState,bool isCallValid,UniformLocation locationPacked,GLsizei count,GLboolean transpose,const GLfloat * value)2934 CallCapture CaptureUniformMatrix4fv(const State &glState,
2935 bool isCallValid,
2936 UniformLocation locationPacked,
2937 GLsizei count,
2938 GLboolean transpose,
2939 const GLfloat *value)
2940 {
2941 ParamBuffer paramBuffer;
2942
2943 paramBuffer.addValueParam("locationPacked", ParamType::TUniformLocation, locationPacked);
2944 paramBuffer.addValueParam("count", ParamType::TGLsizei, count);
2945 paramBuffer.addValueParam("transpose", ParamType::TGLboolean, transpose);
2946
2947 if (isCallValid)
2948 {
2949 ParamCapture valueParam("value", ParamType::TGLfloatConstPointer);
2950 InitParamValue(ParamType::TGLfloatConstPointer, value, &valueParam.value);
2951 CaptureUniformMatrix4fv_value(glState, isCallValid, locationPacked, count, transpose, value,
2952 &valueParam);
2953 paramBuffer.addParam(std::move(valueParam));
2954 }
2955 else
2956 {
2957 ParamCapture valueParam("value", ParamType::TGLfloatConstPointer);
2958 InitParamValue(ParamType::TGLfloatConstPointer, static_cast<const GLfloat *>(nullptr),
2959 &valueParam.value);
2960 paramBuffer.addParam(std::move(valueParam));
2961 }
2962
2963 return CallCapture(angle::EntryPoint::GLUniformMatrix4fv, std::move(paramBuffer));
2964 }
2965
CaptureUseProgram(const State & glState,bool isCallValid,ShaderProgramID programPacked)2966 CallCapture CaptureUseProgram(const State &glState, bool isCallValid, ShaderProgramID programPacked)
2967 {
2968 ParamBuffer paramBuffer;
2969
2970 paramBuffer.addValueParam("programPacked", ParamType::TShaderProgramID, programPacked);
2971
2972 return CallCapture(angle::EntryPoint::GLUseProgram, std::move(paramBuffer));
2973 }
2974
CaptureValidateProgram(const State & glState,bool isCallValid,ShaderProgramID programPacked)2975 CallCapture CaptureValidateProgram(const State &glState,
2976 bool isCallValid,
2977 ShaderProgramID programPacked)
2978 {
2979 ParamBuffer paramBuffer;
2980
2981 paramBuffer.addValueParam("programPacked", ParamType::TShaderProgramID, programPacked);
2982
2983 return CallCapture(angle::EntryPoint::GLValidateProgram, std::move(paramBuffer));
2984 }
2985
CaptureVertexAttrib1f(const State & glState,bool isCallValid,GLuint index,GLfloat x)2986 CallCapture CaptureVertexAttrib1f(const State &glState, bool isCallValid, GLuint index, GLfloat x)
2987 {
2988 ParamBuffer paramBuffer;
2989
2990 paramBuffer.addValueParam("index", ParamType::TGLuint, index);
2991 paramBuffer.addValueParam("x", ParamType::TGLfloat, x);
2992
2993 return CallCapture(angle::EntryPoint::GLVertexAttrib1f, std::move(paramBuffer));
2994 }
2995
CaptureVertexAttrib1fv(const State & glState,bool isCallValid,GLuint index,const GLfloat * v)2996 CallCapture CaptureVertexAttrib1fv(const State &glState,
2997 bool isCallValid,
2998 GLuint index,
2999 const GLfloat *v)
3000 {
3001 ParamBuffer paramBuffer;
3002
3003 paramBuffer.addValueParam("index", ParamType::TGLuint, index);
3004
3005 if (isCallValid)
3006 {
3007 ParamCapture vParam("v", ParamType::TGLfloatConstPointer);
3008 InitParamValue(ParamType::TGLfloatConstPointer, v, &vParam.value);
3009 CaptureVertexAttrib1fv_v(glState, isCallValid, index, v, &vParam);
3010 paramBuffer.addParam(std::move(vParam));
3011 }
3012 else
3013 {
3014 ParamCapture vParam("v", ParamType::TGLfloatConstPointer);
3015 InitParamValue(ParamType::TGLfloatConstPointer, static_cast<const GLfloat *>(nullptr),
3016 &vParam.value);
3017 paramBuffer.addParam(std::move(vParam));
3018 }
3019
3020 return CallCapture(angle::EntryPoint::GLVertexAttrib1fv, std::move(paramBuffer));
3021 }
3022
CaptureVertexAttrib2f(const State & glState,bool isCallValid,GLuint index,GLfloat x,GLfloat y)3023 CallCapture CaptureVertexAttrib2f(const State &glState,
3024 bool isCallValid,
3025 GLuint index,
3026 GLfloat x,
3027 GLfloat y)
3028 {
3029 ParamBuffer paramBuffer;
3030
3031 paramBuffer.addValueParam("index", ParamType::TGLuint, index);
3032 paramBuffer.addValueParam("x", ParamType::TGLfloat, x);
3033 paramBuffer.addValueParam("y", ParamType::TGLfloat, y);
3034
3035 return CallCapture(angle::EntryPoint::GLVertexAttrib2f, std::move(paramBuffer));
3036 }
3037
CaptureVertexAttrib2fv(const State & glState,bool isCallValid,GLuint index,const GLfloat * v)3038 CallCapture CaptureVertexAttrib2fv(const State &glState,
3039 bool isCallValid,
3040 GLuint index,
3041 const GLfloat *v)
3042 {
3043 ParamBuffer paramBuffer;
3044
3045 paramBuffer.addValueParam("index", ParamType::TGLuint, index);
3046
3047 if (isCallValid)
3048 {
3049 ParamCapture vParam("v", ParamType::TGLfloatConstPointer);
3050 InitParamValue(ParamType::TGLfloatConstPointer, v, &vParam.value);
3051 CaptureVertexAttrib2fv_v(glState, isCallValid, index, v, &vParam);
3052 paramBuffer.addParam(std::move(vParam));
3053 }
3054 else
3055 {
3056 ParamCapture vParam("v", ParamType::TGLfloatConstPointer);
3057 InitParamValue(ParamType::TGLfloatConstPointer, static_cast<const GLfloat *>(nullptr),
3058 &vParam.value);
3059 paramBuffer.addParam(std::move(vParam));
3060 }
3061
3062 return CallCapture(angle::EntryPoint::GLVertexAttrib2fv, std::move(paramBuffer));
3063 }
3064
CaptureVertexAttrib3f(const State & glState,bool isCallValid,GLuint index,GLfloat x,GLfloat y,GLfloat z)3065 CallCapture CaptureVertexAttrib3f(const State &glState,
3066 bool isCallValid,
3067 GLuint index,
3068 GLfloat x,
3069 GLfloat y,
3070 GLfloat z)
3071 {
3072 ParamBuffer paramBuffer;
3073
3074 paramBuffer.addValueParam("index", ParamType::TGLuint, index);
3075 paramBuffer.addValueParam("x", ParamType::TGLfloat, x);
3076 paramBuffer.addValueParam("y", ParamType::TGLfloat, y);
3077 paramBuffer.addValueParam("z", ParamType::TGLfloat, z);
3078
3079 return CallCapture(angle::EntryPoint::GLVertexAttrib3f, std::move(paramBuffer));
3080 }
3081
CaptureVertexAttrib3fv(const State & glState,bool isCallValid,GLuint index,const GLfloat * v)3082 CallCapture CaptureVertexAttrib3fv(const State &glState,
3083 bool isCallValid,
3084 GLuint index,
3085 const GLfloat *v)
3086 {
3087 ParamBuffer paramBuffer;
3088
3089 paramBuffer.addValueParam("index", ParamType::TGLuint, index);
3090
3091 if (isCallValid)
3092 {
3093 ParamCapture vParam("v", ParamType::TGLfloatConstPointer);
3094 InitParamValue(ParamType::TGLfloatConstPointer, v, &vParam.value);
3095 CaptureVertexAttrib3fv_v(glState, isCallValid, index, v, &vParam);
3096 paramBuffer.addParam(std::move(vParam));
3097 }
3098 else
3099 {
3100 ParamCapture vParam("v", ParamType::TGLfloatConstPointer);
3101 InitParamValue(ParamType::TGLfloatConstPointer, static_cast<const GLfloat *>(nullptr),
3102 &vParam.value);
3103 paramBuffer.addParam(std::move(vParam));
3104 }
3105
3106 return CallCapture(angle::EntryPoint::GLVertexAttrib3fv, std::move(paramBuffer));
3107 }
3108
CaptureVertexAttrib4f(const State & glState,bool isCallValid,GLuint index,GLfloat x,GLfloat y,GLfloat z,GLfloat w)3109 CallCapture CaptureVertexAttrib4f(const State &glState,
3110 bool isCallValid,
3111 GLuint index,
3112 GLfloat x,
3113 GLfloat y,
3114 GLfloat z,
3115 GLfloat w)
3116 {
3117 ParamBuffer paramBuffer;
3118
3119 paramBuffer.addValueParam("index", ParamType::TGLuint, index);
3120 paramBuffer.addValueParam("x", ParamType::TGLfloat, x);
3121 paramBuffer.addValueParam("y", ParamType::TGLfloat, y);
3122 paramBuffer.addValueParam("z", ParamType::TGLfloat, z);
3123 paramBuffer.addValueParam("w", ParamType::TGLfloat, w);
3124
3125 return CallCapture(angle::EntryPoint::GLVertexAttrib4f, std::move(paramBuffer));
3126 }
3127
CaptureVertexAttrib4fv(const State & glState,bool isCallValid,GLuint index,const GLfloat * v)3128 CallCapture CaptureVertexAttrib4fv(const State &glState,
3129 bool isCallValid,
3130 GLuint index,
3131 const GLfloat *v)
3132 {
3133 ParamBuffer paramBuffer;
3134
3135 paramBuffer.addValueParam("index", ParamType::TGLuint, index);
3136
3137 if (isCallValid)
3138 {
3139 ParamCapture vParam("v", ParamType::TGLfloatConstPointer);
3140 InitParamValue(ParamType::TGLfloatConstPointer, v, &vParam.value);
3141 CaptureVertexAttrib4fv_v(glState, isCallValid, index, v, &vParam);
3142 paramBuffer.addParam(std::move(vParam));
3143 }
3144 else
3145 {
3146 ParamCapture vParam("v", ParamType::TGLfloatConstPointer);
3147 InitParamValue(ParamType::TGLfloatConstPointer, static_cast<const GLfloat *>(nullptr),
3148 &vParam.value);
3149 paramBuffer.addParam(std::move(vParam));
3150 }
3151
3152 return CallCapture(angle::EntryPoint::GLVertexAttrib4fv, std::move(paramBuffer));
3153 }
3154
CaptureVertexAttribPointer(const State & glState,bool isCallValid,GLuint index,GLint size,VertexAttribType typePacked,GLboolean normalized,GLsizei stride,const void * pointer)3155 CallCapture CaptureVertexAttribPointer(const State &glState,
3156 bool isCallValid,
3157 GLuint index,
3158 GLint size,
3159 VertexAttribType typePacked,
3160 GLboolean normalized,
3161 GLsizei stride,
3162 const void *pointer)
3163 {
3164 ParamBuffer paramBuffer;
3165
3166 paramBuffer.addValueParam("index", ParamType::TGLuint, index);
3167 paramBuffer.addValueParam("size", ParamType::TGLint, size);
3168 paramBuffer.addValueParam("typePacked", ParamType::TVertexAttribType, typePacked);
3169 paramBuffer.addValueParam("normalized", ParamType::TGLboolean, normalized);
3170 paramBuffer.addValueParam("stride", ParamType::TGLsizei, stride);
3171
3172 if (isCallValid)
3173 {
3174 ParamCapture pointerParam("pointer", ParamType::TvoidConstPointer);
3175 InitParamValue(ParamType::TvoidConstPointer, pointer, &pointerParam.value);
3176 CaptureVertexAttribPointer_pointer(glState, isCallValid, index, size, typePacked,
3177 normalized, stride, pointer, &pointerParam);
3178 paramBuffer.addParam(std::move(pointerParam));
3179 }
3180 else
3181 {
3182 ParamCapture pointerParam("pointer", ParamType::TvoidConstPointer);
3183 InitParamValue(ParamType::TvoidConstPointer, static_cast<const void *>(nullptr),
3184 &pointerParam.value);
3185 paramBuffer.addParam(std::move(pointerParam));
3186 }
3187
3188 return CallCapture(angle::EntryPoint::GLVertexAttribPointer, std::move(paramBuffer));
3189 }
3190
CaptureViewport(const State & glState,bool isCallValid,GLint x,GLint y,GLsizei width,GLsizei height)3191 CallCapture CaptureViewport(const State &glState,
3192 bool isCallValid,
3193 GLint x,
3194 GLint y,
3195 GLsizei width,
3196 GLsizei height)
3197 {
3198 ParamBuffer paramBuffer;
3199
3200 paramBuffer.addValueParam("x", ParamType::TGLint, x);
3201 paramBuffer.addValueParam("y", ParamType::TGLint, y);
3202 paramBuffer.addValueParam("width", ParamType::TGLsizei, width);
3203 paramBuffer.addValueParam("height", ParamType::TGLsizei, height);
3204
3205 return CallCapture(angle::EntryPoint::GLViewport, std::move(paramBuffer));
3206 }
3207
3208 } // namespace gl
3209