mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-10 05:57:51 +00:00
Split Mapped usage in MapWrite and MapRead
Also make use of CreateFrozenBufferFromData where possible in the example to make the renaming easier.
This commit is contained in:
committed by
Corentin Wallez
parent
613eee30c3
commit
f45bdb89c6
@@ -56,8 +56,8 @@ namespace backend {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!(currentUsage & nxt::BufferUsageBit::Mapped)) {
|
||||
device->HandleError("Buffer needs the mapped usage bit");
|
||||
if (!(currentUsage & nxt::BufferUsageBit::MapWrite)) {
|
||||
device->HandleError("Buffer needs the map write usage bit");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -74,6 +74,7 @@ namespace backend {
|
||||
|
||||
bool BufferBase::IsUsagePossible(nxt::BufferUsageBit allowedUsage, nxt::BufferUsageBit usage) {
|
||||
const nxt::BufferUsageBit allReadBits =
|
||||
nxt::BufferUsageBit::MapRead |
|
||||
nxt::BufferUsageBit::TransferSrc |
|
||||
nxt::BufferUsageBit::Index |
|
||||
nxt::BufferUsageBit::Vertex |
|
||||
|
||||
Reference in New Issue
Block a user