summaryrefslogtreecommitdiffstats
path: root/src/video_core/shader/shader_ir.cpp
diff options
context:
space:
mode:
authorLevi Behunin <l3ehunin@gmail.com>2020-09-25 05:52:23 +0200
committerLevi Behunin <l3ehunin@gmail.com>2020-09-25 05:52:23 +0200
commita19dc3bf00bb031120805b1e40fe0a3a455648b7 (patch)
tree01d5cf26bdc0cbe96544b6b59a290fba8efbb33e /src/video_core/shader/shader_ir.cpp
parentStart of Integer flags implementation (diff)
downloadyuzu-a19dc3bf00bb031120805b1e40fe0a3a455648b7.tar
yuzu-a19dc3bf00bb031120805b1e40fe0a3a455648b7.tar.gz
yuzu-a19dc3bf00bb031120805b1e40fe0a3a455648b7.tar.bz2
yuzu-a19dc3bf00bb031120805b1e40fe0a3a455648b7.tar.lz
yuzu-a19dc3bf00bb031120805b1e40fe0a3a455648b7.tar.xz
yuzu-a19dc3bf00bb031120805b1e40fe0a3a455648b7.tar.zst
yuzu-a19dc3bf00bb031120805b1e40fe0a3a455648b7.zip
Diffstat (limited to 'src/video_core/shader/shader_ir.cpp')
-rw-r--r--src/video_core/shader/shader_ir.cpp49
1 files changed, 27 insertions, 22 deletions
diff --git a/src/video_core/shader/shader_ir.cpp b/src/video_core/shader/shader_ir.cpp
index 14206d3ae..521d0e47d 100644
--- a/src/video_core/shader/shader_ir.cpp
+++ b/src/video_core/shader/shader_ir.cpp
@@ -388,12 +388,12 @@ void ShaderIR::SetInternalFlagsFromInteger(NodeBlock& bb, Node value, bool sets_
return;
}
switch (value->index()) {
- case 0:
+ case 0: // Operation Node
Iterop(bb, value);
break;
- case 2:
+ case 2: // Genral Purpose Node
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),
Immediate(gpr->GetIndex()));
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) {
- if (const auto op = std::get_if<OperationNode>(var.get())) {
- if (op->GetOperandsCount() > 0) {
- for (auto& opss : op->GetOperands()) {
- switch (opss->index()) {
- case 0:
- return Iterop(nb, opss);
- case 2:
- 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),
- Immediate(gpr->GetIndex()));
- SetInternalFlag(nb, InternalFlag::Zero, std::move(zerop));
- }
- break;
- default:
- LOG_WARNING(HW_GPU, "Child Node Type: {}", opss->index());
- break;
- }
+void ShaderIR::SearchOperands(NodeBlock& nb, Node var) {
+ const auto* op = std::get_if<OperationNode>(var.get());
+ if (op == nullptr) {
+ return;
+ }
+
+ if (op->GetOperandsCount() == 0) {
+ return;
+ }
+
+ for (auto& operand : op->GetOperands()) {
+ switch (operand->index()) {
+ case 0: // Operation Node
+ return Iterop(nb, operand);
+ case 2: // General Purpose Node
+ if (const auto* gpr = std::get_if<GprNode>(operand.get())) {
+ LOG_DEBUG(HW_GPU, "Child GprNode: index={}", gpr->GetIndex());
+ 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;
}
}
}