I'm writing a DLL that takes video frames in, processes them through a HLSL shader with DirectX 9, and then return the result in memory. It works when rendering against a backbuffer with pixel format D3DFMT_X8R8G8B8. but I need to run the shader and get the result in D3DFMT_A32B32G32R32F or D3DFMT_A16B16G16R16F pixel format which the backbuffer doesn't support.
If I add this line of code, I can run with the D3DFMT_A32B32G32R32F format but the shader isn't being run anymore.
m_pDevice->SetRenderTarget(0, m_pTextureSurface);
I'm starting to think that the reason the HLSL shader isn't being run is because, for optimization purpose, the code only gets executed when calling to display. What makes me think this is that I had a crash when rendering a video larger than the back buffer... but instead of crashing when rendering or presenting the scene, it only crashed at the very end when calling GetRenderTarget().
How can I force the device to render the result of the HLSL shader into another texture of D3DFMT_A32B32G32R32F format without passing through the backbuffer that has a more limited format?
I don't need to display anything to the screen. In fact, this DLL has no UI.