Removed -f suffixes for floats (not supported on AMD)

This commit is contained in:
ZZYZX 2019-12-16 01:17:41 +02:00
parent 81c8cdeec6
commit 2433b8eb0d
6 changed files with 16 additions and 16 deletions

Binary file not shown.

View file

@ -12,7 +12,7 @@ static const char* display2D_vs = R"(
void main() void main()
{ {
gl_Position = projection * vec4(AttrPosition, 1.0f); gl_Position = projection * vec4(AttrPosition, 1.0);
Color = AttrColor; Color = AttrColor;
UV = AttrUV; UV = AttrUV;
} }
@ -56,7 +56,7 @@ static const char* display2D_ps_fsaa = R"(
vec4 c = texture(texture1, UV); vec4 c = texture(texture1, UV);
// If this pixel is not drawn on... // If this pixel is not drawn on...
if(c.a < 0.1f) if(c.a < 0.1)
{ {
// Mix the colors of nearby pixels // Mix the colors of nearby pixels
vec4 n = vec4(0.0); vec4 n = vec4(0.0);

View file

@ -13,7 +13,7 @@ static const char* plotter_vs = R"(
void main() void main()
{ {
gl_Position = projection * vec4(AttrPosition, 1.0f); gl_Position = projection * vec4(AttrPosition, 1.0);
Color = AttrColor; Color = AttrColor;
UV = AttrUV; UV = AttrUV;
Pos = AttrPosition.xy; Pos = AttrPosition.xy;
@ -41,7 +41,7 @@ const char* plotter_ps = R"(
); );
// line stipple // line stipple
if (mod(floor(mix(tPos.x, tPos.y, yFrac)), 2.0) > 0f) if (mod(floor(mix(tPos.x, tPos.y, yFrac)), 2.0) > 0.0)
discard; discard;
} }

View file

@ -12,7 +12,7 @@ static const char* things2D_vs = R"(
void main() void main()
{ {
gl_Position = projection * vec4(AttrPosition, 1.0f); gl_Position = projection * vec4(AttrPosition, 1.0);
Color = AttrColor; Color = AttrColor;
UV = AttrUV; UV = AttrUV;
} }
@ -47,7 +47,7 @@ static const char* things2D_ps_sprite = R"(
if (Color.a > 0.0) if (Color.a > 0.0)
{ {
vec3 cr = desaturate(c.rgb); vec3 cr = desaturate(c.rgb);
FragColor = vec4((cr.r + Color.r) / 2.0f, (cr.g + Color.g) / 2.0f, (cr.b + Color.b) / 2.0f, c.a * rendersettings.w * Color.a); FragColor = vec4((cr.r + Color.r) / 2.0, (cr.g + Color.g) / 2.0, (cr.b + Color.b) / 2.0, c.a * rendersettings.w * Color.a);
} }
else else
{ {

View file

@ -161,7 +161,7 @@ static const char* world3D_ps_main = R"(
if (FragColor.a < 0.5) discard; if (FragColor.a < 0.5) discard;
#endif #endif
if (fogsettings.x >= 0.0f) FragColor = mix(FragColor, fogcolor, clamp((-viewpos.z - fogsettings.x) / (fogsettings.y - fogsettings.x), 0.0, 1.0)); if (fogsettings.x >= 0.0) FragColor = mix(FragColor, fogcolor, clamp((-viewpos.z - fogsettings.x) / (fogsettings.y - fogsettings.x), 0.0, 1.0));
} }
)"; )";
@ -190,7 +190,7 @@ static const char* world3D_ps_fullbright = R"(
if (FragColor.a < 0.5) discard; if (FragColor.a < 0.5) discard;
#endif #endif
if (fogsettings.x >= 0.0f) FragColor = mix(FragColor, fogcolor, clamp((-viewpos.z - fogsettings.x) / (fogsettings.y - fogsettings.x), 0.0, 1.0)); if (fogsettings.x >= 0.0) FragColor = mix(FragColor, fogcolor, clamp((-viewpos.z - fogsettings.x) / (fogsettings.y - fogsettings.x), 0.0, 1.0));
} }
)"; )";
@ -236,7 +236,7 @@ static const char* world3D_ps_main_highlight = R"(
if (FragColor.a < 0.5) discard; if (FragColor.a < 0.5) discard;
#endif #endif
if (fogsettings.x >= 0.0f) FragColor = mix(FragColor, fogcolor, clamp((-viewpos.z - fogsettings.x) / (fogsettings.y - fogsettings.x), 0.0, 1.0)); if (fogsettings.x >= 0.0) FragColor = mix(FragColor, fogcolor, clamp((-viewpos.z - fogsettings.x) / (fogsettings.y - fogsettings.x), 0.0, 1.0));
} }
)"; )";
@ -275,7 +275,7 @@ static const char* world3D_ps_fullbright_highlight = R"(
if (FragColor.a < 0.5) discard; if (FragColor.a < 0.5) discard;
#endif #endif
if (fogsettings.x >= 0.0f) FragColor = mix(FragColor, fogcolor, clamp((-viewpos.z - fogsettings.x) / (fogsettings.y - fogsettings.x), 0.0, 1.0)); if (fogsettings.x >= 0.0) FragColor = mix(FragColor, fogcolor, clamp((-viewpos.z - fogsettings.x) / (fogsettings.y - fogsettings.x), 0.0, 1.0));
} }
)"; )";
@ -331,7 +331,7 @@ static const char* world3D_ps_main_fog = R"(
if (FragColor.a < 0.5) discard; if (FragColor.a < 0.5) discard;
#endif #endif
if (fogsettings.x >= 0.0f) FragColor = mix(FragColor, fogcolor, clamp((-viewpos.z - fogsettings.x) / (fogsettings.y - fogsettings.x), 0.0, 1.0)); if (fogsettings.x >= 0.0) FragColor = mix(FragColor, fogcolor, clamp((-viewpos.z - fogsettings.x) / (fogsettings.y - fogsettings.x), 0.0, 1.0));
} }
)"; )";
@ -391,7 +391,7 @@ static const char* world3D_ps_main_highlight_fog = R"(
if (FragColor.a < 0.5) discard; if (FragColor.a < 0.5) discard;
#endif #endif
if (fogsettings.x >= 0.0f) FragColor = mix(FragColor, fogcolor, clamp((-viewpos.z - fogsettings.x) / (fogsettings.y - fogsettings.x), 0.0, 1.0)); if (fogsettings.x >= 0.0) FragColor = mix(FragColor, fogcolor, clamp((-viewpos.z - fogsettings.x) / (fogsettings.y - fogsettings.x), 0.0, 1.0));
} }
)"; )";
@ -415,7 +415,7 @@ static const char* world3D_ps_constant_color = R"(
if (FragColor.a < 0.5) discard; if (FragColor.a < 0.5) discard;
#endif #endif
if (fogsettings.x >= 0.0f) FragColor = mix(FragColor, fogcolor, clamp((-viewpos.z - fogsettings.x) / (fogsettings.y - fogsettings.x), 0.0, 1.0)); if (fogsettings.x >= 0.0) FragColor = mix(FragColor, fogcolor, clamp((-viewpos.z - fogsettings.x) / (fogsettings.y - fogsettings.x), 0.0, 1.0));
} }
)"; )";
@ -437,7 +437,7 @@ static const char* world3D_ps_vertex_color = R"(
if (FragColor.a < 0.5) discard; if (FragColor.a < 0.5) discard;
#endif #endif
if (fogsettings.x >= 0.0f) FragColor = mix(FragColor, fogcolor, clamp((-viewpos.z - fogsettings.x) / (fogsettings.y - fogsettings.x), 0.0, 1.0)); if (fogsettings.x >= 0.0) FragColor = mix(FragColor, fogcolor, clamp((-viewpos.z - fogsettings.x) / (fogsettings.y - fogsettings.x), 0.0, 1.0));
} }
)"; )";
@ -499,7 +499,7 @@ static const char* world3D_ps_lightpass = R"(
lightColorMod.rgb *= df; lightColorMod.rgb *= df;
} }
if (lightColor.a > 0.979f && lightColor.a < 0.981f) // attenuated light 98% if (lightColor.a > 0.979 && lightColor.a < 0.981) // attenuated light 98%
lightColorMod.rgb *= diffuseContribution; lightColorMod.rgb *= diffuseContribution;
if (lightColorMod.r <= 0.0 && lightColorMod.g <= 0.0 && lightColorMod.b <= 0.0) if (lightColorMod.r <= 0.0 && lightColorMod.g <= 0.0 && lightColorMod.b <= 0.0)
@ -539,6 +539,6 @@ static const char* world3D_ps_skybox = R"(
if (FragColor.a < 0.5) discard; if (FragColor.a < 0.5) discard;
#endif #endif
if (fogsettings.x >= 0.0f) FragColor = mix(FragColor, fogcolor, clamp((-viewpos.z - fogsettings.x) / (fogsettings.y - fogsettings.x), 0.0, 1.0)); if (fogsettings.x >= 0.0) FragColor = mix(FragColor, fogcolor, clamp((-viewpos.z - fogsettings.x) / (fogsettings.y - fogsettings.x), 0.0, 1.0));
} }
)"; )";