diff options
| author | bunnei <bunneidev@gmail.com> | 2019-08-29 12:58:43 -0400 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-08-29 12:58:43 -0400 | 
| commit | f8cc5668f80d0c63f5ce850286760807462e1d72 (patch) | |
| tree | 8856d97bfb22f9cc9c726e7020de051a9deef178 /src/video_core | |
| parent | 680ab6132726946435081df6c4f2ef01ec2f1691 (diff) | |
| parent | 104641db07d04cd32bc83986e2ea05711fab3b5f (diff) | |
Merge pull request #2758 from ReinUsesLisp/packed-tid
shader/decode: Implement S2R Tic
Diffstat (limited to 'src/video_core')
| -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 ac0e764d6..d46e0f823 100644 --- a/src/video_core/shader/decode/other.cpp +++ b/src/video_core/shader/decode/other.cpp @@ -74,6 +74,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 99d06ff4a..bcc9b79b6 100644 --- a/src/video_core/shader/shader_ir.h +++ b/src/video_core/shader/shader_ir.h @@ -280,6 +280,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); | 
