diff --git a/src/d3d11/d3d11_context.cpp b/src/d3d11/d3d11_context.cpp index 46eb32a3..9c4d677b 100644 --- a/src/d3d11/d3d11_context.cpp +++ b/src/d3d11/d3d11_context.cpp @@ -250,10 +250,11 @@ namespace dxvk { if (!pAsync) return; - Com queryPtr = static_cast(pAsync); + Com query(static_cast(pAsync)); - EmitCs([queryPtr] (DxvkContext* ctx) { - queryPtr->Begin(ctx); + EmitCs([cQuery = std::move(query)] + (DxvkContext* ctx) { + cQuery->Begin(ctx); }); } @@ -264,10 +265,11 @@ namespace dxvk { if (!pAsync) return; - Com queryPtr = static_cast(pAsync); - - EmitCs([queryPtr] (DxvkContext* ctx) { - queryPtr->End(ctx); + Com query(static_cast(pAsync)); + + EmitCs([cQuery = std::move(query)] + (DxvkContext* ctx) { + cQuery->End(ctx); }); } @@ -291,7 +293,7 @@ namespace dxvk { // return; // EmitCs([ - // cPredicate = Com(predicate), + // cPredicate = Com(predicate), // cValue = PredicateValue // ] (DxvkContext* ctx) { // DxvkBufferSlice predSlice;