X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fbackends%2Fvulkan%2Ftexture2d_backend.cpp;h=d1bb74f55415c8f916577c36c5f2a1f237e29129;hb=c585c065b7831eb6ae05e48edc36953d2534db2b;hp=7c6b55f1ee94dfb0652ef76ea8adb7e75675fbbf;hpb=c218e021ede4e91c0fbc22ea9d636283409f847f;p=libs%2Fgl.git diff --git a/source/backends/vulkan/texture2d_backend.cpp b/source/backends/vulkan/texture2d_backend.cpp index 7c6b55f1..d1bb74f5 100644 --- a/source/backends/vulkan/texture2d_backend.cpp +++ b/source/backends/vulkan/texture2d_backend.cpp @@ -40,11 +40,6 @@ void VulkanTexture2D::fill_mipmap_blit(unsigned level, void *b) blit.dstOffsets[1] = { static_cast(dst_size.x), static_cast(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, ®ion); + vkCmd.CopyBufferToImage(staging_buf, tex.handle, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, 1, ®ion); }); }