mirror of
https://github.com/vulkano-rs/vulkano.git
synced 2025-02-16 17:12:29 +00:00
Fix wrong start layout in sync layer (#696)
* Fix wrong start layout in sync layer * Fix compilation
This commit is contained in:
parent
cd12580e11
commit
95998d6dc5
@ -527,6 +527,7 @@ impl<P> SyncCommandBufferBuilder<P> {
|
||||
|
||||
Entry::Vacant(entry) => {
|
||||
let mut actually_exclusive = exclusive;
|
||||
let mut actual_start_layout = start_layout;
|
||||
|
||||
// Handle the case when the initial layout requirement of the image is different
|
||||
// from the first layout usage.
|
||||
@ -536,9 +537,11 @@ impl<P> SyncCommandBufferBuilder<P> {
|
||||
{
|
||||
let commands_lock = self.commands.lock().unwrap();
|
||||
let img = commands_lock.commands[latest_command_id].image(resource_index);
|
||||
let initial_layout_requirement = img.initial_layout_requirement();
|
||||
|
||||
if img.initial_layout_requirement() != start_layout {
|
||||
if initial_layout_requirement != start_layout {
|
||||
actually_exclusive = true;
|
||||
actual_start_layout = initial_layout_requirement;
|
||||
|
||||
unsafe {
|
||||
let b = &mut self.pending_barrier;
|
||||
@ -554,7 +557,7 @@ impl<P> SyncCommandBufferBuilder<P> {
|
||||
access,
|
||||
true,
|
||||
None,
|
||||
img.initial_layout_requirement(),
|
||||
initial_layout_requirement,
|
||||
start_layout);
|
||||
}
|
||||
}
|
||||
@ -565,7 +568,7 @@ impl<P> SyncCommandBufferBuilder<P> {
|
||||
access: access,
|
||||
exclusive_any: actually_exclusive,
|
||||
exclusive: actually_exclusive,
|
||||
initial_layout: start_layout,
|
||||
initial_layout: actual_start_layout,
|
||||
current_layout: end_layout, // TODO: what if we reach the end with Undefined? that's not correct?
|
||||
});
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user