Skip to content

Commit

Permalink
gpu: shader: fix partial exp
Browse files Browse the repository at this point in the history
  • Loading branch information
DHrpcs3 committed Oct 22, 2024
1 parent 7d704c3 commit 7aade2f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions rpcsx/gpu/lib/gcn-shader/src/GcnConverter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -645,14 +645,15 @@ static void expToSpv(GcnConverter &converter, gcn::Stage stage,
{{cf0, cf0, cf0, cf0}});

if (comr) {
int operandIndex = 5;
for (auto channel = 0; channel < 2; ++channel) {
if (~swizzle & (1 << (channel * 2))) {
continue;
}

auto src =
builder.createSpvBitcast(loc, context.getTypeFloat32(),
inst.getOperand(5 + channel).getAsValue());
inst.getOperand(operandIndex++).getAsValue());

auto srcType = src.getOperand(0).getAsValue();
ir::Value elementType;
Expand Down Expand Up @@ -697,6 +698,7 @@ static void expToSpv(GcnConverter &converter, gcn::Stage stage,
{{channel * 2 + 1}});
}
} else {
int operandIndex = 5;
for (auto channel = 0; channel < 4; ++channel) {
if (~swizzle & (1 << channel)) {
continue;
Expand All @@ -705,7 +707,7 @@ static void expToSpv(GcnConverter &converter, gcn::Stage stage,
value = builder.createSpvCompositeInsert(
loc, valueType,
context.createCast(loc, builder, elemType,
inst.getOperand(5 + channel).getAsValue()),
inst.getOperand(operandIndex++).getAsValue()),
value, {{channel}});
}
}
Expand Down

0 comments on commit 7aade2f

Please sign in to comment.