psh: Separate input component usage selection for RGB and ALPHA portion

This commit is contained in:
Jannik Vogel 2019-02-17 05:44:20 +01:00 committed by mborgerson
parent f9ba5b9c8c
commit 851e478319
1 changed files with 21 additions and 15 deletions

View File

@ -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;