st/mesa: check for PROG_PARAM_BIT_CYL_WRAP flag
authorBrian Paul <brianp@vmware.com>
Thu, 4 Feb 2010 23:36:55 +0000 (16:36 -0700)
committerMichal Krol <michal@vmware.com>
Tue, 9 Feb 2010 14:32:43 +0000 (15:32 +0100)
src/mesa/state_tracker/st_mesa_to_tgsi.c
src/mesa/state_tracker/st_program.c

index 3eb4c1ccca77d2ecd8ed3c4ef8058e096f49c1d5..06cf6d21c6793b814535c697283a8b9c6a041363 100644 (file)
@@ -825,10 +825,19 @@ st_translate_mesa_program(
    if (procType == TGSI_PROCESSOR_FRAGMENT) {
       struct gl_fragment_program* fp = (struct gl_fragment_program*)program;
       for (i = 0; i < numInputs; i++) {
-         t->inputs[i] = ureg_DECL_fs_input(ureg,
-                                           inputSemanticName[i],
-                                           inputSemanticIndex[i],
-                                           interpMode[i]);
+         if (program->InputFlags[0] & PROG_PARAM_BIT_CYL_WRAP) {
+            t->inputs[i] = ureg_DECL_fs_input_cyl(ureg,
+                                                  inputSemanticName[i],
+                                                  inputSemanticIndex[i],
+                                                  interpMode[i],
+                                                  TGSI_CYLINDRICAL_WRAP_X);
+         }
+         else {
+            t->inputs[i] = ureg_DECL_fs_input(ureg,
+                                              inputSemanticName[i],
+                                              inputSemanticIndex[i],
+                                              interpMode[i]);
+         }
       }
 
       if (program->InputsRead & FRAG_BIT_WPOS) {
index 21ad6fef2b47788f65a73f17ae1b6b273fac5eb8..e939ab382182ab8d42eab31bcb1262203e71ab28 100644 (file)
@@ -33,6 +33,7 @@
 
 #include "main/imports.h"
 #include "main/mtypes.h"
+#include "shader/prog_parameter.h"
 #include "shader/prog_print.h"
 #include "shader/programopt.h"
 
@@ -367,7 +368,14 @@ st_translate_fragment_program(struct st_context *st,
             assert(attr >= FRAG_ATTRIB_TEX0);
             stfp->input_semantic_index[slot] = (attr - FRAG_ATTRIB_TEX0);
             stfp->input_semantic_name[slot] = TGSI_SEMANTIC_GENERIC;
-            interpMode[slot] = TGSI_INTERPOLATE_PERSPECTIVE;
+
+            /* XXX this test is very temporary */
+            if (stfp->Base.Base.InputFlags[0] & PROG_PARAM_BIT_CYL_WRAP) {
+               interpMode[slot] = TGSI_INTERPOLATE_LINEAR;
+            }
+            else {
+               interpMode[slot] = TGSI_INTERPOLATE_PERSPECTIVE;
+            }
             break;
          }
       }