mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-14 07:36:15 +00:00
Update usage of CopyBufferToTexture and CopyTextureToBuffer to include row pitch
This commit is contained in:
@@ -378,7 +378,7 @@ namespace {
|
||||
nxt::Buffer staging = utils::CreateFrozenBufferFromData(device, &white, sizeof(white), nxt::BufferUsageBit::TransferSrc);
|
||||
auto cmdbuf = device.CreateCommandBufferBuilder()
|
||||
.TransitionTextureUsage(oTexture, nxt::TextureUsageBit::TransferDst)
|
||||
.CopyBufferToTexture(staging, 0, oTexture, 0, 0, 0, 1, 1, 1, 0)
|
||||
.CopyBufferToTexture(staging, 0, 0, oTexture, 0, 0, 0, 1, 1, 1, 0)
|
||||
.GetResult();
|
||||
queue.Submit(1, &cmdbuf);
|
||||
oTexture.FreezeUsage(nxt::TextureUsageBit::Sampled);
|
||||
@@ -432,7 +432,7 @@ namespace {
|
||||
nxt::Buffer staging = utils::CreateFrozenBufferFromData(device, data, numPixels * 4, nxt::BufferUsageBit::TransferSrc);
|
||||
auto cmdbuf = device.CreateCommandBufferBuilder()
|
||||
.TransitionTextureUsage(oTexture, nxt::TextureUsageBit::TransferDst)
|
||||
.CopyBufferToTexture(staging, 0, oTexture, 0, 0, 0, iImage.width, iImage.height, 1, 0)
|
||||
.CopyBufferToTexture(staging, 0, 0, oTexture, 0, 0, 0, iImage.width, iImage.height, 1, 0)
|
||||
.GetResult();
|
||||
queue.Submit(1, &cmdbuf);
|
||||
oTexture.FreezeUsage(nxt::TextureUsageBit::Sampled);
|
||||
|
||||
Reference in New Issue
Block a user