Mesa (master): vl: replace DIV-ADD with MAD using inverse size
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Sun Jun 30 16:54:29 UTC 2019
Module: Mesa
Branch: master
Commit: 187c308b96d0501552ec0287ec117273b51228f0
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=187c308b96d0501552ec0287ec117273b51228f0
Author: Gert Wollny <gert.wollny at collabora.com>
Date: Wed Jun 12 16:04:33 2019 +0200
vl: replace DIV-ADD with MAD using inverse size
Optimize the shader a bit by emitting MAD with the inverse size values
instead of DIV+ADD.
Signed-off-by: Gert Wollny <gert.wollny at collabora.com>
Reviewed-by: Marek Olšák <marek.olsak at amd.com>
---
src/gallium/auxiliary/vl/vl_bicubic_filter.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/gallium/auxiliary/vl/vl_bicubic_filter.c b/src/gallium/auxiliary/vl/vl_bicubic_filter.c
index f3f8cbee778..077e2131bfd 100644
--- a/src/gallium/auxiliary/vl/vl_bicubic_filter.c
+++ b/src/gallium/auxiliary/vl/vl_bicubic_filter.c
@@ -201,10 +201,11 @@ create_frag_shader(struct vl_bicubic_filter *filter, unsigned video_width,
ureg_FLR(shader, ureg_writemask(t_array[22], TGSI_WRITEMASK_XY),
ureg_src(t_array[22]));
- ureg_DIV(shader, ureg_writemask(t_array[22], TGSI_WRITEMASK_XY),
- ureg_src(t_array[22]), ureg_imm2f(shader, video_width, video_height));
- ureg_ADD(shader, ureg_writemask(t_array[22], TGSI_WRITEMASK_XY),
- ureg_src(t_array[22]), half_pixel);
+
+ ureg_MAD(shader, ureg_writemask(t_array[22], TGSI_WRITEMASK_XY),
+ ureg_src(t_array[22]),
+ ureg_imm2f(shader, 1.0f / video_width, 1.0f / video_height),
+ half_pixel);
/*
* t_array[0..*] = vtex + offset[0..*]
More information about the mesa-commit
mailing list