From 8d940d6f79c6f12994c085d24f4985b4da19ef86 Mon Sep 17 00:00:00 2001 From: chyyran Date: Wed, 30 Nov 2022 02:50:15 -0500 Subject: [PATCH] d3d11: deferred context experiments --- librashader-runtime-d3d11/src/filter_chain.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/librashader-runtime-d3d11/src/filter_chain.rs b/librashader-runtime-d3d11/src/filter_chain.rs index e7aaf05..142b32d 100644 --- a/librashader-runtime-d3d11/src/filter_chain.rs +++ b/librashader-runtime-d3d11/src/filter_chain.rs @@ -201,6 +201,10 @@ impl FilterChain { } let device_context = device_context.unwrap(); + let device_context = + unsafe { + device.CreateDeferredContext(0)? + }; // initialize output framebuffers let mut output_framebuffers = Vec::new(); output_framebuffers.resize_with(filters.len(), || { @@ -518,6 +522,15 @@ impl FilterChain { } self.push_history(&input)?; + + unsafe { + let list = self.common.d3d11.device_context.FinishCommandList(false)?; + let mut imm = None; + self.common.d3d11.device.GetImmediateContext(&mut imm); + let imm = imm.unwrap(); + imm.ExecuteCommandList(&list, true); + } + Ok(()) } }