mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-20 10:25:28 +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
@@ -262,8 +262,8 @@ void CreateDefaultRenderPass(const nxt::Device& device, nxt::RenderPass* renderP
|
||||
|
||||
nxt::Buffer CreateFrozenBufferFromData(const nxt::Device& device, const void* data, uint32_t size, nxt::BufferUsageBit usage) {
|
||||
nxt::Buffer buffer = device.CreateBufferBuilder()
|
||||
.SetAllowedUsage(nxt::BufferUsageBit::Mapped | usage)
|
||||
.SetInitialUsage(nxt::BufferUsageBit::Mapped)
|
||||
.SetAllowedUsage(nxt::BufferUsageBit::MapWrite | usage)
|
||||
.SetInitialUsage(nxt::BufferUsageBit::MapWrite)
|
||||
.SetSize(size)
|
||||
.GetResult();
|
||||
buffer.SetSubData(0, size / sizeof(uint32_t), reinterpret_cast<const uint32_t*>(data));
|
||||
|
||||
Reference in New Issue
Block a user