brw_sf.h revision 4a1fb81902a7863d5dfe304e5e4ca2c631159be1
1/* 2 Copyright (C) Intel Corp. 2006. All Rights Reserved. 3 Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to 4 develop this 3D driver. 5 6 Permission is hereby granted, free of charge, to any person obtaining 7 a 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, sublicense, 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: 13 14 The above copyright notice and this permission notice (including the 15 next paragraph) shall be included in all copies or substantial 16 portions of the Software. 17 18 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 20 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 21 IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE 22 LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 23 OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 24 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 25 26 **********************************************************************/ 27 /* 28 * Authors: 29 * Keith Whitwell <keith@tungstengraphics.com> 30 */ 31 32 33#ifndef BRW_SF_H 34#define BRW_SF_H 35 36 37#include "program/program.h" 38#include "brw_context.h" 39#include "brw_eu.h" 40 41 42#define SF_POINTS 0 43#define SF_LINES 1 44#define SF_TRIANGLES 2 45#define SF_UNFILLED_TRIS 3 46 47struct brw_sf_prog_key { 48 GLbitfield64 attrs; 49 uint8_t point_sprite_coord_replace; 50 GLuint primitive:2; 51 GLuint do_twoside_color:1; 52 GLuint do_flat_shading:1; 53 GLuint frontface_ccw:1; 54 GLuint do_point_sprite:1; 55 GLuint sprite_origin_lower_left:1; 56 GLuint nr_userclip:4; 57 GLuint pad:20; 58}; 59 60struct brw_sf_compile { 61 struct brw_compile func; 62 struct brw_sf_prog_key key; 63 struct brw_sf_prog_data prog_data; 64 65 struct brw_reg pv; 66 struct brw_reg det; 67 struct brw_reg dx0; 68 struct brw_reg dx2; 69 struct brw_reg dy0; 70 struct brw_reg dy2; 71 72 /* z and 1/w passed in seperately: 73 */ 74 struct brw_reg z[3]; 75 struct brw_reg inv_w[3]; 76 77 /* The vertices: 78 */ 79 struct brw_reg vert[3]; 80 81 /* Temporaries, allocated after last vertex reg. 82 */ 83 struct brw_reg inv_det; 84 struct brw_reg a1_sub_a0; 85 struct brw_reg a2_sub_a0; 86 struct brw_reg tmp; 87 88 struct brw_reg m1Cx; 89 struct brw_reg m2Cy; 90 struct brw_reg m3C0; 91 92 GLuint nr_verts; 93 GLuint nr_attrs; 94 GLuint nr_attr_regs; 95 GLuint nr_setup_attrs; 96 GLuint nr_setup_regs; 97 int urb_entry_read_offset; 98 99 GLubyte attr_to_idx[VERT_RESULT_MAX]; 100 GLubyte idx_to_attr[VERT_RESULT_MAX]; 101 struct brw_vue_map vue_map; 102}; 103 104 105void brw_emit_tri_setup( struct brw_sf_compile *c, GLboolean allocate ); 106void brw_emit_line_setup( struct brw_sf_compile *c, GLboolean allocate ); 107void brw_emit_point_setup( struct brw_sf_compile *c, GLboolean allocate ); 108void brw_emit_point_sprite_setup( struct brw_sf_compile *c, GLboolean allocate ); 109void brw_emit_anyprim_setup( struct brw_sf_compile *c ); 110int brw_sf_compute_urb_entry_read_offset(struct intel_context *intel); 111 112#endif 113