1. 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
  2. 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.
    • 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.
    • 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.
    • Niklas Haas's avatar
      demos/plplay: minor fixes · c8010c4e
      Niklas Haas authored
      Delete leftovers, and fix some error messages.
    • Niklas Haas's avatar
      renderer: fix deprecated struct name in comment · 3ba01d2a
      Niklas Haas authored
      Reference to the deprecated struct `pl_render_target`.
  3. 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.
    • 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.
    • 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.
    • Niklas Haas's avatar
      format: fix weird floating point printing edge case · 68c2e806
      Niklas Haas authored
      We really need a better function for this.
    • 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.
    • Niklas Haas's avatar
      gcovr: exclude demos/ · 5f3d0cb9
      Niklas Haas authored
      They don't contribute anything meaningful to the test framework.
    • 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).
    • 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
      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.
    • 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 /
      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.
    • 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.
  4. 23 Mar, 2021 2 commits
    • 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
    • Niklas Haas's avatar
      filters: rename pl_filter_triangle/box to bilinear/nearest · b6d393d7
      Niklas Haas authored
      I have no idea why I ever gave these such confusing names. Just rename
      them and keep around the old names for backwards compatibility.
      API bump because this is technically an ABI break (symbol rename).
  5. 21 Mar, 2021 2 commits
    • Niklas Haas's avatar
      demos: build both glfw and sdl · 10913533
      Niklas Haas authored
      Apparently GLFW has a habit of not working on Wayland, because they
      hard-code the platform at compile time. Might as well just provide all
      four variants, who really cares about a few extra binaries?
      The proper solution would be to make loading the windowing system
      dynamic at runtime, but that probably requires handling command line
      arguments and I can't really be bothered.
      Also suppress a warning in the sdl code by rewriting it slightly.
    • Niklas Haas's avatar
      dither: suppress warning with NDEBUG · 8e535ed2
      Niklas Haas authored
  6. 18 Mar, 2021 2 commits
  7. 17 Mar, 2021 1 commit
    • Niklas Haas's avatar
      demos: refactor components and integrate into build system · c6f9fb97
      Niklas Haas authored
      Major refactor of the demos/ directory, accomplishing a number of goals:
      1. Allowing easy switching between OpenGL and Vulkan variants.
      2. Supporting both GLFW and SDL2, chosen at compile time. The window
         management itself was made entirely modular for this purpose.
      3. Refactor all of the demo programs atop these new abstractions.
      4. Building them correctly and automatically (via meson).
      I also plan on factoring out the nuklear code to its own helper, but I
      avoided making that part of the same commit to prevent it from blowing
      up any further.
  8. 16 Mar, 2021 1 commit
  9. 12 Mar, 2021 1 commit
    • Niklas Haas's avatar
      renderer: fix memory leak · 2d2aafff
      Niklas Haas authored
      Introduced by 8ef0f369, the `psh` plane shader needs to be aborted
      even on a successful subpass merge.
      Maybe this API should be redesigned. Oh well.
      Fixes #130
  10. 11 Mar, 2021 1 commit
  11. 09 Mar, 2021 9 commits
  12. 07 Mar, 2021 1 commit
  13. 03 Mar, 2021 4 commits
    • Niklas Haas's avatar
      ci: reorganize CI jobs · 5b0ef42d
      Niklas Haas authored
      - don't execute llvmpipe jobs if compiling fails
      - don't execute *san jobs if test-gpu fails
      - rename everything to make it clearer what's being tested
    • Niklas Haas's avatar
      tests: fix/improve REQUIRE() failure output · a5a2b35d
      Niklas Haas authored
      Missing newline, also make it more easily searchable
    • Niklas Haas's avatar
      demos: add nuklear UI example · da42e00d
      Niklas Haas authored
      Mostly a shitty proof concept, but it runs.
      I plan on expanding this demo in the future, but for now it works as a
      sufficient stand-alone example, so I want to get it merged.
    • Niklas Haas's avatar
      dispatch: add support for dispatching custom vertices · df960521
      Niklas Haas authored
      This is actually easier accomplished than expected. Hugely useful for
      the `nuklear` demo I'm working on, and in theory also allows stuff like
      VR integration using custom vertices, although it does prevent the use
      of e.g. sampling shader functions (though this can be mitigated by using
      the custom shader sampler signature stuff).
      Also builds off the previous commit by allowing vertex shaders to access
      _all_ shaders descriptors/variables, even though the vast majority of
      our vertex shaders don't care.
      As an aside, also expose a good blending mode to use for typical alpha
      blending. Didn't feel like making a separate ABI bump for this.