OLD | NEW |
(Empty) | |
| 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. |
| 4 |
| 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 |
| 9 // DO NOT EDIT! |
| 10 |
| 11 // It is included by gles2_cmd_decoder_passthrough.cc |
| 12 #ifndef GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_PASSTHROUGH_HANDLERS_AUTOGE
N_H_ |
| 13 #define GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_PASSTHROUGH_HANDLERS_AUTOGE
N_H_ |
| 14 |
| 15 error::Error GLES2DecoderPassthroughImpl::HandleActiveTexture( |
| 16 uint32_t immediate_data_size, |
| 17 const void* cmd_data) { |
| 18 const gles2::cmds::ActiveTexture& c = |
| 19 *static_cast<const gles2::cmds::ActiveTexture*>(cmd_data); |
| 20 (void)c; |
| 21 GLenum texture = static_cast<GLenum>(c.texture); |
| 22 error::Error error = DoActiveTexture(texture); |
| 23 if (error != error::kNoError) { |
| 24 return error; |
| 25 } |
| 26 return error::kNoError; |
| 27 } |
| 28 |
| 29 error::Error GLES2DecoderPassthroughImpl::HandleAttachShader( |
| 30 uint32_t immediate_data_size, |
| 31 const void* cmd_data) { |
| 32 const gles2::cmds::AttachShader& c = |
| 33 *static_cast<const gles2::cmds::AttachShader*>(cmd_data); |
| 34 (void)c; |
| 35 GLuint program = c.program; |
| 36 GLuint shader = c.shader; |
| 37 error::Error error = DoAttachShader(program, shader); |
| 38 if (error != error::kNoError) { |
| 39 return error; |
| 40 } |
| 41 return error::kNoError; |
| 42 } |
| 43 |
| 44 error::Error GLES2DecoderPassthroughImpl::HandleBindBuffer( |
| 45 uint32_t immediate_data_size, |
| 46 const void* cmd_data) { |
| 47 const gles2::cmds::BindBuffer& c = |
| 48 *static_cast<const gles2::cmds::BindBuffer*>(cmd_data); |
| 49 (void)c; |
| 50 GLenum target = static_cast<GLenum>(c.target); |
| 51 GLuint buffer = c.buffer; |
| 52 error::Error error = DoBindBuffer(target, buffer); |
| 53 if (error != error::kNoError) { |
| 54 return error; |
| 55 } |
| 56 return error::kNoError; |
| 57 } |
| 58 |
| 59 error::Error GLES2DecoderPassthroughImpl::HandleBindBufferBase( |
| 60 uint32_t immediate_data_size, |
| 61 const void* cmd_data) { |
| 62 const gles2::cmds::BindBufferBase& c = |
| 63 *static_cast<const gles2::cmds::BindBufferBase*>(cmd_data); |
| 64 (void)c; |
| 65 GLenum target = static_cast<GLenum>(c.target); |
| 66 GLuint index = static_cast<GLuint>(c.index); |
| 67 GLuint buffer = c.buffer; |
| 68 error::Error error = DoBindBufferBase(target, index, buffer); |
| 69 if (error != error::kNoError) { |
| 70 return error; |
| 71 } |
| 72 return error::kNoError; |
| 73 } |
| 74 |
| 75 error::Error GLES2DecoderPassthroughImpl::HandleBindBufferRange( |
| 76 uint32_t immediate_data_size, |
| 77 const void* cmd_data) { |
| 78 const gles2::cmds::BindBufferRange& c = |
| 79 *static_cast<const gles2::cmds::BindBufferRange*>(cmd_data); |
| 80 (void)c; |
| 81 GLenum target = static_cast<GLenum>(c.target); |
| 82 GLuint index = static_cast<GLuint>(c.index); |
| 83 GLuint buffer = c.buffer; |
| 84 GLintptr offset = static_cast<GLintptr>(c.offset); |
| 85 GLsizeiptr size = static_cast<GLsizeiptr>(c.size); |
| 86 error::Error error = DoBindBufferRange(target, index, buffer, offset, size); |
| 87 if (error != error::kNoError) { |
| 88 return error; |
| 89 } |
| 90 return error::kNoError; |
| 91 } |
| 92 |
| 93 error::Error GLES2DecoderPassthroughImpl::HandleBindFramebuffer( |
| 94 uint32_t immediate_data_size, |
| 95 const void* cmd_data) { |
| 96 const gles2::cmds::BindFramebuffer& c = |
| 97 *static_cast<const gles2::cmds::BindFramebuffer*>(cmd_data); |
| 98 (void)c; |
| 99 GLenum target = static_cast<GLenum>(c.target); |
| 100 GLuint framebuffer = c.framebuffer; |
| 101 error::Error error = DoBindFramebuffer(target, framebuffer); |
| 102 if (error != error::kNoError) { |
| 103 return error; |
| 104 } |
| 105 return error::kNoError; |
| 106 } |
| 107 |
| 108 error::Error GLES2DecoderPassthroughImpl::HandleBindRenderbuffer( |
| 109 uint32_t immediate_data_size, |
| 110 const void* cmd_data) { |
| 111 const gles2::cmds::BindRenderbuffer& c = |
| 112 *static_cast<const gles2::cmds::BindRenderbuffer*>(cmd_data); |
| 113 (void)c; |
| 114 GLenum target = static_cast<GLenum>(c.target); |
| 115 GLuint renderbuffer = c.renderbuffer; |
| 116 error::Error error = DoBindRenderbuffer(target, renderbuffer); |
| 117 if (error != error::kNoError) { |
| 118 return error; |
| 119 } |
| 120 return error::kNoError; |
| 121 } |
| 122 |
| 123 error::Error GLES2DecoderPassthroughImpl::HandleBindSampler( |
| 124 uint32_t immediate_data_size, |
| 125 const void* cmd_data) { |
| 126 const gles2::cmds::BindSampler& c = |
| 127 *static_cast<const gles2::cmds::BindSampler*>(cmd_data); |
| 128 (void)c; |
| 129 GLuint unit = static_cast<GLuint>(c.unit); |
| 130 GLuint sampler = c.sampler; |
| 131 error::Error error = DoBindSampler(unit, sampler); |
| 132 if (error != error::kNoError) { |
| 133 return error; |
| 134 } |
| 135 return error::kNoError; |
| 136 } |
| 137 |
| 138 error::Error GLES2DecoderPassthroughImpl::HandleBindTexture( |
| 139 uint32_t immediate_data_size, |
| 140 const void* cmd_data) { |
| 141 const gles2::cmds::BindTexture& c = |
| 142 *static_cast<const gles2::cmds::BindTexture*>(cmd_data); |
| 143 (void)c; |
| 144 GLenum target = static_cast<GLenum>(c.target); |
| 145 GLuint texture = c.texture; |
| 146 error::Error error = DoBindTexture(target, texture); |
| 147 if (error != error::kNoError) { |
| 148 return error; |
| 149 } |
| 150 return error::kNoError; |
| 151 } |
| 152 |
| 153 error::Error GLES2DecoderPassthroughImpl::HandleBindTransformFeedback( |
| 154 uint32_t immediate_data_size, |
| 155 const void* cmd_data) { |
| 156 const gles2::cmds::BindTransformFeedback& c = |
| 157 *static_cast<const gles2::cmds::BindTransformFeedback*>(cmd_data); |
| 158 (void)c; |
| 159 GLenum target = static_cast<GLenum>(c.target); |
| 160 GLuint transformfeedback = c.transformfeedback; |
| 161 error::Error error = DoBindTransformFeedback(target, transformfeedback); |
| 162 if (error != error::kNoError) { |
| 163 return error; |
| 164 } |
| 165 return error::kNoError; |
| 166 } |
| 167 |
| 168 error::Error GLES2DecoderPassthroughImpl::HandleBlendColor( |
| 169 uint32_t immediate_data_size, |
| 170 const void* cmd_data) { |
| 171 const gles2::cmds::BlendColor& c = |
| 172 *static_cast<const gles2::cmds::BlendColor*>(cmd_data); |
| 173 (void)c; |
| 174 GLclampf red = static_cast<GLclampf>(c.red); |
| 175 GLclampf green = static_cast<GLclampf>(c.green); |
| 176 GLclampf blue = static_cast<GLclampf>(c.blue); |
| 177 GLclampf alpha = static_cast<GLclampf>(c.alpha); |
| 178 error::Error error = DoBlendColor(red, green, blue, alpha); |
| 179 if (error != error::kNoError) { |
| 180 return error; |
| 181 } |
| 182 return error::kNoError; |
| 183 } |
| 184 |
| 185 error::Error GLES2DecoderPassthroughImpl::HandleBlendEquation( |
| 186 uint32_t immediate_data_size, |
| 187 const void* cmd_data) { |
| 188 const gles2::cmds::BlendEquation& c = |
| 189 *static_cast<const gles2::cmds::BlendEquation*>(cmd_data); |
| 190 (void)c; |
| 191 GLenum mode = static_cast<GLenum>(c.mode); |
| 192 error::Error error = DoBlendEquation(mode); |
| 193 if (error != error::kNoError) { |
| 194 return error; |
| 195 } |
| 196 return error::kNoError; |
| 197 } |
| 198 |
| 199 error::Error GLES2DecoderPassthroughImpl::HandleBlendEquationSeparate( |
| 200 uint32_t immediate_data_size, |
| 201 const void* cmd_data) { |
| 202 const gles2::cmds::BlendEquationSeparate& c = |
| 203 *static_cast<const gles2::cmds::BlendEquationSeparate*>(cmd_data); |
| 204 (void)c; |
| 205 GLenum modeRGB = static_cast<GLenum>(c.modeRGB); |
| 206 GLenum modeAlpha = static_cast<GLenum>(c.modeAlpha); |
| 207 error::Error error = DoBlendEquationSeparate(modeRGB, modeAlpha); |
| 208 if (error != error::kNoError) { |
| 209 return error; |
| 210 } |
| 211 return error::kNoError; |
| 212 } |
| 213 |
| 214 error::Error GLES2DecoderPassthroughImpl::HandleBlendFunc( |
| 215 uint32_t immediate_data_size, |
| 216 const void* cmd_data) { |
| 217 const gles2::cmds::BlendFunc& c = |
| 218 *static_cast<const gles2::cmds::BlendFunc*>(cmd_data); |
| 219 (void)c; |
| 220 GLenum sfactor = static_cast<GLenum>(c.sfactor); |
| 221 GLenum dfactor = static_cast<GLenum>(c.dfactor); |
| 222 error::Error error = DoBlendFunc(sfactor, dfactor); |
| 223 if (error != error::kNoError) { |
| 224 return error; |
| 225 } |
| 226 return error::kNoError; |
| 227 } |
| 228 |
| 229 error::Error GLES2DecoderPassthroughImpl::HandleBlendFuncSeparate( |
| 230 uint32_t immediate_data_size, |
| 231 const void* cmd_data) { |
| 232 const gles2::cmds::BlendFuncSeparate& c = |
| 233 *static_cast<const gles2::cmds::BlendFuncSeparate*>(cmd_data); |
| 234 (void)c; |
| 235 GLenum srcRGB = static_cast<GLenum>(c.srcRGB); |
| 236 GLenum dstRGB = static_cast<GLenum>(c.dstRGB); |
| 237 GLenum srcAlpha = static_cast<GLenum>(c.srcAlpha); |
| 238 GLenum dstAlpha = static_cast<GLenum>(c.dstAlpha); |
| 239 error::Error error = DoBlendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha); |
| 240 if (error != error::kNoError) { |
| 241 return error; |
| 242 } |
| 243 return error::kNoError; |
| 244 } |
| 245 |
| 246 error::Error GLES2DecoderPassthroughImpl::HandleBufferSubData( |
| 247 uint32_t immediate_data_size, |
| 248 const void* cmd_data) { |
| 249 const gles2::cmds::BufferSubData& c = |
| 250 *static_cast<const gles2::cmds::BufferSubData*>(cmd_data); |
| 251 (void)c; |
| 252 GLenum target = static_cast<GLenum>(c.target); |
| 253 GLintptr offset = static_cast<GLintptr>(c.offset); |
| 254 GLsizeiptr size = static_cast<GLsizeiptr>(c.size); |
| 255 uint32_t data_size = size; |
| 256 const void* data = GetSharedMemoryAs<const void*>( |
| 257 c.data_shm_id, c.data_shm_offset, data_size); |
| 258 error::Error error = DoBufferSubData(target, offset, size, data); |
| 259 if (error != error::kNoError) { |
| 260 return error; |
| 261 } |
| 262 return error::kNoError; |
| 263 } |
| 264 |
| 265 error::Error GLES2DecoderPassthroughImpl::HandleCheckFramebufferStatus( |
| 266 uint32_t immediate_data_size, |
| 267 const void* cmd_data) { |
| 268 const gles2::cmds::CheckFramebufferStatus& c = |
| 269 *static_cast<const gles2::cmds::CheckFramebufferStatus*>(cmd_data); |
| 270 (void)c; |
| 271 GLenum target = static_cast<GLenum>(c.target); |
| 272 typedef cmds::CheckFramebufferStatus::Result Result; |
| 273 Result* result = GetSharedMemoryAs<Result*>( |
| 274 c.result_shm_id, c.result_shm_offset, sizeof(*result)); |
| 275 if (!result) { |
| 276 return error::kOutOfBounds; |
| 277 } |
| 278 error::Error error = DoCheckFramebufferStatus(target, result); |
| 279 if (error != error::kNoError) { |
| 280 return error; |
| 281 } |
| 282 return error::kNoError; |
| 283 } |
| 284 |
| 285 error::Error GLES2DecoderPassthroughImpl::HandleClear( |
| 286 uint32_t immediate_data_size, |
| 287 const void* cmd_data) { |
| 288 const gles2::cmds::Clear& c = |
| 289 *static_cast<const gles2::cmds::Clear*>(cmd_data); |
| 290 (void)c; |
| 291 GLbitfield mask = static_cast<GLbitfield>(c.mask); |
| 292 error::Error error = DoClear(mask); |
| 293 if (error != error::kNoError) { |
| 294 return error; |
| 295 } |
| 296 return error::kNoError; |
| 297 } |
| 298 |
| 299 error::Error GLES2DecoderPassthroughImpl::HandleClearBufferfi( |
| 300 uint32_t immediate_data_size, |
| 301 const void* cmd_data) { |
| 302 const gles2::cmds::ClearBufferfi& c = |
| 303 *static_cast<const gles2::cmds::ClearBufferfi*>(cmd_data); |
| 304 (void)c; |
| 305 GLenum buffer = static_cast<GLenum>(c.buffer); |
| 306 GLint drawbuffers = static_cast<GLint>(c.drawbuffers); |
| 307 GLfloat depth = static_cast<GLfloat>(c.depth); |
| 308 GLint stencil = static_cast<GLint>(c.stencil); |
| 309 error::Error error = DoClearBufferfi(buffer, drawbuffers, depth, stencil); |
| 310 if (error != error::kNoError) { |
| 311 return error; |
| 312 } |
| 313 return error::kNoError; |
| 314 } |
| 315 |
| 316 error::Error GLES2DecoderPassthroughImpl::HandleClearBufferfvImmediate( |
| 317 uint32_t immediate_data_size, |
| 318 const void* cmd_data) { |
| 319 const gles2::cmds::ClearBufferfvImmediate& c = |
| 320 *static_cast<const gles2::cmds::ClearBufferfvImmediate*>(cmd_data); |
| 321 (void)c; |
| 322 GLenum buffer = static_cast<GLenum>(c.buffer); |
| 323 GLint drawbuffers = static_cast<GLint>(c.drawbuffers); |
| 324 uint32_t data_size; |
| 325 if (!GLES2Util::ComputeDataSize(1, sizeof(GLfloat), 4, &data_size)) { |
| 326 return error::kOutOfBounds; |
| 327 } |
| 328 if (data_size > immediate_data_size) { |
| 329 return error::kOutOfBounds; |
| 330 } |
| 331 const GLfloat* value = |
| 332 GetImmediateDataAs<const GLfloat*>(c, data_size, immediate_data_size); |
| 333 error::Error error = DoClearBufferfv(buffer, drawbuffers, value); |
| 334 if (error != error::kNoError) { |
| 335 return error; |
| 336 } |
| 337 return error::kNoError; |
| 338 } |
| 339 |
| 340 error::Error GLES2DecoderPassthroughImpl::HandleClearBufferivImmediate( |
| 341 uint32_t immediate_data_size, |
| 342 const void* cmd_data) { |
| 343 const gles2::cmds::ClearBufferivImmediate& c = |
| 344 *static_cast<const gles2::cmds::ClearBufferivImmediate*>(cmd_data); |
| 345 (void)c; |
| 346 GLenum buffer = static_cast<GLenum>(c.buffer); |
| 347 GLint drawbuffers = static_cast<GLint>(c.drawbuffers); |
| 348 uint32_t data_size; |
| 349 if (!GLES2Util::ComputeDataSize(1, sizeof(GLint), 4, &data_size)) { |
| 350 return error::kOutOfBounds; |
| 351 } |
| 352 if (data_size > immediate_data_size) { |
| 353 return error::kOutOfBounds; |
| 354 } |
| 355 const GLint* value = |
| 356 GetImmediateDataAs<const GLint*>(c, data_size, immediate_data_size); |
| 357 error::Error error = DoClearBufferiv(buffer, drawbuffers, value); |
| 358 if (error != error::kNoError) { |
| 359 return error; |
| 360 } |
| 361 return error::kNoError; |
| 362 } |
| 363 |
| 364 error::Error GLES2DecoderPassthroughImpl::HandleClearBufferuivImmediate( |
| 365 uint32_t immediate_data_size, |
| 366 const void* cmd_data) { |
| 367 const gles2::cmds::ClearBufferuivImmediate& c = |
| 368 *static_cast<const gles2::cmds::ClearBufferuivImmediate*>(cmd_data); |
| 369 (void)c; |
| 370 GLenum buffer = static_cast<GLenum>(c.buffer); |
| 371 GLint drawbuffers = static_cast<GLint>(c.drawbuffers); |
| 372 uint32_t data_size; |
| 373 if (!GLES2Util::ComputeDataSize(1, sizeof(GLuint), 4, &data_size)) { |
| 374 return error::kOutOfBounds; |
| 375 } |
| 376 if (data_size > immediate_data_size) { |
| 377 return error::kOutOfBounds; |
| 378 } |
| 379 const GLuint* value = |
| 380 GetImmediateDataAs<const GLuint*>(c, data_size, immediate_data_size); |
| 381 error::Error error = DoClearBufferuiv(buffer, drawbuffers, value); |
| 382 if (error != error::kNoError) { |
| 383 return error; |
| 384 } |
| 385 return error::kNoError; |
| 386 } |
| 387 |
| 388 error::Error GLES2DecoderPassthroughImpl::HandleClearColor( |
| 389 uint32_t immediate_data_size, |
| 390 const void* cmd_data) { |
| 391 const gles2::cmds::ClearColor& c = |
| 392 *static_cast<const gles2::cmds::ClearColor*>(cmd_data); |
| 393 (void)c; |
| 394 GLclampf red = static_cast<GLclampf>(c.red); |
| 395 GLclampf green = static_cast<GLclampf>(c.green); |
| 396 GLclampf blue = static_cast<GLclampf>(c.blue); |
| 397 GLclampf alpha = static_cast<GLclampf>(c.alpha); |
| 398 error::Error error = DoClearColor(red, green, blue, alpha); |
| 399 if (error != error::kNoError) { |
| 400 return error; |
| 401 } |
| 402 return error::kNoError; |
| 403 } |
| 404 |
| 405 error::Error GLES2DecoderPassthroughImpl::HandleClearDepthf( |
| 406 uint32_t immediate_data_size, |
| 407 const void* cmd_data) { |
| 408 const gles2::cmds::ClearDepthf& c = |
| 409 *static_cast<const gles2::cmds::ClearDepthf*>(cmd_data); |
| 410 (void)c; |
| 411 GLclampf depth = static_cast<GLclampf>(c.depth); |
| 412 error::Error error = DoClearDepthf(depth); |
| 413 if (error != error::kNoError) { |
| 414 return error; |
| 415 } |
| 416 return error::kNoError; |
| 417 } |
| 418 |
| 419 error::Error GLES2DecoderPassthroughImpl::HandleClearStencil( |
| 420 uint32_t immediate_data_size, |
| 421 const void* cmd_data) { |
| 422 const gles2::cmds::ClearStencil& c = |
| 423 *static_cast<const gles2::cmds::ClearStencil*>(cmd_data); |
| 424 (void)c; |
| 425 GLint s = static_cast<GLint>(c.s); |
| 426 error::Error error = DoClearStencil(s); |
| 427 if (error != error::kNoError) { |
| 428 return error; |
| 429 } |
| 430 return error::kNoError; |
| 431 } |
| 432 |
| 433 error::Error GLES2DecoderPassthroughImpl::HandleColorMask( |
| 434 uint32_t immediate_data_size, |
| 435 const void* cmd_data) { |
| 436 const gles2::cmds::ColorMask& c = |
| 437 *static_cast<const gles2::cmds::ColorMask*>(cmd_data); |
| 438 (void)c; |
| 439 GLboolean red = static_cast<GLboolean>(c.red); |
| 440 GLboolean green = static_cast<GLboolean>(c.green); |
| 441 GLboolean blue = static_cast<GLboolean>(c.blue); |
| 442 GLboolean alpha = static_cast<GLboolean>(c.alpha); |
| 443 error::Error error = DoColorMask(red, green, blue, alpha); |
| 444 if (error != error::kNoError) { |
| 445 return error; |
| 446 } |
| 447 return error::kNoError; |
| 448 } |
| 449 |
| 450 error::Error GLES2DecoderPassthroughImpl::HandleCompileShader( |
| 451 uint32_t immediate_data_size, |
| 452 const void* cmd_data) { |
| 453 const gles2::cmds::CompileShader& c = |
| 454 *static_cast<const gles2::cmds::CompileShader*>(cmd_data); |
| 455 (void)c; |
| 456 GLuint shader = c.shader; |
| 457 error::Error error = DoCompileShader(shader); |
| 458 if (error != error::kNoError) { |
| 459 return error; |
| 460 } |
| 461 return error::kNoError; |
| 462 } |
| 463 |
| 464 error::Error GLES2DecoderPassthroughImpl::HandleCompressedTexSubImage2D( |
| 465 uint32_t immediate_data_size, |
| 466 const void* cmd_data) { |
| 467 const gles2::cmds::CompressedTexSubImage2D& c = |
| 468 *static_cast<const gles2::cmds::CompressedTexSubImage2D*>(cmd_data); |
| 469 (void)c; |
| 470 GLenum target = static_cast<GLenum>(c.target); |
| 471 GLint level = static_cast<GLint>(c.level); |
| 472 GLint xoffset = static_cast<GLint>(c.xoffset); |
| 473 GLint yoffset = static_cast<GLint>(c.yoffset); |
| 474 GLsizei width = static_cast<GLsizei>(c.width); |
| 475 GLsizei height = static_cast<GLsizei>(c.height); |
| 476 GLenum format = static_cast<GLenum>(c.format); |
| 477 GLsizei imageSize = static_cast<GLsizei>(c.imageSize); |
| 478 uint32_t data_size = imageSize; |
| 479 const void* data = GetSharedMemoryAs<const void*>( |
| 480 c.data_shm_id, c.data_shm_offset, data_size); |
| 481 error::Error error = DoCompressedTexSubImage2D( |
| 482 target, level, xoffset, yoffset, width, height, format, imageSize, data); |
| 483 if (error != error::kNoError) { |
| 484 return error; |
| 485 } |
| 486 return error::kNoError; |
| 487 } |
| 488 |
| 489 error::Error GLES2DecoderPassthroughImpl::HandleCompressedTexSubImage3D( |
| 490 uint32_t immediate_data_size, |
| 491 const void* cmd_data) { |
| 492 const gles2::cmds::CompressedTexSubImage3D& c = |
| 493 *static_cast<const gles2::cmds::CompressedTexSubImage3D*>(cmd_data); |
| 494 (void)c; |
| 495 GLenum target = static_cast<GLenum>(c.target); |
| 496 GLint level = static_cast<GLint>(c.level); |
| 497 GLint xoffset = static_cast<GLint>(c.xoffset); |
| 498 GLint yoffset = static_cast<GLint>(c.yoffset); |
| 499 GLint zoffset = static_cast<GLint>(c.zoffset); |
| 500 GLsizei width = static_cast<GLsizei>(c.width); |
| 501 GLsizei height = static_cast<GLsizei>(c.height); |
| 502 GLsizei depth = static_cast<GLsizei>(c.depth); |
| 503 GLenum format = static_cast<GLenum>(c.format); |
| 504 GLsizei imageSize = static_cast<GLsizei>(c.imageSize); |
| 505 uint32_t data_size = imageSize; |
| 506 const void* data = GetSharedMemoryAs<const void*>( |
| 507 c.data_shm_id, c.data_shm_offset, data_size); |
| 508 error::Error error = |
| 509 DoCompressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, |
| 510 height, depth, format, imageSize, data); |
| 511 if (error != error::kNoError) { |
| 512 return error; |
| 513 } |
| 514 return error::kNoError; |
| 515 } |
| 516 |
| 517 error::Error GLES2DecoderPassthroughImpl::HandleCopyBufferSubData( |
| 518 uint32_t immediate_data_size, |
| 519 const void* cmd_data) { |
| 520 const gles2::cmds::CopyBufferSubData& c = |
| 521 *static_cast<const gles2::cmds::CopyBufferSubData*>(cmd_data); |
| 522 (void)c; |
| 523 GLenum readtarget = static_cast<GLenum>(c.readtarget); |
| 524 GLenum writetarget = static_cast<GLenum>(c.writetarget); |
| 525 GLintptr readoffset = static_cast<GLintptr>(c.readoffset); |
| 526 GLintptr writeoffset = static_cast<GLintptr>(c.writeoffset); |
| 527 GLsizeiptr size = static_cast<GLsizeiptr>(c.size); |
| 528 error::Error error = DoCopyBufferSubData(readtarget, writetarget, readoffset, |
| 529 writeoffset, size); |
| 530 if (error != error::kNoError) { |
| 531 return error; |
| 532 } |
| 533 return error::kNoError; |
| 534 } |
| 535 |
| 536 error::Error GLES2DecoderPassthroughImpl::HandleCopyTexImage2D( |
| 537 uint32_t immediate_data_size, |
| 538 const void* cmd_data) { |
| 539 const gles2::cmds::CopyTexImage2D& c = |
| 540 *static_cast<const gles2::cmds::CopyTexImage2D*>(cmd_data); |
| 541 (void)c; |
| 542 GLenum target = static_cast<GLenum>(c.target); |
| 543 GLint level = static_cast<GLint>(c.level); |
| 544 GLenum internalformat = static_cast<GLenum>(c.internalformat); |
| 545 GLint x = static_cast<GLint>(c.x); |
| 546 GLint y = static_cast<GLint>(c.y); |
| 547 GLsizei width = static_cast<GLsizei>(c.width); |
| 548 GLsizei height = static_cast<GLsizei>(c.height); |
| 549 GLint border = static_cast<GLint>(c.border); |
| 550 error::Error error = DoCopyTexImage2D(target, level, internalformat, x, y, |
| 551 width, height, border); |
| 552 if (error != error::kNoError) { |
| 553 return error; |
| 554 } |
| 555 return error::kNoError; |
| 556 } |
| 557 |
| 558 error::Error GLES2DecoderPassthroughImpl::HandleCopyTexSubImage2D( |
| 559 uint32_t immediate_data_size, |
| 560 const void* cmd_data) { |
| 561 const gles2::cmds::CopyTexSubImage2D& c = |
| 562 *static_cast<const gles2::cmds::CopyTexSubImage2D*>(cmd_data); |
| 563 (void)c; |
| 564 GLenum target = static_cast<GLenum>(c.target); |
| 565 GLint level = static_cast<GLint>(c.level); |
| 566 GLint xoffset = static_cast<GLint>(c.xoffset); |
| 567 GLint yoffset = static_cast<GLint>(c.yoffset); |
| 568 GLint x = static_cast<GLint>(c.x); |
| 569 GLint y = static_cast<GLint>(c.y); |
| 570 GLsizei width = static_cast<GLsizei>(c.width); |
| 571 GLsizei height = static_cast<GLsizei>(c.height); |
| 572 error::Error error = |
| 573 DoCopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height); |
| 574 if (error != error::kNoError) { |
| 575 return error; |
| 576 } |
| 577 return error::kNoError; |
| 578 } |
| 579 |
| 580 error::Error GLES2DecoderPassthroughImpl::HandleCopyTexSubImage3D( |
| 581 uint32_t immediate_data_size, |
| 582 const void* cmd_data) { |
| 583 const gles2::cmds::CopyTexSubImage3D& c = |
| 584 *static_cast<const gles2::cmds::CopyTexSubImage3D*>(cmd_data); |
| 585 (void)c; |
| 586 GLenum target = static_cast<GLenum>(c.target); |
| 587 GLint level = static_cast<GLint>(c.level); |
| 588 GLint xoffset = static_cast<GLint>(c.xoffset); |
| 589 GLint yoffset = static_cast<GLint>(c.yoffset); |
| 590 GLint zoffset = static_cast<GLint>(c.zoffset); |
| 591 GLint x = static_cast<GLint>(c.x); |
| 592 GLint y = static_cast<GLint>(c.y); |
| 593 GLsizei width = static_cast<GLsizei>(c.width); |
| 594 GLsizei height = static_cast<GLsizei>(c.height); |
| 595 error::Error error = DoCopyTexSubImage3D(target, level, xoffset, yoffset, |
| 596 zoffset, x, y, width, height); |
| 597 if (error != error::kNoError) { |
| 598 return error; |
| 599 } |
| 600 return error::kNoError; |
| 601 } |
| 602 |
| 603 error::Error GLES2DecoderPassthroughImpl::HandleCullFace( |
| 604 uint32_t immediate_data_size, |
| 605 const void* cmd_data) { |
| 606 const gles2::cmds::CullFace& c = |
| 607 *static_cast<const gles2::cmds::CullFace*>(cmd_data); |
| 608 (void)c; |
| 609 GLenum mode = static_cast<GLenum>(c.mode); |
| 610 error::Error error = DoCullFace(mode); |
| 611 if (error != error::kNoError) { |
| 612 return error; |
| 613 } |
| 614 return error::kNoError; |
| 615 } |
| 616 |
| 617 error::Error GLES2DecoderPassthroughImpl::HandleDeleteBuffersImmediate( |
| 618 uint32_t immediate_data_size, |
| 619 const void* cmd_data) { |
| 620 const gles2::cmds::DeleteBuffersImmediate& c = |
| 621 *static_cast<const gles2::cmds::DeleteBuffersImmediate*>(cmd_data); |
| 622 (void)c; |
| 623 GLsizei n = static_cast<GLsizei>(c.n); |
| 624 uint32_t data_size; |
| 625 if (!SafeMultiplyUint32(n, sizeof(GLuint), &data_size)) { |
| 626 return error::kOutOfBounds; |
| 627 } |
| 628 const GLuint* buffers = |
| 629 GetImmediateDataAs<const GLuint*>(c, data_size, immediate_data_size); |
| 630 error::Error error = DoDeleteBuffers(n, buffers); |
| 631 if (error != error::kNoError) { |
| 632 return error; |
| 633 } |
| 634 return error::kNoError; |
| 635 } |
| 636 |
| 637 error::Error GLES2DecoderPassthroughImpl::HandleDeleteFramebuffersImmediate( |
| 638 uint32_t immediate_data_size, |
| 639 const void* cmd_data) { |
| 640 const gles2::cmds::DeleteFramebuffersImmediate& c = |
| 641 *static_cast<const gles2::cmds::DeleteFramebuffersImmediate*>(cmd_data); |
| 642 (void)c; |
| 643 GLsizei n = static_cast<GLsizei>(c.n); |
| 644 uint32_t data_size; |
| 645 if (!SafeMultiplyUint32(n, sizeof(GLuint), &data_size)) { |
| 646 return error::kOutOfBounds; |
| 647 } |
| 648 const GLuint* framebuffers = |
| 649 GetImmediateDataAs<const GLuint*>(c, data_size, immediate_data_size); |
| 650 error::Error error = DoDeleteFramebuffers(n, framebuffers); |
| 651 if (error != error::kNoError) { |
| 652 return error; |
| 653 } |
| 654 return error::kNoError; |
| 655 } |
| 656 |
| 657 error::Error GLES2DecoderPassthroughImpl::HandleDeleteProgram( |
| 658 uint32_t immediate_data_size, |
| 659 const void* cmd_data) { |
| 660 const gles2::cmds::DeleteProgram& c = |
| 661 *static_cast<const gles2::cmds::DeleteProgram*>(cmd_data); |
| 662 (void)c; |
| 663 GLuint program = c.program; |
| 664 error::Error error = DoDeleteProgram(program); |
| 665 if (error != error::kNoError) { |
| 666 return error; |
| 667 } |
| 668 return error::kNoError; |
| 669 } |
| 670 |
| 671 error::Error GLES2DecoderPassthroughImpl::HandleDeleteRenderbuffersImmediate( |
| 672 uint32_t immediate_data_size, |
| 673 const void* cmd_data) { |
| 674 const gles2::cmds::DeleteRenderbuffersImmediate& c = |
| 675 *static_cast<const gles2::cmds::DeleteRenderbuffersImmediate*>(cmd_data); |
| 676 (void)c; |
| 677 GLsizei n = static_cast<GLsizei>(c.n); |
| 678 uint32_t data_size; |
| 679 if (!SafeMultiplyUint32(n, sizeof(GLuint), &data_size)) { |
| 680 return error::kOutOfBounds; |
| 681 } |
| 682 const GLuint* renderbuffers = |
| 683 GetImmediateDataAs<const GLuint*>(c, data_size, immediate_data_size); |
| 684 error::Error error = DoDeleteRenderbuffers(n, renderbuffers); |
| 685 if (error != error::kNoError) { |
| 686 return error; |
| 687 } |
| 688 return error::kNoError; |
| 689 } |
| 690 |
| 691 error::Error GLES2DecoderPassthroughImpl::HandleDeleteSamplersImmediate( |
| 692 uint32_t immediate_data_size, |
| 693 const void* cmd_data) { |
| 694 const gles2::cmds::DeleteSamplersImmediate& c = |
| 695 *static_cast<const gles2::cmds::DeleteSamplersImmediate*>(cmd_data); |
| 696 (void)c; |
| 697 GLsizei n = static_cast<GLsizei>(c.n); |
| 698 uint32_t data_size; |
| 699 if (!SafeMultiplyUint32(n, sizeof(GLuint), &data_size)) { |
| 700 return error::kOutOfBounds; |
| 701 } |
| 702 const GLuint* samplers = |
| 703 GetImmediateDataAs<const GLuint*>(c, data_size, immediate_data_size); |
| 704 error::Error error = DoDeleteSamplers(n, samplers); |
| 705 if (error != error::kNoError) { |
| 706 return error; |
| 707 } |
| 708 return error::kNoError; |
| 709 } |
| 710 |
| 711 error::Error GLES2DecoderPassthroughImpl::HandleDeleteSync( |
| 712 uint32_t immediate_data_size, |
| 713 const void* cmd_data) { |
| 714 const gles2::cmds::DeleteSync& c = |
| 715 *static_cast<const gles2::cmds::DeleteSync*>(cmd_data); |
| 716 (void)c; |
| 717 GLuint sync = c.sync; |
| 718 error::Error error = DoDeleteSync(sync); |
| 719 if (error != error::kNoError) { |
| 720 return error; |
| 721 } |
| 722 return error::kNoError; |
| 723 } |
| 724 |
| 725 error::Error GLES2DecoderPassthroughImpl::HandleDeleteShader( |
| 726 uint32_t immediate_data_size, |
| 727 const void* cmd_data) { |
| 728 const gles2::cmds::DeleteShader& c = |
| 729 *static_cast<const gles2::cmds::DeleteShader*>(cmd_data); |
| 730 (void)c; |
| 731 GLuint shader = c.shader; |
| 732 error::Error error = DoDeleteShader(shader); |
| 733 if (error != error::kNoError) { |
| 734 return error; |
| 735 } |
| 736 return error::kNoError; |
| 737 } |
| 738 |
| 739 error::Error GLES2DecoderPassthroughImpl::HandleDeleteTexturesImmediate( |
| 740 uint32_t immediate_data_size, |
| 741 const void* cmd_data) { |
| 742 const gles2::cmds::DeleteTexturesImmediate& c = |
| 743 *static_cast<const gles2::cmds::DeleteTexturesImmediate*>(cmd_data); |
| 744 (void)c; |
| 745 GLsizei n = static_cast<GLsizei>(c.n); |
| 746 uint32_t data_size; |
| 747 if (!SafeMultiplyUint32(n, sizeof(GLuint), &data_size)) { |
| 748 return error::kOutOfBounds; |
| 749 } |
| 750 const GLuint* textures = |
| 751 GetImmediateDataAs<const GLuint*>(c, data_size, immediate_data_size); |
| 752 error::Error error = DoDeleteTextures(n, textures); |
| 753 if (error != error::kNoError) { |
| 754 return error; |
| 755 } |
| 756 return error::kNoError; |
| 757 } |
| 758 |
| 759 error::Error |
| 760 GLES2DecoderPassthroughImpl::HandleDeleteTransformFeedbacksImmediate( |
| 761 uint32_t immediate_data_size, |
| 762 const void* cmd_data) { |
| 763 const gles2::cmds::DeleteTransformFeedbacksImmediate& c = |
| 764 *static_cast<const gles2::cmds::DeleteTransformFeedbacksImmediate*>( |
| 765 cmd_data); |
| 766 (void)c; |
| 767 GLsizei n = static_cast<GLsizei>(c.n); |
| 768 uint32_t data_size; |
| 769 if (!SafeMultiplyUint32(n, sizeof(GLuint), &data_size)) { |
| 770 return error::kOutOfBounds; |
| 771 } |
| 772 const GLuint* ids = |
| 773 GetImmediateDataAs<const GLuint*>(c, data_size, immediate_data_size); |
| 774 error::Error error = DoDeleteTransformFeedbacks(n, ids); |
| 775 if (error != error::kNoError) { |
| 776 return error; |
| 777 } |
| 778 return error::kNoError; |
| 779 } |
| 780 |
| 781 error::Error GLES2DecoderPassthroughImpl::HandleDepthFunc( |
| 782 uint32_t immediate_data_size, |
| 783 const void* cmd_data) { |
| 784 const gles2::cmds::DepthFunc& c = |
| 785 *static_cast<const gles2::cmds::DepthFunc*>(cmd_data); |
| 786 (void)c; |
| 787 GLenum func = static_cast<GLenum>(c.func); |
| 788 error::Error error = DoDepthFunc(func); |
| 789 if (error != error::kNoError) { |
| 790 return error; |
| 791 } |
| 792 return error::kNoError; |
| 793 } |
| 794 |
| 795 error::Error GLES2DecoderPassthroughImpl::HandleDepthMask( |
| 796 uint32_t immediate_data_size, |
| 797 const void* cmd_data) { |
| 798 const gles2::cmds::DepthMask& c = |
| 799 *static_cast<const gles2::cmds::DepthMask*>(cmd_data); |
| 800 (void)c; |
| 801 GLboolean flag = static_cast<GLboolean>(c.flag); |
| 802 error::Error error = DoDepthMask(flag); |
| 803 if (error != error::kNoError) { |
| 804 return error; |
| 805 } |
| 806 return error::kNoError; |
| 807 } |
| 808 |
| 809 error::Error GLES2DecoderPassthroughImpl::HandleDepthRangef( |
| 810 uint32_t immediate_data_size, |
| 811 const void* cmd_data) { |
| 812 const gles2::cmds::DepthRangef& c = |
| 813 *static_cast<const gles2::cmds::DepthRangef*>(cmd_data); |
| 814 (void)c; |
| 815 GLclampf zNear = static_cast<GLclampf>(c.zNear); |
| 816 GLclampf zFar = static_cast<GLclampf>(c.zFar); |
| 817 error::Error error = DoDepthRangef(zNear, zFar); |
| 818 if (error != error::kNoError) { |
| 819 return error; |
| 820 } |
| 821 return error::kNoError; |
| 822 } |
| 823 |
| 824 error::Error GLES2DecoderPassthroughImpl::HandleDetachShader( |
| 825 uint32_t immediate_data_size, |
| 826 const void* cmd_data) { |
| 827 const gles2::cmds::DetachShader& c = |
| 828 *static_cast<const gles2::cmds::DetachShader*>(cmd_data); |
| 829 (void)c; |
| 830 GLuint program = c.program; |
| 831 GLuint shader = c.shader; |
| 832 error::Error error = DoDetachShader(program, shader); |
| 833 if (error != error::kNoError) { |
| 834 return error; |
| 835 } |
| 836 return error::kNoError; |
| 837 } |
| 838 |
| 839 error::Error GLES2DecoderPassthroughImpl::HandleDisable( |
| 840 uint32_t immediate_data_size, |
| 841 const void* cmd_data) { |
| 842 const gles2::cmds::Disable& c = |
| 843 *static_cast<const gles2::cmds::Disable*>(cmd_data); |
| 844 (void)c; |
| 845 GLenum cap = static_cast<GLenum>(c.cap); |
| 846 error::Error error = DoDisable(cap); |
| 847 if (error != error::kNoError) { |
| 848 return error; |
| 849 } |
| 850 return error::kNoError; |
| 851 } |
| 852 |
| 853 error::Error GLES2DecoderPassthroughImpl::HandleDisableVertexAttribArray( |
| 854 uint32_t immediate_data_size, |
| 855 const void* cmd_data) { |
| 856 const gles2::cmds::DisableVertexAttribArray& c = |
| 857 *static_cast<const gles2::cmds::DisableVertexAttribArray*>(cmd_data); |
| 858 (void)c; |
| 859 GLuint index = static_cast<GLuint>(c.index); |
| 860 error::Error error = DoDisableVertexAttribArray(index); |
| 861 if (error != error::kNoError) { |
| 862 return error; |
| 863 } |
| 864 return error::kNoError; |
| 865 } |
| 866 |
| 867 error::Error GLES2DecoderPassthroughImpl::HandleEnable( |
| 868 uint32_t immediate_data_size, |
| 869 const void* cmd_data) { |
| 870 const gles2::cmds::Enable& c = |
| 871 *static_cast<const gles2::cmds::Enable*>(cmd_data); |
| 872 (void)c; |
| 873 GLenum cap = static_cast<GLenum>(c.cap); |
| 874 error::Error error = DoEnable(cap); |
| 875 if (error != error::kNoError) { |
| 876 return error; |
| 877 } |
| 878 return error::kNoError; |
| 879 } |
| 880 |
| 881 error::Error GLES2DecoderPassthroughImpl::HandleEnableVertexAttribArray( |
| 882 uint32_t immediate_data_size, |
| 883 const void* cmd_data) { |
| 884 const gles2::cmds::EnableVertexAttribArray& c = |
| 885 *static_cast<const gles2::cmds::EnableVertexAttribArray*>(cmd_data); |
| 886 (void)c; |
| 887 GLuint index = static_cast<GLuint>(c.index); |
| 888 error::Error error = DoEnableVertexAttribArray(index); |
| 889 if (error != error::kNoError) { |
| 890 return error; |
| 891 } |
| 892 return error::kNoError; |
| 893 } |
| 894 |
| 895 error::Error GLES2DecoderPassthroughImpl::HandleFinish( |
| 896 uint32_t immediate_data_size, |
| 897 const void* cmd_data) { |
| 898 const gles2::cmds::Finish& c = |
| 899 *static_cast<const gles2::cmds::Finish*>(cmd_data); |
| 900 (void)c; |
| 901 error::Error error = DoFinish(); |
| 902 if (error != error::kNoError) { |
| 903 return error; |
| 904 } |
| 905 return error::kNoError; |
| 906 } |
| 907 |
| 908 error::Error GLES2DecoderPassthroughImpl::HandleFlush( |
| 909 uint32_t immediate_data_size, |
| 910 const void* cmd_data) { |
| 911 const gles2::cmds::Flush& c = |
| 912 *static_cast<const gles2::cmds::Flush*>(cmd_data); |
| 913 (void)c; |
| 914 error::Error error = DoFlush(); |
| 915 if (error != error::kNoError) { |
| 916 return error; |
| 917 } |
| 918 return error::kNoError; |
| 919 } |
| 920 |
| 921 error::Error GLES2DecoderPassthroughImpl::HandleFramebufferRenderbuffer( |
| 922 uint32_t immediate_data_size, |
| 923 const void* cmd_data) { |
| 924 const gles2::cmds::FramebufferRenderbuffer& c = |
| 925 *static_cast<const gles2::cmds::FramebufferRenderbuffer*>(cmd_data); |
| 926 (void)c; |
| 927 GLenum target = static_cast<GLenum>(c.target); |
| 928 GLenum attachment = static_cast<GLenum>(c.attachment); |
| 929 GLenum renderbuffertarget = static_cast<GLenum>(c.renderbuffertarget); |
| 930 GLuint renderbuffer = c.renderbuffer; |
| 931 error::Error error = DoFramebufferRenderbuffer( |
| 932 target, attachment, renderbuffertarget, renderbuffer); |
| 933 if (error != error::kNoError) { |
| 934 return error; |
| 935 } |
| 936 return error::kNoError; |
| 937 } |
| 938 |
| 939 error::Error GLES2DecoderPassthroughImpl::HandleFramebufferTexture2D( |
| 940 uint32_t immediate_data_size, |
| 941 const void* cmd_data) { |
| 942 const gles2::cmds::FramebufferTexture2D& c = |
| 943 *static_cast<const gles2::cmds::FramebufferTexture2D*>(cmd_data); |
| 944 (void)c; |
| 945 GLenum target = static_cast<GLenum>(c.target); |
| 946 GLenum attachment = static_cast<GLenum>(c.attachment); |
| 947 GLenum textarget = static_cast<GLenum>(c.textarget); |
| 948 GLuint texture = c.texture; |
| 949 GLint level = static_cast<GLint>(c.level); |
| 950 error::Error error = |
| 951 DoFramebufferTexture2D(target, attachment, textarget, texture, level); |
| 952 if (error != error::kNoError) { |
| 953 return error; |
| 954 } |
| 955 return error::kNoError; |
| 956 } |
| 957 |
| 958 error::Error GLES2DecoderPassthroughImpl::HandleFramebufferTextureLayer( |
| 959 uint32_t immediate_data_size, |
| 960 const void* cmd_data) { |
| 961 const gles2::cmds::FramebufferTextureLayer& c = |
| 962 *static_cast<const gles2::cmds::FramebufferTextureLayer*>(cmd_data); |
| 963 (void)c; |
| 964 GLenum target = static_cast<GLenum>(c.target); |
| 965 GLenum attachment = static_cast<GLenum>(c.attachment); |
| 966 GLuint texture = c.texture; |
| 967 GLint level = static_cast<GLint>(c.level); |
| 968 GLint layer = static_cast<GLint>(c.layer); |
| 969 error::Error error = |
| 970 DoFramebufferTextureLayer(target, attachment, texture, level, layer); |
| 971 if (error != error::kNoError) { |
| 972 return error; |
| 973 } |
| 974 return error::kNoError; |
| 975 } |
| 976 |
| 977 error::Error GLES2DecoderPassthroughImpl::HandleFrontFace( |
| 978 uint32_t immediate_data_size, |
| 979 const void* cmd_data) { |
| 980 const gles2::cmds::FrontFace& c = |
| 981 *static_cast<const gles2::cmds::FrontFace*>(cmd_data); |
| 982 (void)c; |
| 983 GLenum mode = static_cast<GLenum>(c.mode); |
| 984 error::Error error = DoFrontFace(mode); |
| 985 if (error != error::kNoError) { |
| 986 return error; |
| 987 } |
| 988 return error::kNoError; |
| 989 } |
| 990 |
| 991 error::Error GLES2DecoderPassthroughImpl::HandleGenBuffersImmediate( |
| 992 uint32_t immediate_data_size, |
| 993 const void* cmd_data) { |
| 994 const gles2::cmds::GenBuffersImmediate& c = |
| 995 *static_cast<const gles2::cmds::GenBuffersImmediate*>(cmd_data); |
| 996 (void)c; |
| 997 GLsizei n = static_cast<GLsizei>(c.n); |
| 998 uint32_t data_size; |
| 999 if (!SafeMultiplyUint32(n, sizeof(GLuint), &data_size)) { |
| 1000 return error::kOutOfBounds; |
| 1001 } |
| 1002 GLuint* buffers = |
| 1003 GetImmediateDataAs<GLuint*>(c, data_size, immediate_data_size); |
| 1004 error::Error error = DoGenBuffers(n, buffers); |
| 1005 if (error != error::kNoError) { |
| 1006 return error; |
| 1007 } |
| 1008 return error::kNoError; |
| 1009 } |
| 1010 |
| 1011 error::Error GLES2DecoderPassthroughImpl::HandleGenerateMipmap( |
| 1012 uint32_t immediate_data_size, |
| 1013 const void* cmd_data) { |
| 1014 const gles2::cmds::GenerateMipmap& c = |
| 1015 *static_cast<const gles2::cmds::GenerateMipmap*>(cmd_data); |
| 1016 (void)c; |
| 1017 GLenum target = static_cast<GLenum>(c.target); |
| 1018 error::Error error = DoGenerateMipmap(target); |
| 1019 if (error != error::kNoError) { |
| 1020 return error; |
| 1021 } |
| 1022 return error::kNoError; |
| 1023 } |
| 1024 |
| 1025 error::Error GLES2DecoderPassthroughImpl::HandleGenFramebuffersImmediate( |
| 1026 uint32_t immediate_data_size, |
| 1027 const void* cmd_data) { |
| 1028 const gles2::cmds::GenFramebuffersImmediate& c = |
| 1029 *static_cast<const gles2::cmds::GenFramebuffersImmediate*>(cmd_data); |
| 1030 (void)c; |
| 1031 GLsizei n = static_cast<GLsizei>(c.n); |
| 1032 uint32_t data_size; |
| 1033 if (!SafeMultiplyUint32(n, sizeof(GLuint), &data_size)) { |
| 1034 return error::kOutOfBounds; |
| 1035 } |
| 1036 GLuint* framebuffers = |
| 1037 GetImmediateDataAs<GLuint*>(c, data_size, immediate_data_size); |
| 1038 error::Error error = DoGenFramebuffers(n, framebuffers); |
| 1039 if (error != error::kNoError) { |
| 1040 return error; |
| 1041 } |
| 1042 return error::kNoError; |
| 1043 } |
| 1044 |
| 1045 error::Error GLES2DecoderPassthroughImpl::HandleGenRenderbuffersImmediate( |
| 1046 uint32_t immediate_data_size, |
| 1047 const void* cmd_data) { |
| 1048 const gles2::cmds::GenRenderbuffersImmediate& c = |
| 1049 *static_cast<const gles2::cmds::GenRenderbuffersImmediate*>(cmd_data); |
| 1050 (void)c; |
| 1051 GLsizei n = static_cast<GLsizei>(c.n); |
| 1052 uint32_t data_size; |
| 1053 if (!SafeMultiplyUint32(n, sizeof(GLuint), &data_size)) { |
| 1054 return error::kOutOfBounds; |
| 1055 } |
| 1056 GLuint* renderbuffers = |
| 1057 GetImmediateDataAs<GLuint*>(c, data_size, immediate_data_size); |
| 1058 error::Error error = DoGenRenderbuffers(n, renderbuffers); |
| 1059 if (error != error::kNoError) { |
| 1060 return error; |
| 1061 } |
| 1062 return error::kNoError; |
| 1063 } |
| 1064 |
| 1065 error::Error GLES2DecoderPassthroughImpl::HandleGenSamplersImmediate( |
| 1066 uint32_t immediate_data_size, |
| 1067 const void* cmd_data) { |
| 1068 const gles2::cmds::GenSamplersImmediate& c = |
| 1069 *static_cast<const gles2::cmds::GenSamplersImmediate*>(cmd_data); |
| 1070 (void)c; |
| 1071 GLsizei n = static_cast<GLsizei>(c.n); |
| 1072 uint32_t data_size; |
| 1073 if (!SafeMultiplyUint32(n, sizeof(GLuint), &data_size)) { |
| 1074 return error::kOutOfBounds; |
| 1075 } |
| 1076 GLuint* samplers = |
| 1077 GetImmediateDataAs<GLuint*>(c, data_size, immediate_data_size); |
| 1078 error::Error error = DoGenSamplers(n, samplers); |
| 1079 if (error != error::kNoError) { |
| 1080 return error; |
| 1081 } |
| 1082 return error::kNoError; |
| 1083 } |
| 1084 |
| 1085 error::Error GLES2DecoderPassthroughImpl::HandleGenTexturesImmediate( |
| 1086 uint32_t immediate_data_size, |
| 1087 const void* cmd_data) { |
| 1088 const gles2::cmds::GenTexturesImmediate& c = |
| 1089 *static_cast<const gles2::cmds::GenTexturesImmediate*>(cmd_data); |
| 1090 (void)c; |
| 1091 GLsizei n = static_cast<GLsizei>(c.n); |
| 1092 uint32_t data_size; |
| 1093 if (!SafeMultiplyUint32(n, sizeof(GLuint), &data_size)) { |
| 1094 return error::kOutOfBounds; |
| 1095 } |
| 1096 GLuint* textures = |
| 1097 GetImmediateDataAs<GLuint*>(c, data_size, immediate_data_size); |
| 1098 error::Error error = DoGenTextures(n, textures); |
| 1099 if (error != error::kNoError) { |
| 1100 return error; |
| 1101 } |
| 1102 return error::kNoError; |
| 1103 } |
| 1104 |
| 1105 error::Error GLES2DecoderPassthroughImpl::HandleGenTransformFeedbacksImmediate( |
| 1106 uint32_t immediate_data_size, |
| 1107 const void* cmd_data) { |
| 1108 const gles2::cmds::GenTransformFeedbacksImmediate& c = |
| 1109 *static_cast<const gles2::cmds::GenTransformFeedbacksImmediate*>( |
| 1110 cmd_data); |
| 1111 (void)c; |
| 1112 GLsizei n = static_cast<GLsizei>(c.n); |
| 1113 uint32_t data_size; |
| 1114 if (!SafeMultiplyUint32(n, sizeof(GLuint), &data_size)) { |
| 1115 return error::kOutOfBounds; |
| 1116 } |
| 1117 GLuint* ids = GetImmediateDataAs<GLuint*>(c, data_size, immediate_data_size); |
| 1118 error::Error error = DoGenTransformFeedbacks(n, ids); |
| 1119 if (error != error::kNoError) { |
| 1120 return error; |
| 1121 } |
| 1122 return error::kNoError; |
| 1123 } |
| 1124 |
| 1125 error::Error GLES2DecoderPassthroughImpl::HandleGetBooleanv( |
| 1126 uint32_t immediate_data_size, |
| 1127 const void* cmd_data) { |
| 1128 const gles2::cmds::GetBooleanv& c = |
| 1129 *static_cast<const gles2::cmds::GetBooleanv*>(cmd_data); |
| 1130 (void)c; |
| 1131 GLenum pname = static_cast<GLenum>(c.pname); |
| 1132 unsigned int buffer_size = 0; |
| 1133 typedef cmds::GetBooleanv::Result Result; |
| 1134 Result* result = GetSharedMemoryAndSizeAs<Result*>( |
| 1135 c.params_shm_id, c.params_shm_offset, &buffer_size); |
| 1136 GLboolean* params = result ? result->GetData() : NULL; |
| 1137 GLsizei bufsize = Result::ComputeMaxResults(buffer_size); |
| 1138 GLsizei written_values = 0; |
| 1139 GLsizei* length = &written_values; |
| 1140 error::Error error = DoGetBooleanv(pname, bufsize, length, params); |
| 1141 if (error != error::kNoError) { |
| 1142 return error; |
| 1143 } |
| 1144 if (written_values > bufsize) { |
| 1145 return error::kOutOfBounds; |
| 1146 } |
| 1147 result->SetNumResults(written_values); |
| 1148 return error::kNoError; |
| 1149 } |
| 1150 |
| 1151 error::Error GLES2DecoderPassthroughImpl::HandleGetBufferParameteri64v( |
| 1152 uint32_t immediate_data_size, |
| 1153 const void* cmd_data) { |
| 1154 const gles2::cmds::GetBufferParameteri64v& c = |
| 1155 *static_cast<const gles2::cmds::GetBufferParameteri64v*>(cmd_data); |
| 1156 (void)c; |
| 1157 GLenum target = static_cast<GLenum>(c.target); |
| 1158 GLenum pname = static_cast<GLenum>(c.pname); |
| 1159 unsigned int buffer_size = 0; |
| 1160 typedef cmds::GetBufferParameteri64v::Result Result; |
| 1161 Result* result = GetSharedMemoryAndSizeAs<Result*>( |
| 1162 c.params_shm_id, c.params_shm_offset, &buffer_size); |
| 1163 GLint64* params = result ? result->GetData() : NULL; |
| 1164 GLsizei bufsize = Result::ComputeMaxResults(buffer_size); |
| 1165 GLsizei written_values = 0; |
| 1166 GLsizei* length = &written_values; |
| 1167 error::Error error = |
| 1168 DoGetBufferParameteri64v(target, pname, bufsize, length, params); |
| 1169 if (error != error::kNoError) { |
| 1170 return error; |
| 1171 } |
| 1172 if (written_values > bufsize) { |
| 1173 return error::kOutOfBounds; |
| 1174 } |
| 1175 result->SetNumResults(written_values); |
| 1176 return error::kNoError; |
| 1177 } |
| 1178 |
| 1179 error::Error GLES2DecoderPassthroughImpl::HandleGetBufferParameteriv( |
| 1180 uint32_t immediate_data_size, |
| 1181 const void* cmd_data) { |
| 1182 const gles2::cmds::GetBufferParameteriv& c = |
| 1183 *static_cast<const gles2::cmds::GetBufferParameteriv*>(cmd_data); |
| 1184 (void)c; |
| 1185 GLenum target = static_cast<GLenum>(c.target); |
| 1186 GLenum pname = static_cast<GLenum>(c.pname); |
| 1187 unsigned int buffer_size = 0; |
| 1188 typedef cmds::GetBufferParameteriv::Result Result; |
| 1189 Result* result = GetSharedMemoryAndSizeAs<Result*>( |
| 1190 c.params_shm_id, c.params_shm_offset, &buffer_size); |
| 1191 GLint* params = result ? result->GetData() : NULL; |
| 1192 GLsizei bufsize = Result::ComputeMaxResults(buffer_size); |
| 1193 GLsizei written_values = 0; |
| 1194 GLsizei* length = &written_values; |
| 1195 error::Error error = |
| 1196 DoGetBufferParameteriv(target, pname, bufsize, length, params); |
| 1197 if (error != error::kNoError) { |
| 1198 return error; |
| 1199 } |
| 1200 if (written_values > bufsize) { |
| 1201 return error::kOutOfBounds; |
| 1202 } |
| 1203 result->SetNumResults(written_values); |
| 1204 return error::kNoError; |
| 1205 } |
| 1206 |
| 1207 error::Error GLES2DecoderPassthroughImpl::HandleGetError( |
| 1208 uint32_t immediate_data_size, |
| 1209 const void* cmd_data) { |
| 1210 const gles2::cmds::GetError& c = |
| 1211 *static_cast<const gles2::cmds::GetError*>(cmd_data); |
| 1212 (void)c; |
| 1213 typedef cmds::GetError::Result Result; |
| 1214 Result* result = GetSharedMemoryAs<Result*>( |
| 1215 c.result_shm_id, c.result_shm_offset, sizeof(*result)); |
| 1216 if (!result) { |
| 1217 return error::kOutOfBounds; |
| 1218 } |
| 1219 error::Error error = DoGetError(result); |
| 1220 if (error != error::kNoError) { |
| 1221 return error; |
| 1222 } |
| 1223 return error::kNoError; |
| 1224 } |
| 1225 |
| 1226 error::Error GLES2DecoderPassthroughImpl::HandleGetFloatv( |
| 1227 uint32_t immediate_data_size, |
| 1228 const void* cmd_data) { |
| 1229 const gles2::cmds::GetFloatv& c = |
| 1230 *static_cast<const gles2::cmds::GetFloatv*>(cmd_data); |
| 1231 (void)c; |
| 1232 GLenum pname = static_cast<GLenum>(c.pname); |
| 1233 unsigned int buffer_size = 0; |
| 1234 typedef cmds::GetFloatv::Result Result; |
| 1235 Result* result = GetSharedMemoryAndSizeAs<Result*>( |
| 1236 c.params_shm_id, c.params_shm_offset, &buffer_size); |
| 1237 GLfloat* params = result ? result->GetData() : NULL; |
| 1238 GLsizei bufsize = Result::ComputeMaxResults(buffer_size); |
| 1239 GLsizei written_values = 0; |
| 1240 GLsizei* length = &written_values; |
| 1241 error::Error error = DoGetFloatv(pname, bufsize, length, params); |
| 1242 if (error != error::kNoError) { |
| 1243 return error; |
| 1244 } |
| 1245 if (written_values > bufsize) { |
| 1246 return error::kOutOfBounds; |
| 1247 } |
| 1248 result->SetNumResults(written_values); |
| 1249 return error::kNoError; |
| 1250 } |
| 1251 |
| 1252 error::Error |
| 1253 GLES2DecoderPassthroughImpl::HandleGetFramebufferAttachmentParameteriv( |
| 1254 uint32_t immediate_data_size, |
| 1255 const void* cmd_data) { |
| 1256 const gles2::cmds::GetFramebufferAttachmentParameteriv& c = |
| 1257 *static_cast<const gles2::cmds::GetFramebufferAttachmentParameteriv*>( |
| 1258 cmd_data); |
| 1259 (void)c; |
| 1260 GLenum target = static_cast<GLenum>(c.target); |
| 1261 GLenum attachment = static_cast<GLenum>(c.attachment); |
| 1262 GLenum pname = static_cast<GLenum>(c.pname); |
| 1263 unsigned int buffer_size = 0; |
| 1264 typedef cmds::GetFramebufferAttachmentParameteriv::Result Result; |
| 1265 Result* result = GetSharedMemoryAndSizeAs<Result*>( |
| 1266 c.params_shm_id, c.params_shm_offset, &buffer_size); |
| 1267 GLint* params = result ? result->GetData() : NULL; |
| 1268 GLsizei bufsize = Result::ComputeMaxResults(buffer_size); |
| 1269 GLsizei written_values = 0; |
| 1270 GLsizei* length = &written_values; |
| 1271 error::Error error = DoGetFramebufferAttachmentParameteriv( |
| 1272 target, attachment, pname, bufsize, length, params); |
| 1273 if (error != error::kNoError) { |
| 1274 return error; |
| 1275 } |
| 1276 if (written_values > bufsize) { |
| 1277 return error::kOutOfBounds; |
| 1278 } |
| 1279 result->SetNumResults(written_values); |
| 1280 return error::kNoError; |
| 1281 } |
| 1282 |
| 1283 error::Error GLES2DecoderPassthroughImpl::HandleGetInteger64v( |
| 1284 uint32_t immediate_data_size, |
| 1285 const void* cmd_data) { |
| 1286 const gles2::cmds::GetInteger64v& c = |
| 1287 *static_cast<const gles2::cmds::GetInteger64v*>(cmd_data); |
| 1288 (void)c; |
| 1289 GLenum pname = static_cast<GLenum>(c.pname); |
| 1290 unsigned int buffer_size = 0; |
| 1291 typedef cmds::GetInteger64v::Result Result; |
| 1292 Result* result = GetSharedMemoryAndSizeAs<Result*>( |
| 1293 c.params_shm_id, c.params_shm_offset, &buffer_size); |
| 1294 GLint64* params = result ? result->GetData() : NULL; |
| 1295 GLsizei bufsize = Result::ComputeMaxResults(buffer_size); |
| 1296 GLsizei written_values = 0; |
| 1297 GLsizei* length = &written_values; |
| 1298 error::Error error = DoGetInteger64v(pname, bufsize, length, params); |
| 1299 if (error != error::kNoError) { |
| 1300 return error; |
| 1301 } |
| 1302 if (written_values > bufsize) { |
| 1303 return error::kOutOfBounds; |
| 1304 } |
| 1305 result->SetNumResults(written_values); |
| 1306 return error::kNoError; |
| 1307 } |
| 1308 |
| 1309 error::Error GLES2DecoderPassthroughImpl::HandleGetIntegeri_v( |
| 1310 uint32_t immediate_data_size, |
| 1311 const void* cmd_data) { |
| 1312 const gles2::cmds::GetIntegeri_v& c = |
| 1313 *static_cast<const gles2::cmds::GetIntegeri_v*>(cmd_data); |
| 1314 (void)c; |
| 1315 GLenum pname = static_cast<GLenum>(c.pname); |
| 1316 GLuint index = static_cast<GLuint>(c.index); |
| 1317 unsigned int buffer_size = 0; |
| 1318 typedef cmds::GetIntegeri_v::Result Result; |
| 1319 Result* result = GetSharedMemoryAndSizeAs<Result*>( |
| 1320 c.data_shm_id, c.data_shm_offset, &buffer_size); |
| 1321 GLint* data = result ? result->GetData() : NULL; |
| 1322 GLsizei bufsize = Result::ComputeMaxResults(buffer_size); |
| 1323 GLsizei written_values = 0; |
| 1324 GLsizei* length = &written_values; |
| 1325 error::Error error = DoGetIntegeri_v(pname, index, bufsize, length, data); |
| 1326 if (error != error::kNoError) { |
| 1327 return error; |
| 1328 } |
| 1329 if (written_values > bufsize) { |
| 1330 return error::kOutOfBounds; |
| 1331 } |
| 1332 result->SetNumResults(written_values); |
| 1333 return error::kNoError; |
| 1334 } |
| 1335 |
| 1336 error::Error GLES2DecoderPassthroughImpl::HandleGetInteger64i_v( |
| 1337 uint32_t immediate_data_size, |
| 1338 const void* cmd_data) { |
| 1339 const gles2::cmds::GetInteger64i_v& c = |
| 1340 *static_cast<const gles2::cmds::GetInteger64i_v*>(cmd_data); |
| 1341 (void)c; |
| 1342 GLenum pname = static_cast<GLenum>(c.pname); |
| 1343 GLuint index = static_cast<GLuint>(c.index); |
| 1344 unsigned int buffer_size = 0; |
| 1345 typedef cmds::GetInteger64i_v::Result Result; |
| 1346 Result* result = GetSharedMemoryAndSizeAs<Result*>( |
| 1347 c.data_shm_id, c.data_shm_offset, &buffer_size); |
| 1348 GLint64* data = result ? result->GetData() : NULL; |
| 1349 GLsizei bufsize = Result::ComputeMaxResults(buffer_size); |
| 1350 GLsizei written_values = 0; |
| 1351 GLsizei* length = &written_values; |
| 1352 error::Error error = DoGetInteger64i_v(pname, index, bufsize, length, data); |
| 1353 if (error != error::kNoError) { |
| 1354 return error; |
| 1355 } |
| 1356 if (written_values > bufsize) { |
| 1357 return error::kOutOfBounds; |
| 1358 } |
| 1359 result->SetNumResults(written_values); |
| 1360 return error::kNoError; |
| 1361 } |
| 1362 |
| 1363 error::Error GLES2DecoderPassthroughImpl::HandleGetIntegerv( |
| 1364 uint32_t immediate_data_size, |
| 1365 const void* cmd_data) { |
| 1366 const gles2::cmds::GetIntegerv& c = |
| 1367 *static_cast<const gles2::cmds::GetIntegerv*>(cmd_data); |
| 1368 (void)c; |
| 1369 GLenum pname = static_cast<GLenum>(c.pname); |
| 1370 unsigned int buffer_size = 0; |
| 1371 typedef cmds::GetIntegerv::Result Result; |
| 1372 Result* result = GetSharedMemoryAndSizeAs<Result*>( |
| 1373 c.params_shm_id, c.params_shm_offset, &buffer_size); |
| 1374 GLint* params = result ? result->GetData() : NULL; |
| 1375 GLsizei bufsize = Result::ComputeMaxResults(buffer_size); |
| 1376 GLsizei written_values = 0; |
| 1377 GLsizei* length = &written_values; |
| 1378 error::Error error = DoGetIntegerv(pname, bufsize, length, params); |
| 1379 if (error != error::kNoError) { |
| 1380 return error; |
| 1381 } |
| 1382 if (written_values > bufsize) { |
| 1383 return error::kOutOfBounds; |
| 1384 } |
| 1385 result->SetNumResults(written_values); |
| 1386 return error::kNoError; |
| 1387 } |
| 1388 |
| 1389 error::Error GLES2DecoderPassthroughImpl::HandleGetProgramiv( |
| 1390 uint32_t immediate_data_size, |
| 1391 const void* cmd_data) { |
| 1392 const gles2::cmds::GetProgramiv& c = |
| 1393 *static_cast<const gles2::cmds::GetProgramiv*>(cmd_data); |
| 1394 (void)c; |
| 1395 GLuint program = c.program; |
| 1396 GLenum pname = static_cast<GLenum>(c.pname); |
| 1397 unsigned int buffer_size = 0; |
| 1398 typedef cmds::GetProgramiv::Result Result; |
| 1399 Result* result = GetSharedMemoryAndSizeAs<Result*>( |
| 1400 c.params_shm_id, c.params_shm_offset, &buffer_size); |
| 1401 GLint* params = result ? result->GetData() : NULL; |
| 1402 GLsizei bufsize = Result::ComputeMaxResults(buffer_size); |
| 1403 GLsizei written_values = 0; |
| 1404 GLsizei* length = &written_values; |
| 1405 error::Error error = DoGetProgramiv(program, pname, bufsize, length, params); |
| 1406 if (error != error::kNoError) { |
| 1407 return error; |
| 1408 } |
| 1409 if (written_values > bufsize) { |
| 1410 return error::kOutOfBounds; |
| 1411 } |
| 1412 result->SetNumResults(written_values); |
| 1413 return error::kNoError; |
| 1414 } |
| 1415 |
| 1416 error::Error GLES2DecoderPassthroughImpl::HandleGetRenderbufferParameteriv( |
| 1417 uint32_t immediate_data_size, |
| 1418 const void* cmd_data) { |
| 1419 const gles2::cmds::GetRenderbufferParameteriv& c = |
| 1420 *static_cast<const gles2::cmds::GetRenderbufferParameteriv*>(cmd_data); |
| 1421 (void)c; |
| 1422 GLenum target = static_cast<GLenum>(c.target); |
| 1423 GLenum pname = static_cast<GLenum>(c.pname); |
| 1424 unsigned int buffer_size = 0; |
| 1425 typedef cmds::GetRenderbufferParameteriv::Result Result; |
| 1426 Result* result = GetSharedMemoryAndSizeAs<Result*>( |
| 1427 c.params_shm_id, c.params_shm_offset, &buffer_size); |
| 1428 GLint* params = result ? result->GetData() : NULL; |
| 1429 GLsizei bufsize = Result::ComputeMaxResults(buffer_size); |
| 1430 GLsizei written_values = 0; |
| 1431 GLsizei* length = &written_values; |
| 1432 error::Error error = |
| 1433 DoGetRenderbufferParameteriv(target, pname, bufsize, length, params); |
| 1434 if (error != error::kNoError) { |
| 1435 return error; |
| 1436 } |
| 1437 if (written_values > bufsize) { |
| 1438 return error::kOutOfBounds; |
| 1439 } |
| 1440 result->SetNumResults(written_values); |
| 1441 return error::kNoError; |
| 1442 } |
| 1443 |
| 1444 error::Error GLES2DecoderPassthroughImpl::HandleGetSamplerParameterfv( |
| 1445 uint32_t immediate_data_size, |
| 1446 const void* cmd_data) { |
| 1447 const gles2::cmds::GetSamplerParameterfv& c = |
| 1448 *static_cast<const gles2::cmds::GetSamplerParameterfv*>(cmd_data); |
| 1449 (void)c; |
| 1450 GLuint sampler = c.sampler; |
| 1451 GLenum pname = static_cast<GLenum>(c.pname); |
| 1452 unsigned int buffer_size = 0; |
| 1453 typedef cmds::GetSamplerParameterfv::Result Result; |
| 1454 Result* result = GetSharedMemoryAndSizeAs<Result*>( |
| 1455 c.params_shm_id, c.params_shm_offset, &buffer_size); |
| 1456 GLfloat* params = result ? result->GetData() : NULL; |
| 1457 GLsizei bufsize = Result::ComputeMaxResults(buffer_size); |
| 1458 GLsizei written_values = 0; |
| 1459 GLsizei* length = &written_values; |
| 1460 error::Error error = |
| 1461 DoGetSamplerParameterfv(sampler, pname, bufsize, length, params); |
| 1462 if (error != error::kNoError) { |
| 1463 return error; |
| 1464 } |
| 1465 if (written_values > bufsize) { |
| 1466 return error::kOutOfBounds; |
| 1467 } |
| 1468 result->SetNumResults(written_values); |
| 1469 return error::kNoError; |
| 1470 } |
| 1471 |
| 1472 error::Error GLES2DecoderPassthroughImpl::HandleGetSamplerParameteriv( |
| 1473 uint32_t immediate_data_size, |
| 1474 const void* cmd_data) { |
| 1475 const gles2::cmds::GetSamplerParameteriv& c = |
| 1476 *static_cast<const gles2::cmds::GetSamplerParameteriv*>(cmd_data); |
| 1477 (void)c; |
| 1478 GLuint sampler = c.sampler; |
| 1479 GLenum pname = static_cast<GLenum>(c.pname); |
| 1480 unsigned int buffer_size = 0; |
| 1481 typedef cmds::GetSamplerParameteriv::Result Result; |
| 1482 Result* result = GetSharedMemoryAndSizeAs<Result*>( |
| 1483 c.params_shm_id, c.params_shm_offset, &buffer_size); |
| 1484 GLint* params = result ? result->GetData() : NULL; |
| 1485 GLsizei bufsize = Result::ComputeMaxResults(buffer_size); |
| 1486 GLsizei written_values = 0; |
| 1487 GLsizei* length = &written_values; |
| 1488 error::Error error = |
| 1489 DoGetSamplerParameteriv(sampler, pname, bufsize, length, params); |
| 1490 if (error != error::kNoError) { |
| 1491 return error; |
| 1492 } |
| 1493 if (written_values > bufsize) { |
| 1494 return error::kOutOfBounds; |
| 1495 } |
| 1496 result->SetNumResults(written_values); |
| 1497 return error::kNoError; |
| 1498 } |
| 1499 |
| 1500 error::Error GLES2DecoderPassthroughImpl::HandleGetShaderiv( |
| 1501 uint32_t immediate_data_size, |
| 1502 const void* cmd_data) { |
| 1503 const gles2::cmds::GetShaderiv& c = |
| 1504 *static_cast<const gles2::cmds::GetShaderiv*>(cmd_data); |
| 1505 (void)c; |
| 1506 GLuint shader = c.shader; |
| 1507 GLenum pname = static_cast<GLenum>(c.pname); |
| 1508 unsigned int buffer_size = 0; |
| 1509 typedef cmds::GetShaderiv::Result Result; |
| 1510 Result* result = GetSharedMemoryAndSizeAs<Result*>( |
| 1511 c.params_shm_id, c.params_shm_offset, &buffer_size); |
| 1512 GLint* params = result ? result->GetData() : NULL; |
| 1513 GLsizei bufsize = Result::ComputeMaxResults(buffer_size); |
| 1514 GLsizei written_values = 0; |
| 1515 GLsizei* length = &written_values; |
| 1516 error::Error error = DoGetShaderiv(shader, pname, bufsize, length, params); |
| 1517 if (error != error::kNoError) { |
| 1518 return error; |
| 1519 } |
| 1520 if (written_values > bufsize) { |
| 1521 return error::kOutOfBounds; |
| 1522 } |
| 1523 result->SetNumResults(written_values); |
| 1524 return error::kNoError; |
| 1525 } |
| 1526 |
| 1527 error::Error GLES2DecoderPassthroughImpl::HandleGetSynciv( |
| 1528 uint32_t immediate_data_size, |
| 1529 const void* cmd_data) { |
| 1530 const gles2::cmds::GetSynciv& c = |
| 1531 *static_cast<const gles2::cmds::GetSynciv*>(cmd_data); |
| 1532 (void)c; |
| 1533 GLuint sync = static_cast<GLuint>(c.sync); |
| 1534 GLenum pname = static_cast<GLenum>(c.pname); |
| 1535 unsigned int buffer_size = 0; |
| 1536 typedef cmds::GetSynciv::Result Result; |
| 1537 Result* result = GetSharedMemoryAndSizeAs<Result*>( |
| 1538 c.values_shm_id, c.values_shm_offset, &buffer_size); |
| 1539 GLint* values = result ? result->GetData() : NULL; |
| 1540 GLsizei bufsize = Result::ComputeMaxResults(buffer_size); |
| 1541 GLsizei written_values = 0; |
| 1542 GLsizei* length = &written_values; |
| 1543 error::Error error = DoGetSynciv(sync, pname, bufsize, length, values); |
| 1544 if (error != error::kNoError) { |
| 1545 return error; |
| 1546 } |
| 1547 if (written_values > bufsize) { |
| 1548 return error::kOutOfBounds; |
| 1549 } |
| 1550 result->SetNumResults(written_values); |
| 1551 return error::kNoError; |
| 1552 } |
| 1553 |
| 1554 error::Error GLES2DecoderPassthroughImpl::HandleGetTexParameterfv( |
| 1555 uint32_t immediate_data_size, |
| 1556 const void* cmd_data) { |
| 1557 const gles2::cmds::GetTexParameterfv& c = |
| 1558 *static_cast<const gles2::cmds::GetTexParameterfv*>(cmd_data); |
| 1559 (void)c; |
| 1560 GLenum target = static_cast<GLenum>(c.target); |
| 1561 GLenum pname = static_cast<GLenum>(c.pname); |
| 1562 unsigned int buffer_size = 0; |
| 1563 typedef cmds::GetTexParameterfv::Result Result; |
| 1564 Result* result = GetSharedMemoryAndSizeAs<Result*>( |
| 1565 c.params_shm_id, c.params_shm_offset, &buffer_size); |
| 1566 GLfloat* params = result ? result->GetData() : NULL; |
| 1567 GLsizei bufsize = Result::ComputeMaxResults(buffer_size); |
| 1568 GLsizei written_values = 0; |
| 1569 GLsizei* length = &written_values; |
| 1570 error::Error error = |
| 1571 DoGetTexParameterfv(target, pname, bufsize, length, params); |
| 1572 if (error != error::kNoError) { |
| 1573 return error; |
| 1574 } |
| 1575 if (written_values > bufsize) { |
| 1576 return error::kOutOfBounds; |
| 1577 } |
| 1578 result->SetNumResults(written_values); |
| 1579 return error::kNoError; |
| 1580 } |
| 1581 |
| 1582 error::Error GLES2DecoderPassthroughImpl::HandleGetTexParameteriv( |
| 1583 uint32_t immediate_data_size, |
| 1584 const void* cmd_data) { |
| 1585 const gles2::cmds::GetTexParameteriv& c = |
| 1586 *static_cast<const gles2::cmds::GetTexParameteriv*>(cmd_data); |
| 1587 (void)c; |
| 1588 GLenum target = static_cast<GLenum>(c.target); |
| 1589 GLenum pname = static_cast<GLenum>(c.pname); |
| 1590 unsigned int buffer_size = 0; |
| 1591 typedef cmds::GetTexParameteriv::Result Result; |
| 1592 Result* result = GetSharedMemoryAndSizeAs<Result*>( |
| 1593 c.params_shm_id, c.params_shm_offset, &buffer_size); |
| 1594 GLint* params = result ? result->GetData() : NULL; |
| 1595 GLsizei bufsize = Result::ComputeMaxResults(buffer_size); |
| 1596 GLsizei written_values = 0; |
| 1597 GLsizei* length = &written_values; |
| 1598 error::Error error = |
| 1599 DoGetTexParameteriv(target, pname, bufsize, length, params); |
| 1600 if (error != error::kNoError) { |
| 1601 return error; |
| 1602 } |
| 1603 if (written_values > bufsize) { |
| 1604 return error::kOutOfBounds; |
| 1605 } |
| 1606 result->SetNumResults(written_values); |
| 1607 return error::kNoError; |
| 1608 } |
| 1609 |
| 1610 error::Error GLES2DecoderPassthroughImpl::HandleGetVertexAttribfv( |
| 1611 uint32_t immediate_data_size, |
| 1612 const void* cmd_data) { |
| 1613 const gles2::cmds::GetVertexAttribfv& c = |
| 1614 *static_cast<const gles2::cmds::GetVertexAttribfv*>(cmd_data); |
| 1615 (void)c; |
| 1616 GLuint index = static_cast<GLuint>(c.index); |
| 1617 GLenum pname = static_cast<GLenum>(c.pname); |
| 1618 unsigned int buffer_size = 0; |
| 1619 typedef cmds::GetVertexAttribfv::Result Result; |
| 1620 Result* result = GetSharedMemoryAndSizeAs<Result*>( |
| 1621 c.params_shm_id, c.params_shm_offset, &buffer_size); |
| 1622 GLfloat* params = result ? result->GetData() : NULL; |
| 1623 GLsizei bufsize = Result::ComputeMaxResults(buffer_size); |
| 1624 GLsizei written_values = 0; |
| 1625 GLsizei* length = &written_values; |
| 1626 error::Error error = |
| 1627 DoGetVertexAttribfv(index, pname, bufsize, length, params); |
| 1628 if (error != error::kNoError) { |
| 1629 return error; |
| 1630 } |
| 1631 if (written_values > bufsize) { |
| 1632 return error::kOutOfBounds; |
| 1633 } |
| 1634 result->SetNumResults(written_values); |
| 1635 return error::kNoError; |
| 1636 } |
| 1637 |
| 1638 error::Error GLES2DecoderPassthroughImpl::HandleGetVertexAttribiv( |
| 1639 uint32_t immediate_data_size, |
| 1640 const void* cmd_data) { |
| 1641 const gles2::cmds::GetVertexAttribiv& c = |
| 1642 *static_cast<const gles2::cmds::GetVertexAttribiv*>(cmd_data); |
| 1643 (void)c; |
| 1644 GLuint index = static_cast<GLuint>(c.index); |
| 1645 GLenum pname = static_cast<GLenum>(c.pname); |
| 1646 unsigned int buffer_size = 0; |
| 1647 typedef cmds::GetVertexAttribiv::Result Result; |
| 1648 Result* result = GetSharedMemoryAndSizeAs<Result*>( |
| 1649 c.params_shm_id, c.params_shm_offset, &buffer_size); |
| 1650 GLint* params = result ? result->GetData() : NULL; |
| 1651 GLsizei bufsize = Result::ComputeMaxResults(buffer_size); |
| 1652 GLsizei written_values = 0; |
| 1653 GLsizei* length = &written_values; |
| 1654 error::Error error = |
| 1655 DoGetVertexAttribiv(index, pname, bufsize, length, params); |
| 1656 if (error != error::kNoError) { |
| 1657 return error; |
| 1658 } |
| 1659 if (written_values > bufsize) { |
| 1660 return error::kOutOfBounds; |
| 1661 } |
| 1662 result->SetNumResults(written_values); |
| 1663 return error::kNoError; |
| 1664 } |
| 1665 |
| 1666 error::Error GLES2DecoderPassthroughImpl::HandleGetVertexAttribIiv( |
| 1667 uint32_t immediate_data_size, |
| 1668 const void* cmd_data) { |
| 1669 const gles2::cmds::GetVertexAttribIiv& c = |
| 1670 *static_cast<const gles2::cmds::GetVertexAttribIiv*>(cmd_data); |
| 1671 (void)c; |
| 1672 GLuint index = static_cast<GLuint>(c.index); |
| 1673 GLenum pname = static_cast<GLenum>(c.pname); |
| 1674 unsigned int buffer_size = 0; |
| 1675 typedef cmds::GetVertexAttribIiv::Result Result; |
| 1676 Result* result = GetSharedMemoryAndSizeAs<Result*>( |
| 1677 c.params_shm_id, c.params_shm_offset, &buffer_size); |
| 1678 GLint* params = result ? result->GetData() : NULL; |
| 1679 GLsizei bufsize = Result::ComputeMaxResults(buffer_size); |
| 1680 GLsizei written_values = 0; |
| 1681 GLsizei* length = &written_values; |
| 1682 error::Error error = |
| 1683 DoGetVertexAttribIiv(index, pname, bufsize, length, params); |
| 1684 if (error != error::kNoError) { |
| 1685 return error; |
| 1686 } |
| 1687 if (written_values > bufsize) { |
| 1688 return error::kOutOfBounds; |
| 1689 } |
| 1690 result->SetNumResults(written_values); |
| 1691 return error::kNoError; |
| 1692 } |
| 1693 |
| 1694 error::Error GLES2DecoderPassthroughImpl::HandleGetVertexAttribIuiv( |
| 1695 uint32_t immediate_data_size, |
| 1696 const void* cmd_data) { |
| 1697 const gles2::cmds::GetVertexAttribIuiv& c = |
| 1698 *static_cast<const gles2::cmds::GetVertexAttribIuiv*>(cmd_data); |
| 1699 (void)c; |
| 1700 GLuint index = static_cast<GLuint>(c.index); |
| 1701 GLenum pname = static_cast<GLenum>(c.pname); |
| 1702 unsigned int buffer_size = 0; |
| 1703 typedef cmds::GetVertexAttribIuiv::Result Result; |
| 1704 Result* result = GetSharedMemoryAndSizeAs<Result*>( |
| 1705 c.params_shm_id, c.params_shm_offset, &buffer_size); |
| 1706 GLuint* params = result ? result->GetData() : NULL; |
| 1707 GLsizei bufsize = Result::ComputeMaxResults(buffer_size); |
| 1708 GLsizei written_values = 0; |
| 1709 GLsizei* length = &written_values; |
| 1710 error::Error error = |
| 1711 DoGetVertexAttribIuiv(index, pname, bufsize, length, params); |
| 1712 if (error != error::kNoError) { |
| 1713 return error; |
| 1714 } |
| 1715 if (written_values > bufsize) { |
| 1716 return error::kOutOfBounds; |
| 1717 } |
| 1718 result->SetNumResults(written_values); |
| 1719 return error::kNoError; |
| 1720 } |
| 1721 |
| 1722 error::Error GLES2DecoderPassthroughImpl::HandleHint( |
| 1723 uint32_t immediate_data_size, |
| 1724 const void* cmd_data) { |
| 1725 const gles2::cmds::Hint& c = *static_cast<const gles2::cmds::Hint*>(cmd_data); |
| 1726 (void)c; |
| 1727 GLenum target = static_cast<GLenum>(c.target); |
| 1728 GLenum mode = static_cast<GLenum>(c.mode); |
| 1729 error::Error error = DoHint(target, mode); |
| 1730 if (error != error::kNoError) { |
| 1731 return error; |
| 1732 } |
| 1733 return error::kNoError; |
| 1734 } |
| 1735 |
| 1736 error::Error GLES2DecoderPassthroughImpl::HandleInvalidateFramebufferImmediate( |
| 1737 uint32_t immediate_data_size, |
| 1738 const void* cmd_data) { |
| 1739 const gles2::cmds::InvalidateFramebufferImmediate& c = |
| 1740 *static_cast<const gles2::cmds::InvalidateFramebufferImmediate*>( |
| 1741 cmd_data); |
| 1742 (void)c; |
| 1743 GLenum target = static_cast<GLenum>(c.target); |
| 1744 GLsizei count = static_cast<GLsizei>(c.count); |
| 1745 uint32_t data_size = 0; |
| 1746 if (count >= 0 && |
| 1747 !GLES2Util::ComputeDataSize(count, sizeof(GLenum), 1, &data_size)) { |
| 1748 return error::kOutOfBounds; |
| 1749 } |
| 1750 if (data_size > immediate_data_size) { |
| 1751 return error::kOutOfBounds; |
| 1752 } |
| 1753 const GLenum* attachments = |
| 1754 GetImmediateDataAs<const GLenum*>(c, data_size, immediate_data_size); |
| 1755 error::Error error = DoInvalidateFramebuffer(target, count, attachments); |
| 1756 if (error != error::kNoError) { |
| 1757 return error; |
| 1758 } |
| 1759 return error::kNoError; |
| 1760 } |
| 1761 |
| 1762 error::Error |
| 1763 GLES2DecoderPassthroughImpl::HandleInvalidateSubFramebufferImmediate( |
| 1764 uint32_t immediate_data_size, |
| 1765 const void* cmd_data) { |
| 1766 const gles2::cmds::InvalidateSubFramebufferImmediate& c = |
| 1767 *static_cast<const gles2::cmds::InvalidateSubFramebufferImmediate*>( |
| 1768 cmd_data); |
| 1769 (void)c; |
| 1770 GLenum target = static_cast<GLenum>(c.target); |
| 1771 GLsizei count = static_cast<GLsizei>(c.count); |
| 1772 uint32_t data_size = 0; |
| 1773 if (count >= 0 && |
| 1774 !GLES2Util::ComputeDataSize(count, sizeof(GLenum), 1, &data_size)) { |
| 1775 return error::kOutOfBounds; |
| 1776 } |
| 1777 if (data_size > immediate_data_size) { |
| 1778 return error::kOutOfBounds; |
| 1779 } |
| 1780 const GLenum* attachments = |
| 1781 GetImmediateDataAs<const GLenum*>(c, data_size, immediate_data_size); |
| 1782 GLint x = static_cast<GLint>(c.x); |
| 1783 GLint y = static_cast<GLint>(c.y); |
| 1784 GLsizei width = static_cast<GLsizei>(c.width); |
| 1785 GLsizei height = static_cast<GLsizei>(c.height); |
| 1786 error::Error error = DoInvalidateSubFramebuffer(target, count, attachments, x, |
| 1787 y, width, height); |
| 1788 if (error != error::kNoError) { |
| 1789 return error; |
| 1790 } |
| 1791 return error::kNoError; |
| 1792 } |
| 1793 |
| 1794 error::Error GLES2DecoderPassthroughImpl::HandleIsBuffer( |
| 1795 uint32_t immediate_data_size, |
| 1796 const void* cmd_data) { |
| 1797 const gles2::cmds::IsBuffer& c = |
| 1798 *static_cast<const gles2::cmds::IsBuffer*>(cmd_data); |
| 1799 (void)c; |
| 1800 GLuint buffer = c.buffer; |
| 1801 typedef cmds::IsBuffer::Result Result; |
| 1802 Result* result = GetSharedMemoryAs<Result*>( |
| 1803 c.result_shm_id, c.result_shm_offset, sizeof(*result)); |
| 1804 if (!result) { |
| 1805 return error::kOutOfBounds; |
| 1806 } |
| 1807 error::Error error = DoIsBuffer(buffer, result); |
| 1808 if (error != error::kNoError) { |
| 1809 return error; |
| 1810 } |
| 1811 return error::kNoError; |
| 1812 } |
| 1813 |
| 1814 error::Error GLES2DecoderPassthroughImpl::HandleIsEnabled( |
| 1815 uint32_t immediate_data_size, |
| 1816 const void* cmd_data) { |
| 1817 const gles2::cmds::IsEnabled& c = |
| 1818 *static_cast<const gles2::cmds::IsEnabled*>(cmd_data); |
| 1819 (void)c; |
| 1820 GLenum cap = static_cast<GLenum>(c.cap); |
| 1821 typedef cmds::IsEnabled::Result Result; |
| 1822 Result* result = GetSharedMemoryAs<Result*>( |
| 1823 c.result_shm_id, c.result_shm_offset, sizeof(*result)); |
| 1824 if (!result) { |
| 1825 return error::kOutOfBounds; |
| 1826 } |
| 1827 error::Error error = DoIsEnabled(cap, result); |
| 1828 if (error != error::kNoError) { |
| 1829 return error; |
| 1830 } |
| 1831 return error::kNoError; |
| 1832 } |
| 1833 |
| 1834 error::Error GLES2DecoderPassthroughImpl::HandleIsFramebuffer( |
| 1835 uint32_t immediate_data_size, |
| 1836 const void* cmd_data) { |
| 1837 const gles2::cmds::IsFramebuffer& c = |
| 1838 *static_cast<const gles2::cmds::IsFramebuffer*>(cmd_data); |
| 1839 (void)c; |
| 1840 GLuint framebuffer = c.framebuffer; |
| 1841 typedef cmds::IsFramebuffer::Result Result; |
| 1842 Result* result = GetSharedMemoryAs<Result*>( |
| 1843 c.result_shm_id, c.result_shm_offset, sizeof(*result)); |
| 1844 if (!result) { |
| 1845 return error::kOutOfBounds; |
| 1846 } |
| 1847 error::Error error = DoIsFramebuffer(framebuffer, result); |
| 1848 if (error != error::kNoError) { |
| 1849 return error; |
| 1850 } |
| 1851 return error::kNoError; |
| 1852 } |
| 1853 |
| 1854 error::Error GLES2DecoderPassthroughImpl::HandleIsProgram( |
| 1855 uint32_t immediate_data_size, |
| 1856 const void* cmd_data) { |
| 1857 const gles2::cmds::IsProgram& c = |
| 1858 *static_cast<const gles2::cmds::IsProgram*>(cmd_data); |
| 1859 (void)c; |
| 1860 GLuint program = c.program; |
| 1861 typedef cmds::IsProgram::Result Result; |
| 1862 Result* result = GetSharedMemoryAs<Result*>( |
| 1863 c.result_shm_id, c.result_shm_offset, sizeof(*result)); |
| 1864 if (!result) { |
| 1865 return error::kOutOfBounds; |
| 1866 } |
| 1867 error::Error error = DoIsProgram(program, result); |
| 1868 if (error != error::kNoError) { |
| 1869 return error; |
| 1870 } |
| 1871 return error::kNoError; |
| 1872 } |
| 1873 |
| 1874 error::Error GLES2DecoderPassthroughImpl::HandleIsRenderbuffer( |
| 1875 uint32_t immediate_data_size, |
| 1876 const void* cmd_data) { |
| 1877 const gles2::cmds::IsRenderbuffer& c = |
| 1878 *static_cast<const gles2::cmds::IsRenderbuffer*>(cmd_data); |
| 1879 (void)c; |
| 1880 GLuint renderbuffer = c.renderbuffer; |
| 1881 typedef cmds::IsRenderbuffer::Result Result; |
| 1882 Result* result = GetSharedMemoryAs<Result*>( |
| 1883 c.result_shm_id, c.result_shm_offset, sizeof(*result)); |
| 1884 if (!result) { |
| 1885 return error::kOutOfBounds; |
| 1886 } |
| 1887 error::Error error = DoIsRenderbuffer(renderbuffer, result); |
| 1888 if (error != error::kNoError) { |
| 1889 return error; |
| 1890 } |
| 1891 return error::kNoError; |
| 1892 } |
| 1893 |
| 1894 error::Error GLES2DecoderPassthroughImpl::HandleIsSampler( |
| 1895 uint32_t immediate_data_size, |
| 1896 const void* cmd_data) { |
| 1897 const gles2::cmds::IsSampler& c = |
| 1898 *static_cast<const gles2::cmds::IsSampler*>(cmd_data); |
| 1899 (void)c; |
| 1900 GLuint sampler = c.sampler; |
| 1901 typedef cmds::IsSampler::Result Result; |
| 1902 Result* result = GetSharedMemoryAs<Result*>( |
| 1903 c.result_shm_id, c.result_shm_offset, sizeof(*result)); |
| 1904 if (!result) { |
| 1905 return error::kOutOfBounds; |
| 1906 } |
| 1907 error::Error error = DoIsSampler(sampler, result); |
| 1908 if (error != error::kNoError) { |
| 1909 return error; |
| 1910 } |
| 1911 return error::kNoError; |
| 1912 } |
| 1913 |
| 1914 error::Error GLES2DecoderPassthroughImpl::HandleIsShader( |
| 1915 uint32_t immediate_data_size, |
| 1916 const void* cmd_data) { |
| 1917 const gles2::cmds::IsShader& c = |
| 1918 *static_cast<const gles2::cmds::IsShader*>(cmd_data); |
| 1919 (void)c; |
| 1920 GLuint shader = c.shader; |
| 1921 typedef cmds::IsShader::Result Result; |
| 1922 Result* result = GetSharedMemoryAs<Result*>( |
| 1923 c.result_shm_id, c.result_shm_offset, sizeof(*result)); |
| 1924 if (!result) { |
| 1925 return error::kOutOfBounds; |
| 1926 } |
| 1927 error::Error error = DoIsShader(shader, result); |
| 1928 if (error != error::kNoError) { |
| 1929 return error; |
| 1930 } |
| 1931 return error::kNoError; |
| 1932 } |
| 1933 |
| 1934 error::Error GLES2DecoderPassthroughImpl::HandleIsSync( |
| 1935 uint32_t immediate_data_size, |
| 1936 const void* cmd_data) { |
| 1937 const gles2::cmds::IsSync& c = |
| 1938 *static_cast<const gles2::cmds::IsSync*>(cmd_data); |
| 1939 (void)c; |
| 1940 GLuint sync = c.sync; |
| 1941 typedef cmds::IsSync::Result Result; |
| 1942 Result* result = GetSharedMemoryAs<Result*>( |
| 1943 c.result_shm_id, c.result_shm_offset, sizeof(*result)); |
| 1944 if (!result) { |
| 1945 return error::kOutOfBounds; |
| 1946 } |
| 1947 error::Error error = DoIsSync(sync, result); |
| 1948 if (error != error::kNoError) { |
| 1949 return error; |
| 1950 } |
| 1951 return error::kNoError; |
| 1952 } |
| 1953 |
| 1954 error::Error GLES2DecoderPassthroughImpl::HandleIsTexture( |
| 1955 uint32_t immediate_data_size, |
| 1956 const void* cmd_data) { |
| 1957 const gles2::cmds::IsTexture& c = |
| 1958 *static_cast<const gles2::cmds::IsTexture*>(cmd_data); |
| 1959 (void)c; |
| 1960 GLuint texture = c.texture; |
| 1961 typedef cmds::IsTexture::Result Result; |
| 1962 Result* result = GetSharedMemoryAs<Result*>( |
| 1963 c.result_shm_id, c.result_shm_offset, sizeof(*result)); |
| 1964 if (!result) { |
| 1965 return error::kOutOfBounds; |
| 1966 } |
| 1967 error::Error error = DoIsTexture(texture, result); |
| 1968 if (error != error::kNoError) { |
| 1969 return error; |
| 1970 } |
| 1971 return error::kNoError; |
| 1972 } |
| 1973 |
| 1974 error::Error GLES2DecoderPassthroughImpl::HandleIsTransformFeedback( |
| 1975 uint32_t immediate_data_size, |
| 1976 const void* cmd_data) { |
| 1977 const gles2::cmds::IsTransformFeedback& c = |
| 1978 *static_cast<const gles2::cmds::IsTransformFeedback*>(cmd_data); |
| 1979 (void)c; |
| 1980 GLuint transformfeedback = c.transformfeedback; |
| 1981 typedef cmds::IsTransformFeedback::Result Result; |
| 1982 Result* result = GetSharedMemoryAs<Result*>( |
| 1983 c.result_shm_id, c.result_shm_offset, sizeof(*result)); |
| 1984 if (!result) { |
| 1985 return error::kOutOfBounds; |
| 1986 } |
| 1987 error::Error error = DoIsTransformFeedback(transformfeedback, result); |
| 1988 if (error != error::kNoError) { |
| 1989 return error; |
| 1990 } |
| 1991 return error::kNoError; |
| 1992 } |
| 1993 |
| 1994 error::Error GLES2DecoderPassthroughImpl::HandleLineWidth( |
| 1995 uint32_t immediate_data_size, |
| 1996 const void* cmd_data) { |
| 1997 const gles2::cmds::LineWidth& c = |
| 1998 *static_cast<const gles2::cmds::LineWidth*>(cmd_data); |
| 1999 (void)c; |
| 2000 GLfloat width = static_cast<GLfloat>(c.width); |
| 2001 error::Error error = DoLineWidth(width); |
| 2002 if (error != error::kNoError) { |
| 2003 return error; |
| 2004 } |
| 2005 return error::kNoError; |
| 2006 } |
| 2007 |
| 2008 error::Error GLES2DecoderPassthroughImpl::HandleLinkProgram( |
| 2009 uint32_t immediate_data_size, |
| 2010 const void* cmd_data) { |
| 2011 const gles2::cmds::LinkProgram& c = |
| 2012 *static_cast<const gles2::cmds::LinkProgram*>(cmd_data); |
| 2013 (void)c; |
| 2014 GLuint program = c.program; |
| 2015 error::Error error = DoLinkProgram(program); |
| 2016 if (error != error::kNoError) { |
| 2017 return error; |
| 2018 } |
| 2019 return error::kNoError; |
| 2020 } |
| 2021 |
| 2022 error::Error GLES2DecoderPassthroughImpl::HandlePauseTransformFeedback( |
| 2023 uint32_t immediate_data_size, |
| 2024 const void* cmd_data) { |
| 2025 const gles2::cmds::PauseTransformFeedback& c = |
| 2026 *static_cast<const gles2::cmds::PauseTransformFeedback*>(cmd_data); |
| 2027 (void)c; |
| 2028 error::Error error = DoPauseTransformFeedback(); |
| 2029 if (error != error::kNoError) { |
| 2030 return error; |
| 2031 } |
| 2032 return error::kNoError; |
| 2033 } |
| 2034 |
| 2035 error::Error GLES2DecoderPassthroughImpl::HandlePolygonOffset( |
| 2036 uint32_t immediate_data_size, |
| 2037 const void* cmd_data) { |
| 2038 const gles2::cmds::PolygonOffset& c = |
| 2039 *static_cast<const gles2::cmds::PolygonOffset*>(cmd_data); |
| 2040 (void)c; |
| 2041 GLfloat factor = static_cast<GLfloat>(c.factor); |
| 2042 GLfloat units = static_cast<GLfloat>(c.units); |
| 2043 error::Error error = DoPolygonOffset(factor, units); |
| 2044 if (error != error::kNoError) { |
| 2045 return error; |
| 2046 } |
| 2047 return error::kNoError; |
| 2048 } |
| 2049 |
| 2050 error::Error GLES2DecoderPassthroughImpl::HandleReadBuffer( |
| 2051 uint32_t immediate_data_size, |
| 2052 const void* cmd_data) { |
| 2053 const gles2::cmds::ReadBuffer& c = |
| 2054 *static_cast<const gles2::cmds::ReadBuffer*>(cmd_data); |
| 2055 (void)c; |
| 2056 GLenum src = static_cast<GLenum>(c.src); |
| 2057 error::Error error = DoReadBuffer(src); |
| 2058 if (error != error::kNoError) { |
| 2059 return error; |
| 2060 } |
| 2061 return error::kNoError; |
| 2062 } |
| 2063 |
| 2064 error::Error GLES2DecoderPassthroughImpl::HandleReleaseShaderCompiler( |
| 2065 uint32_t immediate_data_size, |
| 2066 const void* cmd_data) { |
| 2067 const gles2::cmds::ReleaseShaderCompiler& c = |
| 2068 *static_cast<const gles2::cmds::ReleaseShaderCompiler*>(cmd_data); |
| 2069 (void)c; |
| 2070 error::Error error = DoReleaseShaderCompiler(); |
| 2071 if (error != error::kNoError) { |
| 2072 return error; |
| 2073 } |
| 2074 return error::kNoError; |
| 2075 } |
| 2076 |
| 2077 error::Error GLES2DecoderPassthroughImpl::HandleRenderbufferStorage( |
| 2078 uint32_t immediate_data_size, |
| 2079 const void* cmd_data) { |
| 2080 const gles2::cmds::RenderbufferStorage& c = |
| 2081 *static_cast<const gles2::cmds::RenderbufferStorage*>(cmd_data); |
| 2082 (void)c; |
| 2083 GLenum target = static_cast<GLenum>(c.target); |
| 2084 GLenum internalformat = static_cast<GLenum>(c.internalformat); |
| 2085 GLsizei width = static_cast<GLsizei>(c.width); |
| 2086 GLsizei height = static_cast<GLsizei>(c.height); |
| 2087 error::Error error = |
| 2088 DoRenderbufferStorage(target, internalformat, width, height); |
| 2089 if (error != error::kNoError) { |
| 2090 return error; |
| 2091 } |
| 2092 return error::kNoError; |
| 2093 } |
| 2094 |
| 2095 error::Error GLES2DecoderPassthroughImpl::HandleResumeTransformFeedback( |
| 2096 uint32_t immediate_data_size, |
| 2097 const void* cmd_data) { |
| 2098 const gles2::cmds::ResumeTransformFeedback& c = |
| 2099 *static_cast<const gles2::cmds::ResumeTransformFeedback*>(cmd_data); |
| 2100 (void)c; |
| 2101 error::Error error = DoResumeTransformFeedback(); |
| 2102 if (error != error::kNoError) { |
| 2103 return error; |
| 2104 } |
| 2105 return error::kNoError; |
| 2106 } |
| 2107 |
| 2108 error::Error GLES2DecoderPassthroughImpl::HandleSampleCoverage( |
| 2109 uint32_t immediate_data_size, |
| 2110 const void* cmd_data) { |
| 2111 const gles2::cmds::SampleCoverage& c = |
| 2112 *static_cast<const gles2::cmds::SampleCoverage*>(cmd_data); |
| 2113 (void)c; |
| 2114 GLclampf value = static_cast<GLclampf>(c.value); |
| 2115 GLboolean invert = static_cast<GLboolean>(c.invert); |
| 2116 error::Error error = DoSampleCoverage(value, invert); |
| 2117 if (error != error::kNoError) { |
| 2118 return error; |
| 2119 } |
| 2120 return error::kNoError; |
| 2121 } |
| 2122 |
| 2123 error::Error GLES2DecoderPassthroughImpl::HandleSamplerParameterf( |
| 2124 uint32_t immediate_data_size, |
| 2125 const void* cmd_data) { |
| 2126 const gles2::cmds::SamplerParameterf& c = |
| 2127 *static_cast<const gles2::cmds::SamplerParameterf*>(cmd_data); |
| 2128 (void)c; |
| 2129 GLuint sampler = c.sampler; |
| 2130 GLenum pname = static_cast<GLenum>(c.pname); |
| 2131 GLfloat param = static_cast<GLfloat>(c.param); |
| 2132 error::Error error = DoSamplerParameterf(sampler, pname, param); |
| 2133 if (error != error::kNoError) { |
| 2134 return error; |
| 2135 } |
| 2136 return error::kNoError; |
| 2137 } |
| 2138 |
| 2139 error::Error GLES2DecoderPassthroughImpl::HandleSamplerParameterfvImmediate( |
| 2140 uint32_t immediate_data_size, |
| 2141 const void* cmd_data) { |
| 2142 const gles2::cmds::SamplerParameterfvImmediate& c = |
| 2143 *static_cast<const gles2::cmds::SamplerParameterfvImmediate*>(cmd_data); |
| 2144 (void)c; |
| 2145 GLuint sampler = c.sampler; |
| 2146 GLenum pname = static_cast<GLenum>(c.pname); |
| 2147 uint32_t data_size; |
| 2148 if (!GLES2Util::ComputeDataSize(1, sizeof(GLfloat), 1, &data_size)) { |
| 2149 return error::kOutOfBounds; |
| 2150 } |
| 2151 if (data_size > immediate_data_size) { |
| 2152 return error::kOutOfBounds; |
| 2153 } |
| 2154 const GLfloat* params = |
| 2155 GetImmediateDataAs<const GLfloat*>(c, data_size, immediate_data_size); |
| 2156 error::Error error = DoSamplerParameterfv(sampler, pname, params); |
| 2157 if (error != error::kNoError) { |
| 2158 return error; |
| 2159 } |
| 2160 return error::kNoError; |
| 2161 } |
| 2162 |
| 2163 error::Error GLES2DecoderPassthroughImpl::HandleSamplerParameteri( |
| 2164 uint32_t immediate_data_size, |
| 2165 const void* cmd_data) { |
| 2166 const gles2::cmds::SamplerParameteri& c = |
| 2167 *static_cast<const gles2::cmds::SamplerParameteri*>(cmd_data); |
| 2168 (void)c; |
| 2169 GLuint sampler = c.sampler; |
| 2170 GLenum pname = static_cast<GLenum>(c.pname); |
| 2171 GLint param = static_cast<GLint>(c.param); |
| 2172 error::Error error = DoSamplerParameteri(sampler, pname, param); |
| 2173 if (error != error::kNoError) { |
| 2174 return error; |
| 2175 } |
| 2176 return error::kNoError; |
| 2177 } |
| 2178 |
| 2179 error::Error GLES2DecoderPassthroughImpl::HandleSamplerParameterivImmediate( |
| 2180 uint32_t immediate_data_size, |
| 2181 const void* cmd_data) { |
| 2182 const gles2::cmds::SamplerParameterivImmediate& c = |
| 2183 *static_cast<const gles2::cmds::SamplerParameterivImmediate*>(cmd_data); |
| 2184 (void)c; |
| 2185 GLuint sampler = c.sampler; |
| 2186 GLenum pname = static_cast<GLenum>(c.pname); |
| 2187 uint32_t data_size; |
| 2188 if (!GLES2Util::ComputeDataSize(1, sizeof(GLint), 1, &data_size)) { |
| 2189 return error::kOutOfBounds; |
| 2190 } |
| 2191 if (data_size > immediate_data_size) { |
| 2192 return error::kOutOfBounds; |
| 2193 } |
| 2194 const GLint* params = |
| 2195 GetImmediateDataAs<const GLint*>(c, data_size, immediate_data_size); |
| 2196 error::Error error = DoSamplerParameteriv(sampler, pname, params); |
| 2197 if (error != error::kNoError) { |
| 2198 return error; |
| 2199 } |
| 2200 return error::kNoError; |
| 2201 } |
| 2202 |
| 2203 error::Error GLES2DecoderPassthroughImpl::HandleScissor( |
| 2204 uint32_t immediate_data_size, |
| 2205 const void* cmd_data) { |
| 2206 const gles2::cmds::Scissor& c = |
| 2207 *static_cast<const gles2::cmds::Scissor*>(cmd_data); |
| 2208 (void)c; |
| 2209 GLint x = static_cast<GLint>(c.x); |
| 2210 GLint y = static_cast<GLint>(c.y); |
| 2211 GLsizei width = static_cast<GLsizei>(c.width); |
| 2212 GLsizei height = static_cast<GLsizei>(c.height); |
| 2213 error::Error error = DoScissor(x, y, width, height); |
| 2214 if (error != error::kNoError) { |
| 2215 return error; |
| 2216 } |
| 2217 return error::kNoError; |
| 2218 } |
| 2219 |
| 2220 error::Error GLES2DecoderPassthroughImpl::HandleShaderSourceBucket( |
| 2221 uint32_t immediate_data_size, |
| 2222 const void* cmd_data) { |
| 2223 const gles2::cmds::ShaderSourceBucket& c = |
| 2224 *static_cast<const gles2::cmds::ShaderSourceBucket*>(cmd_data); |
| 2225 (void)c; |
| 2226 GLuint shader = static_cast<GLuint>(c.shader); |
| 2227 |
| 2228 Bucket* bucket = GetBucket(c.str_bucket_id); |
| 2229 if (!bucket) { |
| 2230 return error::kInvalidArguments; |
| 2231 } |
| 2232 GLsizei count = 0; |
| 2233 std::vector<char*> strs; |
| 2234 std::vector<GLint> len; |
| 2235 if (!bucket->GetAsStrings(&count, &strs, &len)) { |
| 2236 return error::kInvalidArguments; |
| 2237 } |
| 2238 const char** str = |
| 2239 strs.size() > 0 ? const_cast<const char**>(&strs[0]) : NULL; |
| 2240 const GLint* length = |
| 2241 len.size() > 0 ? const_cast<const GLint*>(&len[0]) : NULL; |
| 2242 (void)length; |
| 2243 error::Error error = DoShaderSource(shader, count, str, length); |
| 2244 if (error != error::kNoError) { |
| 2245 return error; |
| 2246 } |
| 2247 return error::kNoError; |
| 2248 } |
| 2249 |
| 2250 error::Error GLES2DecoderPassthroughImpl::HandleStencilFunc( |
| 2251 uint32_t immediate_data_size, |
| 2252 const void* cmd_data) { |
| 2253 const gles2::cmds::StencilFunc& c = |
| 2254 *static_cast<const gles2::cmds::StencilFunc*>(cmd_data); |
| 2255 (void)c; |
| 2256 GLenum func = static_cast<GLenum>(c.func); |
| 2257 GLint ref = static_cast<GLint>(c.ref); |
| 2258 GLuint mask = static_cast<GLuint>(c.mask); |
| 2259 error::Error error = DoStencilFunc(func, ref, mask); |
| 2260 if (error != error::kNoError) { |
| 2261 return error; |
| 2262 } |
| 2263 return error::kNoError; |
| 2264 } |
| 2265 |
| 2266 error::Error GLES2DecoderPassthroughImpl::HandleStencilFuncSeparate( |
| 2267 uint32_t immediate_data_size, |
| 2268 const void* cmd_data) { |
| 2269 const gles2::cmds::StencilFuncSeparate& c = |
| 2270 *static_cast<const gles2::cmds::StencilFuncSeparate*>(cmd_data); |
| 2271 (void)c; |
| 2272 GLenum face = static_cast<GLenum>(c.face); |
| 2273 GLenum func = static_cast<GLenum>(c.func); |
| 2274 GLint ref = static_cast<GLint>(c.ref); |
| 2275 GLuint mask = static_cast<GLuint>(c.mask); |
| 2276 error::Error error = DoStencilFuncSeparate(face, func, ref, mask); |
| 2277 if (error != error::kNoError) { |
| 2278 return error; |
| 2279 } |
| 2280 return error::kNoError; |
| 2281 } |
| 2282 |
| 2283 error::Error GLES2DecoderPassthroughImpl::HandleStencilMask( |
| 2284 uint32_t immediate_data_size, |
| 2285 const void* cmd_data) { |
| 2286 const gles2::cmds::StencilMask& c = |
| 2287 *static_cast<const gles2::cmds::StencilMask*>(cmd_data); |
| 2288 (void)c; |
| 2289 GLuint mask = static_cast<GLuint>(c.mask); |
| 2290 error::Error error = DoStencilMask(mask); |
| 2291 if (error != error::kNoError) { |
| 2292 return error; |
| 2293 } |
| 2294 return error::kNoError; |
| 2295 } |
| 2296 |
| 2297 error::Error GLES2DecoderPassthroughImpl::HandleStencilMaskSeparate( |
| 2298 uint32_t immediate_data_size, |
| 2299 const void* cmd_data) { |
| 2300 const gles2::cmds::StencilMaskSeparate& c = |
| 2301 *static_cast<const gles2::cmds::StencilMaskSeparate*>(cmd_data); |
| 2302 (void)c; |
| 2303 GLenum face = static_cast<GLenum>(c.face); |
| 2304 GLuint mask = static_cast<GLuint>(c.mask); |
| 2305 error::Error error = DoStencilMaskSeparate(face, mask); |
| 2306 if (error != error::kNoError) { |
| 2307 return error; |
| 2308 } |
| 2309 return error::kNoError; |
| 2310 } |
| 2311 |
| 2312 error::Error GLES2DecoderPassthroughImpl::HandleStencilOp( |
| 2313 uint32_t immediate_data_size, |
| 2314 const void* cmd_data) { |
| 2315 const gles2::cmds::StencilOp& c = |
| 2316 *static_cast<const gles2::cmds::StencilOp*>(cmd_data); |
| 2317 (void)c; |
| 2318 GLenum fail = static_cast<GLenum>(c.fail); |
| 2319 GLenum zfail = static_cast<GLenum>(c.zfail); |
| 2320 GLenum zpass = static_cast<GLenum>(c.zpass); |
| 2321 error::Error error = DoStencilOp(fail, zfail, zpass); |
| 2322 if (error != error::kNoError) { |
| 2323 return error; |
| 2324 } |
| 2325 return error::kNoError; |
| 2326 } |
| 2327 |
| 2328 error::Error GLES2DecoderPassthroughImpl::HandleStencilOpSeparate( |
| 2329 uint32_t immediate_data_size, |
| 2330 const void* cmd_data) { |
| 2331 const gles2::cmds::StencilOpSeparate& c = |
| 2332 *static_cast<const gles2::cmds::StencilOpSeparate*>(cmd_data); |
| 2333 (void)c; |
| 2334 GLenum face = static_cast<GLenum>(c.face); |
| 2335 GLenum fail = static_cast<GLenum>(c.fail); |
| 2336 GLenum zfail = static_cast<GLenum>(c.zfail); |
| 2337 GLenum zpass = static_cast<GLenum>(c.zpass); |
| 2338 error::Error error = DoStencilOpSeparate(face, fail, zfail, zpass); |
| 2339 if (error != error::kNoError) { |
| 2340 return error; |
| 2341 } |
| 2342 return error::kNoError; |
| 2343 } |
| 2344 |
| 2345 error::Error GLES2DecoderPassthroughImpl::HandleTexParameterf( |
| 2346 uint32_t immediate_data_size, |
| 2347 const void* cmd_data) { |
| 2348 const gles2::cmds::TexParameterf& c = |
| 2349 *static_cast<const gles2::cmds::TexParameterf*>(cmd_data); |
| 2350 (void)c; |
| 2351 GLenum target = static_cast<GLenum>(c.target); |
| 2352 GLenum pname = static_cast<GLenum>(c.pname); |
| 2353 GLfloat param = static_cast<GLfloat>(c.param); |
| 2354 error::Error error = DoTexParameterf(target, pname, param); |
| 2355 if (error != error::kNoError) { |
| 2356 return error; |
| 2357 } |
| 2358 return error::kNoError; |
| 2359 } |
| 2360 |
| 2361 error::Error GLES2DecoderPassthroughImpl::HandleTexParameterfvImmediate( |
| 2362 uint32_t immediate_data_size, |
| 2363 const void* cmd_data) { |
| 2364 const gles2::cmds::TexParameterfvImmediate& c = |
| 2365 *static_cast<const gles2::cmds::TexParameterfvImmediate*>(cmd_data); |
| 2366 (void)c; |
| 2367 GLenum target = static_cast<GLenum>(c.target); |
| 2368 GLenum pname = static_cast<GLenum>(c.pname); |
| 2369 uint32_t data_size; |
| 2370 if (!GLES2Util::ComputeDataSize(1, sizeof(GLfloat), 1, &data_size)) { |
| 2371 return error::kOutOfBounds; |
| 2372 } |
| 2373 if (data_size > immediate_data_size) { |
| 2374 return error::kOutOfBounds; |
| 2375 } |
| 2376 const GLfloat* params = |
| 2377 GetImmediateDataAs<const GLfloat*>(c, data_size, immediate_data_size); |
| 2378 error::Error error = DoTexParameterfv(target, pname, params); |
| 2379 if (error != error::kNoError) { |
| 2380 return error; |
| 2381 } |
| 2382 return error::kNoError; |
| 2383 } |
| 2384 |
| 2385 error::Error GLES2DecoderPassthroughImpl::HandleTexParameteri( |
| 2386 uint32_t immediate_data_size, |
| 2387 const void* cmd_data) { |
| 2388 const gles2::cmds::TexParameteri& c = |
| 2389 *static_cast<const gles2::cmds::TexParameteri*>(cmd_data); |
| 2390 (void)c; |
| 2391 GLenum target = static_cast<GLenum>(c.target); |
| 2392 GLenum pname = static_cast<GLenum>(c.pname); |
| 2393 GLint param = static_cast<GLint>(c.param); |
| 2394 error::Error error = DoTexParameteri(target, pname, param); |
| 2395 if (error != error::kNoError) { |
| 2396 return error; |
| 2397 } |
| 2398 return error::kNoError; |
| 2399 } |
| 2400 |
| 2401 error::Error GLES2DecoderPassthroughImpl::HandleTexParameterivImmediate( |
| 2402 uint32_t immediate_data_size, |
| 2403 const void* cmd_data) { |
| 2404 const gles2::cmds::TexParameterivImmediate& c = |
| 2405 *static_cast<const gles2::cmds::TexParameterivImmediate*>(cmd_data); |
| 2406 (void)c; |
| 2407 GLenum target = static_cast<GLenum>(c.target); |
| 2408 GLenum pname = static_cast<GLenum>(c.pname); |
| 2409 uint32_t data_size; |
| 2410 if (!GLES2Util::ComputeDataSize(1, sizeof(GLint), 1, &data_size)) { |
| 2411 return error::kOutOfBounds; |
| 2412 } |
| 2413 if (data_size > immediate_data_size) { |
| 2414 return error::kOutOfBounds; |
| 2415 } |
| 2416 const GLint* params = |
| 2417 GetImmediateDataAs<const GLint*>(c, data_size, immediate_data_size); |
| 2418 error::Error error = DoTexParameteriv(target, pname, params); |
| 2419 if (error != error::kNoError) { |
| 2420 return error; |
| 2421 } |
| 2422 return error::kNoError; |
| 2423 } |
| 2424 |
| 2425 error::Error GLES2DecoderPassthroughImpl::HandleTexStorage3D( |
| 2426 uint32_t immediate_data_size, |
| 2427 const void* cmd_data) { |
| 2428 const gles2::cmds::TexStorage3D& c = |
| 2429 *static_cast<const gles2::cmds::TexStorage3D*>(cmd_data); |
| 2430 (void)c; |
| 2431 GLenum target = static_cast<GLenum>(c.target); |
| 2432 GLsizei levels = static_cast<GLsizei>(c.levels); |
| 2433 GLenum internalFormat = static_cast<GLenum>(c.internalFormat); |
| 2434 GLsizei width = static_cast<GLsizei>(c.width); |
| 2435 GLsizei height = static_cast<GLsizei>(c.height); |
| 2436 GLsizei depth = static_cast<GLsizei>(c.depth); |
| 2437 error::Error error = |
| 2438 DoTexStorage3D(target, levels, internalFormat, width, height, depth); |
| 2439 if (error != error::kNoError) { |
| 2440 return error; |
| 2441 } |
| 2442 return error::kNoError; |
| 2443 } |
| 2444 |
| 2445 error::Error GLES2DecoderPassthroughImpl::HandleTransformFeedbackVaryingsBucket( |
| 2446 uint32_t immediate_data_size, |
| 2447 const void* cmd_data) { |
| 2448 const gles2::cmds::TransformFeedbackVaryingsBucket& c = |
| 2449 *static_cast<const gles2::cmds::TransformFeedbackVaryingsBucket*>( |
| 2450 cmd_data); |
| 2451 (void)c; |
| 2452 GLuint program = static_cast<GLuint>(c.program); |
| 2453 |
| 2454 Bucket* bucket = GetBucket(c.varyings_bucket_id); |
| 2455 if (!bucket) { |
| 2456 return error::kInvalidArguments; |
| 2457 } |
| 2458 GLsizei count = 0; |
| 2459 std::vector<char*> strs; |
| 2460 std::vector<GLint> len; |
| 2461 if (!bucket->GetAsStrings(&count, &strs, &len)) { |
| 2462 return error::kInvalidArguments; |
| 2463 } |
| 2464 const char** varyings = |
| 2465 strs.size() > 0 ? const_cast<const char**>(&strs[0]) : NULL; |
| 2466 const GLint* length = |
| 2467 len.size() > 0 ? const_cast<const GLint*>(&len[0]) : NULL; |
| 2468 (void)length; |
| 2469 GLenum buffermode = static_cast<GLenum>(c.buffermode); |
| 2470 error::Error error = |
| 2471 DoTransformFeedbackVaryings(program, count, varyings, buffermode); |
| 2472 if (error != error::kNoError) { |
| 2473 return error; |
| 2474 } |
| 2475 return error::kNoError; |
| 2476 } |
| 2477 |
| 2478 error::Error GLES2DecoderPassthroughImpl::HandleUniform1f( |
| 2479 uint32_t immediate_data_size, |
| 2480 const void* cmd_data) { |
| 2481 const gles2::cmds::Uniform1f& c = |
| 2482 *static_cast<const gles2::cmds::Uniform1f*>(cmd_data); |
| 2483 (void)c; |
| 2484 GLint location = static_cast<GLint>(c.location); |
| 2485 GLfloat x = static_cast<GLfloat>(c.x); |
| 2486 error::Error error = DoUniform1f(location, x); |
| 2487 if (error != error::kNoError) { |
| 2488 return error; |
| 2489 } |
| 2490 return error::kNoError; |
| 2491 } |
| 2492 |
| 2493 error::Error GLES2DecoderPassthroughImpl::HandleUniform1fvImmediate( |
| 2494 uint32_t immediate_data_size, |
| 2495 const void* cmd_data) { |
| 2496 const gles2::cmds::Uniform1fvImmediate& c = |
| 2497 *static_cast<const gles2::cmds::Uniform1fvImmediate*>(cmd_data); |
| 2498 (void)c; |
| 2499 GLint location = static_cast<GLint>(c.location); |
| 2500 GLsizei count = static_cast<GLsizei>(c.count); |
| 2501 uint32_t data_size = 0; |
| 2502 if (count >= 0 && |
| 2503 !GLES2Util::ComputeDataSize(count, sizeof(GLfloat), 1, &data_size)) { |
| 2504 return error::kOutOfBounds; |
| 2505 } |
| 2506 if (data_size > immediate_data_size) { |
| 2507 return error::kOutOfBounds; |
| 2508 } |
| 2509 const GLfloat* v = |
| 2510 GetImmediateDataAs<const GLfloat*>(c, data_size, immediate_data_size); |
| 2511 error::Error error = DoUniform1fv(location, count, v); |
| 2512 if (error != error::kNoError) { |
| 2513 return error; |
| 2514 } |
| 2515 return error::kNoError; |
| 2516 } |
| 2517 |
| 2518 error::Error GLES2DecoderPassthroughImpl::HandleUniform1i( |
| 2519 uint32_t immediate_data_size, |
| 2520 const void* cmd_data) { |
| 2521 const gles2::cmds::Uniform1i& c = |
| 2522 *static_cast<const gles2::cmds::Uniform1i*>(cmd_data); |
| 2523 (void)c; |
| 2524 GLint location = static_cast<GLint>(c.location); |
| 2525 GLint x = static_cast<GLint>(c.x); |
| 2526 error::Error error = DoUniform1i(location, x); |
| 2527 if (error != error::kNoError) { |
| 2528 return error; |
| 2529 } |
| 2530 return error::kNoError; |
| 2531 } |
| 2532 |
| 2533 error::Error GLES2DecoderPassthroughImpl::HandleUniform1ivImmediate( |
| 2534 uint32_t immediate_data_size, |
| 2535 const void* cmd_data) { |
| 2536 const gles2::cmds::Uniform1ivImmediate& c = |
| 2537 *static_cast<const gles2::cmds::Uniform1ivImmediate*>(cmd_data); |
| 2538 (void)c; |
| 2539 GLint location = static_cast<GLint>(c.location); |
| 2540 GLsizei count = static_cast<GLsizei>(c.count); |
| 2541 uint32_t data_size = 0; |
| 2542 if (count >= 0 && |
| 2543 !GLES2Util::ComputeDataSize(count, sizeof(GLint), 1, &data_size)) { |
| 2544 return error::kOutOfBounds; |
| 2545 } |
| 2546 if (data_size > immediate_data_size) { |
| 2547 return error::kOutOfBounds; |
| 2548 } |
| 2549 const GLint* v = |
| 2550 GetImmediateDataAs<const GLint*>(c, data_size, immediate_data_size); |
| 2551 error::Error error = DoUniform1iv(location, count, v); |
| 2552 if (error != error::kNoError) { |
| 2553 return error; |
| 2554 } |
| 2555 return error::kNoError; |
| 2556 } |
| 2557 |
| 2558 error::Error GLES2DecoderPassthroughImpl::HandleUniform1ui( |
| 2559 uint32_t immediate_data_size, |
| 2560 const void* cmd_data) { |
| 2561 const gles2::cmds::Uniform1ui& c = |
| 2562 *static_cast<const gles2::cmds::Uniform1ui*>(cmd_data); |
| 2563 (void)c; |
| 2564 GLint location = static_cast<GLint>(c.location); |
| 2565 GLuint x = static_cast<GLuint>(c.x); |
| 2566 error::Error error = DoUniform1ui(location, x); |
| 2567 if (error != error::kNoError) { |
| 2568 return error; |
| 2569 } |
| 2570 return error::kNoError; |
| 2571 } |
| 2572 |
| 2573 error::Error GLES2DecoderPassthroughImpl::HandleUniform1uivImmediate( |
| 2574 uint32_t immediate_data_size, |
| 2575 const void* cmd_data) { |
| 2576 const gles2::cmds::Uniform1uivImmediate& c = |
| 2577 *static_cast<const gles2::cmds::Uniform1uivImmediate*>(cmd_data); |
| 2578 (void)c; |
| 2579 GLint location = static_cast<GLint>(c.location); |
| 2580 GLsizei count = static_cast<GLsizei>(c.count); |
| 2581 uint32_t data_size = 0; |
| 2582 if (count >= 0 && |
| 2583 !GLES2Util::ComputeDataSize(count, sizeof(GLuint), 1, &data_size)) { |
| 2584 return error::kOutOfBounds; |
| 2585 } |
| 2586 if (data_size > immediate_data_size) { |
| 2587 return error::kOutOfBounds; |
| 2588 } |
| 2589 const GLuint* v = |
| 2590 GetImmediateDataAs<const GLuint*>(c, data_size, immediate_data_size); |
| 2591 error::Error error = DoUniform1uiv(location, count, v); |
| 2592 if (error != error::kNoError) { |
| 2593 return error; |
| 2594 } |
| 2595 return error::kNoError; |
| 2596 } |
| 2597 |
| 2598 error::Error GLES2DecoderPassthroughImpl::HandleUniform2f( |
| 2599 uint32_t immediate_data_size, |
| 2600 const void* cmd_data) { |
| 2601 const gles2::cmds::Uniform2f& c = |
| 2602 *static_cast<const gles2::cmds::Uniform2f*>(cmd_data); |
| 2603 (void)c; |
| 2604 GLint location = static_cast<GLint>(c.location); |
| 2605 GLfloat x = static_cast<GLfloat>(c.x); |
| 2606 GLfloat y = static_cast<GLfloat>(c.y); |
| 2607 error::Error error = DoUniform2f(location, x, y); |
| 2608 if (error != error::kNoError) { |
| 2609 return error; |
| 2610 } |
| 2611 return error::kNoError; |
| 2612 } |
| 2613 |
| 2614 error::Error GLES2DecoderPassthroughImpl::HandleUniform2fvImmediate( |
| 2615 uint32_t immediate_data_size, |
| 2616 const void* cmd_data) { |
| 2617 const gles2::cmds::Uniform2fvImmediate& c = |
| 2618 *static_cast<const gles2::cmds::Uniform2fvImmediate*>(cmd_data); |
| 2619 (void)c; |
| 2620 GLint location = static_cast<GLint>(c.location); |
| 2621 GLsizei count = static_cast<GLsizei>(c.count); |
| 2622 uint32_t data_size = 0; |
| 2623 if (count >= 0 && |
| 2624 !GLES2Util::ComputeDataSize(count, sizeof(GLfloat), 2, &data_size)) { |
| 2625 return error::kOutOfBounds; |
| 2626 } |
| 2627 if (data_size > immediate_data_size) { |
| 2628 return error::kOutOfBounds; |
| 2629 } |
| 2630 const GLfloat* v = |
| 2631 GetImmediateDataAs<const GLfloat*>(c, data_size, immediate_data_size); |
| 2632 error::Error error = DoUniform2fv(location, count, v); |
| 2633 if (error != error::kNoError) { |
| 2634 return error; |
| 2635 } |
| 2636 return error::kNoError; |
| 2637 } |
| 2638 |
| 2639 error::Error GLES2DecoderPassthroughImpl::HandleUniform2i( |
| 2640 uint32_t immediate_data_size, |
| 2641 const void* cmd_data) { |
| 2642 const gles2::cmds::Uniform2i& c = |
| 2643 *static_cast<const gles2::cmds::Uniform2i*>(cmd_data); |
| 2644 (void)c; |
| 2645 GLint location = static_cast<GLint>(c.location); |
| 2646 GLint x = static_cast<GLint>(c.x); |
| 2647 GLint y = static_cast<GLint>(c.y); |
| 2648 error::Error error = DoUniform2i(location, x, y); |
| 2649 if (error != error::kNoError) { |
| 2650 return error; |
| 2651 } |
| 2652 return error::kNoError; |
| 2653 } |
| 2654 |
| 2655 error::Error GLES2DecoderPassthroughImpl::HandleUniform2ivImmediate( |
| 2656 uint32_t immediate_data_size, |
| 2657 const void* cmd_data) { |
| 2658 const gles2::cmds::Uniform2ivImmediate& c = |
| 2659 *static_cast<const gles2::cmds::Uniform2ivImmediate*>(cmd_data); |
| 2660 (void)c; |
| 2661 GLint location = static_cast<GLint>(c.location); |
| 2662 GLsizei count = static_cast<GLsizei>(c.count); |
| 2663 uint32_t data_size = 0; |
| 2664 if (count >= 0 && |
| 2665 !GLES2Util::ComputeDataSize(count, sizeof(GLint), 2, &data_size)) { |
| 2666 return error::kOutOfBounds; |
| 2667 } |
| 2668 if (data_size > immediate_data_size) { |
| 2669 return error::kOutOfBounds; |
| 2670 } |
| 2671 const GLint* v = |
| 2672 GetImmediateDataAs<const GLint*>(c, data_size, immediate_data_size); |
| 2673 error::Error error = DoUniform2iv(location, count, v); |
| 2674 if (error != error::kNoError) { |
| 2675 return error; |
| 2676 } |
| 2677 return error::kNoError; |
| 2678 } |
| 2679 |
| 2680 error::Error GLES2DecoderPassthroughImpl::HandleUniform2ui( |
| 2681 uint32_t immediate_data_size, |
| 2682 const void* cmd_data) { |
| 2683 const gles2::cmds::Uniform2ui& c = |
| 2684 *static_cast<const gles2::cmds::Uniform2ui*>(cmd_data); |
| 2685 (void)c; |
| 2686 GLint location = static_cast<GLint>(c.location); |
| 2687 GLuint x = static_cast<GLuint>(c.x); |
| 2688 GLuint y = static_cast<GLuint>(c.y); |
| 2689 error::Error error = DoUniform2ui(location, x, y); |
| 2690 if (error != error::kNoError) { |
| 2691 return error; |
| 2692 } |
| 2693 return error::kNoError; |
| 2694 } |
| 2695 |
| 2696 error::Error GLES2DecoderPassthroughImpl::HandleUniform2uivImmediate( |
| 2697 uint32_t immediate_data_size, |
| 2698 const void* cmd_data) { |
| 2699 const gles2::cmds::Uniform2uivImmediate& c = |
| 2700 *static_cast<const gles2::cmds::Uniform2uivImmediate*>(cmd_data); |
| 2701 (void)c; |
| 2702 GLint location = static_cast<GLint>(c.location); |
| 2703 GLsizei count = static_cast<GLsizei>(c.count); |
| 2704 uint32_t data_size = 0; |
| 2705 if (count >= 0 && |
| 2706 !GLES2Util::ComputeDataSize(count, sizeof(GLuint), 2, &data_size)) { |
| 2707 return error::kOutOfBounds; |
| 2708 } |
| 2709 if (data_size > immediate_data_size) { |
| 2710 return error::kOutOfBounds; |
| 2711 } |
| 2712 const GLuint* v = |
| 2713 GetImmediateDataAs<const GLuint*>(c, data_size, immediate_data_size); |
| 2714 error::Error error = DoUniform2uiv(location, count, v); |
| 2715 if (error != error::kNoError) { |
| 2716 return error; |
| 2717 } |
| 2718 return error::kNoError; |
| 2719 } |
| 2720 |
| 2721 error::Error GLES2DecoderPassthroughImpl::HandleUniform3f( |
| 2722 uint32_t immediate_data_size, |
| 2723 const void* cmd_data) { |
| 2724 const gles2::cmds::Uniform3f& c = |
| 2725 *static_cast<const gles2::cmds::Uniform3f*>(cmd_data); |
| 2726 (void)c; |
| 2727 GLint location = static_cast<GLint>(c.location); |
| 2728 GLfloat x = static_cast<GLfloat>(c.x); |
| 2729 GLfloat y = static_cast<GLfloat>(c.y); |
| 2730 GLfloat z = static_cast<GLfloat>(c.z); |
| 2731 error::Error error = DoUniform3f(location, x, y, z); |
| 2732 if (error != error::kNoError) { |
| 2733 return error; |
| 2734 } |
| 2735 return error::kNoError; |
| 2736 } |
| 2737 |
| 2738 error::Error GLES2DecoderPassthroughImpl::HandleUniform3fvImmediate( |
| 2739 uint32_t immediate_data_size, |
| 2740 const void* cmd_data) { |
| 2741 const gles2::cmds::Uniform3fvImmediate& c = |
| 2742 *static_cast<const gles2::cmds::Uniform3fvImmediate*>(cmd_data); |
| 2743 (void)c; |
| 2744 GLint location = static_cast<GLint>(c.location); |
| 2745 GLsizei count = static_cast<GLsizei>(c.count); |
| 2746 uint32_t data_size = 0; |
| 2747 if (count >= 0 && |
| 2748 !GLES2Util::ComputeDataSize(count, sizeof(GLfloat), 3, &data_size)) { |
| 2749 return error::kOutOfBounds; |
| 2750 } |
| 2751 if (data_size > immediate_data_size) { |
| 2752 return error::kOutOfBounds; |
| 2753 } |
| 2754 const GLfloat* v = |
| 2755 GetImmediateDataAs<const GLfloat*>(c, data_size, immediate_data_size); |
| 2756 error::Error error = DoUniform3fv(location, count, v); |
| 2757 if (error != error::kNoError) { |
| 2758 return error; |
| 2759 } |
| 2760 return error::kNoError; |
| 2761 } |
| 2762 |
| 2763 error::Error GLES2DecoderPassthroughImpl::HandleUniform3i( |
| 2764 uint32_t immediate_data_size, |
| 2765 const void* cmd_data) { |
| 2766 const gles2::cmds::Uniform3i& c = |
| 2767 *static_cast<const gles2::cmds::Uniform3i*>(cmd_data); |
| 2768 (void)c; |
| 2769 GLint location = static_cast<GLint>(c.location); |
| 2770 GLint x = static_cast<GLint>(c.x); |
| 2771 GLint y = static_cast<GLint>(c.y); |
| 2772 GLint z = static_cast<GLint>(c.z); |
| 2773 error::Error error = DoUniform3i(location, x, y, z); |
| 2774 if (error != error::kNoError) { |
| 2775 return error; |
| 2776 } |
| 2777 return error::kNoError; |
| 2778 } |
| 2779 |
| 2780 error::Error GLES2DecoderPassthroughImpl::HandleUniform3ivImmediate( |
| 2781 uint32_t immediate_data_size, |
| 2782 const void* cmd_data) { |
| 2783 const gles2::cmds::Uniform3ivImmediate& c = |
| 2784 *static_cast<const gles2::cmds::Uniform3ivImmediate*>(cmd_data); |
| 2785 (void)c; |
| 2786 GLint location = static_cast<GLint>(c.location); |
| 2787 GLsizei count = static_cast<GLsizei>(c.count); |
| 2788 uint32_t data_size = 0; |
| 2789 if (count >= 0 && |
| 2790 !GLES2Util::ComputeDataSize(count, sizeof(GLint), 3, &data_size)) { |
| 2791 return error::kOutOfBounds; |
| 2792 } |
| 2793 if (data_size > immediate_data_size) { |
| 2794 return error::kOutOfBounds; |
| 2795 } |
| 2796 const GLint* v = |
| 2797 GetImmediateDataAs<const GLint*>(c, data_size, immediate_data_size); |
| 2798 error::Error error = DoUniform3iv(location, count, v); |
| 2799 if (error != error::kNoError) { |
| 2800 return error; |
| 2801 } |
| 2802 return error::kNoError; |
| 2803 } |
| 2804 |
| 2805 error::Error GLES2DecoderPassthroughImpl::HandleUniform3ui( |
| 2806 uint32_t immediate_data_size, |
| 2807 const void* cmd_data) { |
| 2808 const gles2::cmds::Uniform3ui& c = |
| 2809 *static_cast<const gles2::cmds::Uniform3ui*>(cmd_data); |
| 2810 (void)c; |
| 2811 GLint location = static_cast<GLint>(c.location); |
| 2812 GLuint x = static_cast<GLuint>(c.x); |
| 2813 GLuint y = static_cast<GLuint>(c.y); |
| 2814 GLuint z = static_cast<GLuint>(c.z); |
| 2815 error::Error error = DoUniform3ui(location, x, y, z); |
| 2816 if (error != error::kNoError) { |
| 2817 return error; |
| 2818 } |
| 2819 return error::kNoError; |
| 2820 } |
| 2821 |
| 2822 error::Error GLES2DecoderPassthroughImpl::HandleUniform3uivImmediate( |
| 2823 uint32_t immediate_data_size, |
| 2824 const void* cmd_data) { |
| 2825 const gles2::cmds::Uniform3uivImmediate& c = |
| 2826 *static_cast<const gles2::cmds::Uniform3uivImmediate*>(cmd_data); |
| 2827 (void)c; |
| 2828 GLint location = static_cast<GLint>(c.location); |
| 2829 GLsizei count = static_cast<GLsizei>(c.count); |
| 2830 uint32_t data_size = 0; |
| 2831 if (count >= 0 && |
| 2832 !GLES2Util::ComputeDataSize(count, sizeof(GLuint), 3, &data_size)) { |
| 2833 return error::kOutOfBounds; |
| 2834 } |
| 2835 if (data_size > immediate_data_size) { |
| 2836 return error::kOutOfBounds; |
| 2837 } |
| 2838 const GLuint* v = |
| 2839 GetImmediateDataAs<const GLuint*>(c, data_size, immediate_data_size); |
| 2840 error::Error error = DoUniform3uiv(location, count, v); |
| 2841 if (error != error::kNoError) { |
| 2842 return error; |
| 2843 } |
| 2844 return error::kNoError; |
| 2845 } |
| 2846 |
| 2847 error::Error GLES2DecoderPassthroughImpl::HandleUniform4f( |
| 2848 uint32_t immediate_data_size, |
| 2849 const void* cmd_data) { |
| 2850 const gles2::cmds::Uniform4f& c = |
| 2851 *static_cast<const gles2::cmds::Uniform4f*>(cmd_data); |
| 2852 (void)c; |
| 2853 GLint location = static_cast<GLint>(c.location); |
| 2854 GLfloat x = static_cast<GLfloat>(c.x); |
| 2855 GLfloat y = static_cast<GLfloat>(c.y); |
| 2856 GLfloat z = static_cast<GLfloat>(c.z); |
| 2857 GLfloat w = static_cast<GLfloat>(c.w); |
| 2858 error::Error error = DoUniform4f(location, x, y, z, w); |
| 2859 if (error != error::kNoError) { |
| 2860 return error; |
| 2861 } |
| 2862 return error::kNoError; |
| 2863 } |
| 2864 |
| 2865 error::Error GLES2DecoderPassthroughImpl::HandleUniform4fvImmediate( |
| 2866 uint32_t immediate_data_size, |
| 2867 const void* cmd_data) { |
| 2868 const gles2::cmds::Uniform4fvImmediate& c = |
| 2869 *static_cast<const gles2::cmds::Uniform4fvImmediate*>(cmd_data); |
| 2870 (void)c; |
| 2871 GLint location = static_cast<GLint>(c.location); |
| 2872 GLsizei count = static_cast<GLsizei>(c.count); |
| 2873 uint32_t data_size = 0; |
| 2874 if (count >= 0 && |
| 2875 !GLES2Util::ComputeDataSize(count, sizeof(GLfloat), 4, &data_size)) { |
| 2876 return error::kOutOfBounds; |
| 2877 } |
| 2878 if (data_size > immediate_data_size) { |
| 2879 return error::kOutOfBounds; |
| 2880 } |
| 2881 const GLfloat* v = |
| 2882 GetImmediateDataAs<const GLfloat*>(c, data_size, immediate_data_size); |
| 2883 error::Error error = DoUniform4fv(location, count, v); |
| 2884 if (error != error::kNoError) { |
| 2885 return error; |
| 2886 } |
| 2887 return error::kNoError; |
| 2888 } |
| 2889 |
| 2890 error::Error GLES2DecoderPassthroughImpl::HandleUniform4i( |
| 2891 uint32_t immediate_data_size, |
| 2892 const void* cmd_data) { |
| 2893 const gles2::cmds::Uniform4i& c = |
| 2894 *static_cast<const gles2::cmds::Uniform4i*>(cmd_data); |
| 2895 (void)c; |
| 2896 GLint location = static_cast<GLint>(c.location); |
| 2897 GLint x = static_cast<GLint>(c.x); |
| 2898 GLint y = static_cast<GLint>(c.y); |
| 2899 GLint z = static_cast<GLint>(c.z); |
| 2900 GLint w = static_cast<GLint>(c.w); |
| 2901 error::Error error = DoUniform4i(location, x, y, z, w); |
| 2902 if (error != error::kNoError) { |
| 2903 return error; |
| 2904 } |
| 2905 return error::kNoError; |
| 2906 } |
| 2907 |
| 2908 error::Error GLES2DecoderPassthroughImpl::HandleUniform4ivImmediate( |
| 2909 uint32_t immediate_data_size, |
| 2910 const void* cmd_data) { |
| 2911 const gles2::cmds::Uniform4ivImmediate& c = |
| 2912 *static_cast<const gles2::cmds::Uniform4ivImmediate*>(cmd_data); |
| 2913 (void)c; |
| 2914 GLint location = static_cast<GLint>(c.location); |
| 2915 GLsizei count = static_cast<GLsizei>(c.count); |
| 2916 uint32_t data_size = 0; |
| 2917 if (count >= 0 && |
| 2918 !GLES2Util::ComputeDataSize(count, sizeof(GLint), 4, &data_size)) { |
| 2919 return error::kOutOfBounds; |
| 2920 } |
| 2921 if (data_size > immediate_data_size) { |
| 2922 return error::kOutOfBounds; |
| 2923 } |
| 2924 const GLint* v = |
| 2925 GetImmediateDataAs<const GLint*>(c, data_size, immediate_data_size); |
| 2926 error::Error error = DoUniform4iv(location, count, v); |
| 2927 if (error != error::kNoError) { |
| 2928 return error; |
| 2929 } |
| 2930 return error::kNoError; |
| 2931 } |
| 2932 |
| 2933 error::Error GLES2DecoderPassthroughImpl::HandleUniform4ui( |
| 2934 uint32_t immediate_data_size, |
| 2935 const void* cmd_data) { |
| 2936 const gles2::cmds::Uniform4ui& c = |
| 2937 *static_cast<const gles2::cmds::Uniform4ui*>(cmd_data); |
| 2938 (void)c; |
| 2939 GLint location = static_cast<GLint>(c.location); |
| 2940 GLuint x = static_cast<GLuint>(c.x); |
| 2941 GLuint y = static_cast<GLuint>(c.y); |
| 2942 GLuint z = static_cast<GLuint>(c.z); |
| 2943 GLuint w = static_cast<GLuint>(c.w); |
| 2944 error::Error error = DoUniform4ui(location, x, y, z, w); |
| 2945 if (error != error::kNoError) { |
| 2946 return error; |
| 2947 } |
| 2948 return error::kNoError; |
| 2949 } |
| 2950 |
| 2951 error::Error GLES2DecoderPassthroughImpl::HandleUniform4uivImmediate( |
| 2952 uint32_t immediate_data_size, |
| 2953 const void* cmd_data) { |
| 2954 const gles2::cmds::Uniform4uivImmediate& c = |
| 2955 *static_cast<const gles2::cmds::Uniform4uivImmediate*>(cmd_data); |
| 2956 (void)c; |
| 2957 GLint location = static_cast<GLint>(c.location); |
| 2958 GLsizei count = static_cast<GLsizei>(c.count); |
| 2959 uint32_t data_size = 0; |
| 2960 if (count >= 0 && |
| 2961 !GLES2Util::ComputeDataSize(count, sizeof(GLuint), 4, &data_size)) { |
| 2962 return error::kOutOfBounds; |
| 2963 } |
| 2964 if (data_size > immediate_data_size) { |
| 2965 return error::kOutOfBounds; |
| 2966 } |
| 2967 const GLuint* v = |
| 2968 GetImmediateDataAs<const GLuint*>(c, data_size, immediate_data_size); |
| 2969 error::Error error = DoUniform4uiv(location, count, v); |
| 2970 if (error != error::kNoError) { |
| 2971 return error; |
| 2972 } |
| 2973 return error::kNoError; |
| 2974 } |
| 2975 |
| 2976 error::Error GLES2DecoderPassthroughImpl::HandleUniformMatrix2fvImmediate( |
| 2977 uint32_t immediate_data_size, |
| 2978 const void* cmd_data) { |
| 2979 const gles2::cmds::UniformMatrix2fvImmediate& c = |
| 2980 *static_cast<const gles2::cmds::UniformMatrix2fvImmediate*>(cmd_data); |
| 2981 (void)c; |
| 2982 GLint location = static_cast<GLint>(c.location); |
| 2983 GLsizei count = static_cast<GLsizei>(c.count); |
| 2984 GLboolean transpose = static_cast<GLboolean>(c.transpose); |
| 2985 uint32_t data_size = 0; |
| 2986 if (count >= 0 && |
| 2987 !GLES2Util::ComputeDataSize(count, sizeof(GLfloat), 4, &data_size)) { |
| 2988 return error::kOutOfBounds; |
| 2989 } |
| 2990 if (data_size > immediate_data_size) { |
| 2991 return error::kOutOfBounds; |
| 2992 } |
| 2993 const GLfloat* value = |
| 2994 GetImmediateDataAs<const GLfloat*>(c, data_size, immediate_data_size); |
| 2995 error::Error error = DoUniformMatrix2fv(location, count, transpose, value); |
| 2996 if (error != error::kNoError) { |
| 2997 return error; |
| 2998 } |
| 2999 return error::kNoError; |
| 3000 } |
| 3001 |
| 3002 error::Error GLES2DecoderPassthroughImpl::HandleUniformMatrix2x3fvImmediate( |
| 3003 uint32_t immediate_data_size, |
| 3004 const void* cmd_data) { |
| 3005 const gles2::cmds::UniformMatrix2x3fvImmediate& c = |
| 3006 *static_cast<const gles2::cmds::UniformMatrix2x3fvImmediate*>(cmd_data); |
| 3007 (void)c; |
| 3008 GLint location = static_cast<GLint>(c.location); |
| 3009 GLsizei count = static_cast<GLsizei>(c.count); |
| 3010 GLboolean transpose = static_cast<GLboolean>(c.transpose); |
| 3011 uint32_t data_size = 0; |
| 3012 if (count >= 0 && |
| 3013 !GLES2Util::ComputeDataSize(count, sizeof(GLfloat), 6, &data_size)) { |
| 3014 return error::kOutOfBounds; |
| 3015 } |
| 3016 if (data_size > immediate_data_size) { |
| 3017 return error::kOutOfBounds; |
| 3018 } |
| 3019 const GLfloat* value = |
| 3020 GetImmediateDataAs<const GLfloat*>(c, data_size, immediate_data_size); |
| 3021 error::Error error = DoUniformMatrix2x3fv(location, count, transpose, value); |
| 3022 if (error != error::kNoError) { |
| 3023 return error; |
| 3024 } |
| 3025 return error::kNoError; |
| 3026 } |
| 3027 |
| 3028 error::Error GLES2DecoderPassthroughImpl::HandleUniformMatrix2x4fvImmediate( |
| 3029 uint32_t immediate_data_size, |
| 3030 const void* cmd_data) { |
| 3031 const gles2::cmds::UniformMatrix2x4fvImmediate& c = |
| 3032 *static_cast<const gles2::cmds::UniformMatrix2x4fvImmediate*>(cmd_data); |
| 3033 (void)c; |
| 3034 GLint location = static_cast<GLint>(c.location); |
| 3035 GLsizei count = static_cast<GLsizei>(c.count); |
| 3036 GLboolean transpose = static_cast<GLboolean>(c.transpose); |
| 3037 uint32_t data_size = 0; |
| 3038 if (count >= 0 && |
| 3039 !GLES2Util::ComputeDataSize(count, sizeof(GLfloat), 8, &data_size)) { |
| 3040 return error::kOutOfBounds; |
| 3041 } |
| 3042 if (data_size > immediate_data_size) { |
| 3043 return error::kOutOfBounds; |
| 3044 } |
| 3045 const GLfloat* value = |
| 3046 GetImmediateDataAs<const GLfloat*>(c, data_size, immediate_data_size); |
| 3047 error::Error error = DoUniformMatrix2x4fv(location, count, transpose, value); |
| 3048 if (error != error::kNoError) { |
| 3049 return error; |
| 3050 } |
| 3051 return error::kNoError; |
| 3052 } |
| 3053 |
| 3054 error::Error GLES2DecoderPassthroughImpl::HandleUniformMatrix3fvImmediate( |
| 3055 uint32_t immediate_data_size, |
| 3056 const void* cmd_data) { |
| 3057 const gles2::cmds::UniformMatrix3fvImmediate& c = |
| 3058 *static_cast<const gles2::cmds::UniformMatrix3fvImmediate*>(cmd_data); |
| 3059 (void)c; |
| 3060 GLint location = static_cast<GLint>(c.location); |
| 3061 GLsizei count = static_cast<GLsizei>(c.count); |
| 3062 GLboolean transpose = static_cast<GLboolean>(c.transpose); |
| 3063 uint32_t data_size = 0; |
| 3064 if (count >= 0 && |
| 3065 !GLES2Util::ComputeDataSize(count, sizeof(GLfloat), 9, &data_size)) { |
| 3066 return error::kOutOfBounds; |
| 3067 } |
| 3068 if (data_size > immediate_data_size) { |
| 3069 return error::kOutOfBounds; |
| 3070 } |
| 3071 const GLfloat* value = |
| 3072 GetImmediateDataAs<const GLfloat*>(c, data_size, immediate_data_size); |
| 3073 error::Error error = DoUniformMatrix3fv(location, count, transpose, value); |
| 3074 if (error != error::kNoError) { |
| 3075 return error; |
| 3076 } |
| 3077 return error::kNoError; |
| 3078 } |
| 3079 |
| 3080 error::Error GLES2DecoderPassthroughImpl::HandleUniformMatrix3x2fvImmediate( |
| 3081 uint32_t immediate_data_size, |
| 3082 const void* cmd_data) { |
| 3083 const gles2::cmds::UniformMatrix3x2fvImmediate& c = |
| 3084 *static_cast<const gles2::cmds::UniformMatrix3x2fvImmediate*>(cmd_data); |
| 3085 (void)c; |
| 3086 GLint location = static_cast<GLint>(c.location); |
| 3087 GLsizei count = static_cast<GLsizei>(c.count); |
| 3088 GLboolean transpose = static_cast<GLboolean>(c.transpose); |
| 3089 uint32_t data_size = 0; |
| 3090 if (count >= 0 && |
| 3091 !GLES2Util::ComputeDataSize(count, sizeof(GLfloat), 6, &data_size)) { |
| 3092 return error::kOutOfBounds; |
| 3093 } |
| 3094 if (data_size > immediate_data_size) { |
| 3095 return error::kOutOfBounds; |
| 3096 } |
| 3097 const GLfloat* value = |
| 3098 GetImmediateDataAs<const GLfloat*>(c, data_size, immediate_data_size); |
| 3099 error::Error error = DoUniformMatrix3x2fv(location, count, transpose, value); |
| 3100 if (error != error::kNoError) { |
| 3101 return error; |
| 3102 } |
| 3103 return error::kNoError; |
| 3104 } |
| 3105 |
| 3106 error::Error GLES2DecoderPassthroughImpl::HandleUniformMatrix3x4fvImmediate( |
| 3107 uint32_t immediate_data_size, |
| 3108 const void* cmd_data) { |
| 3109 const gles2::cmds::UniformMatrix3x4fvImmediate& c = |
| 3110 *static_cast<const gles2::cmds::UniformMatrix3x4fvImmediate*>(cmd_data); |
| 3111 (void)c; |
| 3112 GLint location = static_cast<GLint>(c.location); |
| 3113 GLsizei count = static_cast<GLsizei>(c.count); |
| 3114 GLboolean transpose = static_cast<GLboolean>(c.transpose); |
| 3115 uint32_t data_size = 0; |
| 3116 if (count >= 0 && |
| 3117 !GLES2Util::ComputeDataSize(count, sizeof(GLfloat), 12, &data_size)) { |
| 3118 return error::kOutOfBounds; |
| 3119 } |
| 3120 if (data_size > immediate_data_size) { |
| 3121 return error::kOutOfBounds; |
| 3122 } |
| 3123 const GLfloat* value = |
| 3124 GetImmediateDataAs<const GLfloat*>(c, data_size, immediate_data_size); |
| 3125 error::Error error = DoUniformMatrix3x4fv(location, count, transpose, value); |
| 3126 if (error != error::kNoError) { |
| 3127 return error; |
| 3128 } |
| 3129 return error::kNoError; |
| 3130 } |
| 3131 |
| 3132 error::Error GLES2DecoderPassthroughImpl::HandleUniformMatrix4fvImmediate( |
| 3133 uint32_t immediate_data_size, |
| 3134 const void* cmd_data) { |
| 3135 const gles2::cmds::UniformMatrix4fvImmediate& c = |
| 3136 *static_cast<const gles2::cmds::UniformMatrix4fvImmediate*>(cmd_data); |
| 3137 (void)c; |
| 3138 GLint location = static_cast<GLint>(c.location); |
| 3139 GLsizei count = static_cast<GLsizei>(c.count); |
| 3140 GLboolean transpose = static_cast<GLboolean>(c.transpose); |
| 3141 uint32_t data_size = 0; |
| 3142 if (count >= 0 && |
| 3143 !GLES2Util::ComputeDataSize(count, sizeof(GLfloat), 16, &data_size)) { |
| 3144 return error::kOutOfBounds; |
| 3145 } |
| 3146 if (data_size > immediate_data_size) { |
| 3147 return error::kOutOfBounds; |
| 3148 } |
| 3149 const GLfloat* value = |
| 3150 GetImmediateDataAs<const GLfloat*>(c, data_size, immediate_data_size); |
| 3151 error::Error error = DoUniformMatrix4fv(location, count, transpose, value); |
| 3152 if (error != error::kNoError) { |
| 3153 return error; |
| 3154 } |
| 3155 return error::kNoError; |
| 3156 } |
| 3157 |
| 3158 error::Error GLES2DecoderPassthroughImpl::HandleUniformMatrix4x2fvImmediate( |
| 3159 uint32_t immediate_data_size, |
| 3160 const void* cmd_data) { |
| 3161 const gles2::cmds::UniformMatrix4x2fvImmediate& c = |
| 3162 *static_cast<const gles2::cmds::UniformMatrix4x2fvImmediate*>(cmd_data); |
| 3163 (void)c; |
| 3164 GLint location = static_cast<GLint>(c.location); |
| 3165 GLsizei count = static_cast<GLsizei>(c.count); |
| 3166 GLboolean transpose = static_cast<GLboolean>(c.transpose); |
| 3167 uint32_t data_size = 0; |
| 3168 if (count >= 0 && |
| 3169 !GLES2Util::ComputeDataSize(count, sizeof(GLfloat), 8, &data_size)) { |
| 3170 return error::kOutOfBounds; |
| 3171 } |
| 3172 if (data_size > immediate_data_size) { |
| 3173 return error::kOutOfBounds; |
| 3174 } |
| 3175 const GLfloat* value = |
| 3176 GetImmediateDataAs<const GLfloat*>(c, data_size, immediate_data_size); |
| 3177 error::Error error = DoUniformMatrix4x2fv(location, count, transpose, value); |
| 3178 if (error != error::kNoError) { |
| 3179 return error; |
| 3180 } |
| 3181 return error::kNoError; |
| 3182 } |
| 3183 |
| 3184 error::Error GLES2DecoderPassthroughImpl::HandleUniformMatrix4x3fvImmediate( |
| 3185 uint32_t immediate_data_size, |
| 3186 const void* cmd_data) { |
| 3187 const gles2::cmds::UniformMatrix4x3fvImmediate& c = |
| 3188 *static_cast<const gles2::cmds::UniformMatrix4x3fvImmediate*>(cmd_data); |
| 3189 (void)c; |
| 3190 GLint location = static_cast<GLint>(c.location); |
| 3191 GLsizei count = static_cast<GLsizei>(c.count); |
| 3192 GLboolean transpose = static_cast<GLboolean>(c.transpose); |
| 3193 uint32_t data_size = 0; |
| 3194 if (count >= 0 && |
| 3195 !GLES2Util::ComputeDataSize(count, sizeof(GLfloat), 12, &data_size)) { |
| 3196 return error::kOutOfBounds; |
| 3197 } |
| 3198 if (data_size > immediate_data_size) { |
| 3199 return error::kOutOfBounds; |
| 3200 } |
| 3201 const GLfloat* value = |
| 3202 GetImmediateDataAs<const GLfloat*>(c, data_size, immediate_data_size); |
| 3203 error::Error error = DoUniformMatrix4x3fv(location, count, transpose, value); |
| 3204 if (error != error::kNoError) { |
| 3205 return error; |
| 3206 } |
| 3207 return error::kNoError; |
| 3208 } |
| 3209 |
| 3210 error::Error GLES2DecoderPassthroughImpl::HandleUseProgram( |
| 3211 uint32_t immediate_data_size, |
| 3212 const void* cmd_data) { |
| 3213 const gles2::cmds::UseProgram& c = |
| 3214 *static_cast<const gles2::cmds::UseProgram*>(cmd_data); |
| 3215 (void)c; |
| 3216 GLuint program = c.program; |
| 3217 error::Error error = DoUseProgram(program); |
| 3218 if (error != error::kNoError) { |
| 3219 return error; |
| 3220 } |
| 3221 return error::kNoError; |
| 3222 } |
| 3223 |
| 3224 error::Error GLES2DecoderPassthroughImpl::HandleValidateProgram( |
| 3225 uint32_t immediate_data_size, |
| 3226 const void* cmd_data) { |
| 3227 const gles2::cmds::ValidateProgram& c = |
| 3228 *static_cast<const gles2::cmds::ValidateProgram*>(cmd_data); |
| 3229 (void)c; |
| 3230 GLuint program = c.program; |
| 3231 error::Error error = DoValidateProgram(program); |
| 3232 if (error != error::kNoError) { |
| 3233 return error; |
| 3234 } |
| 3235 return error::kNoError; |
| 3236 } |
| 3237 |
| 3238 error::Error GLES2DecoderPassthroughImpl::HandleVertexAttrib1f( |
| 3239 uint32_t immediate_data_size, |
| 3240 const void* cmd_data) { |
| 3241 const gles2::cmds::VertexAttrib1f& c = |
| 3242 *static_cast<const gles2::cmds::VertexAttrib1f*>(cmd_data); |
| 3243 (void)c; |
| 3244 GLuint indx = static_cast<GLuint>(c.indx); |
| 3245 GLfloat x = static_cast<GLfloat>(c.x); |
| 3246 error::Error error = DoVertexAttrib1f(indx, x); |
| 3247 if (error != error::kNoError) { |
| 3248 return error; |
| 3249 } |
| 3250 return error::kNoError; |
| 3251 } |
| 3252 |
| 3253 error::Error GLES2DecoderPassthroughImpl::HandleVertexAttrib1fvImmediate( |
| 3254 uint32_t immediate_data_size, |
| 3255 const void* cmd_data) { |
| 3256 const gles2::cmds::VertexAttrib1fvImmediate& c = |
| 3257 *static_cast<const gles2::cmds::VertexAttrib1fvImmediate*>(cmd_data); |
| 3258 (void)c; |
| 3259 GLuint indx = static_cast<GLuint>(c.indx); |
| 3260 uint32_t data_size; |
| 3261 if (!GLES2Util::ComputeDataSize(1, sizeof(GLfloat), 1, &data_size)) { |
| 3262 return error::kOutOfBounds; |
| 3263 } |
| 3264 if (data_size > immediate_data_size) { |
| 3265 return error::kOutOfBounds; |
| 3266 } |
| 3267 const GLfloat* values = |
| 3268 GetImmediateDataAs<const GLfloat*>(c, data_size, immediate_data_size); |
| 3269 error::Error error = DoVertexAttrib1fv(indx, values); |
| 3270 if (error != error::kNoError) { |
| 3271 return error; |
| 3272 } |
| 3273 return error::kNoError; |
| 3274 } |
| 3275 |
| 3276 error::Error GLES2DecoderPassthroughImpl::HandleVertexAttrib2f( |
| 3277 uint32_t immediate_data_size, |
| 3278 const void* cmd_data) { |
| 3279 const gles2::cmds::VertexAttrib2f& c = |
| 3280 *static_cast<const gles2::cmds::VertexAttrib2f*>(cmd_data); |
| 3281 (void)c; |
| 3282 GLuint indx = static_cast<GLuint>(c.indx); |
| 3283 GLfloat x = static_cast<GLfloat>(c.x); |
| 3284 GLfloat y = static_cast<GLfloat>(c.y); |
| 3285 error::Error error = DoVertexAttrib2f(indx, x, y); |
| 3286 if (error != error::kNoError) { |
| 3287 return error; |
| 3288 } |
| 3289 return error::kNoError; |
| 3290 } |
| 3291 |
| 3292 error::Error GLES2DecoderPassthroughImpl::HandleVertexAttrib2fvImmediate( |
| 3293 uint32_t immediate_data_size, |
| 3294 const void* cmd_data) { |
| 3295 const gles2::cmds::VertexAttrib2fvImmediate& c = |
| 3296 *static_cast<const gles2::cmds::VertexAttrib2fvImmediate*>(cmd_data); |
| 3297 (void)c; |
| 3298 GLuint indx = static_cast<GLuint>(c.indx); |
| 3299 uint32_t data_size; |
| 3300 if (!GLES2Util::ComputeDataSize(1, sizeof(GLfloat), 2, &data_size)) { |
| 3301 return error::kOutOfBounds; |
| 3302 } |
| 3303 if (data_size > immediate_data_size) { |
| 3304 return error::kOutOfBounds; |
| 3305 } |
| 3306 const GLfloat* values = |
| 3307 GetImmediateDataAs<const GLfloat*>(c, data_size, immediate_data_size); |
| 3308 error::Error error = DoVertexAttrib2fv(indx, values); |
| 3309 if (error != error::kNoError) { |
| 3310 return error; |
| 3311 } |
| 3312 return error::kNoError; |
| 3313 } |
| 3314 |
| 3315 error::Error GLES2DecoderPassthroughImpl::HandleVertexAttrib3f( |
| 3316 uint32_t immediate_data_size, |
| 3317 const void* cmd_data) { |
| 3318 const gles2::cmds::VertexAttrib3f& c = |
| 3319 *static_cast<const gles2::cmds::VertexAttrib3f*>(cmd_data); |
| 3320 (void)c; |
| 3321 GLuint indx = static_cast<GLuint>(c.indx); |
| 3322 GLfloat x = static_cast<GLfloat>(c.x); |
| 3323 GLfloat y = static_cast<GLfloat>(c.y); |
| 3324 GLfloat z = static_cast<GLfloat>(c.z); |
| 3325 error::Error error = DoVertexAttrib3f(indx, x, y, z); |
| 3326 if (error != error::kNoError) { |
| 3327 return error; |
| 3328 } |
| 3329 return error::kNoError; |
| 3330 } |
| 3331 |
| 3332 error::Error GLES2DecoderPassthroughImpl::HandleVertexAttrib3fvImmediate( |
| 3333 uint32_t immediate_data_size, |
| 3334 const void* cmd_data) { |
| 3335 const gles2::cmds::VertexAttrib3fvImmediate& c = |
| 3336 *static_cast<const gles2::cmds::VertexAttrib3fvImmediate*>(cmd_data); |
| 3337 (void)c; |
| 3338 GLuint indx = static_cast<GLuint>(c.indx); |
| 3339 uint32_t data_size; |
| 3340 if (!GLES2Util::ComputeDataSize(1, sizeof(GLfloat), 3, &data_size)) { |
| 3341 return error::kOutOfBounds; |
| 3342 } |
| 3343 if (data_size > immediate_data_size) { |
| 3344 return error::kOutOfBounds; |
| 3345 } |
| 3346 const GLfloat* values = |
| 3347 GetImmediateDataAs<const GLfloat*>(c, data_size, immediate_data_size); |
| 3348 error::Error error = DoVertexAttrib3fv(indx, values); |
| 3349 if (error != error::kNoError) { |
| 3350 return error; |
| 3351 } |
| 3352 return error::kNoError; |
| 3353 } |
| 3354 |
| 3355 error::Error GLES2DecoderPassthroughImpl::HandleVertexAttrib4f( |
| 3356 uint32_t immediate_data_size, |
| 3357 const void* cmd_data) { |
| 3358 const gles2::cmds::VertexAttrib4f& c = |
| 3359 *static_cast<const gles2::cmds::VertexAttrib4f*>(cmd_data); |
| 3360 (void)c; |
| 3361 GLuint indx = static_cast<GLuint>(c.indx); |
| 3362 GLfloat x = static_cast<GLfloat>(c.x); |
| 3363 GLfloat y = static_cast<GLfloat>(c.y); |
| 3364 GLfloat z = static_cast<GLfloat>(c.z); |
| 3365 GLfloat w = static_cast<GLfloat>(c.w); |
| 3366 error::Error error = DoVertexAttrib4f(indx, x, y, z, w); |
| 3367 if (error != error::kNoError) { |
| 3368 return error; |
| 3369 } |
| 3370 return error::kNoError; |
| 3371 } |
| 3372 |
| 3373 error::Error GLES2DecoderPassthroughImpl::HandleVertexAttrib4fvImmediate( |
| 3374 uint32_t immediate_data_size, |
| 3375 const void* cmd_data) { |
| 3376 const gles2::cmds::VertexAttrib4fvImmediate& c = |
| 3377 *static_cast<const gles2::cmds::VertexAttrib4fvImmediate*>(cmd_data); |
| 3378 (void)c; |
| 3379 GLuint indx = static_cast<GLuint>(c.indx); |
| 3380 uint32_t data_size; |
| 3381 if (!GLES2Util::ComputeDataSize(1, sizeof(GLfloat), 4, &data_size)) { |
| 3382 return error::kOutOfBounds; |
| 3383 } |
| 3384 if (data_size > immediate_data_size) { |
| 3385 return error::kOutOfBounds; |
| 3386 } |
| 3387 const GLfloat* values = |
| 3388 GetImmediateDataAs<const GLfloat*>(c, data_size, immediate_data_size); |
| 3389 error::Error error = DoVertexAttrib4fv(indx, values); |
| 3390 if (error != error::kNoError) { |
| 3391 return error; |
| 3392 } |
| 3393 return error::kNoError; |
| 3394 } |
| 3395 |
| 3396 error::Error GLES2DecoderPassthroughImpl::HandleVertexAttribI4i( |
| 3397 uint32_t immediate_data_size, |
| 3398 const void* cmd_data) { |
| 3399 const gles2::cmds::VertexAttribI4i& c = |
| 3400 *static_cast<const gles2::cmds::VertexAttribI4i*>(cmd_data); |
| 3401 (void)c; |
| 3402 GLuint indx = static_cast<GLuint>(c.indx); |
| 3403 GLint x = static_cast<GLint>(c.x); |
| 3404 GLint y = static_cast<GLint>(c.y); |
| 3405 GLint z = static_cast<GLint>(c.z); |
| 3406 GLint w = static_cast<GLint>(c.w); |
| 3407 error::Error error = DoVertexAttribI4i(indx, x, y, z, w); |
| 3408 if (error != error::kNoError) { |
| 3409 return error; |
| 3410 } |
| 3411 return error::kNoError; |
| 3412 } |
| 3413 |
| 3414 error::Error GLES2DecoderPassthroughImpl::HandleVertexAttribI4ivImmediate( |
| 3415 uint32_t immediate_data_size, |
| 3416 const void* cmd_data) { |
| 3417 const gles2::cmds::VertexAttribI4ivImmediate& c = |
| 3418 *static_cast<const gles2::cmds::VertexAttribI4ivImmediate*>(cmd_data); |
| 3419 (void)c; |
| 3420 GLuint indx = static_cast<GLuint>(c.indx); |
| 3421 uint32_t data_size; |
| 3422 if (!GLES2Util::ComputeDataSize(1, sizeof(GLint), 4, &data_size)) { |
| 3423 return error::kOutOfBounds; |
| 3424 } |
| 3425 if (data_size > immediate_data_size) { |
| 3426 return error::kOutOfBounds; |
| 3427 } |
| 3428 const GLint* values = |
| 3429 GetImmediateDataAs<const GLint*>(c, data_size, immediate_data_size); |
| 3430 error::Error error = DoVertexAttribI4iv(indx, values); |
| 3431 if (error != error::kNoError) { |
| 3432 return error; |
| 3433 } |
| 3434 return error::kNoError; |
| 3435 } |
| 3436 |
| 3437 error::Error GLES2DecoderPassthroughImpl::HandleVertexAttribI4ui( |
| 3438 uint32_t immediate_data_size, |
| 3439 const void* cmd_data) { |
| 3440 const gles2::cmds::VertexAttribI4ui& c = |
| 3441 *static_cast<const gles2::cmds::VertexAttribI4ui*>(cmd_data); |
| 3442 (void)c; |
| 3443 GLuint indx = static_cast<GLuint>(c.indx); |
| 3444 GLuint x = static_cast<GLuint>(c.x); |
| 3445 GLuint y = static_cast<GLuint>(c.y); |
| 3446 GLuint z = static_cast<GLuint>(c.z); |
| 3447 GLuint w = static_cast<GLuint>(c.w); |
| 3448 error::Error error = DoVertexAttribI4ui(indx, x, y, z, w); |
| 3449 if (error != error::kNoError) { |
| 3450 return error; |
| 3451 } |
| 3452 return error::kNoError; |
| 3453 } |
| 3454 |
| 3455 error::Error GLES2DecoderPassthroughImpl::HandleVertexAttribI4uivImmediate( |
| 3456 uint32_t immediate_data_size, |
| 3457 const void* cmd_data) { |
| 3458 const gles2::cmds::VertexAttribI4uivImmediate& c = |
| 3459 *static_cast<const gles2::cmds::VertexAttribI4uivImmediate*>(cmd_data); |
| 3460 (void)c; |
| 3461 GLuint indx = static_cast<GLuint>(c.indx); |
| 3462 uint32_t data_size; |
| 3463 if (!GLES2Util::ComputeDataSize(1, sizeof(GLuint), 4, &data_size)) { |
| 3464 return error::kOutOfBounds; |
| 3465 } |
| 3466 if (data_size > immediate_data_size) { |
| 3467 return error::kOutOfBounds; |
| 3468 } |
| 3469 const GLuint* values = |
| 3470 GetImmediateDataAs<const GLuint*>(c, data_size, immediate_data_size); |
| 3471 error::Error error = DoVertexAttribI4uiv(indx, values); |
| 3472 if (error != error::kNoError) { |
| 3473 return error; |
| 3474 } |
| 3475 return error::kNoError; |
| 3476 } |
| 3477 |
| 3478 error::Error GLES2DecoderPassthroughImpl::HandleViewport( |
| 3479 uint32_t immediate_data_size, |
| 3480 const void* cmd_data) { |
| 3481 const gles2::cmds::Viewport& c = |
| 3482 *static_cast<const gles2::cmds::Viewport*>(cmd_data); |
| 3483 (void)c; |
| 3484 GLint x = static_cast<GLint>(c.x); |
| 3485 GLint y = static_cast<GLint>(c.y); |
| 3486 GLsizei width = static_cast<GLsizei>(c.width); |
| 3487 GLsizei height = static_cast<GLsizei>(c.height); |
| 3488 error::Error error = DoViewport(x, y, width, height); |
| 3489 if (error != error::kNoError) { |
| 3490 return error; |
| 3491 } |
| 3492 return error::kNoError; |
| 3493 } |
| 3494 |
| 3495 error::Error GLES2DecoderPassthroughImpl::HandleBlitFramebufferCHROMIUM( |
| 3496 uint32_t immediate_data_size, |
| 3497 const void* cmd_data) { |
| 3498 const gles2::cmds::BlitFramebufferCHROMIUM& c = |
| 3499 *static_cast<const gles2::cmds::BlitFramebufferCHROMIUM*>(cmd_data); |
| 3500 (void)c; |
| 3501 GLint srcX0 = static_cast<GLint>(c.srcX0); |
| 3502 GLint srcY0 = static_cast<GLint>(c.srcY0); |
| 3503 GLint srcX1 = static_cast<GLint>(c.srcX1); |
| 3504 GLint srcY1 = static_cast<GLint>(c.srcY1); |
| 3505 GLint dstX0 = static_cast<GLint>(c.dstX0); |
| 3506 GLint dstY0 = static_cast<GLint>(c.dstY0); |
| 3507 GLint dstX1 = static_cast<GLint>(c.dstX1); |
| 3508 GLint dstY1 = static_cast<GLint>(c.dstY1); |
| 3509 GLbitfield mask = static_cast<GLbitfield>(c.mask); |
| 3510 GLenum filter = static_cast<GLenum>(c.filter); |
| 3511 error::Error error = DoBlitFramebufferCHROMIUM( |
| 3512 srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter); |
| 3513 if (error != error::kNoError) { |
| 3514 return error; |
| 3515 } |
| 3516 return error::kNoError; |
| 3517 } |
| 3518 |
| 3519 error::Error |
| 3520 GLES2DecoderPassthroughImpl::HandleRenderbufferStorageMultisampleCHROMIUM( |
| 3521 uint32_t immediate_data_size, |
| 3522 const void* cmd_data) { |
| 3523 const gles2::cmds::RenderbufferStorageMultisampleCHROMIUM& c = |
| 3524 *static_cast<const gles2::cmds::RenderbufferStorageMultisampleCHROMIUM*>( |
| 3525 cmd_data); |
| 3526 (void)c; |
| 3527 GLenum target = static_cast<GLenum>(c.target); |
| 3528 GLsizei samples = static_cast<GLsizei>(c.samples); |
| 3529 GLenum internalformat = static_cast<GLenum>(c.internalformat); |
| 3530 GLsizei width = static_cast<GLsizei>(c.width); |
| 3531 GLsizei height = static_cast<GLsizei>(c.height); |
| 3532 error::Error error = DoRenderbufferStorageMultisampleCHROMIUM( |
| 3533 target, samples, internalformat, width, height); |
| 3534 if (error != error::kNoError) { |
| 3535 return error; |
| 3536 } |
| 3537 return error::kNoError; |
| 3538 } |
| 3539 |
| 3540 error::Error |
| 3541 GLES2DecoderPassthroughImpl::HandleRenderbufferStorageMultisampleEXT( |
| 3542 uint32_t immediate_data_size, |
| 3543 const void* cmd_data) { |
| 3544 const gles2::cmds::RenderbufferStorageMultisampleEXT& c = |
| 3545 *static_cast<const gles2::cmds::RenderbufferStorageMultisampleEXT*>( |
| 3546 cmd_data); |
| 3547 (void)c; |
| 3548 GLenum target = static_cast<GLenum>(c.target); |
| 3549 GLsizei samples = static_cast<GLsizei>(c.samples); |
| 3550 GLenum internalformat = static_cast<GLenum>(c.internalformat); |
| 3551 GLsizei width = static_cast<GLsizei>(c.width); |
| 3552 GLsizei height = static_cast<GLsizei>(c.height); |
| 3553 error::Error error = DoRenderbufferStorageMultisampleEXT( |
| 3554 target, samples, internalformat, width, height); |
| 3555 if (error != error::kNoError) { |
| 3556 return error; |
| 3557 } |
| 3558 return error::kNoError; |
| 3559 } |
| 3560 |
| 3561 error::Error |
| 3562 GLES2DecoderPassthroughImpl::HandleFramebufferTexture2DMultisampleEXT( |
| 3563 uint32_t immediate_data_size, |
| 3564 const void* cmd_data) { |
| 3565 const gles2::cmds::FramebufferTexture2DMultisampleEXT& c = |
| 3566 *static_cast<const gles2::cmds::FramebufferTexture2DMultisampleEXT*>( |
| 3567 cmd_data); |
| 3568 (void)c; |
| 3569 GLenum target = static_cast<GLenum>(c.target); |
| 3570 GLenum attachment = static_cast<GLenum>(c.attachment); |
| 3571 GLenum textarget = static_cast<GLenum>(c.textarget); |
| 3572 GLuint texture = c.texture; |
| 3573 GLint level = static_cast<GLint>(c.level); |
| 3574 GLsizei samples = static_cast<GLsizei>(c.samples); |
| 3575 error::Error error = DoFramebufferTexture2DMultisampleEXT( |
| 3576 target, attachment, textarget, texture, level, samples); |
| 3577 if (error != error::kNoError) { |
| 3578 return error; |
| 3579 } |
| 3580 return error::kNoError; |
| 3581 } |
| 3582 |
| 3583 error::Error GLES2DecoderPassthroughImpl::HandleTexStorage2DEXT( |
| 3584 uint32_t immediate_data_size, |
| 3585 const void* cmd_data) { |
| 3586 const gles2::cmds::TexStorage2DEXT& c = |
| 3587 *static_cast<const gles2::cmds::TexStorage2DEXT*>(cmd_data); |
| 3588 (void)c; |
| 3589 GLenum target = static_cast<GLenum>(c.target); |
| 3590 GLsizei levels = static_cast<GLsizei>(c.levels); |
| 3591 GLenum internalFormat = static_cast<GLenum>(c.internalFormat); |
| 3592 GLsizei width = static_cast<GLsizei>(c.width); |
| 3593 GLsizei height = static_cast<GLsizei>(c.height); |
| 3594 error::Error error = |
| 3595 DoTexStorage2DEXT(target, levels, internalFormat, width, height); |
| 3596 if (error != error::kNoError) { |
| 3597 return error; |
| 3598 } |
| 3599 return error::kNoError; |
| 3600 } |
| 3601 |
| 3602 error::Error GLES2DecoderPassthroughImpl::HandleGenQueriesEXTImmediate( |
| 3603 uint32_t immediate_data_size, |
| 3604 const void* cmd_data) { |
| 3605 const gles2::cmds::GenQueriesEXTImmediate& c = |
| 3606 *static_cast<const gles2::cmds::GenQueriesEXTImmediate*>(cmd_data); |
| 3607 (void)c; |
| 3608 GLsizei n = static_cast<GLsizei>(c.n); |
| 3609 uint32_t data_size; |
| 3610 if (!SafeMultiplyUint32(n, sizeof(GLuint), &data_size)) { |
| 3611 return error::kOutOfBounds; |
| 3612 } |
| 3613 GLuint* queries = |
| 3614 GetImmediateDataAs<GLuint*>(c, data_size, immediate_data_size); |
| 3615 error::Error error = DoGenQueriesEXT(n, queries); |
| 3616 if (error != error::kNoError) { |
| 3617 return error; |
| 3618 } |
| 3619 return error::kNoError; |
| 3620 } |
| 3621 |
| 3622 error::Error GLES2DecoderPassthroughImpl::HandleDeleteQueriesEXTImmediate( |
| 3623 uint32_t immediate_data_size, |
| 3624 const void* cmd_data) { |
| 3625 const gles2::cmds::DeleteQueriesEXTImmediate& c = |
| 3626 *static_cast<const gles2::cmds::DeleteQueriesEXTImmediate*>(cmd_data); |
| 3627 (void)c; |
| 3628 GLsizei n = static_cast<GLsizei>(c.n); |
| 3629 uint32_t data_size; |
| 3630 if (!SafeMultiplyUint32(n, sizeof(GLuint), &data_size)) { |
| 3631 return error::kOutOfBounds; |
| 3632 } |
| 3633 const GLuint* queries = |
| 3634 GetImmediateDataAs<const GLuint*>(c, data_size, immediate_data_size); |
| 3635 error::Error error = DoDeleteQueriesEXT(n, queries); |
| 3636 if (error != error::kNoError) { |
| 3637 return error; |
| 3638 } |
| 3639 return error::kNoError; |
| 3640 } |
| 3641 |
| 3642 error::Error GLES2DecoderPassthroughImpl::HandleBeginTransformFeedback( |
| 3643 uint32_t immediate_data_size, |
| 3644 const void* cmd_data) { |
| 3645 const gles2::cmds::BeginTransformFeedback& c = |
| 3646 *static_cast<const gles2::cmds::BeginTransformFeedback*>(cmd_data); |
| 3647 (void)c; |
| 3648 GLenum primitivemode = static_cast<GLenum>(c.primitivemode); |
| 3649 error::Error error = DoBeginTransformFeedback(primitivemode); |
| 3650 if (error != error::kNoError) { |
| 3651 return error; |
| 3652 } |
| 3653 return error::kNoError; |
| 3654 } |
| 3655 |
| 3656 error::Error GLES2DecoderPassthroughImpl::HandleEndTransformFeedback( |
| 3657 uint32_t immediate_data_size, |
| 3658 const void* cmd_data) { |
| 3659 const gles2::cmds::EndTransformFeedback& c = |
| 3660 *static_cast<const gles2::cmds::EndTransformFeedback*>(cmd_data); |
| 3661 (void)c; |
| 3662 error::Error error = DoEndTransformFeedback(); |
| 3663 if (error != error::kNoError) { |
| 3664 return error; |
| 3665 } |
| 3666 return error::kNoError; |
| 3667 } |
| 3668 |
| 3669 error::Error GLES2DecoderPassthroughImpl::HandlePopGroupMarkerEXT( |
| 3670 uint32_t immediate_data_size, |
| 3671 const void* cmd_data) { |
| 3672 const gles2::cmds::PopGroupMarkerEXT& c = |
| 3673 *static_cast<const gles2::cmds::PopGroupMarkerEXT*>(cmd_data); |
| 3674 (void)c; |
| 3675 error::Error error = DoPopGroupMarkerEXT(); |
| 3676 if (error != error::kNoError) { |
| 3677 return error; |
| 3678 } |
| 3679 return error::kNoError; |
| 3680 } |
| 3681 |
| 3682 error::Error GLES2DecoderPassthroughImpl::HandleGenVertexArraysOESImmediate( |
| 3683 uint32_t immediate_data_size, |
| 3684 const void* cmd_data) { |
| 3685 const gles2::cmds::GenVertexArraysOESImmediate& c = |
| 3686 *static_cast<const gles2::cmds::GenVertexArraysOESImmediate*>(cmd_data); |
| 3687 (void)c; |
| 3688 GLsizei n = static_cast<GLsizei>(c.n); |
| 3689 uint32_t data_size; |
| 3690 if (!SafeMultiplyUint32(n, sizeof(GLuint), &data_size)) { |
| 3691 return error::kOutOfBounds; |
| 3692 } |
| 3693 GLuint* arrays = |
| 3694 GetImmediateDataAs<GLuint*>(c, data_size, immediate_data_size); |
| 3695 error::Error error = DoGenVertexArraysOES(n, arrays); |
| 3696 if (error != error::kNoError) { |
| 3697 return error; |
| 3698 } |
| 3699 return error::kNoError; |
| 3700 } |
| 3701 |
| 3702 error::Error GLES2DecoderPassthroughImpl::HandleDeleteVertexArraysOESImmediate( |
| 3703 uint32_t immediate_data_size, |
| 3704 const void* cmd_data) { |
| 3705 const gles2::cmds::DeleteVertexArraysOESImmediate& c = |
| 3706 *static_cast<const gles2::cmds::DeleteVertexArraysOESImmediate*>( |
| 3707 cmd_data); |
| 3708 (void)c; |
| 3709 GLsizei n = static_cast<GLsizei>(c.n); |
| 3710 uint32_t data_size; |
| 3711 if (!SafeMultiplyUint32(n, sizeof(GLuint), &data_size)) { |
| 3712 return error::kOutOfBounds; |
| 3713 } |
| 3714 const GLuint* arrays = |
| 3715 GetImmediateDataAs<const GLuint*>(c, data_size, immediate_data_size); |
| 3716 error::Error error = DoDeleteVertexArraysOES(n, arrays); |
| 3717 if (error != error::kNoError) { |
| 3718 return error; |
| 3719 } |
| 3720 return error::kNoError; |
| 3721 } |
| 3722 |
| 3723 error::Error GLES2DecoderPassthroughImpl::HandleIsVertexArrayOES( |
| 3724 uint32_t immediate_data_size, |
| 3725 const void* cmd_data) { |
| 3726 const gles2::cmds::IsVertexArrayOES& c = |
| 3727 *static_cast<const gles2::cmds::IsVertexArrayOES*>(cmd_data); |
| 3728 (void)c; |
| 3729 GLuint array = c.array; |
| 3730 typedef cmds::IsVertexArrayOES::Result Result; |
| 3731 Result* result = GetSharedMemoryAs<Result*>( |
| 3732 c.result_shm_id, c.result_shm_offset, sizeof(*result)); |
| 3733 if (!result) { |
| 3734 return error::kOutOfBounds; |
| 3735 } |
| 3736 error::Error error = DoIsVertexArrayOES(array, result); |
| 3737 if (error != error::kNoError) { |
| 3738 return error; |
| 3739 } |
| 3740 return error::kNoError; |
| 3741 } |
| 3742 |
| 3743 error::Error GLES2DecoderPassthroughImpl::HandleBindVertexArrayOES( |
| 3744 uint32_t immediate_data_size, |
| 3745 const void* cmd_data) { |
| 3746 const gles2::cmds::BindVertexArrayOES& c = |
| 3747 *static_cast<const gles2::cmds::BindVertexArrayOES*>(cmd_data); |
| 3748 (void)c; |
| 3749 GLuint array = c.array; |
| 3750 error::Error error = DoBindVertexArrayOES(array); |
| 3751 if (error != error::kNoError) { |
| 3752 return error; |
| 3753 } |
| 3754 return error::kNoError; |
| 3755 } |
| 3756 |
| 3757 error::Error GLES2DecoderPassthroughImpl::HandleSwapBuffers( |
| 3758 uint32_t immediate_data_size, |
| 3759 const void* cmd_data) { |
| 3760 const gles2::cmds::SwapBuffers& c = |
| 3761 *static_cast<const gles2::cmds::SwapBuffers*>(cmd_data); |
| 3762 (void)c; |
| 3763 error::Error error = DoSwapBuffers(); |
| 3764 if (error != error::kNoError) { |
| 3765 return error; |
| 3766 } |
| 3767 return error::kNoError; |
| 3768 } |
| 3769 |
| 3770 error::Error GLES2DecoderPassthroughImpl::HandleGetMaxValueInBufferCHROMIUM( |
| 3771 uint32_t immediate_data_size, |
| 3772 const void* cmd_data) { |
| 3773 const gles2::cmds::GetMaxValueInBufferCHROMIUM& c = |
| 3774 *static_cast<const gles2::cmds::GetMaxValueInBufferCHROMIUM*>(cmd_data); |
| 3775 (void)c; |
| 3776 GLuint buffer_id = c.buffer_id; |
| 3777 GLsizei count = static_cast<GLsizei>(c.count); |
| 3778 GLenum type = static_cast<GLenum>(c.type); |
| 3779 GLuint offset = static_cast<GLuint>(c.offset); |
| 3780 typedef cmds::GetMaxValueInBufferCHROMIUM::Result Result; |
| 3781 Result* result = GetSharedMemoryAs<Result*>( |
| 3782 c.result_shm_id, c.result_shm_offset, sizeof(*result)); |
| 3783 if (!result) { |
| 3784 return error::kOutOfBounds; |
| 3785 } |
| 3786 error::Error error = |
| 3787 DoGetMaxValueInBufferCHROMIUM(buffer_id, count, type, offset, result); |
| 3788 if (error != error::kNoError) { |
| 3789 return error; |
| 3790 } |
| 3791 return error::kNoError; |
| 3792 } |
| 3793 |
| 3794 error::Error GLES2DecoderPassthroughImpl::HandleTexImageIOSurface2DCHROMIUM( |
| 3795 uint32_t immediate_data_size, |
| 3796 const void* cmd_data) { |
| 3797 const gles2::cmds::TexImageIOSurface2DCHROMIUM& c = |
| 3798 *static_cast<const gles2::cmds::TexImageIOSurface2DCHROMIUM*>(cmd_data); |
| 3799 (void)c; |
| 3800 GLenum target = static_cast<GLenum>(c.target); |
| 3801 GLsizei width = static_cast<GLsizei>(c.width); |
| 3802 GLsizei height = static_cast<GLsizei>(c.height); |
| 3803 GLuint ioSurfaceId = static_cast<GLuint>(c.ioSurfaceId); |
| 3804 GLuint plane = static_cast<GLuint>(c.plane); |
| 3805 error::Error error = |
| 3806 DoTexImageIOSurface2DCHROMIUM(target, width, height, ioSurfaceId, plane); |
| 3807 if (error != error::kNoError) { |
| 3808 return error; |
| 3809 } |
| 3810 return error::kNoError; |
| 3811 } |
| 3812 |
| 3813 error::Error GLES2DecoderPassthroughImpl::HandleCopyTextureCHROMIUM( |
| 3814 uint32_t immediate_data_size, |
| 3815 const void* cmd_data) { |
| 3816 const gles2::cmds::CopyTextureCHROMIUM& c = |
| 3817 *static_cast<const gles2::cmds::CopyTextureCHROMIUM*>(cmd_data); |
| 3818 (void)c; |
| 3819 GLenum source_id = static_cast<GLenum>(c.source_id); |
| 3820 GLenum dest_id = static_cast<GLenum>(c.dest_id); |
| 3821 GLint internalformat = static_cast<GLint>(c.internalformat); |
| 3822 GLenum dest_type = static_cast<GLenum>(c.dest_type); |
| 3823 GLboolean unpack_flip_y = static_cast<GLboolean>(c.unpack_flip_y); |
| 3824 GLboolean unpack_premultiply_alpha = |
| 3825 static_cast<GLboolean>(c.unpack_premultiply_alpha); |
| 3826 GLboolean unpack_unmultiply_alpha = |
| 3827 static_cast<GLboolean>(c.unpack_unmultiply_alpha); |
| 3828 error::Error error = DoCopyTextureCHROMIUM( |
| 3829 source_id, dest_id, internalformat, dest_type, unpack_flip_y, |
| 3830 unpack_premultiply_alpha, unpack_unmultiply_alpha); |
| 3831 if (error != error::kNoError) { |
| 3832 return error; |
| 3833 } |
| 3834 return error::kNoError; |
| 3835 } |
| 3836 |
| 3837 error::Error GLES2DecoderPassthroughImpl::HandleCopySubTextureCHROMIUM( |
| 3838 uint32_t immediate_data_size, |
| 3839 const void* cmd_data) { |
| 3840 const gles2::cmds::CopySubTextureCHROMIUM& c = |
| 3841 *static_cast<const gles2::cmds::CopySubTextureCHROMIUM*>(cmd_data); |
| 3842 (void)c; |
| 3843 GLenum source_id = static_cast<GLenum>(c.source_id); |
| 3844 GLenum dest_id = static_cast<GLenum>(c.dest_id); |
| 3845 GLint xoffset = static_cast<GLint>(c.xoffset); |
| 3846 GLint yoffset = static_cast<GLint>(c.yoffset); |
| 3847 GLint x = static_cast<GLint>(c.x); |
| 3848 GLint y = static_cast<GLint>(c.y); |
| 3849 GLsizei width = static_cast<GLsizei>(c.width); |
| 3850 GLsizei height = static_cast<GLsizei>(c.height); |
| 3851 GLboolean unpack_flip_y = static_cast<GLboolean>(c.unpack_flip_y); |
| 3852 GLboolean unpack_premultiply_alpha = |
| 3853 static_cast<GLboolean>(c.unpack_premultiply_alpha); |
| 3854 GLboolean unpack_unmultiply_alpha = |
| 3855 static_cast<GLboolean>(c.unpack_unmultiply_alpha); |
| 3856 error::Error error = DoCopySubTextureCHROMIUM( |
| 3857 source_id, dest_id, xoffset, yoffset, x, y, width, height, unpack_flip_y, |
| 3858 unpack_premultiply_alpha, unpack_unmultiply_alpha); |
| 3859 if (error != error::kNoError) { |
| 3860 return error; |
| 3861 } |
| 3862 return error::kNoError; |
| 3863 } |
| 3864 |
| 3865 error::Error GLES2DecoderPassthroughImpl::HandleCompressedCopyTextureCHROMIUM( |
| 3866 uint32_t immediate_data_size, |
| 3867 const void* cmd_data) { |
| 3868 const gles2::cmds::CompressedCopyTextureCHROMIUM& c = |
| 3869 *static_cast<const gles2::cmds::CompressedCopyTextureCHROMIUM*>(cmd_data); |
| 3870 (void)c; |
| 3871 GLenum source_id = static_cast<GLenum>(c.source_id); |
| 3872 GLenum dest_id = static_cast<GLenum>(c.dest_id); |
| 3873 error::Error error = DoCompressedCopyTextureCHROMIUM(source_id, dest_id); |
| 3874 if (error != error::kNoError) { |
| 3875 return error; |
| 3876 } |
| 3877 return error::kNoError; |
| 3878 } |
| 3879 |
| 3880 error::Error GLES2DecoderPassthroughImpl::HandleProduceTextureCHROMIUMImmediate( |
| 3881 uint32_t immediate_data_size, |
| 3882 const void* cmd_data) { |
| 3883 const gles2::cmds::ProduceTextureCHROMIUMImmediate& c = |
| 3884 *static_cast<const gles2::cmds::ProduceTextureCHROMIUMImmediate*>( |
| 3885 cmd_data); |
| 3886 (void)c; |
| 3887 GLenum target = static_cast<GLenum>(c.target); |
| 3888 uint32_t data_size; |
| 3889 if (!GLES2Util::ComputeDataSize(1, sizeof(GLbyte), 64, &data_size)) { |
| 3890 return error::kOutOfBounds; |
| 3891 } |
| 3892 if (data_size > immediate_data_size) { |
| 3893 return error::kOutOfBounds; |
| 3894 } |
| 3895 const GLbyte* mailbox = |
| 3896 GetImmediateDataAs<const GLbyte*>(c, data_size, immediate_data_size); |
| 3897 error::Error error = DoProduceTextureCHROMIUM(target, mailbox); |
| 3898 if (error != error::kNoError) { |
| 3899 return error; |
| 3900 } |
| 3901 return error::kNoError; |
| 3902 } |
| 3903 |
| 3904 error::Error |
| 3905 GLES2DecoderPassthroughImpl::HandleProduceTextureDirectCHROMIUMImmediate( |
| 3906 uint32_t immediate_data_size, |
| 3907 const void* cmd_data) { |
| 3908 const gles2::cmds::ProduceTextureDirectCHROMIUMImmediate& c = |
| 3909 *static_cast<const gles2::cmds::ProduceTextureDirectCHROMIUMImmediate*>( |
| 3910 cmd_data); |
| 3911 (void)c; |
| 3912 GLuint texture = c.texture; |
| 3913 GLenum target = static_cast<GLenum>(c.target); |
| 3914 uint32_t data_size; |
| 3915 if (!GLES2Util::ComputeDataSize(1, sizeof(GLbyte), 64, &data_size)) { |
| 3916 return error::kOutOfBounds; |
| 3917 } |
| 3918 if (data_size > immediate_data_size) { |
| 3919 return error::kOutOfBounds; |
| 3920 } |
| 3921 const GLbyte* mailbox = |
| 3922 GetImmediateDataAs<const GLbyte*>(c, data_size, immediate_data_size); |
| 3923 error::Error error = DoProduceTextureDirectCHROMIUM(texture, target, mailbox); |
| 3924 if (error != error::kNoError) { |
| 3925 return error; |
| 3926 } |
| 3927 return error::kNoError; |
| 3928 } |
| 3929 |
| 3930 error::Error GLES2DecoderPassthroughImpl::HandleConsumeTextureCHROMIUMImmediate( |
| 3931 uint32_t immediate_data_size, |
| 3932 const void* cmd_data) { |
| 3933 const gles2::cmds::ConsumeTextureCHROMIUMImmediate& c = |
| 3934 *static_cast<const gles2::cmds::ConsumeTextureCHROMIUMImmediate*>( |
| 3935 cmd_data); |
| 3936 (void)c; |
| 3937 GLenum target = static_cast<GLenum>(c.target); |
| 3938 uint32_t data_size; |
| 3939 if (!GLES2Util::ComputeDataSize(1, sizeof(GLbyte), 64, &data_size)) { |
| 3940 return error::kOutOfBounds; |
| 3941 } |
| 3942 if (data_size > immediate_data_size) { |
| 3943 return error::kOutOfBounds; |
| 3944 } |
| 3945 const GLbyte* mailbox = |
| 3946 GetImmediateDataAs<const GLbyte*>(c, data_size, immediate_data_size); |
| 3947 error::Error error = DoConsumeTextureCHROMIUM(target, mailbox); |
| 3948 if (error != error::kNoError) { |
| 3949 return error; |
| 3950 } |
| 3951 return error::kNoError; |
| 3952 } |
| 3953 |
| 3954 error::Error GLES2DecoderPassthroughImpl::HandleBindTexImage2DCHROMIUM( |
| 3955 uint32_t immediate_data_size, |
| 3956 const void* cmd_data) { |
| 3957 const gles2::cmds::BindTexImage2DCHROMIUM& c = |
| 3958 *static_cast<const gles2::cmds::BindTexImage2DCHROMIUM*>(cmd_data); |
| 3959 (void)c; |
| 3960 GLenum target = static_cast<GLenum>(c.target); |
| 3961 GLint imageId = static_cast<GLint>(c.imageId); |
| 3962 error::Error error = DoBindTexImage2DCHROMIUM(target, imageId); |
| 3963 if (error != error::kNoError) { |
| 3964 return error; |
| 3965 } |
| 3966 return error::kNoError; |
| 3967 } |
| 3968 |
| 3969 error::Error GLES2DecoderPassthroughImpl::HandleReleaseTexImage2DCHROMIUM( |
| 3970 uint32_t immediate_data_size, |
| 3971 const void* cmd_data) { |
| 3972 const gles2::cmds::ReleaseTexImage2DCHROMIUM& c = |
| 3973 *static_cast<const gles2::cmds::ReleaseTexImage2DCHROMIUM*>(cmd_data); |
| 3974 (void)c; |
| 3975 GLenum target = static_cast<GLenum>(c.target); |
| 3976 GLint imageId = static_cast<GLint>(c.imageId); |
| 3977 error::Error error = DoReleaseTexImage2DCHROMIUM(target, imageId); |
| 3978 if (error != error::kNoError) { |
| 3979 return error; |
| 3980 } |
| 3981 return error::kNoError; |
| 3982 } |
| 3983 |
| 3984 error::Error GLES2DecoderPassthroughImpl::HandleTraceEndCHROMIUM( |
| 3985 uint32_t immediate_data_size, |
| 3986 const void* cmd_data) { |
| 3987 const gles2::cmds::TraceEndCHROMIUM& c = |
| 3988 *static_cast<const gles2::cmds::TraceEndCHROMIUM*>(cmd_data); |
| 3989 (void)c; |
| 3990 error::Error error = DoTraceEndCHROMIUM(); |
| 3991 if (error != error::kNoError) { |
| 3992 return error; |
| 3993 } |
| 3994 return error::kNoError; |
| 3995 } |
| 3996 |
| 3997 error::Error GLES2DecoderPassthroughImpl::HandleDiscardFramebufferEXTImmediate( |
| 3998 uint32_t immediate_data_size, |
| 3999 const void* cmd_data) { |
| 4000 const gles2::cmds::DiscardFramebufferEXTImmediate& c = |
| 4001 *static_cast<const gles2::cmds::DiscardFramebufferEXTImmediate*>( |
| 4002 cmd_data); |
| 4003 (void)c; |
| 4004 GLenum target = static_cast<GLenum>(c.target); |
| 4005 GLsizei count = static_cast<GLsizei>(c.count); |
| 4006 uint32_t data_size = 0; |
| 4007 if (count >= 0 && |
| 4008 !GLES2Util::ComputeDataSize(count, sizeof(GLenum), 1, &data_size)) { |
| 4009 return error::kOutOfBounds; |
| 4010 } |
| 4011 if (data_size > immediate_data_size) { |
| 4012 return error::kOutOfBounds; |
| 4013 } |
| 4014 const GLenum* attachments = |
| 4015 GetImmediateDataAs<const GLenum*>(c, data_size, immediate_data_size); |
| 4016 error::Error error = DoDiscardFramebufferEXT(target, count, attachments); |
| 4017 if (error != error::kNoError) { |
| 4018 return error; |
| 4019 } |
| 4020 return error::kNoError; |
| 4021 } |
| 4022 |
| 4023 error::Error GLES2DecoderPassthroughImpl::HandleLoseContextCHROMIUM( |
| 4024 uint32_t immediate_data_size, |
| 4025 const void* cmd_data) { |
| 4026 const gles2::cmds::LoseContextCHROMIUM& c = |
| 4027 *static_cast<const gles2::cmds::LoseContextCHROMIUM*>(cmd_data); |
| 4028 (void)c; |
| 4029 GLenum current = static_cast<GLenum>(c.current); |
| 4030 GLenum other = static_cast<GLenum>(c.other); |
| 4031 error::Error error = DoLoseContextCHROMIUM(current, other); |
| 4032 if (error != error::kNoError) { |
| 4033 return error; |
| 4034 } |
| 4035 return error::kNoError; |
| 4036 } |
| 4037 |
| 4038 error::Error GLES2DecoderPassthroughImpl::HandleDrawBuffersEXTImmediate( |
| 4039 uint32_t immediate_data_size, |
| 4040 const void* cmd_data) { |
| 4041 const gles2::cmds::DrawBuffersEXTImmediate& c = |
| 4042 *static_cast<const gles2::cmds::DrawBuffersEXTImmediate*>(cmd_data); |
| 4043 (void)c; |
| 4044 GLsizei count = static_cast<GLsizei>(c.count); |
| 4045 uint32_t data_size = 0; |
| 4046 if (count >= 0 && |
| 4047 !GLES2Util::ComputeDataSize(count, sizeof(GLenum), 1, &data_size)) { |
| 4048 return error::kOutOfBounds; |
| 4049 } |
| 4050 if (data_size > immediate_data_size) { |
| 4051 return error::kOutOfBounds; |
| 4052 } |
| 4053 const GLenum* bufs = |
| 4054 GetImmediateDataAs<const GLenum*>(c, data_size, immediate_data_size); |
| 4055 error::Error error = DoDrawBuffersEXT(count, bufs); |
| 4056 if (error != error::kNoError) { |
| 4057 return error; |
| 4058 } |
| 4059 return error::kNoError; |
| 4060 } |
| 4061 |
| 4062 error::Error GLES2DecoderPassthroughImpl::HandleCommitOverlayPlanesCHROMIUM( |
| 4063 uint32_t immediate_data_size, |
| 4064 const void* cmd_data) { |
| 4065 const gles2::cmds::CommitOverlayPlanesCHROMIUM& c = |
| 4066 *static_cast<const gles2::cmds::CommitOverlayPlanesCHROMIUM*>(cmd_data); |
| 4067 (void)c; |
| 4068 error::Error error = DoCommitOverlayPlanesCHROMIUM(); |
| 4069 if (error != error::kNoError) { |
| 4070 return error; |
| 4071 } |
| 4072 return error::kNoError; |
| 4073 } |
| 4074 |
| 4075 error::Error GLES2DecoderPassthroughImpl::HandleSwapInterval( |
| 4076 uint32_t immediate_data_size, |
| 4077 const void* cmd_data) { |
| 4078 const gles2::cmds::SwapInterval& c = |
| 4079 *static_cast<const gles2::cmds::SwapInterval*>(cmd_data); |
| 4080 (void)c; |
| 4081 GLint interval = static_cast<GLint>(c.interval); |
| 4082 error::Error error = DoSwapInterval(interval); |
| 4083 if (error != error::kNoError) { |
| 4084 return error; |
| 4085 } |
| 4086 return error::kNoError; |
| 4087 } |
| 4088 |
| 4089 error::Error GLES2DecoderPassthroughImpl::HandleFlushDriverCachesCHROMIUM( |
| 4090 uint32_t immediate_data_size, |
| 4091 const void* cmd_data) { |
| 4092 const gles2::cmds::FlushDriverCachesCHROMIUM& c = |
| 4093 *static_cast<const gles2::cmds::FlushDriverCachesCHROMIUM*>(cmd_data); |
| 4094 (void)c; |
| 4095 error::Error error = DoFlushDriverCachesCHROMIUM(); |
| 4096 if (error != error::kNoError) { |
| 4097 return error; |
| 4098 } |
| 4099 return error::kNoError; |
| 4100 } |
| 4101 |
| 4102 error::Error GLES2DecoderPassthroughImpl::HandleMatrixLoadfCHROMIUMImmediate( |
| 4103 uint32_t immediate_data_size, |
| 4104 const void* cmd_data) { |
| 4105 const gles2::cmds::MatrixLoadfCHROMIUMImmediate& c = |
| 4106 *static_cast<const gles2::cmds::MatrixLoadfCHROMIUMImmediate*>(cmd_data); |
| 4107 (void)c; |
| 4108 GLenum matrixMode = static_cast<GLenum>(c.matrixMode); |
| 4109 uint32_t data_size; |
| 4110 if (!GLES2Util::ComputeDataSize(1, sizeof(GLfloat), 16, &data_size)) { |
| 4111 return error::kOutOfBounds; |
| 4112 } |
| 4113 if (data_size > immediate_data_size) { |
| 4114 return error::kOutOfBounds; |
| 4115 } |
| 4116 const GLfloat* m = |
| 4117 GetImmediateDataAs<const GLfloat*>(c, data_size, immediate_data_size); |
| 4118 error::Error error = DoMatrixLoadfCHROMIUM(matrixMode, m); |
| 4119 if (error != error::kNoError) { |
| 4120 return error; |
| 4121 } |
| 4122 return error::kNoError; |
| 4123 } |
| 4124 |
| 4125 error::Error GLES2DecoderPassthroughImpl::HandleMatrixLoadIdentityCHROMIUM( |
| 4126 uint32_t immediate_data_size, |
| 4127 const void* cmd_data) { |
| 4128 const gles2::cmds::MatrixLoadIdentityCHROMIUM& c = |
| 4129 *static_cast<const gles2::cmds::MatrixLoadIdentityCHROMIUM*>(cmd_data); |
| 4130 (void)c; |
| 4131 GLenum matrixMode = static_cast<GLenum>(c.matrixMode); |
| 4132 error::Error error = DoMatrixLoadIdentityCHROMIUM(matrixMode); |
| 4133 if (error != error::kNoError) { |
| 4134 return error; |
| 4135 } |
| 4136 return error::kNoError; |
| 4137 } |
| 4138 |
| 4139 error::Error GLES2DecoderPassthroughImpl::HandleIsPathCHROMIUM( |
| 4140 uint32_t immediate_data_size, |
| 4141 const void* cmd_data) { |
| 4142 const gles2::cmds::IsPathCHROMIUM& c = |
| 4143 *static_cast<const gles2::cmds::IsPathCHROMIUM*>(cmd_data); |
| 4144 (void)c; |
| 4145 GLuint path = c.path; |
| 4146 typedef cmds::IsPathCHROMIUM::Result Result; |
| 4147 Result* result = GetSharedMemoryAs<Result*>( |
| 4148 c.result_shm_id, c.result_shm_offset, sizeof(*result)); |
| 4149 if (!result) { |
| 4150 return error::kOutOfBounds; |
| 4151 } |
| 4152 error::Error error = DoIsPathCHROMIUM(path, result); |
| 4153 if (error != error::kNoError) { |
| 4154 return error; |
| 4155 } |
| 4156 return error::kNoError; |
| 4157 } |
| 4158 |
| 4159 error::Error GLES2DecoderPassthroughImpl::HandlePathStencilFuncCHROMIUM( |
| 4160 uint32_t immediate_data_size, |
| 4161 const void* cmd_data) { |
| 4162 const gles2::cmds::PathStencilFuncCHROMIUM& c = |
| 4163 *static_cast<const gles2::cmds::PathStencilFuncCHROMIUM*>(cmd_data); |
| 4164 (void)c; |
| 4165 GLenum func = static_cast<GLenum>(c.func); |
| 4166 GLint ref = static_cast<GLint>(c.ref); |
| 4167 GLuint mask = static_cast<GLuint>(c.mask); |
| 4168 error::Error error = DoPathStencilFuncCHROMIUM(func, ref, mask); |
| 4169 if (error != error::kNoError) { |
| 4170 return error; |
| 4171 } |
| 4172 return error::kNoError; |
| 4173 } |
| 4174 |
| 4175 error::Error GLES2DecoderPassthroughImpl::HandleCoverageModulationCHROMIUM( |
| 4176 uint32_t immediate_data_size, |
| 4177 const void* cmd_data) { |
| 4178 const gles2::cmds::CoverageModulationCHROMIUM& c = |
| 4179 *static_cast<const gles2::cmds::CoverageModulationCHROMIUM*>(cmd_data); |
| 4180 (void)c; |
| 4181 GLenum components = static_cast<GLenum>(c.components); |
| 4182 error::Error error = DoCoverageModulationCHROMIUM(components); |
| 4183 if (error != error::kNoError) { |
| 4184 return error; |
| 4185 } |
| 4186 return error::kNoError; |
| 4187 } |
| 4188 |
| 4189 error::Error GLES2DecoderPassthroughImpl::HandleBlendBarrierKHR( |
| 4190 uint32_t immediate_data_size, |
| 4191 const void* cmd_data) { |
| 4192 const gles2::cmds::BlendBarrierKHR& c = |
| 4193 *static_cast<const gles2::cmds::BlendBarrierKHR*>(cmd_data); |
| 4194 (void)c; |
| 4195 error::Error error = DoBlendBarrierKHR(); |
| 4196 if (error != error::kNoError) { |
| 4197 return error; |
| 4198 } |
| 4199 return error::kNoError; |
| 4200 } |
| 4201 |
| 4202 error::Error |
| 4203 GLES2DecoderPassthroughImpl::HandleApplyScreenSpaceAntialiasingCHROMIUM( |
| 4204 uint32_t immediate_data_size, |
| 4205 const void* cmd_data) { |
| 4206 const gles2::cmds::ApplyScreenSpaceAntialiasingCHROMIUM& c = |
| 4207 *static_cast<const gles2::cmds::ApplyScreenSpaceAntialiasingCHROMIUM*>( |
| 4208 cmd_data); |
| 4209 (void)c; |
| 4210 error::Error error = DoApplyScreenSpaceAntialiasingCHROMIUM(); |
| 4211 if (error != error::kNoError) { |
| 4212 return error; |
| 4213 } |
| 4214 return error::kNoError; |
| 4215 } |
| 4216 |
| 4217 error::Error GLES2DecoderPassthroughImpl:: |
| 4218 HandleUniformMatrix4fvStreamTextureMatrixCHROMIUMImmediate( |
| 4219 uint32_t immediate_data_size, |
| 4220 const void* cmd_data) { |
| 4221 const gles2::cmds::UniformMatrix4fvStreamTextureMatrixCHROMIUMImmediate& c = |
| 4222 *static_cast<const gles2::cmds:: |
| 4223 UniformMatrix4fvStreamTextureMatrixCHROMIUMImmediate*>( |
| 4224 cmd_data); |
| 4225 (void)c; |
| 4226 GLint location = static_cast<GLint>(c.location); |
| 4227 GLboolean transpose = static_cast<GLboolean>(c.transpose); |
| 4228 uint32_t data_size; |
| 4229 if (!GLES2Util::ComputeDataSize(1, sizeof(GLfloat), 16, &data_size)) { |
| 4230 return error::kOutOfBounds; |
| 4231 } |
| 4232 if (data_size > immediate_data_size) { |
| 4233 return error::kOutOfBounds; |
| 4234 } |
| 4235 const GLfloat* default_value = |
| 4236 GetImmediateDataAs<const GLfloat*>(c, data_size, immediate_data_size); |
| 4237 error::Error error = DoUniformMatrix4fvStreamTextureMatrixCHROMIUM( |
| 4238 location, transpose, default_value); |
| 4239 if (error != error::kNoError) { |
| 4240 return error; |
| 4241 } |
| 4242 return error::kNoError; |
| 4243 } |
| 4244 |
| 4245 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_PASSTHROUGH_HANDLERS_AUT
OGEN_H_ |
OLD | NEW |