From 9c3461604cff25ef11ecb6937f904eac37090ee7 Mon Sep 17 00:00:00 2001 From: ReinUsesLisp Date: Fri, 3 May 2019 03:00:51 -0300 Subject: shader: Implement S2R Tid{XYZ} and CtaId{XYZ} --- src/video_core/renderer_opengl/gl_shader_decompiler.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/video_core/renderer_opengl') diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp index 713eded6d..d437afad1 100644 --- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp +++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp @@ -1513,6 +1513,16 @@ private: return "uintBitsToFloat(config_pack[2])"; } + template + std::string LocalInvocationId(Operation) { + return "utof(gl_LocalInvocationID"s + GetSwizzle(element) + ')'; + } + + template + std::string WorkGroupId(Operation) { + return "utof(gl_WorkGroupID"s + GetSwizzle(element) + ')'; + } + static constexpr OperationDecompilersArray operation_decompilers = { &GLSLDecompiler::Assign, @@ -1652,6 +1662,12 @@ private: &GLSLDecompiler::EndPrimitive, &GLSLDecompiler::YNegate, + &GLSLDecompiler::LocalInvocationId<0>, + &GLSLDecompiler::LocalInvocationId<1>, + &GLSLDecompiler::LocalInvocationId<2>, + &GLSLDecompiler::WorkGroupId<0>, + &GLSLDecompiler::WorkGroupId<1>, + &GLSLDecompiler::WorkGroupId<2>, }; std::string GetRegister(u32 index) const { -- cgit v1.2.3