gallium/auxiliary/vl: Fix compute shader scaling for non-square pixels
authorThong Thai <thong.thai@amd.com>
Fri, 15 May 2020 18:07:05 +0000 (14:07 -0400)
committerThong Thai <thong.thai@amd.com>
Sat, 16 May 2020 02:17:26 +0000 (02:17 +0000)
Calculate the scale_y parameter instead of assuming square pixels.

Signed-off-by: Thong Thai <thong.thai@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5057>

src/gallium/auxiliary/vl/vl_compositor_cs.c

index eb19dd7b15992861a3a020d65d51914b2dd08777..bc2055bd3e1e73fd28addb39a104316ffdf2db7a 100644 (file)
@@ -712,7 +712,8 @@ draw_layers(struct vl_compositor       *c,
          drawn.area = calc_drawn_area(s, layer);
          drawn.scale_x = layer->viewport.scale[0] /
                   (float)layer->sampler_views[0]->texture->width0;
-         drawn.scale_y = drawn.scale_x;
+         drawn.scale_y = layer->viewport.scale[1] /
+                  (float)layer->sampler_views[0]->texture->height0;
          drawn.translate_x = (int)layer->viewport.translate[0];
          drawn.translate_y = (int)layer->viewport.translate[1];
          drawn.sampler0_w = (float)layer->sampler_views[0]->texture->width0;