1. 10 Oct, 2017 14 commits
  2. 09 Oct, 2017 11 commits
    • Niklas Haas's avatar
      shaders: variable consistency · 08bc153c
      Niklas Haas authored
      Always refer to a pl_shader as `sh`
      08bc153c
    • Niklas Haas's avatar
      shaders: allow soft-resetting pl_shader · de7bd468
      Niklas Haas authored
      Turns out this also solves the whole "but muh frequent re-allocations!"
      problem, without needing some sort of ugly bstr pool. AKA just make the
      user do it.
      
      To avoid leaking memory for descriptor/variable names, we move those to
      an explicit `tmp` object that we recycle when soft-resetting the shader.
      de7bd468
    • Niklas Haas's avatar
      ra: reduce amount of boilerplate for ra_fns · be45e214
      Niklas Haas authored
      be45e214
    • Niklas Haas's avatar
      ra: fix typo: ra_imer_stop -> ra_timer_stop · b99b34de
      Niklas Haas authored
      b99b34de
    • Niklas Haas's avatar
      ra: add namespace index query mechanism · 09f85771
      Niklas Haas authored
      More flexible than the previous "shared || non-shared" distinction. The
      extra flexibility is needed for Direct3D 11, but it also doesn't hurt
      code-wise.
      09f85771
    • Niklas Haas's avatar
      ra: nuke glsl_caps again · 26fe87fe
      Niklas Haas authored
      The texture gather thing is better off as a device-specific limit, and
      the shared binding thing needs to be redesigned anyway.
      26fe87fe
    • Niklas Haas's avatar
      spirv: port from mpv · 326c8944
      Niklas Haas authored
      Only supports libshaderc for now, until I have a clearer picture of what
      the requirements for getting the nvidia extension detected would be.
      
      Note entirely happy with the meson stuff, but eh; it'll work for now.
      326c8944
    • Niklas Haas's avatar
      context: redesign pl_context · 2b123863
      Niklas Haas authored
      Now uses a pl_context_params struct for global options instead of
      getters/setters, for consistency. (And because I don't anticipate the
      need to change these parameters dynamically)
      2b123863
    • Niklas Haas's avatar
      ra: refactor ra_var_layout · f3455890
      Niklas Haas authored
      1. This is made more flexible, by also allowing the code to access the
         current offset of the buffer. (Required for ra_d3d11)
      2. I changed my mind about the matrix order again, simply because doing
         it any other way is just absurd.
      f3455890
    • Niklas Haas's avatar
      ra: add explicit API checking · c8e1abed
      Niklas Haas authored
      This moves the burden of asserting all over the place out of
      implementations like ra_vk and into common code, where it can also be
      checked much more rigorously than we ever did before.
      
      This should catch plenty of bugs. Let's just hope nobody builds
      libplacebo with NDEBUG :^)
      c8e1abed
    • Niklas Haas's avatar
      ra: clarify and expand public API · 9d57c1db
      Niklas Haas authored
      Added some missing restrictions, added an explicit capability for
      storage images, and fixed some comments.
      9d57c1db
  3. 08 Oct, 2017 15 commits
    • Niklas Haas's avatar
      ra: refactor public API · 8dcab3f3
      Niklas Haas authored
      Hide the implementation struct and instead add explicit wrappers for
      every operation. These wrappers will also always be available, even if
      the corresponding feature is unimplemented.
      8dcab3f3
    • Niklas Haas's avatar
      shaders: add missing newline in GLSL() macro · c48e6acf
      Niklas Haas authored
      c48e6acf
    • Niklas Haas's avatar
      shaders: make hable() benefit from sig_peak · 3f9f07d7
      Niklas Haas authored
      Using the new glsl_header API, we can generate the hable function again.
      As an added bonus, do it using a fresh name.
      3f9f07d7
    • Niklas Haas's avatar
      shaders: split up into glsl_header and glsl_body · ba6cf9d5
      Niklas Haas authored
      For the same reason this was required in mpv: GLSL function
      declarations.
      ba6cf9d5
    • Niklas Haas's avatar
      meson.build: allow building a static library · b5124dbd
      Niklas Haas authored
      No reason to force this to be dynamic. The pkg-config unfortunately
      still seems to assume that it was built dynamically, but I think this is
      an upstream bug. Users who really want to build it statically will just
      have to live with that fact.
      b5124dbd
    • Niklas Haas's avatar
      meson.build: improve pkgconfig usage · 55aca4d2
      Niklas Haas authored
      Instead of manually generating the string, we can just pass the
      shared_library object here and it will automatically generate the right
      -L and -l flags.
      55aca4d2
    • Niklas Haas's avatar
      shaders: refactor variable definitions · ec6e5260
      Niklas Haas authored
      Group the variable state up into its own struct, which also includes
      metadata like whether or not the variable is dynamic.
      
      Instead of hard-coding static names for all variables, generate fresh
      identifiers and pass them around. (In theory, we could get away with
      just the `_N` variable names, but I want to keep around the
      human-friendly variable names for debugging purposes; so I went with the
      `_name_N` approach)
      
      Also change the ra_var interpretation back from column major to row
      major, to match the struct color_matrix/color_transform. This is
      probably more convenient for everybody involved, even though it makes
      `dim_m` sort of weird. The new helper functions should hopefully make
      that less painful anyway.
      
      As an aside, fixes a bug where the wrong luma coefficients were used for
      the inverse OOTF. Annoyingly, this makes it harder to detect when
      src_luma/dst_luma are required, so just always load the uniforms again.
      (It's not like it matters)
      ec6e5260
    • Niklas Haas's avatar
      082956d3
    • Niklas Haas's avatar
      meson.build: add pkg-config · 81e367fe
      Niklas Haas authored
      Also add some versioning policy. Basically, the policy I've decided on:
      
      1. majorver has abstract high-level semantics (e.g. major rewrite)
      2. apiver controls the public API (=soname), updated any time the public
         API is extended or reduced
      3. fixver is updated any time a fix is made without changing the API
      
      Additionally:
      - fixver resets on apiver changes
      - apiver never resets
      81e367fe
    • Niklas Haas's avatar
      shaders: fix the matrix order · e5c25606
      Niklas Haas authored
      This is supposed to be column major, but it seems I just flat out forgot
      to swap the indices when writing the "transpose" logic. Also add a
      comment to clarify that this is the intent.
      e5c25606
    • Niklas Haas's avatar
      shaders: skip loading unused some uniforms · 0e76746e
      Niklas Haas authored
      No reason to keep them around.
      0e76746e
    • Niklas Haas's avatar
      shaders: make the ootf non-public · e902300e
      Niklas Haas authored
      I just realized this depends on `src_luma`, which is a privately defined
      variable. It also doesn't really make sense anyway, users should use the
      more general `color_map` function which is a no-op when not specifying
      the other parameters.
      e902300e
    • Niklas Haas's avatar
      ra: fix ra_var_glsl_type_name · 9df6364c
      Niklas Haas authored
      Had a typo for vec4 causing it to be treated as vec3
      9df6364c
    • Niklas Haas's avatar
      4b4784d7
    • Niklas Haas's avatar
      shaders: fix extern const struct definition · 3b2a6c9f
      Niklas Haas authored
      Was missing 'extern'
      3b2a6c9f