1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-01-31 14:52:11 +01:00

[d3d11] Properly implement SetPredication

This commit is contained in:
Philip Rebohle 2019-03-24 01:47:36 +01:00
parent d81146e3d2
commit 3a3d7fb378
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
2 changed files with 20 additions and 7 deletions

View File

@ -273,15 +273,24 @@ namespace dxvk {
void STDMETHODCALLTYPE D3D11DeviceContext::SetPredication(
ID3D11Predicate* pPredicate,
BOOL PredicateValue) {
static bool s_errorShown = false;
if (pPredicate && !std::exchange(s_errorShown, true))
Logger::err("D3D11DeviceContext::SetPredication: Stub");
D3D10DeviceLock lock = LockContext();
m_state.pr.predicateObject = static_cast<D3D11Query*>(pPredicate);
auto predicate = static_cast<D3D11Query*>(pPredicate);
m_state.pr.predicateObject = predicate;
m_state.pr.predicateValue = PredicateValue;
if (!m_device->features().extConditionalRendering.conditionalRendering)
return;
EmitCs([
cPredicate = predicate
? predicate->GetPredicate()
: DxvkBufferSlice(),
cValue = PredicateValue
] (DxvkContext* ctx) {
ctx->setPredicate(cPredicate,
cValue ? VK_CONDITIONAL_RENDERING_INVERTED_BIT_EXT : 0);
});
}

View File

@ -44,6 +44,10 @@ namespace dxvk {
void* pData,
UINT GetDataFlags);
DxvkBufferSlice GetPredicate() const {
return m_predicate;
}
D3D10Query* GetD3D10Iface() {
return &m_d3d10;
}