[Mesa-dev] [PATCH 3/3] radeonsi: don't update polygon offset state if it has no effect
Marek Olšák
maraeo at gmail.com
Sun Sep 6 15:14:43 PDT 2015
From: Marek Olšák <marek.olsak at amd.com>
---
src/gallium/drivers/radeonsi/si_state.c | 4 +++-
src/gallium/drivers/radeonsi/si_state.h | 1 +
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c
index f698c59..d74f6e8 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;
diff --git a/src/gallium/drivers/radeonsi/si_state.h b/src/gallium/drivers/radeonsi/si_state.h
index 3718e05..900b70f 100644
--- a/src/gallium/drivers/radeonsi/si_state.h
+++ b/src/gallium/drivers/radeonsi/si_state.h
@@ -58,6 +58,7 @@ struct si_state_rasterizer {
bool poly_stipple_enable;
bool line_smooth;
bool poly_smooth;
+ bool uses_poly_offset;
};
struct si_dsa_stencil_ref_part {
--
2.1.4
More information about the mesa-dev
mailing list