glsl: drop an useless min in FS

GPU will clamp color anyway. It reduces the number of instruction of 25% (4->3)
This commit is contained in:
Gregory Hainaut 2015-08-22 17:33:01 +02:00
parent 6b11497cdc
commit a1957a685d
2 changed files with 4 additions and 2 deletions

View File

@ -29,7 +29,8 @@ layout(binding = 0) uniform sampler2D TextureSampler;
void ps_main0()
{
vec4 c = texture(TextureSampler, PSin_t);
c.a = min(c.a * 2.0, 1.0);
// Note: clamping will be done by fixed unit
c.a *= 2.0f;
SV_Target0 = c;
}

View File

@ -515,7 +515,8 @@ static const char* merge_glsl =
"void ps_main0()\n"
"{\n"
" vec4 c = texture(TextureSampler, PSin_t);\n"
" c.a = min(c.a * 2.0, 1.0);\n"
" // Note: clamping will be done by fixed unit\n"
" c.a *= 2.0f;\n"
" SV_Target0 = c;\n"
"}\n"
"\n"