VVL: Fix issues for qpmap and intra refresh#211
Merged
dabrain34 merged 6 commits intoJun 16, 2026
Conversation
srinathkr-nv
suggested changes
Jun 13, 2026
0f6bffc to
d630a43
Compare
srinathkr-nv
approved these changes
Jun 15, 2026
Mirror the existing encode_h264_qpmap entry: same 352x288 source YUV and delta-QP map file, with codec/profile adjusted. Drivers lacking the quantization-map capability still report N/S.
The encoder set the quantization-map session-create flag VK_VIDEO_SESSION_CREATE_ALLOW_ENCODE_QUANTIZATION_DELTA_MAP_BIT_KHR without enabling VK_KHR_video_encode_quantization_map, tripping VUID-VkVideoSessionCreateInfoKHR-flags-parameter. Match the CTS setup (vktCustomInstancesDevices.cpp createDeviceSupportingQueue): - Add VK_KHR_VIDEO_ENCODE_QUANTIZATION_MAP_EXTENSION_NAME to the optional device extensions in both encoder entry points. - Chain VkPhysicalDeviceVideoEncodeQuantizationMapFeaturesKHR into the feature pNext list in VulkanDeviceContext::CreateVulkanDevice so the device is created with videoEncodeQuantizationMap = VK_TRUE when supported. - Drop the spurious encodeSessionParametersCreateInfo->flags = 0 in the H.264 encoder that was clobbering QUANTIZATION_MAP_COMPATIBLE_BIT_KHR set by VideoSessionParametersInfo (the H.265 / AV1 helpers already set it). - In VkVideoEncoder::InitEncoder, when --qpMap is requested but the extension is not enabled on the device, return VK_ERROR_FEATURE_NOT_PRESENT so the test framework reports N/S. Verified on hardware: encode_h264_qpmap passes with --validate clean.
Mirror the existing encode_h264_intrarefresh entry for H.265 and AV1, with the same picpartition mode and cycle duration of 30. Implementations lacking the corresponding intra-refresh capability report N/S.
…efreshMode The encoder set VK_VIDEO_ENCODE_INTRA_REFRESH_BIT_KHR on VkVideoEncodeInfoKHR.flags without enabling VK_KHR_video_encode_intra_refresh, tripping VUID-VkVideoEncodeInfoKHR-flags-parameter. Add VK_KHR_VIDEO_ENCODE_INTRA_REFRESH_EXTENSION_NAME to the optional device extensions in both encoder entry points (the feature struct was already chained in VulkanDeviceContext), and require both the extension and the feature in the InitEncoder N/S guard so drivers lacking either report unsupported cleanly instead of tripping the layer.
…refresh (H264+H265) VUID-vkCmdEncodeVideoKHR-pEncodeInfo-10846 (H264) and -10852 (H265) require naluSliceEntryCount / naluSliceSegmentEntryCount == intraRefreshCycleDuration on intra-refresh frames when the session was created with PER_PICTURE_PARTITION mode. The encoder set the slice count to the configured sliceCount (default 1) and never derived it from the cycle duration, so every PER_PARTITION intra-refresh frame tripped the layer. Three pieces were missing: - The cycle duration was not constrained by the picture geometry. In PER_PARTITION mode each partition is one slice row, so the maximum usable duration is height / 16 for H264 (macroblocks) or height / 64 for H265 (CTUs). VkVideoEncoder::InitEncoder now clamps intraRefreshCycleDuration to that maximum when the driver does not advertise nonRectangularIntraRefreshRegions. - Even after the geometry clamp, the duration can still exceed the codec's maxSliceCount / maxSliceSegmentCount. Each codec's InitEncoderCodec now bails out with VK_ERROR_FEATURE_NOT_PRESENT in that case so the test reports N/S instead of submitting a request the driver cannot honour. - naluSliceEntryCount / naluSliceSegmentEntryCount was hard-coded to m_encoderConfig->sliceCount in EncodeFrame. ProcessDpb now sets it to intraRefreshCycleDuration on PER_PARTITION intra-refresh frames, and the late unconditional assignments in EncodeFrame are removed.
…tersInfoH265 Mirror the H.264 helper: wrap the VPS/SPS/PPS add info, the H.265 session- parameters create info, the quality-level info and the session-parameters create info into a single object set up at construction. When enableQpMap is true, chain VkVideoEncodeQuantizationMapSessionParametersCreateInfoKHR onto qualityLevelInfo and set QUANTIZATION_MAP_COMPATIBLE_BIT_KHR on VkVideoSessionParametersCreateInfoKHR.flags (fixes VUID-vkCmdEncodeVideoKHR-pNext-10315 in the --qpMap path). InitEncoderCodec switches to a single helper instantiation, matching H.264.
d630a43 to
73bdfd5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
First various VVL issues related to QpMap and IntraRefresh extensions enablement.
Type of change
VVL bug fix
Issue (optional)
Tests
Intel(R) Iris(R) Xe Graphics (ADL GT2) / Intel open-source Mesa driver Mesa 26.1.2 (git-c653d1509f) / Ubuntu 24.04.4 LTS
Total Tests: 54
Passed: 47
Crashed: 0
Failed: 0
Not Supported: 4
Skipped: 3 (in skip list)
Success Rate: 100.0%
NVIDIA GeForce RTX 3050 Ti Laptop GPU / NVIDIA 595.44.00 / Ubuntu 24.04.4 LTS
Total Tests: 83
Passed: 64
Crashed: 0
Failed: 0
Not Supported: 18
Skipped: 1 (in skip list)
Success Rate: 100.0%
✔️ ALL TESTS COMPLETED - 47 passed, 4 not supported by hardware/driver
Additional Details (optional)