From b3371ed09e6866e235141119f9eecc2bb962dc8d Mon Sep 17 00:00:00 2001 From: Fernando Sahmkow Date: Mon, 30 Dec 2019 13:54:53 -0400 Subject: Shader_IR: add the ability to amend code in the shader ir. This commit introduces a mechanism by which shader IR code can be amended and extended. This useful for track algorithms where certain information can derived from before the track such as indexes to array samplers. --- src/video_core/shader/shader_ir.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/video_core/shader/shader_ir.cpp') diff --git a/src/video_core/shader/shader_ir.cpp b/src/video_core/shader/shader_ir.cpp index 1d9825c76..49678767c 100644 --- a/src/video_core/shader/shader_ir.cpp +++ b/src/video_core/shader/shader_ir.cpp @@ -446,4 +446,10 @@ Node ShaderIR::BitfieldInsert(Node base, Node insert, u32 offset, u32 bits) { Immediate(bits)); } +u32 ShaderIR::DeclareAmend(Node new_amend) { + const u32 id = static_cast(amend_code.size()); + amend_code.push_back(new_amend); + return id; +} + } // namespace VideoCommon::Shader -- cgit v1.2.3