Skip to content

Vulkan decoder fixes#200

Merged
zlatinski merged 2 commits intomainfrom
vulkan-decoder-fixes
Feb 11, 2026
Merged

Vulkan decoder fixes#200
zlatinski merged 2 commits intomainfrom
vulkan-decoder-fixes

Conversation

@zlatinski
Copy link
Contributor

Fix a regression from the previews validation layer fixes that renders the display frames blank
Has a profile fallback for malformed bitstreams.

Revert the SAMPLED_BIT stripping from combined multi-planar image views
introduced in commit 7f90998 ("Fix VE: Exclude SAMPLED_BIT from
multi-planar combined views without YCbCr").

The original fix went too far: it stripped VK_IMAGE_USAGE_SAMPLED_BIT
from combined views of multi-planar YCbCr images. But the decoder's
display pipeline uses the combined view WITH a VkSamplerYcbcrConversion
object for sampling decoded frames during rendering. Without SAMPLED_BIT,
the view cannot be sampled and the display shows a blank/black screen.

The correct behavior:
- STORAGE_BIT: Strip from combined views (multi-planar formats don't
  support storage operations -- only per-plane R8/RG8 views do)
- SAMPLED_BIT: Keep on combined views. The decoder's display path creates
  a VkSamplerYcbcrConversion for multi-planar sampling, satisfying
  VUID-VkImageViewCreateInfo-format-06415. The encoder path that doesn't
  use YCbCr conversion skips the combined view entirely (skipCombinedView)

Bisected-from: 7f90998
Ref: https://gitlab.khronos.org/vulkan/vulkan/-/issues/4624
Signed-off-by: Tony Zlatinski <tzlatinski@nvidia.com>
When vkGetPhysicalDeviceVideoCapabilitiesKHR fails for the reported
H.264 profile, automatically retry with higher profiles (Baseline →
Main → High). This handles streams mis-tagged as Baseline that use
features requiring Main or High (e.g., interlaced content, CABAC,
B-slices, weighted prediction).

H.264 Baseline profile doesn't support interlaced video, but some
encoders/muxers incorrectly tag interlaced streams as Baseline. The
driver correctly rejects Baseline for such content with
VK_ERROR_VIDEO_PROFILE_OPERATION_NOT_SUPPORTED_KHR. Upgrading to
Main (or High) resolves this since they are strict supersets.
This matches NVCUVID/CUVID behavior which always uses the highest
compatible profile.

The upgrade path tries Main first, then High. A warning is printed
when an upgrade occurs so users can identify mis-tagged streams.

Fixes: Assert failure on 1080i-25-H264.mkv (interlaced Baseline)
Signed-off-by: Tony Zlatinski <tzlatinski@nvidia.com>
@zlatinski zlatinski merged commit 01dfa09 into main Feb 11, 2026
1 of 5 checks passed
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.

1 participant