summaryrefslogtreecommitdiffstats
path: root/src/video_core/shader/ast.h
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2019-06-29 07:44:07 +0200
committerFernandoS27 <fsahmkow27@gmail.com>2019-10-05 00:52:50 +0200
commit38fc995f6cc2c2af29abc976ddb45b72873b2cc4 (patch)
treea73839d510c79a5e296e54a6768868f788abd45d /src/video_core/shader/ast.h
parentshader_ir: Declare Manager and pass it to appropiate programs. (diff)
downloadyuzu-38fc995f6cc2c2af29abc976ddb45b72873b2cc4.tar
yuzu-38fc995f6cc2c2af29abc976ddb45b72873b2cc4.tar.gz
yuzu-38fc995f6cc2c2af29abc976ddb45b72873b2cc4.tar.bz2
yuzu-38fc995f6cc2c2af29abc976ddb45b72873b2cc4.tar.lz
yuzu-38fc995f6cc2c2af29abc976ddb45b72873b2cc4.tar.xz
yuzu-38fc995f6cc2c2af29abc976ddb45b72873b2cc4.tar.zst
yuzu-38fc995f6cc2c2af29abc976ddb45b72873b2cc4.zip
Diffstat (limited to 'src/video_core/shader/ast.h')
-rw-r--r--src/video_core/shader/ast.h18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/video_core/shader/ast.h b/src/video_core/shader/ast.h
index 958989bcd..06ab20cc5 100644
--- a/src/video_core/shader/ast.h
+++ b/src/video_core/shader/ast.h
@@ -141,8 +141,6 @@ public:
Expr condition;
};
-using TransformCallback = std::function<NodeBlock(u32 start, u32 end)>;
-
class ASTBase {
public:
explicit ASTBase(ASTNode parent, ASTData data) : parent{parent}, data{data} {}
@@ -233,11 +231,7 @@ public:
return std::holds_alternative<ASTBlockEncoded>(data);
}
- void TransformBlockEncoded(TransformCallback& callback) {
- auto block = std::get_if<ASTBlockEncoded>(&data);
- const u32 start = block->start;
- const u32 end = block->end;
- NodeBlock nodes = callback(start, end);
+ void TransformBlockEncoded(NodeBlock& nodes) {
data = ASTBlockDecoded(nodes);
}
@@ -309,16 +303,20 @@ public:
void SanityCheck();
- bool IsFullyDecompiled() {
+ bool IsFullyDecompiled() const {
return gotos.size() == 0;
}
- ASTNode GetProgram() {
+ ASTNode GetProgram() const {
return main_node;
}
void Clear();
+ u32 GetVariables() const {
+ return variables;
+ }
+
private:
bool IndirectlyRelated(ASTNode first, ASTNode second);
@@ -343,7 +341,7 @@ private:
u32 variables{};
ASTProgram* program{};
ASTNode main_node{};
- Expr true_condition{};
+ Expr false_condition{};
};
} // namespace VideoCommon::Shader