Fix incorrect validation error in CommandBufferStateTracker

If we are missing pipeline in render or compute pass, it always reports
that we are missing vertex buffers or bind groups for render and compute
pass respectively.

Bug: dawn:359

Change-Id: I5550e55fcc9f29c0f2fb71462def836061038add
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/20784
Commit-Queue: Yunchao He <yunchao.he@intel.com>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
This commit is contained in:
Yunchao He 2020-05-04 06:05:47 +00:00 committed by Commit Bot service account
parent ccc40f6ffa
commit 798cefb78d
2 changed files with 7 additions and 10 deletions

View File

@ -69,16 +69,11 @@ namespace dawn_native {
// Generate an error immediately if a non-lazy aspect is missing as computing lazy aspects
// requires the pipeline to be set.
if ((missingAspects & ~kLazyAspects).any()) {
return GenerateAspectError(missingAspects);
}
DAWN_TRY(CheckMissingAspects(missingAspects & ~kLazyAspects));
RecomputeLazyAspects(missingAspects);
missingAspects = requiredAspects & ~mAspects;
if (missingAspects.any()) {
return GenerateAspectError(missingAspects);
}
DAWN_TRY(CheckMissingAspects(requiredAspects & ~mAspects));
return {};
}
@ -114,8 +109,10 @@ namespace dawn_native {
}
}
MaybeError CommandBufferStateTracker::GenerateAspectError(ValidationAspects aspects) {
ASSERT(aspects.any());
MaybeError CommandBufferStateTracker::CheckMissingAspects(ValidationAspects aspects) {
if (!aspects.any()) {
return {};
}
if (aspects[VALIDATION_ASPECT_INDEX_BUFFER]) {
return DAWN_VALIDATION_ERROR("Missing index buffer");

View File

@ -46,7 +46,7 @@ namespace dawn_native {
private:
MaybeError ValidateOperation(ValidationAspects requiredAspects);
void RecomputeLazyAspects(ValidationAspects aspects);
MaybeError GenerateAspectError(ValidationAspects aspects);
MaybeError CheckMissingAspects(ValidationAspects aspects);
void SetPipelineCommon(PipelineBase* pipeline);