diff options
author | Dave Airlie <[email protected]> | 2010-09-06 09:13:50 +1000 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2010-09-06 09:15:42 +1000 |
commit | 3a672785df247e6f8ce95616166b74d4fd10ede0 (patch) | |
tree | de6025a138fcf526e43c53d8a8ed19ec116ebee6 /src/gallium | |
parent | 6ec0fff822f66170f190515fc5e718142f6a5e28 (diff) |
r600g: search for sampler views in context on removal.
Need to remove from context as well.
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/drivers/r600/r600_state.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/gallium/drivers/r600/r600_state.c b/src/gallium/drivers/r600/r600_state.c index ae5139bfb3d..e630e1af407 100644 --- a/src/gallium/drivers/r600/r600_state.c +++ b/src/gallium/drivers/r600/r600_state.c @@ -103,11 +103,28 @@ static void *r600_create_sampler_state(struct pipe_context *ctx, return rstate; } +static void r600_remove_sampler_view(struct r600_shader_sampler_states *sampler, + struct r600_context_state *rstate) +{ + int i, j; + + for (i = 0; i < sampler->nview; i++) { + for (j = 0; j < rstate->nrstate; j++) { + if (sampler->view[i] == &rstate->rstate[j]) + sampler->view[i] = NULL; + } + } +} static void r600_sampler_view_destroy(struct pipe_context *ctx, struct pipe_sampler_view *state) { struct r600_context_state *rstate = (struct r600_context_state *)state; + struct r600_context *rctx = r600_context(ctx); + int i; + /* need to search list of vs/ps sampler views and remove it from any - uggh */ + r600_remove_sampler_view(&rctx->ps_sampler, rstate); + r600_remove_sampler_view(&rctx->vs_sampler, rstate); r600_context_state_decref(rstate); } |