diff options
author | Zack Rusin <[email protected]> | 2007-09-20 11:33:05 -0400 |
---|---|---|
committer | Zack Rusin <[email protected]> | 2007-09-20 11:33:05 -0400 |
commit | 893f9cda7601fb937138629042dd9f6507eb6b5f (patch) | |
tree | 143f836ed819622477d2031b5bc380a84fd7c6f4 /src/mesa/state_tracker/st_cache.c | |
parent | 1d8c31b47bd34a43e1f78a9f21a0c02c57c58479 (diff) |
Allow drivers to cache the template in case they want to
fallback through softpipe which will require the template.
Diffstat (limited to 'src/mesa/state_tracker/st_cache.c')
-rw-r--r-- | src/mesa/state_tracker/st_cache.c | 12 |
1 files changed, 6 insertions, 6 deletions
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); |