summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeonsi/si_state.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2015-09-03 19:34:58 +0200
committerMarek Olšák <[email protected]>2015-09-10 17:14:15 +0200
commit60ec8fb448f292b8aac08f74c26da8171b2b6a8f (patch)
tree6c1fbd467c34d663a8084a1b4a3e6c159922c933 /src/gallium/drivers/radeonsi/si_state.c
parentafa752d3f03ac6697581ff5d324e8ac0512ef513 (diff)
radeonsi: don't update polygon offset state if it has no effect
Reviewed-by: Michel Dänzer <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeonsi/si_state.c')
-rw-r--r--src/gallium/drivers/radeonsi/si_state.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c
index f698c59d87a..d74f6e896c4 100644
--- a/src/gallium/drivers/radeonsi/si_state.c
+++ b/src/gallium/drivers/radeonsi/si_state.c
@@ -636,7 +636,7 @@ static void si_update_poly_offset_state(struct si_context *sctx)
{
struct si_state_rasterizer *rs = sctx->queued.named.rasterizer;
- if (!rs || !sctx->framebuffer.state.zsbuf)
+ if (!rs || !rs->uses_poly_offset || !sctx->framebuffer.state.zsbuf)
return;
switch (sctx->framebuffer.state.zsbuf->texture->format) {
@@ -691,6 +691,8 @@ static void *si_create_rs_state(struct pipe_context *ctx,
rs->poly_stipple_enable = state->poly_stipple_enable;
rs->line_smooth = state->line_smooth;
rs->poly_smooth = state->poly_smooth;
+ rs->uses_poly_offset = state->offset_point || state->offset_line ||
+ state->offset_tri;
rs->flatshade = state->flatshade;
rs->sprite_coord_enable = state->sprite_coord_enable;