Skip to content

Conversation

@zlatinski
Copy link
Contributor

Fix the parameters passed to InitVulkanDecoderDevice() from the applications.

There was a change that added a codec to the InitVulkanDecoderDevice() but did not update all of the clients.

Copy link
Contributor

@srinathkr-nv srinathkr-nv left a comment

Choose a reason for hiding this comment

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

Can you explain the need for all the changes related to DecoderConfig::noPresent, such as the explicit checks against 0 instead of the existing bool-like checks? This will make it different from the handling for all other single-bit fields in DecoderConfig, such as directMode, validate etc.

Also, this change seems to be a regression since 28d581b. If that's accurate, please mention that in the commit message.

Fix the parameters passed to InitVulkanDecoderDevice() from the
applications. This is a regression since 28d581b (28d581b)
where there was a change that added a codec to the InitVulkanDecoderDevice()
but did not update all of the clients.

Also, fix codec extension handling in InitVulkanDecoderDevice

When InitVulkanDecoderDevice is called with a specific codec flag
(e.g., VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR), only that codec's
extension should be required.

Previously, the code used separate 'if' statements which meant all
conditions were evaluated independently. This was incorrect because
the videoCodecs parameter is typically a single codec flag, not a
bitmask of multiple codecs.

- Convert separate 'if' statements to 'else if' chain for mutually
  exclusive codec selection
- Add 'else' branch for when videoCodecs is VK_VIDEO_CODEC_OPERATION_NONE_KHR
  or VIDEO_CODEC_OPERATIONS_ALL (0 or all bits set)
- In the else case, add all codec extensions as OPTIONAL rather than
  required, allowing the device to support whatever codecs are available

This fixes device initialization when the caller doesn't know the
specific codec ahead of time (e.g., auto-detection scenarios).

Signed-off-by: Tony Zlatinski <[email protected]>
@zlatinski zlatinski force-pushed the fix-InitVulkanDecoderDevice branch from 69a0ceb to 2d56c8c Compare December 24, 2025 19:42
@zlatinski
Copy link
Contributor Author

Thank you, for looking at this change!

Can you explain the need for all the changes related to DecoderConfig::noPresent, such as the explicit checks against 0 instead of the existing bool-like checks? This will make it different from the handling for all other single-bit fields in DecoderConfig, such as directMode, validate etc.

There was an issue with the default parameters converting from int bitfiled to integer, which is natural. This was me debugging the issue. I reverted this change.

Also, this change seems to be a regression since 28d581b. If that's accurate, please mention that in the commit message.

I have added the reference to the change that has caused the regression.

@zlatinski zlatinski closed this Dec 24, 2025
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