mirror of
https://github.com/doitsujin/dxvk.git
synced 2024-12-13 07:08:50 +01:00
[dxvk] Simplify pipeline instance data
This commit is contained in:
parent
a72bf02374
commit
2cb9ceba1d
@ -30,7 +30,7 @@ namespace dxvk {
|
||||
|
||||
DxvkComputePipeline::~DxvkComputePipeline() {
|
||||
for (const auto& instance : m_pipelines)
|
||||
this->destroyPipeline(instance.pipeline());
|
||||
this->destroyPipeline(instance.handle);
|
||||
}
|
||||
|
||||
|
||||
@ -60,7 +60,7 @@ namespace dxvk {
|
||||
}
|
||||
}
|
||||
|
||||
return instance->pipeline();
|
||||
return instance->handle;
|
||||
}
|
||||
}
|
||||
|
||||
@ -88,7 +88,7 @@ namespace dxvk {
|
||||
DxvkComputePipelineInstance* DxvkComputePipeline::findInstance(
|
||||
const DxvkComputePipelineStateInfo& state) {
|
||||
for (auto& instance : m_pipelines) {
|
||||
if (instance.isCompatible(state))
|
||||
if (instance.state == state)
|
||||
return &instance;
|
||||
}
|
||||
|
||||
|
@ -39,44 +39,15 @@ namespace dxvk {
|
||||
/**
|
||||
* \brief Compute pipeline instance
|
||||
*/
|
||||
class DxvkComputePipelineInstance {
|
||||
|
||||
public:
|
||||
|
||||
DxvkComputePipelineInstance()
|
||||
: m_stateVector (),
|
||||
m_pipeline (VK_NULL_HANDLE) { }
|
||||
|
||||
struct DxvkComputePipelineInstance {
|
||||
DxvkComputePipelineInstance() { }
|
||||
DxvkComputePipelineInstance(
|
||||
const DxvkComputePipelineStateInfo& state,
|
||||
VkPipeline pipe)
|
||||
: m_stateVector (state),
|
||||
m_pipeline (pipe) { }
|
||||
|
||||
/**
|
||||
* \brief Checks for matching pipeline state
|
||||
*
|
||||
* \param [in] stateVector Graphics pipeline state
|
||||
* \param [in] renderPass Render pass handle
|
||||
* \returns \c true if the specialization is compatible
|
||||
*/
|
||||
bool isCompatible(const DxvkComputePipelineStateInfo& state) const {
|
||||
return m_stateVector == state;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Retrieves pipeline
|
||||
* \returns The pipeline handle
|
||||
*/
|
||||
VkPipeline pipeline() const {
|
||||
return m_pipeline;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
DxvkComputePipelineStateInfo m_stateVector;
|
||||
VkPipeline m_pipeline;
|
||||
const DxvkComputePipelineStateInfo& state_,
|
||||
VkPipeline handle_)
|
||||
: state(state_), handle(handle_) { }
|
||||
|
||||
DxvkComputePipelineStateInfo state;
|
||||
VkPipeline handle = VK_NULL_HANDLE;
|
||||
};
|
||||
|
||||
|
||||
|
@ -493,7 +493,7 @@ namespace dxvk {
|
||||
|
||||
DxvkGraphicsPipeline::~DxvkGraphicsPipeline() {
|
||||
for (const auto& instance : m_pipelines)
|
||||
this->destroyPipeline(instance.pipeline());
|
||||
this->destroyPipeline(instance.handle);
|
||||
}
|
||||
|
||||
|
||||
@ -545,7 +545,7 @@ namespace dxvk {
|
||||
}
|
||||
}
|
||||
|
||||
return instance->pipeline();
|
||||
return instance->handle;
|
||||
}
|
||||
|
||||
|
||||
@ -576,7 +576,7 @@ namespace dxvk {
|
||||
DxvkGraphicsPipelineInstance* DxvkGraphicsPipeline::findInstance(
|
||||
const DxvkGraphicsPipelineStateInfo& state) {
|
||||
for (auto& instance : m_pipelines) {
|
||||
if (instance.isCompatible(state))
|
||||
if (instance.state == state)
|
||||
return &instance;
|
||||
}
|
||||
|
||||
|
@ -236,44 +236,15 @@ namespace dxvk {
|
||||
* Stores a state vector and the
|
||||
* corresponding pipeline handle.
|
||||
*/
|
||||
class DxvkGraphicsPipelineInstance {
|
||||
|
||||
public:
|
||||
|
||||
DxvkGraphicsPipelineInstance()
|
||||
: m_stateVector (),
|
||||
m_pipeline (VK_NULL_HANDLE) { }
|
||||
|
||||
struct DxvkGraphicsPipelineInstance {
|
||||
DxvkGraphicsPipelineInstance() { }
|
||||
DxvkGraphicsPipelineInstance(
|
||||
const DxvkGraphicsPipelineStateInfo& state,
|
||||
VkPipeline pipe)
|
||||
: m_stateVector (state),
|
||||
m_pipeline (pipe) { }
|
||||
|
||||
/**
|
||||
* \brief Checks for matching pipeline state
|
||||
*
|
||||
* \param [in] stateVector Graphics pipeline state
|
||||
* \returns \c true if the specialization is compatible
|
||||
*/
|
||||
bool isCompatible(
|
||||
const DxvkGraphicsPipelineStateInfo& state) {
|
||||
return m_stateVector == state;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Retrieves pipeline
|
||||
* \returns The pipeline handle
|
||||
*/
|
||||
VkPipeline pipeline() const {
|
||||
return m_pipeline;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
DxvkGraphicsPipelineStateInfo m_stateVector;
|
||||
VkPipeline m_pipeline;
|
||||
const DxvkGraphicsPipelineStateInfo& state_,
|
||||
VkPipeline handle_)
|
||||
: state(state_), handle(handle_) { }
|
||||
|
||||
DxvkGraphicsPipelineStateInfo state;
|
||||
VkPipeline handle = VK_NULL_HANDLE;
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user