Chromium Code Reviews| Index: gpu/command_buffer/service/texture_manager.cc |
| diff --git a/gpu/command_buffer/service/texture_manager.cc b/gpu/command_buffer/service/texture_manager.cc |
| index 68cd6bf3e182ae549100085bb16a2ca101962ac9..4104a52a7b24c59b4d11a01ea51fe387aad15da5 100644 |
| --- a/gpu/command_buffer/service/texture_manager.cc |
| +++ b/gpu/command_buffer/service/texture_manager.cc |
| @@ -395,6 +395,24 @@ class ScopedResetPixelUnpackBuffer{ |
| } // namespace anonymous |
| +DecoderTextureState::DecoderTextureState( |
| + const GpuDriverBugWorkarounds& workarounds) |
| + : tex_image_failed(false), |
| + texture_upload_count(0), |
| + texsubimage_faster_than_teximage( |
| + workarounds.texsubimage_faster_than_teximage), |
| + force_cube_map_positive_x_allocation( |
| + workarounds.force_cube_map_positive_x_allocation), |
| + force_cube_complete(workarounds.force_cube_complete), |
| + force_int_cube_texture_complete( |
| + workarounds.force_int_cube_texture_complete), |
| + unpack_alignment_workaround_with_unpack_buffer( |
| + workarounds.unpack_alignment_workaround_with_unpack_buffer), |
| + unpack_overlapping_rows_separately_unpack_buffer( |
| + workarounds.unpack_overlapping_rows_separately_unpack_buffer), |
| + unpack_image_height_workaround_with_unpack_buffer( |
| + workarounds.unpack_image_height_workaround_with_unpack_buffer) {} |
| + |
| TextureManager::DestructionObserver::DestructionObserver() {} |
| TextureManager::DestructionObserver::~DestructionObserver() {} |
| @@ -2527,13 +2545,15 @@ void TextureManager::DoCubeMapWorkaround( |
| std::vector<GLenum> undefined_faces; |
| Texture* texture = texture_ref->texture(); |
| - if (texture_state->force_cube_complete) { |
| + if (texture_state->force_cube_complete || |
| + texture_state->force_int_cube_texture_complete) { |
| int width = 0; |
| int height = 0; |
| for (unsigned i = 0; i < 6; i++) { |
| GLenum target = static_cast<GLenum>(GL_TEXTURE_CUBE_MAP_POSITIVE_X + i); |
| bool defined = texture->GetLevelSize( |
| target, args.level, &width, &height, nullptr); |
| + defined = defined && width == args.width && height == args.height; |
|
Zhenyao Mo
2017/04/18 17:48:02
We should not modify a face level if it's already
qiankun
2017/04/19 12:26:35
If we don't apply workaround, the bug still exists
|
| if (!defined && target != args.target) |
| undefined_faces.push_back(GL_TEXTURE_CUBE_MAP_POSITIVE_X + i); |
| } |
| @@ -2585,6 +2605,13 @@ void TextureManager::ValidateAndDoTexImage( |
| (texture_state->force_cube_complete || |
| (texture_state->force_cube_map_positive_x_allocation && |
| args.target != GL_TEXTURE_CUBE_MAP_POSITIVE_X)); |
| + // Force integer cube map texture complete, see crbug.com/712117. |
| + need_cube_map_workaround = need_cube_map_workaround || |
| + (feature_info_->IsWebGL2OrES3Context() && |
| + texture->target() == GL_TEXTURE_CUBE_MAP && |
| + texture_state->force_int_cube_texture_complete && |
|
qiankun
2017/04/18 16:45:10
With this workaround, we can fix the integer textu
Zhenyao Mo
2017/04/18 17:48:02
This sounds fine.
qiankun
2017/04/19 12:26:35
I found we can not reuse force_cube_complete worka
|
| + GLES2Util::IsIntegerFormat(args.internal_format)); |
| + |
| if (need_cube_map_workaround && !buffer) { |
| DoCubeMapWorkaround(texture_state, state, framebuffer_state, |
| texture_ref, function_name, args); |