mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-15 22:30:20 +01:00
i965: Remove hint_gs_always and resulting dead code
Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
parent
7e809f0b8d
commit
a7fa203f0d
3 changed files with 13 additions and 76 deletions
|
|
@ -83,45 +83,23 @@ static void compile_gs_prog( struct brw_context *brw,
|
|||
/* 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;
|
||||
}
|
||||
|
|
@ -170,7 +148,6 @@ static void populate_key( struct brw_context *brw,
|
|||
{
|
||||
struct gl_context *ctx = &brw->intel.ctx;
|
||||
struct intel_context *intel = &brw->intel;
|
||||
int prim_gs_always;
|
||||
|
||||
memset(key, 0, sizeof(*key));
|
||||
|
||||
|
|
@ -180,8 +157,6 @@ static void populate_key( struct brw_context *brw,
|
|||
/* 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) {
|
||||
|
|
@ -191,14 +166,11 @@ static void populate_key( struct brw_context *brw,
|
|||
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.
|
||||
|
|
|
|||
|
|
@ -42,10 +42,9 @@
|
|||
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 {
|
||||
|
|
@ -70,8 +69,6 @@ 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
|
||||
|
|
|
|||
|
|
@ -193,19 +193,6 @@ 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 )
|
||||
{
|
||||
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;
|
||||
|
|
@ -217,22 +204,3 @@ void brw_gs_lines( struct brw_gs_compile *c )
|
|||
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));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue