Address Comments
This commit is contained in:
parent
d53b79ff5c
commit
a19dc3bf00
|
@ -464,7 +464,11 @@ public:
|
||||||
return operands.size();
|
return operands.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
NodeBlock GetOperands() const {
|
NodeBlock& GetOperands() {
|
||||||
|
return operands;
|
||||||
|
}
|
||||||
|
|
||||||
|
const NodeBlock& GetOperands() const {
|
||||||
return operands;
|
return operands;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -388,12 +388,12 @@ void ShaderIR::SetInternalFlagsFromInteger(NodeBlock& bb, Node value, bool sets_
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
switch (value->index()) {
|
switch (value->index()) {
|
||||||
case 0:
|
case 0: // Operation Node
|
||||||
Iterop(bb, value);
|
Iterop(bb, value);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2: // Genral Purpose Node
|
||||||
if (const auto gpr = std::get_if<GprNode>(value.get())) {
|
if (const auto gpr = std::get_if<GprNode>(value.get())) {
|
||||||
LOG_WARNING(HW_GPU, "GprNode: index={}", gpr->GetIndex());
|
LOG_DEBUG(HW_GPU, "GprNode: index={}", gpr->GetIndex());
|
||||||
Node zerop = Operation(OperationCode::LogicalIEqual, std::move(value),
|
Node zerop = Operation(OperationCode::LogicalIEqual, std::move(value),
|
||||||
Immediate(gpr->GetIndex()));
|
Immediate(gpr->GetIndex()));
|
||||||
SetInternalFlag(bb, InternalFlag::Zero, std::move(zerop));
|
SetInternalFlag(bb, InternalFlag::Zero, std::move(zerop));
|
||||||
|
@ -408,26 +408,31 @@ void ShaderIR::SetInternalFlagsFromInteger(NodeBlock& bb, Node value, bool sets_
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShaderIR::Iterop(NodeBlock& nb, Node var) {
|
void ShaderIR::SearchOperands(NodeBlock& nb, Node var) {
|
||||||
if (const auto op = std::get_if<OperationNode>(var.get())) {
|
const auto* op = std::get_if<OperationNode>(var.get());
|
||||||
if (op->GetOperandsCount() > 0) {
|
if (op == nullptr) {
|
||||||
for (auto& opss : op->GetOperands()) {
|
return;
|
||||||
switch (opss->index()) {
|
}
|
||||||
case 0:
|
|
||||||
return Iterop(nb, opss);
|
if (op->GetOperandsCount() == 0) {
|
||||||
case 2:
|
return;
|
||||||
if (const auto gpr = std::get_if<GprNode>(opss.get())) {
|
}
|
||||||
LOG_WARNING(HW_GPU, "Child GprNode: index={}", gpr->GetIndex());
|
|
||||||
Node zerop = Operation(OperationCode::LogicalIEqual, std::move(opss),
|
for (auto& operand : op->GetOperands()) {
|
||||||
Immediate(gpr->GetIndex()));
|
switch (operand->index()) {
|
||||||
SetInternalFlag(nb, InternalFlag::Zero, std::move(zerop));
|
case 0: // Operation Node
|
||||||
}
|
return Iterop(nb, operand);
|
||||||
break;
|
case 2: // General Purpose Node
|
||||||
default:
|
if (const auto* gpr = std::get_if<GprNode>(operand.get())) {
|
||||||
LOG_WARNING(HW_GPU, "Child Node Type: {}", opss->index());
|
LOG_DEBUG(HW_GPU, "Child GprNode: index={}", gpr->GetIndex());
|
||||||
break;
|
Node zerop = Operation(OperationCode::LogicalIEqual, std::move(operand),
|
||||||
}
|
Immediate(gpr->GetIndex()));
|
||||||
|
SetInternalFlag(nb, InternalFlag::Zero, std::move(zerop));
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
LOG_WARNING(HW_GPU, "Child Node Type: {}", operand->index());
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -346,8 +346,8 @@ private:
|
||||||
/// Access a bindless image sampler.
|
/// Access a bindless image sampler.
|
||||||
Image& GetBindlessImage(Tegra::Shader::Register reg, Tegra::Shader::ImageType type);
|
Image& GetBindlessImage(Tegra::Shader::Register reg, Tegra::Shader::ImageType type);
|
||||||
|
|
||||||
/// Recursive Iteration over the OperationNode operands
|
/// Recursive Iteration over the OperationNode operands, searching for GprNodes.
|
||||||
void Iterop(NodeBlock& nb, Node var);
|
void SearchOperands(NodeBlock& nb, Node var);
|
||||||
|
|
||||||
/// Extracts a sequence of bits from a node
|
/// Extracts a sequence of bits from a node
|
||||||
Node BitfieldExtract(Node value, u32 offset, u32 bits);
|
Node BitfieldExtract(Node value, u32 offset, u32 bits);
|
||||||
|
|
Loading…
Reference in New Issue