Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(241)

Side by Side Diff: gpu/command_buffer/client/gles2_implementation.cc

Issue 7358006: Cache OpenGL program info on the client side of the command buffer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix warnings Created 9 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "../client/program_info_manager.h"
10 #include "../common/gles2_cmd_utils.h" 11 #include "../common/gles2_cmd_utils.h"
11 #include "../common/id_allocator.h" 12 #include "../common/id_allocator.h"
12 #include "../common/trace_event.h" 13 #include "../common/trace_event.h"
13 14
14 #if defined(__native_client__) && !defined(GLES2_SUPPORT_CLIENT_SIDE_ARRAYS) 15 #if defined(__native_client__) && !defined(GLES2_SUPPORT_CLIENT_SIDE_ARRAYS)
15 #define GLES2_SUPPORT_CLIENT_SIDE_ARRAYS 16 #define GLES2_SUPPORT_CLIENT_SIDE_ARRAYS
16 #endif 17 #endif
17 18
18 #if defined(GPU_CLIENT_DEBUG) 19 #if defined(GPU_CLIENT_DEBUG)
19 #include "ui/gfx/gl/gl_switches.h" 20 #include "ui/gfx/gl/gl_switches.h"
(...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after
504 util_.set_num_shader_binary_formats( 505 util_.set_num_shader_binary_formats(
505 gl_state_.num_shader_binary_formats); 506 gl_state_.num_shader_binary_formats);
506 507
507 GetMultipleIntegervCHROMIUM( 508 GetMultipleIntegervCHROMIUM(
508 pnames, arraysize(pnames), &gl_state_.max_combined_texture_image_units, 509 pnames, arraysize(pnames), &gl_state_.max_combined_texture_image_units,
509 sizeof(gl_state_)); 510 sizeof(gl_state_));
510 511
511 texture_units_.reset( 512 texture_units_.reset(
512 new TextureUnit[gl_state_.max_combined_texture_image_units]); 513 new TextureUnit[gl_state_.max_combined_texture_image_units]);
513 514
515 // program_info_manager_.reset(ProgramInfoManager::Create(sharing_resources_));
apatrick_chromium 2011/07/20 18:28:51 delete?
516 program_info_manager_.reset(ProgramInfoManager::Create(true));
517
514 #if defined(GLES2_SUPPORT_CLIENT_SIDE_ARRAYS) 518 #if defined(GLES2_SUPPORT_CLIENT_SIDE_ARRAYS)
515 buffer_id_handler_->MakeIds( 519 buffer_id_handler_->MakeIds(
516 kClientSideArrayId, arraysize(reserved_ids_), &reserved_ids_[0]); 520 kClientSideArrayId, arraysize(reserved_ids_), &reserved_ids_[0]);
517 521
518 client_side_buffer_helper_.reset(new ClientSideBufferHelper( 522 client_side_buffer_helper_.reset(new ClientSideBufferHelper(
519 gl_state_.max_vertex_attribs, 523 gl_state_.max_vertex_attribs,
520 reserved_ids_[0], 524 reserved_ids_[0],
521 reserved_ids_[1])); 525 reserved_ids_[1]));
522 #endif 526 #endif
523 } 527 }
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after
940 index, pname, result_shm_id(), result_shm_offset()); 944 index, pname, result_shm_id(), result_shm_offset());
941 WaitForCmd(); 945 WaitForCmd();
942 result->CopyResult(ptr); 946 result->CopyResult(ptr);
943 GPU_CLIENT_LOG_CODE_BLOCK({ 947 GPU_CLIENT_LOG_CODE_BLOCK({
944 for (int32 i = 0; i < result->GetNumResults(); ++i) { 948 for (int32 i = 0; i < result->GetNumResults(); ++i) {
945 GPU_CLIENT_LOG(" " << i << ": " << result->GetData()[i]); 949 GPU_CLIENT_LOG(" " << i << ": " << result->GetData()[i]);
946 } 950 }
947 }); 951 });
948 } 952 }
949 953
954 void GLES2Implementation::DeleteProgramOrShaderHelper(
955 GLuint program_or_shader) {
956 program_and_shader_id_handler_->FreeIds(1, &program_or_shader);
957 program_info_manager_->DeleteInfo(program_or_shader);
958 }
959
960 GLint GLES2Implementation::GetAttribLocationHelper(
961 GLuint program, const char* name) {
962 typedef GetAttribLocationBucket::Result Result;
963 Result* result = GetResultAs<Result*>();
964 *result = -1;
965 SetBucketAsCString(kResultBucketId, name);
966 helper_->GetAttribLocationBucket(
967 program, kResultBucketId, result_shm_id(), result_shm_offset());
968 WaitForCmd();
969 helper_->SetBucketSize(kResultBucketId, 0);
970 return *result;
971 }
972
950 GLint GLES2Implementation::GetAttribLocation( 973 GLint GLES2Implementation::GetAttribLocation(
951 GLuint program, const char* name) { 974 GLuint program, const char* name) {
952 GPU_CLIENT_LOG("[" << this << "] glGetAttribLocation(" << program 975 GPU_CLIENT_LOG("[" << this << "] glGetAttribLocation(" << program
953 << ", " << name << ")"); 976 << ", " << name << ")");
954 TRACE_EVENT0("gpu", "GLES2::GetAttribLocation"); 977 TRACE_EVENT0("gpu", "GLES2::GetAttribLocation");
955 typedef GetAttribLocationBucket::Result Result; 978 GLint loc = program_info_manager_->GetAttribLocation(this, program, name);
956 Result* result = GetResultAs<Result*>(); 979 GPU_CLIENT_LOG("returned " << loc);
957 *result = -1; 980 return loc;
958 SetBucketAsCString(kResultBucketId, name);
959 helper_->GetAttribLocationBucket(program, kResultBucketId,
960 result_shm_id(), result_shm_offset());
961 WaitForCmd();
962 helper_->SetBucketSize(kResultBucketId, 0);
963 GPU_CLIENT_LOG("returned " << *result);
964 return *result;
965 } 981 }
966 982
967 GLint GLES2Implementation::GetUniformLocation( 983 GLint GLES2Implementation::GetUniformLocationHelper(
968 GLuint program, const char* name) { 984 GLuint program, const char* name) {
969 GPU_CLIENT_LOG("[" << this << "] glGetUniformLocation(" << program
970 << ", " << name << ")");
971 TRACE_EVENT0("gpu", "GLES2::GetUniformLocation");
972 typedef GetUniformLocationBucket::Result Result; 985 typedef GetUniformLocationBucket::Result Result;
973 Result* result = GetResultAs<Result*>(); 986 Result* result = GetResultAs<Result*>();
974 *result = -1; 987 *result = -1;
975 SetBucketAsCString(kResultBucketId, name); 988 SetBucketAsCString(kResultBucketId, name);
976 helper_->GetUniformLocationBucket(program, kResultBucketId, 989 helper_->GetUniformLocationBucket(program, kResultBucketId,
977 result_shm_id(), result_shm_offset()); 990 result_shm_id(), result_shm_offset());
978 WaitForCmd(); 991 WaitForCmd();
979 helper_->SetBucketSize(kResultBucketId, 0); 992 helper_->SetBucketSize(kResultBucketId, 0);
980 GPU_CLIENT_LOG("returned " << *result);
981 return *result; 993 return *result;
982 } 994 }
983 995
996 GLint GLES2Implementation::GetUniformLocation(
997 GLuint program, const char* name) {
998 GPU_CLIENT_LOG("[" << this << "] glGetUniformLocation(" << program
999 << ", " << name << ")");
1000 TRACE_EVENT0("gpu", "GLES2::GetUniformLocation");
1001 GLint loc = program_info_manager_->GetUniformLocation(this, program, name);
1002 GPU_CLIENT_LOG("returned " << loc);
1003 return loc;
1004 }
1005
1006 bool GLES2Implementation::GetProgramivHelper(
1007 GLuint program, GLenum pname, GLint* params) {
1008 return program_info_manager_->GetProgramiv(this, program, pname, params);
1009 }
1010
1011 void GLES2Implementation::LinkProgram(GLuint program) {
1012 GPU_CLIENT_LOG("[" << this << "] glLinkProgram(" << program << ")");
1013 helper_->LinkProgram(program);
1014 program_info_manager_->CreateInfo(program);
1015 }
984 1016
985 void GLES2Implementation::ShaderBinary( 1017 void GLES2Implementation::ShaderBinary(
986 GLsizei n, const GLuint* shaders, GLenum binaryformat, const void* binary, 1018 GLsizei n, const GLuint* shaders, GLenum binaryformat, const void* binary,
987 GLsizei length) { 1019 GLsizei length) {
988 GPU_CLIENT_LOG("[" << this << "] glShaderBinary(" << n << ", " 1020 GPU_CLIENT_LOG("[" << this << "] glShaderBinary(" << n << ", "
989 << static_cast<const void*>(shaders) << ", " 1021 << static_cast<const void*>(shaders) << ", "
990 << GLES2Util::GetStringEnum(binaryformat) << ", " 1022 << GLES2Util::GetStringEnum(binaryformat) << ", "
991 << static_cast<const void*>(binary) << ", " 1023 << static_cast<const void*>(binary) << ", "
992 << length << ")"); 1024 << length << ")");
993 if (n < 0) { 1025 if (n < 0) {
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after
1365 row_source += part_size; 1397 row_source += part_size;
1366 temp_xoffset += num_pixels; 1398 temp_xoffset += num_pixels;
1367 temp_width -= num_pixels; 1399 temp_width -= num_pixels;
1368 } 1400 }
1369 ++yoffset; 1401 ++yoffset;
1370 source += padded_row_size; 1402 source += padded_row_size;
1371 } 1403 }
1372 } 1404 }
1373 } 1405 }
1374 1406
1375 void GLES2Implementation::GetActiveAttrib( 1407 bool GLES2Implementation::GetActiveAttribHelper(
1376 GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, 1408 GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size,
1377 GLenum* type, char* name) { 1409 GLenum* type, char* name) {
1378 GPU_CLIENT_LOG("[" << this << "] glGetActiveAttrib(" 1410 // Clear the bucket so if the command fails nothing will be in it.
1379 << program << ", " << index << ", " << bufsize << ", "
1380 << static_cast<const void*>(length) << ", "
1381 << static_cast<const void*>(size) << ", "
1382 << static_cast<const void*>(type) << ", "
1383 << static_cast<const void*>(name) << ", ");
1384 if (bufsize < 0) {
1385 SetGLError(GL_INVALID_VALUE, "glGetActiveAttrib: bufsize < 0");
1386 return;
1387 }
1388 TRACE_EVENT0("gpu", "GLES2::GetActiveAttrib");
1389 // Clear the bucket so if we the command fails nothing will be in it.
1390 helper_->SetBucketSize(kResultBucketId, 0); 1411 helper_->SetBucketSize(kResultBucketId, 0);
1391 typedef gles2::GetActiveAttrib::Result Result; 1412 typedef gles2::GetActiveAttrib::Result Result;
1392 Result* result = static_cast<Result*>(result_buffer_); 1413 Result* result = static_cast<Result*>(result_buffer_);
1393 // Set as failed so if the command fails we'll recover. 1414 // Set as failed so if the command fails we'll recover.
1394 result->success = false; 1415 result->success = false;
1395 helper_->GetActiveAttrib(program, index, kResultBucketId, 1416 helper_->GetActiveAttrib(program, index, kResultBucketId,
1396 result_shm_id(), result_shm_offset()); 1417 result_shm_id(), result_shm_offset());
1397 WaitForCmd(); 1418 WaitForCmd();
1398 if (result->success) { 1419 if (result->success) {
1399 if (size) { 1420 if (size) {
1400 *size = result->size; 1421 *size = result->size;
1401 GPU_CLIENT_LOG(" size: " << *size);
1402 } 1422 }
1403 if (type) { 1423 if (type) {
1404 *type = result->type; 1424 *type = result->type;
1405 GPU_CLIENT_LOG(" type: " << GLES2Util::GetStringEnum(*type));
1406 } 1425 }
1407 if (length || name) { 1426 if (length || name) {
1408 std::vector<int8> str; 1427 std::vector<int8> str;
1409 GetBucketContents(kResultBucketId, &str); 1428 GetBucketContents(kResultBucketId, &str);
1410 GLsizei max_size = std::min(static_cast<size_t>(bufsize) - 1, 1429 GLsizei max_size = std::min(static_cast<size_t>(bufsize) - 1,
1411 std::max(static_cast<size_t>(0), 1430 std::max(static_cast<size_t>(0),
1412 str.size() - 1)); 1431 str.size() - 1));
1413 if (length) { 1432 if (length) {
1414 *length = max_size; 1433 *length = max_size;
1415 } 1434 }
1416 if (name && bufsize > 0) { 1435 if (name && bufsize > 0) {
1417 memcpy(name, &str[0], max_size); 1436 memcpy(name, &str[0], max_size);
1418 name[max_size] = '\0'; 1437 name[max_size] = '\0';
1419 GPU_CLIENT_LOG(" name: " << name);
1420 } 1438 }
1421 } 1439 }
1422 } 1440 }
1441 return result->success != 0;
1423 } 1442 }
1424 1443
1425 void GLES2Implementation::GetActiveUniform( 1444 void GLES2Implementation::GetActiveAttrib(
1426 GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, 1445 GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size,
1427 GLenum* type, char* name) { 1446 GLenum* type, char* name) {
1428 GPU_CLIENT_LOG("[" << this << "] glGetActiveUniform(" 1447 GPU_CLIENT_LOG("[" << this << "] glGetActiveAttrib("
1429 << program << ", " << index << ", " << bufsize << ", " 1448 << program << ", " << index << ", " << bufsize << ", "
1430 << static_cast<const void*>(length) << ", " 1449 << static_cast<const void*>(length) << ", "
1431 << static_cast<const void*>(size) << ", " 1450 << static_cast<const void*>(size) << ", "
1432 << static_cast<const void*>(type) << ", " 1451 << static_cast<const void*>(type) << ", "
1433 << static_cast<const void*>(name) << ", "); 1452 << static_cast<const void*>(name) << ", ");
1434 if (bufsize < 0) { 1453 if (bufsize < 0) {
1435 SetGLError(GL_INVALID_VALUE, "glGetActiveUniform: bufsize < 0"); 1454 SetGLError(GL_INVALID_VALUE, "glGetActiveAttrib: bufsize < 0");
1436 return; 1455 return;
1437 } 1456 }
1438 TRACE_EVENT0("gpu", "GLES2::GetActiveUniform"); 1457 TRACE_EVENT0("gpu", "GLES2::GetActiveAttrib");
1439 // Clear the bucket so if we the command fails nothing will be in it. 1458 bool success = program_info_manager_->GetActiveAttrib(
1459 this, program, index, bufsize, length, size, type, name);
1460 if (success) {
1461 if (size) {
1462 GPU_CLIENT_LOG(" size: " << *size);
1463 }
1464 if (type) {
1465 GPU_CLIENT_LOG(" type: " << GLES2Util::GetStringEnum(*type));
1466 }
1467 if (name) {
1468 GPU_CLIENT_LOG(" name: " << name);
1469 }
1470 }
1471 }
1472
1473 bool GLES2Implementation::GetActiveUniformHelper(
1474 GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size,
1475 GLenum* type, char* name) {
1476 // Clear the bucket so if the command fails nothing will be in it.
1440 helper_->SetBucketSize(kResultBucketId, 0); 1477 helper_->SetBucketSize(kResultBucketId, 0);
1441 typedef gles2::GetActiveUniform::Result Result; 1478 typedef gles2::GetActiveUniform::Result Result;
1442 Result* result = static_cast<Result*>(result_buffer_); 1479 Result* result = static_cast<Result*>(result_buffer_);
1443 // Set as failed so if the command fails we'll recover. 1480 // Set as failed so if the command fails we'll recover.
1444 result->success = false; 1481 result->success = false;
1445 helper_->GetActiveUniform(program, index, kResultBucketId, 1482 helper_->GetActiveUniform(program, index, kResultBucketId,
1446 result_shm_id(), result_shm_offset()); 1483 result_shm_id(), result_shm_offset());
1447 WaitForCmd(); 1484 WaitForCmd();
1448 if (result->success) { 1485 if (result->success) {
1449 if (size) { 1486 if (size) {
1450 *size = result->size; 1487 *size = result->size;
1451 GPU_CLIENT_LOG(" size: " << *size);
1452 } 1488 }
1453 if (type) { 1489 if (type) {
1454 *type = result->type; 1490 *type = result->type;
1455 GPU_CLIENT_LOG(" type: " << GLES2Util::GetStringEnum(*type));
1456 } 1491 }
1457 if (length || name) { 1492 if (length || name) {
1458 std::vector<int8> str; 1493 std::vector<int8> str;
1459 GetBucketContents(kResultBucketId, &str); 1494 GetBucketContents(kResultBucketId, &str);
1460 GLsizei max_size = std::min(static_cast<size_t>(bufsize) - 1, 1495 GLsizei max_size = std::min(static_cast<size_t>(bufsize) - 1,
1461 std::max(static_cast<size_t>(0), 1496 std::max(static_cast<size_t>(0),
1462 str.size() - 1)); 1497 str.size() - 1));
1463 if (length) { 1498 if (length) {
1464 *length = max_size; 1499 *length = max_size;
1465 } 1500 }
1466 if (name && bufsize > 0) { 1501 if (name && bufsize > 0) {
1467 memcpy(name, &str[0], max_size); 1502 memcpy(name, &str[0], max_size);
1468 name[max_size] = '\0'; 1503 name[max_size] = '\0';
1469 GPU_CLIENT_LOG(" name: " << name);
1470 } 1504 }
1471 } 1505 }
1472 } 1506 }
1507 return result->success != 0;
1508 }
1509
1510 void GLES2Implementation::GetActiveUniform(
1511 GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size,
1512 GLenum* type, char* name) {
1513 GPU_CLIENT_LOG("[" << this << "] glGetActiveUniform("
1514 << program << ", " << index << ", " << bufsize << ", "
1515 << static_cast<const void*>(length) << ", "
1516 << static_cast<const void*>(size) << ", "
1517 << static_cast<const void*>(type) << ", "
1518 << static_cast<const void*>(name) << ", ");
1519 if (bufsize < 0) {
1520 SetGLError(GL_INVALID_VALUE, "glGetActiveUniform: bufsize < 0");
1521 return;
1522 }
1523 TRACE_EVENT0("gpu", "GLES2::GetActiveUniform");
1524 bool success = program_info_manager_->GetActiveUniform(
1525 this, program, index, bufsize, length, size, type, name);
1526 if (success) {
1527 if (size) {
1528 GPU_CLIENT_LOG(" size: " << *size);
1529 }
1530 if (type) {
1531 GPU_CLIENT_LOG(" type: " << GLES2Util::GetStringEnum(*type));
1532 }
1533 if (name) {
1534 GPU_CLIENT_LOG(" name: " << name);
1535 }
1536 }
1473 } 1537 }
1474 1538
1475 void GLES2Implementation::GetAttachedShaders( 1539 void GLES2Implementation::GetAttachedShaders(
1476 GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders) { 1540 GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders) {
1477 GPU_CLIENT_LOG("[" << this << "] glGetAttachedShaders(" 1541 GPU_CLIENT_LOG("[" << this << "] glGetAttachedShaders("
1478 << program << ", " << maxcount << ", " 1542 << program << ", " << maxcount << ", "
1479 << static_cast<const void*>(count) << ", " 1543 << static_cast<const void*>(count) << ", "
1480 << static_cast<const void*>(shaders) << ", "); 1544 << static_cast<const void*>(shaders) << ", ");
1481 if (maxcount < 0) { 1545 if (maxcount < 0) {
1482 SetGLError(GL_INVALID_VALUE, "glGetAttachedShaders: maxcount < 0"); 1546 SetGLError(GL_INVALID_VALUE, "glGetAttachedShaders: maxcount < 0");
(...skipping 765 matching lines...) Expand 10 before | Expand all | Expand 10 after
2248 // TODO(gman): We should be able to free without a token. 2312 // TODO(gman): We should be able to free without a token.
2249 transfer_buffer_.FreePendingToken(buffer, helper_->InsertToken()); 2313 transfer_buffer_.FreePendingToken(buffer, helper_->InsertToken());
2250 GPU_CLIENT_LOG(" returned"); 2314 GPU_CLIENT_LOG(" returned");
2251 GPU_CLIENT_LOG_CODE_BLOCK({ 2315 GPU_CLIENT_LOG_CODE_BLOCK({
2252 for (int i = 0; i < num_results; ++i) { 2316 for (int i = 0; i < num_results; ++i) {
2253 GPU_CLIENT_LOG(" " << i << ": " << (results[i])); 2317 GPU_CLIENT_LOG(" " << i << ": " << (results[i]));
2254 } 2318 }
2255 }); 2319 });
2256 } 2320 }
2257 2321
2322 void GLES2Implementation::GetProgramInfoCHROMIUMHelper(
2323 GLuint program, std::vector<int8>* result) {
2324 DCHECK(result);
2325 // Clear the bucket so if the command fails nothing will be in it.
2326 helper_->SetBucketSize(kResultBucketId, 0);
2327 helper_->GetProgramInfoCHROMIUM(program, kResultBucketId);
2328 GetBucketContents(kResultBucketId, result);
2329 }
2330
2258 void GLES2Implementation::GetProgramInfoCHROMIUM( 2331 void GLES2Implementation::GetProgramInfoCHROMIUM(
2259 GLuint program, GLsizei bufsize, GLsizei* size, void* info) { 2332 GLuint program, GLsizei bufsize, GLsizei* size, void* info) {
2260 if (bufsize < 0) { 2333 if (bufsize < 0) {
2261 SetGLError(GL_INVALID_VALUE, "glProgramInfoCHROMIUM: bufsize less than 0."); 2334 SetGLError(GL_INVALID_VALUE, "glProgramInfoCHROMIUM: bufsize less than 0.");
2262 return; 2335 return;
2263 } 2336 }
2264 if (size == NULL) { 2337 if (size == NULL) {
2265 SetGLError(GL_INVALID_VALUE, "glProgramInfoCHROMIUM: size is null."); 2338 SetGLError(GL_INVALID_VALUE, "glProgramInfoCHROMIUM: size is null.");
2266 return; 2339 return;
2267 } 2340 }
2268 // Make sure they've set size to 0 else the value will be undefined on 2341 // Make sure they've set size to 0 else the value will be undefined on
2269 // lost context. 2342 // lost context.
2270 GPU_DCHECK(*size == 0); 2343 GPU_DCHECK(*size == 0);
2271 // Clear the bucket so if the command fails nothing will be in it.
2272 helper_->SetBucketSize(kResultBucketId, 0);
2273 helper_->GetProgramInfoCHROMIUM(program, kResultBucketId);
2274 std::vector<int8> result; 2344 std::vector<int8> result;
2275 GetBucketContents(kResultBucketId, &result); 2345 GetProgramInfoCHROMIUMHelper(program, &result);
2276 if (result.size() == 0) { 2346 if (result.empty()) {
2277 return; 2347 return;
2278 } 2348 }
2279 *size = result.size(); 2349 *size = result.size();
2280 if (!info) { 2350 if (!info) {
2281 return; 2351 return;
2282 } 2352 }
2283 if (static_cast<size_t>(bufsize) < result.size()) { 2353 if (static_cast<size_t>(bufsize) < result.size()) {
2284 SetGLError(GL_INVALID_OPERATION, 2354 SetGLError(GL_INVALID_OPERATION,
2285 "glProgramInfoCHROMIUM: bufsize is too small for result."); 2355 "glProgramInfoCHROMIUM: bufsize is too small for result.");
2286 return; 2356 return;
2287 } 2357 }
2288 memcpy(info, &result[0], result.size()); 2358 memcpy(info, &result[0], result.size());
2289 } 2359 }
2290 2360
2291 } // namespace gles2 2361 } // namespace gles2
2292 } // namespace gpu 2362 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/client/gles2_implementation.h ('k') | gpu/command_buffer/client/gles2_implementation_autogen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698