mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-12 22:56:09 +00:00
Add row pitch to Texture->Buffer and Buffer->Texture copy commands
This commit is contained in:
@@ -630,7 +630,7 @@ namespace backend {
|
||||
copy->size = size;
|
||||
}
|
||||
|
||||
void CommandBufferBuilder::CopyBufferToTexture(BufferBase* buffer, uint32_t bufferOffset,
|
||||
void CommandBufferBuilder::CopyBufferToTexture(BufferBase* buffer, uint32_t bufferOffset, uint32_t rowPitch,
|
||||
TextureBase* texture, uint32_t x, uint32_t y, uint32_t z,
|
||||
uint32_t width, uint32_t height, uint32_t depth, uint32_t level) {
|
||||
CopyBufferToTextureCmd* copy = allocator.Allocate<CopyBufferToTextureCmd>(Command::CopyBufferToTexture);
|
||||
@@ -645,11 +645,12 @@ namespace backend {
|
||||
copy->destination.height = height;
|
||||
copy->destination.depth = depth;
|
||||
copy->destination.level = level;
|
||||
copy->rowPitch = rowPitch;
|
||||
}
|
||||
|
||||
void CommandBufferBuilder::CopyTextureToBuffer(TextureBase* texture, uint32_t x, uint32_t y, uint32_t z,
|
||||
uint32_t width, uint32_t height, uint32_t depth, uint32_t level,
|
||||
BufferBase* buffer, uint32_t bufferOffset) {
|
||||
BufferBase* buffer, uint32_t bufferOffset, uint32_t rowPitch) {
|
||||
CopyTextureToBufferCmd* copy = allocator.Allocate<CopyTextureToBufferCmd>(Command::CopyTextureToBuffer);
|
||||
new(copy) CopyTextureToBufferCmd;
|
||||
copy->source.texture = texture;
|
||||
@@ -662,6 +663,7 @@ namespace backend {
|
||||
copy->source.level = level;
|
||||
copy->destination.buffer = buffer;
|
||||
copy->destination.offset = bufferOffset;
|
||||
copy->rowPitch = rowPitch;
|
||||
}
|
||||
|
||||
void CommandBufferBuilder::Dispatch(uint32_t x, uint32_t y, uint32_t z) {
|
||||
|
||||
@@ -65,12 +65,12 @@ namespace backend {
|
||||
void BeginRenderPass(RenderPassBase* renderPass, FramebufferBase* framebuffer);
|
||||
void BeginRenderSubpass();
|
||||
void CopyBufferToBuffer(BufferBase* source, uint32_t sourceOffset, BufferBase* destination, uint32_t destinationOffset, uint32_t size);
|
||||
void CopyBufferToTexture(BufferBase* buffer, uint32_t bufferOffset,
|
||||
void CopyBufferToTexture(BufferBase* buffer, uint32_t bufferOffset, uint32_t rowPitch,
|
||||
TextureBase* texture, uint32_t x, uint32_t y, uint32_t z,
|
||||
uint32_t width, uint32_t height, uint32_t depth, uint32_t level);
|
||||
void CopyTextureToBuffer(TextureBase* texture, uint32_t x, uint32_t y, uint32_t z,
|
||||
uint32_t width, uint32_t height, uint32_t depth, uint32_t level,
|
||||
BufferBase* buffer, uint32_t bufferOffset);
|
||||
BufferBase* buffer, uint32_t bufferOffset, uint32_t rowPitch);
|
||||
void Dispatch(uint32_t x, uint32_t y, uint32_t z);
|
||||
void DrawArrays(uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance);
|
||||
void DrawElements(uint32_t vertexCount, uint32_t instanceCount, uint32_t firstIndex, uint32_t firstInstance);
|
||||
|
||||
@@ -83,11 +83,13 @@ namespace backend {
|
||||
struct CopyBufferToTextureCmd {
|
||||
BufferCopyLocation source;
|
||||
TextureCopyLocation destination;
|
||||
uint32_t rowPitch;
|
||||
};
|
||||
|
||||
struct CopyTextureToBufferCmd {
|
||||
TextureCopyLocation source;
|
||||
BufferCopyLocation destination;
|
||||
uint32_t rowPitch;
|
||||
};
|
||||
|
||||
struct DispatchCmd {
|
||||
|
||||
Reference in New Issue
Block a user