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

Unified Diff: gpu/command_buffer/build_gles2_cmd_buffer.py

Issue 1492013002: Reland of Upgrade PixelStorei to ES3/WebGL2. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | gpu/command_buffer/client/gles2_implementation.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/build_gles2_cmd_buffer.py
diff --git a/gpu/command_buffer/build_gles2_cmd_buffer.py b/gpu/command_buffer/build_gles2_cmd_buffer.py
index 0d8b7df947636bf8b875d028870c2c595b3f487b..882ddd04dcfbfa046c8bc1218c963f171c49afcd 100755
--- a/gpu/command_buffer/build_gles2_cmd_buffer.py
+++ b/gpu/command_buffer/build_gles2_cmd_buffer.py
@@ -414,6 +414,62 @@
'type': 'GLint',
'enum': 'GL_UNPACK_ALIGNMENT',
'default': '4'
+ },
+ {
+ 'name': 'pack_row_length',
+ 'type': 'GLint',
+ 'enum': 'GL_PACK_ROW_LENGTH',
+ 'default': '0',
+ 'es3': True
+ },
+ {
+ 'name': 'pack_skip_pixels',
+ 'type': 'GLint',
+ 'enum': 'GL_PACK_SKIP_PIXELS',
+ 'default': '0',
+ 'es3': True
+ },
+ {
+ 'name': 'pack_skip_rows',
+ 'type': 'GLint',
+ 'enum': 'GL_PACK_SKIP_ROWS',
+ 'default': '0',
+ 'es3': True
+ },
+ {
+ 'name': 'unpack_row_length',
+ 'type': 'GLint',
+ 'enum': 'GL_UNPACK_ROW_LENGTH',
+ 'default': '0',
+ 'es3': True
+ },
+ {
+ 'name': 'unpack_image_height',
+ 'type': 'GLint',
+ 'enum': 'GL_UNPACK_IMAGE_HEIGHT',
+ 'default': '0',
+ 'es3': True
+ },
+ {
+ 'name': 'unpack_skip_pixels',
+ 'type': 'GLint',
+ 'enum': 'GL_UNPACK_SKIP_PIXELS',
+ 'default': '0',
+ 'es3': True
+ },
+ {
+ 'name': 'unpack_skip_rows',
+ 'type': 'GLint',
+ 'enum': 'GL_UNPACK_SKIP_ROWS',
+ 'default': '0',
+ 'es3': True
+ },
+ {
+ 'name': 'unpack_skip_images',
+ 'type': 'GLint',
+ 'enum': 'GL_UNPACK_SKIP_IMAGES',
+ 'default': '0',
+ 'es3': True
}
],
},
@@ -10173,6 +10229,9 @@
for item in state['states']:
item_name = CachedStateName(item)
+ if 'es3' in item:
+ assert item['es3']
+ f.write(" if (feature_info_->IsES3Capable()) {\n");
if 'extension_flag' in item:
f.write(" if (feature_info_->feature_flags().%s) {\n " %
item['extension_flag'])
@@ -10198,7 +10257,7 @@
(item['enum_set']
if 'enum_set' in item else item['enum']),
item['name']))
- if 'gl_version_flag' in item:
+ if 'gl_version_flag' in item or 'es3' in item:
f.write(" }\n")
if test_prev:
if 'extension_flag' in item:
@@ -10395,7 +10454,7 @@
f.write(""" }
}
-void GLES2DecoderTestBase::SetupInitStateExpectations() {
+void GLES2DecoderTestBase::SetupInitStateExpectations(bool es3_capable) {
""")
# We need to sort the keys so the expectations match
for state_name in sorted(_STATES.keys()):
@@ -10420,6 +10479,10 @@
f.write(" if (group_->feature_info()->feature_flags().%s) {\n" %
item['extension_flag'])
f.write(" ")
+ if 'es3' in item:
+ assert item['es3']
+ f.write(" if (es3_capable) {\n")
+ f.write(" ")
expect_value = item['default']
if isinstance(expect_value, list):
# TODO: Currently we do not check array values.
@@ -10433,7 +10496,7 @@
expect_value))
f.write(" .Times(1)\n")
f.write(" .RetiresOnSaturation();\n")
- if 'extension_flag' in item:
+ if 'extension_flag' in item or 'es3' in item:
f.write(" }\n")
else:
if 'extension_flag' in state:
@@ -10768,7 +10831,9 @@
enum)
valid_list = _NAMED_TYPE_INFO[enum]['valid']
if 'valid_es3' in _NAMED_TYPE_INFO[enum]:
- valid_list = valid_list + _NAMED_TYPE_INFO[enum]['valid_es3']
+ for es3_enum in _NAMED_TYPE_INFO[enum]['valid_es3']:
+ if not es3_enum in valid_list:
+ valid_list.append(es3_enum)
assert len(valid_list) == len(set(valid_list))
if len(valid_list) > 0:
f.write(" static const EnumToString string_table[] = {\n")
@@ -11009,6 +11074,7 @@
# Add in states and capabilites to GLState
gl_state_valid = _NAMED_TYPE_INFO['GLState']['valid']
+ gl_state_valid_es3 = _NAMED_TYPE_INFO['GLState']['valid_es3']
for state_name in sorted(_STATES.keys()):
state = _STATES[state_name]
if 'extension_flag' in state:
@@ -11020,8 +11086,13 @@
for item in state['states']:
if 'extension_flag' in item:
continue
- if not item['enum'] in gl_state_valid:
- gl_state_valid.append(item['enum'])
+ if 'es3' in item:
+ assert item['es3']
+ if not item['enum'] in gl_state_valid_es3:
+ gl_state_valid_es3.append(item['enum'])
+ else:
+ if not item['enum'] in gl_state_valid:
+ gl_state_valid.append(item['enum'])
for capability in _CAPABILITY_FLAGS:
valid_value = "GL_%s" % capability['name'].upper()
if not valid_value in gl_state_valid:
« no previous file with comments | « no previous file | gpu/command_buffer/client/gles2_implementation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698