/* Note that primitives which don't require a GS program have
* already been weeded out by this stage:
*/
+
+ /* Gen6: VF has already converted into polygon, and LINELOOP is
+ * converted to LINESTRIP at the beginning of the 3D pipeline.
+ */
+ if (intel->gen == 6)
+ return;
+
switch (key->primitive) {
case GL_QUADS:
- /* Gen6: VF has already converted into polygon. */
- if (intel->gen == 6)
- return;
brw_gs_quads( &c, key );
break;
case GL_QUAD_STRIP:
- if (intel->gen == 6)
- return;
brw_gs_quad_strip( &c, key );
break;
case GL_LINE_LOOP:
- /* Gen6: LINELOOP is converted to LINESTRIP at the beginning of the 3D pipeline */
- if (intel->gen == 6)
- return;
brw_gs_lines( &c );
break;
- case GL_LINES:
- if (key->hint_gs_always)
- brw_gs_lines( &c );
- else {
- return;
- }
- break;
- case GL_TRIANGLES:
- if (key->hint_gs_always)
- brw_gs_tris( &c );
- else {
- return;
- }
- break;
- case GL_POINTS:
- if (key->hint_gs_always)
- brw_gs_points( &c );
- else {
- return;
- }
- break;
default:
return;
}
{
struct gl_context *ctx = &brw->intel.ctx;
struct intel_context *intel = &brw->intel;
- int prim_gs_always;
memset(key, 0, sizeof(*key));
/* BRW_NEW_PRIMITIVE */
key->primitive = gs_prim[brw->primitive];
- key->hint_gs_always = 0; /* debug code? */
-
/* _NEW_LIGHT */
key->pv_first = (ctx->Light.ProvokingVertex == GL_FIRST_VERTEX_CONVENTION);
if (key->primitive == GL_QUADS && ctx->Light.ShadeModel != GL_FLAT) {
key->pv_first = GL_TRUE;
}
- if (intel->gen == 6)
- prim_gs_always = 0;
- else
- prim_gs_always = brw->primitive == GL_QUADS ||
- brw->primitive == GL_QUAD_STRIP ||
- brw->primitive == GL_LINE_LOOP;
-
- key->need_gs_prog = (key->hint_gs_always || prim_gs_always);
+ key->need_gs_prog = (intel->gen == 6)
+ ? 0
+ : (brw->primitive == GL_QUADS ||
+ brw->primitive == GL_QUAD_STRIP ||
+ brw->primitive == GL_LINE_LOOP);
}
/* Calculate interpolants for triangle and line rasterization.
struct brw_gs_prog_key {
GLbitfield64 attrs;
GLuint primitive:4;
- GLuint hint_gs_always:1;
GLuint pv_first:1;
GLuint need_gs_prog:1;
- GLuint pad:25;
+ GLuint pad:26;
};
struct brw_gs_compile {
void brw_gs_quads( struct brw_gs_compile *c, struct brw_gs_prog_key *key );
void brw_gs_quad_strip( struct brw_gs_compile *c, struct brw_gs_prog_key *key );
-void brw_gs_tris( struct brw_gs_compile *c );
void brw_gs_lines( struct brw_gs_compile *c );
-void brw_gs_points( struct brw_gs_compile *c );
#endif
}
}
-void brw_gs_tris( struct brw_gs_compile *c )
-{
- struct intel_context *intel = &c->func.brw->intel;
-
- brw_gs_alloc_regs(c, 3);
-
- if (intel->needs_ff_sync)
- brw_gs_ff_sync(c, 1);
- brw_gs_emit_vue(c, c->reg.vertex[0], 0, ((_3DPRIM_TRILIST << 2) | R02_PRIM_START));
- brw_gs_emit_vue(c, c->reg.vertex[1], 0, (_3DPRIM_TRILIST << 2));
- brw_gs_emit_vue(c, c->reg.vertex[2], 1, ((_3DPRIM_TRILIST << 2) | R02_PRIM_END));
-}
-
void brw_gs_lines( struct brw_gs_compile *c )
{
struct intel_context *intel = &c->func.brw->intel;
brw_gs_emit_vue(c, c->reg.vertex[0], 0, ((_3DPRIM_LINESTRIP << 2) | R02_PRIM_START));
brw_gs_emit_vue(c, c->reg.vertex[1], 1, ((_3DPRIM_LINESTRIP << 2) | R02_PRIM_END));
}
-
-void brw_gs_points( struct brw_gs_compile *c )
-{
- struct intel_context *intel = &c->func.brw->intel;
-
- brw_gs_alloc_regs(c, 1);
-
- if (intel->needs_ff_sync)
- brw_gs_ff_sync(c, 1);
- brw_gs_emit_vue(c, c->reg.vertex[0], 1, ((_3DPRIM_POINTLIST << 2) | R02_PRIM_START | R02_PRIM_END));
-}
-
-
-
-
-
-
-
-