mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-01-19 05:52:11 +01:00
[d3d11] Move common Begin/End implementation to immediate context
This commit is contained in:
parent
63dbca82e7
commit
be5dc234c1
@ -243,39 +243,6 @@ namespace dxvk {
|
||||
}
|
||||
|
||||
|
||||
void STDMETHODCALLTYPE D3D11DeviceContext::Begin(ID3D11Asynchronous *pAsync) {
|
||||
D3D10DeviceLock lock = LockContext();
|
||||
|
||||
if (unlikely(!pAsync))
|
||||
return;
|
||||
|
||||
Com<D3D11Query, false> query(static_cast<D3D11Query*>(pAsync));
|
||||
|
||||
if (unlikely(!query->IsScoped()))
|
||||
return;
|
||||
|
||||
EmitCs([cQuery = std::move(query)]
|
||||
(DxvkContext* ctx) {
|
||||
cQuery->Begin(ctx);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
void STDMETHODCALLTYPE D3D11DeviceContext::End(ID3D11Asynchronous *pAsync) {
|
||||
D3D10DeviceLock lock = LockContext();
|
||||
|
||||
if (unlikely(!pAsync))
|
||||
return;
|
||||
|
||||
Com<D3D11Query, false> query(static_cast<D3D11Query*>(pAsync));
|
||||
|
||||
EmitCs([cQuery = std::move(query)]
|
||||
(DxvkContext* ctx) {
|
||||
cQuery->End(ctx);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
void STDMETHODCALLTYPE D3D11DeviceContext::SetPredication(
|
||||
ID3D11Predicate* pPredicate,
|
||||
BOOL PredicateValue) {
|
||||
|
@ -44,10 +44,6 @@ namespace dxvk {
|
||||
|
||||
void STDMETHODCALLTYPE ClearState();
|
||||
|
||||
void STDMETHODCALLTYPE Begin(ID3D11Asynchronous *pAsync);
|
||||
|
||||
void STDMETHODCALLTYPE End(ID3D11Asynchronous *pAsync);
|
||||
|
||||
void STDMETHODCALLTYPE SetPredication(
|
||||
ID3D11Predicate* pPredicate,
|
||||
BOOL PredicateValue);
|
||||
|
@ -102,16 +102,43 @@ namespace dxvk {
|
||||
}
|
||||
|
||||
|
||||
void STDMETHODCALLTYPE D3D11ImmediateContext::End(ID3D11Asynchronous* pAsync) {
|
||||
D3D11DeviceContext::End(pAsync);
|
||||
void STDMETHODCALLTYPE D3D11ImmediateContext::Begin(ID3D11Asynchronous* pAsync) {
|
||||
D3D10DeviceLock lock = LockContext();
|
||||
|
||||
auto query = static_cast<D3D11Query*>(pAsync);
|
||||
if (unlikely(query && query->IsEvent())) {
|
||||
if (unlikely(!pAsync))
|
||||
return;
|
||||
|
||||
Com<D3D11Query, false> query(static_cast<D3D11Query*>(pAsync));
|
||||
|
||||
if (unlikely(!query->IsScoped()))
|
||||
return;
|
||||
|
||||
EmitCs([cQuery = std::move(query)]
|
||||
(DxvkContext* ctx) {
|
||||
cQuery->Begin(ctx);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
void STDMETHODCALLTYPE D3D11ImmediateContext::End(ID3D11Asynchronous* pAsync) {
|
||||
D3D10DeviceLock lock = LockContext();
|
||||
|
||||
if (unlikely(!pAsync))
|
||||
return;
|
||||
|
||||
Com<D3D11Query, false> query(static_cast<D3D11Query*>(pAsync));
|
||||
|
||||
if (unlikely(query->IsEvent())) {
|
||||
query->NotifyEnd();
|
||||
query->IsStalling()
|
||||
? Flush()
|
||||
: FlushImplicit(TRUE);
|
||||
}
|
||||
|
||||
EmitCs([cQuery = std::move(query)]
|
||||
(DxvkContext* ctx) {
|
||||
cQuery->End(ctx);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
@ -27,12 +27,16 @@ namespace dxvk {
|
||||
UINT STDMETHODCALLTYPE GetContextFlags();
|
||||
|
||||
HRESULT STDMETHODCALLTYPE GetData(
|
||||
ID3D11Asynchronous* pAsync,
|
||||
void* pData,
|
||||
UINT DataSize,
|
||||
UINT GetDataFlags);
|
||||
ID3D11Asynchronous* pAsync,
|
||||
void* pData,
|
||||
UINT DataSize,
|
||||
UINT GetDataFlags);
|
||||
|
||||
void STDMETHODCALLTYPE End(ID3D11Asynchronous *pAsync);
|
||||
void STDMETHODCALLTYPE Begin(
|
||||
ID3D11Asynchronous* pAsync);
|
||||
|
||||
void STDMETHODCALLTYPE End(
|
||||
ID3D11Asynchronous* pAsync);
|
||||
|
||||
void STDMETHODCALLTYPE Flush();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user