Commit f067e4cc authored by Geoff Lang's avatar Geoff Lang Committed by Commit Bot

Support DXT textures with non-block sized mip levels.

The block size requirement for each mip level meant that all
DXT textures had to be POT sized. Relax these restrictions for
non-zero mip levels to allow NPOT DXT textures.

Bug: angleproject:4841
Change-Id: I6d5cde0c9eec220d9d82a73fc069743d3a934746
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2416748Reviewed-by: default avatarKenneth Russell <kbr@chromium.org>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#808427}
parent cc7a3f52
...@@ -47,11 +47,9 @@ bool IsValidPVRTCSize(GLint level, GLsizei size) { ...@@ -47,11 +47,9 @@ bool IsValidPVRTCSize(GLint level, GLsizei size) {
} }
bool IsValidS3TCSizeForWebGLAndANGLE(GLint level, GLsizei size) { bool IsValidS3TCSizeForWebGLAndANGLE(GLint level, GLsizei size) {
// WebGL and ANGLE only allow multiple-of-4 sizes, except for levels > 0 where // WebGL and ANGLE only allow multiple-of-4 sizes for the base level. See
// it also allows 1 or 2. See WEBGL_compressed_texture_s3tc and // WEBGL_compressed_texture_s3tc and ANGLE_compressed_texture_dxt*
// ANGLE_compressed_texture_dxt* return (level > 0) || (size % kS3TCBlockWidth == 0);
return (level && size == 1) || (level && size == 2) ||
!(size % kS3TCBlockWidth);
} }
const char* GetDebugSourceString(GLenum source) { const char* GetDebugSourceString(GLenum source) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment