summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/r300/r300_fragprog_common.c
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/r300_fragprog_common.c
parentc637f38e70881b2321db12f5f5fea9b46057ff6a (diff)
r300/compiler: generalize depth texture mode to support arbitrary swizzles
Diffstat (limited to 'src/mesa/drivers/dri/r300/r300_fragprog_common.c')
-rw-r--r--src/mesa/drivers/dri/r300/r300_fragprog_common.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/mesa/drivers/dri/r300/r300_fragprog_common.c b/src/mesa/drivers/dri/r300/r300_fragprog_common.c
index 2b7c93a957..6b1457c1e1 100644
--- a/src/mesa/drivers/dri/r300/r300_fragprog_common.c
+++ b/src/mesa/drivers/dri/r300/r300_fragprog_common.c
@@ -46,13 +46,13 @@
#include "radeon_mesa_to_rc.h"
-static GLuint build_dtm(GLuint depthmode)
+static GLuint build_dts(GLuint depthmode)
{
switch(depthmode) {
default:
- case GL_LUMINANCE: return 0;
- case GL_INTENSITY: return 1;
- case GL_ALPHA: return 2;
+ case GL_LUMINANCE: return RC_MAKE_SWIZZLE(RC_SWIZZLE_X, RC_SWIZZLE_Y, RC_SWIZZLE_Z, RC_SWIZZLE_Z);
+ case GL_INTENSITY: return RC_SWIZZLE_XYZW;
+ case GL_ALPHA: return RC_SWIZZLE_WWWW;
}
}
@@ -78,7 +78,7 @@ static void build_state(
if (fp->Base.ShadowSamplers & (1 << unit)) {
struct gl_texture_object* tex = r300->radeon.glCtx->Texture.Unit[unit]._Current;
- state->unit[unit].depth_texture_mode = build_dtm(tex->DepthMode);
+ state->unit[unit].depth_texture_swizzle = build_dts(tex->DepthMode);
state->unit[unit].texture_compare_func = build_func(tex->CompareFunc);
}
}