I'm creating a 3D texture from memory data. Since the data might be very large, I divide the memory block into bricks. The code for creating the texture is like this:
glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_S, GL_CLAMP);
glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_T, GL_CLAMP);
glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_R, GL_CLAMP);
glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexImage3D(GL_TEXTURE_3D, 0, GL_ALPHA, 256, 256, m_nz, 0, GL_ALPHA, GL_UNSIGNED_BYTE, (unsigned char*)data->GetData());
In the example, the data block in memory has size m_nx*m_ny*m_nz, and I want to read only a portion of the data, which has size 256*256*m_nz, where 256 is smaller than the actual m_nx and m_ny.
On my Radeon HD4870, this doesn't work. Furthermore, no matter what number I put for the GL_UNPACK_IMAGE_HEIGHT parameter, the result stays incorrectly the same. This is apparently a stride problem. I'm wondering if anyone had the same problem and could help.