D3DPTFILTERCAPS_MAGFANISOTROPIC, how to query from code?

Holyfish

Newcomer
Hi,

On one of our development PCs, we encounter a D3D error saying "MAG filter not supported" when D3D9-debug device is used. This is when anisotropic-filtering is used as the mag-filter. When looking in the Directx Caps viewer I find that indeed the D3DPTFILTERCAPS_MAGFANISOTROPIC capability is not supported for that particular card.
Strangely enough, I cannot find any way to query that from within code (other than from a managed D3D application). Both GetDeviceCaps and CheckDeviceFormat don't support this query.

Does anyone if it's possible to poll this cap from code and handle this case gracefully?

Thanks.
 
First at all if you set a texture filter that is not supported the Direct3D runtime/driver will fall back to a simpler filter. Therefore it would not break your program. But I understand that you want to eliminate this error message.

The supported filter caps are stored as bit field in the TextureFilterCaps element in the device caps. Therefore you need to check if the bit for this filter is set.
 
Back
Top