diff --git a/src/dxvk/dxvk_context.cpp b/src/dxvk/dxvk_context.cpp index a70829e90..a5eaec304 100644 --- a/src/dxvk/dxvk_context.cpp +++ b/src/dxvk/dxvk_context.cpp @@ -397,7 +397,7 @@ namespace dxvk { const Rc& imageView, VkImageAspectFlags clearAspects, const VkClearValue& clearValue) { - this->updateFramebuffer(false); + this->updateFramebuffer(); // Prepare attachment ops DxvkColorAttachmentOps colorOp; @@ -1639,7 +1639,7 @@ namespace dxvk { VkOffset3D offset, VkExtent3D extent, VkClearValue value) { - this->updateFramebuffer(false); + this->updateFramebuffer(); // Find out if the render target view is currently bound, // so that we can avoid spilling the render pass if it is. @@ -1974,8 +1974,7 @@ namespace dxvk { m_gpActivePipeline = m_state.gp.pipeline != nullptr && m_state.om.framebuffer != nullptr ? m_state.gp.pipeline->getPipelineHandle(m_state.gp.state, - m_state.om.framebuffer->getRenderPass(), m_cmd->statCounters(), - this->checkAsyncCompilationCompat()) + m_state.om.framebuffer->getRenderPass(), m_cmd->statCounters()) : VK_NULL_HANDLE; if (m_gpActivePipeline != VK_NULL_HANDLE) { @@ -2234,7 +2233,7 @@ namespace dxvk { } - void DxvkContext::updateFramebuffer(bool isDraw) { + void DxvkContext::updateFramebuffer() { if (m_flags.test(DxvkContextFlag::GpDirtyFramebuffer)) { m_flags.clr(DxvkContextFlag::GpDirtyFramebuffer); @@ -2253,11 +2252,6 @@ namespace dxvk { : VkComponentMapping(); } - if (isDraw) { - for (uint32_t i = 0; i < fb->numAttachments(); i++) - fb->getAttachment(i).view->setRtBindingFrameId(m_device->getCurrentFrameId()); - } - m_flags.set(DxvkContextFlag::GpDirtyPipelineState); } } @@ -2399,7 +2393,7 @@ namespace dxvk { void DxvkContext::commitGraphicsState() { - this->updateFramebuffer(true); + this->updateFramebuffer(); this->startRenderPass(); this->updateGraphicsPipeline(); this->updateIndexBufferBinding(); @@ -2525,17 +2519,5 @@ namespace dxvk { } } } - - - bool DxvkContext::checkAsyncCompilationCompat() { - bool fbCompat = m_device->config().asyncPipeCompiler; - - for (uint32_t i = 0; fbCompat && i < m_state.om.framebuffer->numAttachments(); i++) { - const auto& attachment = m_state.om.framebuffer->getAttachment(i); - fbCompat &= attachment.view->getRtBindingAsyncCompilationCompat(); - } - - return fbCompat; - } } \ No newline at end of file diff --git a/src/dxvk/dxvk_context.h b/src/dxvk/dxvk_context.h index f1ef078b6..c49234cc0 100644 --- a/src/dxvk/dxvk_context.h +++ b/src/dxvk/dxvk_context.h @@ -713,7 +713,7 @@ namespace dxvk { VkDescriptorSet set, const DxvkPipelineLayout* layout); - void updateFramebuffer(bool isDraw); + void updateFramebuffer(); void updateIndexBufferBinding(); void updateVertexBufferBindings(); @@ -729,8 +729,6 @@ namespace dxvk { void commitComputeInitBarriers(); void commitComputePostBarriers(); - bool checkAsyncCompilationCompat(); - Rc getTransferBuffer(VkDeviceSize size); }; diff --git a/src/dxvk/dxvk_graphics.cpp b/src/dxvk/dxvk_graphics.cpp index 69df1747c..8b42ca0f0 100644 --- a/src/dxvk/dxvk_graphics.cpp +++ b/src/dxvk/dxvk_graphics.cpp @@ -56,14 +56,12 @@ namespace dxvk { DxvkGraphicsPipeline::DxvkGraphicsPipeline( const DxvkDevice* device, const Rc& cache, - const Rc& compiler, const Rc& vs, const Rc& tcs, const Rc& tes, const Rc& gs, const Rc& fs) - : m_device(device), m_vkd(device->vkd()), - m_cache(cache), m_compiler(compiler) { + : m_device(device), m_vkd(device->vkd()), m_cache(cache) { DxvkDescriptorSlotMapping slotMapping; if (vs != nullptr) vs ->defineResourceSlots(slotMapping); if (tcs != nullptr) tcs->defineResourceSlots(slotMapping); @@ -102,8 +100,7 @@ namespace dxvk { VkPipeline DxvkGraphicsPipeline::getPipelineHandle( const DxvkGraphicsPipelineStateInfo& state, const DxvkRenderPass& renderPass, - DxvkStatCounters& stats, - bool async) { + DxvkStatCounters& stats) { VkRenderPass renderPassHandle = renderPass.getDefaultHandle(); { std::lock_guard lock(m_mutex); @@ -123,12 +120,8 @@ namespace dxvk { // If no pipeline instance exists with the given state // vector, create a new one and add it to the list. VkPipeline newPipelineBase = m_basePipeline.load(); - VkPipeline newPipelineHandle = VK_NULL_HANDLE; - - if (!async) { - newPipelineHandle = this->compilePipeline( - state, renderPassHandle, newPipelineBase); - } + VkPipeline newPipelineHandle = this->compilePipeline( + state, renderPassHandle, newPipelineBase); Rc newPipeline = new DxvkGraphicsPipelineInstance(m_device->vkd(), @@ -154,10 +147,6 @@ namespace dxvk { if (newPipelineBase == VK_NULL_HANDLE && newPipelineHandle != VK_NULL_HANDLE) m_basePipeline.compare_exchange_strong(newPipelineBase, newPipelineHandle); - // Compile pipeline asynchronously if requested - if (async) - m_compiler->queueCompilation(this, newPipeline); - return newPipelineHandle; } diff --git a/src/dxvk/dxvk_graphics.h b/src/dxvk/dxvk_graphics.h index 0032bd9ee..9ed261944 100644 --- a/src/dxvk/dxvk_graphics.h +++ b/src/dxvk/dxvk_graphics.h @@ -167,7 +167,6 @@ namespace dxvk { DxvkGraphicsPipeline( const DxvkDevice* device, const Rc& cache, - const Rc& compiler, const Rc& vs, const Rc& tcs, const Rc& tes, @@ -195,14 +194,12 @@ namespace dxvk { * \param [in] state Pipeline state vector * \param [in] renderPass The render pass * \param [in,out] stats Stat counter - * \param [in] async Compile asynchronously * \returns Pipeline handle */ VkPipeline getPipelineHandle( const DxvkGraphicsPipelineStateInfo& state, const DxvkRenderPass& renderPass, - DxvkStatCounters& stats, - bool async); + DxvkStatCounters& stats); /** * \brief Compiles optimized pipeline @@ -226,7 +223,6 @@ namespace dxvk { const Rc m_vkd; Rc m_cache; - Rc m_compiler; Rc m_layout; Rc m_vs; diff --git a/src/dxvk/dxvk_image.h b/src/dxvk/dxvk_image.h index b4291937d..f7054c221 100644 --- a/src/dxvk/dxvk_image.h +++ b/src/dxvk/dxvk_image.h @@ -377,37 +377,6 @@ namespace dxvk { return m_image->pickLayout(layout); } - /** - * \brief Sets render target usage frame number - * - * The image view will track internally when - * it was last used as a render target. This - * info is used for async shader compilation. - * \param [in] frameId Frame number - */ - void setRtBindingFrameId(uint32_t frameId) { - if (frameId != m_rtBindingFrameId) { - if (frameId == m_rtBindingFrameId + 1) - m_rtBindingFrameCount += 1; - else - m_rtBindingFrameCount = 0; - - m_rtBindingFrameId = frameId; - } - } - - /** - * \brief Checks for async pipeline compatibility - * - * Asynchronous pipeline compilation may be enabled if the - * render target has been drawn to in the previous frames. - * \param [in] frameId Current frame ID - * \returns \c true if async compilation is supported - */ - bool getRtBindingAsyncCompilationCompat() const { - return m_rtBindingFrameCount >= 5; - } - private: Rc m_vkd; @@ -416,9 +385,6 @@ namespace dxvk { DxvkImageViewCreateInfo m_info; VkImageView m_views[ViewCount]; - uint32_t m_rtBindingFrameId = 0; - uint32_t m_rtBindingFrameCount = 0; - void createView(VkImageViewType type, uint32_t numLayers); }; diff --git a/src/dxvk/dxvk_options.cpp b/src/dxvk/dxvk_options.cpp index 2a9f91ecc..51e7140c5 100644 --- a/src/dxvk/dxvk_options.cpp +++ b/src/dxvk/dxvk_options.cpp @@ -4,7 +4,6 @@ namespace dxvk { DxvkOptions::DxvkOptions(const Config& config) { allowMemoryOvercommit = config.getOption("dxvk.allowMemoryOvercommit", false); - asyncPipeCompiler = false; // config.getOption("dxvk.asyncPipeCompiler", false); } } \ No newline at end of file diff --git a/src/dxvk/dxvk_options.h b/src/dxvk/dxvk_options.h index 0fc560e41..2547234a0 100644 --- a/src/dxvk/dxvk_options.h +++ b/src/dxvk/dxvk_options.h @@ -10,9 +10,6 @@ namespace dxvk { /// Allow allocating more memory from /// a heap than the device supports. bool allowMemoryOvercommit; - - /// Enable asynchronous pipeline compilation. - bool asyncPipeCompiler; }; } \ No newline at end of file diff --git a/src/dxvk/dxvk_pipemanager.cpp b/src/dxvk/dxvk_pipemanager.cpp index 8ece067d0..433b6002c 100644 --- a/src/dxvk/dxvk_pipemanager.cpp +++ b/src/dxvk/dxvk_pipemanager.cpp @@ -40,10 +40,8 @@ namespace dxvk { DxvkPipelineManager::DxvkPipelineManager(const DxvkDevice* device) : m_device (device), - m_cache (new DxvkPipelineCache(device->vkd())), - m_compiler(nullptr) { - if (m_device->config().asyncPipeCompiler) - m_compiler = new DxvkPipelineCompiler(); + m_cache (new DxvkPipelineCache(device->vkd())) { + } @@ -97,7 +95,7 @@ namespace dxvk { return pair->second; Rc pipeline = new DxvkGraphicsPipeline( - m_device, m_cache, m_compiler, vs, tcs, tes, gs, fs); + m_device, m_cache, vs, tcs, tes, gs, fs); m_graphicsPipelines.insert(std::make_pair(key, pipeline)); return pipeline; diff --git a/src/dxvk/dxvk_pipemanager.h b/src/dxvk/dxvk_pipemanager.h index 232c13739..11cc51cfd 100644 --- a/src/dxvk/dxvk_pipemanager.h +++ b/src/dxvk/dxvk_pipemanager.h @@ -99,7 +99,6 @@ namespace dxvk { const DxvkDevice* m_device; Rc m_cache; - Rc m_compiler; std::mutex m_mutex;