summaryrefslogtreecommitdiffstats
path: root/video/out/placebo/ra_pl.c
Commit message (Collapse)AuthorAgeFilesLines
* ra_pl: add missing initializerKacper Michajłow2023-11-281-1/+1
|
* ra_pl: drop deprecated cached_program paramDudemanguy2023-11-051-7/+0
| | | | | This was deprecated in api version 322 which earlier than the current 6.338 version that mpv depends on. So remove it.
* ra_pl: drop PL_API_VER compatibility pathsNiklas Haas2023-08-181-65/+1
|
* options: transition commands from OPT_FLAG to OPT_BOOLChristoph Heinrich2023-02-211-0/+1
|
* options: transition options from OPT_FLAG to OPT_BOOLChristoph Heinrich2023-02-211-1/+0
| | | | | | c78482045444c488bb7948305d583a55d17cd236 introduced a bool option type as a replacement for the flag type, but didn't actually transition and remove the flag type because it would have been too much mundane work.
* libplacebo: fix enum type castKacper Michajłow2023-02-021-4/+4
|
* vo_gpu: implement VO_DR_FLAG_HOST_CACHEDsfan52023-01-231-0/+4
| | | | | | | | For OpenGL, this is based on simply comparing GL_VENDOR strings against a list of allowed vendors. Co-authored-by: Nicolas F. <ovdev@fratti.ch> Co-authored-by: Niklas Haas <git@haasn.dev>
* various: replace abort() with MP_ASSERT_UNREACHABLE() where appropriatesfan52023-01-121-1/+1
| | | | | | | | In debug mode the macro causes an assertion failure. In release mode it works differently and tells the compiler that it can assume the codepath will never execute. For this reason I was conversative in replacing it, e.g. in mpv-internal code that exhausts all valid values of an enum or when a condition is clear from directly preceding code.
* libplacebo: switch to new target format APINiklas Haas2022-02-031-1/+6
| | | | | `target_dummy` got deprecated in version v4.169. We unfortunately have to hide this behind an #if for the time being.
* libplacebo: switch to new GPU limits APIsNiklas Haas2022-02-031-6/+11
| | | | | `caps` is deprecated, and replaced by individual fields in `pl_glsl_version` / `pl_gpu_limits`.
* libplacebo: switch to v4 naming conventionNiklas Haas2022-02-031-31/+30
| | | | | All of these const struct pointers got typedefs, clean up the code accordingly.
* vo_gpu: stop hard-coding max compute group threadsPhilip Langdale2021-12-191-0/+1
| | | | | | | | | | We've been assuming that maximum number of compute group threads is never less than the 1024 defined by the desktop GL spec. Given that we haven't had working compute shaders for GLES and I guess the Vulkan spec defines at least as high a value, we've gotten away with it so far. But we should really look the value up and respect it.
* vo_gpu: libplacebo: simplify tex transfers for libplacebo 168+Niklas Haas2021-10-311-9/+19
| | | | | | | | | | | | Upstream libplacebo got refactored to use byte-sized strides rather than texel-sized strides. This commit makes mpv's ra_pl wrapper take advantage of that, rather than forcing a stride-fixing memcpy. Note that, technically, we would still need a stride fixing memcpy in cases when the true stride is not a multiple of the format's texel *alignment*, however this is a much rarer case and extremely unlikely to occur in practice, since all relevant formats use power-of-two texel alignments.
* vo_gpu: libplacebo: drop conditional code paths for old versionsNiklas Haas2021-10-041-19/+0
| | | | No longer needed with the bump to v3.104.
* vo_gpu: libplacebo: drop code deprecated in libplacebo v3Niklas Haas2021-10-041-9/+2
| | | | | This is only needed for back-compat with libplacebo v2, and will break due to upstream removal starting with libplacebo v4.
* vo_gpu: placebo: keep track of texture sample modeNiklas Haas2021-03-211-0/+4
| | | | | | This fixes an issue where dithering was effectively broken on libplacebo versions >= 103 because the dither texture was being sampled with edge-clamped rather than repeating semantics.
* vo_gpu: libplacebo: require v2.72.0Niklas Haas2021-02-231-51/+1
| | | | | | | | | | | | It's about a year old, and packaged pretty much everywhere that bothers to package libplacebo at all. Older versions are only a thing on LTS, which will probably also use older mpv so it works out. Starting with v2.72.0, libplacebo validates all of its parameters internally and turns them into function failures. Doing it twice is awfully redundant, so we can drop the parameter validation. Also allows us to drop some preprocessor macros.
* vo_gpu: placebo: update for upstream API changesNiklas Haas2020-12-041-2/+29
| | | | | | | The concept of sample/address modes was moved from `pl_tex` to `pl_desc_binding`. The `pl_tex_blit()` function also underwent an API change.
* vo_gpu: placebo: add fallback code for stride mismatchNiklas Haas2020-06-161-12/+52
| | | | | | | | | | | | | | | For cases in which the requirements of the GPU API prevent directly uploading a texture with a given stride, we need to fix the stride manually in host memory. This incurs an extra memcpy, but there's not much we can do about it. (Even in `ra_gl` land, the driver will just hide this memcpy from the user) Note: This code could be done better. It could only copy as many texels as needed, and it could pick a stride that's a multiple of `gpu->limits.align_tex_xfer_stride` for better performance. Patches welcome (tm) Fixes #7759
* vo_gpu: ra_pl: add timers supportNiklas Haas2020-05-161-0/+95
| | | | | | | | | | | | | | | Added in libplacebo v60, unfortunately with some changes in design that make it a bit of an awkward fit for the way timers are used in mpv. Timer queries in libplacebo don't support "start" and "stop"-style operations, and instead are attached directly to operations. The only sane way of implementing this in the ra API is to have a single 'active timer' that gets attached to every pass, taking care to sort distinct operations into distinct pl_timer queries within that ra_timer. This design unfortunately doesn't let us have multiple 'active timers' concurrently, similar to the current such limitation in ra_gl. But it's also not a big deal.
* video/out/gpu: Add a `storable` flag to ra_formatPhilip Langdale2019-07-081-0/+1
| | | | | | | | | | | | | | | | While `ra` supports the concept of a texture as a storage destination, it does not support the concept of a texture format being usable for a storage texture. This can lead to us attempting to create a texture from an incompatible format, with undefined results. So, let's introduce an explicit format flag for storage and use it. In `ra_pl` we can simply reflect the `storable` flag. For GL and D3D, we'll need to write some new code to do the compatibility checks. I'm not going to do it here because it's not a regression; we were already implicitly assuming all formats were storable. Fixes #6657
* vo_gpu: ra_pl: Add getter for pl_gpuPhilip Langdale2019-04-211-1/+6
| | | | | We need access to the underlying pl_gpu to make libplacebo calls from hwdecs.
* vo_gpu: vulkan: use libplacebo insteadNiklas Haas2019-04-211-0/+628
This commit rips out the entire mpv vulkan implementation in favor of exposing lightweight wrappers on top of libplacebo instead, which provides much of the same except in a more up-to-date and polished form. This (finally) unifies the code base between mpv and libplacebo, which is something I've been hoping to do for a long time. Note: The ra_pl wrappers are abstract enough from the actual libplacebo device type that we can in theory re-use them for other devices like d3d11 or even opengl in the future, so I moved them to a separate directory for the time being. However, the rest of the code is still vulkan-specific, so I've kept the "vulkan" naming and file paths, rather than introducing a new `--gpu-api` type. (Which would have been ended up with significantly more code duplicaiton) Plus, the code and functionality is similar enough that for most users this should just be a straight-up drop-in replacement. Note: This commit excludes some changes; specifically, the updates to context_win and hwdec_cuda are deferred to separate commits for authorship reasons.