1 //
2 // Copyright 2019 The ANGLE Project Authors. All rights reserved.
3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file.
5 //
6 // capture_gles31_params.cpp:
7 // Pointer parameter capture functions for the OpenGL ES 3.1 entry points.
8
9 #include "libANGLE/capture/capture_gles_3_1_autogen.h"
10
11 using namespace angle;
12
13 namespace gl
14 {
15
CaptureCreateShaderProgramv_strings(const State & glState,bool isCallValid,ShaderType typePacked,GLsizei count,const GLchar * const * strings,ParamCapture * paramCapture)16 void CaptureCreateShaderProgramv_strings(const State &glState,
17 bool isCallValid,
18 ShaderType typePacked,
19 GLsizei count,
20 const GLchar *const *strings,
21 ParamCapture *paramCapture)
22 {
23 CaptureShaderStrings(count, strings, nullptr, paramCapture);
24 }
25
CaptureDeleteProgramPipelines_pipelinesPacked(const State & glState,bool isCallValid,GLsizei n,const ProgramPipelineID * pipelines,ParamCapture * paramCapture)26 void CaptureDeleteProgramPipelines_pipelinesPacked(const State &glState,
27 bool isCallValid,
28 GLsizei n,
29 const ProgramPipelineID *pipelines,
30 ParamCapture *paramCapture)
31 {
32 CaptureArray(pipelines, n, paramCapture);
33 }
34
CaptureDrawArraysIndirect_indirect(const State & glState,bool isCallValid,PrimitiveMode modePacked,const void * indirect,ParamCapture * paramCapture)35 void CaptureDrawArraysIndirect_indirect(const State &glState,
36 bool isCallValid,
37 PrimitiveMode modePacked,
38 const void *indirect,
39 ParamCapture *paramCapture)
40 {
41 // DrawArraysIndirect requires that all data sourced for the command,
42 // including the DrawArraysIndirectCommand structure, be in buffer objects,
43 // and may not be called when the default vertex array object is bound.
44 // Indirect pointer is automatically captured in capture_gles_3_1_autogen.cpp
45 assert(!isCallValid || glState.getTargetBuffer(gl::BufferBinding::DrawIndirect));
46 }
47
CaptureDrawElementsIndirect_indirect(const State & glState,bool isCallValid,PrimitiveMode modePacked,DrawElementsType typePacked,const void * indirect,ParamCapture * paramCapture)48 void CaptureDrawElementsIndirect_indirect(const State &glState,
49 bool isCallValid,
50 PrimitiveMode modePacked,
51 DrawElementsType typePacked,
52 const void *indirect,
53 ParamCapture *paramCapture)
54 {
55 // DrawElementsIndirect requires that all data sourced for the command,
56 // including the DrawElementsIndirectCommand structure, be in buffer objects,
57 // and may not be called when the default vertex array object is bound
58 // Indirect pointer is automatically captured in capture_gles_3_1_autogen.cpp
59 assert(!isCallValid || glState.getTargetBuffer(gl::BufferBinding::DrawIndirect));
60 }
61
CaptureGenProgramPipelines_pipelinesPacked(const State & glState,bool isCallValid,GLsizei n,ProgramPipelineID * pipelines,ParamCapture * paramCapture)62 void CaptureGenProgramPipelines_pipelinesPacked(const State &glState,
63 bool isCallValid,
64 GLsizei n,
65 ProgramPipelineID *pipelines,
66 ParamCapture *paramCapture)
67 {
68 CaptureGenHandles(n, pipelines, paramCapture);
69 }
70
CaptureGetBooleani_v_data(const State & glState,bool isCallValid,GLenum target,GLuint index,GLboolean * data,ParamCapture * paramCapture)71 void CaptureGetBooleani_v_data(const State &glState,
72 bool isCallValid,
73 GLenum target,
74 GLuint index,
75 GLboolean *data,
76 ParamCapture *paramCapture)
77 {
78 UNIMPLEMENTED();
79 }
80
CaptureGetFramebufferParameteriv_params(const State & glState,bool isCallValid,GLenum target,GLenum pname,GLint * params,ParamCapture * paramCapture)81 void CaptureGetFramebufferParameteriv_params(const State &glState,
82 bool isCallValid,
83 GLenum target,
84 GLenum pname,
85 GLint *params,
86 ParamCapture *paramCapture)
87 {
88 UNIMPLEMENTED();
89 }
90
CaptureGetMultisamplefv_val(const State & glState,bool isCallValid,GLenum pname,GLuint index,GLfloat * val,ParamCapture * paramCapture)91 void CaptureGetMultisamplefv_val(const State &glState,
92 bool isCallValid,
93 GLenum pname,
94 GLuint index,
95 GLfloat *val,
96 ParamCapture *paramCapture)
97 {
98 UNIMPLEMENTED();
99 }
100
CaptureGetProgramInterfaceiv_params(const State & glState,bool isCallValid,ShaderProgramID program,GLenum programInterface,GLenum pname,GLint * params,ParamCapture * paramCapture)101 void CaptureGetProgramInterfaceiv_params(const State &glState,
102 bool isCallValid,
103 ShaderProgramID program,
104 GLenum programInterface,
105 GLenum pname,
106 GLint *params,
107 ParamCapture *paramCapture)
108 {
109 CaptureMemory(params, sizeof(GLint), paramCapture);
110 }
111
CaptureGetProgramPipelineInfoLog_length(const State & glState,bool isCallValid,ProgramPipelineID pipeline,GLsizei bufSize,GLsizei * length,GLchar * infoLog,ParamCapture * paramCapture)112 void CaptureGetProgramPipelineInfoLog_length(const State &glState,
113 bool isCallValid,
114 ProgramPipelineID pipeline,
115 GLsizei bufSize,
116 GLsizei *length,
117 GLchar *infoLog,
118 ParamCapture *paramCapture)
119 {
120 UNIMPLEMENTED();
121 }
122
CaptureGetProgramPipelineInfoLog_infoLog(const State & glState,bool isCallValid,ProgramPipelineID pipeline,GLsizei bufSize,GLsizei * length,GLchar * infoLog,ParamCapture * paramCapture)123 void CaptureGetProgramPipelineInfoLog_infoLog(const State &glState,
124 bool isCallValid,
125 ProgramPipelineID pipeline,
126 GLsizei bufSize,
127 GLsizei *length,
128 GLchar *infoLog,
129 ParamCapture *paramCapture)
130 {
131 UNIMPLEMENTED();
132 }
133
CaptureGetProgramPipelineiv_params(const State & glState,bool isCallValid,ProgramPipelineID pipeline,GLenum pname,GLint * params,ParamCapture * paramCapture)134 void CaptureGetProgramPipelineiv_params(const State &glState,
135 bool isCallValid,
136 ProgramPipelineID pipeline,
137 GLenum pname,
138 GLint *params,
139 ParamCapture *paramCapture)
140 {
141 UNIMPLEMENTED();
142 }
143
CaptureGetProgramResourceIndex_name(const State & glState,bool isCallValid,ShaderProgramID program,GLenum programInterface,const GLchar * name,ParamCapture * paramCapture)144 void CaptureGetProgramResourceIndex_name(const State &glState,
145 bool isCallValid,
146 ShaderProgramID program,
147 GLenum programInterface,
148 const GLchar *name,
149 ParamCapture *paramCapture)
150 {
151 UNIMPLEMENTED();
152 }
153
CaptureGetProgramResourceLocation_name(const State & glState,bool isCallValid,ShaderProgramID program,GLenum programInterface,const GLchar * name,ParamCapture * paramCapture)154 void CaptureGetProgramResourceLocation_name(const State &glState,
155 bool isCallValid,
156 ShaderProgramID program,
157 GLenum programInterface,
158 const GLchar *name,
159 ParamCapture *paramCapture)
160 {
161 UNIMPLEMENTED();
162 }
163
CaptureGetProgramResourceName_length(const State & glState,bool isCallValid,ShaderProgramID program,GLenum programInterface,GLuint index,GLsizei bufSize,GLsizei * length,GLchar * name,ParamCapture * paramCapture)164 void CaptureGetProgramResourceName_length(const State &glState,
165 bool isCallValid,
166 ShaderProgramID program,
167 GLenum programInterface,
168 GLuint index,
169 GLsizei bufSize,
170 GLsizei *length,
171 GLchar *name,
172 ParamCapture *paramCapture)
173 {
174 paramCapture->readBufferSizeBytes = sizeof(GLsizei);
175 }
176
CaptureGetProgramResourceName_name(const State & glState,bool isCallValid,ShaderProgramID program,GLenum programInterface,GLuint index,GLsizei bufSize,GLsizei * length,GLchar * name,ParamCapture * paramCapture)177 void CaptureGetProgramResourceName_name(const State &glState,
178 bool isCallValid,
179 ShaderProgramID program,
180 GLenum programInterface,
181 GLuint index,
182 GLsizei bufSize,
183 GLsizei *length,
184 GLchar *name,
185 ParamCapture *paramCapture)
186 {
187 CaptureString(name, paramCapture);
188 }
189
CaptureGetProgramResourceiv_props(const State & glState,bool isCallValid,ShaderProgramID program,GLenum programInterface,GLuint index,GLsizei propCount,const GLenum * props,GLsizei bufSize,GLsizei * length,GLint * params,ParamCapture * paramCapture)190 void CaptureGetProgramResourceiv_props(const State &glState,
191 bool isCallValid,
192 ShaderProgramID program,
193 GLenum programInterface,
194 GLuint index,
195 GLsizei propCount,
196 const GLenum *props,
197 GLsizei bufSize,
198 GLsizei *length,
199 GLint *params,
200 ParamCapture *paramCapture)
201 {
202 CaptureMemory(props, sizeof(GLenum) * propCount, paramCapture);
203 }
204
CaptureGetProgramResourceiv_length(const State & glState,bool isCallValid,ShaderProgramID program,GLenum programInterface,GLuint index,GLsizei propCount,const GLenum * props,GLsizei bufSize,GLsizei * length,GLint * params,ParamCapture * paramCapture)205 void CaptureGetProgramResourceiv_length(const State &glState,
206 bool isCallValid,
207 ShaderProgramID program,
208 GLenum programInterface,
209 GLuint index,
210 GLsizei propCount,
211 const GLenum *props,
212 GLsizei bufSize,
213 GLsizei *length,
214 GLint *params,
215 ParamCapture *paramCapture)
216 {
217 paramCapture->readBufferSizeBytes = sizeof(GLsizei);
218 }
219
CaptureGetProgramResourceiv_params(const State & glState,bool isCallValid,ShaderProgramID program,GLenum programInterface,GLuint index,GLsizei propCount,const GLenum * props,GLsizei bufSize,GLsizei * length,GLint * params,ParamCapture * paramCapture)220 void CaptureGetProgramResourceiv_params(const State &glState,
221 bool isCallValid,
222 ShaderProgramID program,
223 GLenum programInterface,
224 GLuint index,
225 GLsizei propCount,
226 const GLenum *props,
227 GLsizei bufSize,
228 GLsizei *length,
229 GLint *params,
230 ParamCapture *paramCapture)
231 {
232 // See QueryProgramResourceiv for details on how these are handled
233 for (int i = 0; i < propCount; ++i)
234 {
235 if (props[i] == GL_ACTIVE_VARIABLES)
236 {
237 // This appears to be the only property that isn't a single integer
238 UNIMPLEMENTED();
239 return;
240 }
241 }
242
243 CaptureMemory(props, sizeof(GLint) * propCount, paramCapture);
244 }
245
CaptureGetTexLevelParameterfv_params(const State & glState,bool isCallValid,TextureTarget targetPacked,GLint level,GLenum pname,GLfloat * params,ParamCapture * paramCapture)246 void CaptureGetTexLevelParameterfv_params(const State &glState,
247 bool isCallValid,
248 TextureTarget targetPacked,
249 GLint level,
250 GLenum pname,
251 GLfloat *params,
252 ParamCapture *paramCapture)
253 {
254 UNIMPLEMENTED();
255 }
256
CaptureGetTexLevelParameteriv_params(const State & glState,bool isCallValid,TextureTarget targetPacked,GLint level,GLenum pname,GLint * params,ParamCapture * paramCapture)257 void CaptureGetTexLevelParameteriv_params(const State &glState,
258 bool isCallValid,
259 TextureTarget targetPacked,
260 GLint level,
261 GLenum pname,
262 GLint *params,
263 ParamCapture *paramCapture)
264 {
265 UNIMPLEMENTED();
266 }
267
CaptureProgramUniform1fv_value(const State & glState,bool isCallValid,ShaderProgramID program,UniformLocation location,GLsizei count,const GLfloat * value,ParamCapture * paramCapture)268 void CaptureProgramUniform1fv_value(const State &glState,
269 bool isCallValid,
270 ShaderProgramID program,
271 UniformLocation location,
272 GLsizei count,
273 const GLfloat *value,
274 ParamCapture *paramCapture)
275 {
276 CaptureMemory(value, sizeof(GLfloat) * count, paramCapture);
277 }
278
CaptureProgramUniform1iv_value(const State & glState,bool isCallValid,ShaderProgramID program,UniformLocation location,GLsizei count,const GLint * value,ParamCapture * paramCapture)279 void CaptureProgramUniform1iv_value(const State &glState,
280 bool isCallValid,
281 ShaderProgramID program,
282 UniformLocation location,
283 GLsizei count,
284 const GLint *value,
285 ParamCapture *paramCapture)
286 {
287 CaptureMemory(value, sizeof(GLint) * count, paramCapture);
288 }
289
CaptureProgramUniform1uiv_value(const State & glState,bool isCallValid,ShaderProgramID program,UniformLocation location,GLsizei count,const GLuint * value,ParamCapture * paramCapture)290 void CaptureProgramUniform1uiv_value(const State &glState,
291 bool isCallValid,
292 ShaderProgramID program,
293 UniformLocation location,
294 GLsizei count,
295 const GLuint *value,
296 ParamCapture *paramCapture)
297 {
298 CaptureMemory(value, sizeof(GLuint) * count, paramCapture);
299 }
300
CaptureProgramUniform2fv_value(const State & glState,bool isCallValid,ShaderProgramID program,UniformLocation location,GLsizei count,const GLfloat * value,ParamCapture * paramCapture)301 void CaptureProgramUniform2fv_value(const State &glState,
302 bool isCallValid,
303 ShaderProgramID program,
304 UniformLocation location,
305 GLsizei count,
306 const GLfloat *value,
307 ParamCapture *paramCapture)
308 {
309 CaptureMemory(value, sizeof(GLfloat) * 2 * count, paramCapture);
310 }
311
CaptureProgramUniform2iv_value(const State & glState,bool isCallValid,ShaderProgramID program,UniformLocation location,GLsizei count,const GLint * value,ParamCapture * paramCapture)312 void CaptureProgramUniform2iv_value(const State &glState,
313 bool isCallValid,
314 ShaderProgramID program,
315 UniformLocation location,
316 GLsizei count,
317 const GLint *value,
318 ParamCapture *paramCapture)
319 {
320 CaptureMemory(value, sizeof(GLint) * 2 * count, paramCapture);
321 }
322
CaptureProgramUniform2uiv_value(const State & glState,bool isCallValid,ShaderProgramID program,UniformLocation location,GLsizei count,const GLuint * value,ParamCapture * paramCapture)323 void CaptureProgramUniform2uiv_value(const State &glState,
324 bool isCallValid,
325 ShaderProgramID program,
326 UniformLocation location,
327 GLsizei count,
328 const GLuint *value,
329 ParamCapture *paramCapture)
330 {
331 CaptureMemory(value, sizeof(GLuint) * 2 * count, paramCapture);
332 }
333
CaptureProgramUniform3fv_value(const State & glState,bool isCallValid,ShaderProgramID program,UniformLocation location,GLsizei count,const GLfloat * value,ParamCapture * paramCapture)334 void CaptureProgramUniform3fv_value(const State &glState,
335 bool isCallValid,
336 ShaderProgramID program,
337 UniformLocation location,
338 GLsizei count,
339 const GLfloat *value,
340 ParamCapture *paramCapture)
341 {
342 CaptureMemory(value, sizeof(GLfloat) * 3 * count, paramCapture);
343 }
344
CaptureProgramUniform3iv_value(const State & glState,bool isCallValid,ShaderProgramID program,UniformLocation location,GLsizei count,const GLint * value,ParamCapture * paramCapture)345 void CaptureProgramUniform3iv_value(const State &glState,
346 bool isCallValid,
347 ShaderProgramID program,
348 UniformLocation location,
349 GLsizei count,
350 const GLint *value,
351 ParamCapture *paramCapture)
352 {
353 CaptureMemory(value, sizeof(GLint) * 3 * count, paramCapture);
354 }
355
CaptureProgramUniform3uiv_value(const State & glState,bool isCallValid,ShaderProgramID program,UniformLocation location,GLsizei count,const GLuint * value,ParamCapture * paramCapture)356 void CaptureProgramUniform3uiv_value(const State &glState,
357 bool isCallValid,
358 ShaderProgramID program,
359 UniformLocation location,
360 GLsizei count,
361 const GLuint *value,
362 ParamCapture *paramCapture)
363 {
364 CaptureMemory(value, sizeof(GLuint) * 3 * count, paramCapture);
365 }
366
CaptureProgramUniform4fv_value(const State & glState,bool isCallValid,ShaderProgramID program,UniformLocation location,GLsizei count,const GLfloat * value,ParamCapture * paramCapture)367 void CaptureProgramUniform4fv_value(const State &glState,
368 bool isCallValid,
369 ShaderProgramID program,
370 UniformLocation location,
371 GLsizei count,
372 const GLfloat *value,
373 ParamCapture *paramCapture)
374 {
375 CaptureMemory(value, sizeof(GLfloat) * 4 * count, paramCapture);
376 }
377
CaptureProgramUniform4iv_value(const State & glState,bool isCallValid,ShaderProgramID program,UniformLocation location,GLsizei count,const GLint * value,ParamCapture * paramCapture)378 void CaptureProgramUniform4iv_value(const State &glState,
379 bool isCallValid,
380 ShaderProgramID program,
381 UniformLocation location,
382 GLsizei count,
383 const GLint *value,
384 ParamCapture *paramCapture)
385 {
386 CaptureMemory(value, sizeof(GLint) * 4 * count, paramCapture);
387 }
388
CaptureProgramUniform4uiv_value(const State & glState,bool isCallValid,ShaderProgramID program,UniformLocation location,GLsizei count,const GLuint * value,ParamCapture * paramCapture)389 void CaptureProgramUniform4uiv_value(const State &glState,
390 bool isCallValid,
391 ShaderProgramID program,
392 UniformLocation location,
393 GLsizei count,
394 const GLuint *value,
395 ParamCapture *paramCapture)
396 {
397 CaptureMemory(value, sizeof(GLuint) * 4 * count, paramCapture);
398 }
399
CaptureProgramUniformMatrix2fv_value(const State & glState,bool isCallValid,ShaderProgramID program,UniformLocation location,GLsizei count,GLboolean transpose,const GLfloat * value,ParamCapture * paramCapture)400 void CaptureProgramUniformMatrix2fv_value(const State &glState,
401 bool isCallValid,
402 ShaderProgramID program,
403 UniformLocation location,
404 GLsizei count,
405 GLboolean transpose,
406 const GLfloat *value,
407 ParamCapture *paramCapture)
408 {
409 CaptureMemory(value, sizeof(GLfloat) * 2 * 2 * count, paramCapture);
410 }
411
CaptureProgramUniformMatrix2x3fv_value(const State & glState,bool isCallValid,ShaderProgramID program,UniformLocation location,GLsizei count,GLboolean transpose,const GLfloat * value,ParamCapture * paramCapture)412 void CaptureProgramUniformMatrix2x3fv_value(const State &glState,
413 bool isCallValid,
414 ShaderProgramID program,
415 UniformLocation location,
416 GLsizei count,
417 GLboolean transpose,
418 const GLfloat *value,
419 ParamCapture *paramCapture)
420 {
421 CaptureMemory(value, sizeof(GLfloat) * 2 * 3 * count, paramCapture);
422 }
423
CaptureProgramUniformMatrix2x4fv_value(const State & glState,bool isCallValid,ShaderProgramID program,UniformLocation location,GLsizei count,GLboolean transpose,const GLfloat * value,ParamCapture * paramCapture)424 void CaptureProgramUniformMatrix2x4fv_value(const State &glState,
425 bool isCallValid,
426 ShaderProgramID program,
427 UniformLocation location,
428 GLsizei count,
429 GLboolean transpose,
430 const GLfloat *value,
431 ParamCapture *paramCapture)
432 {
433 CaptureMemory(value, sizeof(GLfloat) * 2 * 4 * count, paramCapture);
434 }
435
CaptureProgramUniformMatrix3fv_value(const State & glState,bool isCallValid,ShaderProgramID program,UniformLocation location,GLsizei count,GLboolean transpose,const GLfloat * value,ParamCapture * paramCapture)436 void CaptureProgramUniformMatrix3fv_value(const State &glState,
437 bool isCallValid,
438 ShaderProgramID program,
439 UniformLocation location,
440 GLsizei count,
441 GLboolean transpose,
442 const GLfloat *value,
443 ParamCapture *paramCapture)
444 {
445 CaptureMemory(value, sizeof(GLfloat) * 3 * 3 * count, paramCapture);
446 }
447
CaptureProgramUniformMatrix3x2fv_value(const State & glState,bool isCallValid,ShaderProgramID program,UniformLocation location,GLsizei count,GLboolean transpose,const GLfloat * value,ParamCapture * paramCapture)448 void CaptureProgramUniformMatrix3x2fv_value(const State &glState,
449 bool isCallValid,
450 ShaderProgramID program,
451 UniformLocation location,
452 GLsizei count,
453 GLboolean transpose,
454 const GLfloat *value,
455 ParamCapture *paramCapture)
456 {
457 CaptureMemory(value, sizeof(GLfloat) * 3 * 2 * count, paramCapture);
458 }
459
CaptureProgramUniformMatrix3x4fv_value(const State & glState,bool isCallValid,ShaderProgramID program,UniformLocation location,GLsizei count,GLboolean transpose,const GLfloat * value,ParamCapture * paramCapture)460 void CaptureProgramUniformMatrix3x4fv_value(const State &glState,
461 bool isCallValid,
462 ShaderProgramID program,
463 UniformLocation location,
464 GLsizei count,
465 GLboolean transpose,
466 const GLfloat *value,
467 ParamCapture *paramCapture)
468 {
469 CaptureMemory(value, sizeof(GLfloat) * 3 * 4 * count, paramCapture);
470 }
471
CaptureProgramUniformMatrix4fv_value(const State & glState,bool isCallValid,ShaderProgramID program,UniformLocation location,GLsizei count,GLboolean transpose,const GLfloat * value,ParamCapture * paramCapture)472 void CaptureProgramUniformMatrix4fv_value(const State &glState,
473 bool isCallValid,
474 ShaderProgramID program,
475 UniformLocation location,
476 GLsizei count,
477 GLboolean transpose,
478 const GLfloat *value,
479 ParamCapture *paramCapture)
480 {
481 CaptureMemory(value, sizeof(GLfloat) * 4 * 4 * count, paramCapture);
482 }
483
CaptureProgramUniformMatrix4x2fv_value(const State & glState,bool isCallValid,ShaderProgramID program,UniformLocation location,GLsizei count,GLboolean transpose,const GLfloat * value,ParamCapture * paramCapture)484 void CaptureProgramUniformMatrix4x2fv_value(const State &glState,
485 bool isCallValid,
486 ShaderProgramID program,
487 UniformLocation location,
488 GLsizei count,
489 GLboolean transpose,
490 const GLfloat *value,
491 ParamCapture *paramCapture)
492 {
493 CaptureMemory(value, sizeof(GLfloat) * 4 * 2 * count, paramCapture);
494 }
495
CaptureProgramUniformMatrix4x3fv_value(const State & glState,bool isCallValid,ShaderProgramID program,UniformLocation location,GLsizei count,GLboolean transpose,const GLfloat * value,ParamCapture * paramCapture)496 void CaptureProgramUniformMatrix4x3fv_value(const State &glState,
497 bool isCallValid,
498 ShaderProgramID program,
499 UniformLocation location,
500 GLsizei count,
501 GLboolean transpose,
502 const GLfloat *value,
503 ParamCapture *paramCapture)
504 {
505 CaptureMemory(value, sizeof(GLfloat) * 4 * 3 * count, paramCapture);
506 }
507
508 } // namespace gl
509