~ubuntu-branches/ubuntu/natty/mesa/natty-proposed

« back to all changes in this revision

Viewing changes to src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline.c

  • Committer: Bazaar Package Importer
  • Author(s): Robert Hooker, Robert Hooker, Christopher James Halse Rogers
  • Date: 2010-09-14 08:55:40 UTC
  • mfrom: (1.2.28 upstream)
  • Revision ID: james.westby@ubuntu.com-20100914085540-m4fpl0hdjlfd4jgz
Tags: 7.9~git20100909-0ubuntu1
[ Robert Hooker ]
* New upstream git snapshot up to commit 94118fe2d4b1e5 (LP: #631413)
* New features include ATI HD5xxx series support in r600, and a vastly
  improved glsl compiler.
* Remove pre-generated .pc's, use the ones generated at build time
  instead.
* Remove all references to mesa-utils now that its no longer shipped
  with the mesa source.
* Disable the experimental ARB_fragment_shader option by default on
  i915, it exposes incomplete functionality that breaks KDE compositing
  among other things. It can be enabled via driconf still. (LP: #628930).

[ Christopher James Halse Rogers ]
* debian/patches/04_osmesa_version.diff:
  - Refresh for new upstream
* Bugs fixed in this release:
  - Fixes severe rendering corruption in Unity on radeon (LP: #628727,
    LP: #596292, LP: #599741, LP: #630315, LP: #613694, LP: #599741).
  - Also fixes rendering in gnome-shell (LP: #578619).
  - Flickering in OpenGL apps on radeon (LP: #626943, LP: #610541).
  - Provides preliminary support for new intel chips (LP: #601052).
* debian/rules:
  - Update configure flags to match upstream reshuffling.
  - Explicitly remove gallium DRI drivers that we don't want to ship.
* Update debian/gbp.conf for this Maverick-specific packaging
* libegl1-mesa-dri-x11,kms: There are no longer separate kms or x11 drivers
  for EGL, libegl1-mesa-drivers now contains a single driver that provides
  both backends.

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
 
28
28
#include "util/u_math.h"
29
29
#include "util/u_memory.h"
 
30
#include "util/u_prim.h"
30
31
#include "draw/draw_context.h"
31
32
#include "draw/draw_vbuf.h"
32
33
#include "draw/draw_vertex.h"
40
41
   struct draw_context *draw;
41
42
 
42
43
   struct pt_emit *emit;
 
44
   struct pt_so_emit *so_emit;
43
45
   struct pt_fetch *fetch;
44
46
   struct pt_post_vs *post_vs;
45
47
 
46
48
   unsigned vertex_data_offset;
47
49
   unsigned vertex_size;
48
 
   unsigned prim;
 
50
   unsigned input_prim;
49
51
   unsigned opt;
50
52
};
51
53
 
52
 
 
53
54
static void fetch_pipeline_prepare( struct draw_pt_middle_end *middle,
54
55
                                    unsigned prim,
55
56
                                    unsigned opt,
61
62
   unsigned i;
62
63
   unsigned instance_id_index = ~0;
63
64
 
 
65
   unsigned gs_out_prim = (draw->gs.geometry_shader ? 
 
66
                           draw->gs.geometry_shader->output_primitive :
 
67
                           prim);
 
68
 
64
69
   /* Add one to num_outputs because the pipeline occasionally tags on
65
70
    * an additional texcoord, eg for AA lines.
66
71
    */
76
81
      }
77
82
   }
78
83
 
79
 
   fpme->prim = prim;
 
84
   fpme->input_prim = prim;
80
85
   fpme->opt = opt;
81
86
 
82
87
   /* Always leave room for the vertex header whether we need it or
95
100
    * but gl vs dx9 clip spaces.
96
101
    */
97
102
   draw_pt_post_vs_prepare( fpme->post_vs,
98
 
                            (boolean)draw->bypass_clipping,
99
 
                            (boolean)draw->identity_viewport,
 
103
                            draw->clip_xy,
 
104
                            draw->clip_z,
 
105
                            draw->clip_user,
 
106
                            draw->identity_viewport,
100
107
                            (boolean)draw->rasterizer->gl_rasterization_rules,
101
 
                            (draw->vs.edgeflag_output ? true : false) );    
 
108
                            (draw->vs.edgeflag_output ? TRUE : FALSE) );
 
109
 
 
110
   draw_pt_so_emit_prepare( fpme->so_emit );
102
111
 
103
112
   if (!(opt & PT_PIPELINE)) {
104
 
      draw_pt_emit_prepare( fpme->emit, 
105
 
                            prim,
 
113
      draw_pt_emit_prepare( fpme->emit,
 
114
                            gs_out_prim,
106
115
                            max_vertices );
107
116
 
108
 
      *max_vertices = MAX2( *max_vertices,
109
 
                            DRAW_PIPE_MAX_VERTICES );
 
117
      *max_vertices = MAX2( *max_vertices, 4096 );
110
118
   }
111
119
   else {
112
 
      *max_vertices = DRAW_PIPE_MAX_VERTICES; 
 
120
      /* limit max fetches by limiting max_vertices */
 
121
      *max_vertices = 4096;
113
122
   }
114
123
 
115
 
   /* return even number */
116
 
   *max_vertices = *max_vertices & ~1;
117
 
 
118
124
   /* No need to prepare the shader.
119
125
    */
120
126
   vs->prepare(vs, draw);
121
127
}
122
128
 
123
129
 
 
130
static void fetch( struct pt_fetch *fetch,
 
131
                   const struct draw_fetch_info *fetch_info,
 
132
                   char *output)
 
133
{
 
134
   if (fetch_info->linear) {
 
135
      draw_pt_fetch_run_linear( fetch,
 
136
                                fetch_info->start,
 
137
                                fetch_info->count,
 
138
                                output );
 
139
   }
 
140
   else {
 
141
      draw_pt_fetch_run( fetch,
 
142
                         fetch_info->elts,
 
143
                         fetch_info->count,
 
144
                         output );
 
145
   }
 
146
}
 
147
 
 
148
 
 
149
static void pipeline(struct fetch_pipeline_middle_end *fpme,
 
150
                     const struct draw_vertex_info *vert_info,
 
151
                     const struct draw_prim_info *prim_info)
 
152
{
 
153
   if (prim_info->linear)
 
154
      draw_pipeline_run_linear( fpme->draw,
 
155
                                vert_info,
 
156
                                prim_info);
 
157
   else
 
158
      draw_pipeline_run( fpme->draw,
 
159
                         vert_info,
 
160
                         prim_info );
 
161
}
 
162
 
 
163
static void emit(struct pt_emit *emit,
 
164
                 const struct draw_vertex_info *vert_info,
 
165
                 const struct draw_prim_info *prim_info)
 
166
{
 
167
   if (prim_info->linear) {
 
168
      draw_pt_emit_linear(emit, vert_info, prim_info);
 
169
   }
 
170
   else {
 
171
      draw_pt_emit(emit, vert_info, prim_info);
 
172
   }
 
173
}
 
174
 
 
175
 
 
176
static void draw_vertex_shader_run(struct draw_vertex_shader *vshader,
 
177
                                   const void *constants[PIPE_MAX_CONSTANT_BUFFERS], 
 
178
                                   unsigned const_size[PIPE_MAX_CONSTANT_BUFFERS],
 
179
                                   const struct draw_vertex_info *input_verts,
 
180
                                   struct draw_vertex_info *output_verts )
 
181
{
 
182
   output_verts->vertex_size = input_verts->vertex_size;
 
183
   output_verts->stride = input_verts->vertex_size;
 
184
   output_verts->count = input_verts->count;
 
185
   output_verts->verts =
 
186
      (struct vertex_header *)MALLOC(output_verts->vertex_size *
 
187
                                     align(output_verts->count, 4));
 
188
 
 
189
   vshader->run_linear(vshader,
 
190
                       (const float (*)[4])input_verts->verts->data,
 
191
                       (      float (*)[4])output_verts->verts->data,
 
192
                       constants,
 
193
                       const_size,
 
194
                       input_verts->count,
 
195
                       input_verts->vertex_size,
 
196
                       input_verts->vertex_size);
 
197
}
 
198
 
 
199
static void fetch_pipeline_generic( struct draw_pt_middle_end *middle,
 
200
                                    const struct draw_fetch_info *fetch_info,
 
201
                                    const struct draw_prim_info *prim_info )
 
202
{
 
203
   struct fetch_pipeline_middle_end *fpme = (struct fetch_pipeline_middle_end *)middle;
 
204
   struct draw_context *draw = fpme->draw;
 
205
   struct draw_vertex_shader *vshader = draw->vs.vertex_shader;
 
206
   struct draw_geometry_shader *gshader = draw->gs.geometry_shader;
 
207
   struct draw_prim_info gs_prim_info;
 
208
   struct draw_vertex_info fetched_vert_info;
 
209
   struct draw_vertex_info vs_vert_info;
 
210
   struct draw_vertex_info gs_vert_info;
 
211
   struct draw_vertex_info *vert_info;
 
212
   unsigned opt = fpme->opt;
 
213
 
 
214
   fetched_vert_info.count = fetch_info->count;
 
215
   fetched_vert_info.vertex_size = fpme->vertex_size;
 
216
   fetched_vert_info.stride = fpme->vertex_size;
 
217
   fetched_vert_info.verts =
 
218
      (struct vertex_header *)MALLOC(fpme->vertex_size *
 
219
                                     align(fetch_info->count,  4));
 
220
   if (!fetched_vert_info.verts) {
 
221
      assert(0);
 
222
      return;
 
223
   }
 
224
 
 
225
   /* Fetch into our vertex buffer.
 
226
    */
 
227
   fetch( fpme->fetch, fetch_info, (char *)fetched_vert_info.verts );
 
228
 
 
229
   /* Finished with fetch:
 
230
    */
 
231
   fetch_info = NULL;
 
232
   vert_info = &fetched_vert_info;
 
233
 
 
234
   /* Run the shader, note that this overwrites the data[] parts of
 
235
    * the pipeline verts.
 
236
    */
 
237
   if (fpme->opt & PT_SHADE) {
 
238
      draw_vertex_shader_run(vshader,
 
239
                             draw->pt.user.vs_constants,
 
240
                             draw->pt.user.vs_constants_size,
 
241
                             vert_info,
 
242
                             &vs_vert_info);
 
243
 
 
244
      FREE(vert_info->verts);
 
245
      vert_info = &vs_vert_info;
 
246
   }
 
247
 
 
248
   if ((fpme->opt & PT_SHADE) && gshader) {
 
249
      draw_geometry_shader_run(gshader,
 
250
                               draw->pt.user.gs_constants,
 
251
                               draw->pt.user.gs_constants_size,
 
252
                               vert_info,
 
253
                               prim_info,
 
254
                               &gs_vert_info,
 
255
                               &gs_prim_info);
 
256
 
 
257
      FREE(vert_info->verts);
 
258
      vert_info = &gs_vert_info;
 
259
      prim_info = &gs_prim_info;
 
260
   }
 
261
 
 
262
 
 
263
   /* Stream output needs to be done before clipping.
 
264
    *
 
265
    * XXX: Stream output surely needs to respect the prim_info->elt
 
266
    *      lists.
 
267
    */
 
268
   draw_pt_so_emit( fpme->so_emit,
 
269
                    vert_info,
 
270
                    prim_info );
 
271
 
 
272
   if (draw_pt_post_vs_run( fpme->post_vs,
 
273
                            vert_info ))
 
274
   {
 
275
      opt |= PT_PIPELINE;
 
276
   }
 
277
 
 
278
   /* Do we need to run the pipeline?
 
279
    */
 
280
   if (opt & PT_PIPELINE) {
 
281
      pipeline( fpme,
 
282
                vert_info,
 
283
                prim_info );
 
284
   }
 
285
   else {
 
286
      emit( fpme->emit,
 
287
            vert_info,
 
288
            prim_info );
 
289
   }
 
290
   FREE(vert_info->verts);
 
291
}
124
292
 
125
293
static void fetch_pipeline_run( struct draw_pt_middle_end *middle,
126
294
                                const unsigned *fetch_elts,
127
295
                                unsigned fetch_count,
128
296
                                const ushort *draw_elts,
129
 
                                unsigned draw_count )
 
297
                                unsigned draw_count,
 
298
                                unsigned prim_flags )
130
299
{
131
300
   struct fetch_pipeline_middle_end *fpme = (struct fetch_pipeline_middle_end *)middle;
132
 
   struct draw_context *draw = fpme->draw;
133
 
   struct draw_vertex_shader *vshader = draw->vs.vertex_shader;
134
 
   struct draw_geometry_shader *gshader = draw->gs.geometry_shader;
135
 
   unsigned opt = fpme->opt;
136
 
   unsigned alloc_count = align( fetch_count, 4 );
137
 
 
138
 
   struct vertex_header *pipeline_verts = 
139
 
      (struct vertex_header *)MALLOC(fpme->vertex_size * alloc_count);
140
 
 
141
 
   if (!pipeline_verts) {
142
 
      /* Not much we can do here - just skip the rendering.
143
 
       */
144
 
      assert(0);
145
 
      return;
146
 
   }
147
 
 
148
 
   /* Fetch into our vertex buffer
149
 
    */
150
 
   draw_pt_fetch_run( fpme->fetch,
151
 
                      fetch_elts, 
152
 
                      fetch_count,
153
 
                      (char *)pipeline_verts );
154
 
 
155
 
   /* Run the shader, note that this overwrites the data[] parts of
156
 
    * the pipeline verts.
157
 
    */
158
 
   if (opt & PT_SHADE)
159
 
   {
160
 
      vshader->run_linear(vshader,
161
 
                          (const float (*)[4])pipeline_verts->data,
162
 
                          (      float (*)[4])pipeline_verts->data,
163
 
                          draw->pt.user.vs_constants,
164
 
                          fetch_count,
165
 
                          fpme->vertex_size,
166
 
                          fpme->vertex_size);
167
 
      if (gshader)
168
 
         draw_geometry_shader_run(gshader,
169
 
                                  (const float (*)[4])pipeline_verts->data,
170
 
                                  (      float (*)[4])pipeline_verts->data,
171
 
                                  draw->pt.user.gs_constants,
172
 
                                  fetch_count,
173
 
                                  fpme->vertex_size,
174
 
                                  fpme->vertex_size);
175
 
   }
176
 
 
177
 
   if (draw_pt_post_vs_run( fpme->post_vs,
178
 
                            pipeline_verts,
179
 
                            fetch_count,
180
 
                            fpme->vertex_size ))
181
 
   {
182
 
      opt |= PT_PIPELINE;
183
 
   }
184
 
 
185
 
   /* Do we need to run the pipeline?
186
 
    */
187
 
   if (opt & PT_PIPELINE) {
188
 
      draw_pipeline_run( fpme->draw,
189
 
                         fpme->prim,
190
 
                         pipeline_verts,
191
 
                         fetch_count,
192
 
                         fpme->vertex_size,
193
 
                         draw_elts,
194
 
                         draw_count );
195
 
   }
196
 
   else {
197
 
      draw_pt_emit( fpme->emit,
198
 
                    (const float (*)[4])pipeline_verts->data,
199
 
                    fetch_count,
200
 
                    fpme->vertex_size,
201
 
                    draw_elts,
202
 
                    draw_count );
203
 
   }
204
 
 
205
 
 
206
 
   FREE(pipeline_verts);
 
301
   struct draw_fetch_info fetch_info;
 
302
   struct draw_prim_info prim_info;
 
303
 
 
304
   fetch_info.linear = FALSE;
 
305
   fetch_info.start = 0;
 
306
   fetch_info.elts = fetch_elts;
 
307
   fetch_info.count = fetch_count;
 
308
 
 
309
   prim_info.linear = FALSE;
 
310
   prim_info.start = 0;
 
311
   prim_info.count = draw_count;
 
312
   prim_info.elts = draw_elts;
 
313
   prim_info.prim = fpme->input_prim;
 
314
   prim_info.flags = prim_flags;
 
315
   prim_info.primitive_count = 1;
 
316
   prim_info.primitive_lengths = &draw_count;
 
317
 
 
318
   fetch_pipeline_generic( middle, &fetch_info, &prim_info );
207
319
}
208
320
 
209
321
 
210
322
static void fetch_pipeline_linear_run( struct draw_pt_middle_end *middle,
211
323
                                       unsigned start,
212
 
                                       unsigned count)
 
324
                                       unsigned count,
 
325
                                       unsigned prim_flags)
213
326
{
214
327
   struct fetch_pipeline_middle_end *fpme = (struct fetch_pipeline_middle_end *)middle;
215
 
   struct draw_context *draw = fpme->draw;
216
 
   struct draw_vertex_shader *shader = draw->vs.vertex_shader;
217
 
   struct draw_geometry_shader *geometry_shader = draw->gs.geometry_shader;
218
 
   unsigned opt = fpme->opt;
219
 
   unsigned alloc_count = align( count, 4 );
220
 
 
221
 
   struct vertex_header *pipeline_verts =
222
 
      (struct vertex_header *)MALLOC(fpme->vertex_size * alloc_count);
223
 
 
224
 
   if (!pipeline_verts) {
225
 
      /* Not much we can do here - just skip the rendering.
226
 
       */
227
 
      assert(0);
228
 
      return;
229
 
   }
230
 
 
231
 
   /* Fetch into our vertex buffer
232
 
    */
233
 
   draw_pt_fetch_run_linear( fpme->fetch,
234
 
                             start,
235
 
                             count,
236
 
                             (char *)pipeline_verts );
237
 
 
238
 
   /* Run the shader, note that this overwrites the data[] parts of
239
 
    * the pipeline verts.
240
 
    */
241
 
   if (opt & PT_SHADE)
242
 
   {
243
 
      shader->run_linear(shader,
244
 
                         (const float (*)[4])pipeline_verts->data,
245
 
                         (      float (*)[4])pipeline_verts->data,
246
 
                         draw->pt.user.vs_constants,
247
 
                         count,
248
 
                         fpme->vertex_size,
249
 
                         fpme->vertex_size);
250
 
 
251
 
      if (geometry_shader)
252
 
         draw_geometry_shader_run(geometry_shader,
253
 
                                  (const float (*)[4])pipeline_verts->data,
254
 
                                  (      float (*)[4])pipeline_verts->data,
255
 
                                  draw->pt.user.gs_constants,
256
 
                                  count,
257
 
                                  fpme->vertex_size,
258
 
                                  fpme->vertex_size);
259
 
   }
260
 
 
261
 
   if (draw_pt_post_vs_run( fpme->post_vs,
262
 
                            pipeline_verts,
263
 
                            count,
264
 
                            fpme->vertex_size ))
265
 
   {
266
 
      opt |= PT_PIPELINE;
267
 
   }
268
 
 
269
 
   /* Do we need to run the pipeline?
270
 
    */
271
 
   if (opt & PT_PIPELINE) {
272
 
      draw_pipeline_run_linear( fpme->draw,
273
 
                                fpme->prim,
274
 
                                pipeline_verts,
275
 
                                count,
276
 
                                fpme->vertex_size);
277
 
   }
278
 
   else {
279
 
      draw_pt_emit_linear( fpme->emit,
280
 
                           (const float (*)[4])pipeline_verts->data,
281
 
                           fpme->vertex_size,
282
 
                           count );
283
 
   }
284
 
 
285
 
   FREE(pipeline_verts);
 
328
   struct draw_fetch_info fetch_info;
 
329
   struct draw_prim_info prim_info;
 
330
 
 
331
   fetch_info.linear = TRUE;
 
332
   fetch_info.start = start;
 
333
   fetch_info.count = count;
 
334
   fetch_info.elts = NULL;
 
335
 
 
336
   prim_info.linear = TRUE;
 
337
   prim_info.start = 0;
 
338
   prim_info.count = count;
 
339
   prim_info.elts = NULL;
 
340
   prim_info.prim = fpme->input_prim;
 
341
   prim_info.flags = prim_flags;
 
342
   prim_info.primitive_count = 1;
 
343
   prim_info.primitive_lengths = &count;
 
344
 
 
345
   fetch_pipeline_generic( middle, &fetch_info, &prim_info );
286
346
}
287
347
 
288
348
 
289
349
 
290
350
static boolean fetch_pipeline_linear_run_elts( struct draw_pt_middle_end *middle,
291
 
                                            unsigned start,
292
 
                                            unsigned count,
293
 
                                            const ushort *draw_elts,
294
 
                                            unsigned draw_count )
 
351
                                               unsigned start,
 
352
                                               unsigned count,
 
353
                                               const ushort *draw_elts,
 
354
                                               unsigned draw_count,
 
355
                                               unsigned prim_flags )
