Jonathan has given a great explanation of RenderTargetUsage
, but I'd like to clarify some things with regard to the original question, involving the use of a RenderTarget2D
as a Texture2D
:
Put simply, RenderTargetUsage
controls the behaviour of the surface when it is set on the device as a render target. If it is not set to preserve the contents, they will be cleared. On Xbox 360 this happens as a quirk of the hardware (for performance). On Windows this is emulated to match Xbox 360 by simply clearing the surface when you set it.
But, if you are using it as a texture, this is irrelevant. It's only an issue when you want to render to the one surface multiple times (setting it to the device each time) without losing the previous contents.
If you only set it as the render target once, at the start of your game, it won't matter what the preserve setting is because it never gets set as a render target again.
What you do care about is the IsContentLost
property (MSDN) or the ContentLost
event (MSDN). These will be set/raised if the contents that you rendered to the render target were lost (due to device changes, eg: going full-screen).
If you're re-rendering the render target each frame, then you don't need to check for content-lost. But if you expect to create your render targets at the start of your game and continue using them throughout, you need to ensure they haven't been lost after the frame on which they were created.
(Note that you don't need to worry about content-lost happening part-way through your Draw
call. I'm reasonably certain that it can only ever happen between frames.)