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:
Corentin Wallez
2017-06-05 15:42:14 -04:00
committed by Corentin Wallez
parent 613eee30c3
commit f45bdb89c6
13 changed files with 35 additions and 138 deletions

View File

@@ -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 |