mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-01-19 05:52:11 +01:00
[d3d11] Fix hasing of geometry shaders with stream output
The xfb struct contains pointers, but we should hash the strings instead, otherwise the hash changes between runs.
This commit is contained in:
parent
ca717eeb62
commit
f9e56c97cf
@ -676,11 +676,22 @@ namespace dxvk {
|
||||
|
||||
// Compute hash from both the xfb info and the source
|
||||
// code, because both influence the generated code
|
||||
std::array<Sha1Data, 2> chunks = {{
|
||||
{ pShaderBytecode, BytecodeLength },
|
||||
{ &xfb, sizeof(xfb) },
|
||||
DxbcXfbInfo hashXfb = xfb;
|
||||
|
||||
std::vector<Sha1Data> chunks = {{
|
||||
{ pShaderBytecode, BytecodeLength },
|
||||
{ &hashXfb, sizeof(hashXfb) },
|
||||
}};
|
||||
|
||||
for (uint32_t i = 0; i < hashXfb.entryCount; i++) {
|
||||
const char* semantic = hashXfb.entries[i].semanticName;
|
||||
|
||||
if (semantic) {
|
||||
chunks.push_back({ semantic, std::strlen(semantic) });
|
||||
hashXfb.entries[i].semanticName = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
Sha1Hash hash = Sha1Hash::compute(chunks.size(), chunks.data());
|
||||
|
||||
// Create the actual shader module
|
||||
|
Loading…
x
Reference in New Issue
Block a user