From 4701c5ba4f87ca35f66d574e89eba8c7d4514783 Mon Sep 17 00:00:00 2001 From: Niklas Haas Date: Fri, 27 Oct 2017 16:54:27 +0200 Subject: vo_gpu: fix ra_tex_upload_pbo for 2D textures params->rc was ignored in the calculation for the buffer size. I fucking hate this stupid ra_tex_upload signature where *rc is randomly relevant or not. --- video/out/gpu/utils.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'video') diff --git a/video/out/gpu/utils.c b/video/out/gpu/utils.c index daf570cba5..6a2abae1b2 100644 --- a/video/out/gpu/utils.c +++ b/video/out/gpu/utils.c @@ -106,9 +106,13 @@ bool ra_tex_upload_pbo(struct ra *ra, struct ra_buf_pool *pbo, size_t row_size = tex->params.dimensions == 2 ? params->stride : tex->params.w * tex->params.format->pixel_size; + int height = tex->params.h; + if (tex->params.dimensions == 2 && params->rc) + height = mp_rect_h(*params->rc); + struct ra_buf_params bufparams = { .type = RA_BUF_TYPE_TEX_UPLOAD, - .size = row_size * tex->params.h * tex->params.d, + .size = row_size * height * tex->params.d, .host_mutable = true, }; -- cgit v1.2.3