memory_id = device.get_allocator().allocate(handle, DEVICE_MEMORY);
// Trigger a layout transition if the image is used before uploading data.
- synchronize(-1, VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, true);
+ change_layout(0, -1, VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, true);
}
VkImageViewCreateInfo view_info = { };
throw logic_error("VulkanTexture::generate_mipmap is unimplemented");
}
-void VulkanTexture::synchronize(int layer, unsigned layout, bool discard) const
+void VulkanTexture::change_layout(unsigned n_levels, int level, unsigned layout, bool discard) const
{
unsigned aspect = get_vulkan_aspect(get_components(static_cast<const Texture *>(this)->storage_fmt));
- device.get_synchronizer().access(handle, aspect, layer, layout, discard);
+ if(n_levels>0)
+ device.get_synchronizer().split_image_mipmap(handle, aspect, n_levels);
+ device.get_synchronizer().change_image_layout(handle, aspect, level, layout, discard);
}
void VulkanTexture::set_debug_name(const string &name)