1. 12 Jun, 2020 4 commits
  2. 06 Jun, 2020 16 commits
  3. 28 May, 2020 8 commits
    • Niklas Haas's avatar
      shaders/sampling: generalize PL_SHADER_SIG_SAMPLER2D · bacc24a0
      Niklas Haas authored
      This allows us to accept sampler types other than sampler2D. In
      principle, any sampler type is supported, but due to shaders/sampling
      being the only user of this API, we can restrict ourselves to only 2D
      samplers in the implementation. Notably, though, we also support e.g.
      PL_SAMPLER_RECT.
      bacc24a0
    • Niklas Haas's avatar
      opengl: add raw texture interop API · 663c8cb3
      Niklas Haas authored
      VLC needs this in order to integrate the pl_opengl abstraction into
      their OpenGL-based video output module.
      
      Closes #91
      663c8cb3
    • Niklas Haas's avatar
      shaders/sampling: handle PL_SAMPLER_RECT · e562b731
      Niklas Haas authored
      This just requires us to un-normalized the texture coordinates.
      e562b731
    • Niklas Haas's avatar
      dispatch: handle special sampler types · 30bd2231
      Niklas Haas authored
      We need to generate the correct uniforms depending on the sampler type,
      and also enable the OES_EGL_image_external extension crap.
      30bd2231
    • Niklas Haas's avatar
      gpu: add pl_tex_sampler_type to pl_tex objects · e15d4880
      Niklas Haas authored
      Since objects may have to be sampled differently depending on the type
      of texture, we need to encode this field into the `pl_tex` abstraction.
      
      I broke the API of `pl_tex_dummy_create`, but hopefully in a way that
      wasn't too bad.
      e15d4880
    • Niklas Haas's avatar
      shaders/colorspace: add overshoot prevention to peak detection · 09910b8c
      Niklas Haas authored
      The current algorithm can under-estimate the true peak due to smoothing,
      causing clipping on sudden spikes in scene brightness. To help combat
      this, simply stupidly add a 5% overshoot mergin to the detected peak
      value. Values subject to change.
      09910b8c
    • Niklas Haas's avatar
      dispatch: don't segfault on failed passes · f0f06d9b
      Niklas Haas authored
      Since `p->pass` is NULL on failed passes, the raster_ok check segfaults.
      Simply skip it in this case, since the pass is failed anyway so blend
      parameters don't matter.
      f0f06d9b
    • Niklas Haas's avatar
      shaders/colorspace: implement ITU-R BT.2390 · f793fc04
      Niklas Haas authored
      We make this the default tone mapping function because it's the de-facto
      standard in the industry. Unfortunately, it's quite a bit heavier than
      the other algorithms due to the extra PQ round trip needed during tone
      mapping.
      
      It's entirely possible that we could make the choice of whether to do
      things in PQ space or in linear light a choice completely independent of
      the tone mapping function itself, since arguably PQ's "perceptual
      uniformity" quality makes it a suitable space to do tone mapping in
      regardless of what function we use.
      
      That being said, I don't currently want to consider the headache of
      testing this all, so let's just implement it for BT.2390 and call it a
      day.
      f793fc04
  4. 27 May, 2020 1 commit
  5. 26 May, 2020 4 commits
    • Niklas Haas's avatar
      colorspace: fix default chroma location · 0c19ed29
      Niklas Haas authored
      Simple oversight. This should be PL_CHROMA_LEFT, not PL_CHROMA_TOP_LEFT.
      Our own documentation gets it right, I just had the wrong name in my
      head when writing the code.
      0c19ed29
    • Niklas Haas's avatar
      shaders/custom: implement OFFSET ALIGN · 430aa2f2
      Niklas Haas authored
      Tested on KrigBilateral. Hopefully not too terribly broken.
      
      Fixes #88
      430aa2f2
    • Niklas Haas's avatar
      shaders/custom: fix rects for cropped inputs · aa73a1a3
      Niklas Haas authored
      Rather than using the `params->rect`, we should generally be ignoring it
      in favor of the raw texture dimensions, and only update the rect
      accordingly.
      aa73a1a3
    • Niklas Haas's avatar
      colorspace: treat PL_CHROMA_UNKNOWN as _TOP_LEFT · 04d258da
      Niklas Haas authored
      A lot of subsampled content out there is untagged, but should be treated
      as _TOP_LEFT content (the de-facto standard chroma subsampling mode).
      However, we effectively treat _UNKNOWN as PL_CHROMA_CENTER. To fix this,
      make pl_chroma_location_offset explicitly default the chroma location.
      
      Since a lot of users currently just call that function on the chroma
      planes always (regardless of subsampling), introduce a new helper
      function `pl_image_set_chroma_location` to only set the plane shift for
      actually subsampled planes.
      
      Annoying API break, but it is what it is.
      04d258da
  6. 25 May, 2020 7 commits