From 34e730fe41fd3f528029cd3960ce860418970e3d Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Mon, 30 Nov 2020 19:04:59 +0100 Subject: [PATCH] [d3d11] Remove predication-related code --- src/d3d11/d3d11_context.cpp | 20 -------------------- src/d3d11/d3d11_device.cpp | 1 - src/d3d11/d3d11_query.cpp | 33 --------------------------------- src/d3d11/d3d11_query.h | 7 ------- 4 files changed, 61 deletions(-) diff --git a/src/d3d11/d3d11_context.cpp b/src/d3d11/d3d11_context.cpp index 5dcf4de3e..768681e1a 100644 --- a/src/d3d11/d3d11_context.cpp +++ b/src/d3d11/d3d11_context.cpp @@ -269,23 +269,6 @@ namespace dxvk { if (pPredicate && !std::exchange(s_errorShown, true)) Logger::err("D3D11DeviceContext::SetPredication: Stub"); - - // TODO: Figure out why this breaks Watch Dogs and crashes War Thunder - // if (!m_device->features().extConditionalRendering.conditionalRendering) - // return; - - // EmitCs([ - // cPredicate = Com(predicate), - // cValue = PredicateValue - // ] (DxvkContext* ctx) { - // DxvkBufferSlice predSlice; - - // if (cPredicate != nullptr) - // predSlice = cPredicate->GetPredicate(ctx); - - // ctx->setPredicate(predSlice, - // cValue ? VK_CONDITIONAL_RENDERING_INVERTED_BIT_EXT : 0); - // }); } @@ -3809,9 +3792,6 @@ namespace dxvk { ctx->setViewports(1, &viewport, &scissor); - // Reset predication - ctx->setPredicate(DxvkBufferSlice(), 0); - // Unbind indirect draw buffer ctx->bindDrawBuffers(DxvkBufferSlice(), DxvkBufferSlice()); diff --git a/src/d3d11/d3d11_device.cpp b/src/d3d11/d3d11_device.cpp index 13db3b607..75b0632e5 100644 --- a/src/d3d11/d3d11_device.cpp +++ b/src/d3d11/d3d11_device.cpp @@ -1945,7 +1945,6 @@ namespace dxvk { enabled.core.features.logicOp = supported.core.features.logicOp; enabled.core.features.shaderImageGatherExtended = VK_TRUE; enabled.core.features.variableMultisampleRate = supported.core.features.variableMultisampleRate; - enabled.extConditionalRendering.conditionalRendering = supported.extConditionalRendering.conditionalRendering; enabled.extTransformFeedback.transformFeedback = VK_TRUE; enabled.extTransformFeedback.geometryStreams = VK_TRUE; } diff --git a/src/d3d11/d3d11_query.cpp b/src/d3d11/d3d11_query.cpp index 62a930d89..d2ac5dc54 100644 --- a/src/d3d11/d3d11_query.cpp +++ b/src/d3d11/d3d11_query.cpp @@ -212,9 +212,6 @@ namespace dxvk { ctx->endQuery(m_query[0]); } - if (unlikely(m_predicate != nullptr)) - ctx->writePredicate(DxvkBufferSlice(m_predicate), m_query[0]); - m_resetCtr.fetch_sub(1, std::memory_order_release); } @@ -339,21 +336,6 @@ namespace dxvk { } - DxvkBufferSlice D3D11Query::GetPredicate(DxvkContext* ctx) { - std::lock_guard lock(m_predicateLock); - - if (unlikely(m_desc.Query != D3D11_QUERY_OCCLUSION_PREDICATE)) - return DxvkBufferSlice(); - - if (unlikely(m_predicate != nullptr)) { - m_predicate = CreatePredicateBuffer(); - ctx->writePredicate(DxvkBufferSlice(m_predicate), m_query[0]); - } - - return DxvkBufferSlice(m_predicate); - } - - UINT64 D3D11Query::GetTimestampQueryFrequency() const { Rc device = m_device->GetDXVKDevice(); Rc adapter = device->adapter(); @@ -370,20 +352,5 @@ namespace dxvk { return S_OK; } - - - Rc D3D11Query::CreatePredicateBuffer() { - Rc device = m_device->GetDXVKDevice(); - - DxvkBufferCreateInfo info; - info.size = sizeof(uint32_t); - info.usage = VK_BUFFER_USAGE_TRANSFER_DST_BIT - | VK_BUFFER_USAGE_CONDITIONAL_RENDERING_BIT_EXT; - info.stages = VK_PIPELINE_STAGE_TRANSFER_BIT - | VK_PIPELINE_STAGE_CONDITIONAL_RENDERING_BIT_EXT; - info.access = VK_ACCESS_TRANSFER_WRITE_BIT - | VK_ACCESS_CONDITIONAL_RENDERING_READ_BIT_EXT; - return device->createBuffer(info, VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT); - } } diff --git a/src/d3d11/d3d11_query.h b/src/d3d11/d3d11_query.h index 9ddcb9f96..b8c42f708 100644 --- a/src/d3d11/d3d11_query.h +++ b/src/d3d11/d3d11_query.h @@ -51,8 +51,6 @@ namespace dxvk { void* pData, UINT GetDataFlags); - DxvkBufferSlice GetPredicate(DxvkContext* ctx); - void DoDeferredEnd() { m_state = D3D11_VK_QUERY_ENDED; m_resetCtr.fetch_add(1, std::memory_order_acquire); @@ -106,9 +104,6 @@ namespace dxvk { std::array, MaxGpuQueries> m_query; std::array, MaxGpuEvents> m_event; - sync::Spinlock m_predicateLock; - Rc m_predicate; - D3D10Query m_d3d10; uint32_t m_stallMask = 0; @@ -117,8 +112,6 @@ namespace dxvk { std::atomic m_resetCtr = { 0u }; UINT64 GetTimestampQueryFrequency() const; - - Rc CreatePredicateBuffer(); };