Vulkan: always specify TRANSFER_DST_BIT usage when creating images
This patch adds VK_IMAGE_USAGE_TRANSFER_DST_BIT usage when creating Vulkan images because when we do resource initialization with vkCmdClearColorImage() and vkCmdClearDepthStencilImage(), the image must have been created with VK_IMAGE_USAGE_TRANSFER_DST_BIT usage flag according to Vulkan SPEC. BUG=dawn:171 TEST=dawn_end2end_tests Change-Id: Iaba6c04c6942354cc6be502eeee04457d3f43ba7 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/8100 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Austin Eng <enga@chromium.org> Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
This commit is contained in:
parent
3dc8bf4c6f
commit
87ab2f96d9
|
@ -301,6 +301,11 @@ namespace dawn_native { namespace vulkan {
|
|||
createInfo.flags |= VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT;
|
||||
}
|
||||
|
||||
// We always set VK_IMAGE_USAGE_TRANSFER_DST_BIT unconditionally beause the Vulkan images
|
||||
// that are used in vkCmdClearColorImage() must have been created with this flag, which is
|
||||
// also required for the implementation of robust resource initialization.
|
||||
createInfo.usage |= VK_IMAGE_USAGE_TRANSFER_DST_BIT;
|
||||
|
||||
if (device->fn.CreateImage(device->GetVkDevice(), &createInfo, nullptr, &mHandle) !=
|
||||
VK_SUCCESS) {
|
||||
ASSERT(false);
|
||||
|
|
Loading…
Reference in New Issue