From d5bd6874f6b30bb3c0992a3da1d0b654918cd5ea Mon Sep 17 00:00:00 2001 From: "Pohsiang (John) Hsu" Date: Tue, 24 Feb 2026 09:23:22 -0800 Subject: [PATCH] d3d12: add workaround for max subregion number reported in slice auto mode Reviewed-by: Sil Vilerino Part-of: --- src/gallium/drivers/d3d12/d3d12_video_enc.cpp | 2 +- src/gallium/drivers/d3d12/d3d12_video_enc_hevc.cpp | 10 ---------- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/src/gallium/drivers/d3d12/d3d12_video_enc.cpp b/src/gallium/drivers/d3d12/d3d12_video_enc.cpp index 921b48e6487..c990311fefe 100644 --- a/src/gallium/drivers/d3d12/d3d12_video_enc.cpp +++ b/src/gallium/drivers/d3d12/d3d12_video_enc.cpp @@ -3025,7 +3025,7 @@ d3d12_video_encoder_calculate_max_slices_count_in_output( case D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE_BYTES_PER_SUBREGION: case D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE_AUTO: { - maxSlices = MaxSubregionsNumberFromCaps; + maxSlices = std::max(128u, MaxSubregionsNumberFromCaps); } break; case D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE_SQUARE_UNITS_PER_SUBREGION_ROW_UNALIGNED: { diff --git a/src/gallium/drivers/d3d12/d3d12_video_enc_hevc.cpp b/src/gallium/drivers/d3d12/d3d12_video_enc_hevc.cpp index 1b9ce63888d..25ded7e57a3 100644 --- a/src/gallium/drivers/d3d12/d3d12_video_enc_hevc.cpp +++ b/src/gallium/drivers/d3d12/d3d12_video_enc_hevc.cpp @@ -1481,16 +1481,6 @@ d3d12_video_encoder_update_current_encoder_config_state_hevc(struct d3d12_video_ pD3D12Enc->m_currentEncodeCapabilities.m_encoderLevelSuggestedDesc.m_HEVCLevelSetting.Level); } - if (pD3D12Enc->m_currentEncodeCapabilities.m_MaxSlicesInOutput > - pD3D12Enc->m_currentEncodeCapabilities.m_currentResolutionSupportCaps.MaxSubregionsNumber) { - debug_printf("[d3d12_video_encoder_hevc] Desired number of subregions %d is not supported (higher than max " - "reported slice number %d in query caps) for current resolution (%d, %d)\n.", - pD3D12Enc->m_currentEncodeCapabilities.m_MaxSlicesInOutput, - pD3D12Enc->m_currentEncodeCapabilities.m_currentResolutionSupportCaps.MaxSubregionsNumber, - pD3D12Enc->m_currentEncodeConfig.m_currentResolution.Width, - pD3D12Enc->m_currentEncodeConfig.m_currentResolution.Height); - return false; - } return true; }