From 8bda9507bd795505d4a6b8d024fe0a89e1d87d94 Mon Sep 17 00:00:00 2001 From: Matt Borgerson Date: Sat, 28 Jun 2025 00:08:45 -0700 Subject: [PATCH] nv2a/glsl: Invert fog gen blocks for readability --- hw/xbox/nv2a/pgraph/glsl/vsh.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/hw/xbox/nv2a/pgraph/glsl/vsh.c b/hw/xbox/nv2a/pgraph/glsl/vsh.c index 0e2f69853b..b8074658e6 100644 --- a/hw/xbox/nv2a/pgraph/glsl/vsh.c +++ b/hw/xbox/nv2a/pgraph/glsl/vsh.c @@ -175,8 +175,10 @@ MString *pgraph_gen_vsh_glsl(const VshState *state, state->programmable.program_length, header, body); } - if (state->fog_enable) { - + if (!state->fog_enable) { + /* FIXME: Is the fog still calculated / passed somehow?! */ + mstring_append(body, " oFog = vec4(1.0);\n"); + } else { if (!state->is_fixed_function) { /* FIXME: Does foggen do something here? Let's do some tracking.. * @@ -255,10 +257,6 @@ MString *pgraph_gen_vsh_glsl(const VshState *state, mstring_append(body, " oFog = clamp(NaNToOne(vec4(fogFactor)), -FLOAT_MAX, FLOAT_MAX);\n"); // clang-format on - } else { - /* FIXME: Is the fog still calculated / passed somehow?! - */ - mstring_append(body, " oFog = vec4(1.0);\n"); } mstring_append(body, "\n"