summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNiklas Haas <git@haasn.dev>2022-01-11 13:40:59 +0100
committerNiklas Haas <github-daiK1o@haasn.dev>2022-02-03 18:22:14 +0100
commitd59eb580077c7f7f830e91d4380838581f224e00 (patch)
tree2b7183eebcd1bb17782c97f0587c857ec521fe42
parentb2958670a3bf67653d861534ef6e21dd9309f5e0 (diff)
downloadmpv-d59eb580077c7f7f830e91d4380838581f224e00.tar.bz2
mpv-d59eb580077c7f7f830e91d4380838581f224e00.tar.xz
libplacebo: switch to new GPU limits APIs
`caps` is deprecated, and replaced by individual fields in `pl_glsl_version` / `pl_gpu_limits`.
-rw-r--r--video/out/placebo/ra_pl.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/video/out/placebo/ra_pl.c b/video/out/placebo/ra_pl.c
index b680580bd7..401da4e716 100644
--- a/video/out/placebo/ra_pl.c
+++ b/video/out/placebo/ra_pl.c
@@ -41,12 +41,17 @@ struct ra *ra_create_pl(pl_gpu gpu, struct mp_log *log)
ra->caps = RA_CAP_DIRECT_UPLOAD | RA_CAP_NESTED_ARRAY | RA_CAP_FRAGCOORD;
- if (gpu->caps & PL_GPU_CAP_COMPUTE)
+ if (gpu->glsl.compute)
ra->caps |= RA_CAP_COMPUTE | RA_CAP_NUM_GROUPS;
- if (gpu->caps & PL_GPU_CAP_PARALLEL_COMPUTE)
+ if (gpu->limits.compute_queues > gpu->limits.fragment_queues)
ra->caps |= RA_CAP_PARALLEL_COMPUTE;
- if (gpu->caps & PL_GPU_CAP_INPUT_VARIABLES)
+#if PL_API_VER >= 180
+ if (gpu->limits.max_variable_comps)
ra->caps |= RA_CAP_GLOBAL_UNIFORM;
+#else
+ if (gpu->limits.max_variables)
+ ra->caps |= RA_CAP_GLOBAL_UNIFORM;
+#endif
if (gpu->limits.max_tex_1d_dim)
ra->caps |= RA_CAP_TEX_1D;
@@ -56,7 +61,7 @@ struct ra *ra_create_pl(pl_gpu gpu, struct mp_log *log)
ra->caps |= RA_CAP_BUF_RO;
if (gpu->limits.max_ssbo_size)
ra->caps |= RA_CAP_BUF_RW;
- if (gpu->limits.min_gather_offset && gpu->limits.max_gather_offset)
+ if (gpu->glsl.min_gather_offset && gpu->glsl.max_gather_offset)
ra->caps |= RA_CAP_GATHER;
// Semi-hack: assume all textures are blittable if r8 is
@@ -65,9 +70,9 @@ struct ra *ra_create_pl(pl_gpu gpu, struct mp_log *log)
ra->caps |= RA_CAP_BLIT;
ra->max_texture_wh = gpu->limits.max_tex_2d_dim;
- ra->max_shmem = gpu->limits.max_shmem_size;
ra->max_pushc_size = gpu->limits.max_pushc_size;
- ra->max_compute_group_threads = gpu->limits.max_group_threads;
+ ra->max_compute_group_threads = gpu->glsl.max_group_threads;
+ ra->max_shmem = gpu->glsl.max_shmem_size;
// Set up format wrappers
for (int i = 0; i < gpu->num_formats; i++) {