PDA

View Full Version : texture 2d array update



Hetzer
05-01-2013, 01:20 PM
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)

Hetzer
05-02-2013, 10:38 AM
problem fixed. The update time is now 0.22ms. Thx