summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/r300/compiler
diff options
context:
space:
mode:
authorMarek Olšák <maraeo@gmail.com>2010-05-08 01:19:59 +0200
committerMarek Olšák <maraeo@gmail.com>2010-05-08 23:03:44 +0200
commiteb9dc2595f33f43e99c70dd69588f5573459fbca (patch)
tree8cf1cced82daeeffbdcdb45bcc82986de2fe8872 /src/mesa/drivers/dri/r300/compiler
parentc637f38e70881b2321db12f5f5fea9b46057ff6a (diff)
r300/compiler: generalize depth texture mode to support arbitrary swizzles
Diffstat (limited to 'src/mesa/drivers/dri/r300/compiler')
-rw-r--r--src/mesa/drivers/dri/r300/compiler/radeon_code.h2
-rw-r--r--src/mesa/drivers/dri/r300/compiler/radeon_program_tex.c6
2 files changed, 2 insertions, 6 deletions
diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_code.h b/src/mesa/drivers/dri/r300/compiler/radeon_code.h
index 27274f0712..17703a9ad3 100644
--- a/src/mesa/drivers/dri/r300/compiler/radeon_code.h
+++ b/src/mesa/drivers/dri/r300/compiler/radeon_code.h
@@ -132,7 +132,7 @@ struct r300_fragment_program_external_state {
* 2 - GL_ALPHA
* depending on the depth texture mode.
*/
- unsigned depth_texture_mode : 2;
+ unsigned depth_texture_swizzle:12;
/**
* If the sampler is used as a shadow sampler,
diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_program_tex.c b/src/mesa/drivers/dri/r300/compiler/radeon_program_tex.c
index b4ba0b3f87..98e391ab0c 100644
--- a/src/mesa/drivers/dri/r300/compiler/radeon_program_tex.c
+++ b/src/mesa/drivers/dri/r300/compiler/radeon_program_tex.c
@@ -113,7 +113,6 @@ int radeonTransformTEX(
return 1;
} else {
rc_compare_func comparefunc = compiler->state.unit[inst->U.I.TexSrcUnit].texture_compare_func;
- unsigned int depthmode = compiler->state.unit[inst->U.I.TexSrcUnit].depth_texture_mode;
struct rc_instruction * inst_rcp = rc_insert_new_instruction(c, inst);
struct rc_instruction * inst_mad = rc_insert_new_instruction(c, inst_rcp);
struct rc_instruction * inst_cmp = rc_insert_new_instruction(c, inst_mad);
@@ -141,10 +140,7 @@ int radeonTransformTEX(
inst_mad->U.I.SrcReg[1].Swizzle = RC_SWIZZLE_WWWW;
inst_mad->U.I.SrcReg[2].File = RC_FILE_TEMPORARY;
inst_mad->U.I.SrcReg[2].Index = inst->U.I.DstReg.Index;
- if (depthmode == 0) /* GL_LUMINANCE */
- inst_mad->U.I.SrcReg[2].Swizzle = RC_MAKE_SWIZZLE(RC_SWIZZLE_X, RC_SWIZZLE_Y, RC_SWIZZLE_Z, RC_SWIZZLE_Z);
- else if (depthmode == 2) /* GL_ALPHA */
- inst_mad->U.I.SrcReg[2].Swizzle = RC_SWIZZLE_WWWW;
+ inst_mad->U.I.SrcReg[2].Swizzle = compiler->state.unit[inst->U.I.TexSrcUnit].depth_texture_swizzle;
/* Recall that SrcReg[0] is tex, SrcReg[2] is r and:
* r < tex <=> -tex+r < 0