Validate buffer view offset on bind groups

This commit is contained in:
Austin Eng
2017-08-17 14:03:14 -04:00
committed by Austin Eng
parent ae48c95306
commit 4086effec0
3 changed files with 112 additions and 0 deletions

View File

@@ -19,6 +19,7 @@
#include "backend/Device.h"
#include "backend/Texture.h"
#include "common/Assert.h"
#include "common/Math.h"
namespace backend {
@@ -130,6 +131,11 @@ namespace backend {
HandleError("Buffer needs to allow the correct usage bit");
return;
}
if (!IsAligned(bufferViews[i]->GetOffset(), 256)) {
HandleError("Buffer view offset for bind group needs to be 256-byte aligned");
return;
}
}
SetBindingsBase(start, count, reinterpret_cast<RefCounted* const *>(bufferViews));