summaryrefslogtreecommitdiffstats
path: root/src/video_core/shader/shader_ir.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/shader_ir.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/shader_ir.h')
-rw-r--r--src/video_core/shader/shader_ir.h25
1 files changed, 17 insertions, 8 deletions
diff --git a/src/video_core/shader/shader_ir.h b/src/video_core/shader/shader_ir.h
index a91cd7d67..48c7b722e 100644
--- a/src/video_core/shader/shader_ir.h
+++ b/src/video_core/shader/shader_ir.h
@@ -15,8 +15,8 @@
#include "video_core/engines/maxwell_3d.h"
#include "video_core/engines/shader_bytecode.h"
#include "video_core/engines/shader_header.h"
-#include "video_core/shader/node.h"
#include "video_core/shader/ast.h"
+#include "video_core/shader/node.h"
namespace VideoCommon::Shader {
@@ -141,15 +141,27 @@ public:
return header;
}
- bool IsFlowStackDisabled() const {
- return disable_flow_stack;
+ bool IsDecompiled() const {
+ return decompiled;
+ }
+
+ ASTNode GetASTProgram() const {
+ return program_manager.GetProgram();
+ }
+
+ u32 GetASTNumVariables() const {
+ return program_manager.GetVariables();
}
u32 ConvertAddressToNvidiaSpace(const u32 address) const {
return (address - main_offset) * sizeof(Tegra::Shader::Instruction);
}
+ /// Returns a condition code evaluated from internal flags
+ Node GetConditionCode(Tegra::Shader::ConditionCode cc) const;
+
private:
+ friend class ASTDecoder;
void Decode();
NodeBlock DecodeRange(u32 begin, u32 end);
@@ -214,7 +226,7 @@ private:
/// Generates a node representing an output attribute. Keeps track of used attributes.
Node GetOutputAttribute(Tegra::Shader::Attribute::Index index, u64 element, Node buffer);
/// Generates a node representing an internal flag
- Node GetInternalFlag(InternalFlag flag, bool negated = false);
+ Node GetInternalFlag(InternalFlag flag, bool negated = false) const;
/// Generates a node representing a local memory address
Node GetLocalMemory(Node address);
/// Generates a node representing a shared memory address
@@ -272,9 +284,6 @@ private:
/// Returns a predicate combiner operation
OperationCode GetPredicateCombiner(Tegra::Shader::PredOperation operation);
- /// Returns a condition code evaluated from internal flags
- Node GetConditionCode(Tegra::Shader::ConditionCode cc);
-
/// Accesses a texture sampler
const Sampler& GetSampler(const Tegra::Shader::Sampler& sampler,
Tegra::Shader::TextureType type, bool is_array, bool is_shadow);
@@ -358,7 +367,7 @@ private:
const ProgramCode& program_code;
const u32 main_offset;
const std::size_t program_size;
- bool disable_flow_stack{};
+ bool decompiled{};
u32 coverage_begin{};
u32 coverage_end{};