Skip to content

gallium: add handling for YUV planar surfaces

Mike Blumenkrantz requested to merge zmike/mesa:yuvplanes into master

st/dri: this adds a table (similar to the one in i965) which provides mappings for turning various planar formats into multiple sampler views. whereas only NV12 and IYUV were supported, now many more formats are supported here:

  • P0XX
  • YUV4XX
  • YVU4XX
  • AYUV
  • XYUV
  • YUYV
  • UYVY

the table is used directly to handle image creation, simplifying a lot of code and resolving related TODO/FIXME items where workarounds were previously in place to manage NV12 and IYUV formats exclusively

st/mesa: the changes here relate to setting up samplers for the planar formats. this requires:

  • checking for driver support for all the sampler formats
  • creating the samplers with the corresponding formats and swizzling
  • running nir_lower_tex with the appropriate options to trigger the lowering for each plane->sampler

fixes kwg/mesa#36 (closed)

Tested with piglit's ext_image_dma_buf_import-sample_yuv test across many formats on iris driver.

Edited by Mike Blumenkrantz

Merge request reports