Skip to content

Commit

Permalink
vulkan: fix texture<->buffer copying when there's an offset into the …
Browse files Browse the repository at this point in the history
…texture
  • Loading branch information
slime73 committed Aug 13, 2024
1 parent ff2f57b commit 8e2fc44
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/modules/graphics/vulkan/Texture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,8 @@ void Texture::copyFromBuffer(graphics::Buffer *source, size_t sourceoffset, int
region.bufferRowLength = sourcewidth;
region.bufferImageHeight = 1;
region.imageSubresource = layers;
region.imageOffset.x = rect.x;
region.imageOffset.y = rect.y;
region.imageExtent.width = static_cast<uint32_t>(rect.w);
region.imageExtent.height = static_cast<uint32_t>(rect.h);

Expand Down Expand Up @@ -648,6 +650,8 @@ void Texture::copyToBuffer(graphics::Buffer *dest, int slice, int mipmap, const
region.bufferRowLength = destwidth;
region.bufferImageHeight = 0;
region.imageSubresource = layers;
region.imageOffset.x = rect.x;
region.imageOffset.y = rect.y;
region.imageExtent.width = static_cast<uint32_t>(rect.w);
region.imageExtent.height = static_cast<uint32_t>(rect.h);
region.imageExtent.depth = 1;
Expand Down

0 comments on commit 8e2fc44

Please sign in to comment.