From 893f9cda7601fb937138629042dd9f6507eb6b5f Mon Sep 17 00:00:00 2001 From: Zack Rusin Date: Thu, 20 Sep 2007 11:33:05 -0400 Subject: Allow drivers to cache the template in case they want to fallback through softpipe which will require the template. --- src/mesa/state_tracker/st_cache.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/mesa/state_tracker') diff --git a/src/mesa/state_tracker/st_cache.c b/src/mesa/state_tracker/st_cache.c index 007a2311e98..01d1934232b 100644 --- a/src/mesa/state_tracker/st_cache.c +++ b/src/mesa/state_tracker/st_cache.c @@ -53,7 +53,7 @@ const struct cso_blend * st_cached_blend_state(struct st_context *st, if (cso_hash_iter_is_null(iter)) { struct cso_blend *cso = malloc(sizeof(struct cso_blend)); memcpy(&cso->state, templ, sizeof(struct pipe_blend_state)); - cso->data = st->pipe->create_blend_state(st->pipe, templ); + cso->data = st->pipe->create_blend_state(st->pipe, &cso->state); if (!cso->data) cso->data = &cso->state; iter = cso_insert_state(st->cache, hash_key, CSO_BLEND, cso); @@ -72,7 +72,7 @@ st_cached_sampler_state(struct st_context *st, if (cso_hash_iter_is_null(iter)) { struct cso_sampler *cso = malloc(sizeof(struct cso_sampler)); memcpy(&cso->state, templ, sizeof(struct pipe_sampler_state)); - cso->data = st->pipe->create_sampler_state(st->pipe, templ); + cso->data = st->pipe->create_sampler_state(st->pipe, &cso->state); if (!cso->data) cso->data = &cso->state; iter = cso_insert_state(st->cache, hash_key, CSO_SAMPLER, cso); @@ -92,7 +92,7 @@ st_cached_depth_stencil_state(struct st_context *st, if (cso_hash_iter_is_null(iter)) { struct cso_depth_stencil *cso = malloc(sizeof(struct cso_depth_stencil)); memcpy(&cso->state, templ, sizeof(struct pipe_depth_stencil_state)); - cso->data = st->pipe->create_depth_stencil_state(st->pipe, templ); + cso->data = st->pipe->create_depth_stencil_state(st->pipe, &cso->state); if (!cso->data) cso->data = &cso->state; iter = cso_insert_state(st->cache, hash_key, CSO_DEPTH_STENCIL, cso); @@ -112,7 +112,7 @@ const struct cso_rasterizer* st_cached_rasterizer_state( if (cso_hash_iter_is_null(iter)) { struct cso_rasterizer *cso = malloc(sizeof(struct cso_rasterizer)); memcpy(&cso->state, templ, sizeof(struct pipe_rasterizer_state)); - cso->data = st->pipe->create_rasterizer_state(st->pipe, templ); + cso->data = st->pipe->create_rasterizer_state(st->pipe, &cso->state); if (!cso->data) cso->data = &cso->state; iter = cso_insert_state(st->cache, hash_key, CSO_RASTERIZER, cso); @@ -132,7 +132,7 @@ st_cached_fs_state(struct st_context *st, if (cso_hash_iter_is_null(iter)) { struct cso_fragment_shader *cso = malloc(sizeof(struct cso_fragment_shader)); memcpy(&cso->state, templ, sizeof(struct pipe_shader_state)); - cso->data = st->pipe->create_fs_state(st->pipe, templ); + cso->data = st->pipe->create_fs_state(st->pipe, &cso->state); if (!cso->data) cso->data = &cso->state; iter = cso_insert_state(st->cache, hash_key, CSO_FRAGMENT_SHADER, cso); @@ -152,7 +152,7 @@ st_cached_vs_state(struct st_context *st, if (cso_hash_iter_is_null(iter)) { struct cso_vertex_shader *cso = malloc(sizeof(struct cso_vertex_shader)); memcpy(&cso->state, templ, sizeof(struct pipe_shader_state)); - cso->data = st->pipe->create_vs_state(st->pipe, templ); + cso->data = st->pipe->create_vs_state(st->pipe, &cso->state); if (!cso->data) cso->data = &cso->state; iter = cso_insert_state(st->cache, hash_key, CSO_VERTEX_SHADER, cso); -- cgit v1.2.3