[d3d11] Move SetPredication to D3D11CommonContext

This commit is contained in:
Philip Rebohle 2022-08-03 20:37:07 +02:00
parent b8b5662461
commit 163af1309d
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
4 changed files with 39 additions and 37 deletions

View File

@ -30,35 +30,6 @@ namespace dxvk {
}
void STDMETHODCALLTYPE D3D11DeviceContext::SetPredication(
ID3D11Predicate* pPredicate,
BOOL PredicateValue) {
D3D10DeviceLock lock = LockContext();
auto predicate = D3D11Query::FromPredicate(pPredicate);
m_state.pr.predicateObject = predicate;
m_state.pr.predicateValue = PredicateValue;
static bool s_errorShown = false;
if (pPredicate && !std::exchange(s_errorShown, true))
Logger::err("D3D11DeviceContext::SetPredication: Stub");
}
void STDMETHODCALLTYPE D3D11DeviceContext::GetPredication(
ID3D11Predicate** ppPredicate,
BOOL* pPredicateValue) {
D3D10DeviceLock lock = LockContext();
if (ppPredicate)
*ppPredicate = D3D11Query::AsPredicate(m_state.pr.predicateObject.ref());
if (pPredicateValue)
*pPredicateValue = m_state.pr.predicateValue;
}
void STDMETHODCALLTYPE D3D11DeviceContext::CopySubresourceRegion(
ID3D11Resource* pDstResource,
UINT DstSubresource,

View File

@ -34,14 +34,6 @@ namespace dxvk {
DxvkCsChunkFlags CsFlags);
~D3D11DeviceContext();
void STDMETHODCALLTYPE SetPredication(
ID3D11Predicate* pPredicate,
BOOL PredicateValue);
void STDMETHODCALLTYPE GetPredication(
ID3D11Predicate** ppPredicate,
BOOL* pPredicateValue);
void STDMETHODCALLTYPE CopySubresourceRegion(
ID3D11Resource* pDstResource,
UINT DstSubresource,

View File

@ -1804,6 +1804,37 @@ namespace dxvk {
}
template<typename ContextType>
void STDMETHODCALLTYPE D3D11CommonContext<ContextType>::SetPredication(
ID3D11Predicate* pPredicate,
BOOL PredicateValue) {
D3D10DeviceLock lock = LockContext();
auto predicate = D3D11Query::FromPredicate(pPredicate);
m_state.pr.predicateObject = predicate;
m_state.pr.predicateValue = PredicateValue;
static bool s_errorShown = false;
if (pPredicate && !std::exchange(s_errorShown, true))
Logger::err("D3D11DeviceContext::SetPredication: Stub");
}
template<typename ContextType>
void STDMETHODCALLTYPE D3D11CommonContext<ContextType>::GetPredication(
ID3D11Predicate** ppPredicate,
BOOL* pPredicateValue) {
D3D10DeviceLock lock = LockContext();
if (ppPredicate)
*ppPredicate = D3D11Query::AsPredicate(m_state.pr.predicateObject.ref());
if (pPredicateValue)
*pPredicateValue = m_state.pr.predicateValue;
}
template<typename ContextType>
BOOL STDMETHODCALLTYPE D3D11CommonContext<ContextType>::IsAnnotationEnabled() {
return m_annotation.GetStatus();

View File

@ -548,6 +548,14 @@ namespace dxvk {
ID3D11Buffer** ppSOTargets,
UINT* pOffsets);
void STDMETHODCALLTYPE SetPredication(
ID3D11Predicate* pPredicate,
BOOL PredicateValue);
void STDMETHODCALLTYPE GetPredication(
ID3D11Predicate** ppPredicate,
BOOL* pPredicateValue);
BOOL STDMETHODCALLTYPE IsAnnotationEnabled();
protected: