Results 1 to 3 of 3

Thread: glGetTexImage for integer

  1. #1
    Junior Member Newbie
    Join Date
    May 2007
    Posts
    4

    glGetTexImage for integer

    I have an 8800 GTX and an integer texture. (To be precise: created with glTexImage2D with target=GL_TEXTURE_RECTANGLE_NV, internalformat=GL_RGBA32I_EXT, format=GL_RGBA_INTEGER_EXT, type=GL_INT.) I can use this texture in fragment programs, I can bind this texture as a framebuffer and everything works OK.

    The problem is: I cannot download data from it with glGetTexImage. Whatever I tried for the format or type arguments, I get an "invalid operation". (The call context is not the problem, because download from float textures works in the same situation.) So what are the correct enumerants?

    (Tried under various driver version, current 158.22 on XP-32.)

  2. #2
    Super Moderator OpenGL Guru imported_dorbie's Avatar
    Join Date
    Jul 2000
    Location
    Bay Area, CA, USA
    Posts
    3,966

    Re: glGetTexImage for integer

    Have you checked for other possible prohibitions?

    Also make sure that you're not between a begin end draw pair and that the intended target is bound and. You don't mention MIP lod....?

  3. #3
    Junior Member Newbie
    Join Date
    May 2007
    Posts
    4

    Re: glGetTexImage for integer

    Have you checked for other possible prohibitions?

    Also make sure that you're not between a begin end draw pair and that the intended target is bound and. You don't mention MIP lod....?
    I try the download immediately after the upload, and level==0:

    Code :
      GLuint texture;
      GLfloat test[4] = {2,3,4,5}, out[4];
      //GLint test[4] = {2,3,4,5}, out[4];
      glGenTextures(1,&texture);
      glActiveTextureARB(GL_TEXTURE0_ARB);
      glEnable(GL_TEXTURE_RECTANGLE_NV);
      glBindTexture(GL_TEXTURE_RECTANGLE_NV,texture);
      glTexImage2D(GL_TEXTURE_RECTANGLE_NV,0,GL_FLOAT_RGBA_NV,1,1,0,GL_RGBA,GL_FLOAT,test);      
      //glTexImage2D(GL_TEXTURE_RECTANGLE_NV,0,GL_RGBA32I_EXT,1,1,0,GL_RGBA_INTEGER_EXT,GL_INT,test);      
      assert(glGetError()==GL_NO_ERROR);
      glGetTexImage(GL_TEXTURE_RECTANGLE_NV,0,GL_RGBA,GL_FLOAT,out);
      //glGetTexImage(GL_TEXTURE_RECTANGLE_NV,0,GL_RGBA_INTEGER_EXT,GL_INT,out);
      assert(glGetError()==GL_NO_ERROR);
      assert(test[0]==out[0] && test[1]==out[1] && test[2]==out[2] && test[3]==out[3]);
    In this state, that is, with the floating point textures, everything works correctly. The integer code path fails at the glGetTexImage call (0x502, which is invalid operation). The generated texture, however, can be used by fragment programs, so I know that the set up has worked correctly. It seems that just the download is broken.

Similar Threads

  1. Integer textures and integer samplers
    By Beren Minor in forum OpenGL: Advanced Coding
    Replies: 4
    Last Post: 12-23-2011, 12:52 AM
  2. glGetTexImage
    By cruachan in forum OpenGL: Advanced Coding
    Replies: 1
    Last Post: 05-19-2005, 05:24 PM
  3. FBO + glGetTexImage == no go?
    By ScottManDeath in forum OpenGL: Advanced Coding
    Replies: 2
    Last Post: 05-10-2005, 10:25 AM
  4. glGetTexImage not working...
    By Sanctus Animus in forum OpenGL: Advanced Coding
    Replies: 1
    Last Post: 01-11-2004, 03:56 AM
  5. glGetTexImage() problem
    By Sancho in forum OpenGL: Advanced Coding
    Replies: 6
    Last Post: 03-24-2003, 04:41 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean