Mesa (master): st/mesa: 'fix' point coord semantic info

Brian Paul brianp at kemper.freedesktop.org
Fri Feb 5 17:00:21 UTC 2010


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

Author: Brian Paul <brianp at vmware.com>
Date:   Fri Feb  5 09:52:29 2010 -0700

st/mesa: 'fix' point coord semantic info

This fixes the progs/glsl/pointcoord.c demo.  But this isn't a proper fix.
We really need a TGSI_SEMANTIC_POINT_COORD label so that the draw module
can determine which fragment input / vertex output slot needs to be set
up with the point coordinate info.  We've been using generic slot 0 so far.

This would also require telling the draw module about fragment shaders
(something it doesn't have at this time).

---

 src/mesa/state_tracker/st_program.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c
index a639003..21ad6fe 100644
--- a/src/mesa/state_tracker/st_program.c
+++ b/src/mesa/state_tracker/st_program.c
@@ -325,6 +325,16 @@ st_translate_fragment_program(struct st_context *st,
             stfp->input_semantic_index[slot] = 0;
             interpMode[slot] = TGSI_INTERPOLATE_CONSTANT;
             break;
+         case FRAG_ATTRIB_PNTC:
+            /* This is a hack.  We really need a new semantic label for
+             * point coord.  The draw module needs to know which fragment
+             * shader input is the point coord attribute so that it can set
+             * up the right vertex attribute values.
+             */
+            stfp->input_semantic_name[slot] = TGSI_SEMANTIC_GENERIC;
+            stfp->input_semantic_index[slot] = 0;
+            interpMode[slot] = TGSI_INTERPOLATE_PERSPECTIVE;
+            break;
 
             /* In most cases, there is nothing special about these
              * inputs, so adopt a convention to use the generic
@@ -349,7 +359,6 @@ st_translate_fragment_program(struct st_context *st,
          case FRAG_ATTRIB_TEX5:
          case FRAG_ATTRIB_TEX6:
          case FRAG_ATTRIB_TEX7:
-         case FRAG_ATTRIB_PNTC:
          case FRAG_ATTRIB_VAR0:
          default:
             /* Actually, let's try and zero-base this just for




More information about the mesa-commit mailing list