1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 // This file is auto-generated from
6 // gpu/command_buffer/build_gles2_cmd_buffer.py
7 // It's formatted by clang-format using chromium coding style:
8 // clang-format -i -style=chromium filename
11 // This file is included by gles2_implementation.cc to define the
13 #ifndef GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_IMPL_AUTOGEN_H_
14 #define GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_IMPL_AUTOGEN_H_
16 void GLES2Implementation::AttachShader(GLuint program
, GLuint shader
) {
17 GPU_CLIENT_SINGLE_THREAD_CHECK();
18 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glAttachShader(" << program
<< ", "
20 helper_
->AttachShader(program
, shader
);
24 void GLES2Implementation::BindBuffer(GLenum target
, GLuint buffer
) {
25 GPU_CLIENT_SINGLE_THREAD_CHECK();
26 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glBindBuffer("
27 << GLES2Util::GetStringBufferTarget(target
) << ", "
29 if (IsBufferReservedId(buffer
)) {
30 SetGLError(GL_INVALID_OPERATION
, "BindBuffer", "buffer reserved id");
33 BindBufferHelper(target
, buffer
);
37 void GLES2Implementation::BindBufferBase(GLenum target
,
40 GPU_CLIENT_SINGLE_THREAD_CHECK();
41 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glBindBufferBase("
42 << GLES2Util::GetStringIndexedBufferTarget(target
) << ", "
43 << index
<< ", " << buffer
<< ")");
44 if (IsBufferReservedId(buffer
)) {
45 SetGLError(GL_INVALID_OPERATION
, "BindBufferBase", "buffer reserved id");
48 BindBufferBaseHelper(target
, index
, buffer
);
52 void GLES2Implementation::BindBufferRange(GLenum target
,
57 GPU_CLIENT_SINGLE_THREAD_CHECK();
58 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glBindBufferRange("
59 << GLES2Util::GetStringIndexedBufferTarget(target
) << ", "
60 << index
<< ", " << buffer
<< ", " << offset
<< ", "
63 SetGLError(GL_INVALID_VALUE
, "glBindBufferRange", "offset < 0");
67 SetGLError(GL_INVALID_VALUE
, "glBindBufferRange", "size < 0");
70 if (IsBufferReservedId(buffer
)) {
71 SetGLError(GL_INVALID_OPERATION
, "BindBufferRange", "buffer reserved id");
74 BindBufferRangeHelper(target
, index
, buffer
, offset
, size
);
78 void GLES2Implementation::BindFramebuffer(GLenum target
, GLuint framebuffer
) {
79 GPU_CLIENT_SINGLE_THREAD_CHECK();
80 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glBindFramebuffer("
81 << GLES2Util::GetStringFrameBufferTarget(target
) << ", "
82 << framebuffer
<< ")");
83 if (IsFramebufferReservedId(framebuffer
)) {
84 SetGLError(GL_INVALID_OPERATION
, "BindFramebuffer",
85 "framebuffer reserved id");
88 BindFramebufferHelper(target
, framebuffer
);
92 void GLES2Implementation::BindRenderbuffer(GLenum target
, GLuint renderbuffer
) {
93 GPU_CLIENT_SINGLE_THREAD_CHECK();
94 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glBindRenderbuffer("
95 << GLES2Util::GetStringRenderBufferTarget(target
) << ", "
96 << renderbuffer
<< ")");
97 if (IsRenderbufferReservedId(renderbuffer
)) {
98 SetGLError(GL_INVALID_OPERATION
, "BindRenderbuffer",
99 "renderbuffer reserved id");
102 BindRenderbufferHelper(target
, renderbuffer
);
106 void GLES2Implementation::BindSampler(GLuint unit
, GLuint sampler
) {
107 GPU_CLIENT_SINGLE_THREAD_CHECK();
108 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glBindSampler(" << unit
<< ", "
110 if (IsSamplerReservedId(sampler
)) {
111 SetGLError(GL_INVALID_OPERATION
, "BindSampler", "sampler reserved id");
114 BindSamplerHelper(unit
, sampler
);
118 void GLES2Implementation::BindTexture(GLenum target
, GLuint texture
) {
119 GPU_CLIENT_SINGLE_THREAD_CHECK();
120 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glBindTexture("
121 << GLES2Util::GetStringTextureBindTarget(target
) << ", "
123 if (IsTextureReservedId(texture
)) {
124 SetGLError(GL_INVALID_OPERATION
, "BindTexture", "texture reserved id");
127 BindTextureHelper(target
, texture
);
131 void GLES2Implementation::BindTransformFeedback(GLenum target
,
132 GLuint transformfeedback
) {
133 GPU_CLIENT_SINGLE_THREAD_CHECK();
134 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glBindTransformFeedback("
135 << GLES2Util::GetStringTransformFeedbackBindTarget(target
)
136 << ", " << transformfeedback
<< ")");
137 if (IsTransformFeedbackReservedId(transformfeedback
)) {
138 SetGLError(GL_INVALID_OPERATION
, "BindTransformFeedback",
139 "transformfeedback reserved id");
142 BindTransformFeedbackHelper(target
, transformfeedback
);
146 void GLES2Implementation::BlendColor(GLclampf red
,
150 GPU_CLIENT_SINGLE_THREAD_CHECK();
151 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glBlendColor(" << red
<< ", "
152 << green
<< ", " << blue
<< ", " << alpha
<< ")");
153 helper_
->BlendColor(red
, green
, blue
, alpha
);
157 void GLES2Implementation::BlendEquation(GLenum mode
) {
158 GPU_CLIENT_SINGLE_THREAD_CHECK();
159 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glBlendEquation("
160 << GLES2Util::GetStringEquation(mode
) << ")");
161 helper_
->BlendEquation(mode
);
165 void GLES2Implementation::BlendEquationSeparate(GLenum modeRGB
,
167 GPU_CLIENT_SINGLE_THREAD_CHECK();
168 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glBlendEquationSeparate("
169 << GLES2Util::GetStringEquation(modeRGB
) << ", "
170 << GLES2Util::GetStringEquation(modeAlpha
) << ")");
171 helper_
->BlendEquationSeparate(modeRGB
, modeAlpha
);
175 void GLES2Implementation::BlendFunc(GLenum sfactor
, GLenum dfactor
) {
176 GPU_CLIENT_SINGLE_THREAD_CHECK();
177 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glBlendFunc("
178 << GLES2Util::GetStringSrcBlendFactor(sfactor
) << ", "
179 << GLES2Util::GetStringDstBlendFactor(dfactor
) << ")");
180 helper_
->BlendFunc(sfactor
, dfactor
);
184 void GLES2Implementation::BlendFuncSeparate(GLenum srcRGB
,
188 GPU_CLIENT_SINGLE_THREAD_CHECK();
189 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glBlendFuncSeparate("
190 << GLES2Util::GetStringSrcBlendFactor(srcRGB
) << ", "
191 << GLES2Util::GetStringDstBlendFactor(dstRGB
) << ", "
192 << GLES2Util::GetStringSrcBlendFactor(srcAlpha
) << ", "
193 << GLES2Util::GetStringDstBlendFactor(dstAlpha
) << ")");
194 helper_
->BlendFuncSeparate(srcRGB
, dstRGB
, srcAlpha
, dstAlpha
);
198 GLenum
GLES2Implementation::CheckFramebufferStatus(GLenum target
) {
199 GPU_CLIENT_SINGLE_THREAD_CHECK();
200 TRACE_EVENT0("gpu", "GLES2Implementation::CheckFramebufferStatus");
201 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glCheckFramebufferStatus("
202 << GLES2Util::GetStringFrameBufferTarget(target
) << ")");
203 typedef cmds::CheckFramebufferStatus::Result Result
;
204 Result
* result
= GetResultAs
<Result
*>();
206 return GL_FRAMEBUFFER_UNSUPPORTED
;
209 helper_
->CheckFramebufferStatus(target
, GetResultShmId(),
210 GetResultShmOffset());
212 GLenum result_value
= *result
;
213 GPU_CLIENT_LOG("returned " << result_value
);
218 void GLES2Implementation::Clear(GLbitfield mask
) {
219 GPU_CLIENT_SINGLE_THREAD_CHECK();
220 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glClear(" << mask
<< ")");
221 helper_
->Clear(mask
);
225 void GLES2Implementation::ClearBufferfi(GLenum buffer
,
229 GPU_CLIENT_SINGLE_THREAD_CHECK();
230 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glClearBufferfi("
231 << GLES2Util::GetStringBufferfv(buffer
) << ", "
232 << drawbuffers
<< ", " << depth
<< ", " << stencil
<< ")");
233 helper_
->ClearBufferfi(buffer
, drawbuffers
, depth
, stencil
);
237 void GLES2Implementation::ClearBufferfv(GLenum buffer
,
239 const GLfloat
* value
) {
240 GPU_CLIENT_SINGLE_THREAD_CHECK();
241 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glClearBufferfv("
242 << GLES2Util::GetStringBufferfv(buffer
) << ", "
243 << drawbuffers
<< ", " << static_cast<const void*>(value
)
245 size_t count
= GLES2Util::CalcClearBufferfvDataCount(buffer
);
246 DCHECK_LE(count
, 4u);
247 for (size_t ii
= 0; ii
< count
; ++ii
)
248 GPU_CLIENT_LOG("value[" << ii
<< "]: " << value
[ii
]);
249 helper_
->ClearBufferfvImmediate(buffer
, drawbuffers
, value
);
253 void GLES2Implementation::ClearBufferiv(GLenum buffer
,
255 const GLint
* value
) {
256 GPU_CLIENT_SINGLE_THREAD_CHECK();
257 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glClearBufferiv("
258 << GLES2Util::GetStringBufferiv(buffer
) << ", "
259 << drawbuffers
<< ", " << static_cast<const void*>(value
)
261 size_t count
= GLES2Util::CalcClearBufferivDataCount(buffer
);
262 DCHECK_LE(count
, 4u);
263 for (size_t ii
= 0; ii
< count
; ++ii
)
264 GPU_CLIENT_LOG("value[" << ii
<< "]: " << value
[ii
]);
265 helper_
->ClearBufferivImmediate(buffer
, drawbuffers
, value
);
269 void GLES2Implementation::ClearBufferuiv(GLenum buffer
,
271 const GLuint
* value
) {
272 GPU_CLIENT_SINGLE_THREAD_CHECK();
273 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glClearBufferuiv("
274 << GLES2Util::GetStringBufferuiv(buffer
) << ", "
275 << drawbuffers
<< ", " << static_cast<const void*>(value
)
278 for (size_t ii
= 0; ii
< count
; ++ii
)
279 GPU_CLIENT_LOG("value[" << ii
<< "]: " << value
[ii
]);
280 helper_
->ClearBufferuivImmediate(buffer
, drawbuffers
, value
);
284 void GLES2Implementation::ClearColor(GLclampf red
,
288 GPU_CLIENT_SINGLE_THREAD_CHECK();
289 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glClearColor(" << red
<< ", "
290 << green
<< ", " << blue
<< ", " << alpha
<< ")");
291 helper_
->ClearColor(red
, green
, blue
, alpha
);
295 void GLES2Implementation::ClearDepthf(GLclampf depth
) {
296 GPU_CLIENT_SINGLE_THREAD_CHECK();
297 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glClearDepthf(" << depth
<< ")");
298 helper_
->ClearDepthf(depth
);
302 void GLES2Implementation::ClearStencil(GLint s
) {
303 GPU_CLIENT_SINGLE_THREAD_CHECK();
304 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glClearStencil(" << s
<< ")");
305 helper_
->ClearStencil(s
);
309 void GLES2Implementation::ColorMask(GLboolean red
,
313 GPU_CLIENT_SINGLE_THREAD_CHECK();
314 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glColorMask("
315 << GLES2Util::GetStringBool(red
) << ", "
316 << GLES2Util::GetStringBool(green
) << ", "
317 << GLES2Util::GetStringBool(blue
) << ", "
318 << GLES2Util::GetStringBool(alpha
) << ")");
319 helper_
->ColorMask(red
, green
, blue
, alpha
);
323 void GLES2Implementation::CompileShader(GLuint shader
) {
324 GPU_CLIENT_SINGLE_THREAD_CHECK();
325 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glCompileShader(" << shader
327 helper_
->CompileShader(shader
);
331 void GLES2Implementation::CopyBufferSubData(GLenum readtarget
,
334 GLintptr writeoffset
,
336 GPU_CLIENT_SINGLE_THREAD_CHECK();
337 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glCopyBufferSubData("
338 << GLES2Util::GetStringBufferTarget(readtarget
) << ", "
339 << GLES2Util::GetStringBufferTarget(writetarget
) << ", "
340 << readoffset
<< ", " << writeoffset
<< ", " << size
342 if (readoffset
< 0) {
343 SetGLError(GL_INVALID_VALUE
, "glCopyBufferSubData", "readoffset < 0");
346 if (writeoffset
< 0) {
347 SetGLError(GL_INVALID_VALUE
, "glCopyBufferSubData", "writeoffset < 0");
351 SetGLError(GL_INVALID_VALUE
, "glCopyBufferSubData", "size < 0");
354 helper_
->CopyBufferSubData(readtarget
, writetarget
, readoffset
, writeoffset
,
359 void GLES2Implementation::CopyTexImage2D(GLenum target
,
361 GLenum internalformat
,
367 GPU_CLIENT_SINGLE_THREAD_CHECK();
369 "[" << GetLogPrefix() << "] glCopyTexImage2D("
370 << GLES2Util::GetStringTextureTarget(target
) << ", " << level
<< ", "
371 << GLES2Util::GetStringTextureInternalFormat(internalformat
) << ", "
372 << x
<< ", " << y
<< ", " << width
<< ", " << height
<< ", " << border
375 SetGLError(GL_INVALID_VALUE
, "glCopyTexImage2D", "width < 0");
379 SetGLError(GL_INVALID_VALUE
, "glCopyTexImage2D", "height < 0");
383 SetGLError(GL_INVALID_VALUE
, "glCopyTexImage2D", "border GL_INVALID_VALUE");
386 helper_
->CopyTexImage2D(target
, level
, internalformat
, x
, y
, width
, height
);
390 void GLES2Implementation::CopyTexSubImage2D(GLenum target
,
398 GPU_CLIENT_SINGLE_THREAD_CHECK();
399 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glCopyTexSubImage2D("
400 << GLES2Util::GetStringTextureTarget(target
) << ", "
401 << level
<< ", " << xoffset
<< ", " << yoffset
<< ", " << x
402 << ", " << y
<< ", " << width
<< ", " << height
<< ")");
404 SetGLError(GL_INVALID_VALUE
, "glCopyTexSubImage2D", "width < 0");
408 SetGLError(GL_INVALID_VALUE
, "glCopyTexSubImage2D", "height < 0");
411 helper_
->CopyTexSubImage2D(target
, level
, xoffset
, yoffset
, x
, y
, width
,
416 void GLES2Implementation::CopyTexSubImage3D(GLenum target
,
425 GPU_CLIENT_SINGLE_THREAD_CHECK();
426 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glCopyTexSubImage3D("
427 << GLES2Util::GetStringTexture3DTarget(target
) << ", "
428 << level
<< ", " << xoffset
<< ", " << yoffset
<< ", "
429 << zoffset
<< ", " << x
<< ", " << y
<< ", " << width
430 << ", " << height
<< ")");
432 SetGLError(GL_INVALID_VALUE
, "glCopyTexSubImage3D", "width < 0");
436 SetGLError(GL_INVALID_VALUE
, "glCopyTexSubImage3D", "height < 0");
439 helper_
->CopyTexSubImage3D(target
, level
, xoffset
, yoffset
, zoffset
, x
, y
,
444 GLuint
GLES2Implementation::CreateProgram() {
445 GPU_CLIENT_SINGLE_THREAD_CHECK();
446 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glCreateProgram("
449 GetIdHandler(id_namespaces::kProgramsAndShaders
)
450 ->MakeIds(this, 0, 1, &client_id
);
451 helper_
->CreateProgram(client_id
);
452 GPU_CLIENT_LOG("returned " << client_id
);
457 GLuint
GLES2Implementation::CreateShader(GLenum type
) {
458 GPU_CLIENT_SINGLE_THREAD_CHECK();
459 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glCreateShader("
460 << GLES2Util::GetStringShaderType(type
) << ")");
462 GetIdHandler(id_namespaces::kProgramsAndShaders
)
463 ->MakeIds(this, 0, 1, &client_id
);
464 helper_
->CreateShader(type
, client_id
);
465 GPU_CLIENT_LOG("returned " << client_id
);
470 void GLES2Implementation::CullFace(GLenum mode
) {
471 GPU_CLIENT_SINGLE_THREAD_CHECK();
472 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glCullFace("
473 << GLES2Util::GetStringFaceType(mode
) << ")");
474 helper_
->CullFace(mode
);
478 void GLES2Implementation::DeleteBuffers(GLsizei n
, const GLuint
* buffers
) {
479 GPU_CLIENT_SINGLE_THREAD_CHECK();
480 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glDeleteBuffers(" << n
<< ", "
481 << static_cast<const void*>(buffers
) << ")");
482 GPU_CLIENT_LOG_CODE_BLOCK({
483 for (GLsizei i
= 0; i
< n
; ++i
) {
484 GPU_CLIENT_LOG(" " << i
<< ": " << buffers
[i
]);
487 GPU_CLIENT_DCHECK_CODE_BLOCK({
488 for (GLsizei i
= 0; i
< n
; ++i
) {
489 DCHECK(buffers
[i
] != 0);
493 SetGLError(GL_INVALID_VALUE
, "glDeleteBuffers", "n < 0");
496 DeleteBuffersHelper(n
, buffers
);
500 void GLES2Implementation::DeleteFramebuffers(GLsizei n
,
501 const GLuint
* framebuffers
) {
502 GPU_CLIENT_SINGLE_THREAD_CHECK();
503 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glDeleteFramebuffers(" << n
<< ", "
504 << static_cast<const void*>(framebuffers
) << ")");
505 GPU_CLIENT_LOG_CODE_BLOCK({
506 for (GLsizei i
= 0; i
< n
; ++i
) {
507 GPU_CLIENT_LOG(" " << i
<< ": " << framebuffers
[i
]);
510 GPU_CLIENT_DCHECK_CODE_BLOCK({
511 for (GLsizei i
= 0; i
< n
; ++i
) {
512 DCHECK(framebuffers
[i
] != 0);
516 SetGLError(GL_INVALID_VALUE
, "glDeleteFramebuffers", "n < 0");
519 DeleteFramebuffersHelper(n
, framebuffers
);
523 void GLES2Implementation::DeleteProgram(GLuint program
) {
524 GPU_CLIENT_SINGLE_THREAD_CHECK();
525 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glDeleteProgram(" << program
527 GPU_CLIENT_DCHECK(program
!= 0);
528 DeleteProgramHelper(program
);
532 void GLES2Implementation::DeleteRenderbuffers(GLsizei n
,
533 const GLuint
* renderbuffers
) {
534 GPU_CLIENT_SINGLE_THREAD_CHECK();
535 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glDeleteRenderbuffers(" << n
536 << ", " << static_cast<const void*>(renderbuffers
) << ")");
537 GPU_CLIENT_LOG_CODE_BLOCK({
538 for (GLsizei i
= 0; i
< n
; ++i
) {
539 GPU_CLIENT_LOG(" " << i
<< ": " << renderbuffers
[i
]);
542 GPU_CLIENT_DCHECK_CODE_BLOCK({
543 for (GLsizei i
= 0; i
< n
; ++i
) {
544 DCHECK(renderbuffers
[i
] != 0);
548 SetGLError(GL_INVALID_VALUE
, "glDeleteRenderbuffers", "n < 0");
551 DeleteRenderbuffersHelper(n
, renderbuffers
);
555 void GLES2Implementation::DeleteSamplers(GLsizei n
, const GLuint
* samplers
) {
556 GPU_CLIENT_SINGLE_THREAD_CHECK();
557 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glDeleteSamplers(" << n
<< ", "
558 << static_cast<const void*>(samplers
) << ")");
559 GPU_CLIENT_LOG_CODE_BLOCK({
560 for (GLsizei i
= 0; i
< n
; ++i
) {
561 GPU_CLIENT_LOG(" " << i
<< ": " << samplers
[i
]);
564 GPU_CLIENT_DCHECK_CODE_BLOCK({
565 for (GLsizei i
= 0; i
< n
; ++i
) {
566 DCHECK(samplers
[i
] != 0);
570 SetGLError(GL_INVALID_VALUE
, "glDeleteSamplers", "n < 0");
573 DeleteSamplersHelper(n
, samplers
);
577 void GLES2Implementation::DeleteSync(GLsync sync
) {
578 GPU_CLIENT_SINGLE_THREAD_CHECK();
579 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glDeleteSync(" << sync
<< ")");
580 GPU_CLIENT_DCHECK(sync
!= 0);
581 DeleteSyncHelper(sync
);
585 void GLES2Implementation::DeleteShader(GLuint shader
) {
586 GPU_CLIENT_SINGLE_THREAD_CHECK();
587 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glDeleteShader(" << shader
<< ")");
588 GPU_CLIENT_DCHECK(shader
!= 0);
589 DeleteShaderHelper(shader
);
593 void GLES2Implementation::DeleteTextures(GLsizei n
, const GLuint
* textures
) {
594 GPU_CLIENT_SINGLE_THREAD_CHECK();
595 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glDeleteTextures(" << n
<< ", "
596 << static_cast<const void*>(textures
) << ")");
597 GPU_CLIENT_LOG_CODE_BLOCK({
598 for (GLsizei i
= 0; i
< n
; ++i
) {
599 GPU_CLIENT_LOG(" " << i
<< ": " << textures
[i
]);
602 GPU_CLIENT_DCHECK_CODE_BLOCK({
603 for (GLsizei i
= 0; i
< n
; ++i
) {
604 DCHECK(textures
[i
] != 0);
608 SetGLError(GL_INVALID_VALUE
, "glDeleteTextures", "n < 0");
611 DeleteTexturesHelper(n
, textures
);
615 void GLES2Implementation::DeleteTransformFeedbacks(GLsizei n
,
617 GPU_CLIENT_SINGLE_THREAD_CHECK();
618 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glDeleteTransformFeedbacks(" << n
619 << ", " << static_cast<const void*>(ids
) << ")");
620 GPU_CLIENT_LOG_CODE_BLOCK({
621 for (GLsizei i
= 0; i
< n
; ++i
) {
622 GPU_CLIENT_LOG(" " << i
<< ": " << ids
[i
]);
625 GPU_CLIENT_DCHECK_CODE_BLOCK({
626 for (GLsizei i
= 0; i
< n
; ++i
) {
631 SetGLError(GL_INVALID_VALUE
, "glDeleteTransformFeedbacks", "n < 0");
634 DeleteTransformFeedbacksHelper(n
, ids
);
638 void GLES2Implementation::DepthFunc(GLenum func
) {
639 GPU_CLIENT_SINGLE_THREAD_CHECK();
640 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glDepthFunc("
641 << GLES2Util::GetStringCmpFunction(func
) << ")");
642 helper_
->DepthFunc(func
);
646 void GLES2Implementation::DepthMask(GLboolean flag
) {
647 GPU_CLIENT_SINGLE_THREAD_CHECK();
648 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glDepthMask("
649 << GLES2Util::GetStringBool(flag
) << ")");
650 helper_
->DepthMask(flag
);
654 void GLES2Implementation::DepthRangef(GLclampf zNear
, GLclampf zFar
) {
655 GPU_CLIENT_SINGLE_THREAD_CHECK();
656 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glDepthRangef(" << zNear
<< ", "
658 helper_
->DepthRangef(zNear
, zFar
);
662 void GLES2Implementation::DetachShader(GLuint program
, GLuint shader
) {
663 GPU_CLIENT_SINGLE_THREAD_CHECK();
664 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glDetachShader(" << program
<< ", "
666 helper_
->DetachShader(program
, shader
);
670 GLsync
GLES2Implementation::FenceSync(GLenum condition
, GLbitfield flags
) {
671 GPU_CLIENT_SINGLE_THREAD_CHECK();
672 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glFenceSync("
673 << GLES2Util::GetStringSyncCondition(condition
) << ", "
675 if (condition
!= GL_SYNC_GPU_COMMANDS_COMPLETE
) {
676 SetGLError(GL_INVALID_ENUM
, "glFenceSync", "condition GL_INVALID_ENUM");
680 SetGLError(GL_INVALID_VALUE
, "glFenceSync", "flags GL_INVALID_VALUE");
684 GetIdHandler(id_namespaces::kSyncs
)->MakeIds(this, 0, 1, &client_id
);
685 helper_
->FenceSync(client_id
);
686 GPU_CLIENT_LOG("returned " << client_id
);
688 return reinterpret_cast<GLsync
>(client_id
);
691 void GLES2Implementation::FramebufferRenderbuffer(GLenum target
,
693 GLenum renderbuffertarget
,
694 GLuint renderbuffer
) {
695 GPU_CLIENT_SINGLE_THREAD_CHECK();
697 "[" << GetLogPrefix() << "] glFramebufferRenderbuffer("
698 << GLES2Util::GetStringFrameBufferTarget(target
) << ", "
699 << GLES2Util::GetStringAttachment(attachment
) << ", "
700 << GLES2Util::GetStringRenderBufferTarget(renderbuffertarget
) << ", "
701 << renderbuffer
<< ")");
702 helper_
->FramebufferRenderbuffer(target
, attachment
, renderbuffertarget
,
707 void GLES2Implementation::FramebufferTexture2D(GLenum target
,
712 GPU_CLIENT_SINGLE_THREAD_CHECK();
713 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glFramebufferTexture2D("
714 << GLES2Util::GetStringFrameBufferTarget(target
) << ", "
715 << GLES2Util::GetStringAttachment(attachment
) << ", "
716 << GLES2Util::GetStringTextureTarget(textarget
) << ", "
717 << texture
<< ", " << level
<< ")");
719 SetGLError(GL_INVALID_VALUE
, "glFramebufferTexture2D",
720 "level GL_INVALID_VALUE");
723 helper_
->FramebufferTexture2D(target
, attachment
, textarget
, texture
);
727 void GLES2Implementation::FramebufferTextureLayer(GLenum target
,
732 GPU_CLIENT_SINGLE_THREAD_CHECK();
733 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glFramebufferTextureLayer("
734 << GLES2Util::GetStringFrameBufferTarget(target
) << ", "
735 << GLES2Util::GetStringAttachment(attachment
) << ", "
736 << texture
<< ", " << level
<< ", " << layer
<< ")");
737 helper_
->FramebufferTextureLayer(target
, attachment
, texture
, level
, layer
);
741 void GLES2Implementation::FrontFace(GLenum mode
) {
742 GPU_CLIENT_SINGLE_THREAD_CHECK();
743 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glFrontFace("
744 << GLES2Util::GetStringFaceMode(mode
) << ")");
745 helper_
->FrontFace(mode
);
749 void GLES2Implementation::GenBuffers(GLsizei n
, GLuint
* buffers
) {
750 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glGenBuffers(" << n
<< ", "
751 << static_cast<const void*>(buffers
) << ")");
753 SetGLError(GL_INVALID_VALUE
, "glGenBuffers", "n < 0");
756 GPU_CLIENT_SINGLE_THREAD_CHECK();
757 GetIdHandler(id_namespaces::kBuffers
)->MakeIds(this, 0, n
, buffers
);
758 GenBuffersHelper(n
, buffers
);
759 helper_
->GenBuffersImmediate(n
, buffers
);
760 if (share_group_
->bind_generates_resource())
761 helper_
->CommandBufferHelper::Flush();
762 GPU_CLIENT_LOG_CODE_BLOCK({
763 for (GLsizei i
= 0; i
< n
; ++i
) {
764 GPU_CLIENT_LOG(" " << i
<< ": " << buffers
[i
]);
770 void GLES2Implementation::GenerateMipmap(GLenum target
) {
771 GPU_CLIENT_SINGLE_THREAD_CHECK();
772 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glGenerateMipmap("
773 << GLES2Util::GetStringTextureBindTarget(target
) << ")");
774 helper_
->GenerateMipmap(target
);
778 void GLES2Implementation::GenFramebuffers(GLsizei n
, GLuint
* framebuffers
) {
779 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glGenFramebuffers(" << n
<< ", "
780 << static_cast<const void*>(framebuffers
) << ")");
782 SetGLError(GL_INVALID_VALUE
, "glGenFramebuffers", "n < 0");
785 GPU_CLIENT_SINGLE_THREAD_CHECK();
786 GetIdHandler(id_namespaces::kFramebuffers
)->MakeIds(this, 0, n
, framebuffers
);
787 GenFramebuffersHelper(n
, framebuffers
);
788 helper_
->GenFramebuffersImmediate(n
, framebuffers
);
789 if (share_group_
->bind_generates_resource())
790 helper_
->CommandBufferHelper::Flush();
791 GPU_CLIENT_LOG_CODE_BLOCK({
792 for (GLsizei i
= 0; i
< n
; ++i
) {
793 GPU_CLIENT_LOG(" " << i
<< ": " << framebuffers
[i
]);
799 void GLES2Implementation::GenRenderbuffers(GLsizei n
, GLuint
* renderbuffers
) {
800 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glGenRenderbuffers(" << n
<< ", "
801 << static_cast<const void*>(renderbuffers
) << ")");
803 SetGLError(GL_INVALID_VALUE
, "glGenRenderbuffers", "n < 0");
806 GPU_CLIENT_SINGLE_THREAD_CHECK();
807 GetIdHandler(id_namespaces::kRenderbuffers
)
808 ->MakeIds(this, 0, n
, renderbuffers
);
809 GenRenderbuffersHelper(n
, renderbuffers
);
810 helper_
->GenRenderbuffersImmediate(n
, renderbuffers
);
811 if (share_group_
->bind_generates_resource())
812 helper_
->CommandBufferHelper::Flush();
813 GPU_CLIENT_LOG_CODE_BLOCK({
814 for (GLsizei i
= 0; i
< n
; ++i
) {
815 GPU_CLIENT_LOG(" " << i
<< ": " << renderbuffers
[i
]);
821 void GLES2Implementation::GenSamplers(GLsizei n
, GLuint
* samplers
) {
822 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glGenSamplers(" << n
<< ", "
823 << static_cast<const void*>(samplers
) << ")");
825 SetGLError(GL_INVALID_VALUE
, "glGenSamplers", "n < 0");
828 GPU_CLIENT_SINGLE_THREAD_CHECK();
829 GetIdHandler(id_namespaces::kSamplers
)->MakeIds(this, 0, n
, samplers
);
830 GenSamplersHelper(n
, samplers
);
831 helper_
->GenSamplersImmediate(n
, samplers
);
832 if (share_group_
->bind_generates_resource())
833 helper_
->CommandBufferHelper::Flush();
834 GPU_CLIENT_LOG_CODE_BLOCK({
835 for (GLsizei i
= 0; i
< n
; ++i
) {
836 GPU_CLIENT_LOG(" " << i
<< ": " << samplers
[i
]);
842 void GLES2Implementation::GenTextures(GLsizei n
, GLuint
* textures
) {
843 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glGenTextures(" << n
<< ", "
844 << static_cast<const void*>(textures
) << ")");
846 SetGLError(GL_INVALID_VALUE
, "glGenTextures", "n < 0");
849 GPU_CLIENT_SINGLE_THREAD_CHECK();
850 GetIdHandler(id_namespaces::kTextures
)->MakeIds(this, 0, n
, textures
);
851 GenTexturesHelper(n
, textures
);
852 helper_
->GenTexturesImmediate(n
, textures
);
853 if (share_group_
->bind_generates_resource())
854 helper_
->CommandBufferHelper::Flush();
855 GPU_CLIENT_LOG_CODE_BLOCK({
856 for (GLsizei i
= 0; i
< n
; ++i
) {
857 GPU_CLIENT_LOG(" " << i
<< ": " << textures
[i
]);
863 void GLES2Implementation::GenTransformFeedbacks(GLsizei n
, GLuint
* ids
) {
864 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glGenTransformFeedbacks(" << n
865 << ", " << static_cast<const void*>(ids
) << ")");
867 SetGLError(GL_INVALID_VALUE
, "glGenTransformFeedbacks", "n < 0");
870 GPU_CLIENT_SINGLE_THREAD_CHECK();
871 GetIdHandler(id_namespaces::kTransformFeedbacks
)->MakeIds(this, 0, n
, ids
);
872 GenTransformFeedbacksHelper(n
, ids
);
873 helper_
->GenTransformFeedbacksImmediate(n
, ids
);
874 if (share_group_
->bind_generates_resource())
875 helper_
->CommandBufferHelper::Flush();
876 GPU_CLIENT_LOG_CODE_BLOCK({
877 for (GLsizei i
= 0; i
< n
; ++i
) {
878 GPU_CLIENT_LOG(" " << i
<< ": " << ids
[i
]);
884 void GLES2Implementation::GetBooleanv(GLenum pname
, GLboolean
* params
) {
885 GPU_CLIENT_SINGLE_THREAD_CHECK();
886 GPU_CLIENT_VALIDATE_DESTINATION_INITALIZATION(GLboolean
, params
);
887 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glGetBooleanv("
888 << GLES2Util::GetStringGLState(pname
) << ", "
889 << static_cast<const void*>(params
) << ")");
890 TRACE_EVENT0("gpu", "GLES2Implementation::GetBooleanv");
891 if (GetBooleanvHelper(pname
, params
)) {
894 typedef cmds::GetBooleanv::Result Result
;
895 Result
* result
= GetResultAs
<Result
*>();
899 result
->SetNumResults(0);
900 helper_
->GetBooleanv(pname
, GetResultShmId(), GetResultShmOffset());
902 result
->CopyResult(params
);
903 GPU_CLIENT_LOG_CODE_BLOCK({
904 for (int32_t i
= 0; i
< result
->GetNumResults(); ++i
) {
905 GPU_CLIENT_LOG(" " << i
<< ": " << result
->GetData()[i
]);
910 void GLES2Implementation::GetBufferParameteri64v(GLenum target
,
913 GPU_CLIENT_SINGLE_THREAD_CHECK();
914 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glGetBufferParameteri64v("
915 << GLES2Util::GetStringBufferTarget(target
) << ", "
916 << GLES2Util::GetStringBufferParameter64(pname
) << ", "
917 << static_cast<const void*>(params
) << ")");
918 TRACE_EVENT0("gpu", "GLES2Implementation::GetBufferParameteri64v");
919 if (GetBufferParameteri64vHelper(target
, pname
, params
)) {
922 typedef cmds::GetBufferParameteri64v::Result Result
;
923 Result
* result
= GetResultAs
<Result
*>();
927 result
->SetNumResults(0);
928 helper_
->GetBufferParameteri64v(target
, pname
, GetResultShmId(),
929 GetResultShmOffset());
931 result
->CopyResult(params
);
932 GPU_CLIENT_LOG_CODE_BLOCK({
933 for (int32_t i
= 0; i
< result
->GetNumResults(); ++i
) {
934 GPU_CLIENT_LOG(" " << i
<< ": " << result
->GetData()[i
]);
939 void GLES2Implementation::GetBufferParameteriv(GLenum target
,
942 GPU_CLIENT_SINGLE_THREAD_CHECK();
943 GPU_CLIENT_VALIDATE_DESTINATION_INITALIZATION(GLint
, params
);
944 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glGetBufferParameteriv("
945 << GLES2Util::GetStringBufferTarget(target
) << ", "
946 << GLES2Util::GetStringBufferParameter(pname
) << ", "
947 << static_cast<const void*>(params
) << ")");
948 TRACE_EVENT0("gpu", "GLES2Implementation::GetBufferParameteriv");
949 if (GetBufferParameterivHelper(target
, pname
, params
)) {
952 typedef cmds::GetBufferParameteriv::Result Result
;
953 Result
* result
= GetResultAs
<Result
*>();
957 result
->SetNumResults(0);
958 helper_
->GetBufferParameteriv(target
, pname
, GetResultShmId(),
959 GetResultShmOffset());
961 result
->CopyResult(params
);
962 GPU_CLIENT_LOG_CODE_BLOCK({
963 for (int32_t i
= 0; i
< result
->GetNumResults(); ++i
) {
964 GPU_CLIENT_LOG(" " << i
<< ": " << result
->GetData()[i
]);
969 void GLES2Implementation::GetFloatv(GLenum pname
, GLfloat
* params
) {
970 GPU_CLIENT_SINGLE_THREAD_CHECK();
971 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glGetFloatv("
972 << GLES2Util::GetStringGLState(pname
) << ", "
973 << static_cast<const void*>(params
) << ")");
974 TRACE_EVENT0("gpu", "GLES2Implementation::GetFloatv");
975 if (GetFloatvHelper(pname
, params
)) {
978 typedef cmds::GetFloatv::Result Result
;
979 Result
* result
= GetResultAs
<Result
*>();
983 result
->SetNumResults(0);
984 helper_
->GetFloatv(pname
, GetResultShmId(), GetResultShmOffset());
986 result
->CopyResult(params
);
987 GPU_CLIENT_LOG_CODE_BLOCK({
988 for (int32_t i
= 0; i
< result
->GetNumResults(); ++i
) {
989 GPU_CLIENT_LOG(" " << i
<< ": " << result
->GetData()[i
]);
994 void GLES2Implementation::GetFramebufferAttachmentParameteriv(GLenum target
,
998 GPU_CLIENT_SINGLE_THREAD_CHECK();
999 GPU_CLIENT_VALIDATE_DESTINATION_INITALIZATION(GLint
, params
);
1000 GPU_CLIENT_LOG("[" << GetLogPrefix()
1001 << "] glGetFramebufferAttachmentParameteriv("
1002 << GLES2Util::GetStringFrameBufferTarget(target
) << ", "
1003 << GLES2Util::GetStringAttachment(attachment
) << ", "
1004 << GLES2Util::GetStringFrameBufferParameter(pname
) << ", "
1005 << static_cast<const void*>(params
) << ")");
1007 "GLES2Implementation::GetFramebufferAttachmentParameteriv");
1008 if (GetFramebufferAttachmentParameterivHelper(target
, attachment
, pname
,
1012 typedef cmds::GetFramebufferAttachmentParameteriv::Result Result
;
1013 Result
* result
= GetResultAs
<Result
*>();
1017 result
->SetNumResults(0);
1018 helper_
->GetFramebufferAttachmentParameteriv(
1019 target
, attachment
, pname
, GetResultShmId(), GetResultShmOffset());
1021 result
->CopyResult(params
);
1022 GPU_CLIENT_LOG_CODE_BLOCK({
1023 for (int32_t i
= 0; i
< result
->GetNumResults(); ++i
) {
1024 GPU_CLIENT_LOG(" " << i
<< ": " << result
->GetData()[i
]);
1029 void GLES2Implementation::GetInteger64v(GLenum pname
, GLint64
* params
) {
1030 GPU_CLIENT_SINGLE_THREAD_CHECK();
1031 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glGetInteger64v("
1032 << GLES2Util::GetStringGLState(pname
) << ", "
1033 << static_cast<const void*>(params
) << ")");
1034 TRACE_EVENT0("gpu", "GLES2Implementation::GetInteger64v");
1035 if (GetInteger64vHelper(pname
, params
)) {
1038 typedef cmds::GetInteger64v::Result Result
;
1039 Result
* result
= GetResultAs
<Result
*>();
1043 result
->SetNumResults(0);
1044 helper_
->GetInteger64v(pname
, GetResultShmId(), GetResultShmOffset());
1046 result
->CopyResult(params
);
1047 GPU_CLIENT_LOG_CODE_BLOCK({
1048 for (int32_t i
= 0; i
< result
->GetNumResults(); ++i
) {
1049 GPU_CLIENT_LOG(" " << i
<< ": " << result
->GetData()[i
]);
1054 void GLES2Implementation::GetIntegeri_v(GLenum pname
,
1057 GPU_CLIENT_SINGLE_THREAD_CHECK();
1058 GPU_CLIENT_VALIDATE_DESTINATION_INITALIZATION(GLint
, data
);
1059 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glGetIntegeri_v("
1060 << GLES2Util::GetStringIndexedGLState(pname
) << ", "
1061 << index
<< ", " << static_cast<const void*>(data
) << ")");
1062 TRACE_EVENT0("gpu", "GLES2Implementation::GetIntegeri_v");
1063 if (GetIntegeri_vHelper(pname
, index
, data
)) {
1066 typedef cmds::GetIntegeri_v::Result Result
;
1067 Result
* result
= GetResultAs
<Result
*>();
1071 result
->SetNumResults(0);
1072 helper_
->GetIntegeri_v(pname
, index
, GetResultShmId(), GetResultShmOffset());
1074 result
->CopyResult(data
);
1075 GPU_CLIENT_LOG_CODE_BLOCK({
1076 for (int32_t i
= 0; i
< result
->GetNumResults(); ++i
) {
1077 GPU_CLIENT_LOG(" " << i
<< ": " << result
->GetData()[i
]);
1082 void GLES2Implementation::GetInteger64i_v(GLenum pname
,
1085 GPU_CLIENT_SINGLE_THREAD_CHECK();
1086 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glGetInteger64i_v("
1087 << GLES2Util::GetStringIndexedGLState(pname
) << ", "
1088 << index
<< ", " << static_cast<const void*>(data
) << ")");
1089 TRACE_EVENT0("gpu", "GLES2Implementation::GetInteger64i_v");
1090 if (GetInteger64i_vHelper(pname
, index
, data
)) {
1093 typedef cmds::GetInteger64i_v::Result Result
;
1094 Result
* result
= GetResultAs
<Result
*>();
1098 result
->SetNumResults(0);
1099 helper_
->GetInteger64i_v(pname
, index
, GetResultShmId(),
1100 GetResultShmOffset());
1102 result
->CopyResult(data
);
1103 GPU_CLIENT_LOG_CODE_BLOCK({
1104 for (int32_t i
= 0; i
< result
->GetNumResults(); ++i
) {
1105 GPU_CLIENT_LOG(" " << i
<< ": " << result
->GetData()[i
]);
1110 void GLES2Implementation::GetIntegerv(GLenum pname
, GLint
* params
) {
1111 GPU_CLIENT_SINGLE_THREAD_CHECK();
1112 GPU_CLIENT_VALIDATE_DESTINATION_INITALIZATION(GLint
, params
);
1113 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glGetIntegerv("
1114 << GLES2Util::GetStringGLState(pname
) << ", "
1115 << static_cast<const void*>(params
) << ")");
1116 TRACE_EVENT0("gpu", "GLES2Implementation::GetIntegerv");
1117 if (GetIntegervHelper(pname
, params
)) {
1120 typedef cmds::GetIntegerv::Result Result
;
1121 Result
* result
= GetResultAs
<Result
*>();
1125 result
->SetNumResults(0);
1126 helper_
->GetIntegerv(pname
, GetResultShmId(), GetResultShmOffset());
1128 result
->CopyResult(params
);
1129 GPU_CLIENT_LOG_CODE_BLOCK({
1130 for (int32_t i
= 0; i
< result
->GetNumResults(); ++i
) {
1131 GPU_CLIENT_LOG(" " << i
<< ": " << result
->GetData()[i
]);
1136 void GLES2Implementation::GetProgramiv(GLuint program
,
1139 GPU_CLIENT_SINGLE_THREAD_CHECK();
1140 GPU_CLIENT_VALIDATE_DESTINATION_INITALIZATION(GLint
, params
);
1141 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glGetProgramiv(" << program
<< ", "
1142 << GLES2Util::GetStringProgramParameter(pname
) << ", "
1143 << static_cast<const void*>(params
) << ")");
1144 TRACE_EVENT0("gpu", "GLES2Implementation::GetProgramiv");
1145 if (GetProgramivHelper(program
, pname
, params
)) {
1148 typedef cmds::GetProgramiv::Result Result
;
1149 Result
* result
= GetResultAs
<Result
*>();
1153 result
->SetNumResults(0);
1154 helper_
->GetProgramiv(program
, pname
, GetResultShmId(), GetResultShmOffset());
1156 result
->CopyResult(params
);
1157 GPU_CLIENT_LOG_CODE_BLOCK({
1158 for (int32_t i
= 0; i
< result
->GetNumResults(); ++i
) {
1159 GPU_CLIENT_LOG(" " << i
<< ": " << result
->GetData()[i
]);
1164 void GLES2Implementation::GetProgramInfoLog(GLuint program
,
1168 GPU_CLIENT_SINGLE_THREAD_CHECK();
1169 GPU_CLIENT_VALIDATE_DESTINATION_OPTIONAL_INITALIZATION(GLsizei
, length
);
1170 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glGetProgramInfoLog"
1171 << "(" << program
<< ", " << bufsize
<< ", "
1172 << static_cast<void*>(length
) << ", "
1173 << static_cast<void*>(infolog
) << ")");
1174 helper_
->SetBucketSize(kResultBucketId
, 0);
1175 helper_
->GetProgramInfoLog(program
, kResultBucketId
);
1177 GLsizei max_size
= 0;
1178 if (GetBucketAsString(kResultBucketId
, &str
)) {
1180 max_size
= std::min(static_cast<size_t>(bufsize
) - 1, str
.size());
1181 memcpy(infolog
, str
.c_str(), max_size
);
1182 infolog
[max_size
] = '\0';
1183 GPU_CLIENT_LOG("------\n" << infolog
<< "\n------");
1186 if (length
!= NULL
) {
1191 void GLES2Implementation::GetRenderbufferParameteriv(GLenum target
,
1194 GPU_CLIENT_SINGLE_THREAD_CHECK();
1195 GPU_CLIENT_VALIDATE_DESTINATION_INITALIZATION(GLint
, params
);
1196 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glGetRenderbufferParameteriv("
1197 << GLES2Util::GetStringRenderBufferTarget(target
) << ", "
1198 << GLES2Util::GetStringRenderBufferParameter(pname
) << ", "
1199 << static_cast<const void*>(params
) << ")");
1200 TRACE_EVENT0("gpu", "GLES2Implementation::GetRenderbufferParameteriv");
1201 if (GetRenderbufferParameterivHelper(target
, pname
, params
)) {
1204 typedef cmds::GetRenderbufferParameteriv::Result Result
;
1205 Result
* result
= GetResultAs
<Result
*>();
1209 result
->SetNumResults(0);
1210 helper_
->GetRenderbufferParameteriv(target
, pname
, GetResultShmId(),
1211 GetResultShmOffset());
1213 result
->CopyResult(params
);
1214 GPU_CLIENT_LOG_CODE_BLOCK({
1215 for (int32_t i
= 0; i
< result
->GetNumResults(); ++i
) {
1216 GPU_CLIENT_LOG(" " << i
<< ": " << result
->GetData()[i
]);
1221 void GLES2Implementation::GetSamplerParameterfv(GLuint sampler
,
1224 GPU_CLIENT_SINGLE_THREAD_CHECK();
1225 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glGetSamplerParameterfv("
1227 << GLES2Util::GetStringSamplerParameter(pname
) << ", "
1228 << static_cast<const void*>(params
) << ")");
1229 TRACE_EVENT0("gpu", "GLES2Implementation::GetSamplerParameterfv");
1230 if (GetSamplerParameterfvHelper(sampler
, pname
, params
)) {
1233 typedef cmds::GetSamplerParameterfv::Result Result
;
1234 Result
* result
= GetResultAs
<Result
*>();
1238 result
->SetNumResults(0);
1239 helper_
->GetSamplerParameterfv(sampler
, pname
, GetResultShmId(),
1240 GetResultShmOffset());
1242 result
->CopyResult(params
);
1243 GPU_CLIENT_LOG_CODE_BLOCK({
1244 for (int32_t i
= 0; i
< result
->GetNumResults(); ++i
) {
1245 GPU_CLIENT_LOG(" " << i
<< ": " << result
->GetData()[i
]);
1250 void GLES2Implementation::GetSamplerParameteriv(GLuint sampler
,
1253 GPU_CLIENT_SINGLE_THREAD_CHECK();
1254 GPU_CLIENT_VALIDATE_DESTINATION_INITALIZATION(GLint
, params
);
1255 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glGetSamplerParameteriv("
1257 << GLES2Util::GetStringSamplerParameter(pname
) << ", "
1258 << static_cast<const void*>(params
) << ")");
1259 TRACE_EVENT0("gpu", "GLES2Implementation::GetSamplerParameteriv");
1260 if (GetSamplerParameterivHelper(sampler
, pname
, params
)) {
1263 typedef cmds::GetSamplerParameteriv::Result Result
;
1264 Result
* result
= GetResultAs
<Result
*>();
1268 result
->SetNumResults(0);
1269 helper_
->GetSamplerParameteriv(sampler
, pname
, GetResultShmId(),
1270 GetResultShmOffset());
1272 result
->CopyResult(params
);
1273 GPU_CLIENT_LOG_CODE_BLOCK({
1274 for (int32_t i
= 0; i
< result
->GetNumResults(); ++i
) {
1275 GPU_CLIENT_LOG(" " << i
<< ": " << result
->GetData()[i
]);
1280 void GLES2Implementation::GetShaderiv(GLuint shader
,
1283 GPU_CLIENT_SINGLE_THREAD_CHECK();
1284 GPU_CLIENT_VALIDATE_DESTINATION_INITALIZATION(GLint
, params
);
1285 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glGetShaderiv(" << shader
<< ", "
1286 << GLES2Util::GetStringShaderParameter(pname
) << ", "
1287 << static_cast<const void*>(params
) << ")");
1288 TRACE_EVENT0("gpu", "GLES2Implementation::GetShaderiv");
1289 if (GetShaderivHelper(shader
, pname
, params
)) {
1292 typedef cmds::GetShaderiv::Result Result
;
1293 Result
* result
= GetResultAs
<Result
*>();
1297 result
->SetNumResults(0);
1298 helper_
->GetShaderiv(shader
, pname
, GetResultShmId(), GetResultShmOffset());
1300 result
->CopyResult(params
);
1301 GPU_CLIENT_LOG_CODE_BLOCK({
1302 for (int32_t i
= 0; i
< result
->GetNumResults(); ++i
) {
1303 GPU_CLIENT_LOG(" " << i
<< ": " << result
->GetData()[i
]);
1308 void GLES2Implementation::GetShaderInfoLog(GLuint shader
,
1312 GPU_CLIENT_SINGLE_THREAD_CHECK();
1313 GPU_CLIENT_VALIDATE_DESTINATION_OPTIONAL_INITALIZATION(GLsizei
, length
);
1314 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glGetShaderInfoLog"
1315 << "(" << shader
<< ", " << bufsize
<< ", "
1316 << static_cast<void*>(length
) << ", "
1317 << static_cast<void*>(infolog
) << ")");
1318 helper_
->SetBucketSize(kResultBucketId
, 0);
1319 helper_
->GetShaderInfoLog(shader
, kResultBucketId
);
1321 GLsizei max_size
= 0;
1322 if (GetBucketAsString(kResultBucketId
, &str
)) {
1324 max_size
= std::min(static_cast<size_t>(bufsize
) - 1, str
.size());
1325 memcpy(infolog
, str
.c_str(), max_size
);
1326 infolog
[max_size
] = '\0';
1327 GPU_CLIENT_LOG("------\n" << infolog
<< "\n------");
1330 if (length
!= NULL
) {
1335 void GLES2Implementation::GetShaderSource(GLuint shader
,
1339 GPU_CLIENT_SINGLE_THREAD_CHECK();
1340 GPU_CLIENT_VALIDATE_DESTINATION_OPTIONAL_INITALIZATION(GLsizei
, length
);
1341 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glGetShaderSource"
1342 << "(" << shader
<< ", " << bufsize
<< ", "
1343 << static_cast<void*>(length
) << ", "
1344 << static_cast<void*>(source
) << ")");
1345 helper_
->SetBucketSize(kResultBucketId
, 0);
1346 helper_
->GetShaderSource(shader
, kResultBucketId
);
1348 GLsizei max_size
= 0;
1349 if (GetBucketAsString(kResultBucketId
, &str
)) {
1351 max_size
= std::min(static_cast<size_t>(bufsize
) - 1, str
.size());
1352 memcpy(source
, str
.c_str(), max_size
);
1353 source
[max_size
] = '\0';
1354 GPU_CLIENT_LOG("------\n" << source
<< "\n------");
1357 if (length
!= NULL
) {
1362 void GLES2Implementation::GetSynciv(GLsync sync
,
1367 GPU_CLIENT_SINGLE_THREAD_CHECK();
1368 GPU_CLIENT_VALIDATE_DESTINATION_OPTIONAL_INITALIZATION(GLsizei
, length
);
1369 GPU_CLIENT_VALIDATE_DESTINATION_INITALIZATION(GLint
, values
);
1370 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glGetSynciv(" << sync
<< ", "
1371 << GLES2Util::GetStringSyncParameter(pname
) << ", "
1372 << bufsize
<< ", " << static_cast<const void*>(length
)
1373 << ", " << static_cast<const void*>(values
) << ")");
1375 SetGLError(GL_INVALID_VALUE
, "glGetSynciv", "bufsize < 0");
1378 TRACE_EVENT0("gpu", "GLES2Implementation::GetSynciv");
1379 if (GetSyncivHelper(sync
, pname
, bufsize
, length
, values
)) {
1382 typedef cmds::GetSynciv::Result Result
;
1383 Result
* result
= GetResultAs
<Result
*>();
1387 result
->SetNumResults(0);
1388 helper_
->GetSynciv(ToGLuint(sync
), pname
, GetResultShmId(),
1389 GetResultShmOffset());
1391 result
->CopyResult(values
);
1392 GPU_CLIENT_LOG_CODE_BLOCK({
1393 for (int32_t i
= 0; i
< result
->GetNumResults(); ++i
) {
1394 GPU_CLIENT_LOG(" " << i
<< ": " << result
->GetData()[i
]);
1398 *length
= result
->GetNumResults();
1402 void GLES2Implementation::GetTexParameterfv(GLenum target
,
1405 GPU_CLIENT_SINGLE_THREAD_CHECK();
1406 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glGetTexParameterfv("
1407 << GLES2Util::GetStringGetTexParamTarget(target
) << ", "
1408 << GLES2Util::GetStringTextureParameter(pname
) << ", "
1409 << static_cast<const void*>(params
) << ")");
1410 TRACE_EVENT0("gpu", "GLES2Implementation::GetTexParameterfv");
1411 if (GetTexParameterfvHelper(target
, pname
, params
)) {
1414 typedef cmds::GetTexParameterfv::Result Result
;
1415 Result
* result
= GetResultAs
<Result
*>();
1419 result
->SetNumResults(0);
1420 helper_
->GetTexParameterfv(target
, pname
, GetResultShmId(),
1421 GetResultShmOffset());
1423 result
->CopyResult(params
);
1424 GPU_CLIENT_LOG_CODE_BLOCK({
1425 for (int32_t i
= 0; i
< result
->GetNumResults(); ++i
) {
1426 GPU_CLIENT_LOG(" " << i
<< ": " << result
->GetData()[i
]);
1431 void GLES2Implementation::GetTexParameteriv(GLenum target
,
1434 GPU_CLIENT_SINGLE_THREAD_CHECK();
1435 GPU_CLIENT_VALIDATE_DESTINATION_INITALIZATION(GLint
, params
);
1436 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glGetTexParameteriv("
1437 << GLES2Util::GetStringGetTexParamTarget(target
) << ", "
1438 << GLES2Util::GetStringTextureParameter(pname
) << ", "
1439 << static_cast<const void*>(params
) << ")");
1440 TRACE_EVENT0("gpu", "GLES2Implementation::GetTexParameteriv");
1441 if (GetTexParameterivHelper(target
, pname
, params
)) {
1444 typedef cmds::GetTexParameteriv::Result Result
;
1445 Result
* result
= GetResultAs
<Result
*>();
1449 result
->SetNumResults(0);
1450 helper_
->GetTexParameteriv(target
, pname
, GetResultShmId(),
1451 GetResultShmOffset());
1453 result
->CopyResult(params
);
1454 GPU_CLIENT_LOG_CODE_BLOCK({
1455 for (int32_t i
= 0; i
< result
->GetNumResults(); ++i
) {
1456 GPU_CLIENT_LOG(" " << i
<< ": " << result
->GetData()[i
]);
1461 void GLES2Implementation::Hint(GLenum target
, GLenum mode
) {
1462 GPU_CLIENT_SINGLE_THREAD_CHECK();
1463 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glHint("
1464 << GLES2Util::GetStringHintTarget(target
) << ", "
1465 << GLES2Util::GetStringHintMode(mode
) << ")");
1466 helper_
->Hint(target
, mode
);
1470 void GLES2Implementation::InvalidateFramebuffer(GLenum target
,
1472 const GLenum
* attachments
) {
1473 GPU_CLIENT_SINGLE_THREAD_CHECK();
1474 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glInvalidateFramebuffer("
1475 << GLES2Util::GetStringInvalidateFrameBufferTarget(target
)
1476 << ", " << count
<< ", "
1477 << static_cast<const void*>(attachments
) << ")");
1478 GPU_CLIENT_LOG_CODE_BLOCK({
1479 for (GLsizei i
= 0; i
< count
; ++i
) {
1480 GPU_CLIENT_LOG(" " << i
<< ": " << attachments
[0 + i
* 1]);
1484 SetGLError(GL_INVALID_VALUE
, "glInvalidateFramebuffer", "count < 0");
1487 helper_
->InvalidateFramebufferImmediate(target
, count
, attachments
);
1491 void GLES2Implementation::InvalidateSubFramebuffer(GLenum target
,
1493 const GLenum
* attachments
,
1498 GPU_CLIENT_SINGLE_THREAD_CHECK();
1499 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glInvalidateSubFramebuffer("
1500 << GLES2Util::GetStringInvalidateFrameBufferTarget(target
)
1501 << ", " << count
<< ", "
1502 << static_cast<const void*>(attachments
) << ", " << x
1503 << ", " << y
<< ", " << width
<< ", " << height
<< ")");
1504 GPU_CLIENT_LOG_CODE_BLOCK({
1505 for (GLsizei i
= 0; i
< count
; ++i
) {
1506 GPU_CLIENT_LOG(" " << i
<< ": " << attachments
[0 + i
* 1]);
1510 SetGLError(GL_INVALID_VALUE
, "glInvalidateSubFramebuffer", "count < 0");
1514 SetGLError(GL_INVALID_VALUE
, "glInvalidateSubFramebuffer", "width < 0");
1518 SetGLError(GL_INVALID_VALUE
, "glInvalidateSubFramebuffer", "height < 0");
1521 helper_
->InvalidateSubFramebufferImmediate(target
, count
, attachments
, x
, y
,
1526 GLboolean
GLES2Implementation::IsBuffer(GLuint buffer
) {
1527 GPU_CLIENT_SINGLE_THREAD_CHECK();
1528 TRACE_EVENT0("gpu", "GLES2Implementation::IsBuffer");
1529 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glIsBuffer(" << buffer
<< ")");
1530 typedef cmds::IsBuffer::Result Result
;
1531 Result
* result
= GetResultAs
<Result
*>();
1536 helper_
->IsBuffer(buffer
, GetResultShmId(), GetResultShmOffset());
1538 GLboolean result_value
= *result
!= 0;
1539 GPU_CLIENT_LOG("returned " << result_value
);
1541 return result_value
;
1544 GLboolean
GLES2Implementation::IsFramebuffer(GLuint framebuffer
) {
1545 GPU_CLIENT_SINGLE_THREAD_CHECK();
1546 TRACE_EVENT0("gpu", "GLES2Implementation::IsFramebuffer");
1547 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glIsFramebuffer(" << framebuffer
1549 typedef cmds::IsFramebuffer::Result Result
;
1550 Result
* result
= GetResultAs
<Result
*>();
1555 helper_
->IsFramebuffer(framebuffer
, GetResultShmId(), GetResultShmOffset());
1557 GLboolean result_value
= *result
!= 0;
1558 GPU_CLIENT_LOG("returned " << result_value
);
1560 return result_value
;
1563 GLboolean
GLES2Implementation::IsProgram(GLuint program
) {
1564 GPU_CLIENT_SINGLE_THREAD_CHECK();
1565 TRACE_EVENT0("gpu", "GLES2Implementation::IsProgram");
1566 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glIsProgram(" << program
<< ")");
1567 typedef cmds::IsProgram::Result Result
;
1568 Result
* result
= GetResultAs
<Result
*>();
1573 helper_
->IsProgram(program
, GetResultShmId(), GetResultShmOffset());
1575 GLboolean result_value
= *result
!= 0;
1576 GPU_CLIENT_LOG("returned " << result_value
);
1578 return result_value
;
1581 GLboolean
GLES2Implementation::IsRenderbuffer(GLuint renderbuffer
) {
1582 GPU_CLIENT_SINGLE_THREAD_CHECK();
1583 TRACE_EVENT0("gpu", "GLES2Implementation::IsRenderbuffer");
1584 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glIsRenderbuffer(" << renderbuffer
1586 typedef cmds::IsRenderbuffer::Result Result
;
1587 Result
* result
= GetResultAs
<Result
*>();
1592 helper_
->IsRenderbuffer(renderbuffer
, GetResultShmId(), GetResultShmOffset());
1594 GLboolean result_value
= *result
!= 0;
1595 GPU_CLIENT_LOG("returned " << result_value
);
1597 return result_value
;
1600 GLboolean
GLES2Implementation::IsSampler(GLuint sampler
) {
1601 GPU_CLIENT_SINGLE_THREAD_CHECK();
1602 TRACE_EVENT0("gpu", "GLES2Implementation::IsSampler");
1603 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glIsSampler(" << sampler
<< ")");
1604 typedef cmds::IsSampler::Result Result
;
1605 Result
* result
= GetResultAs
<Result
*>();
1610 helper_
->IsSampler(sampler
, GetResultShmId(), GetResultShmOffset());
1612 GLboolean result_value
= *result
!= 0;
1613 GPU_CLIENT_LOG("returned " << result_value
);
1615 return result_value
;
1618 GLboolean
GLES2Implementation::IsShader(GLuint shader
) {
1619 GPU_CLIENT_SINGLE_THREAD_CHECK();
1620 TRACE_EVENT0("gpu", "GLES2Implementation::IsShader");
1621 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glIsShader(" << shader
<< ")");
1622 typedef cmds::IsShader::Result Result
;
1623 Result
* result
= GetResultAs
<Result
*>();
1628 helper_
->IsShader(shader
, GetResultShmId(), GetResultShmOffset());
1630 GLboolean result_value
= *result
!= 0;
1631 GPU_CLIENT_LOG("returned " << result_value
);
1633 return result_value
;
1636 GLboolean
GLES2Implementation::IsSync(GLsync sync
) {
1637 GPU_CLIENT_SINGLE_THREAD_CHECK();
1638 TRACE_EVENT0("gpu", "GLES2Implementation::IsSync");
1639 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glIsSync(" << sync
<< ")");
1640 typedef cmds::IsSync::Result Result
;
1641 Result
* result
= GetResultAs
<Result
*>();
1646 helper_
->IsSync(ToGLuint(sync
), GetResultShmId(), GetResultShmOffset());
1648 GLboolean result_value
= *result
!= 0;
1649 GPU_CLIENT_LOG("returned " << result_value
);
1651 return result_value
;
1654 GLboolean
GLES2Implementation::IsTexture(GLuint texture
) {
1655 GPU_CLIENT_SINGLE_THREAD_CHECK();
1656 TRACE_EVENT0("gpu", "GLES2Implementation::IsTexture");
1657 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glIsTexture(" << texture
<< ")");
1658 typedef cmds::IsTexture::Result Result
;
1659 Result
* result
= GetResultAs
<Result
*>();
1664 helper_
->IsTexture(texture
, GetResultShmId(), GetResultShmOffset());
1666 GLboolean result_value
= *result
!= 0;
1667 GPU_CLIENT_LOG("returned " << result_value
);
1669 return result_value
;
1672 GLboolean
GLES2Implementation::IsTransformFeedback(GLuint transformfeedback
) {
1673 GPU_CLIENT_SINGLE_THREAD_CHECK();
1674 TRACE_EVENT0("gpu", "GLES2Implementation::IsTransformFeedback");
1675 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glIsTransformFeedback("
1676 << transformfeedback
<< ")");
1677 typedef cmds::IsTransformFeedback::Result Result
;
1678 Result
* result
= GetResultAs
<Result
*>();
1683 helper_
->IsTransformFeedback(transformfeedback
, GetResultShmId(),
1684 GetResultShmOffset());
1686 GLboolean result_value
= *result
!= 0;
1687 GPU_CLIENT_LOG("returned " << result_value
);
1689 return result_value
;
1692 void GLES2Implementation::LineWidth(GLfloat width
) {
1693 GPU_CLIENT_SINGLE_THREAD_CHECK();
1694 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glLineWidth(" << width
<< ")");
1695 helper_
->LineWidth(width
);
1699 void GLES2Implementation::PauseTransformFeedback() {
1700 GPU_CLIENT_SINGLE_THREAD_CHECK();
1701 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glPauseTransformFeedback("
1703 helper_
->PauseTransformFeedback();
1707 void GLES2Implementation::PolygonOffset(GLfloat factor
, GLfloat units
) {
1708 GPU_CLIENT_SINGLE_THREAD_CHECK();
1709 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glPolygonOffset(" << factor
<< ", "
1711 helper_
->PolygonOffset(factor
, units
);
1715 void GLES2Implementation::ReadBuffer(GLenum src
) {
1716 GPU_CLIENT_SINGLE_THREAD_CHECK();
1717 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glReadBuffer("
1718 << GLES2Util::GetStringReadBuffer(src
) << ")");
1719 helper_
->ReadBuffer(src
);
1723 void GLES2Implementation::ReleaseShaderCompiler() {
1724 GPU_CLIENT_SINGLE_THREAD_CHECK();
1725 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glReleaseShaderCompiler("
1727 helper_
->ReleaseShaderCompiler();
1731 void GLES2Implementation::RenderbufferStorage(GLenum target
,
1732 GLenum internalformat
,
1735 GPU_CLIENT_SINGLE_THREAD_CHECK();
1736 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glRenderbufferStorage("
1737 << GLES2Util::GetStringRenderBufferTarget(target
) << ", "
1738 << GLES2Util::GetStringRenderBufferFormat(internalformat
)
1739 << ", " << width
<< ", " << height
<< ")");
1741 SetGLError(GL_INVALID_VALUE
, "glRenderbufferStorage", "width < 0");
1745 SetGLError(GL_INVALID_VALUE
, "glRenderbufferStorage", "height < 0");
1748 helper_
->RenderbufferStorage(target
, internalformat
, width
, height
);
1752 void GLES2Implementation::ResumeTransformFeedback() {
1753 GPU_CLIENT_SINGLE_THREAD_CHECK();
1754 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glResumeTransformFeedback("
1756 helper_
->ResumeTransformFeedback();
1760 void GLES2Implementation::SampleCoverage(GLclampf value
, GLboolean invert
) {
1761 GPU_CLIENT_SINGLE_THREAD_CHECK();
1762 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glSampleCoverage(" << value
<< ", "
1763 << GLES2Util::GetStringBool(invert
) << ")");
1764 helper_
->SampleCoverage(value
, invert
);
1768 void GLES2Implementation::SamplerParameterf(GLuint sampler
,
1771 GPU_CLIENT_SINGLE_THREAD_CHECK();
1772 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glSamplerParameterf(" << sampler
1773 << ", " << GLES2Util::GetStringSamplerParameter(pname
)
1774 << ", " << param
<< ")");
1775 helper_
->SamplerParameterf(sampler
, pname
, param
);
1779 void GLES2Implementation::SamplerParameterfv(GLuint sampler
,
1781 const GLfloat
* params
) {
1782 GPU_CLIENT_SINGLE_THREAD_CHECK();
1783 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glSamplerParameterfv(" << sampler
1784 << ", " << GLES2Util::GetStringSamplerParameter(pname
)
1785 << ", " << static_cast<const void*>(params
) << ")");
1787 for (size_t ii
= 0; ii
< count
; ++ii
)
1788 GPU_CLIENT_LOG("value[" << ii
<< "]: " << params
[ii
]);
1789 helper_
->SamplerParameterfvImmediate(sampler
, pname
, params
);
1793 void GLES2Implementation::SamplerParameteri(GLuint sampler
,
1796 GPU_CLIENT_SINGLE_THREAD_CHECK();
1797 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glSamplerParameteri(" << sampler
1798 << ", " << GLES2Util::GetStringSamplerParameter(pname
)
1799 << ", " << param
<< ")");
1800 helper_
->SamplerParameteri(sampler
, pname
, param
);
1804 void GLES2Implementation::SamplerParameteriv(GLuint sampler
,
1806 const GLint
* params
) {
1807 GPU_CLIENT_SINGLE_THREAD_CHECK();
1808 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glSamplerParameteriv(" << sampler
1809 << ", " << GLES2Util::GetStringSamplerParameter(pname
)
1810 << ", " << static_cast<const void*>(params
) << ")");
1812 for (size_t ii
= 0; ii
< count
; ++ii
)
1813 GPU_CLIENT_LOG("value[" << ii
<< "]: " << params
[ii
]);
1814 helper_
->SamplerParameterivImmediate(sampler
, pname
, params
);
1818 void GLES2Implementation::Scissor(GLint x
,
1822 GPU_CLIENT_SINGLE_THREAD_CHECK();
1823 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glScissor(" << x
<< ", " << y
1824 << ", " << width
<< ", " << height
<< ")");
1826 SetGLError(GL_INVALID_VALUE
, "glScissor", "width < 0");
1830 SetGLError(GL_INVALID_VALUE
, "glScissor", "height < 0");
1833 helper_
->Scissor(x
, y
, width
, height
);
1837 void GLES2Implementation::ShaderSource(GLuint shader
,
1839 const GLchar
* const* str
,
1840 const GLint
* length
) {
1841 GPU_CLIENT_SINGLE_THREAD_CHECK();
1842 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glShaderSource(" << shader
<< ", "
1843 << count
<< ", " << static_cast<const void*>(str
) << ", "
1844 << static_cast<const void*>(length
) << ")");
1845 GPU_CLIENT_LOG_CODE_BLOCK({
1846 for (GLsizei ii
= 0; ii
< count
; ++ii
) {
1848 if (length
&& length
[ii
] >= 0) {
1849 const std::string
my_str(str
[ii
], length
[ii
]);
1850 GPU_CLIENT_LOG(" " << ii
<< ": ---\n" << my_str
<< "\n---");
1852 GPU_CLIENT_LOG(" " << ii
<< ": ---\n" << str
[ii
] << "\n---");
1855 GPU_CLIENT_LOG(" " << ii
<< ": NULL");
1860 SetGLError(GL_INVALID_VALUE
, "glShaderSource", "count < 0");
1864 if (!PackStringsToBucket(count
, str
, length
, "glShaderSource")) {
1867 helper_
->ShaderSourceBucket(shader
, kResultBucketId
);
1868 helper_
->SetBucketSize(kResultBucketId
, 0);
1872 void GLES2Implementation::StencilFunc(GLenum func
, GLint ref
, GLuint mask
) {
1873 GPU_CLIENT_SINGLE_THREAD_CHECK();
1874 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glStencilFunc("
1875 << GLES2Util::GetStringCmpFunction(func
) << ", " << ref
1876 << ", " << mask
<< ")");
1877 helper_
->StencilFunc(func
, ref
, mask
);
1881 void GLES2Implementation::StencilFuncSeparate(GLenum face
,
1885 GPU_CLIENT_SINGLE_THREAD_CHECK();
1886 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glStencilFuncSeparate("
1887 << GLES2Util::GetStringFaceType(face
) << ", "
1888 << GLES2Util::GetStringCmpFunction(func
) << ", " << ref
1889 << ", " << mask
<< ")");
1890 helper_
->StencilFuncSeparate(face
, func
, ref
, mask
);
1894 void GLES2Implementation::StencilMask(GLuint mask
) {
1895 GPU_CLIENT_SINGLE_THREAD_CHECK();
1896 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glStencilMask(" << mask
<< ")");
1897 helper_
->StencilMask(mask
);
1901 void GLES2Implementation::StencilMaskSeparate(GLenum face
, GLuint mask
) {
1902 GPU_CLIENT_SINGLE_THREAD_CHECK();
1903 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glStencilMaskSeparate("
1904 << GLES2Util::GetStringFaceType(face
) << ", " << mask
1906 helper_
->StencilMaskSeparate(face
, mask
);
1910 void GLES2Implementation::StencilOp(GLenum fail
, GLenum zfail
, GLenum zpass
) {
1911 GPU_CLIENT_SINGLE_THREAD_CHECK();
1912 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glStencilOp("
1913 << GLES2Util::GetStringStencilOp(fail
) << ", "
1914 << GLES2Util::GetStringStencilOp(zfail
) << ", "
1915 << GLES2Util::GetStringStencilOp(zpass
) << ")");
1916 helper_
->StencilOp(fail
, zfail
, zpass
);
1920 void GLES2Implementation::StencilOpSeparate(GLenum face
,
1924 GPU_CLIENT_SINGLE_THREAD_CHECK();
1925 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glStencilOpSeparate("
1926 << GLES2Util::GetStringFaceType(face
) << ", "
1927 << GLES2Util::GetStringStencilOp(fail
) << ", "
1928 << GLES2Util::GetStringStencilOp(zfail
) << ", "
1929 << GLES2Util::GetStringStencilOp(zpass
) << ")");
1930 helper_
->StencilOpSeparate(face
, fail
, zfail
, zpass
);
1934 void GLES2Implementation::TexParameterf(GLenum target
,
1937 GPU_CLIENT_SINGLE_THREAD_CHECK();
1938 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glTexParameterf("
1939 << GLES2Util::GetStringTextureBindTarget(target
) << ", "
1940 << GLES2Util::GetStringTextureParameter(pname
) << ", "
1942 helper_
->TexParameterf(target
, pname
, param
);
1946 void GLES2Implementation::TexParameterfv(GLenum target
,
1948 const GLfloat
* params
) {
1949 GPU_CLIENT_SINGLE_THREAD_CHECK();
1950 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glTexParameterfv("
1951 << GLES2Util::GetStringTextureBindTarget(target
) << ", "
1952 << GLES2Util::GetStringTextureParameter(pname
) << ", "
1953 << static_cast<const void*>(params
) << ")");
1955 for (size_t ii
= 0; ii
< count
; ++ii
)
1956 GPU_CLIENT_LOG("value[" << ii
<< "]: " << params
[ii
]);
1957 helper_
->TexParameterfvImmediate(target
, pname
, params
);
1961 void GLES2Implementation::TexParameteri(GLenum target
,
1964 GPU_CLIENT_SINGLE_THREAD_CHECK();
1965 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glTexParameteri("
1966 << GLES2Util::GetStringTextureBindTarget(target
) << ", "
1967 << GLES2Util::GetStringTextureParameter(pname
) << ", "
1969 helper_
->TexParameteri(target
, pname
, param
);
1973 void GLES2Implementation::TexParameteriv(GLenum target
,
1975 const GLint
* params
) {
1976 GPU_CLIENT_SINGLE_THREAD_CHECK();
1977 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glTexParameteriv("
1978 << GLES2Util::GetStringTextureBindTarget(target
) << ", "
1979 << GLES2Util::GetStringTextureParameter(pname
) << ", "
1980 << static_cast<const void*>(params
) << ")");
1982 for (size_t ii
= 0; ii
< count
; ++ii
)
1983 GPU_CLIENT_LOG("value[" << ii
<< "]: " << params
[ii
]);
1984 helper_
->TexParameterivImmediate(target
, pname
, params
);
1988 void GLES2Implementation::TexStorage3D(GLenum target
,
1990 GLenum internalFormat
,
1994 GPU_CLIENT_SINGLE_THREAD_CHECK();
1996 "[" << GetLogPrefix() << "] glTexStorage3D("
1997 << GLES2Util::GetStringTexture3DTarget(target
) << ", " << levels
1999 << GLES2Util::GetStringTextureInternalFormatStorage(internalFormat
)
2000 << ", " << width
<< ", " << height
<< ", " << depth
<< ")");
2002 SetGLError(GL_INVALID_VALUE
, "glTexStorage3D", "levels < 0");
2006 SetGLError(GL_INVALID_VALUE
, "glTexStorage3D", "width < 0");
2010 SetGLError(GL_INVALID_VALUE
, "glTexStorage3D", "height < 0");
2014 SetGLError(GL_INVALID_VALUE
, "glTexStorage3D", "depth < 0");
2017 helper_
->TexStorage3D(target
, levels
, internalFormat
, width
, height
, depth
);
2021 void GLES2Implementation::TransformFeedbackVaryings(GLuint program
,
2023 const char* const* varyings
,
2024 GLenum buffermode
) {
2025 GPU_CLIENT_SINGLE_THREAD_CHECK();
2026 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glTransformFeedbackVaryings("
2027 << program
<< ", " << count
<< ", "
2028 << static_cast<const void*>(varyings
) << ", "
2029 << GLES2Util::GetStringBufferMode(buffermode
) << ")");
2030 GPU_CLIENT_LOG_CODE_BLOCK({
2031 for (GLsizei ii
= 0; ii
< count
; ++ii
) {
2033 GPU_CLIENT_LOG(" " << ii
<< ": ---\n" << varyings
[ii
] << "\n---");
2035 GPU_CLIENT_LOG(" " << ii
<< ": NULL");
2040 SetGLError(GL_INVALID_VALUE
, "glTransformFeedbackVaryings", "count < 0");
2044 if (!PackStringsToBucket(count
, varyings
, NULL
,
2045 "glTransformFeedbackVaryings")) {
2048 helper_
->TransformFeedbackVaryingsBucket(program
, kResultBucketId
,
2050 helper_
->SetBucketSize(kResultBucketId
, 0);
2054 void GLES2Implementation::Uniform1f(GLint location
, GLfloat x
) {
2055 GPU_CLIENT_SINGLE_THREAD_CHECK();
2056 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glUniform1f(" << location
<< ", "
2058 helper_
->Uniform1f(location
, x
);
2062 void GLES2Implementation::Uniform1fv(GLint location
,
2065 GPU_CLIENT_SINGLE_THREAD_CHECK();
2066 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glUniform1fv(" << location
<< ", "
2067 << count
<< ", " << static_cast<const void*>(v
) << ")");
2068 GPU_CLIENT_LOG_CODE_BLOCK({
2069 for (GLsizei i
= 0; i
< count
; ++i
) {
2070 GPU_CLIENT_LOG(" " << i
<< ": " << v
[0 + i
* 1]);
2074 SetGLError(GL_INVALID_VALUE
, "glUniform1fv", "count < 0");
2077 helper_
->Uniform1fvImmediate(location
, count
, v
);
2081 void GLES2Implementation::Uniform1i(GLint location
, GLint x
) {
2082 GPU_CLIENT_SINGLE_THREAD_CHECK();
2083 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glUniform1i(" << location
<< ", "
2085 helper_
->Uniform1i(location
, x
);
2089 void GLES2Implementation::Uniform1iv(GLint location
,
2092 GPU_CLIENT_SINGLE_THREAD_CHECK();
2093 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glUniform1iv(" << location
<< ", "
2094 << count
<< ", " << static_cast<const void*>(v
) << ")");
2095 GPU_CLIENT_LOG_CODE_BLOCK({
2096 for (GLsizei i
= 0; i
< count
; ++i
) {
2097 GPU_CLIENT_LOG(" " << i
<< ": " << v
[0 + i
* 1]);
2101 SetGLError(GL_INVALID_VALUE
, "glUniform1iv", "count < 0");
2104 helper_
->Uniform1ivImmediate(location
, count
, v
);
2108 void GLES2Implementation::Uniform1ui(GLint location
, GLuint x
) {
2109 GPU_CLIENT_SINGLE_THREAD_CHECK();
2110 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glUniform1ui(" << location
<< ", "
2112 helper_
->Uniform1ui(location
, x
);
2116 void GLES2Implementation::Uniform1uiv(GLint location
,
2119 GPU_CLIENT_SINGLE_THREAD_CHECK();
2120 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glUniform1uiv(" << location
<< ", "
2121 << count
<< ", " << static_cast<const void*>(v
) << ")");
2122 GPU_CLIENT_LOG_CODE_BLOCK({
2123 for (GLsizei i
= 0; i
< count
; ++i
) {
2124 GPU_CLIENT_LOG(" " << i
<< ": " << v
[0 + i
* 1]);
2128 SetGLError(GL_INVALID_VALUE
, "glUniform1uiv", "count < 0");
2131 helper_
->Uniform1uivImmediate(location
, count
, v
);
2135 void GLES2Implementation::Uniform2f(GLint location
, GLfloat x
, GLfloat y
) {
2136 GPU_CLIENT_SINGLE_THREAD_CHECK();
2137 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glUniform2f(" << location
<< ", "
2138 << x
<< ", " << y
<< ")");
2139 helper_
->Uniform2f(location
, x
, y
);
2143 void GLES2Implementation::Uniform2fv(GLint location
,
2146 GPU_CLIENT_SINGLE_THREAD_CHECK();
2147 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glUniform2fv(" << location
<< ", "
2148 << count
<< ", " << static_cast<const void*>(v
) << ")");
2149 GPU_CLIENT_LOG_CODE_BLOCK({
2150 for (GLsizei i
= 0; i
< count
; ++i
) {
2151 GPU_CLIENT_LOG(" " << i
<< ": " << v
[0 + i
* 2] << ", " << v
[1 + i
* 2]);
2155 SetGLError(GL_INVALID_VALUE
, "glUniform2fv", "count < 0");
2158 helper_
->Uniform2fvImmediate(location
, count
, v
);
2162 void GLES2Implementation::Uniform2i(GLint location
, GLint x
, GLint y
) {
2163 GPU_CLIENT_SINGLE_THREAD_CHECK();
2164 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glUniform2i(" << location
<< ", "
2165 << x
<< ", " << y
<< ")");
2166 helper_
->Uniform2i(location
, x
, y
);
2170 void GLES2Implementation::Uniform2iv(GLint location
,
2173 GPU_CLIENT_SINGLE_THREAD_CHECK();
2174 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glUniform2iv(" << location
<< ", "
2175 << count
<< ", " << static_cast<const void*>(v
) << ")");
2176 GPU_CLIENT_LOG_CODE_BLOCK({
2177 for (GLsizei i
= 0; i
< count
; ++i
) {
2178 GPU_CLIENT_LOG(" " << i
<< ": " << v
[0 + i
* 2] << ", " << v
[1 + i
* 2]);
2182 SetGLError(GL_INVALID_VALUE
, "glUniform2iv", "count < 0");
2185 helper_
->Uniform2ivImmediate(location
, count
, v
);
2189 void GLES2Implementation::Uniform2ui(GLint location
, GLuint x
, GLuint y
) {
2190 GPU_CLIENT_SINGLE_THREAD_CHECK();
2191 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glUniform2ui(" << location
<< ", "
2192 << x
<< ", " << y
<< ")");
2193 helper_
->Uniform2ui(location
, x
, y
);
2197 void GLES2Implementation::Uniform2uiv(GLint location
,
2200 GPU_CLIENT_SINGLE_THREAD_CHECK();
2201 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glUniform2uiv(" << location
<< ", "
2202 << count
<< ", " << static_cast<const void*>(v
) << ")");
2203 GPU_CLIENT_LOG_CODE_BLOCK({
2204 for (GLsizei i
= 0; i
< count
; ++i
) {
2205 GPU_CLIENT_LOG(" " << i
<< ": " << v
[0 + i
* 2] << ", " << v
[1 + i
* 2]);
2209 SetGLError(GL_INVALID_VALUE
, "glUniform2uiv", "count < 0");
2212 helper_
->Uniform2uivImmediate(location
, count
, v
);
2216 void GLES2Implementation::Uniform3f(GLint location
,
2220 GPU_CLIENT_SINGLE_THREAD_CHECK();
2221 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glUniform3f(" << location
<< ", "
2222 << x
<< ", " << y
<< ", " << z
<< ")");
2223 helper_
->Uniform3f(location
, x
, y
, z
);
2227 void GLES2Implementation::Uniform3fv(GLint location
,
2230 GPU_CLIENT_SINGLE_THREAD_CHECK();
2231 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glUniform3fv(" << location
<< ", "
2232 << count
<< ", " << static_cast<const void*>(v
) << ")");
2233 GPU_CLIENT_LOG_CODE_BLOCK({
2234 for (GLsizei i
= 0; i
< count
; ++i
) {
2235 GPU_CLIENT_LOG(" " << i
<< ": " << v
[0 + i
* 3] << ", " << v
[1 + i
* 3]
2236 << ", " << v
[2 + i
* 3]);
2240 SetGLError(GL_INVALID_VALUE
, "glUniform3fv", "count < 0");
2243 helper_
->Uniform3fvImmediate(location
, count
, v
);
2247 void GLES2Implementation::Uniform3i(GLint location
, GLint x
, GLint y
, GLint z
) {
2248 GPU_CLIENT_SINGLE_THREAD_CHECK();
2249 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glUniform3i(" << location
<< ", "
2250 << x
<< ", " << y
<< ", " << z
<< ")");
2251 helper_
->Uniform3i(location
, x
, y
, z
);
2255 void GLES2Implementation::Uniform3iv(GLint location
,
2258 GPU_CLIENT_SINGLE_THREAD_CHECK();
2259 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glUniform3iv(" << location
<< ", "
2260 << count
<< ", " << static_cast<const void*>(v
) << ")");
2261 GPU_CLIENT_LOG_CODE_BLOCK({
2262 for (GLsizei i
= 0; i
< count
; ++i
) {
2263 GPU_CLIENT_LOG(" " << i
<< ": " << v
[0 + i
* 3] << ", " << v
[1 + i
* 3]
2264 << ", " << v
[2 + i
* 3]);
2268 SetGLError(GL_INVALID_VALUE
, "glUniform3iv", "count < 0");
2271 helper_
->Uniform3ivImmediate(location
, count
, v
);
2275 void GLES2Implementation::Uniform3ui(GLint location
,
2279 GPU_CLIENT_SINGLE_THREAD_CHECK();
2280 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glUniform3ui(" << location
<< ", "
2281 << x
<< ", " << y
<< ", " << z
<< ")");
2282 helper_
->Uniform3ui(location
, x
, y
, z
);
2286 void GLES2Implementation::Uniform3uiv(GLint location
,
2289 GPU_CLIENT_SINGLE_THREAD_CHECK();
2290 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glUniform3uiv(" << location
<< ", "
2291 << count
<< ", " << static_cast<const void*>(v
) << ")");
2292 GPU_CLIENT_LOG_CODE_BLOCK({
2293 for (GLsizei i
= 0; i
< count
; ++i
) {
2294 GPU_CLIENT_LOG(" " << i
<< ": " << v
[0 + i
* 3] << ", " << v
[1 + i
* 3]
2295 << ", " << v
[2 + i
* 3]);
2299 SetGLError(GL_INVALID_VALUE
, "glUniform3uiv", "count < 0");
2302 helper_
->Uniform3uivImmediate(location
, count
, v
);
2306 void GLES2Implementation::Uniform4f(GLint location
,
2311 GPU_CLIENT_SINGLE_THREAD_CHECK();
2312 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glUniform4f(" << location
<< ", "
2313 << x
<< ", " << y
<< ", " << z
<< ", " << w
<< ")");
2314 helper_
->Uniform4f(location
, x
, y
, z
, w
);
2318 void GLES2Implementation::Uniform4fv(GLint location
,
2321 GPU_CLIENT_SINGLE_THREAD_CHECK();
2322 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glUniform4fv(" << location
<< ", "
2323 << count
<< ", " << static_cast<const void*>(v
) << ")");
2324 GPU_CLIENT_LOG_CODE_BLOCK({
2325 for (GLsizei i
= 0; i
< count
; ++i
) {
2326 GPU_CLIENT_LOG(" " << i
<< ": " << v
[0 + i
* 4] << ", " << v
[1 + i
* 4]
2327 << ", " << v
[2 + i
* 4] << ", " << v
[3 + i
* 4]);
2331 SetGLError(GL_INVALID_VALUE
, "glUniform4fv", "count < 0");
2334 helper_
->Uniform4fvImmediate(location
, count
, v
);
2338 void GLES2Implementation::Uniform4i(GLint location
,
2343 GPU_CLIENT_SINGLE_THREAD_CHECK();
2344 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glUniform4i(" << location
<< ", "
2345 << x
<< ", " << y
<< ", " << z
<< ", " << w
<< ")");
2346 helper_
->Uniform4i(location
, x
, y
, z
, w
);
2350 void GLES2Implementation::Uniform4iv(GLint location
,
2353 GPU_CLIENT_SINGLE_THREAD_CHECK();
2354 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glUniform4iv(" << location
<< ", "
2355 << count
<< ", " << static_cast<const void*>(v
) << ")");
2356 GPU_CLIENT_LOG_CODE_BLOCK({
2357 for (GLsizei i
= 0; i
< count
; ++i
) {
2358 GPU_CLIENT_LOG(" " << i
<< ": " << v
[0 + i
* 4] << ", " << v
[1 + i
* 4]
2359 << ", " << v
[2 + i
* 4] << ", " << v
[3 + i
* 4]);
2363 SetGLError(GL_INVALID_VALUE
, "glUniform4iv", "count < 0");
2366 helper_
->Uniform4ivImmediate(location
, count
, v
);
2370 void GLES2Implementation::Uniform4ui(GLint location
,
2375 GPU_CLIENT_SINGLE_THREAD_CHECK();
2376 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glUniform4ui(" << location
<< ", "
2377 << x
<< ", " << y
<< ", " << z
<< ", " << w
<< ")");
2378 helper_
->Uniform4ui(location
, x
, y
, z
, w
);
2382 void GLES2Implementation::Uniform4uiv(GLint location
,
2385 GPU_CLIENT_SINGLE_THREAD_CHECK();
2386 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glUniform4uiv(" << location
<< ", "
2387 << count
<< ", " << static_cast<const void*>(v
) << ")");
2388 GPU_CLIENT_LOG_CODE_BLOCK({
2389 for (GLsizei i
= 0; i
< count
; ++i
) {
2390 GPU_CLIENT_LOG(" " << i
<< ": " << v
[0 + i
* 4] << ", " << v
[1 + i
* 4]
2391 << ", " << v
[2 + i
* 4] << ", " << v
[3 + i
* 4]);
2395 SetGLError(GL_INVALID_VALUE
, "glUniform4uiv", "count < 0");
2398 helper_
->Uniform4uivImmediate(location
, count
, v
);
2402 void GLES2Implementation::UniformMatrix2fv(GLint location
,
2404 GLboolean transpose
,
2405 const GLfloat
* value
) {
2406 GPU_CLIENT_SINGLE_THREAD_CHECK();
2407 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glUniformMatrix2fv(" << location
2408 << ", " << count
<< ", "
2409 << GLES2Util::GetStringBool(transpose
) << ", "
2410 << static_cast<const void*>(value
) << ")");
2411 GPU_CLIENT_LOG_CODE_BLOCK({
2412 for (GLsizei i
= 0; i
< count
; ++i
) {
2413 GPU_CLIENT_LOG(" " << i
<< ": " << value
[0 + i
* 4] << ", "
2414 << value
[1 + i
* 4] << ", " << value
[2 + i
* 4]
2415 << ", " << value
[3 + i
* 4]);
2419 SetGLError(GL_INVALID_VALUE
, "glUniformMatrix2fv", "count < 0");
2422 if (transpose
!= false) {
2423 SetGLError(GL_INVALID_VALUE
, "glUniformMatrix2fv",
2424 "transpose GL_INVALID_VALUE");
2427 helper_
->UniformMatrix2fvImmediate(location
, count
, value
);
2431 void GLES2Implementation::UniformMatrix2x3fv(GLint location
,
2433 GLboolean transpose
,
2434 const GLfloat
* value
) {
2435 GPU_CLIENT_SINGLE_THREAD_CHECK();
2436 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glUniformMatrix2x3fv(" << location
2437 << ", " << count
<< ", "
2438 << GLES2Util::GetStringBool(transpose
) << ", "
2439 << static_cast<const void*>(value
) << ")");
2440 GPU_CLIENT_LOG_CODE_BLOCK({
2441 for (GLsizei i
= 0; i
< count
; ++i
) {
2442 GPU_CLIENT_LOG(" " << i
<< ": " << value
[0 + i
* 6] << ", "
2443 << value
[1 + i
* 6] << ", " << value
[2 + i
* 6]
2444 << ", " << value
[3 + i
* 6] << ", "
2445 << value
[4 + i
* 6] << ", " << value
[5 + i
* 6]);
2449 SetGLError(GL_INVALID_VALUE
, "glUniformMatrix2x3fv", "count < 0");
2452 if (transpose
!= false) {
2453 SetGLError(GL_INVALID_VALUE
, "glUniformMatrix2x3fv",
2454 "transpose GL_INVALID_VALUE");
2457 helper_
->UniformMatrix2x3fvImmediate(location
, count
, value
);
2461 void GLES2Implementation::UniformMatrix2x4fv(GLint location
,
2463 GLboolean transpose
,
2464 const GLfloat
* value
) {
2465 GPU_CLIENT_SINGLE_THREAD_CHECK();
2466 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glUniformMatrix2x4fv(" << location
2467 << ", " << count
<< ", "
2468 << GLES2Util::GetStringBool(transpose
) << ", "
2469 << static_cast<const void*>(value
) << ")");
2470 GPU_CLIENT_LOG_CODE_BLOCK({
2471 for (GLsizei i
= 0; i
< count
; ++i
) {
2473 " " << i
<< ": " << value
[0 + i
* 8] << ", " << value
[1 + i
* 8]
2474 << ", " << value
[2 + i
* 8] << ", " << value
[3 + i
* 8] << ", "
2475 << value
[4 + i
* 8] << ", " << value
[5 + i
* 8] << ", "
2476 << value
[6 + i
* 8] << ", " << value
[7 + i
* 8]);
2480 SetGLError(GL_INVALID_VALUE
, "glUniformMatrix2x4fv", "count < 0");
2483 if (transpose
!= false) {
2484 SetGLError(GL_INVALID_VALUE
, "glUniformMatrix2x4fv",
2485 "transpose GL_INVALID_VALUE");
2488 helper_
->UniformMatrix2x4fvImmediate(location
, count
, value
);
2492 void GLES2Implementation::UniformMatrix3fv(GLint location
,
2494 GLboolean transpose
,
2495 const GLfloat
* value
) {
2496 GPU_CLIENT_SINGLE_THREAD_CHECK();
2497 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glUniformMatrix3fv(" << location
2498 << ", " << count
<< ", "
2499 << GLES2Util::GetStringBool(transpose
) << ", "
2500 << static_cast<const void*>(value
) << ")");
2501 GPU_CLIENT_LOG_CODE_BLOCK({
2502 for (GLsizei i
= 0; i
< count
; ++i
) {
2503 GPU_CLIENT_LOG(" " << i
<< ": " << value
[0 + i
* 9] << ", "
2504 << value
[1 + i
* 9] << ", " << value
[2 + i
* 9]
2505 << ", " << value
[3 + i
* 9] << ", "
2506 << value
[4 + i
* 9] << ", " << value
[5 + i
* 9]
2507 << ", " << value
[6 + i
* 9] << ", "
2508 << value
[7 + i
* 9] << ", " << value
[8 + i
* 9]);
2512 SetGLError(GL_INVALID_VALUE
, "glUniformMatrix3fv", "count < 0");
2515 if (transpose
!= false) {
2516 SetGLError(GL_INVALID_VALUE
, "glUniformMatrix3fv",
2517 "transpose GL_INVALID_VALUE");
2520 helper_
->UniformMatrix3fvImmediate(location
, count
, value
);
2524 void GLES2Implementation::UniformMatrix3x2fv(GLint location
,
2526 GLboolean transpose
,
2527 const GLfloat
* value
) {
2528 GPU_CLIENT_SINGLE_THREAD_CHECK();
2529 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glUniformMatrix3x2fv(" << location
2530 << ", " << count
<< ", "
2531 << GLES2Util::GetStringBool(transpose
) << ", "
2532 << static_cast<const void*>(value
) << ")");
2533 GPU_CLIENT_LOG_CODE_BLOCK({
2534 for (GLsizei i
= 0; i
< count
; ++i
) {
2535 GPU_CLIENT_LOG(" " << i
<< ": " << value
[0 + i
* 6] << ", "
2536 << value
[1 + i
* 6] << ", " << value
[2 + i
* 6]
2537 << ", " << value
[3 + i
* 6] << ", "
2538 << value
[4 + i
* 6] << ", " << value
[5 + i
* 6]);
2542 SetGLError(GL_INVALID_VALUE
, "glUniformMatrix3x2fv", "count < 0");
2545 if (transpose
!= false) {
2546 SetGLError(GL_INVALID_VALUE
, "glUniformMatrix3x2fv",
2547 "transpose GL_INVALID_VALUE");
2550 helper_
->UniformMatrix3x2fvImmediate(location
, count
, value
);
2554 void GLES2Implementation::UniformMatrix3x4fv(GLint location
,
2556 GLboolean transpose
,
2557 const GLfloat
* value
) {
2558 GPU_CLIENT_SINGLE_THREAD_CHECK();
2559 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glUniformMatrix3x4fv(" << location
2560 << ", " << count
<< ", "
2561 << GLES2Util::GetStringBool(transpose
) << ", "
2562 << static_cast<const void*>(value
) << ")");
2563 GPU_CLIENT_LOG_CODE_BLOCK({
2564 for (GLsizei i
= 0; i
< count
; ++i
) {
2566 " " << i
<< ": " << value
[0 + i
* 12] << ", " << value
[1 + i
* 12]
2567 << ", " << value
[2 + i
* 12] << ", " << value
[3 + i
* 12] << ", "
2568 << value
[4 + i
* 12] << ", " << value
[5 + i
* 12] << ", "
2569 << value
[6 + i
* 12] << ", " << value
[7 + i
* 12] << ", "
2570 << value
[8 + i
* 12] << ", " << value
[9 + i
* 12] << ", "
2571 << value
[10 + i
* 12] << ", " << value
[11 + i
* 12]);
2575 SetGLError(GL_INVALID_VALUE
, "glUniformMatrix3x4fv", "count < 0");
2578 if (transpose
!= false) {
2579 SetGLError(GL_INVALID_VALUE
, "glUniformMatrix3x4fv",
2580 "transpose GL_INVALID_VALUE");
2583 helper_
->UniformMatrix3x4fvImmediate(location
, count
, value
);
2587 void GLES2Implementation::UniformMatrix4fv(GLint location
,
2589 GLboolean transpose
,
2590 const GLfloat
* value
) {
2591 GPU_CLIENT_SINGLE_THREAD_CHECK();
2592 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glUniformMatrix4fv(" << location
2593 << ", " << count
<< ", "
2594 << GLES2Util::GetStringBool(transpose
) << ", "
2595 << static_cast<const void*>(value
) << ")");
2596 GPU_CLIENT_LOG_CODE_BLOCK({
2597 for (GLsizei i
= 0; i
< count
; ++i
) {
2599 " " << i
<< ": " << value
[0 + i
* 16] << ", " << value
[1 + i
* 16]
2600 << ", " << value
[2 + i
* 16] << ", " << value
[3 + i
* 16] << ", "
2601 << value
[4 + i
* 16] << ", " << value
[5 + i
* 16] << ", "
2602 << value
[6 + i
* 16] << ", " << value
[7 + i
* 16] << ", "
2603 << value
[8 + i
* 16] << ", " << value
[9 + i
* 16] << ", "
2604 << value
[10 + i
* 16] << ", " << value
[11 + i
* 16] << ", "
2605 << value
[12 + i
* 16] << ", " << value
[13 + i
* 16] << ", "
2606 << value
[14 + i
* 16] << ", " << value
[15 + i
* 16]);
2610 SetGLError(GL_INVALID_VALUE
, "glUniformMatrix4fv", "count < 0");
2613 if (transpose
!= false) {
2614 SetGLError(GL_INVALID_VALUE
, "glUniformMatrix4fv",
2615 "transpose GL_INVALID_VALUE");
2618 helper_
->UniformMatrix4fvImmediate(location
, count
, value
);
2622 void GLES2Implementation::UniformMatrix4x2fv(GLint location
,
2624 GLboolean transpose
,
2625 const GLfloat
* value
) {
2626 GPU_CLIENT_SINGLE_THREAD_CHECK();
2627 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glUniformMatrix4x2fv(" << location
2628 << ", " << count
<< ", "
2629 << GLES2Util::GetStringBool(transpose
) << ", "
2630 << static_cast<const void*>(value
) << ")");
2631 GPU_CLIENT_LOG_CODE_BLOCK({
2632 for (GLsizei i
= 0; i
< count
; ++i
) {
2634 " " << i
<< ": " << value
[0 + i
* 8] << ", " << value
[1 + i
* 8]
2635 << ", " << value
[2 + i
* 8] << ", " << value
[3 + i
* 8] << ", "
2636 << value
[4 + i
* 8] << ", " << value
[5 + i
* 8] << ", "
2637 << value
[6 + i
* 8] << ", " << value
[7 + i
* 8]);
2641 SetGLError(GL_INVALID_VALUE
, "glUniformMatrix4x2fv", "count < 0");
2644 if (transpose
!= false) {
2645 SetGLError(GL_INVALID_VALUE
, "glUniformMatrix4x2fv",
2646 "transpose GL_INVALID_VALUE");
2649 helper_
->UniformMatrix4x2fvImmediate(location
, count
, value
);
2653 void GLES2Implementation::UniformMatrix4x3fv(GLint location
,
2655 GLboolean transpose
,
2656 const GLfloat
* value
) {
2657 GPU_CLIENT_SINGLE_THREAD_CHECK();
2658 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glUniformMatrix4x3fv(" << location
2659 << ", " << count
<< ", "
2660 << GLES2Util::GetStringBool(transpose
) << ", "
2661 << static_cast<const void*>(value
) << ")");
2662 GPU_CLIENT_LOG_CODE_BLOCK({
2663 for (GLsizei i
= 0; i
< count
; ++i
) {
2665 " " << i
<< ": " << value
[0 + i
* 12] << ", " << value
[1 + i
* 12]
2666 << ", " << value
[2 + i
* 12] << ", " << value
[3 + i
* 12] << ", "
2667 << value
[4 + i
* 12] << ", " << value
[5 + i
* 12] << ", "
2668 << value
[6 + i
* 12] << ", " << value
[7 + i
* 12] << ", "
2669 << value
[8 + i
* 12] << ", " << value
[9 + i
* 12] << ", "
2670 << value
[10 + i
* 12] << ", " << value
[11 + i
* 12]);
2674 SetGLError(GL_INVALID_VALUE
, "glUniformMatrix4x3fv", "count < 0");
2677 if (transpose
!= false) {
2678 SetGLError(GL_INVALID_VALUE
, "glUniformMatrix4x3fv",
2679 "transpose GL_INVALID_VALUE");
2682 helper_
->UniformMatrix4x3fvImmediate(location
, count
, value
);
2686 void GLES2Implementation::UseProgram(GLuint program
) {
2687 GPU_CLIENT_SINGLE_THREAD_CHECK();
2688 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glUseProgram(" << program
<< ")");
2689 if (IsProgramReservedId(program
)) {
2690 SetGLError(GL_INVALID_OPERATION
, "UseProgram", "program reserved id");
2693 UseProgramHelper(program
);
2697 void GLES2Implementation::ValidateProgram(GLuint program
) {
2698 GPU_CLIENT_SINGLE_THREAD_CHECK();
2699 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glValidateProgram(" << program
2701 helper_
->ValidateProgram(program
);
2705 void GLES2Implementation::VertexAttrib1f(GLuint indx
, GLfloat x
) {
2706 GPU_CLIENT_SINGLE_THREAD_CHECK();
2707 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glVertexAttrib1f(" << indx
<< ", "
2709 helper_
->VertexAttrib1f(indx
, x
);
2713 void GLES2Implementation::VertexAttrib1fv(GLuint indx
, const GLfloat
* values
) {
2714 GPU_CLIENT_SINGLE_THREAD_CHECK();
2715 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glVertexAttrib1fv(" << indx
<< ", "
2716 << static_cast<const void*>(values
) << ")");
2718 for (size_t ii
= 0; ii
< count
; ++ii
)
2719 GPU_CLIENT_LOG("value[" << ii
<< "]: " << values
[ii
]);
2720 helper_
->VertexAttrib1fvImmediate(indx
, values
);
2724 void GLES2Implementation::VertexAttrib2f(GLuint indx
, GLfloat x
, GLfloat y
) {
2725 GPU_CLIENT_SINGLE_THREAD_CHECK();
2726 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glVertexAttrib2f(" << indx
<< ", "
2727 << x
<< ", " << y
<< ")");
2728 helper_
->VertexAttrib2f(indx
, x
, y
);
2732 void GLES2Implementation::VertexAttrib2fv(GLuint indx
, const GLfloat
* values
) {
2733 GPU_CLIENT_SINGLE_THREAD_CHECK();
2734 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glVertexAttrib2fv(" << indx
<< ", "
2735 << static_cast<const void*>(values
) << ")");
2737 for (size_t ii
= 0; ii
< count
; ++ii
)
2738 GPU_CLIENT_LOG("value[" << ii
<< "]: " << values
[ii
]);
2739 helper_
->VertexAttrib2fvImmediate(indx
, values
);
2743 void GLES2Implementation::VertexAttrib3f(GLuint indx
,
2747 GPU_CLIENT_SINGLE_THREAD_CHECK();
2748 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glVertexAttrib3f(" << indx
<< ", "
2749 << x
<< ", " << y
<< ", " << z
<< ")");
2750 helper_
->VertexAttrib3f(indx
, x
, y
, z
);
2754 void GLES2Implementation::VertexAttrib3fv(GLuint indx
, const GLfloat
* values
) {
2755 GPU_CLIENT_SINGLE_THREAD_CHECK();
2756 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glVertexAttrib3fv(" << indx
<< ", "
2757 << static_cast<const void*>(values
) << ")");
2759 for (size_t ii
= 0; ii
< count
; ++ii
)
2760 GPU_CLIENT_LOG("value[" << ii
<< "]: " << values
[ii
]);
2761 helper_
->VertexAttrib3fvImmediate(indx
, values
);
2765 void GLES2Implementation::VertexAttrib4f(GLuint indx
,
2770 GPU_CLIENT_SINGLE_THREAD_CHECK();
2771 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glVertexAttrib4f(" << indx
<< ", "
2772 << x
<< ", " << y
<< ", " << z
<< ", " << w
<< ")");
2773 helper_
->VertexAttrib4f(indx
, x
, y
, z
, w
);
2777 void GLES2Implementation::VertexAttrib4fv(GLuint indx
, const GLfloat
* values
) {
2778 GPU_CLIENT_SINGLE_THREAD_CHECK();
2779 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glVertexAttrib4fv(" << indx
<< ", "
2780 << static_cast<const void*>(values
) << ")");
2782 for (size_t ii
= 0; ii
< count
; ++ii
)
2783 GPU_CLIENT_LOG("value[" << ii
<< "]: " << values
[ii
]);
2784 helper_
->VertexAttrib4fvImmediate(indx
, values
);
2788 void GLES2Implementation::VertexAttribI4i(GLuint indx
,
2793 GPU_CLIENT_SINGLE_THREAD_CHECK();
2794 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glVertexAttribI4i(" << indx
<< ", "
2795 << x
<< ", " << y
<< ", " << z
<< ", " << w
<< ")");
2796 helper_
->VertexAttribI4i(indx
, x
, y
, z
, w
);
2800 void GLES2Implementation::VertexAttribI4iv(GLuint indx
, const GLint
* values
) {
2801 GPU_CLIENT_SINGLE_THREAD_CHECK();
2802 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glVertexAttribI4iv(" << indx
2803 << ", " << static_cast<const void*>(values
) << ")");
2805 for (size_t ii
= 0; ii
< count
; ++ii
)
2806 GPU_CLIENT_LOG("value[" << ii
<< "]: " << values
[ii
]);
2807 helper_
->VertexAttribI4ivImmediate(indx
, values
);
2811 void GLES2Implementation::VertexAttribI4ui(GLuint indx
,
2816 GPU_CLIENT_SINGLE_THREAD_CHECK();
2817 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glVertexAttribI4ui(" << indx
2818 << ", " << x
<< ", " << y
<< ", " << z
<< ", " << w
2820 helper_
->VertexAttribI4ui(indx
, x
, y
, z
, w
);
2824 void GLES2Implementation::VertexAttribI4uiv(GLuint indx
, const GLuint
* values
) {
2825 GPU_CLIENT_SINGLE_THREAD_CHECK();
2826 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glVertexAttribI4uiv(" << indx
2827 << ", " << static_cast<const void*>(values
) << ")");
2829 for (size_t ii
= 0; ii
< count
; ++ii
)
2830 GPU_CLIENT_LOG("value[" << ii
<< "]: " << values
[ii
]);
2831 helper_
->VertexAttribI4uivImmediate(indx
, values
);
2835 void GLES2Implementation::Viewport(GLint x
,
2839 GPU_CLIENT_SINGLE_THREAD_CHECK();
2840 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glViewport(" << x
<< ", " << y
2841 << ", " << width
<< ", " << height
<< ")");
2843 SetGLError(GL_INVALID_VALUE
, "glViewport", "width < 0");
2847 SetGLError(GL_INVALID_VALUE
, "glViewport", "height < 0");
2850 helper_
->Viewport(x
, y
, width
, height
);
2854 void GLES2Implementation::BlitFramebufferCHROMIUM(GLint srcX0
,
2864 GPU_CLIENT_SINGLE_THREAD_CHECK();
2865 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glBlitFramebufferCHROMIUM("
2866 << srcX0
<< ", " << srcY0
<< ", " << srcX1
<< ", " << srcY1
2867 << ", " << dstX0
<< ", " << dstY0
<< ", " << dstX1
<< ", "
2868 << dstY1
<< ", " << mask
<< ", "
2869 << GLES2Util::GetStringBlitFilter(filter
) << ")");
2870 helper_
->BlitFramebufferCHROMIUM(srcX0
, srcY0
, srcX1
, srcY1
, dstX0
, dstY0
,
2871 dstX1
, dstY1
, mask
, filter
);
2875 void GLES2Implementation::RenderbufferStorageMultisampleCHROMIUM(
2878 GLenum internalformat
,
2881 GPU_CLIENT_SINGLE_THREAD_CHECK();
2883 "[" << GetLogPrefix() << "] glRenderbufferStorageMultisampleCHROMIUM("
2884 << GLES2Util::GetStringRenderBufferTarget(target
) << ", " << samples
2885 << ", " << GLES2Util::GetStringRenderBufferFormat(internalformat
)
2886 << ", " << width
<< ", " << height
<< ")");
2888 SetGLError(GL_INVALID_VALUE
, "glRenderbufferStorageMultisampleCHROMIUM",
2893 SetGLError(GL_INVALID_VALUE
, "glRenderbufferStorageMultisampleCHROMIUM",
2898 SetGLError(GL_INVALID_VALUE
, "glRenderbufferStorageMultisampleCHROMIUM",
2902 helper_
->RenderbufferStorageMultisampleCHROMIUM(
2903 target
, samples
, internalformat
, width
, height
);
2907 void GLES2Implementation::RenderbufferStorageMultisampleEXT(
2910 GLenum internalformat
,
2913 GPU_CLIENT_SINGLE_THREAD_CHECK();
2915 "[" << GetLogPrefix() << "] glRenderbufferStorageMultisampleEXT("
2916 << GLES2Util::GetStringRenderBufferTarget(target
) << ", " << samples
2917 << ", " << GLES2Util::GetStringRenderBufferFormat(internalformat
)
2918 << ", " << width
<< ", " << height
<< ")");
2920 SetGLError(GL_INVALID_VALUE
, "glRenderbufferStorageMultisampleEXT",
2925 SetGLError(GL_INVALID_VALUE
, "glRenderbufferStorageMultisampleEXT",
2930 SetGLError(GL_INVALID_VALUE
, "glRenderbufferStorageMultisampleEXT",
2934 helper_
->RenderbufferStorageMultisampleEXT(target
, samples
, internalformat
,
2939 void GLES2Implementation::FramebufferTexture2DMultisampleEXT(GLenum target
,
2945 GPU_CLIENT_SINGLE_THREAD_CHECK();
2946 GPU_CLIENT_LOG("[" << GetLogPrefix()
2947 << "] glFramebufferTexture2DMultisampleEXT("
2948 << GLES2Util::GetStringFrameBufferTarget(target
) << ", "
2949 << GLES2Util::GetStringAttachment(attachment
) << ", "
2950 << GLES2Util::GetStringTextureTarget(textarget
) << ", "
2951 << texture
<< ", " << level
<< ", " << samples
<< ")");
2953 SetGLError(GL_INVALID_VALUE
, "glFramebufferTexture2DMultisampleEXT",
2954 "level GL_INVALID_VALUE");
2958 SetGLError(GL_INVALID_VALUE
, "glFramebufferTexture2DMultisampleEXT",
2962 helper_
->FramebufferTexture2DMultisampleEXT(target
, attachment
, textarget
,
2967 void GLES2Implementation::TexStorage2DEXT(GLenum target
,
2969 GLenum internalFormat
,
2972 GPU_CLIENT_SINGLE_THREAD_CHECK();
2974 "[" << GetLogPrefix() << "] glTexStorage2DEXT("
2975 << GLES2Util::GetStringTextureBindTarget(target
) << ", " << levels
2977 << GLES2Util::GetStringTextureInternalFormatStorage(internalFormat
)
2978 << ", " << width
<< ", " << height
<< ")");
2980 SetGLError(GL_INVALID_VALUE
, "glTexStorage2DEXT", "levels < 0");
2984 SetGLError(GL_INVALID_VALUE
, "glTexStorage2DEXT", "width < 0");
2988 SetGLError(GL_INVALID_VALUE
, "glTexStorage2DEXT", "height < 0");
2991 helper_
->TexStorage2DEXT(target
, levels
, internalFormat
, width
, height
);
2995 void GLES2Implementation::GenQueriesEXT(GLsizei n
, GLuint
* queries
) {
2996 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glGenQueriesEXT(" << n
<< ", "
2997 << static_cast<const void*>(queries
) << ")");
2999 SetGLError(GL_INVALID_VALUE
, "glGenQueriesEXT", "n < 0");
3002 GPU_CLIENT_SINGLE_THREAD_CHECK();
3003 IdAllocator
* id_allocator
= GetIdAllocator(id_namespaces::kQueries
);
3004 for (GLsizei ii
= 0; ii
< n
; ++ii
)
3005 queries
[ii
] = id_allocator
->AllocateID();
3006 GenQueriesEXTHelper(n
, queries
);
3007 helper_
->GenQueriesEXTImmediate(n
, queries
);
3008 if (share_group_
->bind_generates_resource())
3009 helper_
->CommandBufferHelper::Flush();
3010 GPU_CLIENT_LOG_CODE_BLOCK({
3011 for (GLsizei i
= 0; i
< n
; ++i
) {
3012 GPU_CLIENT_LOG(" " << i
<< ": " << queries
[i
]);
3018 void GLES2Implementation::DeleteQueriesEXT(GLsizei n
, const GLuint
* queries
) {
3019 GPU_CLIENT_SINGLE_THREAD_CHECK();
3020 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glDeleteQueriesEXT(" << n
<< ", "
3021 << static_cast<const void*>(queries
) << ")");
3022 GPU_CLIENT_LOG_CODE_BLOCK({
3023 for (GLsizei i
= 0; i
< n
; ++i
) {
3024 GPU_CLIENT_LOG(" " << i
<< ": " << queries
[i
]);
3027 GPU_CLIENT_DCHECK_CODE_BLOCK({
3028 for (GLsizei i
= 0; i
< n
; ++i
) {
3029 DCHECK(queries
[i
] != 0);
3033 SetGLError(GL_INVALID_VALUE
, "glDeleteQueriesEXT", "n < 0");
3036 DeleteQueriesEXTHelper(n
, queries
);
3040 void GLES2Implementation::BeginTransformFeedback(GLenum primitivemode
) {
3041 GPU_CLIENT_SINGLE_THREAD_CHECK();
3043 "[" << GetLogPrefix() << "] glBeginTransformFeedback("
3044 << GLES2Util::GetStringTransformFeedbackPrimitiveMode(primitivemode
)
3046 helper_
->BeginTransformFeedback(primitivemode
);
3050 void GLES2Implementation::EndTransformFeedback() {
3051 GPU_CLIENT_SINGLE_THREAD_CHECK();
3052 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glEndTransformFeedback("
3054 helper_
->EndTransformFeedback();
3058 void GLES2Implementation::GenVertexArraysOES(GLsizei n
, GLuint
* arrays
) {
3059 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glGenVertexArraysOES(" << n
<< ", "
3060 << static_cast<const void*>(arrays
) << ")");
3062 SetGLError(GL_INVALID_VALUE
, "glGenVertexArraysOES", "n < 0");
3065 GPU_CLIENT_SINGLE_THREAD_CHECK();
3066 GetIdHandler(id_namespaces::kVertexArrays
)->MakeIds(this, 0, n
, arrays
);
3067 GenVertexArraysOESHelper(n
, arrays
);
3068 helper_
->GenVertexArraysOESImmediate(n
, arrays
);
3069 if (share_group_
->bind_generates_resource())
3070 helper_
->CommandBufferHelper::Flush();
3071 GPU_CLIENT_LOG_CODE_BLOCK({
3072 for (GLsizei i
= 0; i
< n
; ++i
) {
3073 GPU_CLIENT_LOG(" " << i
<< ": " << arrays
[i
]);
3079 void GLES2Implementation::DeleteVertexArraysOES(GLsizei n
,
3080 const GLuint
* arrays
) {
3081 GPU_CLIENT_SINGLE_THREAD_CHECK();
3082 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glDeleteVertexArraysOES(" << n
3083 << ", " << static_cast<const void*>(arrays
) << ")");
3084 GPU_CLIENT_LOG_CODE_BLOCK({
3085 for (GLsizei i
= 0; i
< n
; ++i
) {
3086 GPU_CLIENT_LOG(" " << i
<< ": " << arrays
[i
]);
3089 GPU_CLIENT_DCHECK_CODE_BLOCK({
3090 for (GLsizei i
= 0; i
< n
; ++i
) {
3091 DCHECK(arrays
[i
] != 0);
3095 SetGLError(GL_INVALID_VALUE
, "glDeleteVertexArraysOES", "n < 0");
3098 DeleteVertexArraysOESHelper(n
, arrays
);
3102 GLboolean
GLES2Implementation::IsVertexArrayOES(GLuint array
) {
3103 GPU_CLIENT_SINGLE_THREAD_CHECK();
3104 TRACE_EVENT0("gpu", "GLES2Implementation::IsVertexArrayOES");
3105 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glIsVertexArrayOES(" << array
3107 typedef cmds::IsVertexArrayOES::Result Result
;
3108 Result
* result
= GetResultAs
<Result
*>();
3113 helper_
->IsVertexArrayOES(array
, GetResultShmId(), GetResultShmOffset());
3115 GLboolean result_value
= *result
!= 0;
3116 GPU_CLIENT_LOG("returned " << result_value
);
3118 return result_value
;
3121 void GLES2Implementation::BindVertexArrayOES(GLuint array
) {
3122 GPU_CLIENT_SINGLE_THREAD_CHECK();
3123 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glBindVertexArrayOES(" << array
3125 if (IsVertexArrayReservedId(array
)) {
3126 SetGLError(GL_INVALID_OPERATION
, "BindVertexArrayOES", "array reserved id");
3129 BindVertexArrayOESHelper(array
);
3133 void GLES2Implementation::GetTranslatedShaderSourceANGLE(GLuint shader
,
3137 GPU_CLIENT_SINGLE_THREAD_CHECK();
3138 GPU_CLIENT_VALIDATE_DESTINATION_OPTIONAL_INITALIZATION(GLsizei
, length
);
3139 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glGetTranslatedShaderSourceANGLE"
3140 << "(" << shader
<< ", " << bufsize
<< ", "
3141 << static_cast<void*>(length
) << ", "
3142 << static_cast<void*>(source
) << ")");
3143 helper_
->SetBucketSize(kResultBucketId
, 0);
3144 helper_
->GetTranslatedShaderSourceANGLE(shader
, kResultBucketId
);
3146 GLsizei max_size
= 0;
3147 if (GetBucketAsString(kResultBucketId
, &str
)) {
3149 max_size
= std::min(static_cast<size_t>(bufsize
) - 1, str
.size());
3150 memcpy(source
, str
.c_str(), max_size
);
3151 source
[max_size
] = '\0';
3152 GPU_CLIENT_LOG("------\n" << source
<< "\n------");
3155 if (length
!= NULL
) {
3160 void GLES2Implementation::TexImageIOSurface2DCHROMIUM(GLenum target
,
3165 GPU_CLIENT_SINGLE_THREAD_CHECK();
3166 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glTexImageIOSurface2DCHROMIUM("
3167 << GLES2Util::GetStringTextureBindTarget(target
) << ", "
3168 << width
<< ", " << height
<< ", " << ioSurfaceId
<< ", "
3171 SetGLError(GL_INVALID_VALUE
, "glTexImageIOSurface2DCHROMIUM", "width < 0");
3175 SetGLError(GL_INVALID_VALUE
, "glTexImageIOSurface2DCHROMIUM", "height < 0");
3178 helper_
->TexImageIOSurface2DCHROMIUM(target
, width
, height
, ioSurfaceId
,
3183 void GLES2Implementation::CopyTextureCHROMIUM(
3187 GLint internalformat
,
3189 GLboolean unpack_flip_y
,
3190 GLboolean unpack_premultiply_alpha
,
3191 GLboolean unpack_unmultiply_alpha
) {
3192 GPU_CLIENT_SINGLE_THREAD_CHECK();
3194 "[" << GetLogPrefix() << "] glCopyTextureCHROMIUM("
3195 << GLES2Util::GetStringEnum(target
) << ", "
3196 << GLES2Util::GetStringEnum(source_id
) << ", "
3197 << GLES2Util::GetStringEnum(dest_id
) << ", " << internalformat
<< ", "
3198 << GLES2Util::GetStringPixelType(dest_type
) << ", "
3199 << GLES2Util::GetStringBool(unpack_flip_y
) << ", "
3200 << GLES2Util::GetStringBool(unpack_premultiply_alpha
) << ", "
3201 << GLES2Util::GetStringBool(unpack_unmultiply_alpha
) << ")");
3202 helper_
->CopyTextureCHROMIUM(
3203 target
, source_id
, dest_id
, internalformat
, dest_type
, unpack_flip_y
,
3204 unpack_premultiply_alpha
, unpack_unmultiply_alpha
);
3208 void GLES2Implementation::CopySubTextureCHROMIUM(
3218 GLboolean unpack_flip_y
,
3219 GLboolean unpack_premultiply_alpha
,
3220 GLboolean unpack_unmultiply_alpha
) {
3221 GPU_CLIENT_SINGLE_THREAD_CHECK();
3223 "[" << GetLogPrefix() << "] glCopySubTextureCHROMIUM("
3224 << GLES2Util::GetStringEnum(target
) << ", "
3225 << GLES2Util::GetStringEnum(source_id
) << ", "
3226 << GLES2Util::GetStringEnum(dest_id
) << ", " << xoffset
<< ", "
3227 << yoffset
<< ", " << x
<< ", " << y
<< ", " << width
<< ", "
3228 << height
<< ", " << GLES2Util::GetStringBool(unpack_flip_y
) << ", "
3229 << GLES2Util::GetStringBool(unpack_premultiply_alpha
) << ", "
3230 << GLES2Util::GetStringBool(unpack_unmultiply_alpha
) << ")");
3232 SetGLError(GL_INVALID_VALUE
, "glCopySubTextureCHROMIUM", "width < 0");
3236 SetGLError(GL_INVALID_VALUE
, "glCopySubTextureCHROMIUM", "height < 0");
3239 helper_
->CopySubTextureCHROMIUM(
3240 target
, source_id
, dest_id
, xoffset
, yoffset
, x
, y
, width
, height
,
3241 unpack_flip_y
, unpack_premultiply_alpha
, unpack_unmultiply_alpha
);
3245 void GLES2Implementation::CompressedCopyTextureCHROMIUM(GLenum target
,
3248 GPU_CLIENT_SINGLE_THREAD_CHECK();
3249 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glCompressedCopyTextureCHROMIUM("
3250 << GLES2Util::GetStringEnum(target
) << ", "
3251 << GLES2Util::GetStringEnum(source_id
) << ", "
3252 << GLES2Util::GetStringEnum(dest_id
) << ")");
3253 helper_
->CompressedCopyTextureCHROMIUM(target
, source_id
, dest_id
);
3257 void GLES2Implementation::GenValuebuffersCHROMIUM(GLsizei n
, GLuint
* buffers
) {
3258 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glGenValuebuffersCHROMIUM(" << n
3259 << ", " << static_cast<const void*>(buffers
) << ")");
3261 SetGLError(GL_INVALID_VALUE
, "glGenValuebuffersCHROMIUM", "n < 0");
3264 GPU_CLIENT_SINGLE_THREAD_CHECK();
3265 GetIdHandler(id_namespaces::kValuebuffers
)->MakeIds(this, 0, n
, buffers
);
3266 GenValuebuffersCHROMIUMHelper(n
, buffers
);
3267 helper_
->GenValuebuffersCHROMIUMImmediate(n
, buffers
);
3268 if (share_group_
->bind_generates_resource())
3269 helper_
->CommandBufferHelper::Flush();
3270 GPU_CLIENT_LOG_CODE_BLOCK({
3271 for (GLsizei i
= 0; i
< n
; ++i
) {
3272 GPU_CLIENT_LOG(" " << i
<< ": " << buffers
[i
]);
3278 void GLES2Implementation::DeleteValuebuffersCHROMIUM(
3280 const GLuint
* valuebuffers
) {
3281 GPU_CLIENT_SINGLE_THREAD_CHECK();
3282 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glDeleteValuebuffersCHROMIUM(" << n
3283 << ", " << static_cast<const void*>(valuebuffers
) << ")");
3284 GPU_CLIENT_LOG_CODE_BLOCK({
3285 for (GLsizei i
= 0; i
< n
; ++i
) {
3286 GPU_CLIENT_LOG(" " << i
<< ": " << valuebuffers
[i
]);
3289 GPU_CLIENT_DCHECK_CODE_BLOCK({
3290 for (GLsizei i
= 0; i
< n
; ++i
) {
3291 DCHECK(valuebuffers
[i
] != 0);
3295 SetGLError(GL_INVALID_VALUE
, "glDeleteValuebuffersCHROMIUM", "n < 0");
3298 DeleteValuebuffersCHROMIUMHelper(n
, valuebuffers
);
3302 GLboolean
GLES2Implementation::IsValuebufferCHROMIUM(GLuint valuebuffer
) {
3303 GPU_CLIENT_SINGLE_THREAD_CHECK();
3304 TRACE_EVENT0("gpu", "GLES2Implementation::IsValuebufferCHROMIUM");
3305 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glIsValuebufferCHROMIUM("
3306 << valuebuffer
<< ")");
3307 typedef cmds::IsValuebufferCHROMIUM::Result Result
;
3308 Result
* result
= GetResultAs
<Result
*>();
3313 helper_
->IsValuebufferCHROMIUM(valuebuffer
, GetResultShmId(),
3314 GetResultShmOffset());
3316 GLboolean result_value
= *result
!= 0;
3317 GPU_CLIENT_LOG("returned " << result_value
);
3319 return result_value
;
3322 void GLES2Implementation::BindValuebufferCHROMIUM(GLenum target
,
3323 GLuint valuebuffer
) {
3324 GPU_CLIENT_SINGLE_THREAD_CHECK();
3325 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glBindValuebufferCHROMIUM("
3326 << GLES2Util::GetStringValueBufferTarget(target
) << ", "
3327 << valuebuffer
<< ")");
3328 if (IsValuebufferReservedId(valuebuffer
)) {
3329 SetGLError(GL_INVALID_OPERATION
, "BindValuebufferCHROMIUM",
3330 "valuebuffer reserved id");
3333 BindValuebufferCHROMIUMHelper(target
, valuebuffer
);
3337 void GLES2Implementation::SubscribeValueCHROMIUM(GLenum target
,
3338 GLenum subscription
) {
3339 GPU_CLIENT_SINGLE_THREAD_CHECK();
3340 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glSubscribeValueCHROMIUM("
3341 << GLES2Util::GetStringValueBufferTarget(target
) << ", "
3342 << GLES2Util::GetStringSubscriptionTarget(subscription
)
3344 helper_
->SubscribeValueCHROMIUM(target
, subscription
);
3348 void GLES2Implementation::PopulateSubscribedValuesCHROMIUM(GLenum target
) {
3349 GPU_CLIENT_SINGLE_THREAD_CHECK();
3350 GPU_CLIENT_LOG("[" << GetLogPrefix()
3351 << "] glPopulateSubscribedValuesCHROMIUM("
3352 << GLES2Util::GetStringValueBufferTarget(target
) << ")");
3353 helper_
->PopulateSubscribedValuesCHROMIUM(target
);
3357 void GLES2Implementation::UniformValuebufferCHROMIUM(GLint location
,
3359 GLenum subscription
) {
3360 GPU_CLIENT_SINGLE_THREAD_CHECK();
3362 "[" << GetLogPrefix() << "] glUniformValuebufferCHROMIUM(" << location
3363 << ", " << GLES2Util::GetStringValueBufferTarget(target
) << ", "
3364 << GLES2Util::GetStringSubscriptionTarget(subscription
) << ")");
3365 helper_
->UniformValuebufferCHROMIUM(location
, target
, subscription
);
3369 void GLES2Implementation::BindTexImage2DCHROMIUM(GLenum target
, GLint imageId
) {
3370 GPU_CLIENT_SINGLE_THREAD_CHECK();
3371 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glBindTexImage2DCHROMIUM("
3372 << GLES2Util::GetStringTextureBindTarget(target
) << ", "
3374 helper_
->BindTexImage2DCHROMIUM(target
, imageId
);
3378 void GLES2Implementation::ReleaseTexImage2DCHROMIUM(GLenum target
,
3380 GPU_CLIENT_SINGLE_THREAD_CHECK();
3381 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glReleaseTexImage2DCHROMIUM("
3382 << GLES2Util::GetStringTextureBindTarget(target
) << ", "
3384 helper_
->ReleaseTexImage2DCHROMIUM(target
, imageId
);
3388 void GLES2Implementation::DiscardFramebufferEXT(GLenum target
,
3390 const GLenum
* attachments
) {
3391 GPU_CLIENT_SINGLE_THREAD_CHECK();
3392 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glDiscardFramebufferEXT("
3393 << GLES2Util::GetStringEnum(target
) << ", " << count
3394 << ", " << static_cast<const void*>(attachments
) << ")");
3395 GPU_CLIENT_LOG_CODE_BLOCK({
3396 for (GLsizei i
= 0; i
< count
; ++i
) {
3397 GPU_CLIENT_LOG(" " << i
<< ": " << attachments
[0 + i
* 1]);
3401 SetGLError(GL_INVALID_VALUE
, "glDiscardFramebufferEXT", "count < 0");
3404 helper_
->DiscardFramebufferEXTImmediate(target
, count
, attachments
);
3408 void GLES2Implementation::LoseContextCHROMIUM(GLenum current
, GLenum other
) {
3409 GPU_CLIENT_SINGLE_THREAD_CHECK();
3410 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glLoseContextCHROMIUM("
3411 << GLES2Util::GetStringResetStatus(current
) << ", "
3412 << GLES2Util::GetStringResetStatus(other
) << ")");
3413 helper_
->LoseContextCHROMIUM(current
, other
);
3417 void GLES2Implementation::WaitSyncPointCHROMIUM(GLuint sync_point
) {
3418 GPU_CLIENT_SINGLE_THREAD_CHECK();
3419 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glWaitSyncPointCHROMIUM("
3420 << sync_point
<< ")");
3421 helper_
->WaitSyncPointCHROMIUM(sync_point
);
3425 void GLES2Implementation::DrawBuffersEXT(GLsizei count
, const GLenum
* bufs
) {
3426 GPU_CLIENT_SINGLE_THREAD_CHECK();
3427 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glDrawBuffersEXT(" << count
<< ", "
3428 << static_cast<const void*>(bufs
) << ")");
3429 GPU_CLIENT_LOG_CODE_BLOCK({
3430 for (GLsizei i
= 0; i
< count
; ++i
) {
3431 GPU_CLIENT_LOG(" " << i
<< ": " << bufs
[0 + i
* 1]);
3435 SetGLError(GL_INVALID_VALUE
, "glDrawBuffersEXT", "count < 0");
3438 helper_
->DrawBuffersEXTImmediate(count
, bufs
);
3442 void GLES2Implementation::DiscardBackbufferCHROMIUM() {
3443 GPU_CLIENT_SINGLE_THREAD_CHECK();
3444 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glDiscardBackbufferCHROMIUM("
3446 helper_
->DiscardBackbufferCHROMIUM();
3450 void GLES2Implementation::ScheduleOverlayPlaneCHROMIUM(
3451 GLint plane_z_order
,
3452 GLenum plane_transform
,
3453 GLuint overlay_texture_id
,
3457 GLint bounds_height
,
3461 GLfloat uv_height
) {
3462 GPU_CLIENT_SINGLE_THREAD_CHECK();
3464 "[" << GetLogPrefix() << "] glScheduleOverlayPlaneCHROMIUM("
3465 << plane_z_order
<< ", " << GLES2Util::GetStringEnum(plane_transform
)
3466 << ", " << overlay_texture_id
<< ", " << bounds_x
<< ", " << bounds_y
3467 << ", " << bounds_width
<< ", " << bounds_height
<< ", " << uv_x
3468 << ", " << uv_y
<< ", " << uv_width
<< ", " << uv_height
<< ")");
3469 helper_
->ScheduleOverlayPlaneCHROMIUM(
3470 plane_z_order
, plane_transform
, overlay_texture_id
, bounds_x
, bounds_y
,
3471 bounds_width
, bounds_height
, uv_x
, uv_y
, uv_width
, uv_height
);
3475 void GLES2Implementation::FlushDriverCachesCHROMIUM() {
3476 GPU_CLIENT_SINGLE_THREAD_CHECK();
3477 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glFlushDriverCachesCHROMIUM("
3479 helper_
->FlushDriverCachesCHROMIUM();
3483 void GLES2Implementation::MatrixLoadfCHROMIUM(GLenum matrixMode
,
3485 GPU_CLIENT_SINGLE_THREAD_CHECK();
3486 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glMatrixLoadfCHROMIUM("
3487 << GLES2Util::GetStringMatrixMode(matrixMode
) << ", "
3488 << static_cast<const void*>(m
) << ")");
3490 for (size_t ii
= 0; ii
< count
; ++ii
)
3491 GPU_CLIENT_LOG("value[" << ii
<< "]: " << m
[ii
]);
3492 helper_
->MatrixLoadfCHROMIUMImmediate(matrixMode
, m
);
3496 void GLES2Implementation::MatrixLoadIdentityCHROMIUM(GLenum matrixMode
) {
3497 GPU_CLIENT_SINGLE_THREAD_CHECK();
3498 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glMatrixLoadIdentityCHROMIUM("
3499 << GLES2Util::GetStringMatrixMode(matrixMode
) << ")");
3500 helper_
->MatrixLoadIdentityCHROMIUM(matrixMode
);
3504 GLboolean
GLES2Implementation::IsPathCHROMIUM(GLuint path
) {
3505 GPU_CLIENT_SINGLE_THREAD_CHECK();
3506 TRACE_EVENT0("gpu", "GLES2Implementation::IsPathCHROMIUM");
3507 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glIsPathCHROMIUM(" << path
<< ")");
3508 typedef cmds::IsPathCHROMIUM::Result Result
;
3509 Result
* result
= GetResultAs
<Result
*>();
3514 helper_
->IsPathCHROMIUM(path
, GetResultShmId(), GetResultShmOffset());
3516 GLboolean result_value
= *result
!= 0;
3517 GPU_CLIENT_LOG("returned " << result_value
);
3519 return result_value
;
3522 void GLES2Implementation::PathParameterfCHROMIUM(GLuint path
,
3525 GPU_CLIENT_SINGLE_THREAD_CHECK();
3526 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glPathParameterfCHROMIUM(" << path
3527 << ", " << GLES2Util::GetStringPathParameter(pname
) << ", "
3529 helper_
->PathParameterfCHROMIUM(path
, pname
, value
);
3533 void GLES2Implementation::PathParameteriCHROMIUM(GLuint path
,
3536 GPU_CLIENT_SINGLE_THREAD_CHECK();
3537 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glPathParameteriCHROMIUM(" << path
3538 << ", " << GLES2Util::GetStringPathParameter(pname
) << ", "
3540 helper_
->PathParameteriCHROMIUM(path
, pname
, value
);
3544 void GLES2Implementation::PathStencilFuncCHROMIUM(GLenum func
,
3547 GPU_CLIENT_SINGLE_THREAD_CHECK();
3548 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glPathStencilFuncCHROMIUM("
3549 << GLES2Util::GetStringCmpFunction(func
) << ", " << ref
3550 << ", " << mask
<< ")");
3551 helper_
->PathStencilFuncCHROMIUM(func
, ref
, mask
);
3555 void GLES2Implementation::StencilFillPathCHROMIUM(GLuint path
,
3558 GPU_CLIENT_SINGLE_THREAD_CHECK();
3559 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glStencilFillPathCHROMIUM(" << path
3560 << ", " << GLES2Util::GetStringPathFillMode(fillMode
)
3561 << ", " << mask
<< ")");
3562 helper_
->StencilFillPathCHROMIUM(path
, fillMode
, mask
);
3566 void GLES2Implementation::StencilStrokePathCHROMIUM(GLuint path
,
3569 GPU_CLIENT_SINGLE_THREAD_CHECK();
3570 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glStencilStrokePathCHROMIUM("
3571 << path
<< ", " << reference
<< ", " << mask
<< ")");
3572 helper_
->StencilStrokePathCHROMIUM(path
, reference
, mask
);
3576 void GLES2Implementation::CoverFillPathCHROMIUM(GLuint path
, GLenum coverMode
) {
3577 GPU_CLIENT_SINGLE_THREAD_CHECK();
3578 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glCoverFillPathCHROMIUM(" << path
3579 << ", " << GLES2Util::GetStringPathCoverMode(coverMode
)
3581 helper_
->CoverFillPathCHROMIUM(path
, coverMode
);
3585 void GLES2Implementation::CoverStrokePathCHROMIUM(GLuint path
,
3587 GPU_CLIENT_SINGLE_THREAD_CHECK();
3588 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glCoverStrokePathCHROMIUM(" << path
3589 << ", " << GLES2Util::GetStringPathCoverMode(coverMode
)
3591 helper_
->CoverStrokePathCHROMIUM(path
, coverMode
);
3595 void GLES2Implementation::StencilThenCoverFillPathCHROMIUM(GLuint path
,
3599 GPU_CLIENT_SINGLE_THREAD_CHECK();
3601 "[" << GetLogPrefix() << "] glStencilThenCoverFillPathCHROMIUM(" << path
3602 << ", " << GLES2Util::GetStringPathFillMode(fillMode
) << ", " << mask
3603 << ", " << GLES2Util::GetStringPathCoverMode(coverMode
) << ")");
3604 helper_
->StencilThenCoverFillPathCHROMIUM(path
, fillMode
, mask
, coverMode
);
3608 void GLES2Implementation::StencilThenCoverStrokePathCHROMIUM(GLuint path
,
3612 GPU_CLIENT_SINGLE_THREAD_CHECK();
3613 GPU_CLIENT_LOG("[" << GetLogPrefix()
3614 << "] glStencilThenCoverStrokePathCHROMIUM(" << path
3615 << ", " << reference
<< ", " << mask
<< ", "
3616 << GLES2Util::GetStringPathCoverMode(coverMode
) << ")");
3617 helper_
->StencilThenCoverStrokePathCHROMIUM(path
, reference
, mask
, coverMode
);
3621 void GLES2Implementation::BlendBarrierKHR() {
3622 GPU_CLIENT_SINGLE_THREAD_CHECK();
3623 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glBlendBarrierKHR("
3625 helper_
->BlendBarrierKHR();
3629 #endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_IMPL_AUTOGEN_H_