diff --git a/src/dxvk/dxvk_pipemanager.cpp b/src/dxvk/dxvk_pipemanager.cpp index 378bb3d1..b1ddecae 100644 --- a/src/dxvk/dxvk_pipemanager.cpp +++ b/src/dxvk/dxvk_pipemanager.cpp @@ -12,15 +12,18 @@ namespace dxvk { size_t DxvkPipelineKeyHash::operator () (const DxvkGraphicsPipelineShaders& key) const { DxvkHashState state; - - std::hash 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& shader) { + return shader != nullptr ? shader->getHash() : 0; + } bool DxvkPipelineKeyEq::operator () ( diff --git a/src/dxvk/dxvk_pipemanager.h b/src/dxvk/dxvk_pipemanager.h index f0087d15..5820c766 100644 --- a/src/dxvk/dxvk_pipemanager.h +++ b/src/dxvk/dxvk_pipemanager.h @@ -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& shader); };