Remove the requirement that a format must be texturable to be renderable.
Previously, to determine if a texture format was renderable, the
texturable and renderable fields had to be and-ed together. This caused
issues for formats such as D24S8 which can be renderable but not
texturable depending on available extensions.
Made the renderable flag a complete check that may be different than the
textureable flag and removed assumptions that a format is texturable if
renderable from the code.
GL_DEPTH24_STENCIL8 now checks for ANGLE_depth_textures for texturability
and ANGLE_depth_textures or OES_packed_depth_stencil for renderability.
BUG=angle:752
Change-Id: I6d197cee72cc249e5996fa395303bdf43d246a87
Reviewed-on: https://chromium-review.googlesource.com/219093
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
diff --git a/src/libGLESv2/Context.cpp b/src/libGLESv2/Context.cpp
index 474806c..04c7616 100644
--- a/src/libGLESv2/Context.cpp
+++ b/src/libGLESv2/Context.cpp
@@ -2391,26 +2391,25 @@
TextureCaps formatCaps = i->second;
const InternalFormat &formatInfo = GetInternalFormatInfo(format);
- if (formatCaps.texturable && formatInfo.textureSupport(clientVersion, mExtensions))
+
+ // Update the format caps based on the client version and extensions
+ formatCaps.texturable = formatInfo.textureSupport(clientVersion, mExtensions);
+ formatCaps.renderable = formatInfo.renderSupport(clientVersion, mExtensions);
+ formatCaps.filterable = formatInfo.filterSupport(clientVersion, mExtensions);
+
+ // OpenGL ES does not support multisampling with integer formats
+ if (!formatInfo.renderSupport || formatInfo.componentType == GL_INT || formatInfo.componentType == GL_UNSIGNED_INT)
{
- // Update the format caps based on the client version and extensions
- formatCaps.renderable = formatInfo.renderSupport(clientVersion, mExtensions);
- formatCaps.filterable = formatInfo.filterSupport(clientVersion, mExtensions);
-
- // OpenGL ES does not support multisampling with integer formats
- if (formatInfo.componentType == GL_INT || formatInfo.componentType == GL_UNSIGNED_INT)
- {
- formatCaps.sampleCounts.clear();
- }
- maxSamples = std::max(maxSamples, formatCaps.getMaxSamples());
-
- if (formatInfo.compressed)
- {
- mCaps.compressedTextureFormats.push_back(format);
- }
-
- mTextureCaps.insert(format, formatCaps);
+ formatCaps.sampleCounts.clear();
}
+ maxSamples = std::max(maxSamples, formatCaps.getMaxSamples());
+
+ if (formatCaps.texturable && formatInfo.compressed)
+ {
+ mCaps.compressedTextureFormats.push_back(format);
+ }
+
+ mTextureCaps.insert(format, formatCaps);
}
mExtensions.maxSamples = maxSamples;