mirror of
https://github.com/doitsujin/dxvk.git
synced 2024-11-30 04:24:11 +01:00
[dxvk] Rename Dxvk*PipelineKey -> Dxvk*PipelineShaders
This commit is contained in:
parent
70294aac44
commit
604e89b97a
@ -15,6 +15,14 @@ namespace dxvk {
|
||||
class DxvkDevice;
|
||||
class DxvkPipelineManager;
|
||||
|
||||
/**
|
||||
* \brief Shaders used in compute pipelines
|
||||
*/
|
||||
struct DxvkComputePipelineShaders {
|
||||
Rc<DxvkShader> cs;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* \brief Compute pipeline state info
|
||||
*/
|
||||
|
@ -28,6 +28,18 @@ namespace dxvk {
|
||||
using DxvkGraphicsPipelineFlags = Flags<DxvkGraphicsPipelineFlag>;
|
||||
|
||||
|
||||
/**
|
||||
* \brief Shaders used in graphics pipelines
|
||||
*/
|
||||
struct DxvkGraphicsPipelineShaders {
|
||||
Rc<DxvkShader> vs;
|
||||
Rc<DxvkShader> tcs;
|
||||
Rc<DxvkShader> tes;
|
||||
Rc<DxvkShader> gs;
|
||||
Rc<DxvkShader> fs;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* \brief Graphics pipeline state info
|
||||
*
|
||||
|
@ -4,13 +4,13 @@
|
||||
|
||||
namespace dxvk {
|
||||
|
||||
size_t DxvkPipelineKeyHash::operator () (const DxvkComputePipelineKey& key) const {
|
||||
size_t DxvkPipelineKeyHash::operator () (const DxvkComputePipelineShaders& key) const {
|
||||
std::hash<DxvkShader*> hash;
|
||||
return hash(key.cs.ptr());
|
||||
}
|
||||
|
||||
|
||||
size_t DxvkPipelineKeyHash::operator () (const DxvkGraphicsPipelineKey& key) const {
|
||||
size_t DxvkPipelineKeyHash::operator () (const DxvkGraphicsPipelineShaders& key) const {
|
||||
DxvkHashState state;
|
||||
|
||||
std::hash<DxvkShader*> hash;
|
||||
@ -24,15 +24,15 @@ namespace dxvk {
|
||||
|
||||
|
||||
bool DxvkPipelineKeyEq::operator () (
|
||||
const DxvkComputePipelineKey& a,
|
||||
const DxvkComputePipelineKey& b) const {
|
||||
const DxvkComputePipelineShaders& a,
|
||||
const DxvkComputePipelineShaders& b) const {
|
||||
return a.cs == b.cs;
|
||||
}
|
||||
|
||||
|
||||
bool DxvkPipelineKeyEq::operator () (
|
||||
const DxvkGraphicsPipelineKey& a,
|
||||
const DxvkGraphicsPipelineKey& b) const {
|
||||
const DxvkGraphicsPipelineShaders& a,
|
||||
const DxvkGraphicsPipelineShaders& b) const {
|
||||
return a.vs == b.vs && a.tcs == b.tcs
|
||||
&& a.tes == b.tes && a.gs == b.gs
|
||||
&& a.fs == b.fs;
|
||||
@ -63,7 +63,7 @@ namespace dxvk {
|
||||
|
||||
std::lock_guard<std::mutex> lock(m_mutex);
|
||||
|
||||
DxvkComputePipelineKey key;
|
||||
DxvkComputePipelineShaders key;
|
||||
key.cs = cs;
|
||||
|
||||
auto pair = m_computePipelines.find(key);
|
||||
@ -89,7 +89,7 @@ namespace dxvk {
|
||||
|
||||
std::lock_guard<std::mutex> lock(m_mutex);
|
||||
|
||||
DxvkGraphicsPipelineKey key;
|
||||
DxvkGraphicsPipelineShaders key;
|
||||
key.vs = vs;
|
||||
key.tcs = tcs;
|
||||
key.tes = tes;
|
||||
|
@ -21,41 +21,16 @@ namespace dxvk {
|
||||
uint32_t numComputePipelines;
|
||||
};
|
||||
|
||||
/**
|
||||
* \brief Compute pipeline key
|
||||
*
|
||||
* Identifier for a compute pipeline object.
|
||||
* Consists of the compute shader itself.
|
||||
*/
|
||||
struct DxvkComputePipelineKey {
|
||||
Rc<DxvkShader> cs;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* \brief Graphics pipeline key
|
||||
*
|
||||
* Identifier for a graphics pipeline object.
|
||||
* Consists of all graphics pipeline shaders.
|
||||
*/
|
||||
struct DxvkGraphicsPipelineKey {
|
||||
Rc<DxvkShader> vs;
|
||||
Rc<DxvkShader> tcs;
|
||||
Rc<DxvkShader> tes;
|
||||
Rc<DxvkShader> gs;
|
||||
Rc<DxvkShader> fs;
|
||||
};
|
||||
|
||||
|
||||
struct DxvkPipelineKeyHash {
|
||||
size_t operator () (const DxvkComputePipelineKey& key) const;
|
||||
size_t operator () (const DxvkGraphicsPipelineKey& key) const;
|
||||
size_t operator () (const DxvkComputePipelineShaders& key) const;
|
||||
size_t operator () (const DxvkGraphicsPipelineShaders& key) const;
|
||||
};
|
||||
|
||||
|
||||
struct DxvkPipelineKeyEq {
|
||||
bool operator () (const DxvkComputePipelineKey& a, const DxvkComputePipelineKey& b) const;
|
||||
bool operator () (const DxvkGraphicsPipelineKey& a, const DxvkGraphicsPipelineKey& b) const;
|
||||
bool operator () (const DxvkComputePipelineShaders& a, const DxvkComputePipelineShaders& b) const;
|
||||
bool operator () (const DxvkGraphicsPipelineShaders& a, const DxvkGraphicsPipelineShaders& b) const;
|
||||
};
|
||||
|
||||
|
||||
@ -146,13 +121,13 @@ namespace dxvk {
|
||||
std::mutex m_mutex;
|
||||
|
||||
std::unordered_map<
|
||||
DxvkComputePipelineKey,
|
||||
DxvkComputePipelineShaders,
|
||||
Rc<DxvkComputePipeline>,
|
||||
DxvkPipelineKeyHash,
|
||||
DxvkPipelineKeyEq> m_computePipelines;
|
||||
|
||||
std::unordered_map<
|
||||
DxvkGraphicsPipelineKey,
|
||||
DxvkGraphicsPipelineShaders,
|
||||
Rc<DxvkGraphicsPipeline>,
|
||||
DxvkPipelineKeyHash,
|
||||
DxvkPipelineKeyEq> m_graphicsPipelines;
|
||||
|
Loading…
Reference in New Issue
Block a user