Armin Zingler
2007-08-23 23:25:30 UTC
Hi group,
is there anything special to consider when using Device.SetRenderTarget? I
ask because I a get a huge memory occupation if I use it. Long story short:
The problem can simply be reproduced by modifying Tutorial1 from the SDKs
Samples\Managed\Direct3D\Tutorials\Tutorial1 folder:
In function "Render", add this statement before "device.Clear...":
device.SetRenderTarget(0,
device.GetSwapChain(0).GetBackBuffer(
0, BackBufferType.Mono
)
);
And in function InitializeGraphics, add this statement before "new
Device...":
presentParams.PresentationInterval = PresentInterval.Immediate;
Start it in the IDE, wait 5 seconds, then close the Form: It will take many
minutes until the application quits, so you will have to kill it in the task
manager. Why does this happen?
In this case, of course, setting the render target this way does not make
much sense, but it is only a reduced example. Though it works.
Nevertheless, I don't understand why this happens. The render target is the
first backbuffer anyways, so why does explicitly setting the RenderTarget
cause such a behavior?
If anybody is interested I can provide more details.
Armin
is there anything special to consider when using Device.SetRenderTarget? I
ask because I a get a huge memory occupation if I use it. Long story short:
The problem can simply be reproduced by modifying Tutorial1 from the SDKs
Samples\Managed\Direct3D\Tutorials\Tutorial1 folder:
In function "Render", add this statement before "device.Clear...":
device.SetRenderTarget(0,
device.GetSwapChain(0).GetBackBuffer(
0, BackBufferType.Mono
)
);
And in function InitializeGraphics, add this statement before "new
Device...":
presentParams.PresentationInterval = PresentInterval.Immediate;
Start it in the IDE, wait 5 seconds, then close the Form: It will take many
minutes until the application quits, so you will have to kill it in the task
manager. Why does this happen?
In this case, of course, setting the render target this way does not make
much sense, but it is only a reduced example. Though it works.
Nevertheless, I don't understand why this happens. The render target is the
first backbuffer anyways, so why does explicitly setting the RenderTarget
cause such a behavior?
If anybody is interested I can provide more details.
Armin