From a1a989f0be8dc34082b52bb3b3a6eacb36d9e75e Mon Sep 17 00:00:00 2001 From: Zack Rusin Date: Fri, 28 Sep 2007 04:33:55 -0400 Subject: Redoing the way we handle vertex shaders for the draw module. --- src/mesa/pipe/i915simple/i915_state.c | 44 ++++++++++++++++++++++------------- 1 file changed, 28 insertions(+), 16 deletions(-) (limited to 'src/mesa/pipe/i915simple') diff --git a/src/mesa/pipe/i915simple/i915_state.c b/src/mesa/pipe/i915simple/i915_state.c index 5c6d37a4661..19ca5e575fb 100644 --- a/src/mesa/pipe/i915simple/i915_state.c +++ b/src/mesa/pipe/i915simple/i915_state.c @@ -443,16 +443,13 @@ static void i915_set_polygon_stipple( struct pipe_context *pipe, { } - -static void * -i915_create_shader_state(struct pipe_context *pipe, - const struct pipe_shader_state *templ) +static void * i915_create_fs_state(struct pipe_context *pipe, + const struct pipe_shader_state *templ) { return 0; } -static void i915_bind_fs_state( struct pipe_context *pipe, - void *fs ) +static void i915_bind_fs_state(struct pipe_context *pipe, void *fs) { struct i915_context *i915 = i915_context(pipe); @@ -461,20 +458,35 @@ static void i915_bind_fs_state( struct pipe_context *pipe, i915->dirty |= I915_NEW_FS; } +static void i915_delete_fs_state(struct pipe_context *pipe, void *shader) +{ + /*do nothing*/ +} -static void i915_bind_vs_state(struct pipe_context *pipe, - void *vs) +static void * +i915_create_vs_state(struct pipe_context *pipe, + const struct pipe_shader_state *templ) { struct i915_context *i915 = i915_context(pipe); /* just pass-through to draw module */ - draw_set_vertex_shader(i915->draw, (const struct pipe_shader_state *)vs); + return draw_create_vertex_shader(i915->draw, templ); } -static void i915_delete_shader_state(struct pipe_context *pipe, - void *shader) +static void i915_bind_vs_state(struct pipe_context *pipe, void *vs) { - /*do nothing*/ + struct i915_context *i915 = i915_context(pipe); + + /* just pass-through to draw module */ + draw_bind_vertex_shader(i915->draw, vs); +} + +static void i915_delete_vs_state(struct pipe_context *pipe, void *shader) +{ + struct i915_context *i915 = i915_context(pipe); + + /* just pass-through to draw module */ + draw_delete_vertex_shader(i915->draw, shader); } static void i915_set_constant_buffer(struct pipe_context *pipe, @@ -707,12 +719,12 @@ i915_init_state_functions( struct i915_context *i915 ) i915->pipe.create_rasterizer_state = i915_create_rasterizer_state; i915->pipe.bind_rasterizer_state = i915_bind_rasterizer_state; i915->pipe.delete_rasterizer_state = i915_delete_rasterizer_state; - i915->pipe.create_fs_state = i915_create_shader_state; + i915->pipe.create_fs_state = i915_create_fs_state; i915->pipe.bind_fs_state = i915_bind_fs_state; - i915->pipe.delete_fs_state = i915_delete_shader_state; - i915->pipe.create_vs_state = i915_create_shader_state; + i915->pipe.delete_fs_state = i915_delete_fs_state; + i915->pipe.create_vs_state = i915_create_vs_state; i915->pipe.bind_vs_state = i915_bind_vs_state; - i915->pipe.delete_vs_state = i915_delete_shader_state; + i915->pipe.delete_vs_state = i915_delete_vs_state; i915->pipe.set_blend_color = i915_set_blend_color; i915->pipe.set_clip_state = i915_set_clip_state; -- cgit v1.2.3