Mesa (master): llvmpipe: Obey color interpolation.

Jose Fonseca jrfonseca at kemper.freedesktop.org
Tue Jun 1 13:31:06 PDT 2010


Module: Mesa
Branch: master
Commit: 489f637741da5d3dea2c9eb858a64b15f9af0e3f
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=489f637741da5d3dea2c9eb858a64b15f9af0e3f

Author: José Fonseca <jfonseca at vmware.com>
Date:   Tue Jun  1 21:29:01 2010 +0100

llvmpipe: Obey color interpolation.

Don't force color to be linearly interpolated when that's not being
requested.

---

 src/gallium/drivers/llvmpipe/lp_state_derived.c |   33 ++++++++++++-----------
 1 files changed, 17 insertions(+), 16 deletions(-)

diff --git a/src/gallium/drivers/llvmpipe/lp_state_derived.c b/src/gallium/drivers/llvmpipe/lp_state_derived.c
index 46a9653..9e066f5 100644
--- a/src/gallium/drivers/llvmpipe/lp_state_derived.c
+++ b/src/gallium/drivers/llvmpipe/lp_state_derived.c
@@ -78,6 +78,22 @@ compute_vertex_info(struct llvmpipe_context *llvmpipe)
       /* This can be pre-computed, except for flatshade:
        */
       inputs[i].usage_mask = lpfs->info.input_usage_mask[i];
+
+      switch (lpfs->info.input_interpolate[i]) {
+      case TGSI_INTERPOLATE_CONSTANT:
+         inputs[i].interp = LP_INTERP_CONSTANT;
+         break;
+      case TGSI_INTERPOLATE_LINEAR:
+         inputs[i].interp = LP_INTERP_LINEAR;
+         break;
+      case TGSI_INTERPOLATE_PERSPECTIVE:
+         inputs[i].interp = LP_INTERP_PERSPECTIVE;
+         break;
+      default:
+         assert(0);
+         break;
+      }
+
       switch (lpfs->info.input_semantic_name[i]) {
       case TGSI_SEMANTIC_FACE:
          inputs[i].interp = LP_INTERP_FACING;
@@ -96,25 +112,10 @@ compute_vertex_info(struct llvmpipe_context *llvmpipe)
           */
          if (llvmpipe->rasterizer->flatshade)
             inputs[i].interp = LP_INTERP_CONSTANT;
-         else
-            inputs[i].interp = LP_INTERP_LINEAR;
          break;
 
       default:
-         switch (lpfs->info.input_interpolate[i]) {
-         case TGSI_INTERPOLATE_CONSTANT:
-            inputs[i].interp = LP_INTERP_CONSTANT;
-            break;
-         case TGSI_INTERPOLATE_LINEAR:
-            inputs[i].interp = LP_INTERP_LINEAR;
-            break;
-         case TGSI_INTERPOLATE_PERSPECTIVE:
-            inputs[i].interp = LP_INTERP_PERSPECTIVE;
-            break;
-         default:
-            assert(0);
-            break;
-         }
+         break;
       }
 
       /*



More information about the mesa-commit mailing list