-
Notifications
You must be signed in to change notification settings - Fork 434
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't execute command on swapchain image #977
Comments
Per design, the AutoCommandBufferBuilder is supposed to automatically handle pipeline barriers for you. |
Any updates on this? |
Or put differently: How can I initialize a swapchain image? I'd like to render a stream from my webcam after processing it with a compute shader straight to a window. Missing the straight to a window part, but I guess I can copy it back to ram and then push it through a graphics pipeline with the framebuffer/renderpass stuff |
Just want to add that I'm running into this exact issue - specifically, using an I can verify that something to do with #974 seems very similar, though runs into the issue with a Both the @realitix did you ever work out a solution? I noticed you mentioned you were going to try the solution mentioned in #974, any luck? |
Memory barrier image layouts seem OKMemory barriers are inserted via the
The first call is a barrier with layout transition from Actual
|
It looks like grep -nr undefined_layout ./vulkano/src/ shows that it can never be changed from this. The only other time the field seems to get read is within the This leads me to believe that the source of the problem is either:
Will do some investigating into this. |
Upon `Swapchain::new_inner`, `ImageEntry`s are created for each image with their `undefined_layout` field set to `true`. Once set, this field is never altered within the vulkano codebase. The only time it is used following initialisation is when it is read during calls to `SwapchainAcquireFuture::check_image_access`. For reference, the case in which I am hitting this method is when attempting to execute a command buffer that clears a swapchain image using `clear_color_image`. If the `undefined_layout` field is `true` and the swapchain image layout is not `Undefined`, the `check_image_access` function returns an error. [See here](https://docs.rs/vulkano/0.11.1/src/vulkano/swapchain/swapchain.rs.html#828-835). This is a problem as the implementation of `ImageAccess::initial_layout_requirement` and `ImageAccess::final_layout_requirement` both return `ImageLayout::PresentSrc` which implies to me that by the time the command buffer is executed the swapchain image layout *must* be `PresentSrc` (the call to `add_image_memory_barrier` within `SyncCommandBufferBuilder::build` [ensures this](https://docs.rs/vulkano/0.11.1/src/vulkano/command_buffer/synced/base.rs.html#720)) and in turn, this error condition will always be true. In this PR I remove the unused `undefined_layout` field as well as the error condition that does not seem to make sense and as a result my downstream project seems to work fine. However, it is more than likely that there is some special case that @tomaka intended to cover here and that there is a better, proper solution that involves checking that swapchain image layouts are actually initially `PresentSrc` (and not `Undefined`) and only then setting the `undefined_layout` field to `false`. @tomaka could you share your thoughts on this briefly? I'm happy to dive in and do a proper fix if there is indeed some case you had in mind here that I'm overlooking. Eventually, this should close vulkano-rs#977.
As mentioned by @tomaka on vulkano-rs#1117, swapchain images have an undefined image layout upon creation. This change aims to reflect this, in turn ensuring that the `add_image_memory_barrier` inserts the correct layout transitions. I believe this closes vulkano-rs#977.
@mitchmindtree Thanks for your investigation. |
As mentioned by @tomaka on vulkano-rs#1117, swapchain images have an undefined image layout upon creation. This change aims to reflect this, in turn ensuring that the `add_image_memory_barrier` inserts the correct layout transitions. I believe this closes vulkano-rs#977.
As mentioned by @tomaka on vulkano-rs#1117, swapchain images have an undefined image layout upon creation. This change aims to reflect this, in turn ensuring that the `add_image_memory_barrier` inserts the correct layout transitions. I believe this closes vulkano-rs#977.
As mentioned by @tomaka on vulkano-rs#1117, swapchain images have an undefined image layout upon creation. This change aims to reflect this, in turn ensuring that the `add_image_memory_barrier` inserts the correct layout transitions. I believe this closes vulkano-rs#977.
As mentioned by @tomaka on vulkano-rs#1117, swapchain images have an undefined image layout upon creation. This change aims to reflect this, in turn ensuring that the `add_image_memory_barrier` inserts the correct layout transitions. I believe this closes vulkano-rs#977.
As mentioned by @tomaka on vulkano-rs#1117, swapchain images have an undefined image layout upon creation. This change aims to reflect this, in turn ensuring that the `add_image_memory_barrier` inserts the correct layout transitions. I believe this closes vulkano-rs#977.
As mentioned by @tomaka on vulkano-rs#1117, swapchain images have an undefined image layout upon creation. This change aims to reflect this, in turn ensuring that the `add_image_memory_barrier` inserts the correct layout transitions. I believe this closes vulkano-rs#977.
As mentioned by @tomaka on vulkano-rs#1117, swapchain images have an undefined image layout upon creation. This change aims to reflect this, in turn ensuring that the `add_image_memory_barrier` inserts the correct layout transitions. I believe this closes vulkano-rs#977.
Hello,
When I try to execute a command directly on a swapchain image, I got a layout error:
With a command like this one:
I got the same error with the
clear_color_image
command.I searched in the API but I can't find a way to manually update the layout. Why the
AutoCommandBufferBuilder
doesn't expose thevkCmdPipelineBarrier
function ?Thanks,
JS
The text was updated successfully, but these errors were encountered: