diff options
author | aelias <aelias@chromium.org> | 2014-08-25 17:46:20 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-08-26 00:47:56 +0000 |
commit | d880a3deca8ab1c6c75ef915faa22ab7d40f55ff (patch) | |
tree | f388e316830f6fa69fdc138ba6cf66c62e369646 /gpu/command_buffer | |
parent | 9ecb800c3c129578ce352596250f9ca3ab8ad667 (diff) | |
download | chromium_src-d880a3deca8ab1c6c75ef915faa22ab7d40f55ff.zip chromium_src-d880a3deca8ab1c6c75ef915faa22ab7d40f55ff.tar.gz chromium_src-d880a3deca8ab1c6c75ef915faa22ab7d40f55ff.tar.bz2 |
Restrict ETC1 power-of-two rounding to old IMG drivers.
The ETC1 spec says that any multiple of 4 is allowed for ETC1 size, but
certain old IMG devices (notably the Galaxy Nexus) crash unless the
textures are specifically power-of-two. To avoid wasting RAM on all
devices due to this device-specific problem, this patch plumbs a driver
workaround flag to the thumbnail store (the only user of ETC1 at
present).
We considered adding a workaround to the service side like all of the
others, but because texture size impacts memory budgeting and
coordinates, this one seems like it needs to be in the client code.
NOTRY=true
BUG=150500
Review URL: https://codereview.chromium.org/470233003
Cr-Commit-Position: refs/heads/master@{#291814}
Diffstat (limited to 'gpu/command_buffer')
-rw-r--r-- | gpu/command_buffer/common/capabilities.cc | 1 | ||||
-rw-r--r-- | gpu/command_buffer/common/capabilities.h | 1 | ||||
-rw-r--r-- | gpu/command_buffer/service/gles2_cmd_decoder.cc | 2 |
3 files changed, 4 insertions, 0 deletions
diff --git a/gpu/command_buffer/common/capabilities.cc b/gpu/command_buffer/common/capabilities.cc index f286eaf..257086a 100644 --- a/gpu/command_buffer/common/capabilities.cc +++ b/gpu/command_buffer/common/capabilities.cc @@ -11,6 +11,7 @@ Capabilities::Capabilities() egl_image_external(false), texture_format_bgra8888(false), texture_format_etc1(false), + texture_format_etc1_npot(false), texture_rectangle(false), iosurface(false), texture_usage(false), diff --git a/gpu/command_buffer/common/capabilities.h b/gpu/command_buffer/common/capabilities.h index 9e38f5c..60f7b0d 100644 --- a/gpu/command_buffer/common/capabilities.h +++ b/gpu/command_buffer/common/capabilities.h @@ -14,6 +14,7 @@ struct GPU_EXPORT Capabilities { bool egl_image_external; bool texture_format_bgra8888; bool texture_format_etc1; + bool texture_format_etc1_npot; bool texture_rectangle; bool iosurface; bool texture_usage; diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc index a71a5a6..b46c252 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder.cc +++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc @@ -2711,6 +2711,8 @@ Capabilities GLES2DecoderImpl::GetCapabilities() { feature_info_->feature_flags().ext_texture_format_bgra8888; caps.texture_format_etc1 = feature_info_->feature_flags().oes_compressed_etc1_rgb8_texture; + caps.texture_format_etc1_npot = + caps.texture_format_etc1 && !workarounds().etc1_power_of_two_only; caps.texture_rectangle = feature_info_->feature_flags().arb_texture_rectangle; caps.texture_usage = feature_info_->feature_flags().angle_texture_usage; caps.texture_storage = feature_info_->feature_flags().ext_texture_storage; |