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 2 of 2

Thread: NVIDIA glTexImage3D problems

  1. #1
    Junior Member Newbie
    Join Date
    May 2009
    Location
    Budapest, Hungary
    Posts
    29

    NVIDIA glTexImage3D problems

    Hi!

    glTexImage3D crashes for certain sizes, for example the following code will crash:

    Code :
    int width = 65;
    int height = 64;
    int depth = 64;
    int size = width * height * depth;
    byte *data = new byte[size];
    GLuint tex;
    glGenTextures(1, &tex);
    glBindTexture(GL_TEXTURE_3D, tex);
    glTexImage3D(GL_TEXTURE_3D, 0, GL_R8, 
                 width, height, depth, 0, GL_RED, GL_UNSIGNED_BYTE, data);

    It's totally weird, it is ok for width= 63, 64 and 67 but it crashes for 65 and 66.
    I think when it is divisible by 4 then it's ok, but not always crashes when it's not divisable by 4.

    Configuration:
    ForceWare 266.58
    GTX 285
    Vista 64 bit

  2. #2
    Member Regular Contributor
    Join Date
    Apr 2007
    Posts
    271

    Re: NVIDIA glTexImage3D problems

    Try this:
    glPixelStorei(GL_UNPACK_ALIGNMENT, 1);

    ref: http://www.opengl.org/resources/feat...es/oglpitfall/ , section "7. Watch Your Pixel Store Alignment

Posting Permissions

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