diff options
Diffstat (limited to 'video/out/hwdec')
-rw-r--r-- | video/out/hwdec/hwdec_cuda.c | 2 | ||||
-rw-r--r-- | video/out/hwdec/hwdec_cuda.h | 3 | ||||
-rw-r--r-- | video/out/hwdec/hwdec_cuda_gl.c | 3 |
3 files changed, 8 insertions, 0 deletions
diff --git a/video/out/hwdec/hwdec_cuda.c b/video/out/hwdec/hwdec_cuda.c index 3edc58c6eb..2a2b296ccd 100644 --- a/video/out/hwdec/hwdec_cuda.c +++ b/video/out/hwdec/hwdec_cuda.c @@ -249,6 +249,8 @@ static int mapper_map(struct ra_hwdec_mapper *mapper) goto error; } } + if (p_owner->do_full_sync) + CHECK_CU(cu->cuStreamSynchronize(0)); error: eret = CHECK_CU(cu->cuCtxPopCurrent(&dummy)); 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); diff --git a/video/out/hwdec/hwdec_cuda_gl.c b/video/out/hwdec/hwdec_cuda_gl.c index c87c372cfa..0e6160da87 100644 --- a/video/out/hwdec/hwdec_cuda_gl.c +++ b/video/out/hwdec/hwdec_cuda_gl.c @@ -164,6 +164,9 @@ bool cuda_gl_init(const struct ra_hwdec *hw) { } } + // We don't have a way to do a GPU sync after copying + p->do_full_sync = true; + p->ext_init = cuda_ext_gl_init; p->ext_uninit = cuda_ext_gl_uninit; |