summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r300/r300_state.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/r300/r300_state.c')
-rw-r--r--src/gallium/drivers/r300/r300_state.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c
index dc94c95e69f..d1486a20395 100644
--- a/src/gallium/drivers/r300/r300_state.c
+++ b/src/gallium/drivers/r300/r300_state.c
@@ -908,8 +908,9 @@ static void r300_bind_sampler_states(struct pipe_context* pipe,
struct r300_context* r300 = r300_context(pipe);
struct r300_textures_state* state =
(struct r300_textures_state*)r300->textures_state.state;
+ unsigned tex_units = r300_screen(r300->context.screen)->caps->num_tex_units;
- if (count > 8) {
+ if (count > tex_units) {
return;
}
@@ -947,11 +948,11 @@ static void r300_set_fragment_sampler_views(struct pipe_context* pipe,
(struct r300_textures_state*)r300->textures_state.state;
struct r300_texture *texture;
unsigned i;
+ unsigned tex_units = r300_screen(r300->context.screen)->caps->num_tex_units;
boolean is_r500 = r300_screen(r300->context.screen)->caps->is_r500;
boolean dirty_tex = FALSE;
- /* XXX magic num */
- if (count > 8) {
+ if (count > tex_units) {
return;
}
@@ -977,7 +978,7 @@ static void r300_set_fragment_sampler_views(struct pipe_context* pipe,
}
}
- for (i = count; i < 8; i++) {
+ for (i = count; i < tex_units; i++) {
if (state->fragment_sampler_views[i]) {
pipe_sampler_view_reference(&state->fragment_sampler_views[i],
NULL);