mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-09 13:38:00 +00:00
Implement copying between a buffer and a texture 2D array on Vulkan (#257)
Implement copying between a buffer and a texture 2D array on Vulkan This patch implements the creation of a 2D array texture and data copying between a buffer and a layer of a 2D array texture on Vulkan back-ends. TEST=dawn_end2end_tests
This commit is contained in:
committed by
Corentin Wallez
parent
ec72443bf1
commit
4b74dbef7b
@@ -71,7 +71,7 @@ void initTextures() {
|
||||
|
||||
dawn::Buffer stagingBuffer = utils::CreateBufferFromData(device, data.data(), static_cast<uint32_t>(data.size()), dawn::BufferUsageBit::TransferSrc);
|
||||
dawn::CommandBuffer copy = device.CreateCommandBufferBuilder()
|
||||
.CopyBufferToTexture(stagingBuffer, 0, 0, texture, 0, 0, 0, 1024, 1024, 1, 0)
|
||||
.CopyBufferToTexture(stagingBuffer, 0, 0, texture, 0, 0, 0, 1024, 1024, 1, 0, 0)
|
||||
.GetResult();
|
||||
|
||||
queue.Submit(1, ©);
|
||||
|
||||
@@ -434,7 +434,7 @@ namespace {
|
||||
|
||||
dawn::Buffer staging = utils::CreateBufferFromData(device, data, rowPitch * iImage.height, dawn::BufferUsageBit::TransferSrc);
|
||||
auto cmdbuf = device.CreateCommandBufferBuilder()
|
||||
.CopyBufferToTexture(staging, 0, rowPitch, oTexture, 0, 0, 0, iImage.width, iImage.height, 1, 0)
|
||||
.CopyBufferToTexture(staging, 0, rowPitch, oTexture, 0, 0, 0, iImage.width, iImage.height, 1, 0, 0)
|
||||
.GetResult();
|
||||
queue.Submit(1, &cmdbuf);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user