vk_shader_compiler: Implement the decompiler in SPIR-V

This commit is contained in:
Fernando Sahmkow 2019-08-25 15:32:00 -04:00 committed by FernandoS27
parent 0366c18d87
commit ca9901867e
3 changed files with 301 additions and 23 deletions

View file

@ -205,13 +205,29 @@ public:
return nullptr;
}
void MarkLabelUnused() const {
void MarkLabelUnused() {
auto inner = std::get_if<ASTLabel>(&data);
if (inner) {
inner->unused = true;
}
}
bool IsLabelUnused() const {
auto inner = std::get_if<ASTLabel>(&data);
if (inner) {
return inner->unused;
}
return true;
}
u32 GetLabelIndex() const {
auto inner = std::get_if<ASTLabel>(&data);
if (inner) {
return inner->index;
}
return -1;
}
Expr GetIfCondition() const {
auto inner = std::get_if<ASTIfThen>(&data);
if (inner) {
@ -336,6 +352,10 @@ public:
return variables;
}
const std::vector<ASTNode>& GetLabels() const {
return labels;
}
private:
bool IsBackwardsJump(ASTNode goto_node, ASTNode label_node) const;