Skip to content

Fix wrong reset of command buffers in sample fragment_shading_rate_dynamic.#992

Merged
marty-johnson59 merged 1 commit intoKhronosGroup:mainfrom
asuessenbach:fragment_shading_rate_dynamic
Mar 26, 2024
Merged

Fix wrong reset of command buffers in sample fragment_shading_rate_dynamic.#992
marty-johnson59 merged 1 commit intoKhronosGroup:mainfrom
asuessenbach:fragment_shading_rate_dynamic

Conversation

@asuessenbach
Copy link
Copy Markdown
Contributor

@asuessenbach asuessenbach commented Mar 19, 2024

Description

Without this fix, I got the following validation layer error when running the fragment_shading_rate_dynamic sample:

Validation Error: [ VUID-vkQueueSubmit-pCommandBuffers-00070 ] Object 0: handle = 0x223ba20f060, type = VK_OBJECT_TYPE_COMMAND_BUFFER; | MessageID = 0xaeecdc0b | vkQueueSubmit(): pSubmits[0].pCommandBuffers[0] VkCommandBuffer 0x223ba20f060[] is unrecorded and contains no commands. The Vulkan spec states: Each element of the pCommandBuffers member of each element of pSubmits must be in the pending or executable state (https://vulkan.lunarg.com/doc/view/1.3.275.0/windows/1.3-extensions/vkspec.html#VUID-vkQueueSubmit-pCommandBuffers-00070)

The reason was, that the call to vkResetCommandPool not only reset the small_command_buffers, but also the compute_buffer[].command_buffers.

Creating the command_pool with VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT and resetting the small_command_buffers by calls to vkResetCommandBuffer resolves that error.

Build tested on Win10 with VS2022. Run tested on Win10 with NVidia GPU.

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

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
  • 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
  • Any dependent assets have been merged and published in downstream modules
  • 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
  • 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
  • For new samples, I have added a link to the Antora navigation so that the sample will be listed at the Vulkan documentation site

@asuessenbach asuessenbach marked this pull request as ready for review March 20, 2024 07:02
@asuessenbach asuessenbach requested review from a team and gpx1000 March 20, 2024 07:02
@SaschaWillems SaschaWillems self-requested a review March 21, 2024 16:19
@SaschaWillems
Copy link
Copy Markdown
Collaborator

@marty-johnson59 : Can we merge this? The sample fixed by this PR will currently crash, at least if one tries to run it with validation.

@marty-johnson59
Copy link
Copy Markdown
Contributor

Yep, will do. LMK if issues.

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.

3 participants