Skip to content
Snippets Groups Projects
  1. May 21, 2020
    • Niklas Haas's avatar
      vulkan: always load VK_KHR_surface · e630b7ae
      Niklas Haas authored
      There's really no reason not to. Also clarify that these functions are
      not, in fact, "mandatory" instance-level function pointers.
      e630b7ae
    • Niklas Haas's avatar
      vulkan: clean up VK_KHR_swapchain handling · 41d4a7ab
      Niklas Haas authored
      This extension was treated as global in the past, but now that we have
      a proper extension framework we should just handle it like any other
      extension. Solves a very concrete issue where dependencies on e.g.
      VK_EXT_hdr_metadata were not satisfied if the user did not happen to
      enable this extension.
      
      Also check if the extension is loaded when we attempt actually creating
      a swapchain.
      41d4a7ab
    • Niklas Haas's avatar
      vulkan: fix vk_cmd_timer_end · 925b1b86
      Niklas Haas authored
      Forgot to un-mark timers as recording. Probably mostly benign, but could
      hypothetically cause issues.
      925b1b86
    • Niklas Haas's avatar
      renderer: assert if SAMPLER_NOOP implies scaling · 58e588cd
      Niklas Haas authored
      With ca1ebc, the mismatched shaders of the variety that 092229 was
      intending to solve should no longer be a possibility.
      
      If this is still the case, it's probably a bug. Assert instead.
      58e588cd
    • Niklas Haas's avatar
      renderer: replace round0 by truncf · bde7fc04
      Niklas Haas authored
      This function already exists.
      bde7fc04
    • Niklas Haas's avatar
      renderer: simplify offset rounding / plane alignment · ca1ebc94
      Niklas Haas authored
      The current logic could end rounding the plane up in both directions,
      inadvertently introducing an upscale by 1 pixel to the refplane, which
      not only forced an FBO indirection but also lowered the quality due to
      the effective resample. Furthermore, the code for adjusting the rect by
      the `rc` was wrong, since it failed to scale the "affine" part of the
      transformation down to the coordinate space of the plane.
      
      Simplify and fix this by only rounding the offset (making sure to always
      round towards 0 to have the best chance of "doing the right thing"), and
      also correctly scaling this offset when calculating the offsets for the
      individual planes.
      ca1ebc94
    • Niklas Haas's avatar
      renderer: force FBO indirection for mismatched shaders · 092229af
      Niklas Haas authored
      This can happen if e.g. the shader's output image is rounded up relative
      to the rect actually being sampled, for example when when users are
      sampling fractional parts of the image.
      092229af
    • Niklas Haas's avatar
      shaders: explicitly round some implicitly rounded floats · 18583d7c
      Niklas Haas authored
      Across the boards, "output sizes" and so forth are assumed to be
      integers, but a lot of the code generating them is based on floating
      point math. To make it clear what happens, make things consistent by
      using roundf() instead of implicit conversion (which may end up
      truncating etc.).
      18583d7c
    • Niklas Haas's avatar
      renderer: fix order of scaler-skip checks · 8f473413
      Niklas Haas authored
      The order these are written in currently means the second check never
      has a chance to get printed, because SAMPLER_NOOP implies
      SAMPLER_DIRECT.
      8f473413
  2. May 20, 2020
    • Niklas Haas's avatar
      vulkan: don't attempt resetting query pools on transfer queues · ea8f3e32
      Niklas Haas authored
      In theory there are various ways we could reconcile this difference, but
      for now, the easiest thing to do is to simply disable it.
      
      I'll try working on a way to bring back support for this, but I wanted
      to get this fix out of the way first.
      ea8f3e32
    • Niklas Haas's avatar
      shaders/custom: don't force OUTPUT fbo for szexprs · 1ce5ed24
      Niklas Haas authored
      09834c52 introduced a regression here that caused an unnecessary FBO
      indirection to occur for the (relatively common) case of user shaders
      consulting the dimensions of OUTPUT in their RPN expressions.
      
      OUTPUT apparently behaves weirdly. mpv should probably document this
      better. Even better would be to have had different names for the OUTPUT
      hook stage and the OUTPUT magic constant for RPN exprs. But it's
      probably too late for that now. Unless we want to rename the OUTPUT
      stage, which we totally could do.
      1ce5ed24
    • Niklas Haas's avatar
      shaders/custom: minor comment improvement · d1452f45
      Niklas Haas authored
      Also add a TODO for something I realized while staring at this code
      again.
      d1452f45
    • Niklas Haas's avatar
      shaders/av1: fix output size · c0d6a7d6
      Niklas Haas authored
      This shader is very definitively non-resizable. Flag it as such.
      c0d6a7d6
  3. May 19, 2020
  4. May 18, 2020
  5. May 17, 2020
    • Niklas Haas's avatar
      shaders/av1: document minimum GLSL version · 524ef50a
      Niklas Haas authored
      524ef50a
    • Niklas Haas's avatar
      shaders/av1: remove misleading comment · 7e0ad727
      Niklas Haas authored
      In practice the pre-grain texture is going to be a different pl_tex than
      the post-grain texture, so the "order" of operations does not really
      make sense in this context.
      7e0ad727
    • Niklas Haas's avatar
      shaders/colorspace: fix build error without lcms · e6dee250
      Niklas Haas authored
      The pl_3dlut_default_params was undefined in this case, but the renderer
      still referenced it.
      e6dee250
    • Niklas Haas's avatar
      colorspace: update interpretation of SDR white · ce9168d4
      Niklas Haas authored and Niklas Haas's avatar Niklas Haas committed
      Based on ITU-R Report BT.2408, and general recommendations within the
      industry, the "SDR white level", i.e. the level at which to map SDR into
      HDR signals, is not 100 cd/m^2 but a value closer to 203 cd/m^2.
      
      For PQ signals this results in a relatively straightforward change of
      the code, but for HLG signals things get more complicated. For HLG,
      rather than targeting a fixed brightness in cd/m^2, the recommendation
      is to map SDR white levels to the 75% point in HLG, which calculates to
      a value of about roughly 3.17955 in scene-referred space (where the
      nominal peak is at 12.0). To fit this into the libplacebo interpretation
      of these values (where 1.0 maps to the SDR white levels), we scale
      things down by this factor, giving rise to a new scene-referred signal
      range of 12.0/3.17955 = 3.774, and adjust the OOTF to compensate.
      
      This commit does put into question to what extent the default tone
      mapping settings need to be altered to account for this change in
      interpretation when going from HDR back to SDR.
      
      Also add tests to ensure this stuff round-trips.
      
      Bump the API version because, apart from the fact that we changed a
      public header, this is quite a drastic change in functionality.
      ce9168d4
    • Niklas Haas's avatar
      Revert "shaders: parent tmp onto sh instead of ctx" · f8dacaf7
      Niklas Haas authored
      This reverts commit 9c0d88fb.
      
      The xta_ref is not parented, it's attached to the ref it's counting.
      Should probably improve the documentation here or something.
      f8dacaf7
  6. May 16, 2020
    • Niklas Haas's avatar
      dispatch: add support for pl_timer queries · 90cd7fc6
      Niklas Haas authored
      Rather than add yet another field to the growing signature of these
      functions, I decided to do the sensible thing and just params-ify it.
      (When will I learn my lesson and just use params structs to begin with?)
      
      While this rather annoyingly requires completely breaking the API of a
      relatively common function, we're fortunately saved by the fact that I
      expect the majority of pl_dispatch uses to be libplacebo-internal.
      
      This commit also adds the use of such timers to the benchmark, giving us
      more accurate reporting of the raw GPU execution time.
      90cd7fc6
    • Niklas Haas's avatar
      vulkan: implement timer queries · e40aee5c
      Niklas Haas authored
      Some amount of care needs to be taken because not all queue families
      necessarily support writing timestamps, in particular some asynchronous
      transfer queues may not.
      e40aee5c
    • Niklas Haas's avatar
      gpu: add generic timer API · f484e9e6
      Niklas Haas authored
      By popular request. It can make sense to measure the execution time of
      individual shaders, *even though* they might be highly out-of-order and
      asynchronous with respect to each other.
      
      libplacebo's API makes no guarantees or assumptions about the sanity of
      how users will end up interpreting these values. But whatever, it's not
      a huge deal for us to provide them.
      
      To avoid the interpretation of these runtimes completely exploding, we
      don't implement any sort of "timer_begin" or "timer_end", and instead
      only allow users to associate a pl_timer with concrete commands of
      interest (in particular, pl_pass_run and pl_tex_upload/download), so
      that implementations can guarantee both halves of the timer query are
      written by the same command buffer.
      
      Also write some test cases, even though it's not implemented yet.
      f484e9e6
  7. May 15, 2020
Loading