diff options
author | zmo <zmo@chromium.org> | 2016-01-06 12:39:08 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-01-06 20:40:57 +0000 |
commit | b730f32bd9a9363941ed7f8b09839cadcca7352a (patch) | |
tree | ede2258b91d624aaaf90f88352f2d23a9b27c8f0 /gpu/command_buffer/build_gles2_cmd_buffer.py | |
parent | 7db06605487dac6489f1248db2f1e3021477262a (diff) | |
download | chromium_src-b730f32bd9a9363941ed7f8b09839cadcca7352a.zip chromium_src-b730f32bd9a9363941ed7f8b09839cadcca7352a.tar.gz chromium_src-b730f32bd9a9363941ed7f8b09839cadcca7352a.tar.bz2 |
Fix a bug in state restore during context switch
For PACK and UNPACK parameters, since we cache a bunch of them and don't
send them down to GL if no pack/unpack buffer is bound, then when we
restore them during context switch, we need to obey the same rule.
BUG=295792,429053
TEST=gpu_unittests
R=piman@chromium.org
NOTRY=true
Review URL: https://codereview.chromium.org/1569563002
Cr-Commit-Position: refs/heads/master@{#367898}
Diffstat (limited to 'gpu/command_buffer/build_gles2_cmd_buffer.py')
-rwxr-xr-x | gpu/command_buffer/build_gles2_cmd_buffer.py | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/gpu/command_buffer/build_gles2_cmd_buffer.py b/gpu/command_buffer/build_gles2_cmd_buffer.py index 104de37..d75d473 100755 --- a/gpu/command_buffer/build_gles2_cmd_buffer.py +++ b/gpu/command_buffer/build_gles2_cmd_buffer.py @@ -436,56 +436,64 @@ _STATES = { 'type': 'GLint', 'enum': 'GL_PACK_ROW_LENGTH', 'default': '0', - 'es3': True + 'es3': True, + 'manual': True, }, { 'name': 'pack_skip_pixels', 'type': 'GLint', 'enum': 'GL_PACK_SKIP_PIXELS', 'default': '0', - 'es3': True + 'es3': True, + 'manual': True, }, { 'name': 'pack_skip_rows', 'type': 'GLint', 'enum': 'GL_PACK_SKIP_ROWS', 'default': '0', - 'es3': True + 'es3': True, + 'manual': True, }, { 'name': 'unpack_row_length', 'type': 'GLint', 'enum': 'GL_UNPACK_ROW_LENGTH', 'default': '0', - 'es3': True + 'es3': True, + 'manual': True, }, { 'name': 'unpack_image_height', 'type': 'GLint', 'enum': 'GL_UNPACK_IMAGE_HEIGHT', 'default': '0', - 'es3': True + 'es3': True, + 'manual': True, }, { 'name': 'unpack_skip_pixels', 'type': 'GLint', 'enum': 'GL_UNPACK_SKIP_PIXELS', 'default': '0', - 'es3': True + 'es3': True, + 'manual': True, }, { 'name': 'unpack_skip_rows', 'type': 'GLint', 'enum': 'GL_UNPACK_SKIP_ROWS', 'default': '0', - 'es3': True + 'es3': True, + 'manual': True, }, { 'name': 'unpack_skip_images', 'type': 'GLint', 'enum': 'GL_UNPACK_SKIP_IMAGES', 'default': '0', - 'es3': True + 'es3': True, + 'manual': True, } ], }, @@ -10453,6 +10461,9 @@ void ContextState::InitState(const ContextState *prev_state) const { for item in state['states']: item_name = CachedStateName(item) + if 'manual' in item: + assert item['manual'] + continue if 'es3' in item: assert item['es3'] f.write(" if (feature_info_->IsES3Capable()) {\n"); @@ -10513,6 +10524,7 @@ void ContextState::InitState(const ContextState *prev_state) const { f.write(" } else {") WriteStates(False) f.write(" }") + f.write(" InitStateManual(prev_state);") f.write("}\n") f.write("""bool ContextState::GetEnabled(GLenum cap) const { @@ -10711,6 +10723,9 @@ void GLES2DecoderTestBase::SetupInitStateExpectations(bool es3_capable) { f.write(" .RetiresOnSaturation();\n") elif state['type'] == 'NamedParameter': for item in state['states']: + if 'manual' in item: + assert item['manual'] + continue if 'extension_flag' in item: f.write(" if (group_->feature_info()->feature_flags().%s) {\n" % item['extension_flag']) @@ -10753,6 +10768,7 @@ void GLES2DecoderTestBase::SetupInitStateExpectations(bool es3_capable) { f.write(" .RetiresOnSaturation();\n") if 'extension_flag' in state: f.write(" }\n") + f.write(" SetupInitStateManualExpectations(es3_capable);\n") f.write("}\n") self.generated_cpp_filenames.append(filename) |