Skip to content

Improve and fix async compute sample #1366

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

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

iagoCL
Copy link
Contributor

@iagoCL iagoCL commented Jun 25, 2025

Description

This PR adds missing barriers to the async_compute sample as highlighted by #1331. We have also added comments to the code to better explain how the sample works. A few validation synchronization errors have also been fixed.

When looking at this sample I found some problems in the framework that I also fix in this PR:

  • Barriers were actively ignoring old_queue_family and new_queue_family. The async compute sample is the only place using them so I re-enable them and I stop ignoring them. I also renamed them to src_queue_family and dst_queue_family to be closer to the vulkan spec.
  • VKB_VALIDATION_LAYERS_GPU_ASSISTED, VKB_VALIDATION_LAYERS_BEST_PRACTICES and VKB_VALIDATION_LAYERS_SYNCHRONIZATION were being ignored. I use this chance to update how we control the validation layers, replacing VK_EXT_validation_features with VK_EXT_layer_settings. This should close Add sample utilizing VK_EXT_layer_settings #863
  • I noticed that some gltfs have images without a name, this makes more difficult to debug the samples using render doc, so images without a name will use the URI instead.

Tested on Android using a Mali G715 and on Windows using a Nvidia RTX 4070 Super

Fixes #1331 #863

General Checklist:

Please ensure the following points are checked:

  • My code follows the coding style
  • I have reviewed file licenses
  • I have commented any added functions (in line with Doxygen)
  • I have commented any code that could be hard to understand
  • My changes do not add any new compiler warnings
  • My changes do not add any new validation layer errors or warnings
  • I have used existing framework/helper functions where possible
  • My changes do not add any regressions
  • I have tested every sample to ensure everything runs correctly
  • This PR describes the scope and expected impact of the changes I am making

Note: The Samples CI runs a number of checks including:

  • I have updated the header Copyright to reflect the current year (CI build will fail if Copyright is out of date)
  • My changes build on Windows, Linux, macOS and Android. Otherwise I have documented any exceptions

If this PR contains framework changes:

  • I did a full batch run using the batch command line argument to make sure all samples still work properly

Sample Checklist

If your PR contains a new or modified sample, these further checks must be carried out in addition to the General Checklist:

  • I have tested the sample on at least one compliant Vulkan implementation
  • [NA] If the sample is vendor-specific, I have tagged it appropriately
  • I have stated on what implementation the sample has been tested so that others can test on different implementations and platforms
  • [NA] Any dependent assets have been merged and published in downstream modules
  • [NA] For new samples, I have added a paragraph with a summary to the appropriate chapter in the readme of the folder that the sample belongs to e.g. api samples readme
  • [NA] For new samples, I have added a tutorial README.md file to guide users through what they need to know to implement code using this feature. For example, see conditional_rendering
  • [NA] For new samples, I have added a link to the Antora navigation so that the sample will be listed at the Vulkan documentation site

@CLAassistant
Copy link

CLAassistant commented Jun 25, 2025

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

@asuessenbach asuessenbach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great improvement, and very helpful comments in async_compute.cpp!

Just a few comments in the framework part.

gary-sweet
gary-sweet previously approved these changes Jun 30, 2025
Copy link
Contributor

@gary-sweet gary-sweet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am seeing some warning with this sample:

[warning] Render Pass creation: size of attachment list and load/store info list does not match: 1 vs 2
[warning] Render Pass creation: size of attachment list and load/store info list does not match: 1 vs 2

It looks like those existed before your change though.

@iagoCL iagoCL force-pushed the arm/iagocl/async-compute-fix branch from 413fd18 to b542e47 Compare June 30, 2025 10:30
@iagoCL
Copy link
Contributor Author

iagoCL commented Jun 30, 2025

I am seeing some warning with this sample:

[warning] Render Pass creation: size of attachment list and load/store info list does not match: 1 vs 2
[warning] Render Pass creation: size of attachment list and load/store info list does not match: 1 vs 2

It looks like those existed before your change though.

The warning was present before my changes, but I’ve pushed a fix for it.
We could have ignored it, as the default load_store_op behavior was correct. The warning was triggered because the framework default configuration expects two attachments. In this case, the sample only used one attachment. The unused load_store_op was ignored.

Copy link
Contributor

@asuessenbach asuessenbach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Copy link
Contributor

@gary-sweet gary-sweet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@SaschaWillems SaschaWillems self-requested a review July 3, 2025 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Why isn't queue family ownership transferred for blur_chain[1] vkimage in the async compute sample? Add sample utilizing VK_EXT_layer_settings
5 participants