mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-14 07:36:15 +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
@@ -165,8 +165,8 @@ void init() {
|
||||
.GetResult();
|
||||
|
||||
cameraBuffer = device.CreateBufferBuilder()
|
||||
.SetAllowedUsage(nxt::BufferUsageBit::Mapped | nxt::BufferUsageBit::Uniform)
|
||||
.SetInitialUsage(nxt::BufferUsageBit::Mapped)
|
||||
.SetAllowedUsage(nxt::BufferUsageBit::MapWrite | nxt::BufferUsageBit::Uniform)
|
||||
.SetInitialUsage(nxt::BufferUsageBit::MapWrite)
|
||||
.SetSize(sizeof(CameraData))
|
||||
.GetResult();
|
||||
|
||||
@@ -265,7 +265,7 @@ void frame() {
|
||||
glm::vec3(0.0f, 1.0f, 0.0f)
|
||||
);
|
||||
|
||||
cameraBuffer.TransitionUsage(nxt::BufferUsageBit::Mapped);
|
||||
cameraBuffer.TransitionUsage(nxt::BufferUsageBit::MapWrite);
|
||||
cameraBuffer.SetSubData(0, sizeof(CameraData) / sizeof(uint32_t), reinterpret_cast<uint32_t*>(&cameraData));
|
||||
|
||||
nxt::CommandBuffer commands = device.CreateCommandBufferBuilder()
|
||||
|
||||
Reference in New Issue
Block a user