summaryrefslogtreecommitdiffstats
path: root/gpu
diff options
context:
space:
mode:
authoraelias <aelias@chromium.org>2014-08-25 17:46:20 -0700
committerCommit bot <commit-bot@chromium.org>2014-08-26 00:47:56 +0000
commitd880a3deca8ab1c6c75ef915faa22ab7d40f55ff (patch)
treef388e316830f6fa69fdc138ba6cf66c62e369646 /gpu
parent9ecb800c3c129578ce352596250f9ca3ab8ad667 (diff)
downloadchromium_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')
-rw-r--r--gpu/command_buffer/common/capabilities.cc1
-rw-r--r--gpu/command_buffer/common/capabilities.h1
-rw-r--r--gpu/command_buffer/service/gles2_cmd_decoder.cc2
-rw-r--r--gpu/config/gpu_driver_bug_list_json.cc15
-rw-r--r--gpu/config/gpu_driver_bug_workaround_type.h2
5 files changed, 20 insertions, 1 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;
diff --git a/gpu/config/gpu_driver_bug_list_json.cc b/gpu/config/gpu_driver_bug_list_json.cc
index 1317f9f..2e55cc0 100644
--- a/gpu/config/gpu_driver_bug_list_json.cc
+++ b/gpu/config/gpu_driver_bug_list_json.cc
@@ -19,7 +19,7 @@ const char kGpuDriverBugListJson[] = LONG_STRING_CONST(
{
"name": "gpu driver bug list",
// Please update the version number whenever you change this file.
- "version": "7.2",
+ "version": "7.3",
"entries": [
{
"id": 1,
@@ -1026,6 +1026,19 @@ LONG_STRING_CONST(
"features": [
"regenerate_struct_names"
]
+ },
+ {
+ "id": 91,
+ "cr_bugs": [150500],
+ "description": "ETC1 non-power-of-two sized textures crash older IMG drivers",
+ "os": {
+ "type": "android"
+ },
+ "gl_vendor": "Imagination.*",
+ "gl_renderer": "PowerVR SGX 540.*",
+ "features": [
+ "etc1_power_of_two_only"
+ ]
}
]
}
diff --git a/gpu/config/gpu_driver_bug_workaround_type.h b/gpu/config/gpu_driver_bug_workaround_type.h
index 2b220e0..0d9f200 100644
--- a/gpu/config/gpu_driver_bug_workaround_type.h
+++ b/gpu/config/gpu_driver_bug_workaround_type.h
@@ -42,6 +42,8 @@
disable_oes_standard_derivatives) \
GPU_OP(DISABLE_POST_SUB_BUFFERS_FOR_ONSCREEN_SURFACES, \
disable_post_sub_buffers_for_onscreen_surfaces) \
+ GPU_OP(ETC1_POWER_OF_TWO_ONLY, \
+ etc1_power_of_two_only) \
GPU_OP(EXIT_ON_CONTEXT_LOST, \
exit_on_context_lost) \
GPU_OP(FORCE_DISCRETE_GPU, \