]> git.tdb.fi Git - libs/gl.git/blobdiff - source/backends/vulkan/texture2d_backend.cpp
Check the flat qualifier from the correct member
[libs/gl.git] / source / backends / vulkan / texture2d_backend.cpp
index 7c6b55f1ee94dfb0652ef76ea8adb7e75675fbbf..d1bb74f55415c8f916577c36c5f2a1f237e29129 100644 (file)
@@ -40,11 +40,6 @@ void VulkanTexture2D::fill_mipmap_blit(unsigned level, void *b)
        blit.dstOffsets[1] = { static_cast<int>(dst_size.x), static_cast<int>(dst_size.y), 1 };
 }
 
-Resource::AsyncLoader *VulkanTexture2D::load(IO::Seekable &, const Resources *)
-{
-       throw logic_error("Texture2D::load is unimplemented");
-}
-
 uint64_t VulkanTexture2D::get_data_size() const
 {
        return 0;
@@ -74,9 +69,7 @@ void *VulkanTexture2D::AsyncTransfer::allocate()
                [&tex, level, discard](){
                        tex.change_layout(level, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, discard);
                },
-               [&tex, level, x, y, wd, ht](VkCommandBuffer cmd_buf, VkBuffer staging_buf, size_t src_off){
-                       const VulkanFunctions &vk = tex.device.get_functions();
-
+               [&tex, level, x, y, wd, ht](const VulkanCommandRecorder &vkCmd, VkBuffer staging_buf, size_t src_off){
                        VkBufferImageCopy region = { };
                        region.bufferOffset = src_off;
                        region.imageSubresource.aspectMask = get_vulkan_aspect(get_components(tex.storage_fmt));
@@ -85,7 +78,7 @@ void *VulkanTexture2D::AsyncTransfer::allocate()
                        region.imageSubresource.layerCount = 1;
                        region.imageOffset = { x, y, 0 };
                        region.imageExtent = { wd, ht, 1 };
-                       vk.CmdCopyBufferToImage(cmd_buf, staging_buf, tex.handle, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, 1, &region);
+                       vkCmd.CopyBufferToImage(staging_buf, tex.handle, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, 1, &region);
                });
 }