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..7c8f95ab2d3a3ee91dfbab7f45f0af24c5c48fc2 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_or_srgb_cube_texture_complete( |
| + workarounds.force_int_or_srgb_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_or_srgb_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/19 17:11:53
I understand the issue, but still, I think modifyi
qiankun
2017/04/20 01:35:53
Sounds good. Removed it.
|
| if (!defined && target != args.target) |
| undefined_faces.push_back(GL_TEXTURE_CUBE_MAP_POSITIVE_X + i); |
| } |
| @@ -2585,6 +2605,16 @@ 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 or srgb cube map texture complete, see crbug.com/712117. |
| + need_cube_map_workaround = |
| + need_cube_map_workaround || |
| + (feature_info_->IsWebGL2OrES3Context() && |
|
Zhenyao Mo
2017/04/19 17:11:53
This isn't correct. You can also get sRGB formats
qiankun
2017/04/20 01:35:53
What I meant is other platforms doesn't have such
qiankun
2017/04/20 02:12:31
Never mind. Please ignore my last comments. I remo
|
| + texture->target() == GL_TEXTURE_CUBE_MAP && |
| + texture_state->force_int_or_srgb_cube_texture_complete && |
| + (GLES2Util::IsIntegerFormat(args.internal_format) || |
| + GLES2Util::GetColorEncodingFromInternalFormat(args.internal_format) == |
| + GL_SRGB)); |
| + |
| if (need_cube_map_workaround && !buffer) { |
| DoCubeMapWorkaround(texture_state, state, framebuffer_state, |
| texture_ref, function_name, args); |