I’m not too sure about D3D, I’m an OpenGL guy, but you could be running out
of video memory, how big is your card’s memory ? Note that A8R8G8B8 needs 4
bytes per pixel, so, 1280x1024 for example, requires about 5.2Mb for the
front buffer plus 5.2Mb for the back buffer. A 16-bit depth buffer requires
1280x1024x2 = 2.6Mb. Now if you add one more surface in offscreen memory,
that’s 5.2Mb more, so, you see, you run out of memory pretty fast, and I’m
not even talking about texures yet. I’ll be surprised, however, if D3D ties
the number of bits in the depth buffer to the bit depth of the color buffer,
these should be independent.
One other thing that could be happening is, video memory is often managed by
the 2D Display Driver. D3D will ask the 2D driver for video memory, and if
your offscreen memory buffer allocation routine has a bug, that memory is
not going to be available, and D3D will barf. Depending on how your 2D
driver handles offscreen buffering of 2D bitmaps and fonts, you may have
even less video memory than you believe you do.
One suggestion is, try lowering the resolution, or the size of your
offscreen surface, or both, and see if D3D takes it.
Hope this helps!
Alberto.
-----Original Message-----
From: Gordon McEwen [mailto:xxxxx@enseo.co.uk]
Sent: Thursday, November 15, 2001 10:50 AM
To: NT Developers Interest List
Subject: [ntdev] Re: Why can’t D3DFMT_A8R8G8B8 work together with
D3DFMT_D16?
I’m developing display driver on w2k supporting Direct3D, However,
when the application creating a 3D Device with an offscreenplain
surface?of D3DFMT_A8R8G8B8 and a depth buffer of D3DFMT_D16,?DX
always reports that these two format can’t work together on this
card. In fact, any type of surface that has alpha pixels can’t work
with D3DFMT_D16. Why so? Thank you
An educated guess says the D3DFMT_A8R8G8B8 colour format needs 32 bits
- 8 bits each for R, G, B and Alpha. However _D16 indicates a 16 bit
deep surface - hence the incompatibility. I could be wrong but from
looking at the header it looks as if D3DFMT_A4R4G4B4 (or
D3DFMT_A1R5G5B5) would be the correct format with alpha for a 16 bit
(D3DFMT_D16) surface. Also, if you want D3DFMT_A8R8G8B8 you need
D3DFMT_D32.
Gordon
You are currently subscribed to ntdev as: xxxxx@compuware.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com