summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/softpipe/sp_state_shader.c
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2010-09-25 13:54:24 -0600
committerBrian Paul <brianp@vmware.com>2010-09-25 14:25:40 -0600
commit279b368dc34d8829bfd23b83af7f78e10e303f54 (patch)
treeb8d2d9abf9ddedcb76779e359d801f5a1aa77742 /src/gallium/drivers/softpipe/sp_state_shader.c
parent72c6d16f8fe31b1b711465d20e4d2c4cbd13825f (diff)
softpipe: make shader-related functions static
Diffstat (limited to 'src/gallium/drivers/softpipe/sp_state_shader.c')
-rw-r--r--src/gallium/drivers/softpipe/sp_state_shader.c90
1 files changed, 55 insertions, 35 deletions
diff --git a/src/gallium/drivers/softpipe/sp_state_shader.c b/src/gallium/drivers/softpipe/sp_state_shader.c
index 50bc2eea5f..7fff338cce 100644
--- a/src/gallium/drivers/softpipe/sp_state_shader.c
+++ b/src/gallium/drivers/softpipe/sp_state_shader.c
@@ -42,7 +42,7 @@
#include "tgsi/tgsi_parse.h"
-void *
+static void *
softpipe_create_fs_state(struct pipe_context *pipe,
const struct pipe_shader_state *templ)
{
@@ -84,7 +84,7 @@ softpipe_create_fs_state(struct pipe_context *pipe,
}
-void
+static void
softpipe_bind_fs_state(struct pipe_context *pipe, void *fs)
{
struct softpipe_context *softpipe = softpipe_context(pipe);
@@ -105,7 +105,7 @@ softpipe_bind_fs_state(struct pipe_context *pipe, void *fs)
}
-void
+static void
softpipe_delete_fs_state(struct pipe_context *pipe, void *fs)
{
struct softpipe_context *softpipe = softpipe_context(pipe);
@@ -126,7 +126,7 @@ softpipe_delete_fs_state(struct pipe_context *pipe, void *fs)
}
-void *
+static void *
softpipe_create_vs_state(struct pipe_context *pipe,
const struct pipe_shader_state *templ)
{
@@ -161,7 +161,7 @@ fail:
}
-void
+static void
softpipe_bind_vs_state(struct pipe_context *pipe, void *vs)
{
struct softpipe_context *softpipe = softpipe_context(pipe);
@@ -175,7 +175,7 @@ softpipe_bind_vs_state(struct pipe_context *pipe, void *vs)
}
-void
+static void
softpipe_delete_vs_state(struct pipe_context *pipe, void *vs)
{
struct softpipe_context *softpipe = softpipe_context(pipe);
@@ -187,34 +187,8 @@ softpipe_delete_vs_state(struct pipe_context *pipe, void *vs)
FREE( state );
}
-void
-softpipe_set_constant_buffer(struct pipe_context *pipe,
- uint shader, uint index,
- struct pipe_resource *constants)
-{
- struct softpipe_context *softpipe = softpipe_context(pipe);
- unsigned size = constants ? constants->width0 : 0;
- const void *data = constants ? softpipe_resource(constants)->data : NULL;
-
- assert(shader < PIPE_SHADER_TYPES);
-
- draw_flush(softpipe->draw);
- /* note: reference counting */
- pipe_resource_reference(&softpipe->constants[shader][index], constants);
-
- if (shader == PIPE_SHADER_VERTEX || shader == PIPE_SHADER_GEOMETRY) {
- draw_set_mapped_constant_buffer(softpipe->draw, shader, index, data, size);
- }
-
- softpipe->mapped_constants[shader][index] = data;
- softpipe->const_buffer_size[shader][index] = size;
-
- softpipe->dirty |= SP_NEW_CONSTANTS;
-}
-
-
-void *
+static void *
softpipe_create_gs_state(struct pipe_context *pipe,
const struct pipe_shader_state *templ)
{
@@ -253,7 +227,7 @@ fail:
}
-void
+static void
softpipe_bind_gs_state(struct pipe_context *pipe, void *gs)
{
struct softpipe_context *softpipe = softpipe_context(pipe);
@@ -267,7 +241,7 @@ softpipe_bind_gs_state(struct pipe_context *pipe, void *gs)
}
-void
+static void
softpipe_delete_gs_state(struct pipe_context *pipe, void *gs)
{
struct softpipe_context *softpipe = softpipe_context(pipe);
@@ -279,3 +253,49 @@ softpipe_delete_gs_state(struct pipe_context *pipe, void *gs)
(state) ? state->draw_data : 0);
FREE(state);
}
+
+
+static void
+softpipe_set_constant_buffer(struct pipe_context *pipe,
+ uint shader, uint index,
+ struct pipe_resource *constants)
+{
+ struct softpipe_context *softpipe = softpipe_context(pipe);
+ unsigned size = constants ? constants->width0 : 0;
+ const void *data = constants ? softpipe_resource(constants)->data : NULL;
+
+ assert(shader < PIPE_SHADER_TYPES);
+
+ draw_flush(softpipe->draw);
+
+ /* note: reference counting */
+ pipe_resource_reference(&softpipe->constants[shader][index], constants);
+
+ if (shader == PIPE_SHADER_VERTEX || shader == PIPE_SHADER_GEOMETRY) {
+ draw_set_mapped_constant_buffer(softpipe->draw, shader, index, data, size);
+ }
+
+ softpipe->mapped_constants[shader][index] = data;
+ softpipe->const_buffer_size[shader][index] = size;
+
+ softpipe->dirty |= SP_NEW_CONSTANTS;
+}
+
+
+void
+softpipe_init_shader_funcs(struct pipe_context *pipe)
+{
+ pipe->create_fs_state = softpipe_create_fs_state;
+ pipe->bind_fs_state = softpipe_bind_fs_state;
+ pipe->delete_fs_state = softpipe_delete_fs_state;
+
+ pipe->create_vs_state = softpipe_create_vs_state;
+ pipe->bind_vs_state = softpipe_bind_vs_state;
+ pipe->delete_vs_state = softpipe_delete_vs_state;
+
+ pipe->create_gs_state = softpipe_create_gs_state;
+ pipe->bind_gs_state = softpipe_bind_gs_state;
+ pipe->delete_gs_state = softpipe_delete_gs_state;
+
+ pipe->set_constant_buffer = softpipe_set_constant_buffer;
+}