aboutsummaryrefslogtreecommitdiffstats
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.c24
1 files changed, 20 insertions, 4 deletions
diff --git a/src/mesa/pipe/softpipe/sp_state_fs.c b/src/mesa/pipe/softpipe/sp_state_fs.c
index 5ab246896b9..fbbde2f5201 100644
--- a/src/mesa/pipe/softpipe/sp_state_fs.c
+++ b/src/mesa/pipe/softpipe/sp_state_fs.c
@@ -33,23 +33,33 @@
#include "pipe/draw/draw_context.h"
-void softpipe_set_fs_state( struct pipe_context *pipe,
+const struct pipe_shader_state *
+softpipe_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;
+}
+
+void softpipe_bind_fs_state( struct pipe_context *pipe,
const struct pipe_shader_state *fs )
{
struct softpipe_context *softpipe = softpipe_context(pipe);
- memcpy(&softpipe->fs, fs, sizeof(*fs));
+ softpipe->fs = fs;
softpipe->dirty |= SP_NEW_FS;
}
-void softpipe_set_vs_state( struct pipe_context *pipe,
+void softpipe_bind_vs_state( struct pipe_context *pipe,
const struct pipe_shader_state *vs )
{
struct softpipe_context *softpipe = softpipe_context(pipe);
- memcpy(&softpipe->vs, vs, sizeof(*vs));
+ softpipe->vs = vs;
softpipe->dirty |= SP_NEW_VS;
@@ -57,6 +67,12 @@ void softpipe_set_vs_state( struct pipe_context *pipe,
}
+void softpipe_delete_shader_state( struct pipe_context *pipe,
+ const struct pipe_shader_state *shader )
+{
+ free((struct pipe_shader_state*)shader);
+}
+
void softpipe_set_constant_buffer(struct pipe_context *pipe,
uint shader, uint index,
const struct pipe_constant_buffer *buf)