Commit 84e6848d authored by Niklas Haas's avatar Niklas Haas
Browse files

utils/upload: don't make pl_upload_plane clobber shift_x/y

This fixes an issue where pl_upload_plane currently clobbers the
shift_x/y values set by the dav1d/AVFrame helpers.
parent 50b797e9
......@@ -123,6 +123,9 @@ const struct pl_fmt *pl_plane_find_fmt(const struct pl_gpu *gpu, int out_map[4],
// The resulting texture is guaranteed to be `sampleable`, and it will also try
// and maximize compatibility with the other `pl_renderer` requirements
// (blittable, linear filterable, etc.).
// Note: `out_plane->shift_x/y` are left uninitialized, and should be set
// explicitly by the user.
bool pl_upload_plane(const struct pl_gpu *gpu, struct pl_plane *out_plane,
const struct pl_tex **tex, const struct pl_plane_data *data);
......@@ -242,7 +242,8 @@ bool pl_upload_plane(const struct pl_gpu *gpu, struct pl_plane *out_plane,
if (out_plane) {
*out_plane = (struct pl_plane) { .texture = *tex };
out_plane->texture = *tex;
out_plane->components = 0;
for (int i = 0; i < PL_ARRAY_SIZE(out_map); i++) {
out_plane->component_mapping[i] = out_map[i];
if (out_map[i] >= 0)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment