summaryrefslogtreecommitdiff
path: root/src/mesa/pipe/softpipe/sp_state_fs.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/pipe/softpipe/sp_state_fs.c')
-rw-r--r--src/mesa/pipe/softpipe/sp_state_fs.c49
1 files changed, 39 insertions, 10 deletions
diff --git a/src/mesa/pipe/softpipe/sp_state_fs.c b/src/mesa/pipe/softpipe/sp_state_fs.c
index 8306a95f44..f1bec2c73a 100644
--- a/src/mesa/pipe/softpipe/sp_state_fs.c
+++ b/src/mesa/pipe/softpipe/sp_state_fs.c
@@ -33,10 +33,13 @@
#include "pipe/draw/draw_context.h"
-void * softpipe_create_shader_state(struct pipe_context *pipe,
- const struct pipe_shader_state *templ)
+void * softpipe_create_fs_state(struct pipe_context *pipe,
+ const struct pipe_shader_state *templ)
{
- /* we just want the pipe_shader_state template in the bind calls */
+ /* Decide whether we'll be codegenerating this shader and if so do
+ * that now.
+ */
+
return 0;
}
@@ -49,25 +52,51 @@ void softpipe_bind_fs_state(struct pipe_context *pipe, void *fs)
softpipe->dirty |= SP_NEW_FS;
}
+void softpipe_delete_fs_state(struct pipe_context *pipe,
+ void *shader)
+{
+}
+
+
+void * softpipe_create_vs_state(struct pipe_context *pipe,
+ const struct pipe_shader_state *templ)
+{
+ struct softpipe_context *softpipe = softpipe_context(pipe);
+ struct sp_vertex_shader_state *state =
+ malloc(sizeof(struct sp_vertex_shader_state));
+
+ state->state = templ;
+ state->draw_data = draw_create_vertex_shader(softpipe->draw,
+ state->state);
+
+ return state;
+}
void softpipe_bind_vs_state(struct pipe_context *pipe, void *vs)
{
struct softpipe_context *softpipe = softpipe_context(pipe);
- softpipe->vs = (struct pipe_shader_state *)vs;
+ softpipe->vs = (const struct sp_vertex_shader_state *)vs;
- softpipe->dirty |= SP_NEW_VS;
+ draw_bind_vertex_shader(softpipe->draw, softpipe->vs->draw_data);
- draw_set_vertex_shader(softpipe->draw, (struct pipe_shader_state *)vs);
+ softpipe->dirty |= SP_NEW_VS;
}
-
-void softpipe_delete_shader_state( struct pipe_context *pipe,
- void *shader )
+void softpipe_delete_vs_state(struct pipe_context *pipe,
+ void *vs)
{
- /* do nothing */
+ struct softpipe_context *softpipe = softpipe_context(pipe);
+
+ struct sp_vertex_shader_state *state =
+ (struct sp_vertex_shader_state *)vs;
+
+ draw_delete_vertex_shader(softpipe->draw, state->draw_data);
+ free(state);
}
+
+
void softpipe_set_constant_buffer(struct pipe_context *pipe,
uint shader, uint index,
const struct pipe_constant_buffer *buf)