From 2f87fd060d6bed70fb90d97f8c847a0bd03d4c43 Mon Sep 17 00:00:00 2001 From: ReinUsesLisp Date: Thu, 20 Dec 2018 22:49:59 -0300 Subject: shader_ir: Add internal flag getters --- src/video_core/shader/shader_ir.cpp | 8 ++++++++ src/video_core/shader/shader_ir.h | 2 ++ 2 files changed, 10 insertions(+) (limited to 'src/video_core') diff --git a/src/video_core/shader/shader_ir.cpp b/src/video_core/shader/shader_ir.cpp index 0c814fc80..62a139e56 100644 --- a/src/video_core/shader/shader_ir.cpp +++ b/src/video_core/shader/shader_ir.cpp @@ -109,6 +109,14 @@ Node ShaderIR::GetOutputAttribute(Attribute::Index index, u64 element, Node buff return StoreNode(AbufNode(index, static_cast(element), buffer)); } +Node ShaderIR::GetInternalFlag(InternalFlag flag, bool negated) { + const Node node = StoreNode(InternalFlagNode(flag)); + if (negated) { + return Operation(OperationCode::LogicalNegate, node); + } + return node; +} + /*static*/ OperationCode ShaderIR::SignedToUnsignedCode(OperationCode operation_code, bool is_signed) { if (is_signed) { diff --git a/src/video_core/shader/shader_ir.h b/src/video_core/shader/shader_ir.h index fde1594aa..d839d1f1b 100644 --- a/src/video_core/shader/shader_ir.h +++ b/src/video_core/shader/shader_ir.h @@ -629,6 +629,8 @@ private: const Tegra::Shader::IpaMode& input_mode, Node buffer = {}); /// Generates a node representing an output atttribute. 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); template inline Node Operation(OperationCode code, const T*... operands) { -- cgit v1.2.3