mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 16:08:04 +02:00
d3d12: HEVC Encode - Query slice config mode based on user slice setting
Queries D3D12_FEATURE_VIDEO_ENCODER_SUPPORT1 for HEVC setting D3D12_FEATURE_DATA_VIDEO_ENCODER_SUPPORT1.SubregionFrameEncoding as D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE_UNIFORM_PARTITIONING_SUBREGIONS_PER_FRAME or D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE_FULL_FRAME depending on the frontend number of slices requested. Doing this avoids d3d12_video_encoder_config_dirty_flag_slices from being set on every frame otherwise, triggering a reconstruction of the encoder objects on every frame on some platforms. Signed-off-by: Teng, Jin Chung <jin.chung.teng@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28007>
This commit is contained in:
parent
cda6877cb6
commit
ef45417690
1 changed files with 7 additions and 2 deletions
|
|
@ -906,8 +906,13 @@ d3d12_video_encoder_update_current_encoder_config_state_hevc(struct d3d12_video_
|
|||
// try to fallback if any of them is not supported and return the negotiated d3d12 settings
|
||||
D3D12_FEATURE_DATA_VIDEO_ENCODER_SUPPORT1 capEncoderSupportData1 = {};
|
||||
// Get max number of slices per frame supported
|
||||
pD3D12Enc->m_currentEncodeConfig.m_encoderSliceConfigMode =
|
||||
D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE_UNIFORM_PARTITIONING_SUBREGIONS_PER_FRAME;
|
||||
if (hevcPic->num_slice_descriptors > 1)
|
||||
pD3D12Enc->m_currentEncodeConfig.m_encoderSliceConfigMode =
|
||||
D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE_UNIFORM_PARTITIONING_SUBREGIONS_PER_FRAME;
|
||||
else
|
||||
pD3D12Enc->m_currentEncodeConfig.m_encoderSliceConfigMode =
|
||||
D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE_FULL_FRAME;
|
||||
|
||||
if (!d3d12_video_encoder_negotiate_requested_features_and_d3d12_driver_caps(pD3D12Enc, capEncoderSupportData1)) {
|
||||
debug_printf("[d3d12_video_encoder_hevc] After negotiating caps, D3D12_FEATURE_VIDEO_ENCODER_SUPPORT1 "
|
||||
"arguments are not supported - "
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue