1. 26 Dec, 2017 2 commits
  2. 25 Dec, 2017 6 commits
    • Niklas Haas's avatar
      vulkan: improve command polling/waiting · 4bb683f9
      Niklas Haas authored
      Redesign vk_poll_commands to only wait for the completion of some
      commands, rather than repeatedly waiting for all of them. Basically, we
      will only block once. This makes it much more useful for loops like
      “while (!condition) { wait for commands} ”
      
      For the scenario in which we *do* want to wait until all commands have
      completed, introduce a helper function “vk_wait_idle” which waits until
      the entire device is idle (all commands have been completed).
      4bb683f9
    • Niklas Haas's avatar
      shaders: fix segfault when using sh_lut with !ra · ab2201cc
      Niklas Haas authored
      `ra` can't always be dereferenced.
      ab2201cc
    • Niklas Haas's avatar
      shaders: GLSL 120 compat: round -> floor · 397a4ed0
      Niklas Haas authored
      round() is only available in GLSL 130+
      397a4ed0
    • Niklas Haas's avatar
      shaders: add high quality dithering · aa04f95b
      Niklas Haas authored
      The algorithm is ported from mpv; with some minor modifications (AVLFG
      -> rand()). Blue noise is internally preferred wherever possiblle, with
      ordered LUT being an alternative - and falling back to fixed function
      ordered and finally white noise when LUTs are not available.
      
      Also contains some minor other modifications (maximum shader literal LUT
      size, maximum dither depth)
      aa04f95b
    • Niklas Haas's avatar
      shaders: fix hdr peak detection segfault on uninit · 2dfb7066
      Niklas Haas authored
      I forgot to actually set obj->ra after initializing the shader object
      2dfb7066
    • Niklas Haas's avatar
      shaders: rework sh_lut mechanism · e2dabec9
      Niklas Haas authored
      1. Drop the use of UBOs and SSBOs; since not only are there unaddressed
         packing concerns, but they also don't really provide an advantage.
         Instead, use regular uniform floats (i.e. input variables with
         dim_v), but only do this by default if we have global inputs.
      
      2. Implement the missing case (SH_LITERAL)
      
      3. Improve the signature for the `fill` function.
      
      On my nvidia hardware, both SH_LITERAL and SH_UNIFORM sadly explode for
      large inputs - SH_UNIFORM exhausts the UBO size limits when using
      vulkan, mainly due to the vec4/float packing inefficiency. SH_LITERAL on
      the other hand just makes the nvidia shader compiler explode. Further
      investigation is required, but for small LUTs it should work
      nonetheless.
      e2dabec9
  3. 22 Dec, 2017 2 commits
    • Niklas Haas's avatar
      travis: fix python version · 59eab2cd
      Niklas Haas authored
      Apparently 3.5 is unavailable now
      59eab2cd
    • Niklas Haas's avatar
      shaders: refactor pl_shader_obj and add sh_lut · 456aa914
      Niklas Haas authored
      This refactors the way we store data like scaler LUTs, with the intent
      of generalizing it for other types of LUTs (e.g. dither matrix) in an
      easy-to-use but flexible way.
      
      Instead of trying to come up with sane semantics for who gets to use
      what fields inside a pl_shader_obj, we just abstract it away and let the
      caller deal with the *priv representation (as usual). Unfortunately,
      this requires "nesting" pl_shader_objs for cases like the sampler LUTs
      where we need to store information about the scaling kernel *and* the
      underlying LUT. But that's not too bad, I think.
      
      I had to rewrite the code that uses pl_shader_objs. Hopefully for the
      better.
      456aa914
  4. 30 Nov, 2017 2 commits
    • Niklas Haas's avatar
      dispatch: add partial support for rendering to subrects · 118e8b38
      Niklas Haas authored
      Still needs adjusting for the compute shader path, but the fragment
      shaders work for now. Also would benefit from setting a stencil, but
      I'll worry about performance issues like that once everything else
      works.
      118e8b38
    • Niklas Haas's avatar
      renderer: always align source planes to the refplane · c35010eb
      Niklas Haas authored
      Instead of the src_rect. This is needed if the src_rect is not an
      integer crop. In theory, we could still use the src_rect here as long as
      we make sure to take care of the correct src_rect in pass_scale_main,
      but doing it this way is more consistent and less error-prone; although
      slower.
      
      Since this renderer has been WIP for way too long, I'll focus on the
      easy solution rather than the ideal solution.
      c35010eb
  5. 16 Nov, 2017 1 commit
    • Marvin Scholz's avatar
      osdep: explicitly set a category mask for newlocale · e93f9589
      Marvin Scholz authored
      While on Linux it works fine to not specify one, as Linux will fill all
      not given ones from the POSIX locale, on BSD using `xlocale.h` this does
      not work.
      
      When no base locale is given, BSD uses the current locale and fills not
      matching bitmasks with values from that one, not with values from the
      POSIX locale.
      e93f9589
  6. 15 Nov, 2017 5 commits
  7. 12 Nov, 2017 1 commit
  8. 11 Nov, 2017 1 commit
  9. 10 Nov, 2017 6 commits
    • Niklas Haas's avatar
      README: update · 03cafade
      Niklas Haas authored
      Several things were outdated, or left over from an earlier version of
      libplacebo during which the scope and design wasn't entirely clear.
      Since I decided to rewrite most of the code instead of porting mpv, I
      changed the wording on some bits.
      
      Also add missing documentation and fix some errors.
      03cafade
    • Niklas Haas's avatar
      ra: explicitly mark stride as unsigned · 3692c260
      Niklas Haas authored
      To prevent anybody from getting any funny ideas
      3692c260
    • Niklas Haas's avatar
      renderer: add initial rough draft · 1668a0bb
      Niklas Haas authored
      This is mostly there to give us an idea of what the API will look like,
      and also adds some skeleton code to begin targetting it. Many features
      missing, only bilinear scaling supported, etc.
      
      For testing, we move the RA-agnostic tests over to ra_tests instead,
      since it's getting unscaleable to lump these all in with vulkan.c
      1668a0bb
    • Niklas Haas's avatar
      shaders: support dithering to depths greater than 32 · bc30c076
      Niklas Haas authored
      This blows up otherwise on 32-bit frame buffers. Honestly, we could
      probably just disable dithering for this case, but might as well write
      the code as general as possible.
      bc30c076
    • Niklas Haas's avatar
      shaders: slightly improve debugging diagnostics · eb67aea5
      Niklas Haas authored
      Better names to avoid clashing with other vertex attribs, more
      descriptive failures
      eb67aea5
    • Niklas Haas's avatar
      shaders: place shader inputs dynamically · 301bf233
      Niklas Haas authored
      Instead of hard-coding the bindings and position in pl_shader_res, place
      them dynamically once we have a better idea of the overall inputs. This
      is needed to enable shader merging without conflicting bindings /
      offsets. The logic is moved to pl_dispatch instead.
      301bf233
  10. 09 Nov, 2017 7 commits
    • Niklas Haas's avatar
      shaders: explicitly check texture params better · e886dd51
      Niklas Haas authored
      Debanding in particular requires linear sampling, and sh_bind in general
      requires 2D, sampleable textures.
      e886dd51
    • Niklas Haas's avatar
      shaders: mark pl_shader_sample_direct as resizeable · e8fac7a6
      Niklas Haas authored
      By just clearing the output_w/h again. This basically makes it an
      invisible operation as far as resizing is concerned, i.e. the result
      doesn't have to be cached before naive resizing again.
      e8fac7a6
    • Niklas Haas's avatar
      shaders: remove left-over redundant argument · 49de18df
      Niklas Haas authored
      This makes no more sense, since it's part of the color_repr.
      49de18df
    • Niklas Haas's avatar
      shaders: add sh_subpass / shader merging · 7465c43b
      Niklas Haas authored
      This adds the secondary shader as a subpass of the first shader;
      exposing it as a function (much like pl_shader_finalize). There is
      currently still no public shader merging API, but it could easily be
      built on top of this.
      
      This switches from void *tmp to ta_ref *tmp in order to avoid breaking
      memory allocated by the attached objects.
      7465c43b
    • Niklas Haas's avatar
      talloc: add TARRAY_CONCAT helper · 849b064b
      Niklas Haas authored
      This copies all elements from one array into another.
      849b064b
    • Niklas Haas's avatar
      talloc: add refcounting API · 83f6d883
      Niklas Haas authored
      This is a helper built on top of talloc, which maintains a refcounted
      container. The function `ta_ref_attach` is a bit special, in that it
      will attach a reference as a child of another talloc object such that
      freeing the talloc object (or its children) will deref the reference.
      
      Arguablly, it would probably be better to lump this into the extension
      header and make it part of core TA, but I want to avoid touching TA as
      much as possible.
      83f6d883
    • Niklas Haas's avatar
      shaders: add pl_deband_default_params · 72c5de26
      Niklas Haas authored
      This was missing for whatever reason.
      72c5de26
  11. 08 Nov, 2017 1 commit
  12. 06 Nov, 2017 6 commits