Bind Unity RenderTexture in D3D11 native code plugin

My Direct3D is somewhat rusty so apologies if there is an obvious answer to this question :slight_smile:

I’m trying to write a native code plugin that uses D3D11 to draw to a Unity RenderTexture.
I pass the RenderTexture into the plugin from Unity and I need to bind it as the “active” Render Target in D3D. The RenderingPlugin sample code shows how to do most of what I want except actually bind a different Render Target - how can I do this successfully with a Unity Render Texture?


I solved this problem by setting the active renderTexture on the managed code side before calling my render event = myRenderTexture;