SDK emulator does not raise error when loading unsupported compressed texture

In SDK 3.5 when attempting to load an unsupported texture format with CompressedTexImage2D, e.g. GL_COMPRESSED_RGB8_ETC2 in an OpenGL ES 1.1 context, no error is raised. According to the spec, an INVALID_ENUM should be raised.

I get an incomplete texture with this and other ETC2 formats which is what leads me to suppose they are unsupported.

Why am I trying to do this? Because the easiest way to determine if a format is supported is to try to load it, a strategy that fails dismally when the implementation does not raise the errors it is supposed to.

Please inform me of the bug number.

Hi Mark,
We always recommend checking for capabilities and extension strings to determine available features. This approach is the most portable solution for determining the support of a given feature.
In this case, it should be OES_compressed_ETC2_RGB8_texture.

I will try to reproduce this issue. then create a bug for this.

Thanks,
Kevin

The application in question is the KTX loader (https://github.com/KhronosGroup/KTX). KTX supports any format so in order to use the approach you suggest I would have to maintain a large table of format enums to extension names. It couldn’t even be a simple table because the enum values aren’t packed together. So there would be some inelegant code.

The IMG emulator is the first implementation I have encountered that does not raise an error. The only issue I previously encountered was an implementation that raised INVALID_VALUE instead of INVALID_ENUM.

You can use the KTX es1loadtests to reproduce the problem. Clone the repo from the above URL and checkout the “incoming” branch. Install GYP as per the KTX README. Edit the file gyp_include/config.gypi in the KTX source, commenting out maliemu.gypi in the includes at the bottom and uncommenting pvremu.gypi. Then regenerate the projects (“make msvs”) and open the generated solution (build/msvs/vsNNNN) in your version of Visual Studio (NNNN is, e.g, 2013) and build and run es1loadtests.

All the ETC2 tests will show a yellow square due to this bug. The loader has a software ETC2 decoder that it uses when a raised error indicates the implementation does not support the formats. In that case you will see some images.

Hi Mark,
Thank you for your information.
I created a bug for this issue. == BRN58313

Thanks,
Kevin