Bug 107059 - vkCmdCopyImage - Double Optimize
Summary: vkCmdCopyImage - Double Optimize
Status: RESOLVED INVALID
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/Vulkan/intel (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Intel 3D Bugs Mailing List
QA Contact: Intel 3D Bugs Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-06-28 06:31 UTC by Michael Hübner
Modified: 2018-07-06 20:41 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
Renderdoc - Source Image (2.32 KB, image/png)
2018-06-30 07:55 UTC, Michael Hübner
Details
Renderdoc - Target Image Array (3.52 KB, image/png)
2018-06-30 07:56 UTC, Michael Hübner
Details
Copy example (8.31 KB, text/plain)
2018-06-30 08:00 UTC, Michael Hübner
Details

Description Michael Hübner 2018-06-28 06:31:18 UTC
Hi,

I'm creating my images with a staging buffer with tiling mode VK_IMAGE_TILING_OPTIMAL.
Then I select a set of images, which I try to copy with vkCmdCopyImage to an 2d array of images. Thus the srcImageLayout is optimal tiling and the target too. I think what now happens is that the intel driver tries to optimize it again for the target, which shouldn't happen since the source image is already optimized. 
It works correctly with any other vulkan driver I have tested (Radv, Nvidia (Windows & Linux), AMD (Windows)).
Comment 1 Jason Ekstrand 2018-06-30 03:51:59 UTC
Unfortunately, there is not nearly enough information in this bug report for us to be able to do anything with it.  Could you provide some example code or something that shows off the bug?  Also, please run with the validation layers and ensure that there are no errors.
Comment 2 Michael Hübner 2018-06-30 07:55:37 UTC
Created attachment 140393 [details]
Renderdoc - Source Image

This is the source image. It is already loaded into my application, where I select a few images, which are then assembled to an image array. It is created with VK_IMAGE_TILING_OPTIMAL through an staging buffer and with vkCmdCopyBufferToImage.
Comment 3 Michael Hübner 2018-06-30 07:56:53 UTC
Created attachment 140394 [details]
Renderdoc - Target Image Array

This is the target image array, where the source image is copied to vkCmdCopyImage.
Comment 4 Michael Hübner 2018-06-30 08:00:28 UTC
Created attachment 140395 [details]
Copy example

This is my copy function. It is written in rust, if there are any questions about how things work, just ask them.
Comment 5 Jason Ekstrand 2018-07-06 19:05:21 UTC
Here's your problem:

> command_buffer.set_image_layout(
>     image,
>     VK_IMAGE_LAYOUT_UNDEFINED,
>     VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL,
>     subresource_range.clone(),
> );

The UNDEFINED layout doesn't mean "I don't know", it means "undefined contents".  Transitioning an image from UNDEFINED to anything may discard or corrupt its contents.
Comment 6 Michael Hübner 2018-07-06 20:41:02 UTC
Ah wow, I thought it is more something like "I don't care". Thank you very much. This issue is no issue anymore and can be closed.

Sorry for inconvenience.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.