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

Unified Diff: gpu/command_buffer/build_gles2_cmd_buffer.py

Issue 1000483002: Added GLES3 Capabilities to the Command Buffer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Stopped ES3 features from being set unless backed by an ES3 context Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
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 ab51fcd535be4453157e51729312bc6735bf6f7f..27cd409025cdaff70416d4df55aee20870d77083 100755
--- a/gpu/command_buffer/build_gles2_cmd_buffer.py
+++ b/gpu/command_buffer/build_gles2_cmd_buffer.py
@@ -82,6 +82,8 @@ _CAPABILITY_FLAGS = [
{'name': 'scissor_test'},
{'name': 'stencil_test',
'state_flag': 'framebuffer_state_.clear_state_dirty'},
+ {'name': 'primitive_restart_fixed_index', 'es3': True},
+ {'name': 'rasterizer_discard', 'es3': True},
]
_STATES = {
@@ -878,7 +880,10 @@ _NAMED_TYPE_INFO = {
},
'Capability': {
'type': 'GLenum',
- 'valid': ["GL_%s" % cap['name'].upper() for cap in _CAPABILITY_FLAGS],
+ 'valid': ["GL_%s" % cap['name'].upper() for cap in _CAPABILITY_FLAGS
+ if 'es3' not in cap or cap['es3'] != True],
+ 'valid_es3': ["GL_%s" % cap['name'].upper() for cap in _CAPABILITY_FLAGS
+ if 'es3' in cap and cap['es3'] == True],
'invalid': [
'GL_CLIP_PLANE0',
'GL_POINT_SPRITE',
@@ -9338,10 +9343,14 @@ void ContextState::InitCapabilities(const ContextState* prev_state) const {
def WriteCapabilities(test_prev):
for capability in _CAPABILITY_FLAGS:
capability_name = capability['name']
+ capability_es3 = 'es3' in capability and capability['es3'] == True
+ es3_test = 'feature_info_->IsES3Capable() && ' if capability_es3 else ''
if test_prev:
- file.Write(""" if (prev_state->enable_flags.cached_%s !=
- enable_flags.cached_%s)\n""" %
- (capability_name, capability_name))
+ file.Write(""" if (%sprev_state->enable_flags.cached_%s !=
+ enable_flags.cached_%s)\n""" %
+ (es3_test, capability_name, capability_name))
+ elif capability_es3:
+ file.Write(" if (feature_info_->IsES3Capable())\n")
file.Write(" EnableDisable(GL_%s, enable_flags.cached_%s);\n" %
(capability_name.upper(), capability_name))

Powered by Google App Engine
This is Rietveld 408576698