1 /**************************************************************************
3 * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
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:
14 * The above copyright notice and this permission notice (including the
15 * next paragraph) shall be included in all copies or substantial portions
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.
26 **************************************************************************/
30 * Keith Whitwell <keith@tungstengraphics.com>
34 #include "pipe/p_context.h"
35 #include "util/u_memory.h"
36 #include "util/u_math.h"
37 #include "util/u_cpu_detect.h"
38 #include "util/u_inlines.h"
39 #include "util/u_helpers.h"
40 #include "draw_context.h"
45 #include "gallivm/lp_bld_init.h"
46 #include "gallivm/lp_bld_limits.h"
47 #include "draw_llvm.h"
50 draw_get_option_use_llvm(void)
52 static boolean first
= TRUE
;
56 value
= debug_get_bool_option("DRAW_USE_LLVM", TRUE
);
60 /* require SSE2 due to LLVM PR6960. */
61 if (!util_cpu_caps
.has_sse2
)
71 * Create new draw module context with gallivm state for LLVM JIT.
73 static struct draw_context
*
74 draw_create_context(struct pipe_context
*pipe
, boolean try_llvm
)
76 struct draw_context
*draw
= CALLOC_STRUCT( draw_context
);
81 if (try_llvm
&& draw_get_option_use_llvm()) {
82 draw
->llvm
= draw_llvm_create(draw
);
103 * Create new draw module context, with LLVM JIT.
105 struct draw_context
*
106 draw_create(struct pipe_context
*pipe
)
108 return draw_create_context(pipe
, TRUE
);
113 * Create a new draw context, without LLVM JIT.
115 struct draw_context
*
116 draw_create_no_llvm(struct pipe_context
*pipe
)
118 return draw_create_context(pipe
, FALSE
);
122 boolean
draw_init(struct draw_context
*draw
)
125 * Note that several functions compute the clipmask of the predefined
126 * formats with hardcoded formulas instead of using these. So modifications
127 * here must be reflected there too.
130 ASSIGN_4V( draw
->plane
[0], -1, 0, 0, 1 );
131 ASSIGN_4V( draw
->plane
[1], 1, 0, 0, 1 );
132 ASSIGN_4V( draw
->plane
[2], 0, -1, 0, 1 );
133 ASSIGN_4V( draw
->plane
[3], 0, 1, 0, 1 );
134 ASSIGN_4V( draw
->plane
[4], 0, 0, 1, 1 ); /* yes these are correct */
135 ASSIGN_4V( draw
->plane
[5], 0, 0, -1, 1 ); /* mesa's a bit wonky */
136 draw
->clip_xy
= TRUE
;
139 draw
->pt
.user
.planes
= (float (*) [DRAW_TOTAL_CLIP_PLANES
][4]) &(draw
->plane
[0]);
141 if (!draw_pipeline_init( draw
))
144 if (!draw_pt_init( draw
))
147 if (!draw_vs_init( draw
))
150 if (!draw_gs_init( draw
))
153 draw
->quads_always_flatshade_last
= !draw
->pipe
->screen
->get_param(
154 draw
->pipe
->screen
, PIPE_CAP_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION
);
160 * Called whenever we're starting to draw a new instance.
161 * Some internal structures don't want to have to reset internal
162 * members on each invocation (because their state might have to persist
163 * between multiple primitive restart rendering call) but might have to
164 * for each new instance.
165 * This is particularly the case for primitive id's in geometry shader.
167 void draw_new_instance(struct draw_context
*draw
)
169 draw_geometry_shader_new_instance(draw
->gs
.geometry_shader
);
173 void draw_destroy( struct draw_context
*draw
)
175 struct pipe_context
*pipe
;
183 /* free any rasterizer CSOs that we may have created.
185 for (i
= 0; i
< 2; i
++) {
186 for (j
= 0; j
< 2; j
++) {
187 if (draw
->rasterizer_no_cull
[i
][j
]) {
188 pipe
->delete_rasterizer_state(pipe
, draw
->rasterizer_no_cull
[i
][j
]);
193 for (i
= 0; i
< draw
->pt
.nr_vertex_buffers
; i
++) {
194 pipe_resource_reference(&draw
->pt
.vertex_buffer
[i
].buffer
, NULL
);
197 /* Not so fast -- we're just borrowing this at the moment.
200 draw->render->destroy( draw->render );
203 draw_pipeline_destroy( draw
);
204 draw_pt_destroy( draw
);
205 draw_vs_destroy( draw
);
206 draw_gs_destroy( draw
);
209 draw_llvm_destroy( draw
->llvm
);
217 void draw_flush( struct draw_context
*draw
)
219 draw_do_flush( draw
, DRAW_FLUSH_BACKEND
);
224 * Specify the Minimum Resolvable Depth factor for polygon offset.
225 * This factor potentially depends on the number of Z buffer bits,
226 * the rasterization algorithm and the arithmetic performed on Z
227 * values between vertex shading and rasterization. It will vary
228 * from one driver to another.
230 void draw_set_mrd(struct draw_context
*draw
, double mrd
)
236 static void update_clip_flags( struct draw_context
*draw
)
238 draw
->clip_xy
= !draw
->driver
.bypass_clip_xy
;
239 draw
->guard_band_xy
= (!draw
->driver
.bypass_clip_xy
&&
240 draw
->driver
.guard_band_xy
);
241 draw
->clip_z
= (!draw
->driver
.bypass_clip_z
&&
242 draw
->rasterizer
&& draw
->rasterizer
->depth_clip
);
243 draw
->clip_user
= draw
->rasterizer
&&
244 draw
->rasterizer
->clip_plane_enable
!= 0;
248 * Register new primitive rasterization/rendering state.
249 * This causes the drawing pipeline to be rebuilt.
251 void draw_set_rasterizer_state( struct draw_context
*draw
,
252 const struct pipe_rasterizer_state
*raster
,
255 if (!draw
->suspend_flushing
) {
256 draw_do_flush( draw
, DRAW_FLUSH_STATE_CHANGE
);
258 draw
->rasterizer
= raster
;
259 draw
->rast_handle
= rast_handle
;
260 update_clip_flags(draw
);
264 /* With a little more work, llvmpipe will be able to turn this off and
265 * do its own x/y clipping.
267 * Some hardware can turn off clipping altogether - in particular any
268 * hardware with a TNL unit can do its own clipping, even if it is
269 * relying on the draw module for some other reason.
271 void draw_set_driver_clipping( struct draw_context
*draw
,
272 boolean bypass_clip_xy
,
273 boolean bypass_clip_z
,
274 boolean guard_band_xy
)
276 draw_do_flush( draw
, DRAW_FLUSH_STATE_CHANGE
);
278 draw
->driver
.bypass_clip_xy
= bypass_clip_xy
;
279 draw
->driver
.bypass_clip_z
= bypass_clip_z
;
280 draw
->driver
.guard_band_xy
= guard_band_xy
;
281 update_clip_flags(draw
);
286 * Plug in the primitive rendering/rasterization stage (which is the last
287 * stage in the drawing pipeline).
288 * This is provided by the device driver.
290 void draw_set_rasterize_stage( struct draw_context
*draw
,
291 struct draw_stage
*stage
)
293 draw_do_flush( draw
, DRAW_FLUSH_STATE_CHANGE
);
295 draw
->pipeline
.rasterize
= stage
;
300 * Set the draw module's clipping state.
302 void draw_set_clip_state( struct draw_context
*draw
,
303 const struct pipe_clip_state
*clip
)
305 draw_do_flush(draw
, DRAW_FLUSH_PARAMETER_CHANGE
);
307 memcpy(&draw
->plane
[6], clip
->ucp
, sizeof(clip
->ucp
));
312 * Set the draw module's viewport state.
314 void draw_set_viewport_state( struct draw_context
*draw
,
315 const struct pipe_viewport_state
*viewport
)
317 draw_do_flush(draw
, DRAW_FLUSH_PARAMETER_CHANGE
);
318 draw
->viewport
= *viewport
; /* struct copy */
319 draw
->identity_viewport
= (viewport
->scale
[0] == 1.0f
&&
320 viewport
->scale
[1] == 1.0f
&&
321 viewport
->scale
[2] == 1.0f
&&
322 viewport
->scale
[3] == 1.0f
&&
323 viewport
->translate
[0] == 0.0f
&&
324 viewport
->translate
[1] == 0.0f
&&
325 viewport
->translate
[2] == 0.0f
&&
326 viewport
->translate
[3] == 0.0f
);
328 draw_vs_set_viewport( draw
, viewport
);
334 draw_set_vertex_buffers(struct draw_context
*draw
,
335 unsigned start_slot
, unsigned count
,
336 const struct pipe_vertex_buffer
*buffers
)
338 assert(start_slot
+ count
<= PIPE_MAX_ATTRIBS
);
340 util_set_vertex_buffers_count(draw
->pt
.vertex_buffer
,
341 &draw
->pt
.nr_vertex_buffers
,
342 buffers
, start_slot
, count
);
347 draw_set_vertex_elements(struct draw_context
*draw
,
349 const struct pipe_vertex_element
*elements
)
351 assert(count
<= PIPE_MAX_ATTRIBS
);
353 /* We could improve this by only flushing the frontend and the fetch part
354 * of the middle. This would avoid recalculating the emit keys.*/
355 draw_do_flush( draw
, DRAW_FLUSH_STATE_CHANGE
);
357 memcpy(draw
->pt
.vertex_element
, elements
, count
* sizeof(elements
[0]));
358 draw
->pt
.nr_vertex_elements
= count
;
363 * Tell drawing context where to find mapped vertex buffers.
366 draw_set_mapped_vertex_buffer(struct draw_context
*draw
,
367 unsigned attr
, const void *buffer
)
369 draw
->pt
.user
.vbuffer
[attr
] = buffer
;
374 draw_set_mapped_constant_buffer(struct draw_context
*draw
,
375 unsigned shader_type
,
380 debug_assert(shader_type
== PIPE_SHADER_VERTEX
||
381 shader_type
== PIPE_SHADER_GEOMETRY
);
382 debug_assert(slot
< PIPE_MAX_CONSTANT_BUFFERS
);
384 draw_do_flush(draw
, DRAW_FLUSH_PARAMETER_CHANGE
);
386 switch (shader_type
) {
387 case PIPE_SHADER_VERTEX
:
388 draw
->pt
.user
.vs_constants
[slot
] = buffer
;
389 draw
->pt
.user
.vs_constants_size
[slot
] = size
;
391 case PIPE_SHADER_GEOMETRY
:
392 draw
->pt
.user
.gs_constants
[slot
] = buffer
;
393 draw
->pt
.user
.gs_constants_size
[slot
] = size
;
396 assert(0 && "invalid shader type in draw_set_mapped_constant_buffer");
402 * Tells the draw module to draw points with triangles if their size
403 * is greater than this threshold.
406 draw_wide_point_threshold(struct draw_context
*draw
, float threshold
)
408 draw_do_flush( draw
, DRAW_FLUSH_STATE_CHANGE
);
409 draw
->pipeline
.wide_point_threshold
= threshold
;
414 * Should the draw module handle point->quad conversion for drawing sprites?
417 draw_wide_point_sprites(struct draw_context
*draw
, boolean draw_sprite
)
419 draw_do_flush( draw
, DRAW_FLUSH_STATE_CHANGE
);
420 draw
->pipeline
.wide_point_sprites
= draw_sprite
;
425 * Tells the draw module to draw lines with triangles if their width
426 * is greater than this threshold.
429 draw_wide_line_threshold(struct draw_context
*draw
, float threshold
)
431 draw_do_flush( draw
, DRAW_FLUSH_STATE_CHANGE
);
432 draw
->pipeline
.wide_line_threshold
= roundf(threshold
);
437 * Tells the draw module whether or not to implement line stipple.
440 draw_enable_line_stipple(struct draw_context
*draw
, boolean enable
)
442 draw_do_flush( draw
, DRAW_FLUSH_STATE_CHANGE
);
443 draw
->pipeline
.line_stipple
= enable
;
448 * Tells draw module whether to convert points to quads for sprite mode.
451 draw_enable_point_sprites(struct draw_context
*draw
, boolean enable
)
453 draw_do_flush( draw
, DRAW_FLUSH_STATE_CHANGE
);
454 draw
->pipeline
.point_sprite
= enable
;
459 draw_set_force_passthrough( struct draw_context
*draw
, boolean enable
)
461 draw_do_flush( draw
, DRAW_FLUSH_STATE_CHANGE
);
462 draw
->force_passthrough
= enable
;
468 * Allocate an extra vertex/geometry shader vertex attribute, if it doesn't
471 * This is used by some of the optional draw module stages such
472 * as wide_point which may need to allocate additional generic/texcoord
476 draw_alloc_extra_vertex_attrib(struct draw_context
*draw
,
477 uint semantic_name
, uint semantic_index
)
483 slot
= draw_find_shader_output(draw
, semantic_name
, semantic_index
);
488 num_outputs
= draw_current_shader_outputs(draw
);
489 n
= draw
->extra_shader_outputs
.num
;
491 assert(n
< Elements(draw
->extra_shader_outputs
.semantic_name
));
493 draw
->extra_shader_outputs
.semantic_name
[n
] = semantic_name
;
494 draw
->extra_shader_outputs
.semantic_index
[n
] = semantic_index
;
495 draw
->extra_shader_outputs
.slot
[n
] = num_outputs
+ n
;
496 draw
->extra_shader_outputs
.num
++;
498 return draw
->extra_shader_outputs
.slot
[n
];
503 * Remove all extra vertex attributes that were allocated with
504 * draw_alloc_extra_vertex_attrib().
507 draw_remove_extra_vertex_attribs(struct draw_context
*draw
)
509 draw
->extra_shader_outputs
.num
= 0;
514 * If a geometry shader is present, return its info, else the vertex shader's
517 struct tgsi_shader_info
*
518 draw_get_shader_info(const struct draw_context
*draw
)
521 if (draw
->gs
.geometry_shader
) {
522 return &draw
->gs
.geometry_shader
->info
;
524 return &draw
->vs
.vertex_shader
->info
;
530 * Ask the draw module for the location/slot of the given vertex attribute in
531 * a post-transformed vertex.
533 * With this function, drivers that use the draw module should have no reason
534 * to track the current vertex/geometry shader.
536 * Note that the draw module may sometimes generate vertices with extra
537 * attributes (such as texcoords for AA lines). The driver can call this
538 * function to find those attributes.
540 * Zero is returned if the attribute is not found since this is
541 * a don't care / undefined situtation. Returning -1 would be a bit more
542 * work for the drivers.
545 draw_find_shader_output(const struct draw_context
*draw
,
546 uint semantic_name
, uint semantic_index
)
548 const struct tgsi_shader_info
*info
= draw_get_shader_info(draw
);
551 for (i
= 0; i
< info
->num_outputs
; i
++) {
552 if (info
->output_semantic_name
[i
] == semantic_name
&&
553 info
->output_semantic_index
[i
] == semantic_index
)
557 /* Search the extra vertex attributes */
558 for (i
= 0; i
< draw
->extra_shader_outputs
.num
; i
++) {
559 if (draw
->extra_shader_outputs
.semantic_name
[i
] == semantic_name
&&
560 draw
->extra_shader_outputs
.semantic_index
[i
] == semantic_index
) {
561 return draw
->extra_shader_outputs
.slot
[i
];
570 * Return total number of the shader outputs. This function is similar to
571 * draw_current_shader_outputs() but this function also counts any extra
572 * vertex/geometry output attributes that may be filled in by some draw
573 * stages (such as AA point, AA line).
575 * If geometry shader is present, its output will be returned,
576 * if not vertex shader is used.
579 draw_num_shader_outputs(const struct draw_context
*draw
)
581 const struct tgsi_shader_info
*info
= draw_get_shader_info(draw
);
584 count
= info
->num_outputs
;
585 count
+= draw
->extra_shader_outputs
.num
;
592 * Provide TGSI sampler objects for vertex/geometry shaders that use
593 * texture fetches. This state only needs to be set once per context.
594 * This might only be used by software drivers for the time being.
597 draw_texture_sampler(struct draw_context
*draw
,
599 struct tgsi_sampler
*sampler
)
601 if (shader
== PIPE_SHADER_VERTEX
) {
602 draw
->vs
.tgsi
.sampler
= sampler
;
604 debug_assert(shader
== PIPE_SHADER_GEOMETRY
);
605 draw
->gs
.tgsi
.sampler
= sampler
;
612 void draw_set_render( struct draw_context
*draw
,
613 struct vbuf_render
*render
)
615 draw
->render
= render
;
620 * Tell the draw module where vertex indexes/elements are located, and
621 * their size (in bytes).
623 * Note: the caller must apply the pipe_index_buffer::offset value to
624 * the address. The draw module doesn't do that.
627 draw_set_indexes(struct draw_context
*draw
,
628 const void *elements
, unsigned elem_size
)
630 assert(elem_size
== 0 ||
634 draw
->pt
.user
.elts
= elements
;
635 draw
->pt
.user
.eltSizeIB
= elem_size
;
641 void draw_do_flush( struct draw_context
*draw
, unsigned flags
)
643 if (!draw
->suspend_flushing
)
645 assert(!draw
->flushing
); /* catch inadvertant recursion */
647 draw
->flushing
= TRUE
;
649 draw_pipeline_flush( draw
, flags
);
651 draw_pt_flush( draw
, flags
);
653 draw
->flushing
= FALSE
;
659 * Return the number of output attributes produced by the geometry
660 * shader, if present. If no geometry shader, return the number of
661 * outputs from the vertex shader.
662 * \sa draw_num_shader_outputs
665 draw_current_shader_outputs(const struct draw_context
*draw
)
667 if (draw
->gs
.geometry_shader
)
668 return draw
->gs
.num_gs_outputs
;
669 return draw
->vs
.num_vs_outputs
;
674 * Return the index of the shader output which will contain the
678 draw_current_shader_position_output(const struct draw_context
*draw
)
680 if (draw
->gs
.geometry_shader
)
681 return draw
->gs
.position_output
;
682 return draw
->vs
.position_output
;
687 * Return the index of the shader output which will contain the
691 draw_current_shader_clipvertex_output(const struct draw_context
*draw
)
693 return draw
->vs
.clipvertex_output
;
697 draw_current_shader_clipdistance_output(const struct draw_context
*draw
, int index
)
699 return draw
->vs
.clipdistance_output
[index
];
703 * Return a pointer/handle for a driver/CSO rasterizer object which
704 * disabled culling, stippling, unfilled tris, etc.
705 * This is used by some pipeline stages (such as wide_point, aa_line
706 * and aa_point) which convert points/lines into triangles. In those
707 * cases we don't want to accidentally cull the triangles.
709 * \param scissor should the rasterizer state enable scissoring?
710 * \param flatshade should the rasterizer state use flat shading?
711 * \return rasterizer CSO handle
714 draw_get_rasterizer_no_cull( struct draw_context
*draw
,
718 if (!draw
->rasterizer_no_cull
[scissor
][flatshade
]) {
720 struct pipe_context
*pipe
= draw
->pipe
;
721 struct pipe_rasterizer_state rast
;
723 memset(&rast
, 0, sizeof(rast
));
724 rast
.scissor
= scissor
;
725 rast
.flatshade
= flatshade
;
727 rast
.half_pixel_center
= draw
->rasterizer
->half_pixel_center
;
728 rast
.bottom_edge_rule
= draw
->rasterizer
->bottom_edge_rule
;
729 rast
.clip_halfz
= draw
->rasterizer
->clip_halfz
;
731 draw
->rasterizer_no_cull
[scissor
][flatshade
] =
732 pipe
->create_rasterizer_state(pipe
, &rast
);
734 return draw
->rasterizer_no_cull
[scissor
][flatshade
];
738 draw_set_mapped_so_targets(struct draw_context
*draw
,
740 struct draw_so_target
*targets
[PIPE_MAX_SO_BUFFERS
])
744 for (i
= 0; i
< num_targets
; i
++)
745 draw
->so
.targets
[i
] = targets
[i
];
746 for (i
= num_targets
; i
< PIPE_MAX_SO_BUFFERS
; i
++)
747 draw
->so
.targets
[i
] = NULL
;
749 draw
->so
.num_targets
= num_targets
;
753 draw_set_sampler_views(struct draw_context
*draw
,
754 unsigned shader_stage
,
755 struct pipe_sampler_view
**views
,
760 debug_assert(shader_stage
< PIPE_SHADER_TYPES
);
761 debug_assert(num
<= PIPE_MAX_SHADER_SAMPLER_VIEWS
);
763 draw_do_flush( draw
, DRAW_FLUSH_STATE_CHANGE
);
765 for (i
= 0; i
< num
; ++i
)
766 draw
->sampler_views
[shader_stage
][i
] = views
[i
];
767 for (i
= num
; i
< PIPE_MAX_SHADER_SAMPLER_VIEWS
; ++i
)
768 draw
->sampler_views
[shader_stage
][i
] = NULL
;
770 draw
->num_sampler_views
[shader_stage
] = num
;
774 draw_set_samplers(struct draw_context
*draw
,
775 unsigned shader_stage
,
776 struct pipe_sampler_state
**samplers
,
781 debug_assert(shader_stage
< PIPE_SHADER_TYPES
);
782 debug_assert(num
<= PIPE_MAX_SAMPLERS
);
784 draw_do_flush( draw
, DRAW_FLUSH_STATE_CHANGE
);
786 for (i
= 0; i
< num
; ++i
)
787 draw
->samplers
[shader_stage
][i
] = samplers
[i
];
788 for (i
= num
; i
< PIPE_MAX_SAMPLERS
; ++i
)
789 draw
->samplers
[shader_stage
][i
] = NULL
;
791 draw
->num_samplers
[shader_stage
] = num
;
795 draw_llvm_set_sampler_state(draw
, shader_stage
);
800 draw_set_mapped_texture(struct draw_context
*draw
,
801 unsigned shader_stage
,
803 uint32_t width
, uint32_t height
, uint32_t depth
,
804 uint32_t first_level
, uint32_t last_level
,
805 const void *base_ptr
,
806 uint32_t row_stride
[PIPE_MAX_TEXTURE_LEVELS
],
807 uint32_t img_stride
[PIPE_MAX_TEXTURE_LEVELS
],
808 uint32_t mip_offsets
[PIPE_MAX_TEXTURE_LEVELS
])
812 draw_llvm_set_mapped_texture(draw
,
815 width
, height
, depth
, first_level
,
816 last_level
, base_ptr
,
817 row_stride
, img_stride
, mip_offsets
);
822 * XXX: Results for PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS because there are two
823 * different ways of setting textures, and drivers typically only support one.
826 draw_get_shader_param_no_llvm(unsigned shader
, enum pipe_shader_cap param
)
829 case PIPE_SHADER_VERTEX
:
830 case PIPE_SHADER_GEOMETRY
:
831 return tgsi_exec_get_shader_param(param
);
838 * XXX: Results for PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS because there are two
839 * different ways of setting textures, and drivers typically only support one.
842 draw_get_shader_param(unsigned shader
, enum pipe_shader_cap param
)
846 if (draw_get_option_use_llvm()) {
848 case PIPE_SHADER_VERTEX
:
849 case PIPE_SHADER_GEOMETRY
:
850 return gallivm_get_shader_param(param
);
857 return draw_get_shader_param_no_llvm(shader
, param
);
861 * Enables or disables collection of statistics.
863 * Draw module is capable of generating statistics for the vertex
864 * processing pipeline. Collection of that data isn't free and so
865 * it's disabled by default. The users of the module can enable
866 * (or disable) this functionality through this function.
867 * The actual data will be emitted through the VBUF interface,
868 * the 'pipeline_statistics' callback to be exact.
871 draw_collect_pipeline_statistics(struct draw_context
*draw
,
874 draw
->collect_statistics
= enable
;