summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker
diff options
context:
space:
mode:
authorZack Rusin <[email protected]>2008-02-25 22:03:58 -0500
committerZack Rusin <[email protected]>2008-02-26 01:51:46 -0500
commit6abb82da7e676384e7e2c9732307b23f8ed7157d (patch)
treee59cfdda493f8618d34835836023e1bd25e58226 /src/mesa/state_tracker
parent08a5f49644c4bfc62291c49718f2d18e58527d1d (diff)
implement deleting of driver side cached state in cso's
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r--src/mesa/state_tracker/st_cache.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/mesa/state_tracker/st_cache.c b/src/mesa/state_tracker/st_cache.c
index 2979e7fae54..78f282302eb 100644
--- a/src/mesa/state_tracker/st_cache.c
+++ b/src/mesa/state_tracker/st_cache.c
@@ -63,6 +63,8 @@ const struct cso_blend * st_cached_blend_state(struct st_context *st,
cso->data = st->pipe->create_blend_state(st->pipe, &cso->state);
if (!cso->data)
cso->data = &cso->state;
+ cso->delete_state = st->pipe->delete_blend_state;
+ cso->context = st->pipe;
iter = cso_insert_state(st->cache, hash_key, CSO_BLEND, cso);
}
return ((struct cso_blend *)cso_hash_iter_data(iter));
@@ -82,6 +84,8 @@ st_cached_sampler_state(struct st_context *st,
cso->data = st->pipe->create_sampler_state(st->pipe, &cso->state);
if (!cso->data)
cso->data = &cso->state;
+ cso->delete_state = st->pipe->delete_sampler_state;
+ cso->context = st->pipe;
iter = cso_insert_state(st->cache, hash_key, CSO_SAMPLER, cso);
}
return (struct cso_sampler*)(cso_hash_iter_data(iter));
@@ -103,6 +107,8 @@ st_cached_depth_stencil_alpha_state(struct st_context *st,
cso->data = st->pipe->create_depth_stencil_alpha_state(st->pipe, &cso->state);
if (!cso->data)
cso->data = &cso->state;
+ cso->delete_state = st->pipe->delete_depth_stencil_alpha_state;
+ cso->context = st->pipe;
iter = cso_insert_state(st->cache, hash_key, CSO_DEPTH_STENCIL_ALPHA, cso);
}
return (struct cso_depth_stencil_alpha*)(cso_hash_iter_data(iter));
@@ -123,6 +129,8 @@ const struct cso_rasterizer* st_cached_rasterizer_state(
cso->data = st->pipe->create_rasterizer_state(st->pipe, &cso->state);
if (!cso->data)
cso->data = &cso->state;
+ cso->delete_state = st->pipe->delete_rasterizer_state;
+ cso->context = st->pipe;
iter = cso_insert_state(st->cache, hash_key, CSO_RASTERIZER, cso);
}
return (struct cso_rasterizer*)(cso_hash_iter_data(iter));
@@ -143,6 +151,8 @@ st_cached_fs_state(struct st_context *st,
cso->data = st->pipe->create_fs_state(st->pipe, &cso->state);
if (!cso->data)
cso->data = &cso->state;
+ cso->delete_state = st->pipe->delete_fs_state;
+ cso->context = st->pipe;
iter = cso_insert_state(st->cache, hash_key, CSO_FRAGMENT_SHADER, cso);
}
return (struct cso_fragment_shader*)(cso_hash_iter_data(iter));
@@ -163,8 +173,9 @@ st_cached_vs_state(struct st_context *st,
cso->data = st->pipe->create_vs_state(st->pipe, &cso->state);
if (!cso->data)
cso->data = &cso->state;
+ cso->delete_state = st->pipe->delete_vs_state;
+ cso->context = st->pipe;
iter = cso_insert_state(st->cache, hash_key, CSO_VERTEX_SHADER, cso);
}
return (struct cso_vertex_shader*)(cso_hash_iter_data(iter));
}
-