1. 16 Mar, 2021 1 commit
  2. 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
      2d2aafff
  3. 11 Mar, 2021 1 commit
  4. 09 Mar, 2021 9 commits
  5. 07 Mar, 2021 1 commit
  6. 03 Mar, 2021 11 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
      5b0ef42d
    • Niklas Haas's avatar
      tests: fix/improve REQUIRE() failure output · a5a2b35d
      Niklas Haas authored
      Missing newline, also make it more easily searchable
      a5a2b35d
    • 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.
      da42e00d
    • 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.
      df960521
    • Niklas Haas's avatar
      vulkan: allow vertex shaders to access descriptors / constants · 71a228dc
      Niklas Haas authored
      This doesn't really come with a performance penalty, and enabling them
      can be useful when using the pl_pass_run API directly, in which case
      vertex shaders might want to access descriptors or push constants.
      71a228dc
    • Niklas Haas's avatar
      gpu: add support for indexed draw calls · 2f49f699
      Niklas Haas authored
      This is needed for nuklear, in particular. Not really a huge hassle for
      us to support, so we might as well.
      
      This commit also adds support for `pl_pass_run_params.buf_offset` to
      both vulkan and opengl, which was previously completely forgotten.
      2f49f699
    • Niklas Haas's avatar
      demos: factor common GLFW code out of demos · 565a532b
      Niklas Haas authored
      This simplifies the demos to focus on their specific logic rather than
      the window creation boilerplate, and also allows me to expand the amount
      of demos without needing to re-duplicate this logic over and over again.
      565a532b
    • Niklas Haas's avatar
      opengl: fix #includes in opengl.h · aff33f5f
      Niklas Haas authored
      1. Use global include, rather than relative, like everything else
      2. Also include the swapchain headers, for consistency with vulkan.h
      aff33f5f
    • Niklas Haas's avatar
      opengl: ensure FBO format uniqueness · d88b3371
      Niklas Haas authored
      This avoids invalidating the pl_pass cache every time the FBO gets
      reinitialized, by making sure that the FBO format pointer remains the
      same unless the actual format changes in a detectable way.
      
      Probably not the most elegant solution here (maybe there should only
      always be one FBO format per swapchain?), but it works.
      d88b3371
    • Niklas Haas's avatar
      gpu: drop redundant parameter validation · 5d2ab4d3
      Niklas Haas authored
      This is already covered by the index test, since that cap is required to
      create passes with variables.
      5d2ab4d3
    • Niklas Haas's avatar
      gpu: improve wording on target validation · 5f2b93d8
      Niklas Haas authored
      This variable being called `tex` makes it a bit misleading.
      5f2b93d8
  7. 23 Feb, 2021 4 commits
  8. 22 Feb, 2021 11 commits
    • Niklas Haas's avatar
      vulkan: include line information on failed calls · 52ef301f
      Niklas Haas authored
      Might as well.
      52ef301f
    • Niklas Haas's avatar
      tests: include line information on failing tests · a10cf8e6
      Niklas Haas authored
      I have no idea why I didn't do this before.
      a10cf8e6
    • Niklas Haas's avatar
      opengl: log EGL_EXTENSIONS · fef90e06
      Niklas Haas authored
      Semi-useful for debugging purposes.
      fef90e06
    • Niklas Haas's avatar
      opengl: more liberally set pl_fmt.emulated · 1f42616c
      Niklas Haas authored
      This hint doesn't matter a whole lot because it doesn't really prevent
      the format from being used for anything, but it does help prevent the
      test framework from erroring on older implementations that don't
      natively support these formats.
      1f42616c
    • Niklas Haas's avatar
      ci: suppress MSAN failures · 4904c22c
      Niklas Haas authored
      Annoying.
      4904c22c
    • Niklas Haas's avatar
      vulkan: suppress errors for benign race condition · f2342aef
      Niklas Haas authored
      The vulkan layer likes to emit errors about perfectly valid API usage in
      this case, owing to an unresolvable race condition in the specification.
      This usage is fine in practice, but the layer complains about it.
      Suppress this VUID.
      
      cf. https://github.com/KhronosGroup/Vulkan-ValidationLayers/issues/1340
      f2342aef
    • Niklas Haas's avatar
      renderer: pick fbo format based on the number of components · aa066d1d
      Niklas Haas authored
      This avoids wasting memory bandwidth rendering to 4-component float FBOs
      when we only need 2 components (e.g. for chroma debanding).
      
      Also, print the format of created textures to improve log legibility.
      aa066d1d
    • Niklas Haas's avatar
      shaders/sampling: avoid scaling unnecessary components · 66857583
      Niklas Haas authored
      Avoid unnecessary vec4 arithmetic for components we're not interested
      in. This was already done for the polar compute and gather cases, this
      commit extends that optimization to the non-gather and ortho cases.
      66857583
    • Niklas Haas's avatar
      tests: test chroma merging code · e540f3d1
      Niklas Haas authored
      Since a hook on PL_HOOK_CHROMA_INPUT forces plane merging, we can abuse
      this to make sure this code gets tested properly.
      e540f3d1
    • Niklas Haas's avatar
      renderer: avoid unnecessary anamorphic scaling before plane merging · 93da0318
      Niklas Haas authored
      This can happen in the case of slight aspect ratio mismatches between
      the target and image, in which case we end up performing fractional
      cropping. However, currently, this causes a pathological mismatch
      between the refplane and the desired crop, which ends up being
      (erroneously) scaled away before plane merging. Not a huge deal, but
      waste of performance and worse for quality. Fix it by moving all
      subpixel crops to the main scaler.
      
      Note that this means we will get an incorrect scaling ratio in the case
      where the plane scaler ends up becoming the main scaler. I don't think
      there's a fundamental solution here other than replicating the
      `need_fbo` logic from pass_scale_main.
      
      Maybe in general we should move all of the logic for determining which
      operations to perform to a common function that runs once, at the
      beginning, and caches all results.
      93da0318
    • Niklas Haas's avatar
      renderer: merge similar planes before heavy operations · 8ef0f369
      Niklas Haas authored
      This makes most types of planar operations faster, especially
      scaling, debanding, AV1 grain application and other plane shaders.
      Care needs to be taken to avoid doing this unnecessarily though, to
      avoid an FBO roundtrip when there's no point.
      
      Note that we try re-using the same plane texture format if possible, and
      only pick as many components for the FBO as we deem necessary. This cuts
      down on memory bandwidth.
      
      Closes #26
      8ef0f369
  9. 20 Feb, 2021 1 commit
    • Niklas Haas's avatar
      string: fix reliance on non-portable exp10 · e48a1622
      Niklas Haas authored
      Between checking at config time and spamming the code with more #ifdef,
      hard-coding the pow(10.0, x) call in what's potentially a hot path,
      and just copy/pasting the musl implementation, I think copy/pasting is
      the easiest solution that's the least likely to create future headaches.
      
      Closes #127
      e48a1622