microsoft / WPFDXInterop

Repo for WPF DX Interop support
MIT License
307 stars 98 forks source link

Sample improvement: D3DVisualization.cpp - RenderTarget should not be recreated each Render() call #4

Closed rrelyea closed 8 years ago

rrelyea commented 8 years ago

From the sample I see that you recreate rendertarget each DoRender() call, which is extremely not efficient in highe performance rendering scenarios. Rendertargets should be recreated only when one of the swapchain parameters changed. Other time DX should reuse existing one.

[Originally filed by QuantumDeveloper as part of "D3DImage possible issues" https://github.com/Microsoft/WPFDXInterop/issues/2]

rrelyea commented 8 years ago

Would love feedback on the fix.