1. 06 Apr, 2021 3 commits
    • Niklas Haas's avatar
      utils/libav: clarify lifetime of `pl_upload_avframe` · 77928eac
      Niklas Haas authored
      Turns out I actually made this very mistake. Oops.
      77928eac
    • Niklas Haas's avatar
      demos: reduce verbosity across the board · af12b592
      Niklas Haas authored
      No reason for this confusing `demo_context()` anyway, just pick a
      suitable verbosity level for each demo. In particular, `plplay` was way
      too spammy.
      af12b592
    • Niklas Haas's avatar
      tests/fuzz: add shaders fuzzer · 1f2f2b6d
      Niklas Haas authored
      Fuzz various patterns of creating and combining shaders, including
      subshaders and various types of attached resource.
      
      The API fuzzing is realized by iterating through a plaintext string
      describing the order of operations to perform, using a simple
      stack-based shader combinator language.
      1f2f2b6d
  2. 05 Apr, 2021 4 commits
  3. 04 Apr, 2021 6 commits
  4. 02 Apr, 2021 1 commit
    • Niklas Haas's avatar
      ci: delete unused cross files · 6881d3ab
      Niklas Haas authored
      These are pulled from the CI image anyway. Their presence in the repo
      itself makes no sense since all of the information inside it is
      environment-specific, meaning it only works on the developer's
      machine(tm).
      
      Unfortunately the reality of cross compiling in 2021 is that people will
      just have to do it themselves. Which is probably irrelevant anyway
      because who the fuck is manually cross-compiling stuff instead of
      relying on existing distro tools to do it for them?
      6881d3ab
  5. 01 Apr, 2021 4 commits
  6. 31 Mar, 2021 5 commits
    • Niklas Haas's avatar
      demos/plplay: add support for loading custom shaders · 0dc3d06d
      Niklas Haas authored
      Now I *finally* have a good test platform for this stuff, especially
      obscure interactions between shader order and such.
      0dc3d06d
    • Niklas Haas's avatar
      shaders/custom: fix COMPUTE parsing · 2c49cdc0
      Niklas Haas authored
      In the switch to `pl_str_parse_int`, we forgot to actually strip the
      line before and after parsing.
      
      Additionally, `out->is_compute` was accidentally never set to true.
      2c49cdc0
    • Niklas Haas's avatar
      renderer: fix segfault when using custom hooks · c290d27d
      Niklas Haas authored
      Oops. HASH_PTR overwrite this by NULL, which was not intended.
      c290d27d
    • Niklas Haas's avatar
      demos/plplay: add GUI for loading custom LUTs · 2449ba51
      Niklas Haas authored
      Implemented using drag&drop region because nuklear doesn't provide
      anything resembling a file picker dialog.
      
      This is only for `pl_render_params.lut`, not for image/target LUTs. This
      is obviously suboptimal, but I need a better place to override those.
      2449ba51
    • Niklas Haas's avatar
      demos: add support for file drag&drop · 287684ab
      Niklas Haas authored
      I've decided this is by far the easiest way to avoid having to implement
      a file picker dialog, which would be significantly harder.
      
      Ideally we should support loading new files in plplay itself this way,
      but I couldn't be bothered implementing this yet.
      287684ab
  7. 30 Mar, 2021 1 commit
    • Niklas Haas's avatar
      renderer: only force-enable 3DLUT for actual conversions · fcd80494
      Niklas Haas authored
      This logic is not perfect, but good enough for what's essentially a
      debug feature. This (conservatively) avoids forcing an ICC for what we
      essentially know is a no-op transformation.
      
      Importantly, this somewhat relaxed check is never a false negative.
      Also rewrite the logic a bit to reduce symbol clutter.
      
      Fixes #134
      fcd80494
  8. 29 Mar, 2021 5 commits
    • Niklas Haas's avatar
      filters: refactor and expand filter presets · 80ab65fd
      Niklas Haas authored
      Rename this to pl_filter_preset to make the intent clearer, and add an
      extra field `description` to provide a friendlier name.
      
      In addition to this change, re-order the list to move the popular
      filters up to the top of the list, as well as adding a "none" entry
      corresponding to the built-in sampling.
      
      Finally, add pl_frame_mixers to provide frame mixer presets.
      
      Update plplay to use these new fields/structs.
      80ab65fd
    • Niklas Haas's avatar
      colorspace: add color temperature adjustment · 8a1c10f0
      Niklas Haas authored
      In theory, this is not quite the right place to do this adjustment,
      because it's applied in gamma light. But the alternative fix here, I
      think, would be making `pl_renderer` smart enough to apply these
      controls on its own. Plus, I don't think this feature is worth the extra
      API complexity of somehow moving it to a separate location. The more we
      can roll into this struct, the better.
      
      Supporting this, a helper is provided to compute the CIE xy coordinates
      for a given color temperature, as well as a function to compute a
      chromatic adaptation matrix.
      8a1c10f0
    • Niklas Haas's avatar
      utils: add PL_CLAMP helper · fabeb4f1
      Niklas Haas authored
      I noticed that a couple of usages of PL_MIN(PL_MAX and vice versa
      involve a wasteful double evaluation. Plus, the argument order of
      PL_CLAMP is way easier to remember.
      fabeb4f1
    • Niklas Haas's avatar
      demos/plplay: minor fixes · c8010c4e
      Niklas Haas authored
      Delete leftovers, and fix some error messages.
      c8010c4e
    • Niklas Haas's avatar
      renderer: fix deprecated struct name in comment · 3ba01d2a
      Niklas Haas authored
      Reference to the deprecated struct `pl_render_target`.
      3ba01d2a
  9. 26 Mar, 2021 10 commits
    • Niklas Haas's avatar
      README: add screenshot of plplay · 0b9f1eca
      Niklas Haas authored
      It would be cool if I could figure out more screenshots to add, maybe
      some sort of comparison between bilinear and jinc scaling or w/e.
      0b9f1eca
    • Niklas Haas's avatar
      utils/frame_queue: guard against future PTS · 7329f2c2
      Niklas Haas authored
      Fixes at least one abort() by turning it into a more reasonable
      fallback to zOH semantics.
      
      Not the proper solution to #133, but better than crashing.
      7329f2c2
    • Niklas Haas's avatar
      shaders/colorspace: make gamut warning less broken · 46ab5528
      Niklas Haas authored
      The current logic either just saturates the pixel or else does whatever.
      I realized there's no really sane way to "invert" an out-of-gamut color,
      and even if we did invert it in a reasonable manner, it's still less
      visible than just making it pink.
      
      Context provides better clues for what's out of gamut, anyways.
      46ab5528
    • Niklas Haas's avatar
      format: fix weird floating point printing edge case · 68c2e806
      Niklas Haas authored
      We really need a better function for this.
      68c2e806
    • Niklas Haas's avatar
      demos/plplay: add UI with settings integration · 20a0b9b3
      Niklas Haas authored
      This is actually insanely useful for testing.
      
      Still missing some way to load custom shaders / 3DLUTs / ICC profiles,
      unfortunately. Also missing ICC-related settings, for reasons which may
      require an API change.
      20a0b9b3
    • Niklas Haas's avatar
      gcovr: exclude demos/ · 5f3d0cb9
      Niklas Haas authored
      They don't contribute anything meaningful to the test framework.
      5f3d0cb9
    • Niklas Haas's avatar
      renderer: correctly invalidate mixer cache when render params change · 3207144b
      Niklas Haas authored
      Annoying but necessary. Otherwise this just creates unintuitive
      behaviour, especially when displaying the same frame over and over again
      (which is the default pl_queue semenatics for single frame streams).
      3207144b
    • Niklas Haas's avatar
      tests: add test case for pl_queue functions · cbd9f0e6
      Niklas Haas authored
      Replaces the old hacky manual pl_frame_mix test, mostly as a matter of
      convenience.
      
      Could probably also somehow test that it does the right logic, but
      that's a lot harder to do this way and a lot easier to do visually.
      cbd9f0e6
    • Niklas Haas's avatar
      demos/plplay: rewrite on top of proper decode/present loop · 4b0657fc
      Niklas Haas authored
      This threads the decoder loop to make it run asynchronously from the
      present loop, so we can fetch frames from it as fast as possible /
      required.
      
      We also switch to the new `pl_queue` API, using it to translate frame
      timestamps into `pl_frame_mix` structs suitable for interpolation.
      
      This currently defaults on, but I still need to hook it up to the UI.
      4b0657fc
    • Niklas Haas's avatar
      utils/frame_queue: add new interpolation helper · 0e594407
      Niklas Haas authored
      The API for `pl_frame_mix` is currently a bit abstract and high-level.
      Most clients will probably not care to reimplement the massive amounts
      of logic that go into constructing a proper frame queue.
      
      Enter `pl_queue`, the solution for all your frame queuing needs! This
      will interface with the decoder via your choice of a push or pull API,
      and translate all decoded frames into an abstract internal timeline,
      `pl_frame_mix` slices of which can be probed for arbitrary timestamps.
      
      As an extra bonus, this also contains code for things like FPS
      estimation and VPS (vsyncs per second) estimation, somewhat mirroring
      the logic in e.g. mpv's interpolation/display-sync code.
      
      It's worth pointing out that this is a rather severe API break for
      `pl_frame_mix`, but I'm pretty sure this API has absolutely zero users,
      given the massive amount of effort required to use it before this
      commit. So I didn't bother with backwards compatibility, aside from an
      API bump as usualy.
      0e594407
  10. 23 Mar, 2021 1 commit
    • Niklas Haas's avatar
      vulkan: blacklist FUCHSIA strings · ac44e8f1
      Niklas Haas authored
      Maybe one day we'll actually figure out how to make this python script
      exclude platform-specific stuff in a way that doesn't rely on hardcoding
      a list of strings to blacklist.
      
      One day.
      
      Fixes #131
      ac44e8f1