diff options
author | Zack Rusin <[email protected]> | 2007-09-20 07:50:33 -0400 |
---|---|---|
committer | Zack Rusin <[email protected]> | 2007-09-20 07:50:33 -0400 |
commit | daf5b0f41baa50951e7c2f9ea5cd90b119085a7f (patch) | |
tree | d273c4ae95a8cb617412c9f7a1b943dc4364420f /src/mesa/pipe/i915simple/i915_state.c | |
parent | 37cf13ed9a429c755f121daa1776b1b30a985ab3 (diff) |
Switch fragment/vertex shaders to the new caching semantics.
Allow driver custom allocation within cached objects. The shaders
are currently twiced (by cso layer and by the program itself).
Diffstat (limited to 'src/mesa/pipe/i915simple/i915_state.c')
-rw-r--r-- | src/mesa/pipe/i915simple/i915_state.c | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/src/mesa/pipe/i915simple/i915_state.c b/src/mesa/pipe/i915simple/i915_state.c index 66aa9a0274b..1104c9519db 100644 --- a/src/mesa/pipe/i915simple/i915_state.c +++ b/src/mesa/pipe/i915simple/i915_state.c @@ -228,41 +228,37 @@ static void i915_set_polygon_stipple( struct pipe_context *pipe, } -static const struct pipe_shader_state * -i915_create_shader_state( struct pipe_context *pipe, - const struct pipe_shader_state *templ ) +static void * +i915_create_shader_state(struct pipe_context *pipe, + const struct pipe_shader_state *templ) { - - struct pipe_shader_state *shader = malloc(sizeof(struct pipe_shader_state)); - memcpy(shader, templ, sizeof(struct pipe_shader_state)); - - return shader; + return 0; } static void i915_bind_fs_state( struct pipe_context *pipe, - const struct pipe_shader_state *fs ) + void *fs ) { struct i915_context *i915 = i915_context(pipe); - i915->fs = fs; + i915->fs = (struct pipe_shader_state *)fs; i915->dirty |= I915_NEW_FS; } -static void i915_bind_vs_state( struct pipe_context *pipe, - const struct pipe_shader_state *vs ) +static void i915_bind_vs_state(struct pipe_context *pipe, + void *vs) { struct i915_context *i915 = i915_context(pipe); /* just pass-through to draw module */ - draw_set_vertex_shader(i915->draw, vs); + draw_set_vertex_shader(i915->draw, (const struct pipe_shader_state *)vs); } -static void i915_delete_shader_state( struct pipe_context *pipe, - const struct pipe_shader_state *shader ) +static void i915_delete_shader_state(struct pipe_context *pipe, + void *shader) { - free((struct pipe_shader_state*)shader); + /*do nothing*/ } static void i915_set_constant_buffer(struct pipe_context *pipe, |