| 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))
|
|
|
|
|