0
102 Jan 29, 2008 at 15:14

Hi all,

Could someone with an ATI graphics card test which Direct3D surface formats support sRGB reading and writing?

#include <stdio.h>
#include <d3d9.h>

int main()
{
IDirect3D9 *d3d9 = Direct3DCreate9(D3D_SDK_VERSION);
for(int format = 0; format < 1000; format++)
printf("\t%d\n", format);
printf("Write sRGB:\n");
for(int format = 0; format < 1000; format++)
if(d3d9->CheckDeviceFormat(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, D3DFMT_X8R8G8B8, D3DUSAGE_QUERY_SRGBWRITE, D3DRTYPE_TEXTURE, (D3DFORMAT)format) == D3D_OK)
printf("\t%d\n", format);
}


Thanks!

Nicolas

#### 5 Replies

0
117 Jan 29, 2008 at 16:45

It returns 21, 22 and 33 for both writing sRGB and reading sRGB.
Tested on Radeon HD 2900 XT, 6GB RAM, Pentium D 2*2.8 Ghz, Windows XP Professional

0
102 Jan 29, 2008 at 18:11

Thanks a lot Vilém!

0
101 Jan 30, 2008 at 13:45

Do you need information for other ATI cards too, Nick?

0
102 Jan 30, 2008 at 14:17

@roel

Do you need information for other ATI cards too, Nick?

No, I was just trying to confirm the cause of a bug. NVIDIA cards also support sRGB for 16-bit surfaces, so you have to be careful no to do gamma correction in the shader as well…

But if you have some time to kill you’re always welcome to post more results of course. I assume they support sRGB for DXTn and ATIn formats, but maybe that assumption will cause my next bug. ;)

0
101 Jan 31, 2008 at 14:56

Ran it on my Radeon Mobility 9700