summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_atom.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2014-03-04 01:45:48 +0100
committerMarek Olšák <[email protected]>2014-03-15 17:47:36 +0100
commit8199d149edd21d74ff70bed652e50d176136aab6 (patch)
treef601874995048ed408fb8f7d688156fd3ff96c9a /src/mesa/state_tracker/st_atom.c
parent4e634c524024fa05d9ea2047497cd065c905bcdf (diff)
st/mesa: remove _NEW_POLYGON dependency from vertex shader
We can just check the polygon mode when updating the edge flag state. Also, we can just flag ST_NEW_VERTEX_PROGRAM directly, which makes ST_NEW_EDGEFLAGS_DATA useless.
Diffstat (limited to 'src/mesa/state_tracker/st_atom.c')
-rw-r--r--src/mesa/state_tracker/st_atom.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/mesa/state_tracker/st_atom.c b/src/mesa/state_tracker/st_atom.c
index 00149f8ab77..99e9df26b47 100644
--- a/src/mesa/state_tracker/st_atom.c
+++ b/src/mesa/state_tracker/st_atom.c
@@ -132,18 +132,22 @@ static void check_program_state( struct st_context *st )
static void check_attrib_edgeflag(struct st_context *st)
{
const struct gl_client_array **arrays = st->ctx->Array._DrawArrays;
- GLboolean vertdata_edgeflags, edgeflag_culls_prims;
+ GLboolean vertdata_edgeflags, edgeflag_culls_prims, edgeflags_enabled;
if (!arrays)
return;
- vertdata_edgeflags = arrays[VERT_ATTRIB_EDGEFLAG]->StrideB != 0;
+ edgeflags_enabled = st->ctx->Polygon.FrontMode != GL_FILL ||
+ st->ctx->Polygon.BackMode != GL_FILL;
+
+ vertdata_edgeflags = edgeflags_enabled &&
+ arrays[VERT_ATTRIB_EDGEFLAG]->StrideB != 0;
if (vertdata_edgeflags != st->vertdata_edgeflags) {
st->vertdata_edgeflags = vertdata_edgeflags;
- st->dirty.st |= ST_NEW_EDGEFLAGS_DATA;
+ st->dirty.st |= ST_NEW_VERTEX_PROGRAM;
}
- edgeflag_culls_prims = !vertdata_edgeflags &&
+ edgeflag_culls_prims = edgeflags_enabled && !vertdata_edgeflags &&
!st->ctx->Current.Attrib[VERT_ATTRIB_EDGEFLAG][0];
if (edgeflag_culls_prims != st->edgeflag_culls_prims) {
st->edgeflag_culls_prims = edgeflag_culls_prims;