DXSceneUse |
UseSharedWpfTexture gets or sets a nullable Boolean that is used only when using BackBuffer without SwapChain and specifies if DXScene is using a shared resources (texture) that can be used by both DirectX 11 (DXEngine) and DirectX 9 (WPF).
Using shared resources improves performance because the texture that is used to render the DirectX 11 image is shader with WPF composition engine. This means that the texture is not copied to main CPU memory and than back to GPU by WPF.
When the value is not set by the user (is null), then the value is set in the DXScene initialization. It is set to true when DXEngine is using the same graphics card (adapter) then WPF. Otherwise the value is set to false.
If you want to set the value of UseSharedWpfTexture to false, this needs to be done before the DirectX buffers and other resources are created. The best place to set the value is in the DXSceneDeviceCreated event handler.
MainDXViewportView.DXSceneDeviceCreated += delegate(object sender, EventArgs e) { if (MainDXViewportView.DXScene != null) // DXScene can be null in case of WPF rendering MainDXViewportView.DXScene.UseSharedWpfTexture = false; };