Skip to content

Commit

Permalink
USAGE_FOG is a float, not a vec4
Browse files Browse the repository at this point in the history
  • Loading branch information
flibitijibibo committed Oct 30, 2019
1 parent 47dcadd commit 7738438
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion profiles/mojoshader_profile_glsl.c
Expand Up @@ -955,10 +955,28 @@ void emit_GLSL_attribute(Context *ctx, RegisterType regtype, int regnum,
if (support_glsles(ctx))
break; // GLSL ES does not have gl_FogFragCoord
#endif
if (index == 0)
#if SUPPORT_PROFILE_GLSLES
const int skipFogFragCoord = support_glsles(ctx) || (index > 0);
#else
const int skipFogFragCoord = (index > 0);
#endif
if (!skipFogFragCoord)
{
usage_str = "gl_FogFragCoord";
} // if
else
{
push_output(ctx, &ctx->globals);
#if SUPPORT_PROFILE_GLSLES
if (support_glsles(ctx))
output_line(ctx, "varying highp float io_%i_%i;", usage, index);
else
#endif
output_line(ctx, "varying float io_%i_%i;", usage, index);
output_line(ctx, "#define %s io_%i_%i", var, usage, index);
pop_output(ctx);
return;
}
break;
case MOJOSHADER_USAGE_TEXCOORD:
#if SUPPORT_PROFILE_GLSLES
Expand Down

0 comments on commit 7738438

Please sign in to comment.