mirror of
https://github.com/doitsujin/dxvk.git
synced 2024-12-01 16:24:12 +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:
parent
47b9fd8b19
commit
37456d583e
@ -8,11 +8,9 @@ namespace dxvk {
|
||||
|
||||
DxvkContext::DxvkContext(
|
||||
const Rc<DxvkDevice>& device,
|
||||
const Rc<DxvkPipelineCache>& pipelineCache,
|
||||
const Rc<DxvkPipelineManager>& pipelineManager,
|
||||
const Rc<DxvkMetaClearObjects>& metaClearObjects)
|
||||
: m_device (device),
|
||||
m_pipeCache (pipelineCache),
|
||||
m_pipeMgr (pipelineManager),
|
||||
m_metaClear (metaClearObjects) { }
|
||||
|
||||
@ -1654,8 +1652,7 @@ namespace dxvk {
|
||||
m_flags.clr(DxvkContextFlag::CpDirtyPipeline);
|
||||
|
||||
m_state.cp.state.bsBindingState.clear();
|
||||
m_state.cp.pipeline = m_pipeMgr->createComputePipeline(
|
||||
m_pipeCache, m_state.cp.cs.shader);
|
||||
m_state.cp.pipeline = m_pipeMgr->createComputePipeline(m_state.cp.cs.shader);
|
||||
|
||||
if (m_state.cp.pipeline != nullptr)
|
||||
m_cmd->trackResource(m_state.cp.pipeline);
|
||||
@ -1686,7 +1683,7 @@ namespace dxvk {
|
||||
|
||||
m_state.gp.state.bsBindingState.clear();
|
||||
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.gs.shader, m_state.gp.fs.shader);
|
||||
|
||||
|
@ -29,7 +29,6 @@ namespace dxvk {
|
||||
|
||||
DxvkContext(
|
||||
const Rc<DxvkDevice>& device,
|
||||
const Rc<DxvkPipelineCache>& pipelineCache,
|
||||
const Rc<DxvkPipelineManager>& pipelineManager,
|
||||
const Rc<DxvkMetaClearObjects>& metaClearObjects);
|
||||
~DxvkContext();
|
||||
@ -620,7 +619,6 @@ namespace dxvk {
|
||||
private:
|
||||
|
||||
const Rc<DxvkDevice> m_device;
|
||||
const Rc<DxvkPipelineCache> m_pipeCache;
|
||||
const Rc<DxvkPipelineManager> m_pipeMgr;
|
||||
const Rc<DxvkMetaClearObjects> m_metaClear;
|
||||
|
||||
|
@ -15,7 +15,6 @@ namespace dxvk {
|
||||
m_properties (adapter->deviceProperties()),
|
||||
m_memory (new DxvkMemoryAllocator (adapter, vkd)),
|
||||
m_renderPassPool (new DxvkRenderPassPool (vkd)),
|
||||
m_pipelineCache (new DxvkPipelineCache (vkd)),
|
||||
m_pipelineManager (new DxvkPipelineManager (this)),
|
||||
m_metaClearObjects(new DxvkMetaClearObjects (vkd)),
|
||||
m_unboundResources(this),
|
||||
@ -106,7 +105,6 @@ namespace dxvk {
|
||||
|
||||
Rc<DxvkContext> DxvkDevice::createContext() {
|
||||
return new DxvkContext(this,
|
||||
m_pipelineCache,
|
||||
m_pipelineManager,
|
||||
m_metaClearObjects);
|
||||
}
|
||||
|
@ -354,7 +354,6 @@ namespace dxvk {
|
||||
|
||||
Rc<DxvkMemoryAllocator> m_memory;
|
||||
Rc<DxvkRenderPassPool> m_renderPassPool;
|
||||
Rc<DxvkPipelineCache> m_pipelineCache;
|
||||
Rc<DxvkPipelineManager> m_pipelineManager;
|
||||
Rc<DxvkMetaClearObjects> m_metaClearObjects;
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
#include "dxvk_device.h"
|
||||
#include "dxvk_pipemanager.h"
|
||||
|
||||
namespace dxvk {
|
||||
@ -38,7 +39,7 @@ namespace dxvk {
|
||||
|
||||
|
||||
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(
|
||||
const Rc<DxvkPipelineCache>& cache,
|
||||
const Rc<DxvkShader>& cs) {
|
||||
if (cs == nullptr)
|
||||
return nullptr;
|
||||
@ -64,7 +64,7 @@ namespace dxvk {
|
||||
return pair->second;
|
||||
|
||||
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));
|
||||
return pipeline;
|
||||
@ -72,7 +72,6 @@ namespace dxvk {
|
||||
|
||||
|
||||
Rc<DxvkGraphicsPipeline> DxvkPipelineManager::createGraphicsPipeline(
|
||||
const Rc<DxvkPipelineCache>& cache,
|
||||
const Rc<DxvkShader>& vs,
|
||||
const Rc<DxvkShader>& tcs,
|
||||
const Rc<DxvkShader>& tes,
|
||||
@ -95,7 +94,7 @@ namespace dxvk {
|
||||
return pair->second;
|
||||
|
||||
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));
|
||||
return pipeline;
|
||||
|
@ -72,7 +72,6 @@ namespace dxvk {
|
||||
* \returns Compute pipeline object
|
||||
*/
|
||||
Rc<DxvkComputePipeline> createComputePipeline(
|
||||
const Rc<DxvkPipelineCache>& cache,
|
||||
const Rc<DxvkShader>& cs);
|
||||
|
||||
/**
|
||||
@ -89,7 +88,6 @@ namespace dxvk {
|
||||
* \returns Graphics pipeline object
|
||||
*/
|
||||
Rc<DxvkGraphicsPipeline> createGraphicsPipeline(
|
||||
const Rc<DxvkPipelineCache>& cache,
|
||||
const Rc<DxvkShader>& vs,
|
||||
const Rc<DxvkShader>& tcs,
|
||||
const Rc<DxvkShader>& tes,
|
||||
@ -98,7 +96,8 @@ namespace dxvk {
|
||||
|
||||
private:
|
||||
|
||||
const DxvkDevice* m_device;
|
||||
const DxvkDevice* m_device;
|
||||
const Rc<DxvkPipelineCache> m_cache;
|
||||
|
||||
std::mutex m_mutex;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user