Z-Buffer formats on R300?

Andy N

Member
I tried to post this in R300 technology forum but got no useful replies, maybe here someone will notice it.
I have written a DX7 application (I don't know whether it is different in DX8 or DX9). It originally created a Z-Buffer surface by requesting given bit-depth (16, 24 or 32) with according Z bit mask (0x0000FFFF, 0x00FFFFFF or 0xFFFFFFFF). This worked fine on Radeon 8500 which supports all possible Z-Buffer formats, but on Radeon 9700 I was only able to get 16 bit Z-Buffer using this method.
So started enumerating available Z-Buffer formats and choosing the best one. However, on Radeon 9700 there seem to be only two Z-Buffer formats, that being 16 bit plain and 24 bit Z with 8 bit stencil. There is no 24 bit without stencil neither 32 bit format. It also seems that the only way to get the Z depth of enumerated Z-Buffer format is actually counting the bits in Z mask, since the ZBits for 24+8 format is 32.

Now comes the main question: Is it possible to enable different Z-Buffer formats with registry keys (as was the case on Radeon 8500)? Or is it a hardware limitation? Would it be possible to force Z-Buffer depth in drivers (it works in OGL)?

I think that the lack of Z-Buffer formats is the reason for visual artifacts in some games (Morrowind). I have also seen on these forums that Sacrifice (don't have the game myself) is unable to run in 32 bpp mode, since it probably also wants 32 bit Z-Buffer and falls back to 16 bpp mode, hence disabling FSAA.
 
Come on, post a dumb reply at least, just don't ignore me completely.
I have seen Humus and OpenGL guy discussing this issue over at Beyond3D forums, so why doesn't anyone reply to my post?
 
According to Caps viewer there are support for 16bit, 24bit and 24+8.

This Mask thing you're using ... I don't quite get it, where do you use it?
 
When I call IDirectDraw7_CreateSurface (to create the Z-Buffer), I have to provide a DDSURFACEDESC2 structure. Part of it is the ddpfPixelFormat member, which contains the type of the buffer (DDPF_ZBUFFER), bit depth (16, 24 or 32) and bit masks for buffer elements. For plain Z-Buffer there is only one bit mask, that being the dwZBitMask. For Z-Buffer with stencil there are 2 more members (dwStencilBitDepth and dwStencilBitMask).
Interesting thing is that the DX Caps viewer form DX7 SDK shows only one Z-Buffer depth - 16 bits.

As far as I know this is different from DX8, but I don't know how much. Is the DX8 SDK available for download?
 
Thanks for the link, Humus. I'll try to download it later today but with my 128 kb/s cable connection it will take a while.

However, I would still like to know whether R300 hardware supports 32 bit Z-Buffer and it is not reported by drivers (to gain some performance) or it is not even possible.
 
Back
Top