Sign in to follow this  
johndirect

D3DFORMAT

Recommended Posts

When I create a device, there is a parameter to specify the back buffer format in the D3DPRESENT_PARAMETERS. Similarly, when I create a texture, there is an option of specifying the format. Question 1: Do these 2 formats need to match? Question 2: For the FOURCC formats, in the documentation, I see that I can specify only either ('M','E','T','I') ('G','R','G','B'), ('R','G','B','G') ('U','Y','V','Y'). How can I specify other formats such as I420, YV12, YVU9 etc. Thanks

Share this post


Link to post
Share on other sites
1: They don't. Texture sampler converts texture format to floating point and later in pipeline it's converted to the format of whatever surface you are rendering to. If you aren't using shaders, exactly the same things happen automatically.

2: Use FOURCC macro, exactly like in examples you've mentioned.

Share this post


Link to post
Share on other sites
While the formats often don't have to match, there are certain cards which may be more strict than others. Technically you're supposed to use "CheckDeviceFormat" to ensure the format is available for the use you want, when using a certain backbuffer type. It's possible the card won't allow a YUV texture with an RGB backbuffer. Some cards only support YUV for DirectDraw overlays.

As I've never tried using any obscure formats I can't really comment on how widespread support for them is.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this