From 8a1df968627de01d04f3d692fd81108ba6492c18 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 31 May 2005 04:04:24 +0000 Subject: Bugzilla #2195: Convert the radeon driver to the t_vertex interface. This cuts about 200 lines from the code and 25k from the binary, while matching other drivers more closely. In the worst case (tcl_mode=0) it appears to have a performance cost of 4.4% +/- 0.3% on quake3 (800x600 demofours, 1ghz p3, rv200). Tested on ut2004, ut, q3, projtex. Submitted by: Andreas Stenglein --- src/mesa/drivers/dri/radeon/radeon_context.h | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'src/mesa/drivers/dri/radeon/radeon_context.h') diff --git a/src/mesa/drivers/dri/radeon/radeon_context.h b/src/mesa/drivers/dri/radeon/radeon_context.h index 8d0637ca32..3019602b7c 100644 --- a/src/mesa/drivers/dri/radeon/radeon_context.h +++ b/src/mesa/drivers/dri/radeon/radeon_context.h @@ -38,6 +38,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #ifndef __RADEON_CONTEXT_H__ #define __RADEON_CONTEXT_H__ +#include "tnl/t_vertex.h" #include "dri_util.h" #include "drm.h" #include "radeon_drm.h" @@ -530,12 +531,13 @@ struct radeon_tcl_info { /* radeon_swtcl.c */ struct radeon_swtcl_info { - GLuint SetupIndex; - GLuint SetupNewInputs; GLuint RenderIndex; GLuint vertex_size; - GLuint vertex_stride_shift; GLuint vertex_format; + + struct tnl_attr_map vertex_attrs[VERT_ATTRIB_MAX]; + GLuint vertex_attr_count; + GLubyte *verts; /* Fallback rasterization functions @@ -548,6 +550,18 @@ struct radeon_swtcl_info { GLenum render_primitive; GLuint numverts; + /** + * Offset of the 4UB color data within a hardware (swtcl) vertex. + */ + GLuint coloroffset; + + /** + * Offset of the 3UB specular color data within a hardware (swtcl) vertex. + */ + GLuint specoffset; + + GLboolean needproj; + struct radeon_dma_region indexed_verts; }; @@ -707,6 +721,7 @@ struct radeon_context { GLuint TclFallback; GLuint Fallback; GLuint NewGLState; + GLuint tnl_index; /* index of bits for last tnl_install_attrs */ /* Vertex buffers */ -- cgit v1.2.3