diff options
author | Zhigang Gong <zhigang.gong@linux.intel.com> | 2012-08-01 18:27:29 +0800 |
---|---|---|
committer | Zhigang Gong <zhigang.gong@linux.intel.com> | 2012-08-02 10:48:11 +0800 |
commit | f233aeef15ca357c9a0a770687d13b6560871420 (patch) | |
tree | 21edd1a1769c607dd76baf45f29bec40f7a5d412 | |
parent | 79d369f161c78185483bf8fdeed77f79430d4a1e (diff) |
glamor_trapezoid: workaround a glsl like problem.
It seems that the following statement cann't run as expected on SNB.
bool trap_left_vertical = (abs(trap_left_vertical_f - 1.0) <= 0.0001);
Have to rewrite it to another style to let the vertical edge trapezoid
to be rendered correctly.
Reviewed-by: Junyan He <junyan.he@linux.intel.com>
Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
-rw-r--r-- | src/glamor_trapezoid.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/glamor_trapezoid.c b/src/glamor_trapezoid.c index fd63062..7813d82 100644 --- a/src/glamor_trapezoid.c +++ b/src/glamor_trapezoid.c @@ -1068,8 +1068,6 @@ glamor_init_trapezoid_shader(ScreenPtr screen) "varying float trap_right_vertical_f; \n" "float x_per_pix = 1.0;" "float y_per_pix = 1.0;" - "bool trap_left_vertical = (abs(trap_left_vertical_f - 1.0) <= 0.0001);\n" - "bool trap_right_vertical = (abs(trap_right_vertical_f - 1.0) <= 0.0001);\n" "\n" "float get_alpha_val() \n" "{ \n" @@ -1077,6 +1075,16 @@ glamor_init_trapezoid_shader(ScreenPtr screen) " float x_bottom_cut_left; \n" " float x_up_cut_right; \n" " float x_bottom_cut_right; \n" + " bool trap_left_vertical;\n" + " bool trap_right_vertical;\n" + " if (abs(trap_left_vertical_f - 1.0) <= 0.0001)\n" + " trap_left_vertical = true;\n" + " else\n" + " trap_left_vertical = false;\n" + " if (abs(trap_right_vertical_f - 1.0) <= 0.0001)\n" + " trap_right_vertical = true;\n" + " else\n" + " trap_right_vertical = false;\n" " \n" " if(trap_left_vertical == true) { \n" " x_up_cut_left = trap_left_x; \n" |