1
0
mirror of https://github.com/EduApps-CDG/OpenDX synced 2024-12-30 09:45:37 +01:00

[dxvk] Move DxvkPipelineCache to DxvkPipeManager

Since the pipeline cache isn't used for anything else but compiling
pipelines, keeping this stuff together is much more useful.
This commit is contained in:
Philip Rebohle 2018-05-09 14:26:45 +02:00
parent 47b9fd8b19
commit 37456d583e
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
6 changed files with 8 additions and 18 deletions

View File

@ -8,11 +8,9 @@ namespace dxvk {
DxvkContext::DxvkContext( DxvkContext::DxvkContext(
const Rc<DxvkDevice>& device, const Rc<DxvkDevice>& device,
const Rc<DxvkPipelineCache>& pipelineCache,
const Rc<DxvkPipelineManager>& pipelineManager, const Rc<DxvkPipelineManager>& pipelineManager,
const Rc<DxvkMetaClearObjects>& metaClearObjects) const Rc<DxvkMetaClearObjects>& metaClearObjects)
: m_device (device), : m_device (device),
m_pipeCache (pipelineCache),
m_pipeMgr (pipelineManager), m_pipeMgr (pipelineManager),
m_metaClear (metaClearObjects) { } m_metaClear (metaClearObjects) { }
@ -1654,8 +1652,7 @@ namespace dxvk {
m_flags.clr(DxvkContextFlag::CpDirtyPipeline); m_flags.clr(DxvkContextFlag::CpDirtyPipeline);
m_state.cp.state.bsBindingState.clear(); m_state.cp.state.bsBindingState.clear();
m_state.cp.pipeline = m_pipeMgr->createComputePipeline( m_state.cp.pipeline = m_pipeMgr->createComputePipeline(m_state.cp.cs.shader);
m_pipeCache, m_state.cp.cs.shader);
if (m_state.cp.pipeline != nullptr) if (m_state.cp.pipeline != nullptr)
m_cmd->trackResource(m_state.cp.pipeline); m_cmd->trackResource(m_state.cp.pipeline);
@ -1686,7 +1683,7 @@ namespace dxvk {
m_state.gp.state.bsBindingState.clear(); m_state.gp.state.bsBindingState.clear();
m_state.gp.pipeline = m_pipeMgr->createGraphicsPipeline( m_state.gp.pipeline = m_pipeMgr->createGraphicsPipeline(
m_pipeCache, m_state.gp.vs.shader, m_state.gp.vs.shader,
m_state.gp.tcs.shader, m_state.gp.tes.shader, m_state.gp.tcs.shader, m_state.gp.tes.shader,
m_state.gp.gs.shader, m_state.gp.fs.shader); m_state.gp.gs.shader, m_state.gp.fs.shader);

View File

@ -29,7 +29,6 @@ namespace dxvk {
DxvkContext( DxvkContext(
const Rc<DxvkDevice>& device, const Rc<DxvkDevice>& device,
const Rc<DxvkPipelineCache>& pipelineCache,
const Rc<DxvkPipelineManager>& pipelineManager, const Rc<DxvkPipelineManager>& pipelineManager,
const Rc<DxvkMetaClearObjects>& metaClearObjects); const Rc<DxvkMetaClearObjects>& metaClearObjects);
~DxvkContext(); ~DxvkContext();
@ -620,7 +619,6 @@ namespace dxvk {
private: private:
const Rc<DxvkDevice> m_device; const Rc<DxvkDevice> m_device;
const Rc<DxvkPipelineCache> m_pipeCache;
const Rc<DxvkPipelineManager> m_pipeMgr; const Rc<DxvkPipelineManager> m_pipeMgr;
const Rc<DxvkMetaClearObjects> m_metaClear; const Rc<DxvkMetaClearObjects> m_metaClear;

View File

@ -15,7 +15,6 @@ namespace dxvk {
m_properties (adapter->deviceProperties()), m_properties (adapter->deviceProperties()),
m_memory (new DxvkMemoryAllocator (adapter, vkd)), m_memory (new DxvkMemoryAllocator (adapter, vkd)),
m_renderPassPool (new DxvkRenderPassPool (vkd)), m_renderPassPool (new DxvkRenderPassPool (vkd)),
m_pipelineCache (new DxvkPipelineCache (vkd)),
m_pipelineManager (new DxvkPipelineManager (this)), m_pipelineManager (new DxvkPipelineManager (this)),
m_metaClearObjects(new DxvkMetaClearObjects (vkd)), m_metaClearObjects(new DxvkMetaClearObjects (vkd)),
m_unboundResources(this), m_unboundResources(this),
@ -106,7 +105,6 @@ namespace dxvk {
Rc<DxvkContext> DxvkDevice::createContext() { Rc<DxvkContext> DxvkDevice::createContext() {
return new DxvkContext(this, return new DxvkContext(this,
m_pipelineCache,
m_pipelineManager, m_pipelineManager,
m_metaClearObjects); m_metaClearObjects);
} }

View File

@ -354,7 +354,6 @@ namespace dxvk {
Rc<DxvkMemoryAllocator> m_memory; Rc<DxvkMemoryAllocator> m_memory;
Rc<DxvkRenderPassPool> m_renderPassPool; Rc<DxvkRenderPassPool> m_renderPassPool;
Rc<DxvkPipelineCache> m_pipelineCache;
Rc<DxvkPipelineManager> m_pipelineManager; Rc<DxvkPipelineManager> m_pipelineManager;
Rc<DxvkMetaClearObjects> m_metaClearObjects; Rc<DxvkMetaClearObjects> m_metaClearObjects;

View File

@ -1,3 +1,4 @@
#include "dxvk_device.h"
#include "dxvk_pipemanager.h" #include "dxvk_pipemanager.h"
namespace dxvk { namespace dxvk {
@ -38,7 +39,7 @@ namespace dxvk {
DxvkPipelineManager::DxvkPipelineManager(const DxvkDevice* device) DxvkPipelineManager::DxvkPipelineManager(const DxvkDevice* device)
: m_device(device) { : m_device(device), m_cache(new DxvkPipelineCache(device->vkd())) {
} }
@ -49,7 +50,6 @@ namespace dxvk {
Rc<DxvkComputePipeline> DxvkPipelineManager::createComputePipeline( Rc<DxvkComputePipeline> DxvkPipelineManager::createComputePipeline(
const Rc<DxvkPipelineCache>& cache,
const Rc<DxvkShader>& cs) { const Rc<DxvkShader>& cs) {
if (cs == nullptr) if (cs == nullptr)
return nullptr; return nullptr;
@ -64,7 +64,7 @@ namespace dxvk {
return pair->second; return pair->second;
const Rc<DxvkComputePipeline> pipeline const Rc<DxvkComputePipeline> pipeline
= new DxvkComputePipeline(m_device, cache, cs); = new DxvkComputePipeline(m_device, m_cache, cs);
m_computePipelines.insert(std::make_pair(key, pipeline)); m_computePipelines.insert(std::make_pair(key, pipeline));
return pipeline; return pipeline;
@ -72,7 +72,6 @@ namespace dxvk {
Rc<DxvkGraphicsPipeline> DxvkPipelineManager::createGraphicsPipeline( Rc<DxvkGraphicsPipeline> DxvkPipelineManager::createGraphicsPipeline(
const Rc<DxvkPipelineCache>& cache,
const Rc<DxvkShader>& vs, const Rc<DxvkShader>& vs,
const Rc<DxvkShader>& tcs, const Rc<DxvkShader>& tcs,
const Rc<DxvkShader>& tes, const Rc<DxvkShader>& tes,
@ -95,7 +94,7 @@ namespace dxvk {
return pair->second; return pair->second;
const Rc<DxvkGraphicsPipeline> pipeline const Rc<DxvkGraphicsPipeline> pipeline
= new DxvkGraphicsPipeline(m_device, cache, vs, tcs, tes, gs, fs); = new DxvkGraphicsPipeline(m_device, m_cache, vs, tcs, tes, gs, fs);
m_graphicsPipelines.insert(std::make_pair(key, pipeline)); m_graphicsPipelines.insert(std::make_pair(key, pipeline));
return pipeline; return pipeline;

View File

@ -72,7 +72,6 @@ namespace dxvk {
* \returns Compute pipeline object * \returns Compute pipeline object
*/ */
Rc<DxvkComputePipeline> createComputePipeline( Rc<DxvkComputePipeline> createComputePipeline(
const Rc<DxvkPipelineCache>& cache,
const Rc<DxvkShader>& cs); const Rc<DxvkShader>& cs);
/** /**
@ -89,7 +88,6 @@ namespace dxvk {
* \returns Graphics pipeline object * \returns Graphics pipeline object
*/ */
Rc<DxvkGraphicsPipeline> createGraphicsPipeline( Rc<DxvkGraphicsPipeline> createGraphicsPipeline(
const Rc<DxvkPipelineCache>& cache,
const Rc<DxvkShader>& vs, const Rc<DxvkShader>& vs,
const Rc<DxvkShader>& tcs, const Rc<DxvkShader>& tcs,
const Rc<DxvkShader>& tes, const Rc<DxvkShader>& tes,
@ -98,7 +96,8 @@ namespace dxvk {
private: private:
const DxvkDevice* m_device; const DxvkDevice* m_device;
const Rc<DxvkPipelineCache> m_cache;
std::mutex m_mutex; std::mutex m_mutex;