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

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

Issue 2496633005: Fix unsized internalformat color-renderable detection (Closed)
Patch Set: fix comments of zmo Created 4 years, 1 month 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 dd7d59c5474322fc89ea5fda5158825e06723381..bdec5d071f2e1f34d7bed5fc825e17e5a7eef936 100644
--- a/gpu/command_buffer/service/texture_manager.cc
+++ b/gpu/command_buffer/service/texture_manager.cc
@@ -785,11 +785,15 @@ bool Texture::CanGenerateMipmaps(const FeatureInfo* feature_info) const {
return false;
}
- if (!Texture::ColorRenderable(feature_info, base.internal_format,
- immutable_) ||
- !Texture::TextureFilterable(feature_info, base.internal_format, base.type,
- immutable_)) {
- return false;
+ if (!feature_info->validators()->texture_unsized_internal_format.IsValid(
+ base.internal_format)) {
+ if (!Texture::ColorRenderable(feature_info, base.internal_format,
+ immutable_) ||
+ !Texture::TextureFilterable(feature_info, base.internal_format,
+ base.type,
+ immutable_)) {
+ return false;
+ }
}
for (size_t ii = 0; ii < face_infos_.size(); ++ii) {
@@ -869,7 +873,9 @@ bool Texture::ColorRenderable(const FeatureInfo* feature_info,
bool immutable) {
if (feature_info->validators()->texture_unsized_internal_format.IsValid(
internal_format)) {
- return true;
+ return internal_format != GL_ALPHA && internal_format != GL_LUMINANCE &&
+ internal_format != GL_LUMINANCE_ALPHA &&
+ internal_format != GL_SRGB_EXT;
}
return SizedFormatAvailable(feature_info, immutable, internal_format) &&
@@ -1772,16 +1778,8 @@ bool Texture::CanRenderTo(const FeatureInfo* feature_info, GLint level) const {
DCHECK(level >= 0 &&
level < static_cast<GLint>(face_infos_[0].level_infos.size()));
GLenum internal_format = face_infos_[0].level_infos[level].internal_format;
- bool color_renderable =
- ((feature_info->validators()->texture_unsized_internal_format.IsValid(
- internal_format) &&
- internal_format != GL_ALPHA && internal_format != GL_LUMINANCE &&
- internal_format != GL_LUMINANCE_ALPHA &&
- internal_format != GL_SRGB_EXT) ||
- (SizedFormatAvailable(feature_info, immutable_, internal_format) &&
- feature_info->validators()
- ->texture_sized_color_renderable_internal_format.IsValid(
- internal_format)));
+ bool color_renderable = ColorRenderable(feature_info, internal_format,
+ immutable_);
bool depth_renderable = feature_info->validators()->
texture_depth_renderable_internal_format.IsValid(internal_format);
bool stencil_renderable = feature_info->validators()->
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder.cc ('k') | gpu/command_buffer/service/texture_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698