mirror of
https://github.com/mpv-player/mpv
synced 2025-01-03 05:22:23 +00:00
vo_gpu: skip DR for unsupported image formats
DR (direct rendering) works by having the decoder decode into the GPU staging buffers, instead of copying the video data on texture upload. We did this even for formats unsupported by the GPU or the renderer. This "worked" because the staging memory is untyped, and the video frame was converted by libswscale to a supported format, and then uploaded with a copy using the normal non-DR texture upload path. Even though it "works", we don't gain anything from using the staging buffers for decoding, since we can't use them for upload anyway. Also, staging memory might be potentially limited (what really happens is up to the driver). It's easy to avoid, so just skip it in these cases.
This commit is contained in:
parent
07753bbb4a
commit
342e36ea11
@ -3849,6 +3849,9 @@ static void gl_video_dr_free_buffer(void *opaque, uint8_t *data)
|
||||
struct mp_image *gl_video_get_image(struct gl_video *p, int imgfmt, int w, int h,
|
||||
int stride_align)
|
||||
{
|
||||
if (!gl_video_check_format(p, imgfmt))
|
||||
return NULL;
|
||||
|
||||
int size = mp_image_get_alloc_size(imgfmt, w, h, stride_align);
|
||||
if (size < 0)
|
||||
return NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user