summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r300
diff options
context:
space:
mode:
authorCorbin Simpson <[email protected]>2010-04-11 13:55:00 -0700
committerCorbin Simpson <[email protected]>2010-04-11 23:39:24 -0700
commitf95ff1cf48a3da090dc999621f2d153af0c7db14 (patch)
tree2560553c029655476f65e99600ccc1c3f15e1793 /src/gallium/drivers/r300
parent8f37f910bf9c3e34c6afc5a2ec8cc1828f792b16 (diff)
r300g: Setup external state for wrap modes.
Diffstat (limited to 'src/gallium/drivers/r300')
-rw-r--r--src/gallium/drivers/r300/r300_fs.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/gallium/drivers/r300/r300_fs.c b/src/gallium/drivers/r300/r300_fs.c
index bd9608e5046..c0d26e5ebde 100644
--- a/src/gallium/drivers/r300/r300_fs.c
+++ b/src/gallium/drivers/r300/r300_fs.c
@@ -152,6 +152,32 @@ static void get_external_state(
/* Fortunately, no need to translate this. */
state->unit[i].texture_compare_func = s->state.compare_func;
}
+
+ /* Should we ask the shader to handle wrapping modes for us? */
+ if (!s->state.normalized_coords) {
+ state->unit[i].non_normalized_coords = 1;
+
+ /* XXX this should probably take into account STR, not just S. */
+ switch (s->state.wrap_s) {
+ case PIPE_TEX_WRAP_REPEAT:
+ state->unit[i].wrap_mode = RC_WRAP_REPEAT;
+ break;
+ case PIPE_TEX_WRAP_CLAMP:
+ case PIPE_TEX_WRAP_CLAMP_TO_EDGE:
+ case PIPE_TEX_WRAP_CLAMP_TO_BORDER:
+ state->unit[i].wrap_mode = RC_WRAP_CLAMP;
+ break;
+ case PIPE_TEX_WRAP_MIRROR_REPEAT:
+ case PIPE_TEX_WRAP_MIRROR_CLAMP:
+ case PIPE_TEX_WRAP_MIRROR_CLAMP_TO_EDGE:
+ case PIPE_TEX_WRAP_MIRROR_CLAMP_TO_BORDER:
+ state->unit[i].wrap_mode = RC_WRAP_MIRROR;
+ break;
+ default:
+ state->unit[i].wrap_mode = RC_WRAP_NONE;
+ break;
+ }
+ }
}
}