Skip to content
Snippets Groups Projects
  1. Sep 08, 2023
  2. Mar 10, 2023
  3. Feb 19, 2023
  4. Sep 21, 2022
    • Niklas Haas's avatar
      meson/opengl: refactor 'opengl-loader' · 16dc8a71
      Niklas Haas authored
      For symmetry with the vulkan code. See the previous commit for
      discussion and justification.
      16dc8a71
    • Niklas Haas's avatar
      meson/vulkan: refactor `vulkan-link` · 221c8ec9
      Niklas Haas authored
      Instead of a bool. This is an unfortunate config API break, but
      hopefully not a too drastic one as most people will have left this on
      the default setting. Even so, give it a new name to disambiguate it from
      the old setting.
      
      This change is a functional ipmrovement as it allows us to distinguish
      between 'auto' and 'enabled' for 'vulkan-link', up from the previous
      default of being effectively equivalent to 'auto'. I also wanted to
      simplify the code to distinguish more clearly between the headers and
      loader.
      
      A minor benefit of the variable renaming is that the value printed in
      the configuration summary now matches the option name.
      221c8ec9
  5. Jul 29, 2022
    • Niklas Haas's avatar
      opengl: add pl_opengl_params.get_proc_addr · 491a7af1
      Niklas Haas authored
      This finally gives users complete control over the GL loading mechanism,
      and also makes libdl optional.
      
      Mirror the vulkan-link option by making the opengl-loader option
      non-mandatory.
      491a7af1
  6. Mar 08, 2022
    • Niklas Haas's avatar
      meson: add debug-abort option · 448165a7
      Niklas Haas authored
      It's sometimes more convenient to get coredumps instead of plain stack
      traces, especially if you didn't have gdb attached to the process at the
      time.
      
      Note that, asymmetrically, we add pl_debug_abort() to the vulkan debug
      callbacks but not the opengl debug callbacks. This is motivated by
      vulkan debug errors mainly corresponding to API usage violations (should
      never happen!), whereas OpenGL debug errors mainly correspond to runtime
      errors (e.g. invalid GLSL files), which should not trigger an abort().
      
      (Note that you can also `(gdb) break pl_log_stack_trace`)
      448165a7
  7. Nov 13, 2021
    • Niklas Haas's avatar
      log: add stack trace printing helper · 79cfa9be
      Niklas Haas authored
      Using libunwind. Call this from non-crashing validation error paths. Not
      needed for asserts/aborts because they will typically generate
      equivalent coredumps.
      
      Makes debugging any sort of validation error slightly less annoying.
      Needs an exception for MSAN, though, because apparently MSAN can't track
      memory allocated by `backtrace_symbols`.
      79cfa9be
  8. Aug 28, 2021
  9. Jul 02, 2021
    • James Ross-Gowan's avatar
      d3d11: add initial implementation · be32ca68
      James Ross-Gowan authored
      Add a pl_gpu implementation that uses Direct3D 11. This uses SPIRV-Cross
      to translate shaders from GLSL to HLSL. In its current state, plplay
      works and the test suite passes with feature level 10_0 and up. (9_x is
      unlikely to ever pass due to runtime-enforced shader complexity limits.)
      
      Missing features include emulated texture formats, cached_program,
      `pl_gpu_limits.thread_safe`, and HDR/high bit depth support in
      pl_swapchain, though these shouldn't be too hard to implement.
      
      This also updates the GLFW demos to be able to use Direct3D 11 through
      GLFW_NO_API.
      
      Closes #18
      be32ca68
  10. Apr 06, 2021
  11. Apr 04, 2021
  12. Mar 17, 2021
    • 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.
      c6f9fb97
  13. May 29, 2020
  14. May 25, 2020
    • Niklas Haas's avatar
      vulkan: generate boilerplate instead of hand-writing it · dca1913c
      Niklas Haas authored
      Turns out I need to generate even more boilerplate than just this, so
      just write a shitty python script (inspired by RADV/mesa) to do the job.
      
      Makes python part of the build dependency of libplacebo, but meson
      already depends on python so nothing has changed.
      
      The CI URL for aarch64 needs to be updated to pull in python3-mako.
      dca1913c
  15. Apr 06, 2020
    • Niklas Haas's avatar
      opengl: add initial implementation · 3e94b695
      Niklas Haas authored
      This is missing support for texel buffers (which are considered optional
      anyway by the API), and also for some swapchain-related features (which
      I'm not sure in what way we even want to represent in our code).
      
      This is mainly here so we can get support for OpenGL-related GPU backend
      features in the context of e.g. shader generation.
      
      We also update the GLFW demo program to support using OpenGL. This is
      all still very primitive and rather untested.
      
      Closes #17.
      3e94b695
  16. Feb 05, 2020
    • Niklas Haas's avatar
      vulkan: load all function pointers indirectly · 91983120
      Niklas Haas authored
      We already had almost all of the infrastructure for this anyway, and
      there were legitimate use cases that benefit from this change. I decided
      to drop the extra `vk` prefix from our function pointers, because
      writing `VK(vk->vk` seemed a bit silly and doesn't provide any real
      advantages (tab completion etc. still work on the reduced function
      pointers, and development of new code can be done without loading the
      function pointers anyway).
      
      Users can also specify the vkGetInstanceProcAddr to use directly as part
      of the instance parameters, rather than directly. This API ended up
      slightly ugly, unfortunately, due to the mirroring of this get_proc_addr
      callback between the vulkan_params and the vk_inst_params, but oh well.
      This ugliness shouldn't affect the vast majority of users so I don't
      particularly care.
      
      Closes #75.
      91983120
  17. Aug 31, 2018
    • Niklas Haas's avatar
      meson: switch to using feature options · cc03351a
      Niklas Haas authored
      Annoyingly, this requires using =enabled/disabled instead of
      =true/false, but it's less boilerplate and more consistency in the long
      run to do things this way.
      cc03351a
  18. Jun 20, 2018
    • Niklas Haas's avatar
      spirv: add support for glslang · 654a6d3f
      Niklas Haas authored
      We can now use glslang directly instead of relying on libshaderc for
      everything. This requires a bit of bending over backwards, but it's
      doable.
      
      Fixes #36
      654a6d3f
  19. May 28, 2018
    • Niklas Haas's avatar
      shaders: add support for ICC profiles and 3DLUTs · eb14d3bd
      Niklas Haas authored
      Code taken from mpv, with some modifications. The shader stuff is from
      scratch, but lcms.c draws heavily from code I already wrote.
      
      This again uses LittleCMS 2, with which I've been very satisfied.
      Partially addresses #23.
      eb14d3bd
  20. Jan 11, 2018
    • Niklas Haas's avatar
      tests: add some simple benchmarks · 5e41228e
      Niklas Haas authored
      This just measures raw throughput by rendering to off-screen FBOs as
      fast as possible and seeing how many frames we got in X seconds. Very
      naive, but works for now.
      5e41228e
  21. Oct 12, 2017
Loading