diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2019-07-12 02:14:44 +0200 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2019-07-22 21:16:10 +0200 |
commit | 104641db07d04cd32bc83986e2ea05711fab3b5f (patch) | |
tree | 6d113ada45986a54f23da1ef5324122069c31c1b /src | |
parent | Merge pull request #2734 from ReinUsesLisp/compute-shaders (diff) | |
download | yuzu-104641db07d04cd32bc83986e2ea05711fab3b5f.tar yuzu-104641db07d04cd32bc83986e2ea05711fab3b5f.tar.gz yuzu-104641db07d04cd32bc83986e2ea05711fab3b5f.tar.bz2 yuzu-104641db07d04cd32bc83986e2ea05711fab3b5f.tar.lz yuzu-104641db07d04cd32bc83986e2ea05711fab3b5f.tar.xz yuzu-104641db07d04cd32bc83986e2ea05711fab3b5f.tar.zst yuzu-104641db07d04cd32bc83986e2ea05711fab3b5f.zip |
Diffstat (limited to 'src')
-rw-r--r-- | src/video_core/shader/decode/other.cpp | 7 | ||||
-rw-r--r-- | src/video_core/shader/shader_ir.cpp | 5 | ||||
-rw-r--r-- | src/video_core/shader/shader_ir.h | 3 |
3 files changed, 15 insertions, 0 deletions
diff --git a/src/video_core/shader/decode/other.cpp b/src/video_core/shader/decode/other.cpp index c0f64d7a0..856e1b3d8 100644 --- a/src/video_core/shader/decode/other.cpp +++ b/src/video_core/shader/decode/other.cpp @@ -68,6 +68,13 @@ u32 ShaderIR::DecodeOther(NodeBlock& bb, u32 pc) { case SystemVariable::InvocationInfo: LOG_WARNING(HW_GPU, "MOV_SYS instruction with InvocationInfo is incomplete"); return Immediate(0u); + case SystemVariable::Tid: { + Node value = Immediate(0); + value = BitfieldInsert(value, Operation(OperationCode::LocalInvocationIdX), 0, 9); + value = BitfieldInsert(value, Operation(OperationCode::LocalInvocationIdY), 16, 9); + value = BitfieldInsert(value, Operation(OperationCode::LocalInvocationIdZ), 26, 5); + return value; + } case SystemVariable::TidX: return Operation(OperationCode::LocalInvocationIdX); case SystemVariable::TidY: diff --git a/src/video_core/shader/shader_ir.cpp b/src/video_core/shader/shader_ir.cpp index 5e91fe129..1e5c7f660 100644 --- a/src/video_core/shader/shader_ir.cpp +++ b/src/video_core/shader/shader_ir.cpp @@ -405,4 +405,9 @@ Node ShaderIR::BitfieldExtract(Node value, u32 offset, u32 bits) { Immediate(offset), Immediate(bits)); } +Node ShaderIR::BitfieldInsert(Node base, Node insert, u32 offset, u32 bits) { + return Operation(OperationCode::UBitfieldInsert, NO_PRECISE, base, insert, Immediate(offset), + Immediate(bits)); +} + } // namespace VideoCommon::Shader diff --git a/src/video_core/shader/shader_ir.h b/src/video_core/shader/shader_ir.h index 59a083d90..0509a5f88 100644 --- a/src/video_core/shader/shader_ir.h +++ b/src/video_core/shader/shader_ir.h @@ -279,6 +279,9 @@ private: /// Extracts a sequence of bits from a node Node BitfieldExtract(Node value, u32 offset, u32 bits); + /// Inserts a sequence of bits from a node + Node BitfieldInsert(Node base, Node insert, u32 offset, u32 bits); + void WriteTexInstructionFloat(NodeBlock& bb, Tegra::Shader::Instruction instr, const Node4& components); |