Mesa (sprite-coord): llvmpipe: clean-up, comments in setup_point_coefficient()

Brian Paul brianp at kemper.freedesktop.org
Mon Sep 20 20:12:12 UTC 2010


Module: Mesa
Branch: sprite-coord
Commit: b7a5eac1f3723a369885bad369a04c456bdf1565
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=b7a5eac1f3723a369885bad369a04c456bdf1565

Author: Brian Paul <brianp at vmware.com>
Date:   Mon Sep 20 13:26:27 2010 -0600

llvmpipe: clean-up, comments in setup_point_coefficient()

---

 src/gallium/drivers/llvmpipe/lp_setup_point.c |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/src/gallium/drivers/llvmpipe/lp_setup_point.c b/src/gallium/drivers/llvmpipe/lp_setup_point.c
index 5521cbb..fb4fb2c 100644
--- a/src/gallium/drivers/llvmpipe/lp_setup_point.c
+++ b/src/gallium/drivers/llvmpipe/lp_setup_point.c
@@ -152,6 +152,7 @@ setup_point_coefficients( struct lp_setup_context *setup,
                           struct lp_rast_triangle *point,
                           const struct point_info *info)
 {
+   const struct lp_fragment_shader *shader = setup->fs.current.variant->shader;
    unsigned fragcoord_usage_mask = TGSI_WRITEMASK_XYZ;
    unsigned slot;
 
@@ -172,12 +173,16 @@ setup_point_coefficients( struct lp_setup_context *setup,
          fragcoord_usage_mask |= usage_mask;
          break;
 
+      case LP_INTERP_LINEAR:
+         /* Sprite tex coords may use linear interpolation someday */
+         /* fall-through */
+
       case LP_INTERP_PERSPECTIVE:
-         /* For point sprite textures */        
-         if (setup->fs.current.variant->shader->info.input_semantic_name[slot] 
-             == TGSI_SEMANTIC_GENERIC) 
-         {
-            int index = setup->fs.current.variant->shader->info.input_semantic_index[slot];
+         /* check if the sprite coord flag is set for this attribute.
+          * If so, set it up so it up so x any y vary from 0 to 1.
+          */
+         if (shader->info.input_semantic_name[slot] == TGSI_SEMANTIC_GENERIC) {
+            const int index = shader->info.input_semantic_index[slot];
             
             if (setup->sprite & (1 << index)) {
                for (i = 0; i < NUM_CHANNELS; i++)




More information about the mesa-commit mailing list