From afae0891949b72a2ede2a3b6a01d4d6bcf4ceae0 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Fri, 19 Mar 2010 01:13:57 +0100 Subject: r300g: fix breakage after the gallium-sampler-view merge --- src/gallium/drivers/r300/r300_state.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/gallium/drivers/r300/r300_state.c') diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index db7844eef0..bdfe74ed2a 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 */ -- cgit v1.2.3