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.
This commit is contained in:
Niklas Haas 2017-10-27 16:54:27 +02:00
parent d6f33e0b0d
commit 4701c5ba4f
1 changed files with 5 additions and 1 deletions

View File

@ -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,
};