The encoder ignored VkVideoReferenceSlotInfoKHR entirely: it took
pReferenceSlots[0] as the one reference, wrote its address into frame store 0
and hardcoded the L0 list to that store. Two DPB slots were all it could
honestly advertise, which is fewer than a GOP of any length needs.
Record each slot the operation names under its own index, since a slot maps
onto the frame store of the same index and MFX_PIPE_BUF_ADDR_STATE holds 16
of those, and build the L0 entries from StdVideoEncodeH264ReferenceListsInfo,
whose RefPicList0 already carries slot indices. Clients that pass reference
slots without a list keep the old behaviour.
maxDpbSlots therefore goes to 16. maxActiveReferencePictures stays at 1:
every macroblock is still coded against reference index 0, so a picture may
be kept in the DPB but only the one it names first is predicted from.
dEQP-VK.video.encode.h264.intra_refresh_* goes from 12 Pass and 32 stopped at
the maxDpbSlots >= GOP frame count precondition to 36 Pass, the remaining 8
being per-picture-partition mode, which is not offered. The family as a whole
is 76 of 120 with no failures. ffmpeg's h264_vulkan encoder no longer trips
its slot_index assertion and produces a full GOP.
Co-Authored-By: Claude Opus 5 <[email protected]>
Each macroblock's intra/inter decision is already made on its own when the
PAK objects are emitted, so refreshing a region is a matter of coding the
macroblocks it covers the way an I slice codes them. Regions divide the
picture evenly along rows, columns or raster order, which leaves the block,
block-row and block-column modes supported and gives empty regions for free
when the cycle is longer than the split axis.
Two things needed care. PAK keeps the I slice numbering for MbType5Bits
inside a P slice, where H.264 itself offsets intra mb_types by 5; handing it
the offset value hangs the MFC. And under constrained intra prediction a
neighbour only counts as available if it is in the refresh region too,
because prediction may not cross into an inter macroblock.
Nothing constrains motion away from not-yet-refreshed regions, which is
sound only because there is no motion estimation: every vector is zero, so a
macroblock reads its own co-located block and never leaves its region.
Motion estimation will have to honour VkVideoReferenceIntraRefreshInfoKHR's
dirty region count.
Per-picture-partition mode is not offered. It wants the refreshed slice
coded as an I slice, header included, rather than as intra macroblocks
inside a P slice.
dEQP-VK.video.encode.h264.intra_refresh_* goes from 44 NotSupported to 12
Pass; all three modes pass in the variants that can run. The other 32 stop
at a CTS precondition, maxDpbSlots >= GOP frame count, which the driver's
two slots do not meet. Raising that needs real DPB slot tracking and is
what gates B frames and ffmpeg's encoder too.
Co-Authored-By: Claude Opus 5 <[email protected]>
Squashed work that had been sitting in the working tree. Grouped by area:
Extensions
VK_EXT_host_image_copy, with a MEMCPY_BIT path that reads and writes the
image's own tiled layout, VkSubresourceHostMemcpySizeEXT filled in, and
VkHostImageCopyDevicePerformanceQueryEXT answered. Depth/stencil and
non-power-of-two bpb stay NotSupported.
VK_EXT_pipeline_robustness, VK_KHR_shader_float_controls2,
VK_KHR_shader_subgroup_rotate, VK_EXT_vertex_input_dynamic_state,
VK_EXT_conditional_rendering (an MI_PREDICATE path for gen7, which has no
GPRs), custom_border_color, border_color_swizzle, map_memory2,
load_store_op_none, depth_clamp_zero_one,
dynamic_rendering_unused_attachments, index_type_uint8,
line_rasterization, vertex_attribute_divisor, mutable_descriptor_type.
H.264 encode
MFC command emission and a bitstream writer, driving intra-only encode
through the video queue. Video profile reporting was also corrected from
270 combinations down to the 11 that actually exist.
Correctness
gfx7 routes typed surface writes through the render cache, so
VK_ACCESS_SHADER_WRITE barriers have to flush it -- without that, nothing a
fragment shader stored was visible.
nir_opt_algebraic's fadd->flrp fusion rules dropped signed zero; '~' only
excludes nir_fp_exact, not preserve_signed_zero, so reflect() with a -0
input came out wrong. Guarded with (nsz).
Stop advertising STORAGE_READ_WITHOUT_FORMAT: shaderStorageImageReadWithout-
Format is false here, and since Vulkan 1.3 the per-format bit is what grants
permission, so reporting it while rejecting the pipeline is a contradiction.
gfx7's typed data port ignores SURFTYPE_NULL -- the null surface still has
one addressable texel, which read and wrote graphics address zero. Bounds
check typed image access against the image param when nullDescriptor is
enabled, the same trick lower_image_atomic_instr already used on IVB.
Formats that require a sampler Y'CbCr conversion no longer report
BLIT_SRC/BLIT_DST/STORAGE_IMAGE. Video decode does not need them.
Check the surface state allocations in emit_binding_table() and in the push
descriptor path instead of writing through a NULL map in release builds.
Co-Authored-By: Claude Opus 5 <[email protected]>
Inline queries enabled by video_maintenance1 would just lock up my
machine and I'm not sure a proper workaround exists.
A few nits while here.
Assisted-by: Claude