diff options
| author | Fernando Sahmkow <fsahmkow27@gmail.com> | 2019-12-30 13:54:53 -0400 |
|---|---|---|
| committer | FernandoS27 <fsahmkow27@gmail.com> | 2019-12-30 15:31:48 -0400 |
| commit | b3371ed09e6866e235141119f9eecc2bb962dc8d (patch) | |
| tree | 06619df9bd72cc0d73a3869b040b20804e2d3109 /src/video_core/shader/shader_ir.cpp | |
| parent | f846e3d6d0e973485a53bb87b913059060dcfdbc (diff) | |
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.
Diffstat (limited to 'src/video_core/shader/shader_ir.cpp')
| -rw-r--r-- | src/video_core/shader/shader_ir.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
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<u32>(amend_code.size()); + amend_code.push_back(new_amend); + return id; +} + } // namespace VideoCommon::Shader |
