draw_context.h

Go to the documentation of this file.
00001 
00002 /**************************************************************************
00003  * 
00004  * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
00005  * All Rights Reserved.
00006  *
00007  * Permission is hereby granted, free of charge, to any person obtaining a
00008  * copy of this software and associated documentation files (the
00009  * "Software"), to deal in the Software without restriction, including
00010  * without limitation the rights to use, copy, modify, merge, publish,
00011  * distribute, sub license, and/or sell copies of the Software, and to
00012  * permit persons to whom the Software is furnished to do so, subject to
00013  * the following conditions:
00014  * 
00015  * The above copyright notice and this permission notice (including the
00016  * next paragraph) shall be included in all copies or substantial portions
00017  * of the Software.
00018  * 
00019  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
00020  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00021  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
00022  * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
00023  * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
00024  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
00025  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00026  * 
00027  **************************************************************************/
00028 
00033 /* Authors:  Keith Whitwell <keith@tungstengraphics.com>
00034  */
00035 
00036 
00037 #ifndef DRAW_CONTEXT_H
00038 #define DRAW_CONTEXT_H
00039 
00040 
00041 #include "pipe/p_state.h"
00042 
00043 
00044 struct pipe_context;
00045 struct draw_context;
00046 struct draw_stage;
00047 struct draw_vertex_shader;
00048 
00049 
00050 
00051 struct draw_context *draw_create( void );
00052 
00053 void draw_destroy( struct draw_context *draw );
00054 
00055 void draw_set_viewport_state( struct draw_context *draw,
00056                               const struct pipe_viewport_state *viewport );
00057 
00058 void draw_set_clip_state( struct draw_context *pipe,
00059                           const struct pipe_clip_state *clip );
00060 
00061 void draw_set_rasterizer_state( struct draw_context *draw,
00062                                 const struct pipe_rasterizer_state *raster );
00063 
00064 void draw_set_rasterize_stage( struct draw_context *draw,
00065                                struct draw_stage *stage );
00066 
00067 void draw_wide_point_threshold(struct draw_context *draw, float threshold);
00068 
00069 void draw_wide_line_threshold(struct draw_context *draw, float threshold);
00070 
00071 void draw_enable_line_stipple(struct draw_context *draw, boolean enable);
00072 
00073 void draw_enable_point_sprites(struct draw_context *draw, boolean enable);
00074 
00075 void draw_set_mrd(struct draw_context *draw, double mrd);
00076 
00077 boolean
00078 draw_install_aaline_stage(struct draw_context *draw, struct pipe_context *pipe);
00079 
00080 boolean
00081 draw_install_aapoint_stage(struct draw_context *draw, struct pipe_context *pipe);
00082 
00083 boolean
00084 draw_install_pstipple_stage(struct draw_context *draw, struct pipe_context *pipe);
00085 
00086 
00087 int
00088 draw_find_vs_output(const struct draw_context *draw,
00089                     uint semantic_name, uint semantic_index);
00090 
00091 uint
00092 draw_num_vs_outputs(const struct draw_context *draw);
00093 
00094 
00095 
00096 /*
00097  * Vertex shader functions
00098  */
00099 
00100 struct draw_vertex_shader *
00101 draw_create_vertex_shader(struct draw_context *draw,
00102                           const struct pipe_shader_state *shader);
00103 void draw_bind_vertex_shader(struct draw_context *draw,
00104                              struct draw_vertex_shader *dvs);
00105 void draw_delete_vertex_shader(struct draw_context *draw,
00106                                struct draw_vertex_shader *dvs);
00107 
00108 
00109 
00110 /*
00111  * Vertex data functions
00112  */
00113 
00114 void draw_set_vertex_buffers(struct draw_context *draw,
00115                              unsigned count,
00116                              const struct pipe_vertex_buffer *buffers);
00117 
00118 void draw_set_vertex_elements(struct draw_context *draw,
00119                               unsigned count,
00120                               const struct pipe_vertex_element *elements);
00121 
00122 void
00123 draw_set_mapped_element_buffer_range( struct draw_context *draw,
00124                                       unsigned eltSize,
00125                                       unsigned min_index,
00126                                       unsigned max_index,
00127                                       const void *elements );
00128 
00129 void draw_set_mapped_element_buffer( struct draw_context *draw,
00130                                      unsigned eltSize, 
00131                                      const void *elements );
00132 
00133 void draw_set_mapped_vertex_buffer(struct draw_context *draw,
00134                                    unsigned attr, const void *buffer);
00135 
00136 void draw_set_mapped_constant_buffer(struct draw_context *draw,
00137                                      const void *buffer,
00138                                      unsigned size );
00139 
00140 void draw_set_edgeflags( struct draw_context *draw,
00141                          const unsigned *edgeflag );
00142 
00143 
00144 /***********************************************************************
00145  * draw_prim.c 
00146  */
00147 
00148 void draw_arrays(struct draw_context *draw, unsigned prim,
00149                  unsigned start, unsigned count);
00150 
00151 void draw_flush(struct draw_context *draw);
00152 
00153 
00154 /*******************************************************************************
00155  * Driver backend interface 
00156  */
00157 struct vbuf_render;
00158 void draw_set_render( struct draw_context *draw, 
00159                       struct vbuf_render *render );
00160 
00161 void draw_set_driver_clipping( struct draw_context *draw,
00162                                boolean bypass_clipping );
00163 
00164 void draw_set_force_passthrough( struct draw_context *draw, 
00165                                  boolean enable );
00166 
00167 /*******************************************************************************
00168  * Draw pipeline 
00169  */
00170 boolean draw_need_pipeline(const struct draw_context *draw,
00171                            const struct pipe_rasterizer_state *rasterizer,
00172                            unsigned prim );
00173 
00174 
00175 
00176 #endif /* DRAW_CONTEXT_H */

Generated on Tue Sep 29 06:25:14 2009 for Gallium3D by  doxygen 1.5.4