2 Copyright (C) Intel Corp. 2006. All Rights Reserved.
3 Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to
4 develop this 3D driver.
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:
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.
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.
26 **********************************************************************/
29 * Keith Whitwell <keith@tungstengraphics.com>
37 #include "brw_context.h"
40 #define MAX_GS_VERTS (4)
42 struct brw_gs_prog_key {
46 * Hardware primitive type being drawn, e.g. _3DPRIM_TRILIST.
51 GLuint need_gs_prog:1;
52 GLuint userclip_active:1;
53 GLuint rasterizer_discard:1;
56 * Number of varyings that are output to transform feedback.
58 GLuint num_transform_feedback_bindings:7; /* 0-BRW_MAX_SOL_BINDINGS */
61 * Map from the index of a transform feedback binding table entry to the
62 * gl_vert_result that should be streamed out through that binding table
65 unsigned char transform_feedback_bindings[BRW_MAX_SOL_BINDINGS];
68 * Map from the index of a transform feedback binding table entry to the
69 * swizzles that should be used when streaming out data through that
70 * binding table entry.
72 unsigned char transform_feedback_swizzles[BRW_MAX_SOL_BINDINGS];
75 struct brw_gs_compile {
76 struct brw_compile func;
77 struct brw_gs_prog_key key;
78 struct brw_gs_prog_data prog_data;
84 * Register holding streamed vertex buffer pointers -- see the Sandy
85 * Bridge PRM, volume 2 part 1, section 4.4.2 (GS Thread Payload
86 * [DevSNB]). These pointers are delivered in GRF 1.
90 struct brw_reg vertex[MAX_GS_VERTS];
91 struct brw_reg header;
95 * Register holding destination indices for streamed buffer writes.
96 * Only used for SOL programs.
98 struct brw_reg destination_indices;
101 /* Number of registers used to store vertex data */
104 struct brw_vue_map vue_map;
107 #define ATTR_SIZE (4*4)
109 void brw_gs_quads( struct brw_gs_compile *c, struct brw_gs_prog_key *key );
110 void brw_gs_quad_strip( struct brw_gs_compile *c, struct brw_gs_prog_key *key );
111 void brw_gs_lines( struct brw_gs_compile *c );
112 void gen6_sol_program(struct brw_gs_compile *c, struct brw_gs_prog_key *key,
113 unsigned num_verts, bool check_edge_flag);