aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/ff_fragment_shader.cpp
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-01-06 19:47:46 +0100
committerMarc Haesen <marc@hc-consult.be>2012-01-06 19:47:46 +0100
commit2d52fd67e716caae85bce150b01bc5c284b12de7 (patch)
tree2a641392a6affe99603cbaf169c1ab5173879d27 /mesalib/src/mesa/main/ff_fragment_shader.cpp
parentd515b895dc5151d102f33b577cafbf63473bbafa (diff)
parent7e9f4ea970e8f7008c212d7d3918a974eb0066da (diff)
downloadvcxsrv-2d52fd67e716caae85bce150b01bc5c284b12de7.tar.gz
vcxsrv-2d52fd67e716caae85bce150b01bc5c284b12de7.tar.bz2
vcxsrv-2d52fd67e716caae85bce150b01bc5c284b12de7.zip
Merge remote-tracking branch 'origin/released'
Conflicts: mesalib/src/glsl/link_uniforms.cpp mesalib/src/mesa/drivers/dri/common/drisw_util.c
Diffstat (limited to 'mesalib/src/mesa/main/ff_fragment_shader.cpp')
-rw-r--r--mesalib/src/mesa/main/ff_fragment_shader.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/mesalib/src/mesa/main/ff_fragment_shader.cpp b/mesalib/src/mesa/main/ff_fragment_shader.cpp
index 008da0d0e..3e736fa15 100644
--- a/mesalib/src/mesa/main/ff_fragment_shader.cpp
+++ b/mesalib/src/mesa/main/ff_fragment_shader.cpp
@@ -632,15 +632,19 @@ emit_combine_source(struct texenv_fragment_program *p,
new(p->mem_ctx) ir_constant(1.0f),
src);
- case OPR_SRC_ALPHA:
- return new(p->mem_ctx) ir_swizzle(src, 3, 3, 3, 3, 1);
+ case OPR_SRC_ALPHA:
+ return src->type->is_scalar()
+ ? src : (ir_rvalue *) new(p->mem_ctx) ir_swizzle(src, 3, 3, 3, 3, 1);
+
+ case OPR_ONE_MINUS_SRC_ALPHA: {
+ ir_rvalue *const scalar = (src->type->is_scalar())
+ ? src : (ir_rvalue *) new(p->mem_ctx) ir_swizzle(src, 3, 3, 3, 3, 1);
- case OPR_ONE_MINUS_SRC_ALPHA:
return new(p->mem_ctx) ir_expression(ir_binop_sub,
new(p->mem_ctx) ir_constant(1.0f),
- new(p->mem_ctx) ir_swizzle(src,
- 3, 3,
- 3, 3, 1));
+ scalar);
+ }
+
case OPR_ZERO:
return new(p->mem_ctx) ir_constant(0.0f);
case OPR_ONE: