Tags give the ability to mark specific points in history as being important
  • v2.72.0-rc1   v2.72.0-rc1 This is a major release with several key additions, most notably being the support for custom, mpv-style "user shaders" (.hook), giving us access to a large variety of pre-existing user shaders such as RAVU, FSRCNNX, Anime4K, SSimSuperRes, KrigBilateral, NNEDI3, and more. In addition to this, major additions include a completely refactored and fixed AV1 grain generation shader, support for Vulkan versions higher than 1.0, support for GPU-based timers, and improved interop APIs for both Vulkan and OpenGL, and new and improved aspect ratio handling. Finally, this release also brings with it a major change to the way HDR and SDR content are mapped between each other, including a new tone-mapping function based on the industry-standard ITU-R BT.2390 EETF. Additions: - add `pl_swapchain_hdr_metadata`, to set HDR metadata on supported swapchains (currently only vulkan with `VK_EXT_hdr_metadata`) - add support for vulkan versions higher than 1.0, communicated via the new fields `api_version` and `max_api_version` - add support for GPU-assisted validation and best practices layers, via the new field `pl_vk_inst_params.debug_extra` - add helper functions for working with `pl_rect`s, including new aspect ratio handling helpers (`pl_rect2df_aspect_*`) - add field `pl_vulkan_params.device_uuid` to allow choosing the vulkan device by its UUID - add function `pl_vulkan_hold_raw`, to hold images without actually transitioning its layout and access mode - add function `pl_vulkan_import`, to allow directly re-using an existing VkDevice rather than creating a new one; this requires communicating metadata about how the device was created - add field `pl_vulkan_params.features` to allow loading optional extra device features at device creation time - add support for mpv-style custom user shaders (.hook), using the set of functions in `<libplacebo/shaders/custom.h>` - add `pl_render_high_quality_params`, enabling debanding and EWA scaling - add `pl_timer` GPU resource type and associated API functions, allowing the GPU execution time of shaders and texture transfer operations to be measured directly - add `PL_SHADER_SIG_SAMPLER`, allowing generated sampling shaders to directly accept the sampler to use as function parameters - add `pl_image_set_chroma_location` to automatically apply the correct chroma location to any subsampled planes - add `PL_TONE_MAPPING_BT_2390`, a tone mapping function based on the EETF from ITU-R Report BT.2390 (and make it the default) - add `pl_peak_detect_params.overshoot_margin` to help combat clipping on certain types of rapid scene fade-ins - add `pl_sampler_type` to allow encoding non-standard sampler types such as sampler2DRect, and also generalize samplers to allow e.g. usampler2D or isampler3D - add `pl_opengl_wrap` and `pl_opengl_unwrap`, to allow directly mapping between OpenGL textures and the `pl_tex` abstraction Changes: - deprecate `pl_image.width/height`, which are now inferred automatically from the actual planes - `pl_vulkan_wrap` now takes a `pl_vulkan_wrap_params` struct instead of directly accepting its parameters, including new fields `sample_mode` and `address_mode` to configure the created sampler - change `pl_dispatch_compute` to allow optionally passing in a simulated framebuffer width/height, which will be used to translate vertex attributes (if any) - undefine disabled `config.h` features, instead of defining them as 0 - remove debanding from `pl_render_default_params` - refactor HDR<->SDR mapping; PL_COLOR_REF_WHITE has been removed and replaced by PL_COLOR_SDR_WHITE (203 cd/m^2) and PL_COLOR_SDR_WHITE_HLG (75% HLG), respectively - completely refactor pl_shader_av1_grain`, which now samples directly from the passed texture rather than requiring the color be pre-sampled - `pl_render_image` now infers the image primaries based on resolution, rather than always hard-coding `PL_COLOR_SPACE_UNKNOWN` as BT.709 - change `pl_render_target.dst_rect` from `pl_rect2d` to `pl_rect2df`, allowing more accurate aspect ratio handling, and correctly compensate for subpixel scaling ratios - require `python3-mako` as a dependency of the `vulkan` feature - `pl_chroma_location_offset` now treats `PL_CHROMA_UNKNOWN` as `PL_CHROMA_LEFT`, the de-facto standard chroma location - the default value of `pl_color_map_params.tone_mapping_algo` is now `PL_TONE_MAPPING_BT_2390` Fixes and performance improvements: - fix shader generation when the GLSL version is explicitly overridden - properly mark some shader failures (`pl_shader_is_failed`) - fix texture invalidation on OpenGL - correctly respect `pl_swapchain_frame.flipped` in `pl_render_target_from_swapchain` - correctly validate descriptor uniqueness in `pl_pass_create` - skip redundant matrix multiplication in `pl_shader_encode_color` wherever possible - work around driver bugs w.r.t out-of-order buffer offsets by sorting all buffer variables by offset - fix edge cases in vulkan swapchain usage flag checks - fix excessive CPU usage in `pl_tex_download` - reduce the number of unnecessary GPU flushes caused by `pl_buf_poll` - fix issue where blending did not work on some drivers (e.g. nvidia) - make the framebuffer discard check more aggressive - fix computation of anti-aliased resizable orthogonal filters, e.g. when downscaling using `pl_filter_lanczos` - fix external image memory barriers for exclusive mode images - fix failure path of `pl_swapchain_submit_frame` - fix various GLSL compatibility issues with av1 grain generation - reduce maximum vulkan memory allocation slab size to conform to AMD recommendations - fix build error when lcms is not available - fix double-application of texture scale for e.g. 10-bit content when using separable scalers - fix a multitude of bugs affecting av1 grain generation, especially for chroma planes - fix segfault on vulkan device oom - fix invalid shader generation on some platforms - fix a multitude of bugs, edge cases and subtle off-by-ones related to chroma scaling and plane alignment - add fallback code for edge case w.r.t chroma scaling and gpu resource exhaustion - correctly load VK_KHR_swapchain in all circumstances that require accessing its functions - minimize fbo usage inside `pl_renderer`, by re-using unused fbos - tweak the work group size for polar scaling to perform better on modern GPUs (tested on RDNA) - transparently upgrade fragment shaders to compute shaders on environments with async compute - pick a more reasonable size for the dummy gpu's `max_group_threads` - forbid 10-bit linear transfer functions from vulkan swapchains - fix segfault when re-executing previously failed shaders
  • v2.72.0-rc2   v2.72.0-rc2 This is a major release with several key additions, most notably being the support for custom, mpv-style "user shaders" (.hook), giving us access to a large variety of pre-existing user shaders such as RAVU, FSRCNNX, Anime4K, SSimSuperRes, KrigBilateral, NNEDI3, and more. In addition to this, major additions include a completely refactored and fixed AV1 grain generation shader, support for Vulkan versions higher than 1.0, support for GPU-based timers, and improved interop APIs for both Vulkan and OpenGL, and new and improved aspect ratio handling. Finally, this release also brings with it a major change to the way HDR and SDR content are mapped between each other, including a new tone-mapping function based on the industry-standard ITU-R BT.2390 EETF. Additions: - add `pl_swapchain_hdr_metadata`, to set HDR metadata on supported swapchains (currently only vulkan with `VK_EXT_hdr_metadata`) - add support for vulkan versions higher than 1.0, communicated via the new fields `api_version` and `max_api_version` - add support for GPU-assisted validation and best practices layers, via the new field `pl_vk_inst_params.debug_extra` - add helper functions for working with `pl_rect`s, including new aspect ratio handling helpers (`pl_rect2df_aspect_*`) - add field `pl_vulkan_params.device_uuid` to allow choosing the vulkan device by its UUID - add function `pl_vulkan_hold_raw`, to hold images without actually transitioning its layout and access mode - add function `pl_vulkan_import`, to allow directly re-using an existing VkDevice rather than creating a new one; this requires communicating metadata about how the device was created - add field `pl_vulkan_params.features` to allow loading optional extra device features at device creation time - add support for mpv-style custom user shaders (.hook), using the set of functions in `<libplacebo/shaders/custom.h>` - add `pl_render_high_quality_params`, enabling debanding and EWA scaling - add `pl_timer` GPU resource type and associated API functions, allowing the GPU execution time of shaders and texture transfer operations to be measured directly - add `PL_SHADER_SIG_SAMPLER`, allowing generated sampling shaders to directly accept the sampler to use as function parameters - add `pl_image_set_chroma_location` to automatically apply the correct chroma location to any subsampled planes - add `PL_TONE_MAPPING_BT_2390`, a tone mapping function based on the EETF from ITU-R Report BT.2390 (and make it the default) - add `pl_peak_detect_params.overshoot_margin` to help combat clipping on certain types of rapid scene fade-ins - add `pl_sampler_type` to allow encoding non-standard sampler types such as sampler2DRect, and also generalize samplers to allow e.g. usampler2D or isampler3D - add `pl_opengl_wrap` and `pl_opengl_unwrap`, to allow directly mapping between OpenGL textures and the `pl_tex` abstraction Changes: - deprecate `pl_image.width/height`, which are now inferred automatically from the actual planes - `pl_vulkan_wrap` now takes a `pl_vulkan_wrap_params` struct instead of directly accepting its parameters, including new fields `sample_mode` and `address_mode` to configure the created sampler - change `pl_dispatch_compute` to allow optionally passing in a simulated framebuffer width/height, which will be used to translate vertex attributes (if any) - undefine disabled `config.h` features, instead of defining them as 0 - remove debanding from `pl_render_default_params` - refactor HDR<->SDR mapping; PL_COLOR_REF_WHITE has been removed and replaced by PL_COLOR_SDR_WHITE (203 cd/m^2) and PL_COLOR_SDR_WHITE_HLG (75% HLG), respectively - completely refactor pl_shader_av1_grain`, which now samples directly from the passed texture rather than requiring the color be pre-sampled - `pl_render_image` now infers the image primaries based on resolution, rather than always hard-coding `PL_COLOR_SPACE_UNKNOWN` as BT.709 - change `pl_render_target.dst_rect` from `pl_rect2d` to `pl_rect2df`, allowing more accurate aspect ratio handling, and correctly compensate for subpixel scaling ratios - require `python3-mako` as a dependency of the `vulkan` feature - `pl_chroma_location_offset` now treats `PL_CHROMA_UNKNOWN` as `PL_CHROMA_LEFT`, the de-facto standard chroma location - the default value of `pl_color_map_params.tone_mapping_algo` is now `PL_TONE_MAPPING_BT_2390` Fixes and performance improvements: - fix shader generation when the GLSL version is explicitly overridden - properly mark some shader failures (`pl_shader_is_failed`) - fix texture invalidation on OpenGL - correctly respect `pl_swapchain_frame.flipped` in `pl_render_target_from_swapchain` - correctly validate descriptor uniqueness in `pl_pass_create` - skip redundant matrix multiplication in `pl_shader_encode_color` wherever possible - work around driver bugs w.r.t out-of-order buffer offsets by sorting all buffer variables by offset - fix edge cases in vulkan swapchain usage flag checks - fix excessive CPU usage in `pl_tex_download` - reduce the number of unnecessary GPU flushes caused by `pl_buf_poll` - fix issue where blending did not work on some drivers (e.g. nvidia) - make the framebuffer discard check more aggressive - fix computation of anti-aliased resizable orthogonal filters, e.g. when downscaling using `pl_filter_lanczos` - fix external image memory barriers for exclusive mode images - fix failure path of `pl_swapchain_submit_frame` - fix various GLSL compatibility issues with av1 grain generation - reduce maximum vulkan memory allocation slab size to conform to AMD recommendations - fix build error when lcms is not available - fix double-application of texture scale for e.g. 10-bit content when using separable scalers - fix a multitude of bugs affecting av1 grain generation, especially for chroma planes - fix segfault on vulkan device oom - fix invalid shader generation on some platforms - fix a multitude of bugs, edge cases and subtle off-by-ones related to chroma scaling and plane alignment - add fallback code for edge case w.r.t chroma scaling and gpu resource exhaustion - correctly load VK_KHR_swapchain in all circumstances that require accessing its functions - minimize fbo usage inside `pl_renderer`, by re-using unused fbos - tweak the work group size for polar scaling to perform better on modern GPUs (tested on RDNA) - transparently upgrade fragment shaders to compute shaders on environments with async compute - pick a more reasonable size for the dummy gpu's `max_group_threads` - forbid 10-bit linear transfer functions from vulkan swapchains - fix segfault when re-executing previously failed shaders - fix swapchain creation errors on GLES 2 - explicitly mark all shader resources as non-aliased - correctly specify shader storage buffers as coherent for shaders that require them - fix various memory barrier synchronization issues for opengl
  • v2.72.0   v2.72.0 This is a major release with several key additions, most notably being the support for custom, mpv-style "user shaders" (.hook), giving us access to a large variety of pre-existing user shaders such as RAVU, FSRCNNX, Anime4K, SSimSuperRes, KrigBilateral, NNEDI3, and more. In addition to this, major additions include a completely refactored and fixed AV1 grain generation shader, support for Vulkan versions higher than 1.0, support for GPU-based timers, and improved interop APIs for both Vulkan and OpenGL, and new and improved aspect ratio handling. Finally, this release also brings with it a major change to the way HDR and SDR content are mapped between each other, including a new tone-mapping function based on the industry-standard ITU-R BT.2390 EETF. Additions: - add `pl_swapchain_hdr_metadata`, to set HDR metadata on supported swapchains (currently only vulkan with `VK_EXT_hdr_metadata`) - add support for vulkan versions higher than 1.0, communicated via the new fields `api_version` and `max_api_version` - add support for GPU-assisted validation and best practices layers, via the new field `pl_vk_inst_params.debug_extra` - add helper functions for working with `pl_rect`s, including new aspect ratio handling helpers (`pl_rect2df_aspect_*`) - add field `pl_vulkan_params.device_uuid` to allow choosing the vulkan device by its UUID - add function `pl_vulkan_hold_raw`, to hold images without actually transitioning its layout and access mode - add function `pl_vulkan_import`, to allow directly re-using an existing VkDevice rather than creating a new one; this requires communicating metadata about how the device was created - add field `pl_vulkan_params.features` to allow loading optional extra device features at device creation time - add support for mpv-style custom user shaders (.hook), using the set of functions in `<libplacebo/shaders/custom.h>` - add `pl_render_high_quality_params`, enabling debanding and EWA scaling - add `pl_timer` GPU resource type and associated API functions, allowing the GPU execution time of shaders and texture transfer operations to be measured directly - add `PL_SHADER_SIG_SAMPLER`, allowing generated sampling shaders to directly accept the sampler to use as function parameters - add `pl_image_set_chroma_location` to automatically apply the correct chroma location to any subsampled planes - add `PL_TONE_MAPPING_BT_2390`, a tone mapping function based on the EETF from ITU-R Report BT.2390 (and make it the default) - add `pl_peak_detect_params.overshoot_margin` to help combat clipping on certain types of rapid scene fade-ins - add `pl_sampler_type` to allow encoding non-standard sampler types such as sampler2DRect, and also generalize samplers to allow e.g. usampler2D or isampler3D - add `pl_opengl_wrap` and `pl_opengl_unwrap`, to allow directly mapping between OpenGL textures and the `pl_tex` abstraction Changes: - deprecate `pl_image.width/height`, which are now inferred automatically from the actual planes - `pl_vulkan_wrap` now takes a `pl_vulkan_wrap_params` struct instead of directly accepting its parameters, including new fields `sample_mode` and `address_mode` to configure the created sampler - change `pl_dispatch_compute` to allow optionally passing in a simulated framebuffer width/height, which will be used to translate vertex attributes (if any) - undefine disabled `config.h` features, instead of defining them as 0 - remove debanding from `pl_render_default_params` - refactor HDR<->SDR mapping; PL_COLOR_REF_WHITE has been removed and replaced by PL_COLOR_SDR_WHITE (203 cd/m^2) and PL_COLOR_SDR_WHITE_HLG (75% HLG), respectively - completely refactor pl_shader_av1_grain`, which now samples directly from the passed texture rather than requiring the color be pre-sampled - `pl_render_image` now infers the image primaries based on resolution, rather than always hard-coding `PL_COLOR_SPACE_UNKNOWN` as BT.709 - change `pl_render_target.dst_rect` from `pl_rect2d` to `pl_rect2df`, allowing more accurate aspect ratio handling, and correctly compensate for subpixel scaling ratios - require `python3-mako` as a dependency of the `vulkan` feature - `pl_chroma_location_offset` now treats `PL_CHROMA_UNKNOWN` as `PL_CHROMA_LEFT`, the de-facto standard chroma location - the default value of `pl_color_map_params.tone_mapping_algo` is now `PL_TONE_MAPPING_BT_2390` Fixes and performance improvements: - fix shader generation when the GLSL version is explicitly overridden - properly mark some shader failures (`pl_shader_is_failed`) - fix texture invalidation on OpenGL - correctly respect `pl_swapchain_frame.flipped` in `pl_render_target_from_swapchain` - correctly validate descriptor uniqueness in `pl_pass_create` - skip redundant matrix multiplication in `pl_shader_encode_color` wherever possible - work around driver bugs w.r.t out-of-order buffer offsets by sorting all buffer variables by offset - fix edge cases in vulkan swapchain usage flag checks - fix excessive CPU usage in `pl_tex_download` - reduce the number of unnecessary GPU flushes caused by `pl_buf_poll` - fix issue where blending did not work on some drivers (e.g. nvidia) - make the framebuffer discard check more aggressive - fix computation of anti-aliased resizable orthogonal filters, e.g. when downscaling using `pl_filter_lanczos` - fix external image memory barriers for exclusive mode images - fix failure path of `pl_swapchain_submit_frame` - fix various GLSL compatibility issues with av1 grain generation - reduce maximum vulkan memory allocation slab size to conform to AMD recommendations - fix build error when lcms is not available - fix double-application of texture scale for e.g. 10-bit content when using separable scalers - fix a multitude of bugs affecting av1 grain generation, especially for chroma planes - fix segfault on vulkan device oom - fix invalid shader generation on some platforms - fix a multitude of bugs, edge cases and subtle off-by-ones related to chroma scaling and plane alignment - add fallback code for edge case w.r.t chroma scaling and gpu resource exhaustion - correctly load VK_KHR_swapchain in all circumstances that require accessing its functions - minimize fbo usage inside `pl_renderer`, by re-using unused fbos - tweak the work group size for polar scaling to perform better on modern GPUs (tested on RDNA) - transparently upgrade fragment shaders to compute shaders on environments with async compute - pick a more reasonable size for the dummy gpu's `max_group_threads` - forbid 10-bit linear transfer functions from vulkan swapchains - fix segfault when re-executing previously failed shaders - fix swapchain creation errors on GLES 2 - explicitly mark all shader resources as non-aliased - correctly specify shader storage buffers as coherent for shaders that require them - fix various memory barrier synchronization issues for opengl
  • v2.72.1   v2.72.1 This release backports a number of bug fixes from master affecting the v2.72.0 release, most notably extending the range of supported glslang versions, as well as fixing the 3DLUT/ICC generation code. Bug fixes: - compatibility with glslang >= 8.13.3743 - compatibility with new glslang semantic versioning scheme - fix broken shaders on some versions of GLES by defaulting to 32-bit precision for floating point math - fix the vulkan API version passed to shaderc - fix the extension check for glInvalidateTexImage - fix pl_tex_create on older GLES versions - fix OpenGL logging thread safety - fix undefined memcmp() in pl_shader_av1_grain - fix pl_render_target.repr being ignored by pl_render_image - fix 3DLUT generation code (generated corrupt LUTs in all cases) - fix symbol visibility on some versions of GCC - fix potential overflow in BT.2390 shader - properly restrict pl_shader_sample_polar to GLSL >= 130 - fix vulkan function loading of promoted core functions Other changes: - tiny performance gain in 3DLUT generation - pl_opengl_create now logs GL_EXTENSIONS - log some additional VkResult enum members - improve several vulkan log messages by using friendly names of enums - add a copy of the config.h variables to the libplacebo.pc file
  • v2.72.2   v2.72.2 This hotfix release fixes an additional glslang linking/build issue that was missed in v2.72.1. Bug fixes: - fix linking issue with some installations of glslang >= 11.0.0
  • v3.104.0-rc1   v3.104.0-rc1 This is a major release, introducing many new features and modifications. Most importantly, libplacebo now interoperates well with FFmpeg's libav* abstractions. This is primarily exposed via a new set of helpers, <libplacebo/utils/libav.h>, implemented as a single header library. In addition to this, a number of other supporting changes have been made to the API, most notably the unification of `pl_image` and `pl_render_target` into a single `pl_frame` concept, similar in spirit to AVFrame. As such, libplacebo now supports **rendering to planar targets**, including subsampled YCbCr. Besides the libav* compatibility changes, this release also brings with it a new feature for custom shaders: buffer blocks, and persistent storage. This can be used by third parties to implement stateful shaders (e.g. motion interpolation or temporal deinterlacing), or be leveraged to speed up some shaders by combining multiple passes into one. Finally, various import/export procedures have been expanded, including the ability to import host pointers and real-world DMABUFs. 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 functions `pl_dispatch_save` and `pl_dispatch_load` to allow saving/restoring the contents of an entire `pl_dispatch`'s cache - add functions `pl_renderer_save` and `pl_renderer_load` to allow saving/restoring the contents of an entire `pl_renderer`'s cache - add `pl_vulkan_swapchain_params.prefer_hdr`, which will cause the surface format selection logic to try HDR output formats first - add `pl_buf_copy` to copy from one buffer to another - add `pl_get_detected_peak`, to read back the result of peak detection - add `pl_primaries_superset` to test if one set of primaries is fully enclosed by another - add `pl_color_map_params.gamut_clipping`, which will colorimetrically clip any out-of-gamut colors by desaturating them towards neutral gray until they're in-gamut, rather than clipping per channel as before - add `PL_GPU_CAP_SUBGROUPS` and `pl_gpu_limits.subgroup_size`, to expose GLSL subgroup functionality via the `pl_gpu` interface - add `pl_gpu_is_failed`, to query at a high level whether the `pl_gpu` is in some internal failure state. GPUs in this state should be recreated, using the appropriate mechanism - add `pl_shader_custom`, to allow injecting arbitrary custom GLSL code into a `pl_shader`. - add `pl_buf_params.import_handle` to allow importing buffers - add `PL_HANDLE_HOST_POTR`, to allow importing arbitrary host pointers - 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_fmt.fourcc` to facilitate mapping between `pl_fmt` and DRM - add the missing `pl_var_*` helpers, for consistency - 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 PL_COLOR_PRIM_EBU_3213 and PL_COLOR_PRIM_FILM_C - add a new header <libplacebo/utils/libav.h>, containing a variety of helper functions for interoperating between libav* and libplacebo - add `demos/plplay.c` to serve as a demonstration of how to make a trivial playback loop with libavcodec and libplacebo - add `pl_sample_src.component_mask` to allow sampling an arbitrary subset of the available components from a plane - add `pl_frame_is_cropped` and `pl_frame_clear` to assist in properly clearing frames before rendering to them - add `pl_tex_poll` to assist in interoperating with some external APIs - add `pl_render_params.blend_params` to allow blending the final output Changes: - remove `pl_image.signature` and `pl_render_params.skip_redraw_caching` - change vulkan surface format selection to prioritize formats by 'score', preferring higher depth integer formats - `pl_fmt` may now have PL_FMT_CAP_STORABLE even when `glsl_format` is NULL, in which case formatless image storage must be used - `pl_buf_read` no longer requires `buf_offset` be a multiple of 4 - `pl_buf_*` commands are now synchronized internally: - `pl_buf_write` and `pl_buf_read` now block while the buffer is in use Note: for this reason, `pl_buf_write` should not be used in loops - `pl_tex_upload/download` may now be called on in-use buffers - 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 - remove `pl_buf_params.type`, and the concept of buffer types in general. `pl_buf` is now a generic catch-all for any type of buffer, with individual capabilities in `pl_buf_params` determinig what type of shader operations it can be used for - relax the alignment requirements on `pl_tex_transfer_params` - change `pl_opengl_wrap_params` to allow directly importing framebuffers in addition to textures - 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 - add `pl_av1_grain_params.luma_comp` to allow drawing the luma component from a channel with nonzero index - `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 - fix some GLSL backwards compatibility issues - slightly cut down on unnecessary image layout transitions - add some miscellaneous debug print-outs, and improve the legibility of some existing log messages - fix an issue where freeing buffer variables from shader descriptors could result in use-after-free - add support for vulkan memory imports requiring dedication allocations - slightly improve, and fix, the vulkan memory placement logic - 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 - prevent `pl_renderer` from unneccessarily applying a 3DLUT when both the input and output frames have the same ICC profile - fix the behaviour of partially specified `pl_bit_encoding` structs - fix the component ordering on some odd packed vulkan formats - 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 the behaviour of `pl_renderer` when sampling from textures with swapped component orders - fix the implementation of PL_COLOR_SYSTEM_BT_2100_HLG - fix some issues relating to missing includes - enforce legality of image usage parameters on `pl_vulkan_wrap` - fix an undesired shader double-compilation when using orthogonal scalers with subsampled chroma planes - fix an issue where application of a 3DLUT cleared the alpha channel - add a missing extension to `pl_vulkan_recommended_extensions` - fix the plane alignment code for oddly sized subsampled chroma - fix the poor precision of `pl_shader_dither` for high bit depths - fix several possible overflows in the BT.2390 shader - fix a bug where using a polar sampler to draw a scaled overlay onto a non-storable target neglected to disable compute shaders - fix a bug where the renderer could sometimes alias when downscaling, in particular if both the upsampler and downsampler are set to bicubic - improve performance of scalers by avoiding bilinear filtering
    83fc3aa2 · meson: bump major version ·
  • v3.104.0   v3.104.0 This is a major release, introducing many new features and modifications. Most importantly, libplacebo now interoperates well with FFmpeg's libav* abstractions. This is primarily exposed via a new set of helpers, <libplacebo/utils/libav.h>, implemented as a single header library. In addition to this, a number of other supporting changes have been made to the API, most notably the unification of `pl_image` and `pl_render_target` into a single `pl_frame` concept, similar in spirit to AVFrame. As such, libplacebo now supports **rendering to planar targets**, including subsampled YCbCr. Besides the libav* compatibility changes, this release also brings with it a new feature for custom shaders: buffer blocks, and persistent storage. This can be used by third parties to implement stateful shaders (e.g. motion interpolation or temporal deinterlacing), or be leveraged to speed up some shaders by combining multiple passes into one. Finally, various import/export procedures have been expanded, including the ability to import host pointers and real-world DMABUFs. 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 functions `pl_dispatch_save` and `pl_dispatch_load` to allow saving/restoring the contents of an entire `pl_dispatch`'s cache - add functions `pl_renderer_save` and `pl_renderer_load` to allow saving/restoring the contents of an entire `pl_renderer`'s cache - add `pl_vulkan_swapchain_params.prefer_hdr`, which will cause the surface format selection logic to try HDR output formats first - add `pl_buf_copy` to copy from one buffer to another - add `pl_get_detected_peak`, to read back the result of peak detection - add `pl_primaries_superset` to test if one set of primaries is fully enclosed by another - add `pl_color_map_params.gamut_clipping`, which will colorimetrically clip any out-of-gamut colors by desaturating them towards neutral gray until they're in-gamut, rather than clipping per channel as before - add `PL_GPU_CAP_SUBGROUPS` and `pl_gpu_limits.subgroup_size`, to expose GLSL subgroup functionality via the `pl_gpu` interface - add `pl_gpu_is_failed`, to query at a high level whether the `pl_gpu` is in some internal failure state. GPUs in this state should be recreated, using the appropriate mechanism - add `pl_shader_custom`, to allow injecting arbitrary custom GLSL code into a `pl_shader`. - add `pl_buf_params.import_handle` to allow importing buffers - add `PL_HANDLE_HOST_POTR`, to allow importing arbitrary host pointers - 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_fmt.fourcc` to facilitate mapping between `pl_fmt` and DRM - add the missing `pl_var_*` helpers, for consistency - 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 PL_COLOR_PRIM_EBU_3213 and PL_COLOR_PRIM_FILM_C - add a new header <libplacebo/utils/libav.h>, containing a variety of helper functions for interoperating between libav* and libplacebo - add `demos/plplay.c` to serve as a demonstration of how to make a trivial playback loop with libavcodec and libplacebo - add `pl_sample_src.component_mask` to allow sampling an arbitrary subset of the available components from a plane - add `pl_frame_is_cropped` and `pl_frame_clear` to assist in properly clearing frames before rendering to them - add `pl_tex_poll` to assist in interoperating with some external APIs - add `pl_render_params.blend_params` to allow blending the final output Changes: - remove `pl_image.signature` and `pl_render_params.skip_redraw_caching` - change vulkan surface format selection to prioritize formats by 'score', preferring higher depth integer formats - `pl_fmt` may now have PL_FMT_CAP_STORABLE even when `glsl_format` is NULL, in which case formatless image storage must be used - `pl_buf_read` no longer requires `buf_offset` be a multiple of 4 - `pl_buf_*` commands are now synchronized internally: - `pl_buf_write` and `pl_buf_read` now block while the buffer is in use Note: for this reason, `pl_buf_write` should not be used in loops - `pl_tex_upload/download` may now be called on in-use buffers - 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 - remove `pl_buf_params.type`, and the concept of buffer types in general. `pl_buf` is now a generic catch-all for any type of buffer, with individual capabilities in `pl_buf_params` determinig what type of shader operations it can be used for - relax the alignment requirements on `pl_tex_transfer_params` - change `pl_opengl_wrap_params` to allow directly importing framebuffers in addition to textures - 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 - add `pl_av1_grain_params.luma_comp` to allow drawing the luma component from a channel with nonzero index - `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 - fix some GLSL backwards compatibility issues - slightly cut down on unnecessary image layout transitions - add some miscellaneous debug print-outs, and improve the legibility of some existing log messages - fix an issue where freeing buffer variables from shader descriptors could result in use-after-free - add support for vulkan memory imports requiring dedication allocations - slightly improve, and fix, the vulkan memory placement logic - 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 - prevent `pl_renderer` from unneccessarily applying a 3DLUT when both the input and output frames have the same ICC profile - fix the behaviour of partially specified `pl_bit_encoding` structs - fix the component ordering on some odd packed vulkan formats - 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 the behaviour of `pl_renderer` when sampling from textures with swapped component orders - fix the implementation of PL_COLOR_SYSTEM_BT_2100_HLG - fix some issues relating to missing includes - enforce legality of image usage parameters on `pl_vulkan_wrap` - fix an undesired shader double-compilation when using orthogonal scalers with subsampled chroma planes - fix an issue where application of a 3DLUT cleared the alpha channel - add a missing extension to `pl_vulkan_recommended_extensions` - fix the plane alignment code for oddly sized subsampled chroma - fix the poor precision of `pl_shader_dither` for high bit depths - fix several possible overflows in the BT.2390 shader - fix a bug where using a polar sampler to draw a scaled overlay onto a non-storable target neglected to disable compute shaders - fix a bug where the renderer could sometimes alias when downscaling, in particular if both the upsampler and downsampler are set to bicubic - improve performance of scalers by avoiding bilinear filtering - reduce verbosity of memory allocations - fix missing PL_FMT_CAP_BLENDABLE on opengl fbos - significantly improve precision of float literals in shaders - add better error checking to gl_pass_create
  • v3.120.0   v3.120.0 This is a feature release, introducing frame mixing, DRM format modifiers, and support for custom LUTs -, while also greatly expanding the available demo programs, in particular the `plplay` video player. The main highlight is the new `pl_queue` abstraction living in <libplacebo/utils/frame_queue.h>. This greatly simplifies the core of a libplacebo-based video renderer by translating a stream of input frames into an array of GPU-mapped textures suitable for frame mixing, given a corresponding vsync timestamp. New frames can be delivered to this API using a push or pull model, and they are lazily uploaded on an as-needed basis as well as internally garbage collected when no longer needed. This abstraction also contains all needed machinery for estimating source/display framerates by comparing and averaging timestamps, freeing users from the burden of having to accurately determine this information a priori. Also worth mentioning is the addition of support for custom LUTs, currently only in Adobe's .cube format. They can be applied flexibly at a number of locations in the video processing pipeline, including as a replacement for YUV<->RGB conversion or tone/gamut mapping, and fed with either normalized linear light or native-gamma values. Among the included demo programs, the `plplay` example video player has been greatly expanded - adding support for a settings GUI (based on nuklear), frame timing and mixing, custom shaders, and more. This example video player now serves as a convenient platform to demonstrate all of libplacebo's advanced rendering features. Finally, all of libplacebo now contains only code written entirely from scratch (rather than deriving from mpv), opening up the possibility to explore different licenses besides the current LGPLv2.1+. In particular, permissive (MIT/BSD-style) licenses are being considered. Additions: - add asynchronous GPU callbacks, specifically to `pl_tex_transfer`, allowing for non-blocking host memory transfer operations - add `pl_shared_mem.stride_w/h` to control dmabuf pitch - add `pl_render_image_mix` to blend multiple frames into a single output image, given relative timestamp information - add the `pl_filter_mitchell_clamp` filter preset - add `pl_render_params.preserve_mixing_cache` to speed up redraws after renderer size changes when frame mixing is active - add <libplacebo/utils/dav1d.h> to help with Dav1dPicture mapping - implement `PL_HANDLE_HOST_PTR` for the OpenGL backend - implement drm format modifiers for vulkan - add a new field `pl_fmt.modifiers` for DRM format modifier negotiation - add new header <libplacebo/shaders/lut.h> to load custom LUTs (currently only supporting the .cube format) - add `index_data/buf` to `pl_pass_run_params`, adding support for indexed vertex data when dispatching shader passes - add `pl_dispatch_vertex` to allow dispatching fragment shaders using a list of custom vertices with custom vertex attributes - add `pl_frame_recreate_from_avframe` and `pl_download_avframe` to help downloading GPU textures back into AVFrame form - add a new header <libplacebo/utils/frame_queue.h> to assist in taking a stream of (Frame, PTS) pairs as well as a list of VSync times and turning them into a stream of `pl_frame_mix` structs - add `pl_white_from_temp` and `pl_color_adjustment.temperature` to apply white point adjustments between correlated color temperatures (K) - add `pl_filter_preset.description` containing a longer, human-readable name for a given filter preset Changes: - `pl_3dlut_params` has been renamed `pl_icc_params` - `pl_render_params.force_3dlut` has been renamed `force_icc_lut` - `pl_3dlut_update/apply` have been renamed to `pl_icc_update/apply` and moved to a (conditionally installed) new header <libplacebo/shaders/icc.h> - `pl_upload_plane` no longer initializes `out_plane->shift_x/y` to 0, instead leaving them unmodified (to avoid clobbering existing shift data) - `pl_filter_box` has been renamed to `pl_filter_nearest` - `pl_filter_triangle` has been renamed to `pl_filter_bilinear` - `pl_render_params.frame_mixer = NULL` now disables frame mixing - to get back the old behaviour, set this to `&pl_oversample_frame_mixer`. - `pl_color_map_params.gamut_warning` now highlights out-of-gamut colors in bright pink, rather than the old (ill-defined) inversion behaviour - `pl_named_filter_config` has been renamed to `pl_filter_preset` - `pl_find_named_filter` has been renamed to `pl_find_filter_preset` - ditto for `pl_named_filter_function` and `pl_filter_function_preset` Fixes and performance improvements: - fix buffer overflow in custom shader STORAGE blocks - fix include path for glslang >= 11.0.0 - actually enable shader subgroup operations for HDR peak detection - fix locale dependence of shader parsing primitives - fix AVCOL_SPC_SMPTE170M mapping - fix wrong color space selection in `pl_vulkan_create_swapchain` - work-around low UBO size limits on some platforms - fix compilation issues on C++ due to the use of reserved identifiers - fix `pl_get_detected_peak` on platforms without host-visible SSBOs - fix edge case in vulkan texture handle capabilities check - fix suboptimal mutex destruction code - skip peak detection when outputting to HDR displays - fix edge cases in shader LUT type selection logic - avoid redundant scaling passes when scaling anamorphic content - merge similar planes before dispatching heavy shaders (e.g. debanding, hooks) - avoid scaling passes for certain small fractional scaling steps - entirely avoid processing unneeded components when dispatching scalers - avoid using more components than necessary for intermediate FBOs - fix out-of-bounds read for small non-cropped emulated textures - avoid thrashing the shader cache when reinitializing OpenGL FBOs - fix incorrect include in <libplacebo/opengl.h> - fix vk.xml priority issue on windows - fix undefined behaviour / GPU hangs in HDR peak detection shader - fix incorrect forwarding of DRM modifiers to the OpenGL backend - fix crash on AV_PIX_FMT_FLAG_BAYER - fix various compilation issues on certain platforms - fix obscure edge-case in floating point printing routine - `pl_render_params.force_icc_lut` now excludes no-op cases - fix handling of custom shader COMPUTE blocks - correctly apply hue and saturation controls for non-YCbCr color spaces
  • v3.120.1   v3.120.1 This hotfix release fixes a number of minor issues with the v3.120.0 release, and also modularizes the included demo programs to cut down on the number of compiled binaries. Changes: - hexadecimal strings in custom shaders may now include whitespace - added 16-bit half float formats to the dummy pl_gpu - significantly reduced verbosity of the included demo programs - merged all of the demo program variants into a single binary that picks the best windowing system / graphical API at runtime - install `plplay` when demos are enabled Fixes and performance improvements: - fixed an integer overflow in a texture bounds check - fixed a false positive error in the test framework on 32-bit platforms - fixed some minor issues with various outdated comments - fixed a potential use-after-free in the `plplay` demo program when playing files containing embedded ICC profiles
    ec69102e · meson: bump fix version ·
  • v3.120.2   v3.120.2 This minor release fixes a number of additional bugs related to the thread queue, included demos, included helpers, and build system. Changes: - replace the `shaderc` library checks by pkg-config checks - `pl_dispatch` no longer grows infinitely, but prunes stale cache entries after a certain threshold - improve logging of GPU capabilities (including format capabilities) Fixes and performance improvements: - fix a typo on an error message - fix a use-after-free edge case in `plplay` - filter out Infinity, NaN and other values from fps/vps estimates - add several warnings for suspected frame queue API misuses - fix a crash when combining pl_render_image_mix with cropped frames - fix a crash on AV_PIX_FMT_NONE in the libav helpers - fix the loading of overlays in the `sdlimage` demo - fix a number of potential overflows on 32-bit platforms - omit redundant identity matrices in pl_shader_decode_color - fix crash in frame queue with certain out-of-order PTS sequences - add missing link to vulkan dependency in the `video-filtering` demo - correctly shift overlays when drawing to subsampled YCbCr planes - add missing check for PL_GPU_CAP_CALLBACKS in `utils/{libav,dav1d}.h` - improve handling of asynchronous texture uploads in `utils/libav.h`
    8f81e2eb · meson: bump fix version ·
  • v3.120.3   v3.120.3 This minor release fixes a number of regressions surrounding memory imports and DRM modifiers, specifically aimed at issues that arose with mpv's --hwdec=vaapi. Changes: - `pl_fmt.modifiers` now always includes DRM_FORMAT_MOD_INVALID on OpenGL, which instructs the implementation to not specify modifiers - passing a DRM modifier not in the list of supported modifiers is now considered a hard error, to rule out non-working hwaccel formats Fixes: - fix a crash when using sampling shaders on textures with unknown formats - fix improperly specified SDL header imports in the demos - fix an issue where the vulkan texture handle capabilities were testing for presence of the wrong extension - fix an issue where non-enabled DRM modifier structs were accidentally linked into the pNext chain, causing issues with some drivers
    8a719c08 · meson: bump fix version ·