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

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

Issue 2827573007: Reset TexImage2D base level to workaround Intel mac driver bug (Closed)
Patch Set: Add gpu unittests Created 3 years, 6 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 abfd3bf54522e137e9951d74a83e59b4ce19874d..939530b55003279e73e12c962f756551648869a5 100644
--- a/gpu/command_buffer/service/texture_manager.cc
+++ b/gpu/command_buffer/service/texture_manager.cc
@@ -3350,12 +3350,22 @@ void TextureManager::DoTexImage(
AdjustTexFormat(feature_info_.get(), args.format), args.type,
args.pixels);
} else {
+ Texture* texture = texture_ref->texture();
+ GLint base_level = texture->base_level();
+ if (feature_info_->workarounds().reset_teximage2d_base_level &&
+ args.target == GL_TEXTURE_2D && base_level != 0) {
+ glTexParameteri(args.target, 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 (feature_info_->workarounds().reset_teximage2d_base_level &&
+ args.target == GL_TEXTURE_2D && base_level != 0) {
+ glTexParameteri(args.target, GL_TEXTURE_BASE_LEVEL, base_level);
+ }
}
}
GLenum error = ERRORSTATE_PEEK_GL_ERROR(error_state, function_name);

Powered by Google App Engine
This is Rietveld 408576698