summaryrefslogtreecommitdiff
path: root/src/gallium/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/r300/r300_fs.c55
1 files changed, 25 insertions, 30 deletions
diff --git a/src/gallium/drivers/r300/r300_fs.c b/src/gallium/drivers/r300/r300_fs.c
index b8dab88ef0..3f89987897 100644
--- a/src/gallium/drivers/r300/r300_fs.c
+++ b/src/gallium/drivers/r300/r300_fs.c
@@ -150,12 +150,16 @@ static void get_external_state(
unsigned char *swizzle;
for (i = 0; i < texstate->sampler_state_count; i++) {
- struct r300_sampler_state* s = texstate->sampler_states[i];
+ struct r300_sampler_state *s = texstate->sampler_states[i];
+ struct r300_sampler_view *v = texstate->sampler_views[i];
+ struct r300_texture *t;
- if (!s) {
+ if (!s || !v) {
continue;
}
+ t = r300_texture(texstate->sampler_views[i]->base.texture);
+
if (s->state.compare_mode == PIPE_TEX_COMPARE_R_TO_TEXTURE) {
state->unit[i].compare_mode_enabled = 1;
@@ -176,34 +180,25 @@ static void get_external_state(
state->unit[i].non_normalized_coords = !s->state.normalized_coords;
- if (texstate->sampler_views[i]) {
- struct r300_texture *t;
- t = (struct r300_texture*)texstate->sampler_views[i]->base.texture;
-
- /* XXX this should probably take into account STR, not just S. */
- if (t->desc.is_npot) {
- switch (s->state.wrap_s) {
- case PIPE_TEX_WRAP_REPEAT:
- state->unit[i].wrap_mode = RC_WRAP_REPEAT;
- state->unit[i].fake_npot = TRUE;
- break;
-
- case PIPE_TEX_WRAP_MIRROR_REPEAT:
- state->unit[i].wrap_mode = RC_WRAP_MIRRORED_REPEAT;
- state->unit[i].fake_npot = TRUE;
- break;
-
- 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_MIRRORED_CLAMP;
- state->unit[i].fake_npot = TRUE;
- break;
-
- default:
- state->unit[i].wrap_mode = RC_WRAP_NONE;
- break;
- }
+ /* XXX this should probably take into account STR, not just S. */
+ if (t->desc.is_npot) {
+ switch (s->state.wrap_s) {
+ case PIPE_TEX_WRAP_REPEAT:
+ state->unit[i].wrap_mode = RC_WRAP_REPEAT;
+ break;
+
+ case PIPE_TEX_WRAP_MIRROR_REPEAT:
+ state->unit[i].wrap_mode = RC_WRAP_MIRRORED_REPEAT;
+ break;
+
+ 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_MIRRORED_CLAMP;
+ break;
+
+ default:
+ state->unit[i].wrap_mode = RC_WRAP_NONE;
}
}
}