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: texture 2d array update

Hybrid View

  1. #1
    Junior Member Newbie
    Join Date
    Jul 2012
    Posts
    3

    texture 2d array update

    hi

    When i update without mipmaps texture array layer by PBO, it takes 0.15ms.
    But texture array with mipmaps takes 500-1000ms. It looks like im updating whole array, cos its depending on layers count.

    texture update:
    glBindBuffer(GL_PIXEL_UNPACK_BUFFER,pbo_id);
    glBindTexture(GL_TEXTURE_2D_ARRAY,tex_id);
    glTexSubImage3D(GL_TEXTURE_2D_ARRAY,0,0,0,0,512,51 2,1,GL_RGB,GL_UNSIGNED_BYTE,0);//layer 0


    texture creation:
    glGenTextures(1,&tex_id);
    glBindTexture(GL_TEXTURE_2D_ARRAY,tex_id);
    glTexImage3D(GL_TEXTURE_2D_ARRAY,0,GL_RGB8,512,512 ,128,0,GL_RGB,GL_UNSIGNED_BYTE,0);
    glTexParameteri(GL_TEXTURE_2D_ARRAY,GL_TEXTURE_MIN _FILTER,GL_LINEAR_MIPMAP_LINEAR);
    glTexParameteri(GL_TEXTURE_2D_ARRAY,GL_TEXTURE_MAG _FILTER,GL_LINEAR);
    glTexParameteri(GL_TEXTURE_2D_ARRAY,GL_TEXTURE_WRA P_S,GL_REPEAT);
    glTexParameteri(GL_TEXTURE_2D_ARRAY,GL_TEXTURE_WRA P_T,GL_REPEAT);
    glTexParameteri(GL_TEXTURE_2D_ARRAY,GL_TEXTURE_WRA P_R,GL_REPEAT);
    glGenerateMipmap(GL_TEXTURE_2D_ARRAY);

    num of layers like 128 its too many?(AMD: HD 7950)

  2. #2
    Junior Member Newbie
    Join Date
    Jul 2012
    Posts
    3
    problem fixed. The update time is now 0.22ms. Thx

Posting Permissions

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