1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-11-29 19:24:10 +01:00

[dxvk] Use new shader lookup hash in pipeline manager

This commit is contained in:
Philip Rebohle 2019-09-30 02:08:38 +02:00
parent 5115a42b08
commit ba5f319809
2 changed files with 11 additions and 7 deletions

View File

@ -12,15 +12,18 @@ namespace dxvk {
size_t DxvkPipelineKeyHash::operator () (const DxvkGraphicsPipelineShaders& key) const {
DxvkHashState state;
std::hash<DxvkShader*> hash;
state.add(hash(key.vs.ptr()));
state.add(hash(key.tcs.ptr()));
state.add(hash(key.tes.ptr()));
state.add(hash(key.gs.ptr()));
state.add(hash(key.fs.ptr()));
state.add(getShaderHash(key.vs));
state.add(getShaderHash(key.tcs));
state.add(getShaderHash(key.tes));
state.add(getShaderHash(key.gs));
state.add(getShaderHash(key.fs));
return state;
}
size_t DxvkPipelineKeyHash::getShaderHash(const Rc<DxvkShader>& shader) {
return shader != nullptr ? shader->getHash() : 0;
}
bool DxvkPipelineKeyEq::operator () (

View File

@ -26,6 +26,7 @@ namespace dxvk {
struct DxvkPipelineKeyHash {
size_t operator () (const DxvkComputePipelineShaders& key) const;
size_t operator () (const DxvkGraphicsPipelineShaders& key) const;
static size_t getShaderHash(const Rc<DxvkShader>& shader);
};