295
356
{
296
357
   struct fetch_pipeline_middle_end *fpme = (struct fetch_pipeline_middle_end *)middle;
297
 
   struct draw_context *draw = fpme->draw;
298
 
   struct draw_vertex_shader *shader = draw->vs.vertex_shader;
299
 
   struct draw_geometry_shader *geometry_shader = draw->gs.geometry_shader;
300
 
   unsigned opt = fpme->opt;
301
 
   unsigned alloc_count = align( count, 4 );
302
 
 
303
 
   struct vertex_header *pipeline_verts =
304
 
      (struct vertex_header *)MALLOC(fpme->vertex_size * alloc_count);
305
 
 
306
 
   if (!pipeline_verts) 
307
 
      return FALSE;
308
 
 
309
 
   /* Fetch into our vertex buffer
310
 
    */
311
 
   draw_pt_fetch_run_linear( fpme->fetch,
312
 
                             start,
313
 
                             count,
314
 
                             (char *)pipeline_verts );
315
 
 
316
 
   /* Run the shader, note that this overwrites the data[] parts of
317
 
    * the pipeline verts.
318
 
    */
319
 
   if (opt & PT_SHADE)
320
 
   {
321
 
      shader->run_linear(shader,
322
 
                         (const float (*)[4])pipeline_verts->data,
323
 
                         (      float (*)[4])pipeline_verts->data,
324
 
                         draw->pt.user.vs_constants,
325
 
                         count,
326
 
                         fpme->vertex_size,
327
 
                         fpme->vertex_size);
328
 
 
329
 
      if (geometry_shader)
330
 
         draw_geometry_shader_run(geometry_shader,
331
 
                                  (const float (*)[4])pipeline_verts->data,
332
 
                                  (      float (*)[4])pipeline_verts->data,
333
 
                                  draw->pt.user.gs_constants,
334
 
                                  count,
335
 
                                  fpme->vertex_size,
336
 
                                  fpme->vertex_size);
337
 
   }
338
 
 
339
 
   if (draw_pt_post_vs_run( fpme->post_vs,
340
 
                            pipeline_verts,
341
 
                            count,
342
 
                            fpme->vertex_size ))
343
 
   {
344
 
      opt |= PT_PIPELINE;
345
 
   }
346
 
 
347
 
   /* Do we need to run the pipeline?
348
 
    */
349
 
   if (opt & PT_PIPELINE) {
350
 
      draw_pipeline_run( fpme->draw,
351
 
                         fpme->prim,
352
 
                         pipeline_verts,
353
 
                         count,
354
 
                         fpme->vertex_size,
355
 
                         draw_elts,
356
 
                         draw_count );
357
 
   }
358
 
   else {
359
 
      draw_pt_emit( fpme->emit,
360
 
                    (const float (*)[4])pipeline_verts->data,
361
 
                    count,
362
 
                    fpme->vertex_size,
363
 
                    draw_elts,
364
 
                    draw_count );
365
 
   }
366
 
 
367
 
   FREE(pipeline_verts);
 
358
   struct draw_fetch_info fetch_info;
 
359
   struct draw_prim_info prim_info;
 
360
 
 
361
   fetch_info.linear = TRUE;
 
362
   fetch_info.start = start;
 
363
   fetch_info.count = count;
 
364
   fetch_info.elts = NULL;
 
365
 
 
366
   prim_info.linear = FALSE;
 
367
   prim_info.start = 0;
 
368
   prim_info.count = draw_count;
 
369
   prim_info.elts = draw_elts;
 
370
   prim_info.prim = fpme->input_prim;
 
371
   prim_info.flags = prim_flags;
 
372
   prim_info.primitive_count = 1;
 
373
   prim_info.primitive_lengths = &draw_count;
 
374
 
 
375
   fetch_pipeline_generic( middle, &fetch_info, &prim_info );
 
376
 
368
377
   return TRUE;
369
378
}
370
379
 
385
394
   if (fpme->emit)
386
395
      draw_pt_emit_destroy( fpme->emit );
387
396
 
 
397
   if (fpme->so_emit)
 
398
      draw_pt_so_emit_destroy( fpme->so_emit );
 
399
 
388
400
   if (fpme->post_vs)
389
401
      draw_pt_post_vs_destroy( fpme->post_vs );
390
402
 
416
428
      goto fail;
417
429
 
418
430
   fpme->emit = draw_pt_emit_create( draw );
419
 
   if (!fpme->emit) 
 
431
   if (!fpme->emit)
 
432
      goto fail;
 
433
 
 
434
   fpme->so_emit = draw_pt_so_emit_create( draw );
 
435
   if (!fpme->so_emit)
420
436
      goto fail;
421
437
 
422
438
   return &fpme->base;