Fix barrier setting in async compute sample #1213
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
In the async compute sample, when "Enable async queue" is checked in the GUI, the following validation error is output.
Note
If you get output different from the one below when you check the checkbox, the error may not be reproducible in your environment.
Since the sample contains multiple images and command buffers, I added
set_debug_name()
to make the error more understandable, as shown below.This shows that the barrier setting for
color_targets[0]
incompute_post
is incorrect. The code is as follows:Vulkan-Samples/samples/performance/async_compute/async_compute.cpp
Lines 526 to 527 in f7e97a1
In the previous
forward_offscreen_pass
, the layout already transitioned toSHADER_READ_ONLY_OPTIMAL
after drawing. This means that the current code is performing the same image layout transition twice (However, both barriers are required for queue transitions.).Vulkan-Samples/samples/performance/async_compute/async_compute.cpp
Lines 409 to 410 in f7e97a1
So I fixed the
old_layout
setting on thecompute_post
barrier, and the validation errors disappeared. Also, because this sample is complex and hard to debug, I'm leavingset_debug_name()
for future.General Checklist:
Please ensure the following points are checked:
Note: The Samples CI runs a number of checks including: