profiles/mojoshader_profile_glsl.c
changeset 1216 9d725de6c61c
parent 1215 8e9fb483f4d4
child 1221 012dec2787aa
equal deleted inserted replaced
1215:8e9fb483f4d4 1216:9d725de6c61c
   953                 case MOJOSHADER_USAGE_FOG:
   953                 case MOJOSHADER_USAGE_FOG:
   954 #if SUPPORT_PROFILE_GLSLES
   954 #if SUPPORT_PROFILE_GLSLES
   955                     if (support_glsles(ctx))
   955                     if (support_glsles(ctx))
   956                         break; // GLSL ES does not have gl_FogFragCoord
   956                         break; // GLSL ES does not have gl_FogFragCoord
   957 #endif
   957 #endif
   958                     if (index == 0)
   958 #if SUPPORT_PROFILE_GLSLES
       
   959                     const int skipFogFragCoord = support_glsles(ctx) || (index > 0);
       
   960 #else
       
   961                     const int skipFogFragCoord = (index > 0);
       
   962 #endif
       
   963                     if (!skipFogFragCoord)
   959                     {
   964                     {
   960                         usage_str = "gl_FogFragCoord";
   965                         usage_str = "gl_FogFragCoord";
   961                     } // if
   966                     } // if
       
   967                     else
       
   968                     {
       
   969                         push_output(ctx, &ctx->globals);
       
   970 #if SUPPORT_PROFILE_GLSLES
       
   971                         if (support_glsles(ctx))
       
   972                             output_line(ctx, "varying highp float io_%i_%i;", usage, index);
       
   973                         else
       
   974 #endif
       
   975                         output_line(ctx, "varying float io_%i_%i;", usage, index);
       
   976                         output_line(ctx, "#define %s io_%i_%i", var, usage, index);
       
   977                         pop_output(ctx);
       
   978                         return;
       
   979                     }
   962                     break;
   980                     break;
   963                 case MOJOSHADER_USAGE_TEXCOORD:
   981                 case MOJOSHADER_USAGE_TEXCOORD:
   964 #if SUPPORT_PROFILE_GLSLES
   982 #if SUPPORT_PROFILE_GLSLES
   965                     if (support_glsles(ctx))
   983                     if (support_glsles(ctx))
   966                         break; // GLSL ES does not have gl_TexCoord
   984                         break; // GLSL ES does not have gl_TexCoord