Shader_IR: Address feedback.

This commit is contained in:
Fernando Sahmkow 2020-01-24 10:44:34 -04:00 committed by FernandoS27
parent 806f569143
commit bb8eb15d39
10 changed files with 40 additions and 36 deletions

View file

@ -36,7 +36,6 @@ std::pair<Node, s64> FindOperation(const NodeBlock& code, s64 cursor,
}
return {};
}
} // Anonymous namespace
std::optional<std::pair<Node, Node>> DecoupleIndirectRead(const OperationNode& operation) {
if (operation.GetCode() != OperationCode::UAdd) {
@ -44,9 +43,7 @@ std::optional<std::pair<Node, Node>> DecoupleIndirectRead(const OperationNode& o
}
Node gpr{};
Node offset{};
if (operation.GetOperandsCount() != 2) {
return std::nullopt;
}
ASSERT(operation.GetOperandsCount() == 2);
for (std::size_t i = 0; i < operation.GetOperandsCount(); i++) {
Node operand = operation[i];
if (std::holds_alternative<ImmediateNode>(*operand)) {
@ -56,7 +53,7 @@ std::optional<std::pair<Node, Node>> DecoupleIndirectRead(const OperationNode& o
}
}
if (offset && gpr) {
return {std::make_pair(gpr, offset)};
return std::make_pair(gpr, offset);
}
return std::nullopt;
}
@ -72,6 +69,8 @@ bool AmendNodeCv(std::size_t amend_index, Node node) {
return false;
}
} // Anonymous namespace
std::tuple<Node, TrackSampler> ShaderIR::TrackBindlessSampler(Node tracked, const NodeBlock& code,
s64 cursor) {
if (const auto cbuf = std::get_if<CbufNode>(&*tracked)) {