Mesa (refs/tags/10.3-branchpoint): r600g: Fix flat/ smooth shade state toggle

Carl Worth cworth at kemper.freedesktop.org
Thu Aug 21 15:11:23 UTC 2014


Module: Mesa
Branch: refs/tags/10.3-branchpoint
Commit: 0fb221065eff3788e9bf607a5cf39bd0409740be
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=0fb221065eff3788e9bf607a5cf39bd0409740be

Author: Glenn Kennard <glenn.kennard at gmail.com>
Date:   Wed Aug 20 21:55:37 2014 +0200

r600g: Fix flat/smooth shade state toggle

If only the flat/smooth shade state changed between
two render calls the prior code would miss updating the
hardware state.

Also add check for sprite coord, potentially same type
of issue otherwise for it.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=81967
Signed-off-by: Glenn Kennard <glenn.kennard at gmail.com>
Signed-off-by: Marek Olšák <marek.olsak at amd.com>

---

 src/gallium/drivers/r600/r600_state_common.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/r600/r600_state_common.c b/src/gallium/drivers/r600/r600_state_common.c
index 7594d0e..028d800 100644
--- a/src/gallium/drivers/r600/r600_state_common.c
+++ b/src/gallium/drivers/r600/r600_state_common.c
@@ -1227,7 +1227,9 @@ static bool r600_update_derived_state(struct r600_context *rctx)
 	if (unlikely(!rctx->ps_shader->current))
 		return false;
 
-	if (unlikely(ps_dirty || rctx->pixel_shader.shader != rctx->ps_shader->current)) {
+	if (unlikely(ps_dirty || rctx->pixel_shader.shader != rctx->ps_shader->current ||
+		rctx->rasterizer->sprite_coord_enable != rctx->ps_shader->current->sprite_coord_enable ||
+		rctx->rasterizer->flatshade != rctx->ps_shader->current->flatshade)) {
 
 		if (rctx->cb_misc_state.nr_ps_color_outputs != rctx->ps_shader->current->nr_ps_color_outputs) {
 			rctx->cb_misc_state.nr_ps_color_outputs = rctx->ps_shader->current->nr_ps_color_outputs;




More information about the mesa-commit mailing list