From 416398aecb9fe9a007f0755471a7dbea0b5a791e Mon Sep 17 00:00:00 2001 From: Silvio Vilerino Date: Thu, 16 Oct 2025 20:21:16 -0400 Subject: [PATCH] mediafoundation: Only attach stats to last slice mfsample Reviewed-by: Pohsiang (John) Hsu Part-of: --- src/gallium/frontends/mediafoundation/mftransform.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gallium/frontends/mediafoundation/mftransform.cpp b/src/gallium/frontends/mediafoundation/mftransform.cpp index 28747ef94fc..f4aabfd66f1 100644 --- a/src/gallium/frontends/mediafoundation/mftransform.cpp +++ b/src/gallium/frontends/mediafoundation/mftransform.cpp @@ -1349,7 +1349,8 @@ CDX12EncHMFT::FinalizeAndEmitOutputSample( LPDX12EncodeContext pDX12EncodeContex } // Attach the async stats DXGIBuffers to the MFSample output gated by pAsyncFence completion - { + // Only to the last slice (or full frame) sample. + if (bIsLastSlice) { // Set stats metadata buffers to the sample here. As we are returning the dxgi buffers gated by the completion fence // for the resolved stats we do not need to wait for the pAsyncFence completion on the CPU. if( FAILED( ConfigureAsyncStatsMetadataOutputSampleAttributes( spOutputSample.Get(),