Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(201)

Unified Diff: gpu/command_buffer/service/texture_manager.cc

Issue 2827573007: Reset TexImage2D base level to workaround Intel mac driver bug (Closed)
Patch Set: Reset texture base level to workaround bug of texImage2D on macos. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 3a655827f75efa7ac3312f866295dc400fda5642..31e4b8d9407e75acec20033600ac0e96de7d8c91 100644
--- a/gpu/command_buffer/service/texture_manager.cc
+++ b/gpu/command_buffer/service/texture_manager.cc
@@ -3261,12 +3261,22 @@ void TextureManager::DoTexImage(
AdjustTexFormat(feature_info_.get(), args.format), args.type,
args.pixels);
} else {
+ if (texture_ref &&
qiankun 2017/04/26 04:16:20 texture_ref should be always non-null here.
yizhou.jiang 2017/04/27 04:23:22 Done.
+ feature_info_->workarounds().reset_teximage2d_base_level) {
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, 0);
+ }
glTexImage2D(
args.target, args.level,
AdjustTexInternalFormat(feature_info_.get(), args.internal_format),
args.width, args.height, args.border,
AdjustTexFormat(feature_info_.get(), args.format), args.type,
args.pixels);
+ if (texture_ref &&
+ feature_info_->workarounds().reset_teximage2d_base_level) {
+ Texture* texture = texture_ref->texture();
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL,
+ texture->base_level());
+ }
}
}
GLenum error = ERRORSTATE_PEEK_GL_ERROR(error_state, function_name);

Powered by Google App Engine
This is Rietveld 408576698