summaryrefslogtreecommitdiffstats
path: root/gpu
diff options
context:
space:
mode:
authorgman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-05 20:04:02 +0000
committergman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-05 20:04:02 +0000
commit237bad7135749b5a5c8aeadaaaffd2ffc56f1924 (patch)
tree22ba5a935c0a311e2e16e26674274cab788f6f0f /gpu
parent8d6fe57a84fb4b4e6773373bddfa197be29179c5 (diff)
downloadchromium_src-237bad7135749b5a5c8aeadaaaffd2ffc56f1924.zip
chromium_src-237bad7135749b5a5c8aeadaaaffd2ffc56f1924.tar.gz
chromium_src-237bad7135749b5a5c8aeadaaaffd2ffc56f1924.tar.bz2
Prevent Mipmap generation for compressed textures.
TEST=ran WebGL conformance tests BUG=121476 Review URL: http://codereview.chromium.org/9988001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@130993 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu')
-rw-r--r--gpu/command_buffer/service/gles2_cmd_decoder.cc2
-rw-r--r--gpu/command_buffer/service/texture_manager.cc5
2 files changed, 5 insertions, 2 deletions
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index ff703ed..9021bd1 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -3385,7 +3385,7 @@ void GLES2DecoderImpl::DoGenerateMipmap(GLenum target) {
if (!info ||
!texture_manager()->MarkMipmapsGenerated(info)) {
SetGLError(GL_INVALID_OPERATION,
- "glGenerateMipmaps: Can not generate mips for npot textures");
+ "glGenerateMipmaps: Can not generate mips");
return;
}
// Workaround for Mac driver bug. In the large scheme of things setting
diff --git a/gpu/command_buffer/service/texture_manager.cc b/gpu/command_buffer/service/texture_manager.cc
index 652d313..f3fa467 100644
--- a/gpu/command_buffer/service/texture_manager.cc
+++ b/gpu/command_buffer/service/texture_manager.cc
@@ -180,6 +180,7 @@ bool TextureManager::TextureInfo::CanGenerateMipmaps(
target_ == GL_TEXTURE_RECTANGLE_ARB) {
return false;
}
+
const TextureInfo::LevelInfo& first = level_infos_[0][0];
// TODO(gman): Check internal_format, format and type.
for (size_t ii = 0; ii < level_infos_.size(); ++ii) {
@@ -190,7 +191,9 @@ bool TextureManager::TextureInfo::CanGenerateMipmaps(
(info.depth != 1) ||
(info.format != first.format) ||
(info.internal_format != first.internal_format) ||
- (info.type != first.type)) {
+ (info.type != first.type) ||
+ feature_info->validators()->compressed_texture_format.IsValid(
+ info.internal_format)) {
return false;
}
}