Page MenuHomeSolus

Update libplacebo to 3.104.0
ClosedPublic

Authored by aleksvor on Sat, Jan 2, 10:51 AM.

Details

Summary

Summarized changelog:
Additions:

  • add pl_memory_qualifiers, plus a corresponding pl_shader_desc.memory, to allow attaching GLSL memory qualifiers (coherent, volatile etc.) to shader descriptors
  • add pl_vulkan_swapchain_params.prefer_hdr, which will cause the surface format selection logic to try HDR output formats first
  • add PL_GPU_CAP_SUBGROUPS and pl_gpu_limits.subgroup_size, to expose GLSL subgroup functionality via the pl_gpu interface
  • add pl_pass_run_params.vertex_buf, to allow drawing vertex data directly from a pl_buf, guarded by pl_gpu_limits.max_vbo_size
  • add _COUNT members to all public enums, for consistency
  • add pl_shared_mem.drm_format_mod, to allow communicating DRM format modifiers when importing/exporting textures
  • add support for importing DMABUFs via EGL, via the new fields pl_opengl_params.egl_display/context
  • add pl_plane_data_align to help with aligning pl_plane_data structs to byte boundaries
  • add support for STORAGE textures in user shaders, which can be used to persist data across separate invocations of the shader
  • add support for BUFFER blocks in user shaders, which can be used to create UBOs or SSBOs for use inside shaders, the latter of which can also persist across frames and be used to store persistent state
  • add a new header <libplacebo/utils/libav.h>, containing a variety of helper functions for interoperating between libav* and libplacebo
  • add pl_render_params.blend_params to allow blending the final output

Changes:

  • change Vulkan surface format selection to prioritize formats by 'score', preferring higher depth integer formats
  • allow pl_dispatch_compute on shaders with outputs, including the ability to automatically determine the number of work groups based on the shader output resolution
  • rename pl_color_levels members for clarity
  • make pl_opengl ignore software rasterizers by default, unless the new field pl_opengl_params.allow_software is set
  • pl_renderer now supports rendering to planar targets, including subsampled targets
  • pl_image and pl_render_target have been removed and unified into a single pl_frame concept
  • remove pl_tex_params.sample_mode/address_mode and move them to pl_desc_binding instead, to decouple them from texture creation
  • refactor the signature of pl_tex_blit

Fixes and performance improvements:

  • fix an oversight where pl_buf_destroy delayed some buffer destructions unnecessarily
  • fix a limitation where pl_tex_destroy sometimes delayed destroying textures unnecessarily
  • improve the performance of pl_dispatch's code for assembling UBOs
  • improve the performance of pl_shader_av1_grain by switching from SSBOs to texture LUTs, also improving compatibility with older GL
  • improve the performance of pl_shader_detect_peak on GPUs with access to subgroups operations
  • fix an issue where reinitializing shader state objects with different settings sometimes resulted in undefined behaviour
  • significantly improve the performance of pl_tex_download by importing the target host pointer directly
  • improve the performance of small LUTs, especially for the non-compute polar fallback path
  • fix an issue where pl_plane_data_from_mask broke for high bit depths
  • make pl_renderer consult the dither bit depth from the texture precision, if absent from pl_bit_encoding
  • fix an undesired shader double-compilation when using orthogonal scalers with subsampled chroma planes
  • add a missing extension to pl_vulkan_recommended_extensions
  • fix the poor precision of pl_shader_dither for high bit depths
  • fix several possible overflows in the BT.2390 shader
  • improve performance of scalers by avoiding bilinear filtering
  • fix missing PL_FMT_CAP_BLENDABLE on opengl fbos
  • significantly improve precision of float literals in shaders

Full changelog here.

Test Plan
  1. Rebuilt packages:
    • mpv (needs patching, see update stack)
    • vlc
  2. Played back HDR video in VLC to test HDR-to-SDR gamut conversion.
  3. Played back video in mpv with --gpu-api=vulkan to test Vulkan rendering pipeline.

Diff Detail

Repository
R4851 libplacebo
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

aleksvor created this revision.Sat, Jan 2, 10:51 AM
aleksvor requested review of this revision.Sat, Jan 2, 10:51 AM

Will require a rebuild of vlc. Rebuild of mpv with a patch is in update stack.

aleksvor updated this revision to Diff 24830.Sat, Jan 9, 1:08 PM

Backport patch which enables GPU subgroup operations - they all were disabled because of oversight.
Now the related performance improvements that are mentioned in the changelog should actually work.

Girtablulu requested changes to this revision.Sat, Jan 9, 2:21 PM
Girtablulu added a subscriber: Girtablulu.

as mentioned in IRC, that Changelog should be summarized :)

This revision now requires changes to proceed.Sat, Jan 9, 2:21 PM
aleksvor requested review of this revision.Sat, Jan 9, 2:29 PM
aleksvor edited the summary of this revision. (Show Details)
aleksvor edited the summary of this revision. (Show Details)
aleksvor edited the summary of this revision. (Show Details)Sat, Jan 9, 2:32 PM
aleksvor edited the summary of this revision. (Show Details)Mon, Jan 11, 9:04 AM

Now both libplacebo revdeps are in update stack.

JoshStrobl accepted this revision.Wed, Jan 20, 5:42 PM
JoshStrobl added a subscriber: JoshStrobl.

LGTM, thanks!

This revision is now accepted and ready to land.Wed, Jan 20, 5:44 PM
This revision was automatically updated to reflect the committed changes.