diff --git a/libraries/gpu-gl-common/src/gpu/gl/GLTexelFormat.cpp b/libraries/gpu-gl-common/src/gpu/gl/GLTexelFormat.cpp index fef823718f..dd365efc16 100644 --- a/libraries/gpu-gl-common/src/gpu/gl/GLTexelFormat.cpp +++ b/libraries/gpu-gl-common/src/gpu/gl/GLTexelFormat.cpp @@ -33,8 +33,8 @@ using namespace gpu::gl; #define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT 0x8E8F #endif -bool GLTexelFormat::isCompressed() const { - switch (internalFormat) { +bool GLTexelFormat::isCompressed(GLenum format) { + switch (format) { case GL_COMPRESSED_SRGB_S3TC_DXT1_EXT: case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT: case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT: @@ -92,6 +92,11 @@ bool GLTexelFormat::isCompressed() const { } } +bool GLTexelFormat::isCompressed() const { + return isCompressed(internalFormat); +} + + GLenum GLTexelFormat::evalGLTexelFormatInternal(const gpu::Element& dstFormat) { GLenum result = GL_RGBA8; switch (dstFormat.getDimension()) { diff --git a/libraries/gpu-gl-common/src/gpu/gl/GLTexelFormat.h b/libraries/gpu-gl-common/src/gpu/gl/GLTexelFormat.h index 8f37f6b604..b5c805c5b8 100644 --- a/libraries/gpu-gl-common/src/gpu/gl/GLTexelFormat.h +++ b/libraries/gpu-gl-common/src/gpu/gl/GLTexelFormat.h @@ -14,13 +14,15 @@ namespace gpu { namespace gl { class GLTexelFormat { public: - GLenum internalFormat; - GLenum format; - GLenum type; + GLenum internalFormat{ GL_RGBA8 }; + GLenum format{ GL_RGBA }; + GLenum type{ GL_UNSIGNED_BYTE }; GLTexelFormat(GLenum glinternalFormat, GLenum glformat, GLenum gltype) : internalFormat(glinternalFormat), format(glformat), type(gltype) {} GLTexelFormat(GLenum glinternalFormat) : internalFormat(glinternalFormat) {} + static bool isCompressed(GLenum glinternalFormat); + bool isCompressed() const; static GLTexelFormat evalGLTexelFormat(const Element& dstFormat) {