Jump to content
  • Advertisement
Sign in to follow this  
ptl

Detect FP16 hardware alpha blend caps

This topic is 3490 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi there, I have implemented a new lighting algorithm using floating point texture blending, and I would be able to know, if hardware alpha blending with my G16R16F texture is supported on my graphic card. According to NVIDIA programmer Guide, the feature is available on my 8800 GTX and unavailable on my 7800 GTX. When I launch DirectX Caps Viewer, the floating point caps on a 8800 GTX is correctly detected. The DirectX Caps viewer also detects that my 7800 GTX have no hardware floating point blending. When I try to detect the feature in my code (I am using DirectX SDK November 2008), I look at the documentation on the CheckDeviceFormat function : Remarks • Alpha blending in a pixel shader - Set Usage to D3DUSAGE_QUERY_POSTPIXELSHADER_BLENDING. Expect this to fail for all floating-point render targets. So the CheckDeviceFormat function shouldn’t be able to detect the hardware blending feature according to the SDK documentation… I have tried these lines of code :
            if( FAILED( pD3D->CheckDeviceFormat( D3D_Settings.d3d9.AdapterOrdinal, D3D_Settings.d3d9.DeviceType,
                  D3D_Settings.d3d9.AdapterFormat, D3DUSAGE_QUERY_POSTPIXELSHADER_BLENDING, D3DRTYPE_SURFACE, D3DFMT_G16R16F ) ) )
            {
                  g_bSupportFPBlending = FALSE;
            }
            else
            {
                  g_bSupportFPBlending = TRUE;
            }
And Also :
            if( FAILED( pD3D->CheckDeviceFormat( D3D_Settings.d3d9.AdapterOrdinal, D3D_Settings.d3d9.DeviceType,
                  D3D_Settings.d3d9.AdapterFormat, D3DUSAGE_QUERY_POSTPIXELSHADER_BLENDING, D3DRTYPE_TEXTURE, D3DFMT_G16R16F ) ) )
            {
                  g_bSupportFPBlending = FALSE;
            }
            else
            {
                  g_bSupportFPBlending = TRUE;
            }
And Also :
            if( FAILED( pD3D->CheckDeviceFormat( D3D_Settings.d3d9.AdapterOrdinal, D3D_Settings.d3d9.DeviceType,
                  D3D_Settings.d3d9.AdapterFormat, D3DUSAGE_QUERY_POSTPIXELSHADER_BLENDING| D3DUSAGE_RENDERTARGET, D3DRTYPE_SURFACE, D3DFMT_G16R16F ) ) )
            {
                  g_bSupportFPBlending = FALSE;
            }
            else
            {
                  g_bSupportFPBlending = TRUE;
            }
And Also :
            if( FAILED( pD3D->CheckDeviceFormat( D3D_Settings.d3d9.AdapterOrdinal, D3D_Settings.d3d9.DeviceType,
                  D3D_Settings.d3d9.AdapterFormat, D3DUSAGE_QUERY_POSTPIXELSHADER_BLENDING| D3DUSAGE_RENDERTARGET, D3DRTYPE_TEXTURE, D3DFMT_G16R16F ) ) )
            {
                  g_bSupportFPBlending = FALSE;
            }
            else
            {
                  g_bSupportFPBlending = TRUE;
            }
Results : g_bSupportFPBlending is always FALSE, on my 7800GTX and on the 8800 GTX. So the documentation is right, the function returns always FALSE with floating point formats. But how do they detect correctly the feature in the DirectX Caps Viewer code ? I don’t see any other function that can help me in the SDK, and I’m sure I’m missing something. Thanks in advance for your help. Frank

Share this post


Link to post
Share on other sites
Advertisement
A common misstake when using CheckDeviceFormat is using the wrong adapter format. Many people use the back buffer format here. But you need to use the display mode. The valid display modes are A2R10G10B10, X8R8G8B8, X1R5G5B5, R5G6B5. If you use A8R8G8B8 as back buffer format the display mode would be X8R8G8B8. For A1R5G5B5 you need to use X1R5G5B5.

Share this post


Link to post
Share on other sites
I do use the display format (X8R8G8B8), not the backbuffer format, still have the same problems... An other idea ?

Share this post


Link to post
Share on other sites
As I know that this query works with an GeForce 8xxx when done right you should enable the debug runtime and check if it reports what’s wrong.

Share this post


Link to post
Share on other sites
Pretty sure FP blending only works for 4 component formats on the older cards. The Min/Max blend ops should work on the 2 channel formats, at least for ATI and NVIDIA, but thats about it.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!