]> git.tdb.fi Git - libs/gl.git/blobdiff - source/backends/vulkan/texture2d_backend.cpp
Convert RGB pixel data to RGBA when staging
[libs/gl.git] / source / backends / vulkan / texture2d_backend.cpp
index e40dfe4fedf3003287503f195f4b2426cc86cd37..3b94e766dc21ff4be2ec2b88ad4c49d7d5c7c1bf 100644 (file)
@@ -50,8 +50,7 @@ void VulkanTexture2D::sub_image(unsigned level, int x, int y, unsigned wd, unsig
                        vk.CmdCopyBufferToImage(cmd_buf, staging_buf, handle, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, 1, &region);
                });
 
-       const char *src = static_cast<const char *>(data);
-       copy(src, src+data_size, static_cast<char *>(staging));
+       stage_pixels(staging, data, wd*ht);
 }
 
 void VulkanTexture2D::generate_mipmap()