diff options
author | Marek Olšák <[email protected]> | 2010-03-19 01:13:57 +0100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2010-03-19 04:09:07 +0100 |
commit | afae0891949b72a2ede2a3b6a01d4d6bcf4ceae0 (patch) | |
tree | 6e75eafbe05d39c5ec470484db17eb7317403959 /src/gallium/drivers/r300/r300_state.c | |
parent | f6e987ce7839d66edb88403d2c9ac1b28db2832b (diff) |
r300g: fix breakage after the gallium-sampler-view merge
Diffstat (limited to 'src/gallium/drivers/r300/r300_state.c')
-rw-r--r-- | src/gallium/drivers/r300/r300_state.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index db7844eef0e..bdfe74ed2a0 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -973,6 +973,7 @@ static void r300_set_fragment_sampler_views(struct pipe_context* pipe, struct r300_context* r300 = r300_context(pipe); struct r300_textures_state* state = (struct r300_textures_state*)r300->textures_state.state; + struct r300_texture *texture; unsigned i; boolean is_r500 = r300_screen(r300->context.screen)->caps->is_r500; boolean dirty_tex = FALSE; @@ -984,15 +985,18 @@ static void r300_set_fragment_sampler_views(struct pipe_context* pipe, for (i = 0; i < count; i++) { if (state->fragment_sampler_views[i] != views[i]) { - struct r300_texture *texture; - pipe_sampler_view_reference(&state->fragment_sampler_views[i], views[i]); - dirty_tex = TRUE; - texture = (struct r300_texture *)views[i]->texture; + if (!views[i]) { + continue; + } + + /* A new sampler view (= texture)... */ + dirty_tex = TRUE; /* R300-specific - set the texrect factor in the fragment shader */ + texture = (struct r300_texture *)views[i]->texture; if (!is_r500 && texture->is_npot) { /* XXX It would be nice to re-emit just 1 constant, * XXX not all of them */ |