mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-06-06 14:43:31 +00:00
Fixes serialization of RenderPassCacheQuery struct.
- Since we were recording everything, the sparse representation caused uninitialized data to be recorded in the cache key causing cache key inequality at times. Bug: dawn:549 Change-Id: I7dc3ea34a7dd91addc7b5ca52c79b3354733966b Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/87609 Reviewed-by: Austin Eng <enga@chromium.org> Commit-Queue: Loko Kung <lokokung@google.com> Kokoro: Kokoro <noreply+kokoro@google.com>
This commit is contained in:
parent
f4a861dd60
commit
7b20709d0e
@ -229,12 +229,21 @@ namespace dawn::native {
|
|||||||
void CacheKeySerializer<vulkan::RenderPassCacheQuery>::Serialize(
|
void CacheKeySerializer<vulkan::RenderPassCacheQuery>::Serialize(
|
||||||
CacheKey* key,
|
CacheKey* key,
|
||||||
const vulkan::RenderPassCacheQuery& t) {
|
const vulkan::RenderPassCacheQuery& t) {
|
||||||
key->Record(t.colorMask.to_ulong(), t.resolveTargetMask.to_ulong())
|
key->Record(t.colorMask.to_ulong(), t.resolveTargetMask.to_ulong(), t.sampleCount);
|
||||||
.RecordIterable(t.colorFormats)
|
|
||||||
.RecordIterable(t.colorLoadOp)
|
// Manually iterate the color attachment indices and their corresponding format/load/store
|
||||||
.RecordIterable(t.colorStoreOp)
|
// ops because the data is sparse and may be uninitialized. Since we record the colorMask
|
||||||
.Record(t.hasDepthStencil, t.depthStencilFormat, t.depthLoadOp, t.depthStoreOp,
|
// member above, recording sparse data should be fine here.
|
||||||
t.stencilLoadOp, t.stencilStoreOp, t.readOnlyDepthStencil, t.sampleCount);
|
for (ColorAttachmentIndex i : IterateBitSet(t.colorMask)) {
|
||||||
|
key->Record(t.colorFormats[i], t.colorLoadOp[i], t.colorStoreOp[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Serialize the depth-stencil toggle bit, and the parameters if applicable.
|
||||||
|
key->Record(t.hasDepthStencil);
|
||||||
|
if (t.hasDepthStencil) {
|
||||||
|
key->Record(t.depthStencilFormat, t.depthLoadOp, t.depthStoreOp, t.stencilLoadOp,
|
||||||
|
t.stencilStoreOp, t.readOnlyDepthStencil);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user