hasvk: Emit MFX_AVC_WEIGHTOFFSET_STATE for both list 0 and list 1.

Fixes Haswell corruption with https://files.lynne.ee/testsamples/bbc2.sample.h264.
This is the correct thing to do anyway and only worked on Ivy Bridge by accident.

Assisted-by: Claude
This commit is contained in:
dancingmirrors authored and elwrcl committed 2026-07-21 22:25:27 +03:00
1 parent 1d4d7c0650
commit c9dcef66aa
1 file changed
+8 -5
+8 -5
View File
@@ -794,11 +794,14 @@ anv_h264_decode_video(struct anv_cmd_buffer *cmd_buffer,
} }
} }
bool need_w_l0 = (pps->flags.weighted_pred_flag && /* Emit MFX_AVC_WEIGHTOFFSET_STATE for both list 0 and list 1. */
cur && (cur->slice_type == ANV_H264_SLICE_P || bool is_b = cur && cur->slice_type == ANV_H264_SLICE_B;
cur->slice_type == ANV_H264_SLICE_SP)); bool need_w_l0 = cur &&
bool need_w_l1 = (pps->weighted_bipred_idc == 1 && ((pps->flags.weighted_pred_flag &&
cur && cur->slice_type == ANV_H264_SLICE_B); (cur->slice_type == ANV_H264_SLICE_P ||
cur->slice_type == ANV_H264_SLICE_SP)) ||
(pps->weighted_bipred_idc == 1 && is_b));
bool need_w_l1 = pps->weighted_bipred_idc == 1 && is_b;
if (need_w_l0 || need_w_l1) { if (need_w_l0 || need_w_l1) {
for (unsigned list = 0; list <= 1; list++) { for (unsigned list = 0; list <= 1; list++) {
if (list == 0 && !need_w_l0) continue; if (list == 0 && !need_w_l0) continue;