Cell: trivial clean-ups
[mesa.git] / src / gallium / drivers / cell / spu / spu_vertex_shader.h
1 #ifndef SPU_VERTEX_SHADER_H
2 #define SPU_VERTEX_SHADER_H
3
4 #include "pipe/p_format.h"
5 #include "spu_exec.h"
6
7 struct spu_vs_context;
8
9 typedef void (*spu_full_fetch_func)( struct spu_vs_context *draw,
10 struct spu_exec_machine *machine,
11 const unsigned *elts,
12 unsigned count );
13
14 struct spu_vs_context {
15 struct pipe_viewport_state viewport;
16
17 struct {
18 uint64_t src_ptr[PIPE_ATTRIB_MAX];
19 unsigned pitch[PIPE_ATTRIB_MAX];
20 unsigned size[PIPE_ATTRIB_MAX];
21 unsigned code_offset[PIPE_ATTRIB_MAX];
22 unsigned nr_attrs;
23 boolean dirty;
24
25 spu_full_fetch_func fetch_func;
26 void *code;
27 } vertex_fetch;
28
29 /* Clip derived state:
30 */
31 float plane[12][4];
32 unsigned nr_planes;
33
34 struct spu_exec_machine machine;
35 const float (*constants)[4];
36
37 unsigned num_vs_outputs;
38 };
39
40 extern void spu_update_vertex_fetch(struct spu_vs_context *draw);
41
42 static INLINE void spu_vertex_fetch(struct spu_vs_context *draw,
43 struct spu_exec_machine *machine,
44 const unsigned *elts,
45 unsigned count)
46 {
47 if (draw->vertex_fetch.dirty) {
48 spu_update_vertex_fetch(draw);
49 draw->vertex_fetch.dirty = 0;
50 }
51
52 (*draw->vertex_fetch.fetch_func)(draw, machine, elts, count);
53 }
54
55 struct cell_command_vs;
56
57 extern void
58 spu_execute_vertex_shader(struct spu_vs_context *draw,
59 const struct cell_command_vs *vs);
60
61 #endif /* SPU_VERTEX_SHADER_H */