Skip to content

Commit 376c356

Browse files
committed
Add UseMetalTessellation to the hash computing of the shaderKey. And include the materialNetworkShader and materialTag in the hash of the drawItem.
1 parent 14e978d commit 376c356

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

pxr/imaging/hdSt/commandBuffer.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,14 +156,17 @@ _InsertDrawItemInstance(
156156

157157
// The draw item instances in a batch need to have compatible
158158
// pipeline configurations and resource allocations.
159-
// Currently, draw items with distinct geometric shader hashes
160-
// or buffer array hashes can never be part of the same batch.
161-
// We combine these two hashes into a key that can be used to to
159+
// Currently, draw items with distinct geometric shader hashes,
160+
// materialNetwork shader hashes, buffer array hashes or material
161+
// tag hashes can never be part of the same batch.
162+
// We combine these four hashes into a key that can be used to to
162163
// reduce the number of batches which need to be considered
163164
// as candidate batches.
164165
size_t key = TfHash::Combine(
165166
drawItem->GetGeometricShader()->ComputeHash(),
166-
drawItem->GetBufferArraysHash()
167+
drawItem->GetMaterialNetworkShader()->ComputeHash(),
168+
drawItem->GetBufferArraysHash(),
169+
drawItem->GetMaterialTag().Hash()
167170
);
168171

169172
// When we're not allowing texture resource rebinding within a

pxr/imaging/hdSt/shaderKey.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ HdSt_ShaderKey::ComputeHash() const
8787
}
8888
hash = TfHash::Combine(
8989
hash,
90+
UseMetalTessellation(),
9091
GetPolygonMode(),
9192
IsFrustumCullingPass(),
9293
GetLineWidth(),

0 commit comments

Comments
 (0)