Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 // This file is auto-generated from | 5 // This file is auto-generated from |
| 6 // gpu/command_buffer/build_gles2_cmd_buffer.py | 6 // gpu/command_buffer/build_gles2_cmd_buffer.py |
| 7 // It's formatted by clang-format using chromium coding style: | 7 // It's formatted by clang-format using chromium coding style: |
| 8 // clang-format -i -style=chromium filename | 8 // clang-format -i -style=chromium filename |
| 9 // DO NOT EDIT! | 9 // DO NOT EDIT! |
| 10 | 10 |
| (...skipping 1363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1374 } | 1374 } |
| 1375 if (params == NULL) { | 1375 if (params == NULL) { |
| 1376 return error::kOutOfBounds; | 1376 return error::kOutOfBounds; |
| 1377 } | 1377 } |
| 1378 LOCAL_COPY_REAL_GL_ERRORS_TO_WRAPPER("GetBooleanv"); | 1378 LOCAL_COPY_REAL_GL_ERRORS_TO_WRAPPER("GetBooleanv"); |
| 1379 // Check that the client initialized the result. | 1379 // Check that the client initialized the result. |
| 1380 if (result->size != 0) { | 1380 if (result->size != 0) { |
| 1381 return error::kInvalidArguments; | 1381 return error::kInvalidArguments; |
| 1382 } | 1382 } |
| 1383 DoGetBooleanv(pname, params); | 1383 DoGetBooleanv(pname, params); |
| 1384 GLenum error = glGetError(); | 1384 GLenum error = LOCAL_PEEK_GL_ERROR("GetBooleanv"); |
| 1385 if (error == GL_NO_ERROR) { | 1385 if (error == GL_NO_ERROR) { |
| 1386 result->SetNumResults(num_values); | 1386 result->SetNumResults(num_values); |
| 1387 } else { | |
| 1388 LOCAL_SET_GL_ERROR(error, "GetBooleanv", ""); | |
| 1389 } | 1387 } |
| 1390 return error::kNoError; | 1388 return error::kNoError; |
| 1391 } | 1389 } |
| 1392 | 1390 |
| 1393 error::Error GLES2DecoderImpl::HandleGetBufferParameteriv( | 1391 error::Error GLES2DecoderImpl::HandleGetBufferParameteriv( |
| 1394 uint32_t immediate_data_size, | 1392 uint32_t immediate_data_size, |
| 1395 const void* cmd_data) { | 1393 const void* cmd_data) { |
| 1396 const gles2::cmds::GetBufferParameteriv& c = | 1394 const gles2::cmds::GetBufferParameteriv& c = |
| 1397 *static_cast<const gles2::cmds::GetBufferParameteriv*>(cmd_data); | 1395 *static_cast<const gles2::cmds::GetBufferParameteriv*>(cmd_data); |
| 1398 (void)c; | 1396 (void)c; |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1456 } | 1454 } |
| 1457 if (params == NULL) { | 1455 if (params == NULL) { |
| 1458 return error::kOutOfBounds; | 1456 return error::kOutOfBounds; |
| 1459 } | 1457 } |
| 1460 LOCAL_COPY_REAL_GL_ERRORS_TO_WRAPPER("GetFloatv"); | 1458 LOCAL_COPY_REAL_GL_ERRORS_TO_WRAPPER("GetFloatv"); |
| 1461 // Check that the client initialized the result. | 1459 // Check that the client initialized the result. |
| 1462 if (result->size != 0) { | 1460 if (result->size != 0) { |
| 1463 return error::kInvalidArguments; | 1461 return error::kInvalidArguments; |
| 1464 } | 1462 } |
| 1465 DoGetFloatv(pname, params); | 1463 DoGetFloatv(pname, params); |
| 1466 GLenum error = glGetError(); | 1464 GLenum error = LOCAL_PEEK_GL_ERROR("GetFloatv"); |
| 1467 if (error == GL_NO_ERROR) { | 1465 if (error == GL_NO_ERROR) { |
| 1468 result->SetNumResults(num_values); | 1466 result->SetNumResults(num_values); |
| 1469 } else { | |
| 1470 LOCAL_SET_GL_ERROR(error, "GetFloatv", ""); | |
| 1471 } | 1467 } |
| 1472 return error::kNoError; | 1468 return error::kNoError; |
| 1473 } | 1469 } |
| 1474 | 1470 |
| 1475 error::Error GLES2DecoderImpl::HandleGetFramebufferAttachmentParameteriv( | 1471 error::Error GLES2DecoderImpl::HandleGetFramebufferAttachmentParameteriv( |
| 1476 uint32_t immediate_data_size, | 1472 uint32_t immediate_data_size, |
| 1477 const void* cmd_data) { | 1473 const void* cmd_data) { |
| 1478 const gles2::cmds::GetFramebufferAttachmentParameteriv& c = | 1474 const gles2::cmds::GetFramebufferAttachmentParameteriv& c = |
| 1479 *static_cast<const gles2::cmds::GetFramebufferAttachmentParameteriv*>( | 1475 *static_cast<const gles2::cmds::GetFramebufferAttachmentParameteriv*>( |
| 1480 cmd_data); | 1476 cmd_data); |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 1505 } | 1501 } |
| 1506 if (params == NULL) { | 1502 if (params == NULL) { |
| 1507 return error::kOutOfBounds; | 1503 return error::kOutOfBounds; |
| 1508 } | 1504 } |
| 1509 LOCAL_COPY_REAL_GL_ERRORS_TO_WRAPPER("GetFramebufferAttachmentParameteriv"); | 1505 LOCAL_COPY_REAL_GL_ERRORS_TO_WRAPPER("GetFramebufferAttachmentParameteriv"); |
| 1510 // Check that the client initialized the result. | 1506 // Check that the client initialized the result. |
| 1511 if (result->size != 0) { | 1507 if (result->size != 0) { |
| 1512 return error::kInvalidArguments; | 1508 return error::kInvalidArguments; |
| 1513 } | 1509 } |
| 1514 DoGetFramebufferAttachmentParameteriv(target, attachment, pname, params); | 1510 DoGetFramebufferAttachmentParameteriv(target, attachment, pname, params); |
| 1515 GLenum error = glGetError(); | 1511 GLenum error = LOCAL_PEEK_GL_ERROR("GetFramebufferAttachmentParameteriv"); |
| 1516 if (error == GL_NO_ERROR) { | 1512 if (error == GL_NO_ERROR) { |
| 1517 result->SetNumResults(num_values); | 1513 result->SetNumResults(num_values); |
| 1518 } else { | |
| 1519 LOCAL_SET_GL_ERROR(error, "GetFramebufferAttachmentParameteriv", ""); | |
| 1520 } | 1514 } |
| 1521 return error::kNoError; | 1515 return error::kNoError; |
| 1522 } | 1516 } |
| 1523 | 1517 |
| 1524 error::Error GLES2DecoderImpl::HandleGetInteger64v(uint32_t immediate_data_size, | 1518 error::Error GLES2DecoderImpl::HandleGetInteger64v(uint32_t immediate_data_size, |
| 1525 const void* cmd_data) { | 1519 const void* cmd_data) { |
| 1526 if (!unsafe_es3_apis_enabled()) | 1520 if (!unsafe_es3_apis_enabled()) |
| 1527 return error::kUnknownCommand; | 1521 return error::kUnknownCommand; |
| 1528 const gles2::cmds::GetInteger64v& c = | 1522 const gles2::cmds::GetInteger64v& c = |
| 1529 *static_cast<const gles2::cmds::GetInteger64v*>(cmd_data); | 1523 *static_cast<const gles2::cmds::GetInteger64v*>(cmd_data); |
| 1530 (void)c; | 1524 (void)c; |
| 1531 GLenum pname = static_cast<GLenum>(c.pname); | 1525 GLenum pname = static_cast<GLenum>(c.pname); |
| 1532 typedef cmds::GetInteger64v::Result Result; | 1526 typedef cmds::GetInteger64v::Result Result; |
| 1533 GLsizei num_values = 0; | 1527 GLsizei num_values = 0; |
| 1534 GetNumValuesReturnedForGLGet(pname, &num_values); | 1528 GetNumValuesReturnedForGLGet(pname, &num_values); |
| 1535 Result* result = GetSharedMemoryAs<Result*>( | 1529 Result* result = GetSharedMemoryAs<Result*>( |
| 1536 c.params_shm_id, c.params_shm_offset, Result::ComputeSize(num_values)); | 1530 c.params_shm_id, c.params_shm_offset, Result::ComputeSize(num_values)); |
| 1537 GLint64* params = result ? result->GetData() : NULL; | 1531 GLint64* params = result ? result->GetData() : NULL; |
| 1538 if (params == NULL) { | 1532 if (params == NULL) { |
| 1539 return error::kOutOfBounds; | 1533 return error::kOutOfBounds; |
| 1540 } | 1534 } |
| 1541 LOCAL_COPY_REAL_GL_ERRORS_TO_WRAPPER("GetInteger64v"); | 1535 LOCAL_COPY_REAL_GL_ERRORS_TO_WRAPPER("GetInteger64v"); |
| 1542 // Check that the client initialized the result. | 1536 // Check that the client initialized the result. |
| 1543 if (result->size != 0) { | 1537 if (result->size != 0) { |
| 1544 return error::kInvalidArguments; | 1538 return error::kInvalidArguments; |
| 1545 } | 1539 } |
| 1546 DoGetInteger64v(pname, params); | 1540 DoGetInteger64v(pname, params); |
| 1547 GLenum error = glGetError(); | 1541 GLenum error = LOCAL_PEEK_GL_ERROR("GetInteger64v"); |
| 1548 if (error == GL_NO_ERROR) { | 1542 if (error == GL_NO_ERROR) { |
| 1549 result->SetNumResults(num_values); | 1543 result->SetNumResults(num_values); |
| 1550 } else { | |
| 1551 LOCAL_SET_GL_ERROR(error, "GetInteger64v", ""); | |
| 1552 } | 1544 } |
| 1553 return error::kNoError; | 1545 return error::kNoError; |
| 1554 } | 1546 } |
| 1555 | 1547 |
| 1556 error::Error GLES2DecoderImpl::HandleGetIntegeri_v(uint32_t immediate_data_size, | 1548 error::Error GLES2DecoderImpl::HandleGetIntegeri_v(uint32_t immediate_data_size, |
| 1557 const void* cmd_data) { | 1549 const void* cmd_data) { |
| 1558 if (!unsafe_es3_apis_enabled()) | 1550 if (!unsafe_es3_apis_enabled()) |
| 1559 return error::kUnknownCommand; | 1551 return error::kUnknownCommand; |
| 1560 const gles2::cmds::GetIntegeri_v& c = | 1552 const gles2::cmds::GetIntegeri_v& c = |
| 1561 *static_cast<const gles2::cmds::GetIntegeri_v*>(cmd_data); | 1553 *static_cast<const gles2::cmds::GetIntegeri_v*>(cmd_data); |
| 1562 (void)c; | 1554 (void)c; |
| 1563 GLenum pname = static_cast<GLenum>(c.pname); | 1555 GLenum pname = static_cast<GLenum>(c.pname); |
| 1564 GLuint index = static_cast<GLuint>(c.index); | 1556 GLuint index = static_cast<GLuint>(c.index); |
| 1565 typedef cmds::GetIntegeri_v::Result Result; | 1557 typedef cmds::GetIntegeri_v::Result Result; |
| 1566 GLsizei num_values = 0; | 1558 GLsizei num_values = 0; |
| 1567 GetNumValuesReturnedForGLGet(pname, &num_values); | 1559 GetNumValuesReturnedForGLGet(pname, &num_values); |
| 1568 Result* result = GetSharedMemoryAs<Result*>(c.data_shm_id, c.data_shm_offset, | 1560 Result* result = GetSharedMemoryAs<Result*>(c.data_shm_id, c.data_shm_offset, |
| 1569 Result::ComputeSize(num_values)); | 1561 Result::ComputeSize(num_values)); |
| 1570 GLint* data = result ? result->GetData() : NULL; | 1562 GLint* data = result ? result->GetData() : NULL; |
| 1571 if (data == NULL) { | 1563 if (data == NULL) { |
| 1572 return error::kOutOfBounds; | 1564 return error::kOutOfBounds; |
| 1573 } | 1565 } |
| 1574 LOCAL_COPY_REAL_GL_ERRORS_TO_WRAPPER("GetIntegeri_v"); | 1566 LOCAL_COPY_REAL_GL_ERRORS_TO_WRAPPER("GetIntegeri_v"); |
| 1575 // Check that the client initialized the result. | 1567 // Check that the client initialized the result. |
| 1576 if (result->size != 0) { | 1568 if (result->size != 0) { |
| 1577 return error::kInvalidArguments; | 1569 return error::kInvalidArguments; |
| 1578 } | 1570 } |
| 1579 glGetIntegeri_v(pname, index, data); | 1571 glGetIntegeri_v(pname, index, data); |
| 1580 GLenum error = glGetError(); | 1572 GLenum error = LOCAL_PEEK_GL_ERROR("GetIntegeri_v"); |
| 1581 if (error == GL_NO_ERROR) { | 1573 if (error == GL_NO_ERROR) { |
| 1582 result->SetNumResults(num_values); | 1574 result->SetNumResults(num_values); |
| 1583 } else { | |
| 1584 LOCAL_SET_GL_ERROR(error, "GetIntegeri_v", ""); | |
| 1585 } | 1575 } |
| 1586 return error::kNoError; | 1576 return error::kNoError; |
| 1587 } | 1577 } |
| 1588 | 1578 |
| 1589 error::Error GLES2DecoderImpl::HandleGetInteger64i_v( | 1579 error::Error GLES2DecoderImpl::HandleGetInteger64i_v( |
| 1590 uint32_t immediate_data_size, | 1580 uint32_t immediate_data_size, |
| 1591 const void* cmd_data) { | 1581 const void* cmd_data) { |
| 1592 if (!unsafe_es3_apis_enabled()) | 1582 if (!unsafe_es3_apis_enabled()) |
| 1593 return error::kUnknownCommand; | 1583 return error::kUnknownCommand; |
| 1594 const gles2::cmds::GetInteger64i_v& c = | 1584 const gles2::cmds::GetInteger64i_v& c = |
| 1595 *static_cast<const gles2::cmds::GetInteger64i_v*>(cmd_data); | 1585 *static_cast<const gles2::cmds::GetInteger64i_v*>(cmd_data); |
| 1596 (void)c; | 1586 (void)c; |
| 1597 GLenum pname = static_cast<GLenum>(c.pname); | 1587 GLenum pname = static_cast<GLenum>(c.pname); |
| 1598 GLuint index = static_cast<GLuint>(c.index); | 1588 GLuint index = static_cast<GLuint>(c.index); |
| 1599 typedef cmds::GetInteger64i_v::Result Result; | 1589 typedef cmds::GetInteger64i_v::Result Result; |
| 1600 GLsizei num_values = 0; | 1590 GLsizei num_values = 0; |
| 1601 GetNumValuesReturnedForGLGet(pname, &num_values); | 1591 GetNumValuesReturnedForGLGet(pname, &num_values); |
| 1602 Result* result = GetSharedMemoryAs<Result*>(c.data_shm_id, c.data_shm_offset, | 1592 Result* result = GetSharedMemoryAs<Result*>(c.data_shm_id, c.data_shm_offset, |
| 1603 Result::ComputeSize(num_values)); | 1593 Result::ComputeSize(num_values)); |
| 1604 GLint64* data = result ? result->GetData() : NULL; | 1594 GLint64* data = result ? result->GetData() : NULL; |
| 1605 if (data == NULL) { | 1595 if (data == NULL) { |
| 1606 return error::kOutOfBounds; | 1596 return error::kOutOfBounds; |
| 1607 } | 1597 } |
| 1608 LOCAL_COPY_REAL_GL_ERRORS_TO_WRAPPER("GetInteger64i_v"); | 1598 LOCAL_COPY_REAL_GL_ERRORS_TO_WRAPPER("GetInteger64i_v"); |
| 1609 // Check that the client initialized the result. | 1599 // Check that the client initialized the result. |
| 1610 if (result->size != 0) { | 1600 if (result->size != 0) { |
| 1611 return error::kInvalidArguments; | 1601 return error::kInvalidArguments; |
| 1612 } | 1602 } |
| 1613 glGetInteger64i_v(pname, index, data); | 1603 glGetInteger64i_v(pname, index, data); |
| 1614 GLenum error = glGetError(); | 1604 GLenum error = LOCAL_PEEK_GL_ERROR("GetInteger64i_v"); |
| 1615 if (error == GL_NO_ERROR) { | 1605 if (error == GL_NO_ERROR) { |
| 1616 result->SetNumResults(num_values); | 1606 result->SetNumResults(num_values); |
| 1617 } else { | |
| 1618 LOCAL_SET_GL_ERROR(error, "GetInteger64i_v", ""); | |
| 1619 } | 1607 } |
| 1620 return error::kNoError; | 1608 return error::kNoError; |
| 1621 } | 1609 } |
| 1622 | 1610 |
| 1623 error::Error GLES2DecoderImpl::HandleGetIntegerv(uint32_t immediate_data_size, | 1611 error::Error GLES2DecoderImpl::HandleGetIntegerv(uint32_t immediate_data_size, |
| 1624 const void* cmd_data) { | 1612 const void* cmd_data) { |
| 1625 const gles2::cmds::GetIntegerv& c = | 1613 const gles2::cmds::GetIntegerv& c = |
| 1626 *static_cast<const gles2::cmds::GetIntegerv*>(cmd_data); | 1614 *static_cast<const gles2::cmds::GetIntegerv*>(cmd_data); |
| 1627 (void)c; | 1615 (void)c; |
| 1628 GLenum pname = static_cast<GLenum>(c.pname); | 1616 GLenum pname = static_cast<GLenum>(c.pname); |
| 1629 typedef cmds::GetIntegerv::Result Result; | 1617 typedef cmds::GetIntegerv::Result Result; |
| 1630 GLsizei num_values = 0; | 1618 GLsizei num_values = 0; |
| 1631 GetNumValuesReturnedForGLGet(pname, &num_values); | 1619 GetNumValuesReturnedForGLGet(pname, &num_values); |
| 1632 Result* result = GetSharedMemoryAs<Result*>( | 1620 Result* result = GetSharedMemoryAs<Result*>( |
| 1633 c.params_shm_id, c.params_shm_offset, Result::ComputeSize(num_values)); | 1621 c.params_shm_id, c.params_shm_offset, Result::ComputeSize(num_values)); |
| 1634 GLint* params = result ? result->GetData() : NULL; | 1622 GLint* params = result ? result->GetData() : NULL; |
| 1635 if (!validators_->g_l_state.IsValid(pname)) { | 1623 if (!validators_->g_l_state.IsValid(pname)) { |
| 1636 LOCAL_SET_GL_ERROR_INVALID_ENUM("glGetIntegerv", pname, "pname"); | 1624 LOCAL_SET_GL_ERROR_INVALID_ENUM("glGetIntegerv", pname, "pname"); |
| 1637 return error::kNoError; | 1625 return error::kNoError; |
| 1638 } | 1626 } |
| 1639 if (params == NULL) { | 1627 if (params == NULL) { |
| 1640 return error::kOutOfBounds; | 1628 return error::kOutOfBounds; |
| 1641 } | 1629 } |
| 1642 LOCAL_COPY_REAL_GL_ERRORS_TO_WRAPPER("GetIntegerv"); | 1630 LOCAL_COPY_REAL_GL_ERRORS_TO_WRAPPER("GetIntegerv"); |
| 1643 // Check that the client initialized the result. | 1631 // Check that the client initialized the result. |
| 1644 if (result->size != 0) { | 1632 if (result->size != 0) { |
| 1645 return error::kInvalidArguments; | 1633 return error::kInvalidArguments; |
| 1646 } | 1634 } |
| 1647 DoGetIntegerv(pname, params); | 1635 DoGetIntegerv(pname, params); |
| 1648 GLenum error = glGetError(); | 1636 GLenum error = LOCAL_PEEK_GL_ERROR("GetIntegerv"); |
| 1649 if (error == GL_NO_ERROR) { | 1637 if (error == GL_NO_ERROR) { |
| 1650 result->SetNumResults(num_values); | 1638 result->SetNumResults(num_values); |
| 1651 } else { | |
| 1652 LOCAL_SET_GL_ERROR(error, "GetIntegerv", ""); | |
| 1653 } | 1639 } |
| 1654 return error::kNoError; | 1640 return error::kNoError; |
| 1655 } | 1641 } |
| 1656 | 1642 |
| 1657 error::Error GLES2DecoderImpl::HandleGetInternalformativ( | 1643 error::Error GLES2DecoderImpl::HandleGetInternalformativ( |
| 1658 uint32_t immediate_data_size, | 1644 uint32_t immediate_data_size, |
| 1659 const void* cmd_data) { | 1645 const void* cmd_data) { |
| 1660 if (!unsafe_es3_apis_enabled()) | 1646 if (!unsafe_es3_apis_enabled()) |
| 1661 return error::kUnknownCommand; | 1647 return error::kUnknownCommand; |
| 1662 const gles2::cmds::GetInternalformativ& c = | 1648 const gles2::cmds::GetInternalformativ& c = |
| 1663 *static_cast<const gles2::cmds::GetInternalformativ*>(cmd_data); | 1649 *static_cast<const gles2::cmds::GetInternalformativ*>(cmd_data); |
| 1664 (void)c; | 1650 (void)c; |
| 1665 GLenum target = static_cast<GLenum>(c.target); | 1651 GLenum target = static_cast<GLenum>(c.target); |
| 1666 GLenum format = static_cast<GLenum>(c.format); | 1652 GLenum format = static_cast<GLenum>(c.format); |
| 1667 GLenum pname = static_cast<GLenum>(c.pname); | 1653 GLenum pname = static_cast<GLenum>(c.pname); |
| 1668 GLsizei bufSize = static_cast<GLsizei>(c.bufSize); | 1654 GLsizei bufSize = static_cast<GLsizei>(c.bufSize); |
| 1669 typedef cmds::GetInternalformativ::Result Result; | 1655 typedef cmds::GetInternalformativ::Result Result; |
| 1670 GLsizei num_values = 0; | 1656 GLsizei num_values = 0; |
| 1671 GetNumValuesReturnedForGLGet(pname, &num_values); | 1657 if (bufSize > 0) { |
| 1658 // Sanity check for |bufSize| and set its upbound. | |
| 1659 GLint value = 0; | |
| 1660 LOCAL_COPY_REAL_GL_ERRORS_TO_WRAPPER("GetInternalformativ"); | |
| 1661 glGetInternalformativ(target, format, GL_NUM_SAMPLE_COUNTS, 1, &value); | |
|
piman
2015/06/01 21:29:37
GL_NUM_SAMPLE_COUNTS is only involved if pname is
| |
| 1662 GLenum error = LOCAL_PEEK_GL_ERROR("GetInternalformativ"); | |
| 1663 if (error != GL_NO_ERROR) { | |
| 1664 return error::kNoError; | |
| 1665 } | |
| 1666 if (value < bufSize) { | |
| 1667 bufSize = value; | |
| 1668 } | |
| 1669 } | |
| 1670 | |
| 1671 if (bufSize > 0) { | |
| 1672 num_values = static_cast<GLsizei>(bufSize); | |
| 1673 } | |
| 1672 Result* result = GetSharedMemoryAs<Result*>( | 1674 Result* result = GetSharedMemoryAs<Result*>( |
| 1673 c.params_shm_id, c.params_shm_offset, Result::ComputeSize(num_values)); | 1675 c.params_shm_id, c.params_shm_offset, Result::ComputeSize(num_values)); |
| 1674 GLint* params = result ? result->GetData() : NULL; | 1676 GLint* params = result ? result->GetData() : NULL; |
| 1675 if (params == NULL) { | 1677 if (params == NULL) { |
| 1676 return error::kOutOfBounds; | 1678 return error::kOutOfBounds; |
| 1677 } | 1679 } |
| 1678 LOCAL_COPY_REAL_GL_ERRORS_TO_WRAPPER("GetInternalformativ"); | 1680 LOCAL_COPY_REAL_GL_ERRORS_TO_WRAPPER("GetInternalformativ"); |
| 1679 // Check that the client initialized the result. | 1681 // Check that the client initialized the result. |
| 1680 if (result->size != 0) { | 1682 if (result->size != 0) { |
| 1681 return error::kInvalidArguments; | 1683 return error::kInvalidArguments; |
| 1682 } | 1684 } |
| 1683 glGetInternalformativ(target, format, pname, bufSize, params); | 1685 glGetInternalformativ(target, format, pname, bufSize, params); |
| 1684 GLenum error = glGetError(); | 1686 GLenum error = LOCAL_PEEK_GL_ERROR("GetInternalformativ"); |
| 1685 if (error == GL_NO_ERROR) { | 1687 if (error == GL_NO_ERROR) { |
| 1686 result->SetNumResults(num_values); | 1688 result->SetNumResults(num_values); |
| 1687 } else { | |
| 1688 LOCAL_SET_GL_ERROR(error, "GetInternalformativ", ""); | |
| 1689 } | 1689 } |
| 1690 return error::kNoError; | 1690 return error::kNoError; |
| 1691 } | 1691 } |
| 1692 | 1692 |
| 1693 error::Error GLES2DecoderImpl::HandleGetProgramiv(uint32_t immediate_data_size, | 1693 error::Error GLES2DecoderImpl::HandleGetProgramiv(uint32_t immediate_data_size, |
| 1694 const void* cmd_data) { | 1694 const void* cmd_data) { |
| 1695 const gles2::cmds::GetProgramiv& c = | 1695 const gles2::cmds::GetProgramiv& c = |
| 1696 *static_cast<const gles2::cmds::GetProgramiv*>(cmd_data); | 1696 *static_cast<const gles2::cmds::GetProgramiv*>(cmd_data); |
| 1697 (void)c; | 1697 (void)c; |
| 1698 GLuint program = c.program; | 1698 GLuint program = c.program; |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 1709 } | 1709 } |
| 1710 if (params == NULL) { | 1710 if (params == NULL) { |
| 1711 return error::kOutOfBounds; | 1711 return error::kOutOfBounds; |
| 1712 } | 1712 } |
| 1713 LOCAL_COPY_REAL_GL_ERRORS_TO_WRAPPER("GetProgramiv"); | 1713 LOCAL_COPY_REAL_GL_ERRORS_TO_WRAPPER("GetProgramiv"); |
| 1714 // Check that the client initialized the result. | 1714 // Check that the client initialized the result. |
| 1715 if (result->size != 0) { | 1715 if (result->size != 0) { |
| 1716 return error::kInvalidArguments; | 1716 return error::kInvalidArguments; |
| 1717 } | 1717 } |
| 1718 DoGetProgramiv(program, pname, params); | 1718 DoGetProgramiv(program, pname, params); |
| 1719 GLenum error = glGetError(); | 1719 GLenum error = LOCAL_PEEK_GL_ERROR("GetProgramiv"); |
| 1720 if (error == GL_NO_ERROR) { | 1720 if (error == GL_NO_ERROR) { |
| 1721 result->SetNumResults(num_values); | 1721 result->SetNumResults(num_values); |
| 1722 } else { | |
| 1723 LOCAL_SET_GL_ERROR(error, "GetProgramiv", ""); | |
| 1724 } | 1722 } |
| 1725 return error::kNoError; | 1723 return error::kNoError; |
| 1726 } | 1724 } |
| 1727 | 1725 |
| 1728 error::Error GLES2DecoderImpl::HandleGetRenderbufferParameteriv( | 1726 error::Error GLES2DecoderImpl::HandleGetRenderbufferParameteriv( |
| 1729 uint32_t immediate_data_size, | 1727 uint32_t immediate_data_size, |
| 1730 const void* cmd_data) { | 1728 const void* cmd_data) { |
| 1731 const gles2::cmds::GetRenderbufferParameteriv& c = | 1729 const gles2::cmds::GetRenderbufferParameteriv& c = |
| 1732 *static_cast<const gles2::cmds::GetRenderbufferParameteriv*>(cmd_data); | 1730 *static_cast<const gles2::cmds::GetRenderbufferParameteriv*>(cmd_data); |
| 1733 (void)c; | 1731 (void)c; |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 1751 } | 1749 } |
| 1752 if (params == NULL) { | 1750 if (params == NULL) { |
| 1753 return error::kOutOfBounds; | 1751 return error::kOutOfBounds; |
| 1754 } | 1752 } |
| 1755 LOCAL_COPY_REAL_GL_ERRORS_TO_WRAPPER("GetRenderbufferParameteriv"); | 1753 LOCAL_COPY_REAL_GL_ERRORS_TO_WRAPPER("GetRenderbufferParameteriv"); |
| 1756 // Check that the client initialized the result. | 1754 // Check that the client initialized the result. |
| 1757 if (result->size != 0) { | 1755 if (result->size != 0) { |
| 1758 return error::kInvalidArguments; | 1756 return error::kInvalidArguments; |
| 1759 } | 1757 } |
| 1760 DoGetRenderbufferParameteriv(target, pname, params); | 1758 DoGetRenderbufferParameteriv(target, pname, params); |
| 1761 GLenum error = glGetError(); | 1759 GLenum error = LOCAL_PEEK_GL_ERROR("GetRenderbufferParameteriv"); |
| 1762 if (error == GL_NO_ERROR) { | 1760 if (error == GL_NO_ERROR) { |
| 1763 result->SetNumResults(num_values); | 1761 result->SetNumResults(num_values); |
| 1764 } else { | |
| 1765 LOCAL_SET_GL_ERROR(error, "GetRenderbufferParameteriv", ""); | |
| 1766 } | 1762 } |
| 1767 return error::kNoError; | 1763 return error::kNoError; |
| 1768 } | 1764 } |
| 1769 | 1765 |
| 1770 error::Error GLES2DecoderImpl::HandleGetSamplerParameterfv( | 1766 error::Error GLES2DecoderImpl::HandleGetSamplerParameterfv( |
| 1771 uint32_t immediate_data_size, | 1767 uint32_t immediate_data_size, |
| 1772 const void* cmd_data) { | 1768 const void* cmd_data) { |
| 1773 if (!unsafe_es3_apis_enabled()) | 1769 if (!unsafe_es3_apis_enabled()) |
| 1774 return error::kUnknownCommand; | 1770 return error::kUnknownCommand; |
| 1775 const gles2::cmds::GetSamplerParameterfv& c = | 1771 const gles2::cmds::GetSamplerParameterfv& c = |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 1790 // Check that the client initialized the result. | 1786 // Check that the client initialized the result. |
| 1791 if (result->size != 0) { | 1787 if (result->size != 0) { |
| 1792 return error::kInvalidArguments; | 1788 return error::kInvalidArguments; |
| 1793 } | 1789 } |
| 1794 if (!group_->GetSamplerServiceId(sampler, &sampler)) { | 1790 if (!group_->GetSamplerServiceId(sampler, &sampler)) { |
| 1795 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, "glGetSamplerParameterfv", | 1791 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, "glGetSamplerParameterfv", |
| 1796 "invalid sampler id"); | 1792 "invalid sampler id"); |
| 1797 return error::kNoError; | 1793 return error::kNoError; |
| 1798 } | 1794 } |
| 1799 glGetSamplerParameterfv(sampler, pname, params); | 1795 glGetSamplerParameterfv(sampler, pname, params); |
| 1800 GLenum error = glGetError(); | 1796 GLenum error = LOCAL_PEEK_GL_ERROR("GetSamplerParameterfv"); |
| 1801 if (error == GL_NO_ERROR) { | 1797 if (error == GL_NO_ERROR) { |
| 1802 result->SetNumResults(num_values); | 1798 result->SetNumResults(num_values); |
| 1803 } else { | |
| 1804 LOCAL_SET_GL_ERROR(error, "GetSamplerParameterfv", ""); | |
| 1805 } | 1799 } |
| 1806 return error::kNoError; | 1800 return error::kNoError; |
| 1807 } | 1801 } |
| 1808 | 1802 |
| 1809 error::Error GLES2DecoderImpl::HandleGetSamplerParameteriv( | 1803 error::Error GLES2DecoderImpl::HandleGetSamplerParameteriv( |
| 1810 uint32_t immediate_data_size, | 1804 uint32_t immediate_data_size, |
| 1811 const void* cmd_data) { | 1805 const void* cmd_data) { |
| 1812 if (!unsafe_es3_apis_enabled()) | 1806 if (!unsafe_es3_apis_enabled()) |
| 1813 return error::kUnknownCommand; | 1807 return error::kUnknownCommand; |
| 1814 const gles2::cmds::GetSamplerParameteriv& c = | 1808 const gles2::cmds::GetSamplerParameteriv& c = |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 1829 // Check that the client initialized the result. | 1823 // Check that the client initialized the result. |
| 1830 if (result->size != 0) { | 1824 if (result->size != 0) { |
| 1831 return error::kInvalidArguments; | 1825 return error::kInvalidArguments; |
| 1832 } | 1826 } |
| 1833 if (!group_->GetSamplerServiceId(sampler, &sampler)) { | 1827 if (!group_->GetSamplerServiceId(sampler, &sampler)) { |
| 1834 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, "glGetSamplerParameteriv", | 1828 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, "glGetSamplerParameteriv", |
| 1835 "invalid sampler id"); | 1829 "invalid sampler id"); |
| 1836 return error::kNoError; | 1830 return error::kNoError; |
| 1837 } | 1831 } |
| 1838 glGetSamplerParameteriv(sampler, pname, params); | 1832 glGetSamplerParameteriv(sampler, pname, params); |
| 1839 GLenum error = glGetError(); | 1833 GLenum error = LOCAL_PEEK_GL_ERROR("GetSamplerParameteriv"); |
| 1840 if (error == GL_NO_ERROR) { | 1834 if (error == GL_NO_ERROR) { |
| 1841 result->SetNumResults(num_values); | 1835 result->SetNumResults(num_values); |
| 1842 } else { | |
| 1843 LOCAL_SET_GL_ERROR(error, "GetSamplerParameteriv", ""); | |
| 1844 } | 1836 } |
| 1845 return error::kNoError; | 1837 return error::kNoError; |
| 1846 } | 1838 } |
| 1847 | 1839 |
| 1848 error::Error GLES2DecoderImpl::HandleGetShaderiv(uint32_t immediate_data_size, | 1840 error::Error GLES2DecoderImpl::HandleGetShaderiv(uint32_t immediate_data_size, |
| 1849 const void* cmd_data) { | 1841 const void* cmd_data) { |
| 1850 const gles2::cmds::GetShaderiv& c = | 1842 const gles2::cmds::GetShaderiv& c = |
| 1851 *static_cast<const gles2::cmds::GetShaderiv*>(cmd_data); | 1843 *static_cast<const gles2::cmds::GetShaderiv*>(cmd_data); |
| 1852 (void)c; | 1844 (void)c; |
| 1853 GLuint shader = c.shader; | 1845 GLuint shader = c.shader; |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 1864 } | 1856 } |
| 1865 if (params == NULL) { | 1857 if (params == NULL) { |
| 1866 return error::kOutOfBounds; | 1858 return error::kOutOfBounds; |
| 1867 } | 1859 } |
| 1868 LOCAL_COPY_REAL_GL_ERRORS_TO_WRAPPER("GetShaderiv"); | 1860 LOCAL_COPY_REAL_GL_ERRORS_TO_WRAPPER("GetShaderiv"); |
| 1869 // Check that the client initialized the result. | 1861 // Check that the client initialized the result. |
| 1870 if (result->size != 0) { | 1862 if (result->size != 0) { |
| 1871 return error::kInvalidArguments; | 1863 return error::kInvalidArguments; |
| 1872 } | 1864 } |
| 1873 DoGetShaderiv(shader, pname, params); | 1865 DoGetShaderiv(shader, pname, params); |
| 1874 GLenum error = glGetError(); | 1866 GLenum error = LOCAL_PEEK_GL_ERROR("GetShaderiv"); |
| 1875 if (error == GL_NO_ERROR) { | 1867 if (error == GL_NO_ERROR) { |
| 1876 result->SetNumResults(num_values); | 1868 result->SetNumResults(num_values); |
| 1877 } else { | |
| 1878 LOCAL_SET_GL_ERROR(error, "GetShaderiv", ""); | |
| 1879 } | 1869 } |
| 1880 return error::kNoError; | 1870 return error::kNoError; |
| 1881 } | 1871 } |
| 1882 | 1872 |
| 1883 error::Error GLES2DecoderImpl::HandleGetSynciv(uint32_t immediate_data_size, | 1873 error::Error GLES2DecoderImpl::HandleGetSynciv(uint32_t immediate_data_size, |
| 1884 const void* cmd_data) { | 1874 const void* cmd_data) { |
| 1885 if (!unsafe_es3_apis_enabled()) | 1875 if (!unsafe_es3_apis_enabled()) |
| 1886 return error::kUnknownCommand; | 1876 return error::kUnknownCommand; |
| 1887 const gles2::cmds::GetSynciv& c = | 1877 const gles2::cmds::GetSynciv& c = |
| 1888 *static_cast<const gles2::cmds::GetSynciv*>(cmd_data); | 1878 *static_cast<const gles2::cmds::GetSynciv*>(cmd_data); |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 1902 // Check that the client initialized the result. | 1892 // Check that the client initialized the result. |
| 1903 if (result->size != 0) { | 1893 if (result->size != 0) { |
| 1904 return error::kInvalidArguments; | 1894 return error::kInvalidArguments; |
| 1905 } | 1895 } |
| 1906 GLsync service_sync = 0; | 1896 GLsync service_sync = 0; |
| 1907 if (!group_->GetSyncServiceId(sync, &service_sync)) { | 1897 if (!group_->GetSyncServiceId(sync, &service_sync)) { |
| 1908 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, "glGetSynciv", "invalid sync id"); | 1898 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, "glGetSynciv", "invalid sync id"); |
| 1909 return error::kNoError; | 1899 return error::kNoError; |
| 1910 } | 1900 } |
| 1911 glGetSynciv(service_sync, pname, num_values, nullptr, values); | 1901 glGetSynciv(service_sync, pname, num_values, nullptr, values); |
| 1912 GLenum error = glGetError(); | 1902 GLenum error = LOCAL_PEEK_GL_ERROR("GetSynciv"); |
| 1913 if (error == GL_NO_ERROR) { | 1903 if (error == GL_NO_ERROR) { |
| 1914 result->SetNumResults(num_values); | 1904 result->SetNumResults(num_values); |
| 1915 } else { | |
| 1916 LOCAL_SET_GL_ERROR(error, "GetSynciv", ""); | |
| 1917 } | 1905 } |
| 1918 return error::kNoError; | 1906 return error::kNoError; |
| 1919 } | 1907 } |
| 1920 | 1908 |
| 1921 error::Error GLES2DecoderImpl::HandleGetTexParameterfv( | 1909 error::Error GLES2DecoderImpl::HandleGetTexParameterfv( |
| 1922 uint32_t immediate_data_size, | 1910 uint32_t immediate_data_size, |
| 1923 const void* cmd_data) { | 1911 const void* cmd_data) { |
| 1924 const gles2::cmds::GetTexParameterfv& c = | 1912 const gles2::cmds::GetTexParameterfv& c = |
| 1925 *static_cast<const gles2::cmds::GetTexParameterfv*>(cmd_data); | 1913 *static_cast<const gles2::cmds::GetTexParameterfv*>(cmd_data); |
| 1926 (void)c; | 1914 (void)c; |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 1942 } | 1930 } |
| 1943 if (params == NULL) { | 1931 if (params == NULL) { |
| 1944 return error::kOutOfBounds; | 1932 return error::kOutOfBounds; |
| 1945 } | 1933 } |
| 1946 LOCAL_COPY_REAL_GL_ERRORS_TO_WRAPPER("GetTexParameterfv"); | 1934 LOCAL_COPY_REAL_GL_ERRORS_TO_WRAPPER("GetTexParameterfv"); |
| 1947 // Check that the client initialized the result. | 1935 // Check that the client initialized the result. |
| 1948 if (result->size != 0) { | 1936 if (result->size != 0) { |
| 1949 return error::kInvalidArguments; | 1937 return error::kInvalidArguments; |
| 1950 } | 1938 } |
| 1951 DoGetTexParameterfv(target, pname, params); | 1939 DoGetTexParameterfv(target, pname, params); |
| 1952 GLenum error = glGetError(); | 1940 GLenum error = LOCAL_PEEK_GL_ERROR("GetTexParameterfv"); |
| 1953 if (error == GL_NO_ERROR) { | 1941 if (error == GL_NO_ERROR) { |
| 1954 result->SetNumResults(num_values); | 1942 result->SetNumResults(num_values); |
| 1955 } else { | |
| 1956 LOCAL_SET_GL_ERROR(error, "GetTexParameterfv", ""); | |
| 1957 } | 1943 } |
| 1958 return error::kNoError; | 1944 return error::kNoError; |
| 1959 } | 1945 } |
| 1960 | 1946 |
| 1961 error::Error GLES2DecoderImpl::HandleGetTexParameteriv( | 1947 error::Error GLES2DecoderImpl::HandleGetTexParameteriv( |
| 1962 uint32_t immediate_data_size, | 1948 uint32_t immediate_data_size, |
| 1963 const void* cmd_data) { | 1949 const void* cmd_data) { |
| 1964 const gles2::cmds::GetTexParameteriv& c = | 1950 const gles2::cmds::GetTexParameteriv& c = |
| 1965 *static_cast<const gles2::cmds::GetTexParameteriv*>(cmd_data); | 1951 *static_cast<const gles2::cmds::GetTexParameteriv*>(cmd_data); |
| 1966 (void)c; | 1952 (void)c; |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 1982 } | 1968 } |
| 1983 if (params == NULL) { | 1969 if (params == NULL) { |
| 1984 return error::kOutOfBounds; | 1970 return error::kOutOfBounds; |
| 1985 } | 1971 } |
| 1986 LOCAL_COPY_REAL_GL_ERRORS_TO_WRAPPER("GetTexParameteriv"); | 1972 LOCAL_COPY_REAL_GL_ERRORS_TO_WRAPPER("GetTexParameteriv"); |
| 1987 // Check that the client initialized the result. | 1973 // Check that the client initialized the result. |
| 1988 if (result->size != 0) { | 1974 if (result->size != 0) { |
| 1989 return error::kInvalidArguments; | 1975 return error::kInvalidArguments; |
| 1990 } | 1976 } |
| 1991 DoGetTexParameteriv(target, pname, params); | 1977 DoGetTexParameteriv(target, pname, params); |
| 1992 GLenum error = glGetError(); | 1978 GLenum error = LOCAL_PEEK_GL_ERROR("GetTexParameteriv"); |
| 1993 if (error == GL_NO_ERROR) { | 1979 if (error == GL_NO_ERROR) { |
| 1994 result->SetNumResults(num_values); | 1980 result->SetNumResults(num_values); |
| 1995 } else { | |
| 1996 LOCAL_SET_GL_ERROR(error, "GetTexParameteriv", ""); | |
| 1997 } | 1981 } |
| 1998 return error::kNoError; | 1982 return error::kNoError; |
| 1999 } | 1983 } |
| 2000 | 1984 |
| 2001 error::Error GLES2DecoderImpl::HandleGetVertexAttribfv( | 1985 error::Error GLES2DecoderImpl::HandleGetVertexAttribfv( |
| 2002 uint32_t immediate_data_size, | 1986 uint32_t immediate_data_size, |
| 2003 const void* cmd_data) { | 1987 const void* cmd_data) { |
| 2004 const gles2::cmds::GetVertexAttribfv& c = | 1988 const gles2::cmds::GetVertexAttribfv& c = |
| 2005 *static_cast<const gles2::cmds::GetVertexAttribfv*>(cmd_data); | 1989 *static_cast<const gles2::cmds::GetVertexAttribfv*>(cmd_data); |
| 2006 (void)c; | 1990 (void)c; |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 2018 } | 2002 } |
| 2019 if (params == NULL) { | 2003 if (params == NULL) { |
| 2020 return error::kOutOfBounds; | 2004 return error::kOutOfBounds; |
| 2021 } | 2005 } |
| 2022 LOCAL_COPY_REAL_GL_ERRORS_TO_WRAPPER("GetVertexAttribfv"); | 2006 LOCAL_COPY_REAL_GL_ERRORS_TO_WRAPPER("GetVertexAttribfv"); |
| 2023 // Check that the client initialized the result. | 2007 // Check that the client initialized the result. |
| 2024 if (result->size != 0) { | 2008 if (result->size != 0) { |
| 2025 return error::kInvalidArguments; | 2009 return error::kInvalidArguments; |
| 2026 } | 2010 } |
| 2027 DoGetVertexAttribfv(index, pname, params); | 2011 DoGetVertexAttribfv(index, pname, params); |
| 2028 GLenum error = glGetError(); | 2012 GLenum error = LOCAL_PEEK_GL_ERROR("GetVertexAttribfv"); |
| 2029 if (error == GL_NO_ERROR) { | 2013 if (error == GL_NO_ERROR) { |
| 2030 result->SetNumResults(num_values); | 2014 result->SetNumResults(num_values); |
| 2031 } else { | |
| 2032 LOCAL_SET_GL_ERROR(error, "GetVertexAttribfv", ""); | |
| 2033 } | 2015 } |
| 2034 return error::kNoError; | 2016 return error::kNoError; |
| 2035 } | 2017 } |
| 2036 | 2018 |
| 2037 error::Error GLES2DecoderImpl::HandleGetVertexAttribiv( | 2019 error::Error GLES2DecoderImpl::HandleGetVertexAttribiv( |
| 2038 uint32_t immediate_data_size, | 2020 uint32_t immediate_data_size, |
| 2039 const void* cmd_data) { | 2021 const void* cmd_data) { |
| 2040 const gles2::cmds::GetVertexAttribiv& c = | 2022 const gles2::cmds::GetVertexAttribiv& c = |
| 2041 *static_cast<const gles2::cmds::GetVertexAttribiv*>(cmd_data); | 2023 *static_cast<const gles2::cmds::GetVertexAttribiv*>(cmd_data); |
| 2042 (void)c; | 2024 (void)c; |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 2054 } | 2036 } |
| 2055 if (params == NULL) { | 2037 if (params == NULL) { |
| 2056 return error::kOutOfBounds; | 2038 return error::kOutOfBounds; |
| 2057 } | 2039 } |
| 2058 LOCAL_COPY_REAL_GL_ERRORS_TO_WRAPPER("GetVertexAttribiv"); | 2040 LOCAL_COPY_REAL_GL_ERRORS_TO_WRAPPER("GetVertexAttribiv"); |
| 2059 // Check that the client initialized the result. | 2041 // Check that the client initialized the result. |
| 2060 if (result->size != 0) { | 2042 if (result->size != 0) { |
| 2061 return error::kInvalidArguments; | 2043 return error::kInvalidArguments; |
| 2062 } | 2044 } |
| 2063 DoGetVertexAttribiv(index, pname, params); | 2045 DoGetVertexAttribiv(index, pname, params); |
| 2064 GLenum error = glGetError(); | 2046 GLenum error = LOCAL_PEEK_GL_ERROR("GetVertexAttribiv"); |
| 2065 if (error == GL_NO_ERROR) { | 2047 if (error == GL_NO_ERROR) { |
| 2066 result->SetNumResults(num_values); | 2048 result->SetNumResults(num_values); |
| 2067 } else { | |
| 2068 LOCAL_SET_GL_ERROR(error, "GetVertexAttribiv", ""); | |
| 2069 } | 2049 } |
| 2070 return error::kNoError; | 2050 return error::kNoError; |
| 2071 } | 2051 } |
| 2072 | 2052 |
| 2073 error::Error GLES2DecoderImpl::HandleGetVertexAttribIiv( | 2053 error::Error GLES2DecoderImpl::HandleGetVertexAttribIiv( |
| 2074 uint32_t immediate_data_size, | 2054 uint32_t immediate_data_size, |
| 2075 const void* cmd_data) { | 2055 const void* cmd_data) { |
| 2076 if (!unsafe_es3_apis_enabled()) | 2056 if (!unsafe_es3_apis_enabled()) |
| 2077 return error::kUnknownCommand; | 2057 return error::kUnknownCommand; |
| 2078 const gles2::cmds::GetVertexAttribIiv& c = | 2058 const gles2::cmds::GetVertexAttribIiv& c = |
| 2079 *static_cast<const gles2::cmds::GetVertexAttribIiv*>(cmd_data); | 2059 *static_cast<const gles2::cmds::GetVertexAttribIiv*>(cmd_data); |
| 2080 (void)c; | 2060 (void)c; |
| 2081 GLuint index = static_cast<GLuint>(c.index); | 2061 GLuint index = static_cast<GLuint>(c.index); |
| 2082 GLenum pname = static_cast<GLenum>(c.pname); | 2062 GLenum pname = static_cast<GLenum>(c.pname); |
| 2083 typedef cmds::GetVertexAttribIiv::Result Result; | 2063 typedef cmds::GetVertexAttribIiv::Result Result; |
| 2084 GLsizei num_values = 0; | 2064 GLsizei num_values = 0; |
| 2085 GetNumValuesReturnedForGLGet(pname, &num_values); | 2065 GetNumValuesReturnedForGLGet(pname, &num_values); |
| 2086 Result* result = GetSharedMemoryAs<Result*>( | 2066 Result* result = GetSharedMemoryAs<Result*>( |
| 2087 c.params_shm_id, c.params_shm_offset, Result::ComputeSize(num_values)); | 2067 c.params_shm_id, c.params_shm_offset, Result::ComputeSize(num_values)); |
| 2088 GLint* params = result ? result->GetData() : NULL; | 2068 GLint* params = result ? result->GetData() : NULL; |
| 2089 if (params == NULL) { | 2069 if (params == NULL) { |
| 2090 return error::kOutOfBounds; | 2070 return error::kOutOfBounds; |
| 2091 } | 2071 } |
| 2092 LOCAL_COPY_REAL_GL_ERRORS_TO_WRAPPER("GetVertexAttribIiv"); | 2072 LOCAL_COPY_REAL_GL_ERRORS_TO_WRAPPER("GetVertexAttribIiv"); |
| 2093 // Check that the client initialized the result. | 2073 // Check that the client initialized the result. |
| 2094 if (result->size != 0) { | 2074 if (result->size != 0) { |
| 2095 return error::kInvalidArguments; | 2075 return error::kInvalidArguments; |
| 2096 } | 2076 } |
| 2097 DoGetVertexAttribIiv(index, pname, params); | 2077 DoGetVertexAttribIiv(index, pname, params); |
| 2098 GLenum error = glGetError(); | 2078 GLenum error = LOCAL_PEEK_GL_ERROR("GetVertexAttribIiv"); |
| 2099 if (error == GL_NO_ERROR) { | 2079 if (error == GL_NO_ERROR) { |
| 2100 result->SetNumResults(num_values); | 2080 result->SetNumResults(num_values); |
| 2101 } else { | |
| 2102 LOCAL_SET_GL_ERROR(error, "GetVertexAttribIiv", ""); | |
| 2103 } | 2081 } |
| 2104 return error::kNoError; | 2082 return error::kNoError; |
| 2105 } | 2083 } |
| 2106 | 2084 |
| 2107 error::Error GLES2DecoderImpl::HandleGetVertexAttribIuiv( | 2085 error::Error GLES2DecoderImpl::HandleGetVertexAttribIuiv( |
| 2108 uint32_t immediate_data_size, | 2086 uint32_t immediate_data_size, |
| 2109 const void* cmd_data) { | 2087 const void* cmd_data) { |
| 2110 if (!unsafe_es3_apis_enabled()) | 2088 if (!unsafe_es3_apis_enabled()) |
| 2111 return error::kUnknownCommand; | 2089 return error::kUnknownCommand; |
| 2112 const gles2::cmds::GetVertexAttribIuiv& c = | 2090 const gles2::cmds::GetVertexAttribIuiv& c = |
| 2113 *static_cast<const gles2::cmds::GetVertexAttribIuiv*>(cmd_data); | 2091 *static_cast<const gles2::cmds::GetVertexAttribIuiv*>(cmd_data); |
| 2114 (void)c; | 2092 (void)c; |
| 2115 GLuint index = static_cast<GLuint>(c.index); | 2093 GLuint index = static_cast<GLuint>(c.index); |
| 2116 GLenum pname = static_cast<GLenum>(c.pname); | 2094 GLenum pname = static_cast<GLenum>(c.pname); |
| 2117 typedef cmds::GetVertexAttribIuiv::Result Result; | 2095 typedef cmds::GetVertexAttribIuiv::Result Result; |
| 2118 GLsizei num_values = 0; | 2096 GLsizei num_values = 0; |
| 2119 GetNumValuesReturnedForGLGet(pname, &num_values); | 2097 GetNumValuesReturnedForGLGet(pname, &num_values); |
| 2120 Result* result = GetSharedMemoryAs<Result*>( | 2098 Result* result = GetSharedMemoryAs<Result*>( |
| 2121 c.params_shm_id, c.params_shm_offset, Result::ComputeSize(num_values)); | 2099 c.params_shm_id, c.params_shm_offset, Result::ComputeSize(num_values)); |
| 2122 GLuint* params = result ? result->GetData() : NULL; | 2100 GLuint* params = result ? result->GetData() : NULL; |
| 2123 if (params == NULL) { | 2101 if (params == NULL) { |
| 2124 return error::kOutOfBounds; | 2102 return error::kOutOfBounds; |
| 2125 } | 2103 } |
| 2126 LOCAL_COPY_REAL_GL_ERRORS_TO_WRAPPER("GetVertexAttribIuiv"); | 2104 LOCAL_COPY_REAL_GL_ERRORS_TO_WRAPPER("GetVertexAttribIuiv"); |
| 2127 // Check that the client initialized the result. | 2105 // Check that the client initialized the result. |
| 2128 if (result->size != 0) { | 2106 if (result->size != 0) { |
| 2129 return error::kInvalidArguments; | 2107 return error::kInvalidArguments; |
| 2130 } | 2108 } |
| 2131 DoGetVertexAttribIuiv(index, pname, params); | 2109 DoGetVertexAttribIuiv(index, pname, params); |
| 2132 GLenum error = glGetError(); | 2110 GLenum error = LOCAL_PEEK_GL_ERROR("GetVertexAttribIuiv"); |
| 2133 if (error == GL_NO_ERROR) { | 2111 if (error == GL_NO_ERROR) { |
| 2134 result->SetNumResults(num_values); | 2112 result->SetNumResults(num_values); |
| 2135 } else { | |
| 2136 LOCAL_SET_GL_ERROR(error, "GetVertexAttribIuiv", ""); | |
| 2137 } | 2113 } |
| 2138 return error::kNoError; | 2114 return error::kNoError; |
| 2139 } | 2115 } |
| 2140 | 2116 |
| 2141 error::Error GLES2DecoderImpl::HandleHint(uint32_t immediate_data_size, | 2117 error::Error GLES2DecoderImpl::HandleHint(uint32_t immediate_data_size, |
| 2142 const void* cmd_data) { | 2118 const void* cmd_data) { |
| 2143 const gles2::cmds::Hint& c = *static_cast<const gles2::cmds::Hint*>(cmd_data); | 2119 const gles2::cmds::Hint& c = *static_cast<const gles2::cmds::Hint*>(cmd_data); |
| 2144 (void)c; | 2120 (void)c; |
| 2145 GLenum target = static_cast<GLenum>(c.target); | 2121 GLenum target = static_cast<GLenum>(c.target); |
| 2146 GLenum mode = static_cast<GLenum>(c.mode); | 2122 GLenum mode = static_cast<GLenum>(c.mode); |
| (...skipping 2950 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5097 state_.enable_flags.cached_primitive_restart_fixed_index = enabled; | 5073 state_.enable_flags.cached_primitive_restart_fixed_index = enabled; |
| 5098 return true; | 5074 return true; |
| 5099 } | 5075 } |
| 5100 return false; | 5076 return false; |
| 5101 default: | 5077 default: |
| 5102 NOTREACHED(); | 5078 NOTREACHED(); |
| 5103 return false; | 5079 return false; |
| 5104 } | 5080 } |
| 5105 } | 5081 } |
| 5106 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_AUTOGEN_H_ | 5082 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_AUTOGEN_H_ |
| OLD | NEW |