Skip to content

Commit

Permalink
Simplify argument handling logic
Browse files Browse the repository at this point in the history
  • Loading branch information
cassiebeckley committed Sep 5, 2024
1 parent bb60c13 commit f6443c3
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions tools/clang/lib/SPIRV/SpirvEmitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5486,19 +5486,16 @@ void SpirvEmitter::handleOptionalTextureSampleArgs(
index++;
}

bool hasClampArg =
index < numArgs && expr->getArg(index)->getType()->isFloatingType();
if (hasClampArg) {
*clamp = doExpr(expr->getArg(index));
index++;
}
if (index >= numArgs)
return;

const bool hasStatusArg =
index < numArgs &&
expr->getArg(index)->getType()->isUnsignedIntegerType();
if (hasStatusArg) {
*status = doExpr(expr->getArg(index));
}
*clamp = doExpr(expr->getArg(index));
index++;

if (index >= numArgs)
return;

*status = doExpr(expr->getArg(index));
}

SpirvInstruction *
Expand Down

0 comments on commit f6443c3

Please sign in to comment.