gallium: rework CSO-related code in state tracker

Use the code in cso_context.c rather than st_cache.c.
Basically, binding of state objects now goes through the CSO module.
But Vertex/fragment shaders go through pipe->bind_fs/vs_state() since they're
not cached by the CSO module at this time.

Also, update softpipe driver to handle NULL state objects in various places.
This happens during context destruction.  May need to update other drivers...
This commit is contained in:
Brian
2008-03-11 18:54:31 -06:00
parent 21ff003061
commit 339e7ec680
23 changed files with 293 additions and 299 deletions

View File

@@ -56,6 +56,7 @@
#include "pipe/p_inlines.h"
#include "draw/draw_context.h"
#include "cso_cache/cso_cache.h"
#include "cso_cache/cso_context.h"
/**
@@ -78,6 +79,7 @@ void st_invalidate_state(GLcontext * ctx, GLuint new_state)
static struct st_context *
st_create_context_priv( GLcontext *ctx, struct pipe_context *pipe )
{
uint i;
struct st_context *st = CALLOC_STRUCT( st_context );
ctx->st = st;
@@ -93,12 +95,15 @@ st_create_context_priv( GLcontext *ctx, struct pipe_context *pipe )
st->dirty.mesa = ~0;
st->dirty.st = ~0;
st->cache = cso_cache_create();
st->cso_context = cso_create_context(pipe);
st_init_atoms( st );
st_init_draw( st );
st_init_generate_mipmap(st);
for (i = 0; i < PIPE_MAX_SAMPLERS; i++)
st->state.sampler_list[i] = &st->state.samplers[i];
/* we want all vertex data to be placed in buffer objects */
vbo_use_buffer_objects(ctx);
@@ -149,7 +154,7 @@ static void st_destroy_context_priv( struct st_context *st )
_vbo_DestroyContext(st->ctx);
cso_cache_delete( st->cache );
cso_destroy_context(st->cso_context);
_mesa_delete_program_cache(st->ctx, st->pixel_xfer.cache);