softpipe->pipe.bind_rasterizer_state = softpipe_bind_rasterizer_state;
softpipe->pipe.delete_rasterizer_state = softpipe_delete_rasterizer_state;
- softpipe->pipe.create_fs_state = softpipe_create_fs_state;
- softpipe->pipe.bind_fs_state = softpipe_bind_fs_state;
- softpipe->pipe.delete_fs_state = softpipe_delete_fs_state;
-
- softpipe->pipe.create_vs_state = softpipe_create_vs_state;
- softpipe->pipe.bind_vs_state = softpipe_bind_vs_state;
- softpipe->pipe.delete_vs_state = softpipe_delete_vs_state;
-
- softpipe->pipe.create_gs_state = softpipe_create_gs_state;
- softpipe->pipe.bind_gs_state = softpipe_bind_gs_state;
- softpipe->pipe.delete_gs_state = softpipe_delete_gs_state;
+ softpipe_init_shader_funcs(&softpipe->pipe);
softpipe->pipe.create_vertex_elements_state = softpipe_create_vertex_elements_state;
softpipe->pipe.bind_vertex_elements_state = softpipe_bind_vertex_elements_state;
softpipe->pipe.set_stencil_ref = softpipe_set_stencil_ref;
softpipe->pipe.set_clip_state = softpipe_set_clip_state;
softpipe->pipe.set_sample_mask = softpipe_set_sample_mask;
- softpipe->pipe.set_constant_buffer = softpipe_set_constant_buffer;
softpipe->pipe.set_framebuffer_state = softpipe_set_framebuffer_state;
softpipe->pipe.set_polygon_stipple = softpipe_set_polygon_stipple;
softpipe->pipe.set_scissor_state = softpipe_set_scissor_state;
void softpipe_set_sample_mask( struct pipe_context *,
unsigned sample_mask );
-void softpipe_set_constant_buffer(struct pipe_context *,
- uint shader, uint index,
- struct pipe_resource *buf);
-
-void *softpipe_create_fs_state(struct pipe_context *,
- const struct pipe_shader_state *);
-void softpipe_bind_fs_state(struct pipe_context *, void *);
-void softpipe_delete_fs_state(struct pipe_context *, void *);
-void *softpipe_create_vs_state(struct pipe_context *,
- const struct pipe_shader_state *);
-void softpipe_bind_vs_state(struct pipe_context *, void *);
-void softpipe_delete_vs_state(struct pipe_context *, void *);
-void *softpipe_create_gs_state(struct pipe_context *,
- const struct pipe_shader_state *);
-void softpipe_bind_gs_state(struct pipe_context *, void *);
-void softpipe_delete_gs_state(struct pipe_context *, void *);
+void
+softpipe_init_shader_funcs(struct pipe_context *pipe);
void *softpipe_create_vertex_elements_state(struct pipe_context *,
unsigned count,
#include "tgsi/tgsi_parse.h"
-void *
+static void *
softpipe_create_fs_state(struct pipe_context *pipe,
const struct pipe_shader_state *templ)
{
}
-void
+static void
softpipe_bind_fs_state(struct pipe_context *pipe, void *fs)
{
struct softpipe_context *softpipe = softpipe_context(pipe);
}
-void
+static void
softpipe_delete_fs_state(struct pipe_context *pipe, void *fs)
{
struct softpipe_context *softpipe = softpipe_context(pipe);
}
-void *
+static void *
softpipe_create_vs_state(struct pipe_context *pipe,
const struct pipe_shader_state *templ)
{
}
-void
+static void
softpipe_bind_vs_state(struct pipe_context *pipe, void *vs)
{
struct softpipe_context *softpipe = softpipe_context(pipe);
}
-void
+static void
softpipe_delete_vs_state(struct pipe_context *pipe, void *vs)
{
struct softpipe_context *softpipe = softpipe_context(pipe);
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)
{
}
-void
+static void
softpipe_bind_gs_state(struct pipe_context *pipe, void *gs)
{
struct softpipe_context *softpipe = softpipe_context(pipe);
}
-void
+static void
softpipe_delete_gs_state(struct pipe_context *pipe, void *gs)
{
struct softpipe_context *softpipe = softpipe_context(pipe);
(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;
+}