Keith Whitwell | 8e4a95a | 2007-05-24 10:41:34 +0100 | [diff] [blame] | 1 | /************************************************************************** |
| 2 | * |
| 3 | * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. |
| 4 | * All Rights Reserved. |
| 5 | * |
| 6 | * Permission is hereby granted, free of charge, to any person obtaining a |
| 7 | * copy of this software and associated documentation files (the |
| 8 | * "Software"), to deal in the Software without restriction, including |
| 9 | * without limitation the rights to use, copy, modify, merge, publish, |
| 10 | * distribute, sub license, and/or sell copies of the Software, and to |
| 11 | * permit persons to whom the Software is furnished to do so, subject to |
| 12 | * the following conditions: |
| 13 | * |
| 14 | * The above copyright notice and this permission notice (including the |
| 15 | * next paragraph) shall be included in all copies or substantial portions |
| 16 | * of the Software. |
| 17 | * |
| 18 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
| 19 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
| 20 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. |
| 21 | * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR |
| 22 | * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, |
| 23 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE |
| 24 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| 25 | * |
| 26 | **************************************************************************/ |
| 27 | |
Brian | 279ffe3 | 2007-07-09 16:14:26 -0600 | [diff] [blame] | 28 | /** |
| 29 | * Private data structures, etc for the draw module. |
Keith Whitwell | 8e4a95a | 2007-05-24 10:41:34 +0100 | [diff] [blame] | 30 | */ |
| 31 | |
Keith Whitwell | 8e4a95a | 2007-05-24 10:41:34 +0100 | [diff] [blame] | 32 | |
Brian | 279ffe3 | 2007-07-09 16:14:26 -0600 | [diff] [blame] | 33 | /** |
| 34 | * Authors: |
| 35 | * Keith Whitwell <keith@tungstengraphics.com> |
| 36 | * Brian Paul |
Keith Whitwell | 8e4a95a | 2007-05-24 10:41:34 +0100 | [diff] [blame] | 37 | */ |
Keith Whitwell | 8e4a95a | 2007-05-24 10:41:34 +0100 | [diff] [blame] | 38 | |
Brian | 279ffe3 | 2007-07-09 16:14:26 -0600 | [diff] [blame] | 39 | |
| 40 | #ifndef DRAW_PRIVATE_H |
| 41 | #define DRAW_PRIVATE_H |
| 42 | |
| 43 | |
Brian | 279ffe3 | 2007-07-09 16:14:26 -0600 | [diff] [blame] | 44 | #include "pipe/p_state.h" |
| 45 | #include "pipe/p_defines.h" |
Brian | 766fa51 | 2007-08-20 17:02:07 -0600 | [diff] [blame] | 46 | |
Brian | d3eb25c | 2007-08-23 13:27:18 -0600 | [diff] [blame] | 47 | #include "draw_vertex.h" |
Brian | 279ffe3 | 2007-07-09 16:14:26 -0600 | [diff] [blame] | 48 | |
Zack Rusin | a1a989f | 2007-09-28 04:33:55 -0400 | [diff] [blame] | 49 | #include "x86/rtasm/x86sse.h" |
Brian | 0d13ade | 2007-10-02 11:46:11 -0600 | [diff] [blame] | 50 | #include "pipe/tgsi/exec/tgsi_core.h" |
| 51 | |
Brian | 279ffe3 | 2007-07-09 16:14:26 -0600 | [diff] [blame] | 52 | |
| 53 | /** |
| 54 | * Basic vertex info. |
| 55 | * Carry some useful information around with the vertices in the prim pipe. |
| 56 | */ |
| 57 | struct vertex_header { |
Brian | fd0a6d6 | 2007-08-16 12:52:20 -0600 | [diff] [blame] | 58 | unsigned clipmask:12; |
| 59 | unsigned edgeflag:1; |
Keith Whitwell | a37e0da | 2007-09-25 13:20:53 +0100 | [diff] [blame] | 60 | unsigned pad:3; |
| 61 | unsigned vertex_id:16; |
Brian | 279ffe3 | 2007-07-09 16:14:26 -0600 | [diff] [blame] | 62 | |
Brian | fd0a6d6 | 2007-08-16 12:52:20 -0600 | [diff] [blame] | 63 | float clip[4]; |
Brian | 279ffe3 | 2007-07-09 16:14:26 -0600 | [diff] [blame] | 64 | |
Brian | fd0a6d6 | 2007-08-16 12:52:20 -0600 | [diff] [blame] | 65 | float data[][4]; /* Note variable size */ |
Brian | 279ffe3 | 2007-07-09 16:14:26 -0600 | [diff] [blame] | 66 | }; |
| 67 | |
Brian | d8b16d4 | 2007-08-23 17:00:47 -0600 | [diff] [blame] | 68 | /* XXX This is too large */ |
Brian | 0867345 | 2007-09-20 13:42:37 -0600 | [diff] [blame] | 69 | #define MAX_VERTEX_SIZE ((2 + PIPE_MAX_SHADER_OUTPUTS) * 4 * sizeof(float)) |
Keith Whitwell | 4bb2134 | 2007-08-14 15:44:41 +0100 | [diff] [blame] | 70 | |
| 71 | |
Brian | 279ffe3 | 2007-07-09 16:14:26 -0600 | [diff] [blame] | 72 | |
| 73 | /** |
| 74 | * Basic info for a point/line/triangle primitive. |
| 75 | */ |
| 76 | struct prim_header { |
Brian | fd0a6d6 | 2007-08-16 12:52:20 -0600 | [diff] [blame] | 77 | float det; /**< front/back face determinant */ |
| 78 | unsigned reset_line_stipple:1; |
| 79 | unsigned edgeflags:3; |
| 80 | unsigned pad:28; |
Brian | 279ffe3 | 2007-07-09 16:14:26 -0600 | [diff] [blame] | 81 | struct vertex_header *v[3]; /**< 1 to 3 vertex pointers */ |
| 82 | }; |
| 83 | |
| 84 | |
| 85 | |
| 86 | struct draw_context; |
| 87 | |
| 88 | /** |
| 89 | * Base class for all primitive drawing stages. |
| 90 | */ |
Brian | ea470ee | 2007-07-12 13:32:31 -0600 | [diff] [blame] | 91 | struct draw_stage |
Brian | 279ffe3 | 2007-07-09 16:14:26 -0600 | [diff] [blame] | 92 | { |
| 93 | struct draw_context *draw; /**< parent context */ |
| 94 | |
Brian | ea470ee | 2007-07-12 13:32:31 -0600 | [diff] [blame] | 95 | struct draw_stage *next; /**< next stage in pipeline */ |
Keith Whitwell | 8e4a95a | 2007-05-24 10:41:34 +0100 | [diff] [blame] | 96 | |
| 97 | struct vertex_header **tmp; |
Brian | fd0a6d6 | 2007-08-16 12:52:20 -0600 | [diff] [blame] | 98 | unsigned nr_tmps; |
Keith Whitwell | 8e4a95a | 2007-05-24 10:41:34 +0100 | [diff] [blame] | 99 | |
Brian | ea470ee | 2007-07-12 13:32:31 -0600 | [diff] [blame] | 100 | void (*begin)( struct draw_stage * ); |
Keith Whitwell | 8e4a95a | 2007-05-24 10:41:34 +0100 | [diff] [blame] | 101 | |
Brian | ea470ee | 2007-07-12 13:32:31 -0600 | [diff] [blame] | 102 | void (*point)( struct draw_stage *, |
Keith Whitwell | 8e4a95a | 2007-05-24 10:41:34 +0100 | [diff] [blame] | 103 | struct prim_header * ); |
| 104 | |
Brian | ea470ee | 2007-07-12 13:32:31 -0600 | [diff] [blame] | 105 | void (*line)( struct draw_stage *, |
Keith Whitwell | 8e4a95a | 2007-05-24 10:41:34 +0100 | [diff] [blame] | 106 | struct prim_header * ); |
| 107 | |
Brian | ea470ee | 2007-07-12 13:32:31 -0600 | [diff] [blame] | 108 | void (*tri)( struct draw_stage *, |
Keith Whitwell | 8e4a95a | 2007-05-24 10:41:34 +0100 | [diff] [blame] | 109 | struct prim_header * ); |
Zack Rusin | a1a989f | 2007-09-28 04:33:55 -0400 | [diff] [blame] | 110 | |
Brian | ea470ee | 2007-07-12 13:32:31 -0600 | [diff] [blame] | 111 | void (*end)( struct draw_stage * ); |
Brian | 0360b49 | 2007-07-25 15:48:09 -0600 | [diff] [blame] | 112 | |
| 113 | void (*reset_stipple_counter)( struct draw_stage * ); |
Keith Whitwell | 8e4a95a | 2007-05-24 10:41:34 +0100 | [diff] [blame] | 114 | }; |
| 115 | |
| 116 | |
Keith Whitwell | 4bb2134 | 2007-08-14 15:44:41 +0100 | [diff] [blame] | 117 | #define PRIM_QUEUE_LENGTH 16 |
| 118 | #define VCACHE_SIZE 32 |
| 119 | #define VCACHE_OVERFLOW 4 |
| 120 | #define VS_QUEUE_LENGTH (VCACHE_SIZE + VCACHE_OVERFLOW + 1) /* can never fill up */ |
| 121 | |
Zack Rusin | a1a989f | 2007-09-28 04:33:55 -0400 | [diff] [blame] | 122 | /** |
| 123 | * Private version of the compiled vertex_shader |
| 124 | */ |
| 125 | struct draw_vertex_shader { |
| 126 | const struct pipe_shader_state *state; |
Zack Rusin | a1a989f | 2007-09-28 04:33:55 -0400 | [diff] [blame] | 127 | }; |
Keith Whitwell | 4bb2134 | 2007-08-14 15:44:41 +0100 | [diff] [blame] | 128 | |
Brian | 279ffe3 | 2007-07-09 16:14:26 -0600 | [diff] [blame] | 129 | /** |
| 130 | * Private context for the drawing module. |
| 131 | */ |
| 132 | struct draw_context |
| 133 | { |
Brian | fd0a6d6 | 2007-08-16 12:52:20 -0600 | [diff] [blame] | 134 | /** Drawing/primitive pipeline stages */ |
Brian | 279ffe3 | 2007-07-09 16:14:26 -0600 | [diff] [blame] | 135 | struct { |
Brian | ea470ee | 2007-07-12 13:32:31 -0600 | [diff] [blame] | 136 | struct draw_stage *first; /**< one of the following */ |
Keith Whitwell | 8e4a95a | 2007-05-24 10:41:34 +0100 | [diff] [blame] | 137 | |
Keith Whitwell | 08589f7 | 2007-09-26 11:56:17 +0100 | [diff] [blame] | 138 | struct draw_stage *validate; |
| 139 | |
Brian | 279ffe3 | 2007-07-09 16:14:26 -0600 | [diff] [blame] | 140 | /* stages (in logical order) */ |
Brian | 63a51ae | 2007-09-06 17:07:09 -0600 | [diff] [blame] | 141 | struct draw_stage *feedback; |
Brian | ea470ee | 2007-07-12 13:32:31 -0600 | [diff] [blame] | 142 | struct draw_stage *flatshade; |
| 143 | struct draw_stage *clip; |
| 144 | struct draw_stage *cull; |
| 145 | struct draw_stage *twoside; |
| 146 | struct draw_stage *offset; |
| 147 | struct draw_stage *unfilled; |
Brian | e3444de | 2007-10-22 11:01:34 -0600 | [diff] [blame] | 148 | struct draw_stage *wide; |
Zack Rusin | de69fc1 | 2007-09-18 10:02:16 -0400 | [diff] [blame] | 149 | struct draw_stage *rasterize; |
Brian | 279ffe3 | 2007-07-09 16:14:26 -0600 | [diff] [blame] | 150 | } pipeline; |
| 151 | |
| 152 | /* pipe state that we need: */ |
Zack Rusin | 2944018 | 2007-09-17 12:59:50 -0400 | [diff] [blame] | 153 | const struct pipe_rasterizer_state *rasterizer; |
Brian | 63a51ae | 2007-09-06 17:07:09 -0600 | [diff] [blame] | 154 | struct pipe_feedback_state feedback; |
Brian | 279ffe3 | 2007-07-09 16:14:26 -0600 | [diff] [blame] | 155 | struct pipe_viewport_state viewport; |
Brian | 0a26299 | 2007-08-20 15:11:11 -0600 | [diff] [blame] | 156 | struct pipe_vertex_buffer vertex_buffer[PIPE_ATTRIB_MAX]; |
| 157 | struct pipe_vertex_element vertex_element[PIPE_ATTRIB_MAX]; |
Zack Rusin | a1a989f | 2007-09-28 04:33:55 -0400 | [diff] [blame] | 158 | const struct draw_vertex_shader *vertex_shader; |
Brian | 63a51ae | 2007-09-06 17:07:09 -0600 | [diff] [blame] | 159 | struct pipe_vertex_buffer feedback_buffer[PIPE_ATTRIB_MAX]; |
| 160 | struct pipe_vertex_element feedback_element[PIPE_ATTRIB_MAX]; |
Brian | 3e2be1c | 2007-08-15 18:54:05 -0600 | [diff] [blame] | 161 | |
Brian | 766fa51 | 2007-08-20 17:02:07 -0600 | [diff] [blame] | 162 | /** The mapped vertex element/index buffer */ |
| 163 | const void *mapped_elts; |
| 164 | unsigned eltSize; /**< bytes per index (0, 1, 2 or 4) */ |
| 165 | /** The mapped vertex arrays */ |
Brian | 0a26299 | 2007-08-20 15:11:11 -0600 | [diff] [blame] | 166 | const void *mapped_vbuffer[PIPE_ATTRIB_MAX]; |
Brian | c0bb4ba | 2007-08-22 12:24:51 -0600 | [diff] [blame] | 167 | /** The mapped constant buffers (for vertex shader) */ |
| 168 | const void *mapped_constants; |
Brian | 3e2be1c | 2007-08-15 18:54:05 -0600 | [diff] [blame] | 169 | |
Brian | 63a51ae | 2007-09-06 17:07:09 -0600 | [diff] [blame] | 170 | /** The mapped vertex element/index buffer */ |
| 171 | void *mapped_feedback_buffer[PIPE_MAX_FEEDBACK_ATTRIBS]; |
| 172 | uint mapped_feedback_buffer_size[PIPE_MAX_FEEDBACK_ATTRIBS]; /* in bytes */ |
| 173 | |
Brian | 279ffe3 | 2007-07-09 16:14:26 -0600 | [diff] [blame] | 174 | /* Clip derived state: |
| 175 | */ |
Brian | fd0a6d6 | 2007-08-16 12:52:20 -0600 | [diff] [blame] | 176 | float plane[12][4]; |
| 177 | unsigned nr_planes; |
Brian | 279ffe3 | 2007-07-09 16:14:26 -0600 | [diff] [blame] | 178 | |
Brian | d3eb25c | 2007-08-23 13:27:18 -0600 | [diff] [blame] | 179 | /** Describes the layout of post-transformation vertices */ |
| 180 | struct vertex_info vertex_info; |
Brian | 963b8a7 | 2007-08-30 16:37:56 -0600 | [diff] [blame] | 181 | /** Two-sided attributes: */ |
| 182 | uint attrib_front0, attrib_back0; |
| 183 | uint attrib_front1, attrib_back1; |
Brian | 279ffe3 | 2007-07-09 16:14:26 -0600 | [diff] [blame] | 184 | |
Brian | 3eeef8a | 2007-10-15 10:30:38 -0600 | [diff] [blame] | 185 | boolean drawing; /**< do we presently have something queued for drawing? */ |
Brian | fd0a6d6 | 2007-08-16 12:52:20 -0600 | [diff] [blame] | 186 | unsigned prim; /**< current prim type: PIPE_PRIM_x */ |
| 187 | unsigned reduced_prim; |
| 188 | |
Brian | 0d13ade | 2007-10-02 11:46:11 -0600 | [diff] [blame] | 189 | /** TGSI program interpreter runtime state */ |
| 190 | struct tgsi_exec_machine machine; |
Keith Whitwell | 4bb2134 | 2007-08-14 15:44:41 +0100 | [diff] [blame] | 191 | |
| 192 | /* Post-tnl vertex cache: |
| 193 | */ |
| 194 | struct { |
Brian | 3df65af | 2007-10-23 15:02:02 -0600 | [diff] [blame^] | 195 | unsigned referenced; /**< bitfield */ |
Brian | fd0a6d6 | 2007-08-16 12:52:20 -0600 | [diff] [blame] | 196 | unsigned idx[VCACHE_SIZE + VCACHE_OVERFLOW]; |
Keith Whitwell | 4bb2134 | 2007-08-14 15:44:41 +0100 | [diff] [blame] | 197 | struct vertex_header *vertex[VCACHE_SIZE + VCACHE_OVERFLOW]; |
Brian | fd0a6d6 | 2007-08-16 12:52:20 -0600 | [diff] [blame] | 198 | unsigned overflow; |
Keith Whitwell | 08589f7 | 2007-09-26 11:56:17 +0100 | [diff] [blame] | 199 | |
| 200 | struct vertex_header *(*get_vertex)( struct draw_context *draw, |
| 201 | unsigned i ); |
Keith Whitwell | 4bb2134 | 2007-08-14 15:44:41 +0100 | [diff] [blame] | 202 | } vcache; |
| 203 | |
| 204 | /* Vertex shader queue: |
| 205 | */ |
| 206 | struct { |
| 207 | struct { |
Brian | fd0a6d6 | 2007-08-16 12:52:20 -0600 | [diff] [blame] | 208 | unsigned elt; |
Keith Whitwell | 4bb2134 | 2007-08-14 15:44:41 +0100 | [diff] [blame] | 209 | struct vertex_header *dest; |
| 210 | } queue[VS_QUEUE_LENGTH]; |
Brian | fd0a6d6 | 2007-08-16 12:52:20 -0600 | [diff] [blame] | 211 | unsigned queue_nr; |
Keith Whitwell | 4bb2134 | 2007-08-14 15:44:41 +0100 | [diff] [blame] | 212 | } vs; |
| 213 | |
| 214 | /* Prim pipeline queue: |
| 215 | */ |
| 216 | struct { |
| 217 | |
| 218 | /* Need to queue up primitives until their vertices have been |
| 219 | * transformed by a vs queue flush. |
| 220 | */ |
| 221 | struct prim_header queue[PRIM_QUEUE_LENGTH]; |
Brian | fd0a6d6 | 2007-08-16 12:52:20 -0600 | [diff] [blame] | 222 | unsigned queue_nr; |
Keith Whitwell | 4bb2134 | 2007-08-14 15:44:41 +0100 | [diff] [blame] | 223 | } pq; |
Zack Rusin | 8731e39 | 2007-09-28 07:33:54 -0400 | [diff] [blame] | 224 | |
| 225 | int use_sse : 1; |
Brian | 279ffe3 | 2007-07-09 16:14:26 -0600 | [diff] [blame] | 226 | }; |
| 227 | |
| 228 | |
| 229 | |
Brian | 63a51ae | 2007-09-06 17:07:09 -0600 | [diff] [blame] | 230 | extern struct draw_stage *draw_feedback_stage( struct draw_context *context ); |
Brian | ea470ee | 2007-07-12 13:32:31 -0600 | [diff] [blame] | 231 | extern struct draw_stage *draw_unfilled_stage( struct draw_context *context ); |
| 232 | extern struct draw_stage *draw_twoside_stage( struct draw_context *context ); |
| 233 | extern struct draw_stage *draw_offset_stage( struct draw_context *context ); |
| 234 | extern struct draw_stage *draw_clip_stage( struct draw_context *context ); |
| 235 | extern struct draw_stage *draw_flatshade_stage( struct draw_context *context ); |
| 236 | extern struct draw_stage *draw_cull_stage( struct draw_context *context ); |
Brian | e3444de | 2007-10-22 11:01:34 -0600 | [diff] [blame] | 237 | extern struct draw_stage *draw_wide_stage( struct draw_context *context ); |
Keith Whitwell | 08589f7 | 2007-09-26 11:56:17 +0100 | [diff] [blame] | 238 | extern struct draw_stage *draw_validate_stage( struct draw_context *context ); |
Brian | 279ffe3 | 2007-07-09 16:14:26 -0600 | [diff] [blame] | 239 | |
| 240 | |
Brian | ea470ee | 2007-07-12 13:32:31 -0600 | [diff] [blame] | 241 | extern void draw_free_tmps( struct draw_stage *stage ); |
Brian | fd0a6d6 | 2007-08-16 12:52:20 -0600 | [diff] [blame] | 242 | extern void draw_alloc_tmps( struct draw_stage *stage, unsigned nr ); |
Brian | 279ffe3 | 2007-07-09 16:14:26 -0600 | [diff] [blame] | 243 | |
| 244 | |
Brian | 9a11a4a | 2007-08-31 11:28:31 -0600 | [diff] [blame] | 245 | extern int draw_vertex_cache_check_space( struct draw_context *draw, |
| 246 | unsigned nr_verts ); |
| 247 | |
Brian | 9a11a4a | 2007-08-31 11:28:31 -0600 | [diff] [blame] | 248 | extern void draw_vertex_cache_invalidate( struct draw_context *draw ); |
| 249 | extern void draw_vertex_cache_unreference( struct draw_context *draw ); |
Keith Whitwell | a37e0da | 2007-09-25 13:20:53 +0100 | [diff] [blame] | 250 | extern void draw_vertex_cache_reset_vertex_ids( struct draw_context *draw ); |
| 251 | |
Brian | 9a11a4a | 2007-08-31 11:28:31 -0600 | [diff] [blame] | 252 | |
| 253 | extern void draw_vertex_shader_queue_flush( struct draw_context *draw ); |
| 254 | |
| 255 | struct tgsi_exec_machine; |
| 256 | |
| 257 | extern void draw_vertex_fetch( struct draw_context *draw, |
| 258 | struct tgsi_exec_machine *machine, |
| 259 | const unsigned *elts, |
| 260 | unsigned count ); |
| 261 | |
Brian | 279ffe3 | 2007-07-09 16:14:26 -0600 | [diff] [blame] | 262 | |
Keith Whitwell | 08589f7 | 2007-09-26 11:56:17 +0100 | [diff] [blame] | 263 | #define DRAW_FLUSH_PRIM_QUEUE 0x1 |
| 264 | #define DRAW_FLUSH_VERTEX_CACHE_INVALIDATE 0x2 |
| 265 | #define DRAW_FLUSH_DRAW 0x4 |
| 266 | |
| 267 | |
| 268 | void draw_do_flush( struct draw_context *draw, |
| 269 | unsigned flags ); |
| 270 | |
| 271 | |
| 272 | |
| 273 | |
Brian | 279ffe3 | 2007-07-09 16:14:26 -0600 | [diff] [blame] | 274 | /** |
| 275 | * Get a writeable copy of a vertex. |
| 276 | * \param stage drawing stage info |
| 277 | * \param vert the vertex to copy (source) |
| 278 | * \param idx index into stage's tmp[] array to put the copy (dest) |
| 279 | * \return pointer to the copied vertex |
Keith Whitwell | 8e4a95a | 2007-05-24 10:41:34 +0100 | [diff] [blame] | 280 | */ |
| 281 | static INLINE struct vertex_header * |
Brian | ea470ee | 2007-07-12 13:32:31 -0600 | [diff] [blame] | 282 | dup_vert( struct draw_stage *stage, |
Keith Whitwell | 8e4a95a | 2007-05-24 10:41:34 +0100 | [diff] [blame] | 283 | const struct vertex_header *vert, |
Brian | fd0a6d6 | 2007-08-16 12:52:20 -0600 | [diff] [blame] | 284 | unsigned idx ) |
Keith Whitwell | 8e4a95a | 2007-05-24 10:41:34 +0100 | [diff] [blame] | 285 | { |
| 286 | struct vertex_header *tmp = stage->tmp[idx]; |
Brian | d3eb25c | 2007-08-23 13:27:18 -0600 | [diff] [blame] | 287 | memcpy(tmp, vert, stage->draw->vertex_info.size * sizeof(float) ); |
Keith Whitwell | a37e0da | 2007-09-25 13:20:53 +0100 | [diff] [blame] | 288 | tmp->vertex_id = ~0; |
Keith Whitwell | 8e4a95a | 2007-05-24 10:41:34 +0100 | [diff] [blame] | 289 | return tmp; |
| 290 | } |
| 291 | |
Zack Rusin | b46926c | 2007-10-03 10:31:42 -0400 | [diff] [blame] | 292 | static INLINE float |
| 293 | dot4(const float *a, const float *b) |
| 294 | { |
| 295 | float result = (a[0]*b[0] + |
| 296 | a[1]*b[1] + |
| 297 | a[2]*b[2] + |
| 298 | a[3]*b[3]); |
| 299 | |
| 300 | return result; |
| 301 | } |
Keith Whitwell | 8e4a95a | 2007-05-24 10:41:34 +0100 | [diff] [blame] | 302 | |
Brian | 279ffe3 | 2007-07-09 16:14:26 -0600 | [diff] [blame] | 303 | #endif /* DRAW_PRIVATE_H */ |