summaryrefslogtreecommitdiffstats
path: root/video/out/hwdec/hwdec_cuda.h
diff options
context:
space:
mode:
authorPhilip Langdale <philipl@overt.org>2019-09-28 07:57:11 -0700
committerJan Ekström <jeebjp@gmail.com>2019-09-28 19:24:24 +0300
commit8c1f94f0e711a40617ab63cd7c439cdc5466aec5 (patch)
treebd099745f45fb667f0410ef6a6603751d2ae63b7 /video/out/hwdec/hwdec_cuda.h
parentc940d7dc8ccdc572ab2cd90ab6e69a8697a1df00 (diff)
downloadmpv-8c1f94f0e711a40617ab63cd7c439cdc5466aec5.tar.bz2
mpv-8c1f94f0e711a40617ab63cd7c439cdc5466aec5.tar.xz
vo_gpu: hwdec_cuda: Synchronise OpenGL Interop
Previously, there appeared to be implicit synchronisation in the GL interop path, and we never observed any visual glitches. However, recently, I started seeing stuttering in the GL path and on closer examination it looked like read-before-write behaviour where GL would display an old frame again rather than the current one. After verifying that disabling hwdec made the problem go away, I tried adding a cuStreamSynchronize() after the memcpys and that also resolved the problem, so it's clearly sync related. cuStreamSynchronize() is a CPU sync and so more heavy-weight than you want, but it's the only tool we have. There is no mechanism defined for synchronising GL to CUDA (It looks like there is a way to synchronise CUDA to EGL but it appears one way and so wouldn't directly address this problem). Anyway, empirically, the output now looks the same as with hwdec off.
Diffstat (limited to 'video/out/hwdec/hwdec_cuda.h')
-rw-r--r--video/out/hwdec/hwdec_cuda.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/video/out/hwdec/hwdec_cuda.h b/video/out/hwdec/hwdec_cuda.h
index fc0b3e97f8..1d42505179 100644
--- a/video/out/hwdec/hwdec_cuda.h
+++ b/video/out/hwdec/hwdec_cuda.h
@@ -32,6 +32,9 @@ struct cuda_hw_priv {
// Stored as int to avoid depending on libplacebo enum
int handle_type;
+ // Do we need to do a full CPU sync after copying
+ bool do_full_sync;
+
bool (*ext_init)(struct ra_hwdec_mapper *mapper,
const struct ra_format *format, int n);
void (*ext_uninit)(const struct ra_hwdec_mapper *mapper, int n);