Add query availability tracking in render pass encoder

The same query cannot be written twice in same render pass, so each
render pass also need to have its own query availability map.

Update timestamp query to only check the same query overwrite in same
render pass.

Bug: dawn:434
Change-Id: Icb070adf79a3d76c25367675f7432666eb0dd84f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/31180
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Hao Li <hao.x.li@intel.com>
This commit is contained in:
Hao Li
2020-11-16 02:24:06 +00:00
committed by Commit Bot service account
parent aabde6c88f
commit 575729e8dd
8 changed files with 91 additions and 86 deletions

View File

@@ -114,12 +114,10 @@ namespace dawn_native {
mEncodingContext->TryEncode(this, [&](CommandAllocator* allocator) -> MaybeError {
if (GetDevice()->IsValidationEnabled()) {
DAWN_TRY(GetDevice()->ValidateObject(querySet));
DAWN_TRY(ValidateTimestampQuery(querySet, queryIndex,
mCommandEncoder->GetUsedQueryIndices()));
mCommandEncoder->TrackUsedQuerySet(querySet);
DAWN_TRY(ValidateTimestampQuery(querySet, queryIndex));
}
mCommandEncoder->TrackUsedQueryIndex(querySet, queryIndex);
mCommandEncoder->TrackQueryAvailability(querySet, queryIndex);
WriteTimestampCmd* cmd =
allocator->Allocate<WriteTimestampCmd>(Command::WriteTimestamp);