PDA

View Full Version : AMD catalyst: set GL_UNPACK_ROW_LENGTH will lead to corrupted texture



jianliang79
05-06-2013, 09:09 PM
It seems that there is a bug in Catalyst driver, when I set GL_UNPACK_ROW_LENGTH to a value other than zero, under some specific image width, the texture copied from PBO will be corrupted. I have an AMD radeon HD 7770 card and use Catalyst 13.1 driver in Windows 7 x64. I have uploaded a sample program in http://devgurus.amd.com/servlet/JiveServlet/download/1288187-3622/TestPBO.rar.zip, the sample project can reproduce this issue. Please build it with VS 2010 in 64 bit mode, run the program and two bmp files named "correct.bmp" and "bad.bmp" will be generated, you can see the corrupted image in bad.bmp

Nowhere-01
05-06-2013, 10:58 PM
is your texture rgb(not rgba)? and it glitches only when texture width is not multiple of 4? in that case, it's because by default GL_UNPACK_ALIGNMENT is set to 4 and your texture should be either 4-channel or width must be multiple of 4. you can set GL_UNPACK_ALIGNMENT to 1, but it may cause much slower texture uploads. or you can use only textures that satisfy the requirements stated above.

jianliang79
05-07-2013, 01:31 AM
is your texture rgb(not rgba)? and it glitches only when texture width is not multiple of 4? in that case, it's because by default GL_UNPACK_ALIGNMENT is set to 4 and your texture should be either 4-channel or width must be multiple of 4. you can set GL_UNPACK_ALIGNMENT to 1, but it may cause much slower texture uploads. or you can use only textures that satisfy the requirements stated above.

Yes, My texture is RGBA.
And the sample program works fine in nVidia card.

Nowhere-01
05-07-2013, 01:39 AM
and what texture dimensions are causing trouble?

jianliang79
05-07-2013, 03:24 AM
and what texture dimensions are causing trouble?

Such as 3410 x 2048