* NOTE: if you change this function, also look at the LLVM
* function llvm_middle_end_prepare() for similar changes.
*/
-static void fetch_pipeline_prepare( struct draw_pt_middle_end *middle,
- unsigned prim,
- unsigned opt,
- unsigned *max_vertices )
+static void
+fetch_pipeline_prepare(struct draw_pt_middle_end *middle,
+ unsigned prim,
+ unsigned opt,
+ unsigned *max_vertices)
{
- struct fetch_pipeline_middle_end *fpme = (struct fetch_pipeline_middle_end *)middle;
+ struct fetch_pipeline_middle_end *fpme =
+ (struct fetch_pipeline_middle_end *)middle;
struct draw_context *draw = fpme->draw;
struct draw_vertex_shader *vs = draw->vs.vertex_shader;
struct draw_geometry_shader *gs = draw->gs.geometry_shader;
unsigned i;
unsigned instance_id_index = ~0;
-
const unsigned gs_out_prim = (gs ? gs->output_primitive :
u_assembled_prim(prim));
unsigned nr_vs_outputs = draw_total_vs_outputs(draw);
/* Always leave room for the vertex header whether we need it or
* not. It's hard to get rid of it in particular because of the
- * viewport code in draw_pt_post_vs.c.
+ * viewport code in draw_pt_post_vs.c.
*/
fpme->vertex_size = sizeof(struct vertex_header) + nr * 4 * sizeof(float);
-
- draw_pt_fetch_prepare( fpme->fetch,
+ draw_pt_fetch_prepare( fpme->fetch,
vs->info.num_inputs,
fpme->vertex_size,
instance_id_index );
prim_info );
}
-static void emit(struct pt_emit *emit,
- const struct draw_vertex_info *vert_info,
- const struct draw_prim_info *prim_info)
+
+static void
+emit(struct pt_emit *emit,
+ const struct draw_vertex_info *vert_info,
+ const struct draw_prim_info *prim_info)
{
if (prim_info->linear) {
draw_pt_emit_linear(emit, vert_info, prim_info);
}
-static void draw_vertex_shader_run(struct draw_vertex_shader *vshader,
- const void *constants[PIPE_MAX_CONSTANT_BUFFERS],
- unsigned const_size[PIPE_MAX_CONSTANT_BUFFERS],
- const struct draw_vertex_info *input_verts,
- struct draw_vertex_info *output_verts )
+static void
+draw_vertex_shader_run(struct draw_vertex_shader *vshader,
+ const void *constants[PIPE_MAX_CONSTANT_BUFFERS],
+ unsigned const_size[PIPE_MAX_CONSTANT_BUFFERS],
+ const struct draw_vertex_info *input_verts,
+ struct draw_vertex_info *output_verts)
{
output_verts->vertex_size = input_verts->vertex_size;
output_verts->stride = input_verts->vertex_size;
input_verts->vertex_size);
}
-static void fetch_pipeline_generic( struct draw_pt_middle_end *middle,
- const struct draw_fetch_info *fetch_info,
- const struct draw_prim_info *in_prim_info )
+
+static void
+fetch_pipeline_generic(struct draw_pt_middle_end *middle,
+ const struct draw_fetch_info *fetch_info,
+ const struct draw_prim_info *in_prim_info)
{
- struct fetch_pipeline_middle_end *fpme = (struct fetch_pipeline_middle_end *)middle;
+ struct fetch_pipeline_middle_end *fpme =
+ (struct fetch_pipeline_middle_end *) middle;
struct draw_context *draw = fpme->draw;
struct draw_vertex_shader *vshader = draw->vs.vertex_shader;
struct draw_geometry_shader *gshader = draw->gs.geometry_shader;
}
if (prim_info->count == 0) {
debug_printf("GS/IA didn't emit any vertices!\n");
-
+
FREE(vert_info->verts);
if (free_prim_info) {
FREE(prim_info->primitive_lengths);
}
}
-static void fetch_pipeline_run( struct draw_pt_middle_end *middle,
- const unsigned *fetch_elts,
- unsigned fetch_count,
- const ushort *draw_elts,
- unsigned draw_count,
- unsigned prim_flags )
+
+static void
+fetch_pipeline_run(struct draw_pt_middle_end *middle,
+ const unsigned *fetch_elts,
+ unsigned fetch_count,
+ const ushort *draw_elts,
+ unsigned draw_count,
+ unsigned prim_flags)
{
- struct fetch_pipeline_middle_end *fpme = (struct fetch_pipeline_middle_end *)middle;
+ struct fetch_pipeline_middle_end *fpme =
+ (struct fetch_pipeline_middle_end *) middle;
struct draw_fetch_info fetch_info;
struct draw_prim_info prim_info;
}
-static void fetch_pipeline_linear_run( struct draw_pt_middle_end *middle,
- unsigned start,
- unsigned count,
- unsigned prim_flags)
+static void
+fetch_pipeline_linear_run(struct draw_pt_middle_end *middle,
+ unsigned start,
+ unsigned count,
+ unsigned prim_flags)
{
- struct fetch_pipeline_middle_end *fpme = (struct fetch_pipeline_middle_end *)middle;
+ struct fetch_pipeline_middle_end *fpme =
+ (struct fetch_pipeline_middle_end *) middle;
struct draw_fetch_info fetch_info;
struct draw_prim_info prim_info;
-static boolean fetch_pipeline_linear_run_elts( struct draw_pt_middle_end *middle,
- unsigned start,
- unsigned count,
- const ushort *draw_elts,
- unsigned draw_count,
- unsigned prim_flags )
+static boolean
+fetch_pipeline_linear_run_elts(struct draw_pt_middle_end *middle,
+ unsigned start,
+ unsigned count,
+ const ushort *draw_elts,
+ unsigned draw_count,
+ unsigned prim_flags )
{
- struct fetch_pipeline_middle_end *fpme = (struct fetch_pipeline_middle_end *)middle;
+ struct fetch_pipeline_middle_end *fpme =
+ (struct fetch_pipeline_middle_end *) middle;
struct draw_fetch_info fetch_info;
struct draw_prim_info prim_info;
}
-
-static void fetch_pipeline_finish( struct draw_pt_middle_end *middle )
+static void
+fetch_pipeline_finish( struct draw_pt_middle_end *middle )
{
/* nothing to do */
}
-static void fetch_pipeline_destroy( struct draw_pt_middle_end *middle )
+
+static void
+fetch_pipeline_destroy( struct draw_pt_middle_end *middle )
{
- struct fetch_pipeline_middle_end *fpme = (struct fetch_pipeline_middle_end *)middle;
+ struct fetch_pipeline_middle_end *fpme =
+ (struct fetch_pipeline_middle_end *) middle;
if (fpme->fetch)
draw_pt_fetch_destroy( fpme->fetch );
}
-struct draw_pt_middle_end *draw_pt_fetch_pipeline_or_emit( struct draw_context *draw )
+struct draw_pt_middle_end *
+draw_pt_fetch_pipeline_or_emit(struct draw_context *draw)
{
- struct fetch_pipeline_middle_end *fpme = CALLOC_STRUCT( fetch_pipeline_middle_end );
+ struct fetch_pipeline_middle_end *fpme =
+ CALLOC_STRUCT( fetch_pipeline_middle_end );
if (!fpme)
goto fail;
}
-static void pipeline(struct llvm_middle_end *llvm,
- const struct draw_vertex_info *vert_info,
- const struct draw_prim_info *prim_info)
+static void
+pipeline(struct llvm_middle_end *llvm,
+ const struct draw_vertex_info *vert_info,
+ const struct draw_prim_info *prim_info)
{
if (prim_info->linear)
draw_pipeline_run_linear( llvm->draw,
prim_info );
}
-static void emit(struct pt_emit *emit,
- const struct draw_vertex_info *vert_info,
- const struct draw_prim_info *prim_info)
+
+static void
+emit(struct pt_emit *emit,
+ const struct draw_vertex_info *vert_info,
+ const struct draw_prim_info *prim_info)
{
if (prim_info->linear) {
draw_pt_emit_linear(emit, vert_info, prim_info);
}
}
+
static void
-llvm_pipeline_generic( struct draw_pt_middle_end *middle,
- const struct draw_fetch_info *fetch_info,
- const struct draw_prim_info *in_prim_info )
+llvm_pipeline_generic(struct draw_pt_middle_end *middle,
+ const struct draw_fetch_info *fetch_info,
+ const struct draw_prim_info *in_prim_info)
{
struct llvm_middle_end *fpme = (struct llvm_middle_end *)middle;
struct draw_context *draw = fpme->draw;
llvm_vert_info.count = fetch_info->count;
llvm_vert_info.vertex_size = fpme->vertex_size;
llvm_vert_info.stride = fpme->vertex_size;
- llvm_vert_info.verts =
- (struct vertex_header *)MALLOC(fpme->vertex_size *
- align(fetch_info->count, lp_native_vector_width / 32));
+ llvm_vert_info.verts = (struct vertex_header *)
+ MALLOC(fpme->vertex_size *
+ align(fetch_info->count, lp_native_vector_width / 32));
if (!llvm_vert_info.verts) {
assert(0);
return;
fetch_info = NULL;
vert_info = &llvm_vert_info;
-
if ((opt & PT_SHADE) && gshader) {
struct draw_vertex_shader *vshader = draw->vs.vertex_shader;
draw_geometry_shader_run(gshader,
}
if (prim_info->count == 0) {
debug_printf("GS/IA didn't emit any vertices!\n");
-
+
FREE(vert_info->verts);
if (free_prim_info) {
FREE(prim_info->primitive_lengths);
}
-static void llvm_middle_end_run( struct draw_pt_middle_end *middle,
- const unsigned *fetch_elts,
- unsigned fetch_count,
- const ushort *draw_elts,
- unsigned draw_count,
- unsigned prim_flags )
+static void
+llvm_middle_end_run(struct draw_pt_middle_end *middle,
+ const unsigned *fetch_elts,
+ unsigned fetch_count,
+ const ushort *draw_elts,
+ unsigned draw_count,
+ unsigned prim_flags)
{
struct llvm_middle_end *fpme = (struct llvm_middle_end *)middle;
struct draw_fetch_info fetch_info;
}
-static void llvm_middle_end_linear_run( struct draw_pt_middle_end *middle,
- unsigned start,
- unsigned count,
- unsigned prim_flags)
+static void
+llvm_middle_end_linear_run(struct draw_pt_middle_end *middle,
+ unsigned start,
+ unsigned count,
+ unsigned prim_flags)
{
struct llvm_middle_end *fpme = (struct llvm_middle_end *)middle;
struct draw_fetch_info fetch_info;
}
-
static boolean
-llvm_middle_end_linear_run_elts( struct draw_pt_middle_end *middle,
- unsigned start,
- unsigned count,
- const ushort *draw_elts,
- unsigned draw_count,
- unsigned prim_flags )
+llvm_middle_end_linear_run_elts(struct draw_pt_middle_end *middle,
+ unsigned start,
+ unsigned count,
+ const ushort *draw_elts,
+ unsigned draw_count,
+ unsigned prim_flags)
{
struct llvm_middle_end *fpme = (struct llvm_middle_end *)middle;
struct draw_fetch_info fetch_info;
}
-
-static void llvm_middle_end_finish( struct draw_pt_middle_end *middle )
+static void
+llvm_middle_end_finish(struct draw_pt_middle_end *middle)
{
/* nothing to do */
}
-static void llvm_middle_end_destroy( struct draw_pt_middle_end *middle )
+
+static void
+llvm_middle_end_destroy(struct draw_pt_middle_end *middle)
{
struct llvm_middle_end *fpme = (struct llvm_middle_end *)middle;