mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-13 15:16:16 +00:00
Validate buffer view offset on bind groups
This commit is contained in:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user