Go to the source code of this file.
Functions | |
struct draw_context * | draw_create (void) |
void | draw_destroy (struct draw_context *draw) |
void | draw_set_viewport_state (struct draw_context *draw, const struct pipe_viewport_state *viewport) |
Set the draw module's viewport state. | |
void | draw_set_clip_state (struct draw_context *pipe, const struct pipe_clip_state *clip) |
Set the draw module's clipping state. | |
void | draw_set_rasterizer_state (struct draw_context *draw, const struct pipe_rasterizer_state *raster) |
Register new primitive rasterization/rendering state. | |
void | draw_set_rasterize_stage (struct draw_context *draw, struct draw_stage *stage) |
Plug in the primitive rendering/rasterization stage (which is the last stage in the drawing pipeline). | |
void | draw_wide_point_threshold (struct draw_context *draw, float threshold) |
Tells the draw module to draw points with triangles if their size is greater than this threshold. | |
void | draw_wide_line_threshold (struct draw_context *draw, float threshold) |
Tells the draw module to draw lines with triangles if their width is greater than this threshold. | |
void | draw_enable_line_stipple (struct draw_context *draw, boolean enable) |
Tells the draw module whether or not to implement line stipple. | |
void | draw_enable_point_sprites (struct draw_context *draw, boolean enable) |
Tells draw module whether to convert points to quads for sprite mode. | |
void | draw_set_mrd (struct draw_context *draw, double mrd) |
Specify the Minimum Resolvable Depth factor for polygon offset. | |
boolean | draw_install_aaline_stage (struct draw_context *draw, struct pipe_context *pipe) |
Called by drivers that want to install this AA line prim stage into the draw module's pipeline. | |
boolean | draw_install_aapoint_stage (struct draw_context *draw, struct pipe_context *pipe) |
Called by drivers that want to install this AA point prim stage into the draw module's pipeline. | |
boolean | draw_install_pstipple_stage (struct draw_context *draw, struct pipe_context *pipe) |
Called by drivers that want to install this polygon stipple stage into the draw module's pipeline. | |
int | draw_find_vs_output (const struct draw_context *draw, uint semantic_name, uint semantic_index) |
Ask the draw module for the location/slot of the given vertex attribute in a post-transformed vertex. | |
uint | draw_num_vs_outputs (const struct draw_context *draw) |
Return number of vertex shader outputs. | |
struct draw_vertex_shader * | draw_create_vertex_shader (struct draw_context *draw, const struct pipe_shader_state *shader) |
void | draw_bind_vertex_shader (struct draw_context *draw, struct draw_vertex_shader *dvs) |
void | draw_delete_vertex_shader (struct draw_context *draw, struct draw_vertex_shader *dvs) |
void | draw_set_vertex_buffers (struct draw_context *draw, unsigned count, const struct pipe_vertex_buffer *buffers) |
void | draw_set_vertex_elements (struct draw_context *draw, unsigned count, const struct pipe_vertex_element *elements) |
void | draw_set_mapped_element_buffer_range (struct draw_context *draw, unsigned eltSize, unsigned min_index, unsigned max_index, const void *elements) |
Tell the drawing context about the index/element buffer to use (ala glDrawElements) If no element buffer is to be used (i.e. | |
void | draw_set_mapped_element_buffer (struct draw_context *draw, unsigned eltSize, const void *elements) |
void | draw_set_mapped_vertex_buffer (struct draw_context *draw, unsigned attr, const void *buffer) |
Tell drawing context where to find mapped vertex buffers. | |
void | draw_set_mapped_constant_buffer (struct draw_context *draw, const void *buffer, unsigned size) |
void | draw_set_edgeflags (struct draw_context *draw, const unsigned *edgeflag) |
void | draw_arrays (struct draw_context *draw, unsigned prim, unsigned start, unsigned count) |
Draw vertex arrays This is the main entrypoint into the drawing module. | |
void | draw_flush (struct draw_context *draw) |
void | draw_set_render (struct draw_context *draw, struct vbuf_render *render) |
void | draw_set_driver_clipping (struct draw_context *draw, boolean bypass_clipping) |
void | draw_set_force_passthrough (struct draw_context *draw, boolean enable) |
boolean | draw_need_pipeline (const struct draw_context *draw, const struct pipe_rasterizer_state *rasterizer, unsigned prim) |
void draw_arrays | ( | struct draw_context * | draw, | |
unsigned | prim, | |||
unsigned | start, | |||
unsigned | count | |||
) |
Draw vertex arrays This is the main entrypoint into the drawing module.
prim | one of PIPE_PRIM_x | |
start | index of first vertex to draw | |
count | number of vertices to draw |
Definition at line 278 of file draw_pt.c.
References pipe_vertex_buffer::buffer_offset, debug_printf(), draw_do_flush(), DRAW_FLUSH_STATE_CHANGE, draw_print_arrays(), draw_pt_arrays(), draw_pt_reduced_prim(), MIN2, pipe_vertex_element::nr_components, draw_context::nr_vertex_buffers, draw_context::nr_vertex_elements, pf_name(), pipe_vertex_buffer::pitch, draw_context::pt, draw_context::reduced_prim, reduced_prim, pipe_vertex_element::src_format, draw_vertex_shader::state, tgsi_dump(), pipe_shader_state::tokens, draw_context::user, draw_context::vertex_buffer, draw_context::vertex_element, draw_context::vertex_shader, and draw_context::vs.
00280 { 00281 unsigned reduced_prim = draw_pt_reduced_prim(prim); 00282 if (reduced_prim != draw->reduced_prim) { 00283 draw_do_flush( draw, DRAW_FLUSH_STATE_CHANGE ); 00284 draw->reduced_prim = reduced_prim; 00285 } 00286 00287 if (0) 00288 draw_print_arrays(draw, prim, start, MIN2(count, 20)); 00289 00290 #if 0 00291 { 00292 int i; 00293 debug_printf("draw_arrays(prim=%u start=%u count=%u):\n", 00294 prim, start, count); 00295 tgsi_dump(draw->vs.vertex_shader->state.tokens, 0); 00296 debug_printf("Elements:\n"); 00297 for (i = 0; i < draw->pt.nr_vertex_elements; i++) { 00298 debug_printf(" format=%s comps=%u\n", 00299 pf_name(draw->pt.vertex_element[i].src_format), 00300 draw->pt.vertex_element[i].nr_components); 00301 } 00302 debug_printf("Buffers:\n"); 00303 for (i = 0; i < draw->pt.nr_vertex_buffers; i++) { 00304 debug_printf(" pitch=%u offset=%u ptr=%p\n", 00305 draw->pt.vertex_buffer[i].pitch, 00306 draw->pt.vertex_buffer[i].buffer_offset, 00307 draw->pt.user.vbuffer[i]); 00308 } 00309 } 00310 #endif 00311 00312 /* drawing done here: */ 00313 draw_pt_arrays(draw, prim, start, count); 00314 }
void draw_bind_vertex_shader | ( | struct draw_context * | draw, | |
struct draw_vertex_shader * | dvs | |||
) |
Definition at line 108 of file draw_vs.c.
References draw_do_flush(), DRAW_FLUSH_STATE_CHANGE, draw_vertex_shader::info, tgsi_shader_info::num_outputs, draw_context::num_vs_outputs, draw_vertex_shader::position_output, draw_context::position_output, draw_vertex_shader::prepare, draw_context::vertex_shader, and draw_context::vs.
00110 { 00111 draw_do_flush( draw, DRAW_FLUSH_STATE_CHANGE ); 00112 00113 if (dvs) 00114 { 00115 draw->vs.vertex_shader = dvs; 00116 draw->vs.num_vs_outputs = dvs->info.num_outputs; 00117 draw->vs.position_output = dvs->position_output; 00118 dvs->prepare( dvs, draw ); 00119 } 00120 else { 00121 draw->vs.vertex_shader = NULL; 00122 draw->vs.num_vs_outputs = 0; 00123 } 00124 }
struct draw_context* draw_create | ( | void | ) | [read] |
Definition at line 43 of file draw_context.c.
References ASSIGN_4V, CALLOC_STRUCT, draw, draw_destroy(), draw_pipeline_init(), draw_pt_init(), draw_vs_init(), draw_context::nr_planes, draw_context::plane, and draw_context::reduced_prim.
00044 { 00045 struct draw_context *draw = CALLOC_STRUCT( draw_context ); 00046 if (draw == NULL) 00047 goto fail; 00048 00049 ASSIGN_4V( draw->plane[0], -1, 0, 0, 1 ); 00050 ASSIGN_4V( draw->plane[1], 1, 0, 0, 1 ); 00051 ASSIGN_4V( draw->plane[2], 0, -1, 0, 1 ); 00052 ASSIGN_4V( draw->plane[3], 0, 1, 0, 1 ); 00053 ASSIGN_4V( draw->plane[4], 0, 0, 1, 1 ); /* yes these are correct */ 00054 ASSIGN_4V( draw->plane[5], 0, 0, -1, 1 ); /* mesa's a bit wonky */ 00055 draw->nr_planes = 6; 00056 00057 00058 draw->reduced_prim = ~0; /* != any of PIPE_PRIM_x */ 00059 00060 00061 if (!draw_pipeline_init( draw )) 00062 goto fail; 00063 00064 if (!draw_pt_init( draw )) 00065 goto fail; 00066 00067 if (!draw_vs_init( draw )) 00068 goto fail; 00069 00070 return draw; 00071 00072 fail: 00073 draw_destroy( draw ); 00074 return NULL; 00075 }
struct draw_vertex_shader* draw_create_vertex_shader | ( | struct draw_context * | draw, | |
const struct pipe_shader_state * | shader | |||
) | [read] |
Definition at line 79 of file draw_vs.c.
References assert, draw_create_vs_exec(), draw_create_vs_llvm(), draw_create_vs_sse(), draw_vertex_shader::info, tgsi_shader_info::num_outputs, tgsi_shader_info::output_semantic_index, tgsi_shader_info::output_semantic_name, draw_vertex_shader::position_output, and TGSI_SEMANTIC_POSITION.
00081 { 00082 struct draw_vertex_shader *vs; 00083 00084 vs = draw_create_vs_llvm( draw, shader ); 00085 if (!vs) { 00086 vs = draw_create_vs_sse( draw, shader ); 00087 if (!vs) { 00088 vs = draw_create_vs_exec( draw, shader ); 00089 } 00090 } 00091 00092 if (vs) 00093 { 00094 uint i; 00095 for (i = 0; i < vs->info.num_outputs; i++) { 00096 if (vs->info.output_semantic_name[i] == TGSI_SEMANTIC_POSITION && 00097 vs->info.output_semantic_index[i] == 0) 00098 vs->position_output = i; 00099 } 00100 } 00101 00102 assert(vs); 00103 return vs; 00104 }
void draw_delete_vertex_shader | ( | struct draw_context * | draw, | |
struct draw_vertex_shader * | dvs | |||
) |
Definition at line 128 of file draw_vs.c.
References draw_vertex_shader::delete, draw_vs_varient::destroy, draw_vertex_shader::nr_varients, and draw_vertex_shader::varient.
00130 { 00131 unsigned i; 00132 00133 for (i = 0; i < dvs->nr_varients; i++) 00134 dvs->varient[i]->destroy( dvs->varient[i] ); 00135 00136 dvs->nr_varients = 0; 00137 00138 dvs->delete( dvs ); 00139 }
void draw_destroy | ( | struct draw_context * | draw | ) |
Definition at line 78 of file draw_context.c.
References draw_pipeline_destroy(), draw_pt_destroy(), draw_vs_destroy(), and FREE.
00079 { 00080 if (!draw) 00081 return; 00082 00083 00084 00085 /* Not so fast -- we're just borrowing this at the moment. 00086 * 00087 if (draw->render) 00088 draw->render->destroy( draw->render ); 00089 */ 00090 00091 draw_pipeline_destroy( draw ); 00092 draw_pt_destroy( draw ); 00093 draw_vs_destroy( draw ); 00094 00095 FREE( draw ); 00096 }
void draw_enable_line_stipple | ( | struct draw_context * | draw, | |
boolean | enable | |||
) |
Tells the draw module whether or not to implement line stipple.
Definition at line 269 of file draw_context.c.
References draw_do_flush(), DRAW_FLUSH_STATE_CHANGE, draw_context::line_stipple, and draw_context::pipeline.
00270 { 00271 draw_do_flush( draw, DRAW_FLUSH_STATE_CHANGE ); 00272 draw->pipeline.line_stipple = enable; 00273 }
void draw_enable_point_sprites | ( | struct draw_context * | draw, | |
boolean | enable | |||
) |
Tells draw module whether to convert points to quads for sprite mode.
Definition at line 280 of file draw_context.c.
References draw_do_flush(), DRAW_FLUSH_STATE_CHANGE, draw_context::pipeline, and draw_context::point_sprite.
00281 { 00282 draw_do_flush( draw, DRAW_FLUSH_STATE_CHANGE ); 00283 draw->pipeline.point_sprite = enable; 00284 }
int draw_find_vs_output | ( | const struct draw_context * | draw, | |
uint | semantic_name, | |||
uint | semantic_index | |||
) |
Ask the draw module for the location/slot of the given vertex attribute in a post-transformed vertex.
With this function, drivers that use the draw module should have no reason to track the current vertex shader.
Note that the draw module may sometimes generate vertices with extra attributes (such as texcoords for AA lines). The driver can call this function to find those attributes.
Zero is returned if the attribute is not found since this is a don't care / undefined situtation. Returning -1 would be a bit more work for the drivers.
Definition at line 311 of file draw_context.c.
References draw_context::extra_vp_outputs, draw_vertex_shader::info, tgsi_shader_info::num_outputs, tgsi_shader_info::output_semantic_index, tgsi_shader_info::output_semantic_name, draw_context::semantic_index, draw_context::semantic_name, draw_context::slot, draw_context::vertex_shader, and draw_context::vs.
00313 { 00314 const struct draw_vertex_shader *vs = draw->vs.vertex_shader; 00315 uint i; 00316 for (i = 0; i < vs->info.num_outputs; i++) { 00317 if (vs->info.output_semantic_name[i] == semantic_name && 00318 vs->info.output_semantic_index[i] == semantic_index) 00319 return i; 00320 } 00321 00322 /* XXX there may be more than one extra vertex attrib. 00323 * For example, simulated gl_FragCoord and gl_PointCoord. 00324 */ 00325 if (draw->extra_vp_outputs.semantic_name == semantic_name && 00326 draw->extra_vp_outputs.semantic_index == semantic_index) { 00327 return draw->extra_vp_outputs.slot; 00328 } 00329 return 0; 00330 }
void draw_flush | ( | struct draw_context * | draw | ) |
Definition at line 100 of file draw_context.c.
References draw_do_flush(), and DRAW_FLUSH_BACKEND.
00101 { 00102 draw_do_flush( draw, DRAW_FLUSH_BACKEND ); 00103 }
boolean draw_install_aaline_stage | ( | struct draw_context * | draw, | |
struct pipe_context * | pipe | |||
) |
Called by drivers that want to install this AA line prim stage into the draw module's pipeline.
This will not be used if the hardware has native support for AA lines.
Definition at line 865 of file draw_pipe_aaline.c.
References draw_context::aaline, aaline_bind_fs_state(), aaline_bind_sampler_states(), aaline_create_fs_state(), aaline_create_sampler(), aaline_create_texture(), aaline_delete_fs_state(), aaline_set_sampler_textures(), pipe_context::bind_fs_state, pipe_context::bind_sampler_states, pipe_context::create_fs_state, pipe_context::delete_fs_state, draw_stage::destroy, pipe_context::draw, draw_aaline_stage(), aaline_stage::driver_bind_fs_state, aaline_stage::driver_bind_sampler_states, aaline_stage::driver_create_fs_state, aaline_stage::driver_delete_fs_state, aaline_stage::driver_set_sampler_textures, FALSE, aaline_stage::pipe, draw_context::pipeline, pipe_context::set_sampler_textures, aaline_stage::stage, and TRUE.
00866 { 00867 struct aaline_stage *aaline; 00868 00869 pipe->draw = (void *) draw; 00870 00871 /* 00872 * Create / install AA line drawing / prim stage 00873 */ 00874 aaline = draw_aaline_stage( draw ); 00875 if (!aaline) 00876 goto fail; 00877 00878 aaline->pipe = pipe; 00879 00880 /* create special texture, sampler state */ 00881 if (!aaline_create_texture(aaline)) 00882 goto fail; 00883 00884 if (!aaline_create_sampler(aaline)) 00885 goto fail; 00886 00887 /* save original driver functions */ 00888 aaline->driver_create_fs_state = pipe->create_fs_state; 00889 aaline->driver_bind_fs_state = pipe->bind_fs_state; 00890 aaline->driver_delete_fs_state = pipe->delete_fs_state; 00891 00892 aaline->driver_bind_sampler_states = pipe->bind_sampler_states; 00893 aaline->driver_set_sampler_textures = pipe->set_sampler_textures; 00894 00895 /* override the driver's functions */ 00896 pipe->create_fs_state = aaline_create_fs_state; 00897 pipe->bind_fs_state = aaline_bind_fs_state; 00898 pipe->delete_fs_state = aaline_delete_fs_state; 00899 00900 pipe->bind_sampler_states = aaline_bind_sampler_states; 00901 pipe->set_sampler_textures = aaline_set_sampler_textures; 00902 00903 /* Install once everything is known to be OK: 00904 */ 00905 draw->pipeline.aaline = &aaline->stage; 00906 00907 return TRUE; 00908 00909 fail: 00910 if (aaline) 00911 aaline->stage.destroy( &aaline->stage ); 00912 00913 return FALSE; 00914 }
boolean draw_install_aapoint_stage | ( | struct draw_context * | draw, | |
struct pipe_context * | pipe | |||
) |
Called by drivers that want to install this AA point prim stage into the draw module's pipeline.
This will not be used if the hardware has native support for AA points.
Definition at line 839 of file draw_pipe_aapoint.c.
References draw_context::aapoint, aapoint_bind_fs_state(), aapoint_create_fs_state(), aapoint_delete_fs_state(), pipe_context::bind_fs_state, pipe_context::create_fs_state, pipe_context::delete_fs_state, draw_stage::destroy, pipe_context::draw, draw_aapoint_stage(), aapoint_stage::driver_bind_fs_state, aapoint_stage::driver_create_fs_state, aapoint_stage::driver_delete_fs_state, FALSE, aapoint_stage::pipe, draw_context::pipeline, aapoint_stage::stage, and TRUE.
00842 { 00843 struct aapoint_stage *aapoint; 00844 00845 pipe->draw = (void *) draw; 00846 00847 /* 00848 * Create / install AA point drawing / prim stage 00849 */ 00850 aapoint = draw_aapoint_stage( draw ); 00851 if (aapoint == NULL) 00852 goto fail; 00853 00854 aapoint->pipe = pipe; 00855 00856 /* save original driver functions */ 00857 aapoint->driver_create_fs_state = pipe->create_fs_state; 00858 aapoint->driver_bind_fs_state = pipe->bind_fs_state; 00859 aapoint->driver_delete_fs_state = pipe->delete_fs_state; 00860 00861 /* override the driver's functions */ 00862 pipe->create_fs_state = aapoint_create_fs_state; 00863 pipe->bind_fs_state = aapoint_bind_fs_state; 00864 pipe->delete_fs_state = aapoint_delete_fs_state; 00865 00866 draw->pipeline.aapoint = &aapoint->stage; 00867 00868 return TRUE; 00869 00870 fail: 00871 if (aapoint) 00872 aapoint->stage.destroy( &aapoint->stage ); 00873 00874 return FALSE;
boolean draw_install_pstipple_stage | ( | struct draw_context * | draw, | |
struct pipe_context * | pipe | |||
) |
Called by drivers that want to install this polygon stipple stage into the draw module's pipeline.
This will not be used if the hardware has native support for polygon stipple.
Definition at line 720 of file draw_pipe_pstipple.c.
References pipe_context::bind_fs_state, pipe_context::bind_sampler_states, pipe_context::create_fs_state, pipe_context::delete_fs_state, draw_stage::destroy, pipe_context::draw, draw_pstip_stage(), pstip_stage::driver_bind_fs_state, pstip_stage::driver_bind_sampler_states, pstip_stage::driver_create_fs_state, pstip_stage::driver_delete_fs_state, pstip_stage::driver_set_polygon_stipple, pstip_stage::driver_set_sampler_textures, FALSE, pstip_stage::pipe, draw_context::pipeline, pstip_bind_fs_state(), pstip_bind_sampler_states(), pstip_create_fs_state(), pstip_create_sampler(), pstip_create_texture(), pstip_delete_fs_state(), pstip_set_polygon_stipple(), pstip_set_sampler_textures(), draw_context::pstipple, pipe_context::set_polygon_stipple, pipe_context::set_sampler_textures, pstip_stage::stage, and TRUE.
00722 { 00723 struct pstip_stage *pstip; 00724 00725 pipe->draw = (void *) draw; 00726 00727 /* 00728 * Create / install pgon stipple drawing / prim stage 00729 */ 00730 pstip = draw_pstip_stage( draw ); 00731 if (pstip == NULL) 00732 goto fail; 00733 00734 draw->pipeline.pstipple = &pstip->stage; 00735 00736 pstip->pipe = pipe; 00737 00738 /* create special texture, sampler state */ 00739 if (!pstip_create_texture(pstip)) 00740 goto fail; 00741 00742 if (!pstip_create_sampler(pstip)) 00743 goto fail; 00744 00745 /* save original driver functions */ 00746 pstip->driver_create_fs_state = pipe->create_fs_state; 00747 pstip->driver_bind_fs_state = pipe->bind_fs_state; 00748 pstip->driver_delete_fs_state = pipe->delete_fs_state; 00749 00750 pstip->driver_bind_sampler_states = pipe->bind_sampler_states; 00751 pstip->driver_set_sampler_textures = pipe->set_sampler_textures; 00752 pstip->driver_set_polygon_stipple = pipe->set_polygon_stipple; 00753 00754 /* override the driver's functions */ 00755 pipe->create_fs_state = pstip_create_fs_state; 00756 pipe->bind_fs_state = pstip_bind_fs_state; 00757 pipe->delete_fs_state = pstip_delete_fs_state; 00758 00759 pipe->bind_sampler_states = pstip_bind_sampler_states; 00760 pipe->set_sampler_textures = pstip_set_sampler_textures; 00761 pipe->set_polygon_stipple = pstip_set_polygon_stipple; 00762 00763 return TRUE; 00764 00765 fail: 00766 if (pstip) 00767 pstip->stage.destroy( &pstip->stage ); 00768 00769 return FALSE; 00770 }
boolean draw_need_pipeline | ( | const struct draw_context * | draw, | |
const struct pipe_rasterizer_state * | rasterizer, | |||
unsigned | prim | |||
) |
uint draw_num_vs_outputs | ( | const struct draw_context * | draw | ) |
Return number of vertex shader outputs.
Definition at line 337 of file draw_context.c.
References draw_context::extra_vp_outputs, draw_vertex_shader::info, tgsi_shader_info::num_outputs, draw_context::slot, draw_context::vertex_shader, and draw_context::vs.
00338 { 00339 uint count = draw->vs.vertex_shader->info.num_outputs; 00340 if (draw->extra_vp_outputs.slot > 0) 00341 count++; 00342 return count; 00343 }
void draw_set_clip_state | ( | struct draw_context * | pipe, | |
const struct pipe_clip_state * | clip | |||
) |
Set the draw module's clipping state.
Definition at line 163 of file draw_context.c.
References assert, draw_do_flush(), DRAW_FLUSH_STATE_CHANGE, pipe_clip_state::nr, draw_context::nr_planes, PIPE_MAX_CLIP_PLANES, draw_context::plane, and pipe_clip_state::ucp.
00165 { 00166 draw_do_flush( draw, DRAW_FLUSH_STATE_CHANGE ); 00167 00168 assert(clip->nr <= PIPE_MAX_CLIP_PLANES); 00169 memcpy(&draw->plane[6], clip->ucp, clip->nr * sizeof(clip->ucp[0])); 00170 draw->nr_planes = 6 + clip->nr; 00171 }
void draw_set_driver_clipping | ( | struct draw_context * | draw, | |
boolean | bypass_clipping | |||
) |
Definition at line 135 of file draw_context.c.
References pipe_rasterizer_state::bypass_clipping, draw_context::bypass_clipping, draw_do_flush(), DRAW_FLUSH_STATE_CHANGE, draw_context::driver, and draw_context::rasterizer.
00137 { 00138 draw_do_flush( draw, DRAW_FLUSH_STATE_CHANGE ); 00139 00140 draw->driver.bypass_clipping = bypass_clipping; 00141 draw->bypass_clipping = (draw->rasterizer->bypass_clipping || 00142 draw->driver.bypass_clipping); 00143 }
void draw_set_edgeflags | ( | struct draw_context * | draw, | |
const unsigned * | edgeflag | |||
) |
void draw_set_force_passthrough | ( | struct draw_context * | draw, | |
boolean | enable | |||
) |
Definition at line 288 of file draw_context.c.
References draw_do_flush(), DRAW_FLUSH_STATE_CHANGE, and draw_context::force_passthrough.
00289 { 00290 draw_do_flush( draw, DRAW_FLUSH_STATE_CHANGE ); 00291 draw->force_passthrough = enable; 00292 }
void draw_set_mapped_constant_buffer | ( | struct draw_context * | draw, | |
const void * | buffer, | |||
unsigned | size | |||
) |
Definition at line 232 of file draw_context.c.
References draw_vs_set_constants(), draw_context::pt, and draw_context::user.
00235 { 00236 draw->pt.user.constants = buffer; 00237 draw_vs_set_constants( draw, (const float (*)[4])buffer, size ); 00238 }
void draw_set_mapped_element_buffer | ( | struct draw_context * | draw, | |
unsigned | eltSize, | |||
const void * | elements | |||
) |
Definition at line 387 of file draw_context.c.
References draw_context::pt, and draw_context::user.
00390 { 00391 draw->pt.user.elts = elements; 00392 draw->pt.user.eltSize = eltSize; 00393 draw->pt.user.min_index = 0; 00394 draw->pt.user.max_index = 0xffffffff; 00395 }
void draw_set_mapped_element_buffer_range | ( | struct draw_context * | draw, | |
unsigned | eltSize, | |||
unsigned | min_index, | |||
unsigned | max_index, | |||
const void * | elements | |||
) |
Tell the drawing context about the index/element buffer to use (ala glDrawElements) If no element buffer is to be used (i.e.
glDrawArrays) then this should be called with eltSize=0 and elements=NULL.
draw | the drawing context | |
eltSize | size of each element (1, 2 or 4 bytes) | |
elements | the element buffer ptr |
Definition at line 373 of file draw_context.c.
References draw_context::pt, and draw_context::user.
00378 { 00379 draw->pt.user.elts = elements; 00380 draw->pt.user.eltSize = eltSize; 00381 draw->pt.user.min_index = min_index; 00382 draw->pt.user.max_index = max_index; 00383 }
void draw_set_mapped_vertex_buffer | ( | struct draw_context * | draw, | |
unsigned | attr, | |||
const void * | buffer | |||
) |
Tell drawing context where to find mapped vertex buffers.
Definition at line 224 of file draw_context.c.
References draw_context::pt, and draw_context::user.
void draw_set_mrd | ( | struct draw_context * | draw, | |
double | mrd | |||
) |
Specify the Minimum Resolvable Depth factor for polygon offset.
This factor potentially depends on the number of Z buffer bits, the rasterization algorithm and the arithmetic performed on Z values between vertex shading and rasterization. It will vary from one driver to another.
Definition at line 113 of file draw_context.c.
References draw_context::mrd.
00114 { 00115 draw->mrd = mrd; 00116 }
void draw_set_rasterize_stage | ( | struct draw_context * | draw, | |
struct draw_stage * | stage | |||
) |
Plug in the primitive rendering/rasterization stage (which is the last stage in the drawing pipeline).
This is provided by the device driver.
Definition at line 151 of file draw_context.c.
References draw_do_flush(), DRAW_FLUSH_STATE_CHANGE, draw_context::pipeline, and draw_context::rasterize.
00153 { 00154 draw_do_flush( draw, DRAW_FLUSH_STATE_CHANGE ); 00155 00156 draw->pipeline.rasterize = stage; 00157 }
void draw_set_rasterizer_state | ( | struct draw_context * | draw, | |
const struct pipe_rasterizer_state * | raster | |||
) |
Register new primitive rasterization/rendering state.
This causes the drawing pipeline to be rebuilt.
Definition at line 123 of file draw_context.c.
References pipe_rasterizer_state::bypass_clipping, draw_context::bypass_clipping, draw_do_flush(), DRAW_FLUSH_STATE_CHANGE, draw_context::driver, and draw_context::rasterizer.
00125 { 00126 draw_do_flush( draw, DRAW_FLUSH_STATE_CHANGE ); 00127 00128 draw->rasterizer = raster; 00129 draw->bypass_clipping = 00130 ((draw->rasterizer && draw->rasterizer->bypass_clipping) || 00131 draw->driver.bypass_clipping); 00132 }
void draw_set_render | ( | struct draw_context * | draw, | |
struct vbuf_render * | render | |||
) |
Definition at line 347 of file draw_context.c.
References draw_context::render.
00349 { 00350 draw->render = render; 00351 }
void draw_set_vertex_buffers | ( | struct draw_context * | draw, | |
unsigned | count, | |||
const struct pipe_vertex_buffer * | buffers | |||
) |
Definition at line 197 of file draw_context.c.
References assert, draw_context::nr_vertex_buffers, PIPE_MAX_ATTRIBS, draw_context::pt, and draw_context::vertex_buffer.
00200 { 00201 assert(count <= PIPE_MAX_ATTRIBS); 00202 00203 memcpy(draw->pt.vertex_buffer, buffers, count * sizeof(buffers[0])); 00204 draw->pt.nr_vertex_buffers = count; 00205 }
void draw_set_vertex_elements | ( | struct draw_context * | draw, | |
unsigned | count, | |||
const struct pipe_vertex_element * | elements | |||
) |
Definition at line 209 of file draw_context.c.
References assert, draw_context::nr_vertex_elements, PIPE_MAX_ATTRIBS, draw_context::pt, and draw_context::vertex_element.
00212 { 00213 assert(count <= PIPE_MAX_ATTRIBS); 00214 00215 memcpy(draw->pt.vertex_element, elements, count * sizeof(elements[0])); 00216 draw->pt.nr_vertex_elements = count; 00217 }
void draw_set_viewport_state | ( | struct draw_context * | draw, | |
const struct pipe_viewport_state * | viewport | |||
) |
Set the draw module's viewport state.
Definition at line 177 of file draw_context.c.
References draw_do_flush(), DRAW_FLUSH_STATE_CHANGE, draw_vs_set_viewport(), draw_context::identity_viewport, pipe_viewport_state::scale, pipe_viewport_state::translate, and draw_context::viewport.
00179 { 00180 draw_do_flush( draw, DRAW_FLUSH_STATE_CHANGE ); 00181 draw->viewport = *viewport; /* struct copy */ 00182 draw->identity_viewport = (viewport->scale[0] == 1.0f && 00183 viewport->scale[1] == 1.0f && 00184 viewport->scale[2] == 1.0f && 00185 viewport->scale[3] == 1.0f && 00186 viewport->translate[0] == 0.0f && 00187 viewport->translate[1] == 0.0f && 00188 viewport->translate[2] == 0.0f && 00189 viewport->translate[3] == 0.0f); 00190 00191 draw_vs_set_viewport( draw, viewport ); 00192 }
void draw_wide_line_threshold | ( | struct draw_context * | draw, | |
float | threshold | |||
) |
Tells the draw module to draw lines with triangles if their width is greater than this threshold.
Definition at line 258 of file draw_context.c.
References draw_do_flush(), DRAW_FLUSH_STATE_CHANGE, draw_context::pipeline, and draw_context::wide_line_threshold.
00259 { 00260 draw_do_flush( draw, DRAW_FLUSH_STATE_CHANGE ); 00261 draw->pipeline.wide_line_threshold = threshold; 00262 }
void draw_wide_point_threshold | ( | struct draw_context * | draw, | |
float | threshold | |||
) |
Tells the draw module to draw points with triangles if their size is greater than this threshold.
Definition at line 246 of file draw_context.c.
References draw_do_flush(), DRAW_FLUSH_STATE_CHANGE, draw_context::pipeline, and draw_context::wide_point_threshold.
00247 { 00248 draw_do_flush( draw, DRAW_FLUSH_STATE_CHANGE ); 00249 draw->pipeline.wide_point_threshold = threshold; 00250 }