PDA

View Full Version : ATI: glTexImage2D with large texture doesn't work



pjcozzi
02-02-2009, 05:52 PM
Hi,

The following call to glTexImage2D creates an incorrect texture on my ATI Radeon HD 4350 with updated drivers:



glTexImage2D(
GL_TEXTURE_2D,
0,
GL_RGB8,
2731, // width
512, // height
0,
GL_BGR,
GL_UNSIGNED_BYTE,
pixels);

Anything larger than 2,730 in the x dimension causes problems. For some values, the texture is white, for others, it is distorted. I can provide images, if it will help. GL_MAX_TEXTURE_SIZE is 8K and the code works on my GeForce 8.

As a workaround, I found that you can glTexImage2D with null, then immediately glTexSubImage2D:



glTexImage2D(
GL_TEXTURE_2D,
0,
GL_RGB8,
2731, // width
512, // height
0,
GL_BGR,
GL_UNSIGNED_BYTE,
0); // null pixels

glTexSubImage2D(
GL_TEXTURE_2D,
0,
0, // x offset
0, // y offset
2731, // width
512, // height
GL_BGR,
GL_UNSIGNED_BYTE,
pixels);

Has anyone ran into this before? Do you suggest any other workarounds?

Also, the y dimension seems to have a higher limit than 2,730; somewhere between 4K and 8K.

Thanks,
Patrick

Mars_999
02-02-2009, 09:57 PM
Sounds like a driver bug as usual with ATI... File a report.

pjcozzi
02-03-2009, 07:36 AM
Will do. Do you have a link to the bug submission form? I can't find it anywhere on their website. Do I need to be a registered developer?

Thanks,
Patrick

Eosie
02-03-2009, 08:57 AM
Sending an email to devrel@amd.com should be enough.

AlexandreJ
02-03-2009, 11:13 AM
I confirm this one.
Got it today with catalyst 9.1 on a radeon HD 48*.

AlexandreJ
02-03-2009, 11:31 AM
BTW: I confirm that the fix is working too. Great catch.

pjcozzi
02-03-2009, 04:07 PM
BTW: I confirm that the fix is working too. Great catch.

Thanks for confirming. By fix, do you mean the workaround or an actual fix?

Thanks,
Patrick

Mars_999
02-04-2009, 12:37 AM
Its a stop gap. You shouldn't have to do that.