summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/compiler/glsl/lower_blend_equation_advanced.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/compiler/glsl/lower_blend_equation_advanced.cpp b/src/compiler/glsl/lower_blend_equation_advanced.cpp
index 1d033924159..f8210e3aaa5 100644
--- a/src/compiler/glsl/lower_blend_equation_advanced.cpp
+++ b/src/compiler/glsl/lower_blend_equation_advanced.cpp
@@ -308,12 +308,18 @@ calc_blend_result(ir_factory f,
f.emit(assign(dst_alpha, swizzle_w(fb)));
f.emit(if_tree(equal(dst_alpha, imm1(0)),
assign(dst_rgb, imm3(0)),
- assign(dst_rgb, div(swizzle_xyz(fb), dst_alpha))));
+ assign(dst_rgb, csel(equal(swizzle_xyz(fb),
+ swizzle(fb, SWIZZLE_WWWW, 3)),
+ imm3(1),
+ div(swizzle_xyz(fb), dst_alpha)))));
f.emit(assign(src_alpha, swizzle_w(src)));
f.emit(if_tree(equal(src_alpha, imm1(0)),
assign(src_rgb, imm3(0)),
- assign(src_rgb, div(swizzle_xyz(src), src_alpha))));
+ assign(src_rgb, csel(equal(swizzle_xyz(src),
+ swizzle(src, SWIZZLE_WWWW, 3)),
+ imm3(1),
+ div(swizzle_xyz(src), src_alpha)))));
ir_variable *factor = f.make_temp(glsl_type::vec3_type, "__blend_factor");