VERY experimental Nintendo Switch 2 emulator
C++
shader_ir/other: Implement S2R InvocationId
ReinUsesLisp72b999d78955
diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cppindex 3d3cd21f30..9700c2ebef 100644--- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp+++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp@@ -1915,6 +1915,10 @@ private:return {};}+ Expression InvocationId(Operation operation) {+ return {"gl_InvocationID", Type::Int};+ }+Expression YNegate(Operation operation) {return {"y_direction", Type::Float};}@@ -2153,6 +2157,7 @@ private:&GLSLDecompiler::EmitVertex,&GLSLDecompiler::EndPrimitive,+ &GLSLDecompiler::InvocationId,&GLSLDecompiler::YNegate,&GLSLDecompiler::LocalInvocationId<0>,&GLSLDecompiler::LocalInvocationId<1>,diff --git a/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp b/src/video_core/renderer_vulkan/vk_shader_decompiler.cppindex 8f517bdc15..6632936329 100644--- a/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp+++ b/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp@@ -2357,6 +2357,7 @@ private:&SPIRVDecompiler::EmitVertex,&SPIRVDecompiler::EndPrimitive,+ &SPIRVDecompiler::InvocationId,&SPIRVDecompiler::YNegate,&SPIRVDecompiler::LocalInvocationId<0>,&SPIRVDecompiler::LocalInvocationId<1>,diff --git a/src/video_core/shader/decode/other.cpp b/src/video_core/shader/decode/other.cppindex 17cd45d3c6..5c802886b6 100644--- a/src/video_core/shader/decode/other.cpp+++ b/src/video_core/shader/decode/other.cpp@@ -69,6 +69,8 @@ u32 ShaderIR::DecodeOther(NodeBlock& bb, u32 pc) {case OpCode::Id::MOV_SYS: {const Node value = [this, instr] {switch (instr.sys20) {+ case SystemVariable::InvocationId:+ return Operation(OperationCode::InvocationId);case SystemVariable::Ydirection:return Operation(OperationCode::YNegate);case SystemVariable::InvocationInfo:diff --git a/src/video_core/shader/node.h b/src/video_core/shader/node.hindex 8f4811c889..1a4d28ae90 100644--- a/src/video_core/shader/node.h+++ b/src/video_core/shader/node.h@@ -172,6 +172,7 @@ enum class OperationCode {EmitVertex, /// () -> voidEndPrimitive, /// () -> void+ InvocationId, /// () -> intYNegate, /// () -> floatLocalInvocationIdX, /// () -> uintLocalInvocationIdY, /// () -> uint