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