profiles/mojoshader_profile_glsl.c
changeset 1308 ff7fe8bdbb8f
parent 1293 ee08d870641b
child 1310 9f3b98d12a37
equal deleted inserted replaced
1307:f7efdb215d49 1308:ff7fe8bdbb8f
  1055 #endif
  1055 #endif
  1056             if (usage == MOJOSHADER_USAGE_TEXCOORD)
  1056             if (usage == MOJOSHADER_USAGE_TEXCOORD)
  1057             {
  1057             {
  1058                 // ps_1_1 does a different hack for this attribute.
  1058                 // ps_1_1 does a different hack for this attribute.
  1059                 //  Refer to emit_GLSL_global()'s REG_TYPE_ADDRESS code.
  1059                 //  Refer to emit_GLSL_global()'s REG_TYPE_ADDRESS code.
  1060                 if (shader_version_atleast(ctx, 1, 4) && (index < 4)) // gl_TexCoord[4+] is unreliable!
  1060                 if (!shader_version_atleast(ctx, 1, 4))
       
  1061                     usage_str = "";  // just make sure this isn't NULL.
       
  1062                 else if (index < 4)  // gl_TexCoord[4+] is unreliable!
  1061                 {
  1063                 {
  1062                     snprintf(index_str, sizeof (index_str), "%u", (uint) index);
  1064                     snprintf(index_str, sizeof (index_str), "%u", (uint) index);
  1063                     usage_str = "gl_TexCoord";
  1065                     usage_str = "gl_TexCoord";
  1064                     arrayleft = "[";
  1066                     arrayleft = "[";
  1065                     arrayright = "]";
  1067                     arrayright = "]";
  1066                 } // if
  1068                 } // else if
  1067             } // if
  1069             } // if
  1068 
  1070 
  1069             else if (usage == MOJOSHADER_USAGE_COLOR)
  1071             else if (usage == MOJOSHADER_USAGE_COLOR)
  1070             {
  1072             {
  1071                 index_str[0] = '\0';  // no explicit number.
  1073                 index_str[0] = '\0';  // no explicit number.