summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2019-10-30 22:17:27 +0100
committerReinUsesLisp <reinuseslisp@airmail.cc>2019-12-10 03:52:28 +0100
commit0b5b93053d5f427c668a2494c52adfd468cf5728 (patch)
treeb850d080dce2c8f1c496c03a995b033fb2e4fad3
parentvk_shader_decompiler: Misc changes (diff)
downloadyuzu-0b5b93053d5f427c668a2494c52adfd468cf5728.tar
yuzu-0b5b93053d5f427c668a2494c52adfd468cf5728.tar.gz
yuzu-0b5b93053d5f427c668a2494c52adfd468cf5728.tar.bz2
yuzu-0b5b93053d5f427c668a2494c52adfd468cf5728.tar.lz
yuzu-0b5b93053d5f427c668a2494c52adfd468cf5728.tar.xz
yuzu-0b5b93053d5f427c668a2494c52adfd468cf5728.tar.zst
yuzu-0b5b93053d5f427c668a2494c52adfd468cf5728.zip
-rw-r--r--src/video_core/renderer_opengl/gl_shader_decompiler.cpp5
-rw-r--r--src/video_core/renderer_vulkan/vk_shader_decompiler.cpp1
-rw-r--r--src/video_core/shader/decode/other.cpp2
-rw-r--r--src/video_core/shader/node.h1
4 files changed, 9 insertions, 0 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
index 3d3cd21f3..9700c2ebe 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.cpp
index 8f517bdc1..663293632 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.cpp
index 17cd45d3c..5c802886b 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.h
index 8f4811c88..1a4d28ae9 100644
--- a/src/video_core/shader/node.h
+++ b/src/video_core/shader/node.h
@@ -172,6 +172,7 @@ enum class OperationCode {
EmitVertex, /// () -> void
EndPrimitive, /// () -> void
+ InvocationId, /// () -> int
YNegate, /// () -> float
LocalInvocationIdX, /// () -> uint
LocalInvocationIdY, /// () -> uint