Validate vertex format for Input State

BUG=chromium:935078, chromium:935026

Change-Id: I9c27cae2a0aa1ec23b8203a4d9b95e1d6d98a868
Reviewed-on: https://dawn-review.googlesource.com/c/5020
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
Yunchao He 2019-02-24 17:32:35 +00:00 committed by Commit Bot service account
parent 87bf834109
commit 83684f9c13
1 changed files with 4 additions and 0 deletions

View File

@ -16,6 +16,7 @@
#include "common/Assert.h"
#include "dawn_native/Device.h"
#include "dawn_native/ValidationUtils_autogen.h"
namespace dawn_native {
@ -135,6 +136,9 @@ namespace dawn_native {
HandleError("Binding slot out of bounds");
return;
}
if (GetDevice()->ConsumedError(ValidateVertexFormat(attribute->format))) {
return;
}
// If attribute->offset is close to 0xFFFFFFFF, the validation below to add
// attribute->offset and VertexFormatSize(attribute->format) might overflow on a
// 32bit machine, then it can pass the validation incorrectly. We need to catch it.