OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // A class to emulate GLES2 over command buffers. | 5 // A class to emulate GLES2 over command buffers. |
6 | 6 |
7 #include "../client/gles2_implementation.h" | 7 #include "../client/gles2_implementation.h" |
8 #include <GLES2/gles2_command_buffer.h> | 8 #include <GLES2/gles2_command_buffer.h> |
9 #include "../client/mapped_memory.h" | 9 #include "../client/mapped_memory.h" |
10 #include "../common/gles2_cmd_utils.h" | 10 #include "../common/gles2_cmd_utils.h" |
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 | 427 |
428 COMPILE_ASSERT(gpu::kInvalidResource == 0, | 428 COMPILE_ASSERT(gpu::kInvalidResource == 0, |
429 INVALID_RESOURCE_NOT_0_AS_GL_EXPECTS); | 429 INVALID_RESOURCE_NOT_0_AS_GL_EXPECTS); |
430 | 430 |
431 GLES2Implementation::GLES2Implementation( | 431 GLES2Implementation::GLES2Implementation( |
432 GLES2CmdHelper* helper, | 432 GLES2CmdHelper* helper, |
433 size_t transfer_buffer_size, | 433 size_t transfer_buffer_size, |
434 void* transfer_buffer, | 434 void* transfer_buffer, |
435 int32 transfer_buffer_id, | 435 int32 transfer_buffer_id, |
436 bool share_resources) | 436 bool share_resources) |
437 : util_(0), // TODO(gman): Get real number of compressed texture formats. | 437 : helper_(helper), |
438 helper_(helper), | |
439 transfer_buffer_( | 438 transfer_buffer_( |
440 kStartingOffset, | 439 kStartingOffset, |
441 transfer_buffer_size - kStartingOffset, | 440 transfer_buffer_size - kStartingOffset, |
442 helper, | 441 helper, |
443 static_cast<char*>(transfer_buffer) + kStartingOffset), | 442 static_cast<char*>(transfer_buffer) + kStartingOffset), |
444 transfer_buffer_id_(transfer_buffer_id), | 443 transfer_buffer_id_(transfer_buffer_id), |
445 pack_alignment_(4), | 444 pack_alignment_(4), |
446 unpack_alignment_(4), | 445 unpack_alignment_(4), |
447 bound_array_buffer_id_(0), | 446 bound_array_buffer_id_(0), |
448 bound_element_array_buffer_id_(0), | 447 bound_element_array_buffer_id_(0), |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
489 GL_MAX_TEXTURE_IMAGE_UNITS, | 488 GL_MAX_TEXTURE_IMAGE_UNITS, |
490 GL_MAX_TEXTURE_SIZE, | 489 GL_MAX_TEXTURE_SIZE, |
491 GL_MAX_VARYING_VECTORS, | 490 GL_MAX_VARYING_VECTORS, |
492 GL_MAX_VERTEX_ATTRIBS, | 491 GL_MAX_VERTEX_ATTRIBS, |
493 GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS, | 492 GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS, |
494 GL_MAX_VERTEX_UNIFORM_VECTORS, | 493 GL_MAX_VERTEX_UNIFORM_VECTORS, |
495 GL_NUM_COMPRESSED_TEXTURE_FORMATS, | 494 GL_NUM_COMPRESSED_TEXTURE_FORMATS, |
496 GL_NUM_SHADER_BINARY_FORMATS, | 495 GL_NUM_SHADER_BINARY_FORMATS, |
497 }; | 496 }; |
498 | 497 |
| 498 util_.set_num_compressed_texture_formats( |
| 499 gl_state_.num_compressed_texture_formats); |
| 500 util_.set_num_shader_binary_formats( |
| 501 gl_state_.num_shader_binary_formats); |
| 502 |
499 GetMultipleIntegervCHROMIUM( | 503 GetMultipleIntegervCHROMIUM( |
500 pnames, arraysize(pnames), &gl_state_.max_combined_texture_image_units, | 504 pnames, arraysize(pnames), &gl_state_.max_combined_texture_image_units, |
501 sizeof(gl_state_)); | 505 sizeof(gl_state_)); |
502 | 506 |
503 #if defined(GLES2_SUPPORT_CLIENT_SIDE_ARRAYS) | 507 #if defined(GLES2_SUPPORT_CLIENT_SIDE_ARRAYS) |
504 buffer_id_handler_->MakeIds( | 508 buffer_id_handler_->MakeIds( |
505 kClientSideArrayId, arraysize(reserved_ids_), &reserved_ids_[0]); | 509 kClientSideArrayId, arraysize(reserved_ids_), &reserved_ids_[0]); |
506 | 510 |
507 client_side_buffer_helper_.reset(new ClientSideBufferHelper( | 511 client_side_buffer_helper_.reset(new ClientSideBufferHelper( |
508 gl_state_.max_vertex_attribs, | 512 gl_state_.max_vertex_attribs, |
(...skipping 1632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2141 GPU_CLIENT_LOG(" returned"); | 2145 GPU_CLIENT_LOG(" returned"); |
2142 GPU_CLIENT_LOG_CODE_BLOCK({ | 2146 GPU_CLIENT_LOG_CODE_BLOCK({ |
2143 for (int i = 0; i < num_results; ++i) { | 2147 for (int i = 0; i < num_results; ++i) { |
2144 GPU_CLIENT_LOG(" " << i << ": " << (results[i])); | 2148 GPU_CLIENT_LOG(" " << i << ": " << (results[i])); |
2145 } | 2149 } |
2146 }); | 2150 }); |
2147 } | 2151 } |
2148 | 2152 |
2149 } // namespace gles2 | 2153 } // namespace gles2 |
2150 } // namespace gpu | 2154 } // namespace gpu |
OLD | NEW |