Index: NoesisView.cs
===================================================================
--- NoesisView.cs	(revision 16673)
+++ NoesisView.cs	(working copy)
@@ -832,6 +832,8 @@
             public bool clearStencil;
             public NoesisView view;
             public UniversalCameraData cameraData;
+            public TextureHandle activeColorTexture;
+            public TextureHandle activeDepthTexture;
         }
 
         ProfilingSampler _profilingSampler = new ProfilingSampler("Noesis.RenderOnscreen");
@@ -840,8 +842,12 @@
         {
             if (_view._uiView != null && _view._visible)
             {
-                // D3D12 crashes when using RasterRenderPass and for now we need to use UnsafePass
-                // Tested on 6.0.59f2, 6.1.14f1, 6.2.6f2, 6.3.0b5
+                // For D3D12, UnsafePass is needed because we are flushing the command buffer
+                // using kUnityD3D12EventConfigFlag_FlushCommandBuffers, which crashes Unity inside
+                // a RasterRenderPass. We need flushing because we are using our own Descriptor Heaps.
+                // Until Unity offers a way to reuse the active descriptor heap (as commented here:
+                // https://discussions.unity.com/t/d3d12-not-restoring-descriptorseats-aftert-invoking-low-level-native-plug-in/903907),
+                // we need to keep using UnsafePass.
 
                 if (UnityEngine.SystemInfo.graphicsDeviceType == UnityEngine.Rendering.GraphicsDeviceType.Direct3D12)
                 {
@@ -854,12 +860,20 @@
                         passData.clearStencil = _view._clearStencil;
                         passData.flipY = SystemInfo.graphicsUVStartsAtTop && !resourceData.isActiveTargetBackBuffer;
                         passData.cameraData = cameraData;
+                        passData.activeColorTexture = resourceData.activeColorTexture;
+                        passData.activeDepthTexture = resourceData.activeDepthTexture;
 
                         // Ensure that Unity does not cull this pass
                         builder.AllowPassCulling(false);
 
+                        builder.UseTexture(passData.activeColorTexture, AccessFlags.Write);
+                        builder.UseTexture(passData.activeDepthTexture, AccessFlags.ReadWrite);
+
                         builder.SetRenderFunc((PassData passData, UnsafeGraphContext context) =>
                         {
+                            // UnsafePass requires explicitly binding the resources
+                            context.cmd.SetRenderTarget(passData.activeColorTexture, passData.activeDepthTexture);
+
                         #if ENABLE_VR && ENABLE_XR_MODULE
                             if (passData.cameraData.xrRendering)
                             {
