v4.208.0-rc2 This major release brings with it a number of fixes and changes for compatibility with both upstream and downstream projects, native HDR output on D3D11, and a complete redesign of the way ICC profiles are handled. Additions: - add helper macros linearize() and delinearize(), expanding to the definition of the gamma function in use for the video signal - add various new helper functions relating to colorspaces and primaries, see the API change log for a more comprehensive list - add `pl_render_params.force_low_bit_depth_fbos` for debugging/performance tweaking purposes - add `pl_plane.flipped`, to allow representing individual flipped frames in a way that semantically decouples from the presentation rect (e.g. for OpenGL framebuffers, or planes with negative stride) - add '%' and '=' as operators to custom shaders, matching mpv - add `pl_vulkan.(un)lock_queue` for interop with other libraries - add `pl_frame.acquire/release` for better interop with hardware decoders. These are only called on an as-needed basis immediately before and after a frame is actually used for rendering, with only one frame being acquired at any given time - add `pl_film_grain_from_av` helper function - add support for configuring the swapchain color space on D3D11, using the existing pl_swapchain_colorspace_hint mechanism - add an entirely new ICC profile shader API, allowing ICC profiles to be persistently opened (pl_icc_open) and their metadata exposed, with explicit `pl_icc_decode` and `pl_icc_encode` operations instead of a single monolithic decode+apply step - add `pl_render_params.plane_up/downscaler`, allowing to override the upscaler/downscaler for subsampled chroma planes in particular - add `pl_filter_function/config.name` for debugging/logging purposes Changes: - pl_log_create is no longer an exported symbol, instead becoming versioned by the compiled API version. `pl_log_create` is now a macro expanding to the name of this versioned function - `pl_overlay_part` has been refactored, adding the new field `coords` to control the coordinate system relative to which the part is placed on-screen, as well as being generalized to support floating point positions - deprecate PL_HOOK_PRE_OVERLAY, as a result of overlays no longer being applied during the rendering pipeline - default `pl_color_map_params.gamut_mode` to PL_GAMUT_CLIP, replacing PL_GAMUT_DARKEN - DRM modifiers are now required for vulkan dmabuf interop - `pl_vulkan.queue_*` are now *always* set to valid queues for that operation type, even if it means including duplicates - `pl_render_image` with NULL image now reports itself as a blend pass (blending 0 frames) instead of a frame pass to the info callbacks - completely refactor/remove the old ICC/3DLUT shader API (`pl_icc_update`, `pl_icc_apply` etc.) - <libplacebo/shaders/icc.h> is now installed unconditionally, with `pl_icc_open` simply failing when built without lcms2 - versions of glslang before the new versioning scheme (10.x.x) are no longer supported Fixes and performance enhancements: - fix pl_tone_map_reinhard.param_min to prevent division by zero - fix left-over asserts preventing misaligned buffer uploads via pl_upload_plane - fix bug where emulated rgb textures had alpha incorrectly preinitialized to 0 instead of 1 - overlays are now always rendered onto the final blended image, solving various bugs and unexpected edge cases due to image overlays being blended in the middle of the rendering pipeline - fix a bug where tone-mapping without a state object resulted in broken behavior - allow `pl_shader_sample_polar` to work with external samplers or flipped textures without incurring a performance penalty - fix the behavior of pl_shader_sample_oversample, which was previously producing very wrong results - fix an issue where the dither depth was incorrectly picked in a number of edge cases - fix a number of issues with the H.274 film grain shader - fix a bug where grayscale images were slightly too green - fix a bug where `pl_vulkan.queue_transfer` was never set - fix possible UB in pl_opengl_wrap_tex on some drivers with broken texture channel depth queries - fix issue where some shader LUTs were being regenerated on every single frame rather than properly cached - fix shader compilation error on older GLSL - fix bug where images were sometimes undesiredly being scaled in linear light - fix SDR<->SDR tone-mapping to properly be a no-op (linear stretch) - fix use-after-free in pl_get_buffer2's error path - fix d3d11 build issues on older versions of the SDK - fix edge case where auto-detected vulkan in the absence of glslang/shaderc caused the build to fail - fix build issues with up-to-date vulkan SDK - fix issue where non-coherent buffer imports were used in ways not adhering to the non-coherent memory atom size - fix various issues and undefined behavior when flushing mapped buffers, especially for non-coherent memory - avoid some validation warnings about improper pipeline barriers - fix runtime error with up-to-date MoltenVK - fix issue where some pl_frame_mix structs resulted no frames being mixed, triggering an assertion - fix bug where overlays were drawn flipped onto flipped planes when rendering a NULL image - fix allocation alignment issues on some platforms (notably win32 i686) - fix compatibility issues with older macOS - fix error handling in pl_cond_timedwait - fix build issues with older vulkan versions - fix build issue of demos/sdlimage in some configurations