Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 4 of 4

Thread: glCompressedTexImage2D generates GL_INVALID_ENUM

  1. #1
    Junior Member Newbie
    Join Date
    Apr 2005
    Location
    Moscow.ru
    Posts
    8

    glCompressedTexImage2D generates GL_INVALID_ENUM

    glCompressedTexImage2D(GL_PROXY_TEXTURE_2D, 0, GL_COMPRESSED_RGBA_S3TC_DXT5_EXT, 2048, 2048, 0, 4194304, 0) generates GL_INVALID_ENUM on nVidia 8800 and works properly on AMD 3850.
    Same call but with GL_TEXTURE_2D works properly on nVidia too.
    Why is this happening?

  2. #2
    Advanced Member Frequent Contributor _NK47's Avatar
    Join Date
    Mar 2008
    Posts
    574

    Re: glCompressedTexImage2D generates GL_INVALID_ENUM

    don't know why it works properly in AMD but you tell OpenGL that pixeldata you specify is in compressed format. In order to do it correctly you also need to calculate correct image size taking blocksize into account. If you want to convert to DXT from uncompressed data on the fly use glTexImage2D with specified DXT format.
    Size of your DXT5 texture:
    dxt5size = ((width + 3) / 4) * ((height + 3) / 4) * 16; // 16 blocksize of DXT5

    other then that see the documentation why the function could possibly return INVALID_ENUM.
    GL_PROXY_TEXTURE_2D is not reliable after all. was a good idea but not to be trusted.

  3. #3
    Junior Member Newbie
    Join Date
    Apr 2005
    Location
    Moscow.ru
    Posts
    8

    Re: glCompressedTexImage2D generates GL_INVALID_ENUM

    Yes, pixeldata is compressed.
    Yes, data size is calculated taking blocksize into account.
    What's wrong with this? I don't understand.

  4. #4
    Advanced Member Frequent Contributor _NK47's Avatar
    Join Date
    Mar 2008
    Posts
    574

    Re: glCompressedTexImage2D generates GL_INVALID_ENUM

    might be a driver bug. try installing latest drivers and see if it's still reproduceable to be sure.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •