mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-27 00:20:30 +01:00
r300g: Setup external state for wrap modes.
This commit is contained in:
parent
8f37f910bf
commit
f95ff1cf48
1 changed files with 26 additions and 0 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue