diff options
author | Marek Olšák <[email protected]> | 2010-04-05 02:11:26 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2010-04-05 07:09:45 +0200 |
commit | d2686cdb2354b7cfe0e4eac3c5afab40cb947e0f (patch) | |
tree | 48c64d7fa0e6151e7a74563dfc7c63ece8bfd1d7 /src/gallium/drivers/r300/r300_state.c | |
parent | e41a64591bf1a74465bf0adc7d35c991c4cfb4fe (diff) |
r300g: raise the number of texture units to 16 for all supported chipsets
As per Radeon 9700 Opengl Programming and Optimization Guide [1], there are
16 texture units even on the first r300 chipsets. If you think I am wrong,
feel free to propose a patch.
[1] Here's PDF: http://people.freedesktop.org/~mareko/
Diffstat (limited to 'src/gallium/drivers/r300/r300_state.c')
-rw-r--r-- | src/gallium/drivers/r300/r300_state.c | 9 |
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); |