refactor(default): glsl cleaning (2/2)

This commit is contained in:
2026-08-28 20:08:41 +02:00
parent 749206746d
commit 118fc0d67e
11 changed files with 328 additions and 601 deletions
+28 -102
View File
@@ -1,4 +1,4 @@
#version 460
#version 140
// MONITOR
// ---
@@ -25,92 +25,18 @@ float s(vec2 uv, float x0, float y0) {
step(-y0 - 1, -uv.y);
}
const int texts[12][5] = {
{
0x49,
0x4E,
0x20,
0x41,
0x00
}, // IN A
{
0x49,
0x4E,
0x20,
0x42,
0x00
}, // IN B
{
0x53,
0x52,
0x43,
0x20,
0x41
}, // SRC A
{
0x53,
0x52,
0x43,
0x20,
0x42
}, // SRC B
{
0x46,
0x58,
0x20,
0x41,
0x00
}, // FX A
{
0x46,
0x58,
0x20,
0x42,
0x00
}, // FX B
{
0x41,
0x2B,
0x42,
0x00,
0x00
}, // A+B
{
0x4D,
0x46,
0x58,
0x00,
0x00
}, // MFX
{
0x46,
0x50,
0x53,
0x00,
0x00
}, // FPS
{
0x4F,
0x46,
0x46,
0x00,
0x00
}, // OFF
{
0x44,
0x45,
0x4D,
0x4F,
0x00
}, // DEMO
{
0x4C,
0x49,
0x56,
0x45,
0x00
}, // LIVE
};
const int textINA[] = int[5](0x49, 0x4E, 0x20, 0x41, 0x00);
const int textINB[] = int[5](0x49, 0x4E, 0x20, 0x42, 0x00);
const int textSRCA[] = int[5](0x49, 0x4E, 0x20, 0x41, 0x00);
const int textSRCB[] = int[5](0x49, 0x4E, 0x20, 0x42, 0x00);
const int textFXA[] = int[5](0x46, 0x58, 0x20, 0x41, 0x00);
const int textFXB[] = int[5](0x46, 0x58, 0x20, 0x42, 0x00);
const int textAB[] = int[5](0x41, 0x2B, 0x42, 0x00, 0x00);
const int textMFX[] = int[5](0x4D, 0x46, 0x58, 0x00, 0x00);
const int textFPS[] = int[5](0x46, 0x50, 0x53, 0x00, 0x00);
const int textOFF[] = int[5](0x4F, 0x46, 0x46, 0x00, 0x00);
const int textDEMO[] = int[5](0x44, 0x45, 0x4D, 0x4F, 0x00);
const int textLIVE[] = int[5](0x4C, 0x49, 0x56, 0x45, 0x00);
void main() {
vec2 uv0 = vUV.st;
@@ -146,65 +72,65 @@ void main() {
float t = 0;
f += rect(uv3, vec2(-35, 28.5), vec2(2.1, 0.7));
t += write_5(uv3, vec2(-37, 28), texts[0]);
t += write_5(uv3, vec2(-37, 28), textINA);
if (iInputFormat1 == YUYV_FOURCC) {
c += s(uv2, 0, 2) * texture(iTex3, uv2);
f += rect(uv3, vec2(-35, 26.75), vec2(2.8, 0.7));
t += write_int(uv3, vec2(-37.6, 26.1), iInputFPS1, 2);
t += write_5(uv3, vec2(-35.1, 26.1), texts[8]);
t += write_5(uv3, vec2(-35.1, 26.1), textFPS);
} else {
f += rect(uv3, vec2(-35, 26.75), vec2(1.6, 0.7));
t += write_5(uv3, vec2(-36.5, 26.1), texts[9]);
t += write_5(uv3, vec2(-36.5, 26.1), textOFF);
}
f += rect(uv3, vec2(-35, -11.5), vec2(2.1, 0.7));
t += write_5(uv3, vec2(-37, -12), texts[1]);
t += write_5(uv3, vec2(-37, -12), textINB);
if (iInputFormat2 == YUYV_FOURCC) {
c += s(uv2, 0, 0) * texture(iTex4, uv2);
f += rect(uv3, vec2(-35, -13.25), vec2(2.8, 0.7));
t += write_int(uv3, vec2(-37.6, -13.9), iInputFPS2, 2);
t += write_5(uv3, vec2(-35.1, -13.9), texts[8]);
t += write_5(uv3, vec2(-35.1, -13.9), textFPS);
} else {
f += rect(uv3, vec2(-35, -13.25), vec2(1.6, 0.7));
t += write_5(uv3, vec2(-36.5, -13.9), texts[9]);
t += write_5(uv3, vec2(-36.5, -13.9), textOFF);
}
f += rect(uv3, vec2(-35, 8.5), vec2(2.1, 0.7));
if (iDemo > 0) {
t += write_5(uv3, vec2(-37, 8), texts[10]);
t += write_5(uv3, vec2(-37, 8), textDEMO);
} else {
t += write_5(uv3, vec2(-37, 8), texts[11]);
t += write_5(uv3, vec2(-37, 8), textLIVE);
}
f += rect(uv3, vec2(0, 28.5), vec2(2.6, 0.7));
f += iActive1 == 1 ? h_rect(uv3, vec2(0, 28.5), vec2(3, 1), 0.2) : 0;
t += write_5(uv3, vec2(-2.5, 28), texts[2]);
t += write_5(uv3, vec2(-2.5, 28), textSRCA);
f += rect(uv3, vec2(0, -11.5), vec2(2.6, 0.7));
f += iActive1 == 2 ? h_rect(uv3, vec2(0, -11.5), vec2(3, 1), 0.2) : 0;
t += write_5(uv3, vec2(-2.5, -12), texts[3]);
t += write_5(uv3, vec2(-2.5, -12), textSRCB);
f += rect(uv3, vec2(35, 28.5), vec2(2.1, 0.7));
f += iActive2 == 1 ? h_rect(uv3, vec2(35, 28.5), vec2(2.5, 1), 0.2) : 0;
t += write_5(uv3, vec2(33, 28), texts[4]);
t += write_5(uv3, vec2(33, 28), textFXA);
f += rect(uv3, vec2(35, -11.5), vec2(2.1, 0.7));
f += iActive2 == 2 ? h_rect(uv3, vec2(35, -11.5), vec2(2.5, 1), 0.2) : 0;
t += write_5(uv3, vec2(33, -12), texts[5]);
t += write_5(uv3, vec2(33, -12), textFXB);
f += rect(uv3, vec2(0, 8.5), vec2(1.6, 0.7));
t += write_5(uv3, vec2(-1.5, 8), texts[6]);
t += write_5(uv3, vec2(-1.5, 8), textAB);
f += rect(uv3, vec2(35, 8.5), vec2(1.6, 0.7));
f += iActive2 == 3 ? h_rect(uv3, vec2(35, 8.5), vec2(2, 1), 0.2) : 0;
t += write_5(uv3, vec2(33.5, 8), texts[7]);
t += write_5(uv3, vec2(33.5, 8), textMFX);
f += rect(uv3, vec2(35, 6.75), vec2(2.8, 0.7));
t += write_int(uv3, vec2(32.4, 6.1), iFPS, 2);
t += write_5(uv3, vec2(34.9, 6.1), texts[8]);
t += write_5(uv3, vec2(34.9, 6.1), textFPS);
fragColor = mix(c, vec4(min(1, f) - t), min(1, f));
}