Don't emit semantic info for vertex program inputs.
authorBrian <brian.paul@tungstengraphics.com>
Tue, 9 Oct 2007 20:31:45 +0000 (14:31 -0600)
committerBrian <brian.paul@tungstengraphics.com>
Tue, 9 Oct 2007 20:31:45 +0000 (14:31 -0600)
src/mesa/pipe/tgsi/mesa/mesa_to_tgsi.c

index 189c7f3edad8dc0bfaa43c24522996860ee2b255..e4a93cb60d7ef16db9e271d4497b6c75e3d42628 100644 (file)
@@ -475,6 +475,7 @@ make_input_decl(
    GLuint index,\r
    GLuint interpolate,\r
    GLuint usage_mask,\r
+   GLboolean semantic_info,\r
    GLuint semantic_name,\r
    GLuint semantic_index )\r
 {\r
@@ -486,12 +487,14 @@ make_input_decl(
    decl.Declaration.File = TGSI_FILE_INPUT;\r
    decl.Declaration.Declare = TGSI_DECLARE_RANGE;\r
    decl.Declaration.UsageMask = usage_mask;\r
-   decl.Declaration.Semantic = 1;\r
+   decl.Declaration.Semantic = semantic_info;\r
    decl.Declaration.Interpolate = 1;\r
    decl.u.DeclarationRange.First = index;\r
    decl.u.DeclarationRange.Last = index;\r
-   decl.Semantic.SemanticName = semantic_name;\r
-   decl.Semantic.SemanticIndex = semantic_index;\r
+   if (semantic_info) {\r
+      decl.Semantic.SemanticName = semantic_name;\r
+      decl.Semantic.SemanticIndex = semantic_index;\r
+   }\r
    decl.Interpolation.Interpolate = interpolate;\r
 \r
    return decl;\r
@@ -569,7 +572,7 @@ tgsi_mesa_compile_fp_program(
          fulldecl = make_input_decl(i,\r
                                     TGSI_INTERPOLATE_CONSTANT,\r
                                     TGSI_WRITEMASK_XY,\r
-                                    TGSI_SEMANTIC_POSITION, 0 );\r
+                                    GL_TRUE, TGSI_SEMANTIC_POSITION, 0 );\r
          ti += tgsi_build_full_declaration(\r
                                            &fulldecl,\r
                                            &tokens[ti],\r
@@ -579,7 +582,7 @@ tgsi_mesa_compile_fp_program(
          fulldecl = make_input_decl(i,\r
                                     TGSI_INTERPOLATE_LINEAR,\r
                                     TGSI_WRITEMASK_ZW,\r
-                                    TGSI_SEMANTIC_POSITION, 0 );\r
+                                    GL_TRUE, TGSI_SEMANTIC_POSITION, 0 );\r
          ti += tgsi_build_full_declaration(\r
                                            &fulldecl,\r
                                            &tokens[ti],\r
@@ -590,7 +593,7 @@ tgsi_mesa_compile_fp_program(
          fulldecl = make_input_decl(i,\r
                                     interpMode[i],\r
                                     TGSI_WRITEMASK_XYZW,\r
-                                    inputSemanticName[i],\r
+                                    GL_TRUE, inputSemanticName[i],\r
                                     inputSemanticIndex[i]);\r
          ti += tgsi_build_full_declaration(&fulldecl,\r
                                            &tokens[ti],\r
@@ -713,7 +716,7 @@ tgsi_mesa_compile_vp_program(
       fulldecl = make_input_decl(i,\r
                                  TGSI_INTERPOLATE_CONSTANT, /* no interp */\r
                                  TGSI_WRITEMASK_XYZW,\r
-                                 inputSemanticName[i],\r
+                                 GL_FALSE, inputSemanticName[i],\r
                                  inputSemanticIndex[i]);\r
       ti += tgsi_build_full_declaration(&fulldecl,\r
                                         &tokens[ti],\r