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: glCopyImageSubData issue

  1. #1
    Newbie Newbie
    Join Date
    Jan 2013
    Posts
    2

    glCopyImageSubData issue

    Hello, everyone!

    I've experienced a problem with glCopyImageSubData. I try to copy a compressed DXT1 2D texture array to another compressed DXT1 2D texture array with the same dimensionality. All mip levels copied except the two smallest (1x1 and 2x2) - they stay unchanged (in the destination texture) after copying.
    Why does it happen?

    Code :
    for (int level = 0; level < levelCount; ++ level)
    {
        int mipWidth  = GetTextureMipWidth(srcTex, level);
        int mipHeight = GetTextureMipHeight(srcTex, level);
     
        glCopyImageSubData(srcTex, GL_TEXTURE_2D_ARRAY, level, 0, 0, 0, dstTex, GL_TEXTURE_2D_ARRAY, level, 0, 0, 0, mipWidth, mipHeight, arraySize);
     
        glBindTexture(GL_TEXTURE_2D_ARRAY, dstTex);
        glGetCompressedTexImage(GL_TEXTURE_2D_ARRAY, level, dstData);
        glBindTexture(GL_TEXTURE_2D_ARRAY, 0);
    }

    Thanks
    Last edited by mode89; 01-15-2013 at 09:54 AM.

  2. #2

  3. #3
    Newbie Newbie
    Join Date
    Jan 2013
    Posts
    2
    Quote Originally Posted by Alfonse Reinheart View Post
    Why does what happen?
    Why does these two mip levels didn't copy?
    And even glGetError() doesn't return an error after glCopyImageSubData().

  4. #4
    Senior Member OpenGL Guru Dark Photon's Avatar
    Join Date
    Oct 2004
    Location
    Druidia
    Posts
    3,184
    Are you sure levelCount is what it needs to be? What is the width and height of the base map as well as levelCount?

    If those check out, I have one thought for you. It probably goes without saying that with a DXT1 compressed texture, if your base map width and height are a power of 2, that 2x2 and 1x1 are the only MIPs where the driver has to deal with the resolution not exactly filling a full DXT 4x4 block. Now there's language in EXT_texture_compression_s3tc for CopyTexSubImage2D and friends which suggests that that in such cases you provide the true resolution, not the resolution rounded up to the next 4x4 DXT block size. But you might try 4x4 for width/height of the 2x2 and 1x1 MIPs just for kicks to see if that works. If so, I'd run it to ground because I think that might be a bug.

Posting Permissions

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