brw_sf.h

Go to the documentation of this file.
00001 /*
00002  Copyright (C) Intel Corp.  2006.  All Rights Reserved.
00003  Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to
00004  develop this 3D driver.
00005 
00006  Permission is hereby granted, free of charge, to any person obtaining
00007  a copy of this software and associated documentation files (the
00008  "Software"), to deal in the Software without restriction, including
00009  without limitation the rights to use, copy, modify, merge, publish,
00010  distribute, sublicense, and/or sell copies of the Software, and to
00011  permit persons to whom the Software is furnished to do so, subject to
00012  the following conditions:
00013 
00014  The above copyright notice and this permission notice (including the
00015  next paragraph) shall be included in all copies or substantial
00016  portions of the Software.
00017 
00018  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
00019  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00020  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
00021  IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
00022  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
00023  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
00024  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00025 
00026  **********************************************************************/
00027  /*
00028   * Authors:
00029   *   Keith Whitwell <keith@tungstengraphics.com>
00030   */
00031 
00032 
00033 #ifndef BRW_SF_H
00034 #define BRW_SF_H
00035 
00036 #include "brw_context.h"
00037 #include "brw_eu.h"
00038 
00039 
00040 #define SF_POINTS    0
00041 #define SF_LINES     1
00042 #define SF_TRIANGLES 2
00043 #define SF_UNFILLED_TRIS   3
00044 
00045 
00046 
00047 struct brw_sf_prog_key {
00048    unsigned vp_output_count:5;
00049    unsigned fp_input_count:5;
00050 
00051    unsigned primitive:2;
00052    unsigned do_twoside_color:1;
00053    unsigned do_flat_shading:1;
00054    unsigned frontface_ccw:1;
00055    unsigned do_point_sprite:1;
00056 
00057    /* Interpolation masks;
00058     */
00059    unsigned linear_mask;
00060    unsigned persp_mask;
00061    unsigned const_mask;
00062 
00063 
00064 //   int SpriteOrigin;
00065 };
00066 
00067 struct brw_sf_point_tex {
00068         boolean CoordReplace;
00069 };
00070 
00071 struct brw_sf_compile {
00072    struct brw_compile func;
00073    struct brw_sf_prog_key key;
00074    struct brw_sf_prog_data prog_data;
00075 
00076    struct brw_reg pv;
00077    struct brw_reg det;
00078    struct brw_reg dx0;
00079    struct brw_reg dx2;
00080    struct brw_reg dy0;
00081    struct brw_reg dy2;
00082 
00083    /* z and 1/w passed in seperately:
00084     */
00085    struct brw_reg z[3];
00086    struct brw_reg inv_w[3];
00087 
00088    /* The vertices:
00089     */
00090    struct brw_reg vert[3];
00091 
00092     /* Temporaries, allocated after last vertex reg.
00093     */
00094    struct brw_reg inv_det;
00095    struct brw_reg a1_sub_a0;
00096    struct brw_reg a2_sub_a0;
00097    struct brw_reg tmp;
00098 
00099    struct brw_reg m1Cx;
00100    struct brw_reg m2Cy;
00101    struct brw_reg m3C0;
00102 
00103    unsigned nr_verts;
00104    unsigned nr_attrs;
00105    unsigned nr_attr_regs;
00106    unsigned nr_setup_attrs;
00107    unsigned nr_setup_regs;
00108 #if 0
00109    ubyte attr_to_idx[VERT_RESULT_MAX];
00110    ubyte idx_to_attr[VERT_RESULT_MAX];
00111    struct brw_sf_point_tex point_attrs[VERT_RESULT_MAX];
00112 #endif
00113 };
00114 
00115 
00116 void brw_emit_tri_setup( struct brw_sf_compile *c );
00117 void brw_emit_line_setup( struct brw_sf_compile *c );
00118 void brw_emit_point_setup( struct brw_sf_compile *c );
00119 void brw_emit_point_sprite_setup( struct brw_sf_compile *c );
00120 void brw_emit_anyprim_setup( struct brw_sf_compile *c );
00121 
00122 #endif

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