I have a situation where I need to apply some algorithm to my texture every time it's rotated.
My question is - what is the best approach to apply an image processing algorithms within XNA?
Now the texture is a RenderTarget2D and the algorithm performs some operation with it's pixels and sets them back to the RenderTarget2D. This approach causes termination of my app and it's performance is very bad.
I searched through the stackoverflow but have no found anything relevant to the subject. I also read this article http://blogs.msdn.com/b/shawnhar/archive/2008/04/14/stalling-the-pipeline.aspx and understand how bad my approach is.
Depending on the operations that you may require, then doing them through an HLSL shader would be a very good idea.
Shaders are really the right choice because you can take advantage of the multiple cores the GPU has AND you don't need to resolve the data in the rendertarget; the data gets process on its way to the screen without causing any stalling.