From 851e47831976d127c16a3efae4db8f3e018f6720 Mon Sep 17 00:00:00 2001 From: Jannik Vogel Date: Sun, 17 Feb 2019 05:44:20 +0100 Subject: [PATCH] psh: Separate input component usage selection for RGB and ALPHA portion --- hw/xbox/nv2a/nv2a_psh.c | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/hw/xbox/nv2a/nv2a_psh.c b/hw/xbox/nv2a/nv2a_psh.c index eb5fb291bb..97c807cf99 100644 --- a/hw/xbox/nv2a/nv2a_psh.c +++ b/hw/xbox/nv2a/nv2a_psh.c @@ -296,24 +296,30 @@ static QString* get_input_var(struct PixelShader *ps, struct InputInfo in, bool { QString *reg = get_var(ps, in.reg, false); - switch (in.chan) { - case PS_CHANNEL_RGB: - if (is_alpha) { - qstring_append(reg, ".b"); - } else { + if (!is_alpha) { + switch (in.chan) { + case PS_CHANNEL_RGB: qstring_append(reg, ".rgb"); - } - break; - case PS_CHANNEL_ALPHA: - if (is_alpha) { - qstring_append(reg, ".a"); - } else { + break; + case PS_CHANNEL_ALPHA: qstring_append(reg, ".aaa"); + break; + default: + assert(false); + break; + } + } else { + switch (in.chan) { + case PS_CHANNEL_BLUE: + qstring_append(reg, ".b"); + break; + case PS_CHANNEL_ALPHA: + qstring_append(reg, ".a"); + break; + default: + assert(false); + break; } - break; - default: - assert(false); - break; } QString *res;