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

Side by Side Diff: gpu/command_buffer/build_gles2_cmd_buffer.py

Issue 282253002: Remove unneeded shm versions of bucket functions from command buffer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@no-shm-for-immediate-commands
Patch Set: rebase Created 6 years, 6 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
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """code generator for GLES2 command buffers.""" 6 """code generator for GLES2 command buffers."""
7 7
8 import itertools 8 import itertools
9 import os 9 import os
10 import os.path 10 import os.path
(...skipping 1224 matching lines...) Expand 10 before | Expand all | Expand 10 after
1235 # type: defines which handler will be used to generate code. 1235 # type: defines which handler will be used to generate code.
1236 # decoder_func: defines which function to call in the decoder to execute the 1236 # decoder_func: defines which function to call in the decoder to execute the
1237 # corresponding GL command. If not specified the GL command will 1237 # corresponding GL command. If not specified the GL command will
1238 # be called directly. 1238 # be called directly.
1239 # gl_test_func: GL function that is expected to be called when testing. 1239 # gl_test_func: GL function that is expected to be called when testing.
1240 # cmd_args: The arguments to use for the command. This overrides generating 1240 # cmd_args: The arguments to use for the command. This overrides generating
1241 # them based on the GL function arguments. 1241 # them based on the GL function arguments.
1242 # a NonImmediate type is a type that stays a pointer even in 1242 # a NonImmediate type is a type that stays a pointer even in
1243 # and immediate version of acommand. 1243 # and immediate version of acommand.
1244 # gen_cmd: Whether or not this function geneates a command. Default = True. 1244 # gen_cmd: Whether or not this function geneates a command. Default = True.
1245 # immediate: Whether or not to generate an immediate command for the GL 1245 # data_transfer_methods: Array of methods that are used for transfering the
1246 # function. The default is if there is exactly 1 pointer argument 1246 # pointer data. Possible values: 'immediate', 'shm', 'bucket'.
1247 # in the GL function an immediate command is generated. 1247 # The default is 'immediate' if the command has one pointer
1248 # bucket: True to generate a bucket version of the command. 1248 # argument, otherwise 'shm'. One command is generated for each
1249 # transfer method. Affects only commands which are not of type
1250 # 'HandWritten', 'GETn' or 'GLcharN'.
1251 # Note: the command arguments that affect this are the final args,
1252 # taking cmd_args override into consideration.
1249 # impl_func: Whether or not to generate the GLES2Implementation part of this 1253 # impl_func: Whether or not to generate the GLES2Implementation part of this
1250 # command. 1254 # command.
1251 # impl_decl: Whether or not to generate the GLES2Implementation declaration 1255 # impl_decl: Whether or not to generate the GLES2Implementation declaration
1252 # for this command. 1256 # for this command.
1253 # needs_size: If true a data_size field is added to the command. 1257 # needs_size: If true a data_size field is added to the command.
1254 # count: The number of units per element. For PUTn or PUT types. 1258 # count: The number of units per element. For PUTn or PUT types.
1255 # unit_test: If False no service side unit test will be generated. 1259 # unit_test: If False no service side unit test will be generated.
1256 # client_test: If False no client side unit test will be generated. 1260 # client_test: If False no client side unit test will be generated.
1257 # expectation: If False the unit test will have no expected calls. 1261 # expectation: If False the unit test will have no expected calls.
1258 # gen_func: Name of function that generates GL resource for corresponding 1262 # gen_func: Name of function that generates GL resource for corresponding
(...skipping 24 matching lines...) Expand all
1283 _FUNCTION_INFO = { 1287 _FUNCTION_INFO = {
1284 'ActiveTexture': { 1288 'ActiveTexture': {
1285 'decoder_func': 'DoActiveTexture', 1289 'decoder_func': 'DoActiveTexture',
1286 'unit_test': False, 1290 'unit_test': False,
1287 'impl_func': False, 1291 'impl_func': False,
1288 'client_test': False, 1292 'client_test': False,
1289 }, 1293 },
1290 'AttachShader': {'decoder_func': 'DoAttachShader'}, 1294 'AttachShader': {'decoder_func': 'DoAttachShader'},
1291 'BindAttribLocation': { 1295 'BindAttribLocation': {
1292 'type': 'GLchar', 1296 'type': 'GLchar',
1293 'bucket': True, 1297 'data_transfer_methods': ['bucket'],
1294 'needs_size': True, 1298 'needs_size': True,
1295 'immediate': False,
1296 }, 1299 },
1297 'BindBuffer': { 1300 'BindBuffer': {
1298 'type': 'Bind', 1301 'type': 'Bind',
1299 'decoder_func': 'DoBindBuffer', 1302 'decoder_func': 'DoBindBuffer',
1300 'gen_func': 'GenBuffersARB', 1303 'gen_func': 'GenBuffersARB',
1301 }, 1304 },
1302 'BindFramebuffer': { 1305 'BindFramebuffer': {
1303 'type': 'Bind', 1306 'type': 'Bind',
1304 'decoder_func': 'DoBindFramebuffer', 1307 'decoder_func': 'DoBindFramebuffer',
1305 'gl_test_func': 'glBindFramebufferEXT', 1308 'gl_test_func': 'glBindFramebufferEXT',
(...skipping 19 matching lines...) Expand all
1325 'unit_test': False, 1328 'unit_test': False,
1326 'extension_flag': 'chromium_framebuffer_multisample', 1329 'extension_flag': 'chromium_framebuffer_multisample',
1327 'pepper_interface': 'FramebufferBlit', 1330 'pepper_interface': 'FramebufferBlit',
1328 'pepper_name': 'BlitFramebufferEXT', 1331 'pepper_name': 'BlitFramebufferEXT',
1329 'defer_reads': True, 1332 'defer_reads': True,
1330 'defer_draws': True, 1333 'defer_draws': True,
1331 'trace_level': 1, 1334 'trace_level': 1,
1332 }, 1335 },
1333 'BufferData': { 1336 'BufferData': {
1334 'type': 'Manual', 1337 'type': 'Manual',
1335 'immediate': False, 1338 'data_transfer_methods': ['shm'],
1336 'client_test': False, 1339 'client_test': False,
1337 }, 1340 },
1338 'BufferSubData': { 1341 'BufferSubData': {
1339 'type': 'Data', 1342 'type': 'Data',
1340 'client_test': False, 1343 'client_test': False,
1341 'decoder_func': 'DoBufferSubData', 1344 'decoder_func': 'DoBufferSubData',
1342 'immediate': False, 1345 'data_transfer_methods': ['shm'],
1343 }, 1346 },
1344 'CheckFramebufferStatus': { 1347 'CheckFramebufferStatus': {
1345 'type': 'Is', 1348 'type': 'Is',
1346 'decoder_func': 'DoCheckFramebufferStatus', 1349 'decoder_func': 'DoCheckFramebufferStatus',
1347 'gl_test_func': 'glCheckFramebufferStatusEXT', 1350 'gl_test_func': 'glCheckFramebufferStatusEXT',
1348 'error_value': 'GL_FRAMEBUFFER_UNSUPPORTED', 1351 'error_value': 'GL_FRAMEBUFFER_UNSUPPORTED',
1349 'result': ['GLenum'], 1352 'result': ['GLenum'],
1350 }, 1353 },
1351 'Clear': { 1354 'Clear': {
1352 'decoder_func': 'DoClear', 1355 'decoder_func': 'DoClear',
(...skipping 29 matching lines...) Expand all
1382 'extension': True, 1385 'extension': True,
1383 'chromium': True, 1386 'chromium': True,
1384 'trace_level': 1, 1387 'trace_level': 1,
1385 }, 1388 },
1386 'ClearStencil': { 1389 'ClearStencil': {
1387 'type': 'StateSet', 1390 'type': 'StateSet',
1388 'state': 'ClearStencil', 1391 'state': 'ClearStencil',
1389 }, 1392 },
1390 'EnableFeatureCHROMIUM': { 1393 'EnableFeatureCHROMIUM': {
1391 'type': 'Custom', 1394 'type': 'Custom',
1392 'immediate': False, 1395 'data_transfer_methods': ['shm'],
1393 'decoder_func': 'DoEnableFeatureCHROMIUM', 1396 'decoder_func': 'DoEnableFeatureCHROMIUM',
1394 'expectation': False, 1397 'expectation': False,
1395 'cmd_args': 'GLuint bucket_id, GLint* result', 1398 'cmd_args': 'GLuint bucket_id, GLint* result',
1396 'result': ['GLint'], 1399 'result': ['GLint'],
1397 'extension': True, 1400 'extension': True,
1398 'chromium': True, 1401 'chromium': True,
1399 'pepper_interface': 'ChromiumEnableFeature', 1402 'pepper_interface': 'ChromiumEnableFeature',
1400 }, 1403 },
1401 'CompileShader': {'decoder_func': 'DoCompileShader', 'unit_test': False}, 1404 'CompileShader': {'decoder_func': 'DoCompileShader', 'unit_test': False},
1402 'CompressedTexImage2D': { 1405 'CompressedTexImage2D': {
1403 'type': 'Manual', 1406 'type': 'Manual',
1404 'immediate': False, 1407 'data_transfer_methods': ['bucket', 'shm'],
1405 'bucket': True,
1406 }, 1408 },
1407 'CompressedTexSubImage2D': { 1409 'CompressedTexSubImage2D': {
1408 'type': 'Data', 1410 'type': 'Data',
1409 'bucket': True, 1411 'data_transfer_methods': ['bucket', 'shm'],
1410 'decoder_func': 'DoCompressedTexSubImage2D', 1412 'decoder_func': 'DoCompressedTexSubImage2D',
1411 'immediate': False,
1412 }, 1413 },
1413 'CopyTexImage2D': { 1414 'CopyTexImage2D': {
1414 'decoder_func': 'DoCopyTexImage2D', 1415 'decoder_func': 'DoCopyTexImage2D',
1415 'unit_test': False, 1416 'unit_test': False,
1416 'defer_reads': True, 1417 'defer_reads': True,
1417 }, 1418 },
1418 'CopyTexSubImage2D': { 1419 'CopyTexSubImage2D': {
1419 'decoder_func': 'DoCopyTexSubImage2D', 1420 'decoder_func': 'DoCopyTexSubImage2D',
1420 'defer_reads': True, 1421 'defer_reads': True,
1421 }, 1422 },
1422 'CreateImageCHROMIUM': { 1423 'CreateImageCHROMIUM': {
1423 'type': 'Manual', 1424 'type': 'Manual',
1424 'cmd_args': 1425 'cmd_args':
1425 'GLsizei width, GLsizei height, GLenum internalformat, GLenum usage', 1426 'GLsizei width, GLsizei height, GLenum internalformat, GLenum usage',
1426 'result': ['GLuint'], 1427 'result': ['GLuint'],
1427 'client_test': False, 1428 'client_test': False,
1428 'gen_cmd': False, 1429 'gen_cmd': False,
1429 'expectation': False, 1430 'expectation': False,
1430 'extension': True, 1431 'extension': True,
1431 'chromium': True, 1432 'chromium': True,
1432 }, 1433 },
1433 'DestroyImageCHROMIUM': { 1434 'DestroyImageCHROMIUM': {
1434 'type': 'Manual', 1435 'type': 'Manual',
1435 'immediate': False,
1436 'client_test': False, 1436 'client_test': False,
1437 'gen_cmd': False, 1437 'gen_cmd': False,
1438 'extension': True, 1438 'extension': True,
1439 'chromium': True, 1439 'chromium': True,
1440 }, 1440 },
1441 'GetImageParameterivCHROMIUM': { 1441 'GetImageParameterivCHROMIUM': {
1442 'type': 'Manual', 1442 'type': 'Manual',
1443 'client_test': False, 1443 'client_test': False,
1444 'gen_cmd': False, 1444 'gen_cmd': False,
1445 'expectation': False, 1445 'expectation': False,
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
1539 'gl_test_func': 'glDeleteRenderbuffersEXT', 1539 'gl_test_func': 'glDeleteRenderbuffersEXT',
1540 'resource_type': 'Renderbuffer', 1540 'resource_type': 'Renderbuffer',
1541 'resource_types': 'Renderbuffers', 1541 'resource_types': 'Renderbuffers',
1542 }, 1542 },
1543 'DeleteShader': {'type': 'Delete', 'decoder_func': 'DoDeleteShader'}, 1543 'DeleteShader': {'type': 'Delete', 'decoder_func': 'DoDeleteShader'},
1544 'DeleteSharedIdsCHROMIUM': { 1544 'DeleteSharedIdsCHROMIUM': {
1545 'type': 'Custom', 1545 'type': 'Custom',
1546 'decoder_func': 'DoDeleteSharedIdsCHROMIUM', 1546 'decoder_func': 'DoDeleteSharedIdsCHROMIUM',
1547 'impl_func': False, 1547 'impl_func': False,
1548 'expectation': False, 1548 'expectation': False,
1549 'immediate': False, 1549 'data_transfer_methods': ['shm'],
1550 'extension': True, 1550 'extension': True,
1551 'chromium': True, 1551 'chromium': True,
1552 }, 1552 },
1553 'DeleteTextures': { 1553 'DeleteTextures': {
1554 'type': 'DELn', 1554 'type': 'DELn',
1555 'resource_type': 'Texture', 1555 'resource_type': 'Texture',
1556 'resource_types': 'Textures', 1556 'resource_types': 'Textures',
1557 }, 1557 },
1558 'DepthRangef': { 1558 'DepthRangef': {
1559 'decoder_func': 'DoDepthRangef', 1559 'decoder_func': 'DoDepthRangef',
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
1630 'gl_test_func': 'glGenerateMipmapEXT', 1630 'gl_test_func': 'glGenerateMipmapEXT',
1631 }, 1631 },
1632 'GenBuffers': { 1632 'GenBuffers': {
1633 'type': 'GENn', 1633 'type': 'GENn',
1634 'gl_test_func': 'glGenBuffersARB', 1634 'gl_test_func': 'glGenBuffersARB',
1635 'resource_type': 'Buffer', 1635 'resource_type': 'Buffer',
1636 'resource_types': 'Buffers', 1636 'resource_types': 'Buffers',
1637 }, 1637 },
1638 'GenMailboxCHROMIUM': { 1638 'GenMailboxCHROMIUM': {
1639 'type': 'HandWritten', 1639 'type': 'HandWritten',
1640 'immediate': False,
1641 'impl_func': False, 1640 'impl_func': False,
1642 'extension': True, 1641 'extension': True,
1643 'chromium': True, 1642 'chromium': True,
1644 }, 1643 },
1645 'GenFramebuffers': { 1644 'GenFramebuffers': {
1646 'type': 'GENn', 1645 'type': 'GENn',
1647 'gl_test_func': 'glGenFramebuffersEXT', 1646 'gl_test_func': 'glGenFramebuffersEXT',
1648 'resource_type': 'Framebuffer', 1647 'resource_type': 'Framebuffer',
1649 'resource_types': 'Framebuffers', 1648 'resource_types': 'Framebuffers',
1650 }, 1649 },
1651 'GenRenderbuffers': { 1650 'GenRenderbuffers': {
1652 'type': 'GENn', 'gl_test_func': 'glGenRenderbuffersEXT', 1651 'type': 'GENn', 'gl_test_func': 'glGenRenderbuffersEXT',
1653 'resource_type': 'Renderbuffer', 1652 'resource_type': 'Renderbuffer',
1654 'resource_types': 'Renderbuffers', 1653 'resource_types': 'Renderbuffers',
1655 }, 1654 },
1656 'GenTextures': { 1655 'GenTextures': {
1657 'type': 'GENn', 1656 'type': 'GENn',
1658 'gl_test_func': 'glGenTextures', 1657 'gl_test_func': 'glGenTextures',
1659 'resource_type': 'Texture', 1658 'resource_type': 'Texture',
1660 'resource_types': 'Textures', 1659 'resource_types': 'Textures',
1661 }, 1660 },
1662 'GenSharedIdsCHROMIUM': { 1661 'GenSharedIdsCHROMIUM': {
1663 'type': 'Custom', 1662 'type': 'Custom',
1664 'decoder_func': 'DoGenSharedIdsCHROMIUM', 1663 'decoder_func': 'DoGenSharedIdsCHROMIUM',
1665 'impl_func': False, 1664 'impl_func': False,
1666 'expectation': False, 1665 'expectation': False,
1667 'immediate': False, 1666 'data_transfer_methods': ['shm'],
1668 'extension': True, 1667 'extension': True,
1669 'chromium': True, 1668 'chromium': True,
1670 }, 1669 },
1671 'GetActiveAttrib': { 1670 'GetActiveAttrib': {
1672 'type': 'Custom', 1671 'type': 'Custom',
1673 'immediate': False, 1672 'data_transfer_methods': ['shm'],
1674 'cmd_args': 1673 'cmd_args':
1675 'GLidProgram program, GLuint index, uint32_t name_bucket_id, ' 1674 'GLidProgram program, GLuint index, uint32_t name_bucket_id, '
1676 'void* result', 1675 'void* result',
1677 'result': [ 1676 'result': [
1678 'int32_t success', 1677 'int32_t success',
1679 'int32_t size', 1678 'int32_t size',
1680 'uint32_t type', 1679 'uint32_t type',
1681 ], 1680 ],
1682 }, 1681 },
1683 'GetActiveUniform': { 1682 'GetActiveUniform': {
1684 'type': 'Custom', 1683 'type': 'Custom',
1685 'immediate': False, 1684 'data_transfer_methods': ['shm'],
1686 'cmd_args': 1685 'cmd_args':
1687 'GLidProgram program, GLuint index, uint32_t name_bucket_id, ' 1686 'GLidProgram program, GLuint index, uint32_t name_bucket_id, '
1688 'void* result', 1687 'void* result',
1689 'result': [ 1688 'result': [
1690 'int32_t success', 1689 'int32_t success',
1691 'int32_t size', 1690 'int32_t size',
1692 'uint32_t type', 1691 'uint32_t type',
1693 ], 1692 ],
1694 }, 1693 },
1695 'GetAttachedShaders': { 1694 'GetAttachedShaders': {
1696 'type': 'Custom', 1695 'type': 'Custom',
1697 'immediate': False, 1696 'data_transfer_methods': ['shm'],
1698 'cmd_args': 'GLidProgram program, void* result, uint32_t result_size', 1697 'cmd_args': 'GLidProgram program, void* result, uint32_t result_size',
1699 'result': ['SizedResult<GLuint>'], 1698 'result': ['SizedResult<GLuint>'],
1700 }, 1699 },
1701 'GetAttribLocation': { 1700 'GetAttribLocation': {
1702 'type': 'HandWritten', 1701 'type': 'HandWritten',
1703 'immediate': False,
1704 'bucket': True,
1705 'needs_size': True, 1702 'needs_size': True,
1706 'cmd_args': 1703 'cmd_args':
1707 'GLidProgram program, const char* name, NonImmediate GLint* location', 1704 'GLidProgram program, const char* name, NonImmediate GLint* location',
1708 'result': ['GLint'], 1705 'result': ['GLint'],
1709 'error_return': -1, # http://www.opengl.org/sdk/docs/man/xhtml/glGetAttribLo cation.xml 1706 'error_return': -1, # http://www.opengl.org/sdk/docs/man/xhtml/glGetAttribLo cation.xml
1710 }, 1707 },
1711 'GetBooleanv': { 1708 'GetBooleanv': {
1712 'type': 'GETn', 1709 'type': 'GETn',
1713 'result': ['SizedResult<GLboolean>'], 1710 'result': ['SizedResult<GLboolean>'],
1714 'decoder_func': 'DoGetBooleanv', 1711 'decoder_func': 'DoGetBooleanv',
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
1751 'decoder_func': 'DoGetMaxValueInBufferCHROMIUM', 1748 'decoder_func': 'DoGetMaxValueInBufferCHROMIUM',
1752 'result': ['GLuint'], 1749 'result': ['GLuint'],
1753 'unit_test': False, 1750 'unit_test': False,
1754 'client_test': False, 1751 'client_test': False,
1755 'extension': True, 1752 'extension': True,
1756 'chromium': True, 1753 'chromium': True,
1757 'impl_func': False, 1754 'impl_func': False,
1758 }, 1755 },
1759 'GetMultipleIntegervCHROMIUM': { 1756 'GetMultipleIntegervCHROMIUM': {
1760 'type': 'Custom', 1757 'type': 'Custom',
1761 'immediate': False, 1758 'data_transfer_methods': ['shm'],
1762 'expectation': False, 1759 'expectation': False,
1763 'extension': True, 1760 'extension': True,
1764 'chromium': True, 1761 'chromium': True,
1765 'client_test': False, 1762 'client_test': False,
1766 }, 1763 },
1767 'GetProgramiv': { 1764 'GetProgramiv': {
1768 'type': 'GETn', 1765 'type': 'GETn',
1769 'decoder_func': 'DoGetProgramiv', 1766 'decoder_func': 'DoGetProgramiv',
1770 'result': ['SizedResult<GLint>'], 1767 'result': ['SizedResult<GLint>'],
1771 'expectation': False, 1768 'expectation': False,
1772 }, 1769 },
1773 'GetProgramInfoCHROMIUM': { 1770 'GetProgramInfoCHROMIUM': {
1774 'type': 'Custom', 1771 'type': 'Custom',
1775 'immediate': False,
1776 'expectation': False, 1772 'expectation': False,
1777 'impl_func': False, 1773 'impl_func': False,
1778 'extension': True, 1774 'extension': True,
1779 'chromium': True, 1775 'chromium': True,
1780 'client_test': False, 1776 'client_test': False,
1781 'cmd_args': 'GLidProgram program, uint32_t bucket_id', 1777 'cmd_args': 'GLidProgram program, uint32_t bucket_id',
1782 'result': [ 1778 'result': [
1783 'uint32_t link_status', 1779 'uint32_t link_status',
1784 'uint32_t num_attribs', 1780 'uint32_t num_attribs',
1785 'uint32_t num_uniforms', 1781 'uint32_t num_uniforms',
(...skipping 15 matching lines...) Expand all
1801 'result': ['SizedResult<GLint>'], 1797 'result': ['SizedResult<GLint>'],
1802 }, 1798 },
1803 'GetShaderInfoLog': { 1799 'GetShaderInfoLog': {
1804 'type': 'STRn', 1800 'type': 'STRn',
1805 'get_len_func': 'glGetShaderiv', 1801 'get_len_func': 'glGetShaderiv',
1806 'get_len_enum': 'GL_INFO_LOG_LENGTH', 1802 'get_len_enum': 'GL_INFO_LOG_LENGTH',
1807 'unit_test': False, 1803 'unit_test': False,
1808 }, 1804 },
1809 'GetShaderPrecisionFormat': { 1805 'GetShaderPrecisionFormat': {
1810 'type': 'Custom', 1806 'type': 'Custom',
1811 'immediate': False, 1807 'data_transfer_methods': ['shm'],
1812 'cmd_args': 1808 'cmd_args':
1813 'GLenumShaderType shadertype, GLenumShaderPrecision precisiontype, ' 1809 'GLenumShaderType shadertype, GLenumShaderPrecision precisiontype, '
1814 'void* result', 1810 'void* result',
1815 'result': [ 1811 'result': [
1816 'int32_t success', 1812 'int32_t success',
1817 'int32_t min_range', 1813 'int32_t min_range',
1818 'int32_t max_range', 1814 'int32_t max_range',
1819 'int32_t precision', 1815 'int32_t precision',
1820 ], 1816 ],
1821 }, 1817 },
(...skipping 21 matching lines...) Expand all
1843 }, 1839 },
1844 'GetTranslatedShaderSourceANGLE': { 1840 'GetTranslatedShaderSourceANGLE': {
1845 'type': 'STRn', 1841 'type': 'STRn',
1846 'get_len_func': 'DoGetShaderiv', 1842 'get_len_func': 'DoGetShaderiv',
1847 'get_len_enum': 'GL_TRANSLATED_SHADER_SOURCE_LENGTH_ANGLE', 1843 'get_len_enum': 'GL_TRANSLATED_SHADER_SOURCE_LENGTH_ANGLE',
1848 'unit_test': False, 1844 'unit_test': False,
1849 'extension': True, 1845 'extension': True,
1850 }, 1846 },
1851 'GetUniformfv': { 1847 'GetUniformfv': {
1852 'type': 'Custom', 1848 'type': 'Custom',
1853 'immediate': False, 1849 'data_transfer_methods': ['shm'],
1854 'result': ['SizedResult<GLfloat>'], 1850 'result': ['SizedResult<GLfloat>'],
1855 }, 1851 },
1856 'GetUniformiv': { 1852 'GetUniformiv': {
1857 'type': 'Custom', 1853 'type': 'Custom',
1858 'immediate': False, 1854 'data_transfer_methods': ['shm'],
1859 'result': ['SizedResult<GLint>'], 1855 'result': ['SizedResult<GLint>'],
1860 }, 1856 },
1861 'GetUniformLocation': { 1857 'GetUniformLocation': {
1862 'type': 'HandWritten', 1858 'type': 'HandWritten',
1863 'immediate': False,
1864 'bucket': True,
1865 'needs_size': True, 1859 'needs_size': True,
1866 'cmd_args': 1860 'cmd_args':
1867 'GLidProgram program, const char* name, NonImmediate GLint* location', 1861 'GLidProgram program, const char* name, NonImmediate GLint* location',
1868 'result': ['GLint'], 1862 'result': ['GLint'],
1869 'error_return': -1, # http://www.opengl.org/sdk/docs/man/xhtml/glGetUniformL ocation.xml 1863 'error_return': -1, # http://www.opengl.org/sdk/docs/man/xhtml/glGetUniformL ocation.xml
1870 }, 1864 },
1871 'GetVertexAttribfv': { 1865 'GetVertexAttribfv': {
1872 'type': 'GETn', 1866 'type': 'GETn',
1873 'result': ['SizedResult<GLfloat>'], 1867 'result': ['SizedResult<GLfloat>'],
1874 'impl_decl': False, 1868 'impl_decl': False,
1875 'decoder_func': 'DoGetVertexAttribfv', 1869 'decoder_func': 'DoGetVertexAttribfv',
1876 'expectation': False, 1870 'expectation': False,
1877 'client_test': False, 1871 'client_test': False,
1878 }, 1872 },
1879 'GetVertexAttribiv': { 1873 'GetVertexAttribiv': {
1880 'type': 'GETn', 1874 'type': 'GETn',
1881 'result': ['SizedResult<GLint>'], 1875 'result': ['SizedResult<GLint>'],
1882 'impl_decl': False, 1876 'impl_decl': False,
1883 'decoder_func': 'DoGetVertexAttribiv', 1877 'decoder_func': 'DoGetVertexAttribiv',
1884 'expectation': False, 1878 'expectation': False,
1885 'client_test': False, 1879 'client_test': False,
1886 }, 1880 },
1887 'GetVertexAttribPointerv': { 1881 'GetVertexAttribPointerv': {
1888 'type': 'Custom', 1882 'type': 'Custom',
1889 'immediate': False, 1883 'data_transfer_methods': ['shm'],
1890 'result': ['SizedResult<GLuint>'], 1884 'result': ['SizedResult<GLuint>'],
1891 'client_test': False, 1885 'client_test': False,
1892 }, 1886 },
1893 'IsBuffer': { 1887 'IsBuffer': {
1894 'type': 'Is', 1888 'type': 'Is',
1895 'decoder_func': 'DoIsBuffer', 1889 'decoder_func': 'DoIsBuffer',
1896 'expectation': False, 1890 'expectation': False,
1897 }, 1891 },
1898 'IsEnabled': { 1892 'IsEnabled': {
1899 'type': 'Is', 1893 'type': 'Is',
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
2000 'expectation': False, 1994 'expectation': False,
2001 'unit_test': False, 1995 'unit_test': False,
2002 'extension_flag': 'multisampled_render_to_texture', 1996 'extension_flag': 'multisampled_render_to_texture',
2003 }, 1997 },
2004 'ReadPixels': { 1998 'ReadPixels': {
2005 'cmd_comment': 1999 'cmd_comment':
2006 '// ReadPixels has the result separated from the pixel buffer so that\n' 2000 '// ReadPixels has the result separated from the pixel buffer so that\n'
2007 '// it is easier to specify the result going to some specific place\n' 2001 '// it is easier to specify the result going to some specific place\n'
2008 '// that exactly fits the rectangle of pixels.\n', 2002 '// that exactly fits the rectangle of pixels.\n',
2009 'type': 'Custom', 2003 'type': 'Custom',
2010 'immediate': False, 2004 'data_transfer_methods': ['shm'],
2011 'impl_func': False, 2005 'impl_func': False,
2012 'client_test': False, 2006 'client_test': False,
2013 'cmd_args': 2007 'cmd_args':
2014 'GLint x, GLint y, GLsizei width, GLsizei height, ' 2008 'GLint x, GLint y, GLsizei width, GLsizei height, '
2015 'GLenumReadPixelFormat format, GLenumReadPixelType type, ' 2009 'GLenumReadPixelFormat format, GLenumReadPixelType type, '
2016 'uint32_t pixels_shm_id, uint32_t pixels_shm_offset, ' 2010 'uint32_t pixels_shm_id, uint32_t pixels_shm_offset, '
2017 'uint32_t result_shm_id, uint32_t result_shm_offset, ' 2011 'uint32_t result_shm_id, uint32_t result_shm_offset, '
2018 'GLboolean async', 2012 'GLboolean async',
2019 'result': ['uint32_t'], 2013 'result': ['uint32_t'],
2020 'defer_reads': True, 2014 'defer_reads': True,
2021 }, 2015 },
2022 'RegisterSharedIdsCHROMIUM': { 2016 'RegisterSharedIdsCHROMIUM': {
2023 'type': 'Custom', 2017 'type': 'Custom',
2024 'decoder_func': 'DoRegisterSharedIdsCHROMIUM', 2018 'decoder_func': 'DoRegisterSharedIdsCHROMIUM',
2025 'impl_func': False, 2019 'impl_func': False,
2026 'expectation': False, 2020 'expectation': False,
2027 'immediate': False, 2021 'data_transfer_methods': ['shm'],
2028 'extension': True, 2022 'extension': True,
2029 'chromium': True, 2023 'chromium': True,
2030 }, 2024 },
2031 'ReleaseShaderCompiler': { 2025 'ReleaseShaderCompiler': {
2032 'decoder_func': 'DoReleaseShaderCompiler', 2026 'decoder_func': 'DoReleaseShaderCompiler',
2033 'unit_test': False, 2027 'unit_test': False,
2034 }, 2028 },
2035 'ShaderBinary': { 2029 'ShaderBinary': {
2036 'type': 'Custom', 2030 'type': 'Custom',
2037 'client_test': False, 2031 'client_test': False,
2038 }, 2032 },
2039 'ShaderSource': { 2033 'ShaderSource': {
2040 'type': 'Manual', 2034 'type': 'Manual',
2041 'immediate': False, 2035 'data_transfer_methods': ['bucket'],
2042 'bucket': True,
2043 'needs_size': True, 2036 'needs_size': True,
2044 'client_test': False, 2037 'client_test': False,
2045 'cmd_args': 2038 'cmd_args':
2046 'GLuint shader, const char* data', 2039 'GLuint shader, const char* data',
2047 'pepper_args': 2040 'pepper_args':
2048 'GLuint shader, GLsizei count, const char** str, const GLint* length', 2041 'GLuint shader, GLsizei count, const char** str, const GLint* length',
2049 }, 2042 },
2050 'StencilMask': { 2043 'StencilMask': {
2051 'type': 'StateSetFrontBack', 2044 'type': 'StateSetFrontBack',
2052 'state': 'StencilMask', 2045 'state': 'StencilMask',
2053 'no_gl': True, 2046 'no_gl': True,
2054 'expectation': False, 2047 'expectation': False,
2055 }, 2048 },
2056 'StencilMaskSeparate': { 2049 'StencilMaskSeparate': {
2057 'type': 'StateSetFrontBackSeparate', 2050 'type': 'StateSetFrontBackSeparate',
2058 'state': 'StencilMask', 2051 'state': 'StencilMask',
2059 'no_gl': True, 2052 'no_gl': True,
2060 'expectation': False, 2053 'expectation': False,
2061 }, 2054 },
2062 'SwapBuffers': { 2055 'SwapBuffers': {
2063 'impl_func': False, 2056 'impl_func': False,
2064 'decoder_func': 'DoSwapBuffers', 2057 'decoder_func': 'DoSwapBuffers',
2065 'unit_test': False, 2058 'unit_test': False,
2066 'client_test': False, 2059 'client_test': False,
2067 'extension': True, 2060 'extension': True,
2068 'trace_level': 1, 2061 'trace_level': 1,
2069 }, 2062 },
2070 'TexImage2D': { 2063 'TexImage2D': {
2071 'type': 'Manual', 2064 'type': 'Manual',
2072 'immediate': False, 2065 'data_transfer_methods': ['shm'],
2073 'client_test': False, 2066 'client_test': False,
2074 }, 2067 },
2075 'TexParameterf': { 2068 'TexParameterf': {
2076 'decoder_func': 'DoTexParameterf', 2069 'decoder_func': 'DoTexParameterf',
2077 'valid_args': { 2070 'valid_args': {
2078 '2': 'GL_NEAREST' 2071 '2': 'GL_NEAREST'
2079 }, 2072 },
2080 }, 2073 },
2081 'TexParameteri': { 2074 'TexParameteri': {
2082 'decoder_func': 'DoTexParameteri', 2075 'decoder_func': 'DoTexParameteri',
(...skipping 12 matching lines...) Expand all
2095 'TexParameteriv': { 2088 'TexParameteriv': {
2096 'type': 'PUT', 2089 'type': 'PUT',
2097 'data_value': 'GL_NEAREST', 2090 'data_value': 'GL_NEAREST',
2098 'count': 1, 2091 'count': 1,
2099 'decoder_func': 'DoTexParameteriv', 2092 'decoder_func': 'DoTexParameteriv',
2100 'gl_test_func': 'glTexParameteri', 2093 'gl_test_func': 'glTexParameteri',
2101 'first_element_only': True, 2094 'first_element_only': True,
2102 }, 2095 },
2103 'TexSubImage2D': { 2096 'TexSubImage2D': {
2104 'type': 'Manual', 2097 'type': 'Manual',
2105 'immediate': False, 2098 'data_transfer_methods': ['shm'],
2106 'client_test': False, 2099 'client_test': False,
2107 'cmd_args': 'GLenumTextureTarget target, GLint level, ' 2100 'cmd_args': 'GLenumTextureTarget target, GLint level, '
2108 'GLint xoffset, GLint yoffset, ' 2101 'GLint xoffset, GLint yoffset, '
2109 'GLsizei width, GLsizei height, ' 2102 'GLsizei width, GLsizei height, '
2110 'GLenumTextureFormat format, GLenumPixelType type, ' 2103 'GLenumTextureFormat format, GLenumPixelType type, '
2111 'const void* pixels, GLboolean internal' 2104 'const void* pixels, GLboolean internal'
2112 }, 2105 },
2113 'Uniform1f': {'type': 'PUTXn', 'count': 1}, 2106 'Uniform1f': {'type': 'PUTXn', 'count': 1},
2114 'Uniform1fv': { 2107 'Uniform1fv': {
2115 'type': 'PUTn', 2108 'type': 'PUTn',
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
2246 'ResizeCHROMIUM': { 2239 'ResizeCHROMIUM': {
2247 'type': 'Custom', 2240 'type': 'Custom',
2248 'impl_func': False, 2241 'impl_func': False,
2249 'unit_test': False, 2242 'unit_test': False,
2250 'extension': True, 2243 'extension': True,
2251 'chromium': True, 2244 'chromium': True,
2252 }, 2245 },
2253 'GetRequestableExtensionsCHROMIUM': { 2246 'GetRequestableExtensionsCHROMIUM': {
2254 'type': 'Custom', 2247 'type': 'Custom',
2255 'impl_func': False, 2248 'impl_func': False,
2256 'immediate': False,
2257 'cmd_args': 'uint32_t bucket_id', 2249 'cmd_args': 'uint32_t bucket_id',
2258 'extension': True, 2250 'extension': True,
2259 'chromium': True, 2251 'chromium': True,
2260 }, 2252 },
2261 'RequestExtensionCHROMIUM': { 2253 'RequestExtensionCHROMIUM': {
2262 'type': 'Custom', 2254 'type': 'Custom',
2263 'impl_func': False, 2255 'impl_func': False,
2264 'immediate': False,
2265 'client_test': False, 2256 'client_test': False,
2266 'cmd_args': 'uint32_t bucket_id', 2257 'cmd_args': 'uint32_t bucket_id',
2267 'extension': True, 2258 'extension': True,
2268 'chromium': True, 2259 'chromium': True,
2269 }, 2260 },
2270 'RateLimitOffscreenContextCHROMIUM': { 2261 'RateLimitOffscreenContextCHROMIUM': {
2271 'gen_cmd': False, 2262 'gen_cmd': False,
2272 'extension': True, 2263 'extension': True,
2273 'chromium': True, 2264 'chromium': True,
2274 'client_test': False, 2265 'client_test': False,
2275 }, 2266 },
2276 'CreateStreamTextureCHROMIUM': { 2267 'CreateStreamTextureCHROMIUM': {
2277 'type': 'HandWritten', 2268 'type': 'HandWritten',
2278 'impl_func': False, 2269 'impl_func': False,
2279 'gen_cmd': False, 2270 'gen_cmd': False,
2280 'immediate': False,
2281 'extension': True, 2271 'extension': True,
2282 'chromium': True, 2272 'chromium': True,
2283 }, 2273 },
2284 'TexImageIOSurface2DCHROMIUM': { 2274 'TexImageIOSurface2DCHROMIUM': {
2285 'decoder_func': 'DoTexImageIOSurface2DCHROMIUM', 2275 'decoder_func': 'DoTexImageIOSurface2DCHROMIUM',
2286 'unit_test': False, 2276 'unit_test': False,
2287 'extension': True, 2277 'extension': True,
2288 'chromium': True, 2278 'chromium': True,
2289 }, 2279 },
2290 'CopyTextureCHROMIUM': { 2280 'CopyTextureCHROMIUM': {
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
2352 'pepper_interface': 'Query', 2342 'pepper_interface': 'Query',
2353 }, 2343 },
2354 'IsQueryEXT': { 2344 'IsQueryEXT': {
2355 'gen_cmd': False, 2345 'gen_cmd': False,
2356 'client_test': False, 2346 'client_test': False,
2357 'pepper_interface': 'Query', 2347 'pepper_interface': 'Query',
2358 }, 2348 },
2359 'BeginQueryEXT': { 2349 'BeginQueryEXT': {
2360 'type': 'Manual', 2350 'type': 'Manual',
2361 'cmd_args': 'GLenumQueryTarget target, GLidQuery id, void* sync_data', 2351 'cmd_args': 'GLenumQueryTarget target, GLidQuery id, void* sync_data',
2362 'immediate': False, 2352 'data_transfer_methods': ['shm'],
2363 'gl_test_func': 'glBeginQuery', 2353 'gl_test_func': 'glBeginQuery',
2364 'pepper_interface': 'Query', 2354 'pepper_interface': 'Query',
2365 }, 2355 },
2366 'EndQueryEXT': { 2356 'EndQueryEXT': {
2367 'type': 'Manual', 2357 'type': 'Manual',
2368 'cmd_args': 'GLenumQueryTarget target, GLuint submit_count', 2358 'cmd_args': 'GLenumQueryTarget target, GLuint submit_count',
2369 'gl_test_func': 'glEndnQuery', 2359 'gl_test_func': 'glEndnQuery',
2370 'client_test': False, 2360 'client_test': False,
2371 'pepper_interface': 'Query', 2361 'pepper_interface': 'Query',
2372 }, 2362 },
2373 'GetQueryivEXT': { 2363 'GetQueryivEXT': {
2374 'gen_cmd': False, 2364 'gen_cmd': False,
2375 'client_test': False, 2365 'client_test': False,
2376 'gl_test_func': 'glGetQueryiv', 2366 'gl_test_func': 'glGetQueryiv',
2377 'pepper_interface': 'Query', 2367 'pepper_interface': 'Query',
2378 }, 2368 },
2379 'GetQueryObjectuivEXT': { 2369 'GetQueryObjectuivEXT': {
2380 'gen_cmd': False, 2370 'gen_cmd': False,
2381 'client_test': False, 2371 'client_test': False,
2382 'gl_test_func': 'glGetQueryObjectuiv', 2372 'gl_test_func': 'glGetQueryObjectuiv',
2383 'pepper_interface': 'Query', 2373 'pepper_interface': 'Query',
2384 }, 2374 },
2385 'BindUniformLocationCHROMIUM': { 2375 'BindUniformLocationCHROMIUM': {
2386 'type': 'GLchar', 2376 'type': 'GLchar',
2387 'extension': True, 2377 'extension': True,
2388 'bucket': True, 2378 'data_transfer_methods': ['bucket'],
2389 'needs_size': True, 2379 'needs_size': True,
2390 'gl_test_func': 'DoBindUniformLocationCHROMIUM', 2380 'gl_test_func': 'DoBindUniformLocationCHROMIUM',
2391 'immediate': False,
2392 }, 2381 },
2393 'InsertEventMarkerEXT': { 2382 'InsertEventMarkerEXT': {
2394 'type': 'GLcharN', 2383 'type': 'GLcharN',
2395 'decoder_func': 'DoInsertEventMarkerEXT', 2384 'decoder_func': 'DoInsertEventMarkerEXT',
2396 'expectation': False, 2385 'expectation': False,
2397 'extension': True, 2386 'extension': True,
2398 }, 2387 },
2399 'PushGroupMarkerEXT': { 2388 'PushGroupMarkerEXT': {
2400 'type': 'GLcharN', 2389 'type': 'GLcharN',
2401 'decoder_func': 'DoPushGroupMarkerEXT', 2390 'decoder_func': 'DoPushGroupMarkerEXT',
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
2464 'ShallowFlushCHROMIUM': { 2453 'ShallowFlushCHROMIUM': {
2465 'impl_func': False, 2454 'impl_func': False,
2466 'gen_cmd': False, 2455 'gen_cmd': False,
2467 'extension': True, 2456 'extension': True,
2468 'chromium': True, 2457 'chromium': True,
2469 'client_test': False, 2458 'client_test': False,
2470 }, 2459 },
2471 'TraceBeginCHROMIUM': { 2460 'TraceBeginCHROMIUM': {
2472 'type': 'Custom', 2461 'type': 'Custom',
2473 'impl_func': False, 2462 'impl_func': False,
2474 'immediate': False,
2475 'client_test': False, 2463 'client_test': False,
2476 'cmd_args': 'GLuint bucket_id', 2464 'cmd_args': 'GLuint bucket_id',
2477 'extension': True, 2465 'extension': True,
2478 'chromium': True, 2466 'chromium': True,
2479 }, 2467 },
2480 'TraceEndCHROMIUM': { 2468 'TraceEndCHROMIUM': {
2481 'impl_func': False, 2469 'impl_func': False,
2482 'immediate': False,
2483 'client_test': False, 2470 'client_test': False,
2484 'decoder_func': 'DoTraceEndCHROMIUM', 2471 'decoder_func': 'DoTraceEndCHROMIUM',
2485 'unit_test': False, 2472 'unit_test': False,
2486 'extension': True, 2473 'extension': True,
2487 'chromium': True, 2474 'chromium': True,
2488 }, 2475 },
2489 'AsyncTexImage2DCHROMIUM': { 2476 'AsyncTexImage2DCHROMIUM': {
2490 'type': 'Manual', 2477 'type': 'Manual',
2491 'immediate': False, 2478 'data_transfer_methods': ['shm'],
2492 'client_test': False, 2479 'client_test': False,
2493 'cmd_args': 'GLenumTextureTarget target, GLint level, ' 2480 'cmd_args': 'GLenumTextureTarget target, GLint level, '
2494 'GLintTextureInternalFormat internalformat, ' 2481 'GLintTextureInternalFormat internalformat, '
2495 'GLsizei width, GLsizei height, ' 2482 'GLsizei width, GLsizei height, '
2496 'GLintTextureBorder border, ' 2483 'GLintTextureBorder border, '
2497 'GLenumTextureFormat format, GLenumPixelType type, ' 2484 'GLenumTextureFormat format, GLenumPixelType type, '
2498 'const void* pixels, ' 2485 'const void* pixels, '
2499 'uint32_t async_upload_token, ' 2486 'uint32_t async_upload_token, '
2500 'void* sync_data', 2487 'void* sync_data',
2501 'extension': True, 2488 'extension': True,
2502 'chromium': True, 2489 'chromium': True,
2503 }, 2490 },
2504 'AsyncTexSubImage2DCHROMIUM': { 2491 'AsyncTexSubImage2DCHROMIUM': {
2505 'type': 'Manual', 2492 'type': 'Manual',
2506 'immediate': False, 2493 'data_transfer_methods': ['shm'],
2507 'client_test': False, 2494 'client_test': False,
2508 'cmd_args': 'GLenumTextureTarget target, GLint level, ' 2495 'cmd_args': 'GLenumTextureTarget target, GLint level, '
2509 'GLint xoffset, GLint yoffset, ' 2496 'GLint xoffset, GLint yoffset, '
2510 'GLsizei width, GLsizei height, ' 2497 'GLsizei width, GLsizei height, '
2511 'GLenumTextureFormat format, GLenumPixelType type, ' 2498 'GLenumTextureFormat format, GLenumPixelType type, '
2512 'const void* data, ' 2499 'const void* data, '
2513 'uint32_t async_upload_token, ' 2500 'uint32_t async_upload_token, '
2514 'void* sync_data', 2501 'void* sync_data',
2515 'extension': True, 2502 'extension': True,
2516 'chromium': True, 2503 'chromium': True,
2517 }, 2504 },
2518 'WaitAsyncTexImage2DCHROMIUM': { 2505 'WaitAsyncTexImage2DCHROMIUM': {
2519 'type': 'Manual', 2506 'type': 'Manual',
2520 'immediate': False,
2521 'client_test': False, 2507 'client_test': False,
2522 'extension': True, 2508 'extension': True,
2523 'chromium': True, 2509 'chromium': True,
2524 }, 2510 },
2525 'WaitAllAsyncTexImage2DCHROMIUM': { 2511 'WaitAllAsyncTexImage2DCHROMIUM': {
2526 'type': 'Manual', 2512 'type': 'Manual',
2527 'immediate': False,
2528 'client_test': False, 2513 'client_test': False,
2529 'extension': True, 2514 'extension': True,
2530 'chromium': True, 2515 'chromium': True,
2531 }, 2516 },
2532 'DiscardFramebufferEXT': { 2517 'DiscardFramebufferEXT': {
2533 'type': 'PUTn', 2518 'type': 'PUTn',
2534 'count': 1, 2519 'count': 1,
2535 'cmd_args': 'GLenum target, GLsizei count, ' 2520 'cmd_args': 'GLenum target, GLsizei count, '
2536 'const GLenum* attachments', 2521 'const GLenum* attachments',
2537 'decoder_func': 'DoDiscardFramebufferEXT', 2522 'decoder_func': 'DoDiscardFramebufferEXT',
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
2698 _remove_expected_call_re = re.compile(r' EXPECT_CALL.*?;\n', re.S) 2683 _remove_expected_call_re = re.compile(r' EXPECT_CALL.*?;\n', re.S)
2699 2684
2700 def __init__(self): 2685 def __init__(self):
2701 pass 2686 pass
2702 2687
2703 def InitFunction(self, func): 2688 def InitFunction(self, func):
2704 """Add or adjust anything type specific for this function.""" 2689 """Add or adjust anything type specific for this function."""
2705 if func.GetInfo('needs_size') and not func.name.endswith('Bucket'): 2690 if func.GetInfo('needs_size') and not func.name.endswith('Bucket'):
2706 func.AddCmdArg(DataSizeArgument('data_size')) 2691 func.AddCmdArg(DataSizeArgument('data_size'))
2707 2692
2708 def AddImmediateFunction(self, generator, func): 2693 def NeedsDataTransferFunction(self, func):
2709 """Adds an immediate version of a function.""" 2694 """Overriden from TypeHandler."""
2710 # Generate an immediate command if there is only 1 pointer arg. 2695 return func.num_pointer_args >= 1
2711 immediate = func.GetInfo('immediate') # can be True, False or None
2712 if immediate == True or immediate == None:
2713 if func.num_pointer_args == 1 or immediate:
2714 generator.AddFunction(ImmediateFunction(func))
2715 return True
2716
2717 def AddBucketFunction(self, generator, func):
2718 """Adds a bucket version of a function."""
2719 # Generate an immediate command if there is only 1 pointer arg.
2720 bucket = func.GetInfo('bucket') # can be True, False or None
2721 if bucket:
2722 generator.AddFunction(BucketFunction(func))
2723 2696
2724 def WriteStruct(self, func, file): 2697 def WriteStruct(self, func, file):
2725 """Writes a structure that matches the arguments to a function.""" 2698 """Writes a structure that matches the arguments to a function."""
2726 comment = func.GetInfo('cmd_comment') 2699 comment = func.GetInfo('cmd_comment')
2727 if not comment == None: 2700 if not comment == None:
2728 file.Write(comment) 2701 file.Write(comment)
2729 file.Write("struct %s {\n" % func.name) 2702 file.Write("struct %s {\n" % func.name)
2730 file.Write(" typedef %s ValueType;\n" % func.name) 2703 file.Write(" typedef %s ValueType;\n" % func.name)
2731 file.Write(" static const CommandId kCmdId = k%s;\n" % func.name) 2704 file.Write(" static const CommandId kCmdId = k%s;\n" % func.name)
2732 func.WriteCmdArgFlag(file) 2705 func.WriteCmdArgFlag(file)
(...skipping 834 matching lines...) Expand 10 before | Expand all | Expand 10 after
3567 file.Write(" static_cast<ValueType*>(cmd)->Init(%s);\n" % copy_args) 3540 file.Write(" static_cast<ValueType*>(cmd)->Init(%s);\n" % copy_args)
3568 file.Write(" return NextImmediateCmdAddressTotalSize<ValueType>(" 3541 file.Write(" return NextImmediateCmdAddressTotalSize<ValueType>("
3569 "cmd, total_size);\n") 3542 "cmd, total_size);\n")
3570 file.Write(" }\n") 3543 file.Write(" }\n")
3571 file.Write("\n") 3544 file.Write("\n")
3572 3545
3573 3546
3574 class TodoHandler(CustomHandler): 3547 class TodoHandler(CustomHandler):
3575 """Handle for commands that are not yet implemented.""" 3548 """Handle for commands that are not yet implemented."""
3576 3549
3577 def AddImmediateFunction(self, generator, func): 3550 def NeedsDataTransferFunction(self, func):
3578 """Overrriden from TypeHandler.""" 3551 """Overriden from TypeHandler."""
3579 pass 3552 return False
3580 3553
3581 def WriteImmediateFormatTest(self, func, file): 3554 def WriteImmediateFormatTest(self, func, file):
3582 """Overrriden from TypeHandler.""" 3555 """Overrriden from TypeHandler."""
3583 pass 3556 pass
3584 3557
3585 def WriteGLES2ImplementationUnitTest(self, func, file): 3558 def WriteGLES2ImplementationUnitTest(self, func, file):
3586 """Overrriden from TypeHandler.""" 3559 """Overrriden from TypeHandler."""
3587 pass 3560 pass
3588 3561
3589 def WriteGLES2Implementation(self, func, file): 3562 def WriteGLES2Implementation(self, func, file):
(...skipping 29 matching lines...) Expand all
3619 3592
3620 3593
3621 class HandWrittenHandler(CustomHandler): 3594 class HandWrittenHandler(CustomHandler):
3622 """Handler for comands where everything must be written by hand.""" 3595 """Handler for comands where everything must be written by hand."""
3623 3596
3624 def InitFunction(self, func): 3597 def InitFunction(self, func):
3625 """Add or adjust anything type specific for this function.""" 3598 """Add or adjust anything type specific for this function."""
3626 CustomHandler.InitFunction(self, func) 3599 CustomHandler.InitFunction(self, func)
3627 func.can_auto_generate = False 3600 func.can_auto_generate = False
3628 3601
3602 def NeedsDataTransferFunction(self, func):
3603 """Overriden from TypeHandler."""
3604 return False
3605
3629 def WriteStruct(self, func, file): 3606 def WriteStruct(self, func, file):
3630 """Overrriden from TypeHandler.""" 3607 """Overrriden from TypeHandler."""
3631 pass 3608 pass
3632 3609
3633 def WriteDocs(self, func, file): 3610 def WriteDocs(self, func, file):
3634 """Overrriden from TypeHandler.""" 3611 """Overrriden from TypeHandler."""
3635 pass 3612 pass
3636 3613
3637 def WriteServiceUnitTest(self, func, file): 3614 def WriteServiceUnitTest(self, func, file):
3638 """Overrriden from TypeHandler.""" 3615 """Overrriden from TypeHandler."""
(...skipping 949 matching lines...) Expand 10 before | Expand all | Expand 10 after
4588 file.Write("}\n") 4565 file.Write("}\n")
4589 file.Write("\n") 4566 file.Write("\n")
4590 4567
4591 4568
4592 class GETnHandler(TypeHandler): 4569 class GETnHandler(TypeHandler):
4593 """Handler for GETn for glGetBooleanv, glGetFloatv, ... type functions.""" 4570 """Handler for GETn for glGetBooleanv, glGetFloatv, ... type functions."""
4594 4571
4595 def __init__(self): 4572 def __init__(self):
4596 TypeHandler.__init__(self) 4573 TypeHandler.__init__(self)
4597 4574
4598 def AddImmediateFunction(self, generator, func): 4575 def NeedsDataTransferFunction(self, func):
4599 """Overrriden from TypeHandler.""" 4576 """Overriden from TypeHandler."""
4600 pass 4577 return False
4601 4578
4602 def WriteServiceImplementation(self, func, file): 4579 def WriteServiceImplementation(self, func, file):
4603 """Overrriden from TypeHandler.""" 4580 """Overrriden from TypeHandler."""
4604 file.Write( 4581 file.Write(
4605 "error::Error GLES2DecoderImpl::Handle%s(\n" % func.name) 4582 "error::Error GLES2DecoderImpl::Handle%s(\n" % func.name)
4606 file.Write( 4583 file.Write(
4607 " uint32_t immediate_data_size, const gles2::cmds::%s& c) {\n" % 4584 " uint32_t immediate_data_size, const gles2::cmds::%s& c) {\n" %
4608 func.name) 4585 func.name)
4609 last_arg = func.GetLastOriginalArg() 4586 last_arg = func.GetLastOriginalArg()
4610 4587
(...skipping 983 matching lines...) Expand 10 before | Expand all | Expand 10 after
5594 """Handler for functions that pass a single string with an optional len.""" 5571 """Handler for functions that pass a single string with an optional len."""
5595 5572
5596 def __init__(self): 5573 def __init__(self):
5597 CustomHandler.__init__(self) 5574 CustomHandler.__init__(self)
5598 5575
5599 def InitFunction(self, func): 5576 def InitFunction(self, func):
5600 """Overrriden from TypeHandler.""" 5577 """Overrriden from TypeHandler."""
5601 func.cmd_args = [] 5578 func.cmd_args = []
5602 func.AddCmdArg(Argument('bucket_id', 'GLuint')) 5579 func.AddCmdArg(Argument('bucket_id', 'GLuint'))
5603 5580
5604 def AddImmediateFunction(self, generator, func): 5581 def NeedsDataTransferFunction(self, func):
5605 """Overrriden from TypeHandler.""" 5582 """Overriden from TypeHandler."""
5606 pass 5583 return False
5607 5584
5608 def AddBucketFunction(self, generator, func): 5585 def AddBucketFunction(self, generator, func):
5609 """Overrriden from TypeHandler.""" 5586 """Overrriden from TypeHandler."""
5610 pass 5587 pass
5611 5588
5612 def WriteServiceImplementation(self, func, file): 5589 def WriteServiceImplementation(self, func, file):
5613 """Overrriden from TypeHandler.""" 5590 """Overrriden from TypeHandler."""
5614 file.Write("""error::Error GLES2DecoderImpl::Handle%(name)s( 5591 file.Write("""error::Error GLES2DecoderImpl::Handle%(name)s(
5615 uint32_t immediate_data_size, const gles2::cmds::%(name)s& c) { 5592 uint32_t immediate_data_size, const gles2::cmds::%(name)s& c) {
5616 GLuint bucket_id = static_cast<GLuint>(c.%(bucket_id)s); 5593 GLuint bucket_id = static_cast<GLuint>(c.%(bucket_id)s);
(...skipping 1135 matching lines...) Expand 10 before | Expand all | Expand 10 after
6752 def GetGLTestFunctionName(self): 6729 def GetGLTestFunctionName(self):
6753 gl_func_name = self.GetInfo('gl_test_func') 6730 gl_func_name = self.GetInfo('gl_test_func')
6754 if gl_func_name == None: 6731 if gl_func_name == None:
6755 gl_func_name = self.GetGLFunctionName() 6732 gl_func_name = self.GetGLFunctionName()
6756 if gl_func_name.startswith("gl"): 6733 if gl_func_name.startswith("gl"):
6757 gl_func_name = gl_func_name[2:] 6734 gl_func_name = gl_func_name[2:]
6758 else: 6735 else:
6759 gl_func_name = self.original_name 6736 gl_func_name = self.original_name
6760 return gl_func_name 6737 return gl_func_name
6761 6738
6739 def GetDataTransferMethods(self):
6740 return self.GetInfo('data_transfer_methods',
6741 ['immediate' if self.num_pointer_args == 1 else 'shm'])
6742
6762 def AddCmdArg(self, arg): 6743 def AddCmdArg(self, arg):
6763 """Adds a cmd argument to this function.""" 6744 """Adds a cmd argument to this function."""
6764 self.cmd_args.append(arg) 6745 self.cmd_args.append(arg)
6765 6746
6766 def GetCmdArgs(self): 6747 def GetCmdArgs(self):
6767 """Gets the command args for this function.""" 6748 """Gets the command args for this function."""
6768 return self.cmd_args 6749 return self.cmd_args
6769 6750
6770 def ClearCmdArgs(self): 6751 def ClearCmdArgs(self):
6771 """Clears the command args for this function.""" 6752 """Clears the command args for this function."""
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after
7306 7287
7307 f = Function(func_name, func_info) 7288 f = Function(func_name, func_info)
7308 self.original_functions.append(f) 7289 self.original_functions.append(f)
7309 7290
7310 #for arg in f.GetOriginalArgs(): 7291 #for arg in f.GetOriginalArgs():
7311 # if not isinstance(arg, EnumArgument) and arg.type == 'GLenum': 7292 # if not isinstance(arg, EnumArgument) and arg.type == 'GLenum':
7312 # self.Log("%s uses bare GLenum %s." % (func_name, arg.name)) 7293 # self.Log("%s uses bare GLenum %s." % (func_name, arg.name))
7313 7294
7314 gen_cmd = f.GetInfo('gen_cmd') 7295 gen_cmd = f.GetInfo('gen_cmd')
7315 if gen_cmd == True or gen_cmd == None: 7296 if gen_cmd == True or gen_cmd == None:
7316 if not f.type_handler.AddImmediateFunction(self, f): 7297 if f.type_handler.NeedsDataTransferFunction(f):
7298 methods = f.GetDataTransferMethods()
7299 if 'immediate' in methods:
7300 self.AddFunction(ImmediateFunction(f))
7301 if 'bucket' in methods:
7302 self.AddFunction(BucketFunction(f))
7303 if 'shm' in methods:
7304 self.AddFunction(f)
7305 else:
7317 self.AddFunction(f) 7306 self.AddFunction(f)
7318 f.type_handler.AddBucketFunction(self, f)
7319 7307
7320 self.Log("Auto Generated Functions : %d" % 7308 self.Log("Auto Generated Functions : %d" %
7321 len([f for f in self.functions if f.can_auto_generate or 7309 len([f for f in self.functions if f.can_auto_generate or
7322 (not f.IsType('') and not f.IsType('Custom') and 7310 (not f.IsType('') and not f.IsType('Custom') and
7323 not f.IsType('Todo'))])) 7311 not f.IsType('Todo'))]))
7324 7312
7325 funcs = [f for f in self.functions if not f.can_auto_generate and 7313 funcs = [f for f in self.functions if not f.can_auto_generate and
7326 (f.IsType('') or f.IsType('Custom') or f.IsType('Todo'))] 7314 (f.IsType('') or f.IsType('Custom') or f.IsType('Todo'))]
7327 self.Log("Non Auto Generated Functions: %d" % len(funcs)) 7315 self.Log("Non Auto Generated Functions: %d" % len(funcs))
7328 7316
(...skipping 1009 matching lines...) Expand 10 before | Expand all | Expand 10 after
8338 "ppapi/shared_impl/ppb_opengles2_shared.cc"]) 8326 "ppapi/shared_impl/ppb_opengles2_shared.cc"])
8339 8327
8340 if gen.errors > 0: 8328 if gen.errors > 0:
8341 print "%d errors" % gen.errors 8329 print "%d errors" % gen.errors
8342 return 1 8330 return 1
8343 return 0 8331 return 0
8344 8332
8345 8333
8346 if __name__ == '__main__': 8334 if __name__ == '__main__':
8347 sys.exit(main(sys.argv[1:])) 8335 sys.exit(main(sys.argv[1:]))
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698