diff --git a/rpcs3/Emu/RSX/Common/GLSLCommon.h b/rpcs3/Emu/RSX/Common/GLSLCommon.h index 180efc0e11..ae37fdbe49 100644 --- a/rpcs3/Emu/RSX/Common/GLSLCommon.h +++ b/rpcs3/Emu/RSX/Common/GLSLCommon.h @@ -1,6 +1,7 @@ #pragma once #include +#include "GLSLTypes.h" #include "ShaderParam.h" namespace program_common @@ -132,19 +133,6 @@ namespace program_common namespace glsl { - enum program_domain - { - glsl_vertex_program = 0, - glsl_fragment_program = 1, - glsl_compute_program = 2 - }; - - enum glsl_rules - { - glsl_rules_opengl4, - glsl_rules_rpirv - }; - static std::string getFloatTypeNameImpl(size_t elementCount) { switch (elementCount) @@ -500,20 +488,6 @@ namespace glsl " ocol3 = " << reg3 << ";\n\n"; } - struct shader_properties - { - glsl::program_domain domain; - // Applicable in vertex stage - bool require_lit_emulation; - - // Only relevant for fragment programs - bool require_wpos; - bool require_depth_conversion; - bool require_texture_ops; - bool emulate_shadow_compare; - bool low_precision_tests; - }; - static void insert_glsl_legacy_function(std::ostream& OS, const shader_properties& props) { OS << "#define _select mix\n"; diff --git a/rpcs3/Emu/RSX/Common/GLSLTypes.h b/rpcs3/Emu/RSX/Common/GLSLTypes.h new file mode 100644 index 0000000000..aca7ddf181 --- /dev/null +++ b/rpcs3/Emu/RSX/Common/GLSLTypes.h @@ -0,0 +1,31 @@ +#pragma once + +namespace glsl +{ + enum program_domain + { + glsl_vertex_program = 0, + glsl_fragment_program = 1, + glsl_compute_program = 2 + }; + + enum glsl_rules + { + glsl_rules_opengl4, + glsl_rules_spirv + }; + + struct shader_properties + { + glsl::program_domain domain; + // Applicable in vertex stage + bool require_lit_emulation; + + // Only relevant for fragment programs + bool require_wpos; + bool require_depth_conversion; + bool require_texture_ops; + bool emulate_shadow_compare; + bool low_precision_tests; + }; +}; diff --git a/rpcs3/Emu/RSX/VK/VKCommonDecompiler.h b/rpcs3/Emu/RSX/VK/VKCommonDecompiler.h index a8a0d5c0fa..6cafc88755 100644 --- a/rpcs3/Emu/RSX/VK/VKCommonDecompiler.h +++ b/rpcs3/Emu/RSX/VK/VKCommonDecompiler.h @@ -1,6 +1,6 @@ #pragma once #include "../Common/ShaderParam.h" -#include "../Common/GLSLCommon.h" +#include "../Common/GLSLTypes.h" namespace vk { diff --git a/rpcs3/Emu/RSX/VK/VKFragmentProgram.cpp b/rpcs3/Emu/RSX/VK/VKFragmentProgram.cpp index 2bd95917ca..8b2582a2cb 100644 --- a/rpcs3/Emu/RSX/VK/VKFragmentProgram.cpp +++ b/rpcs3/Emu/RSX/VK/VKFragmentProgram.cpp @@ -2,9 +2,9 @@ #include "Emu/Memory/vm.h" #include "Emu/System.h" #include "VKFragmentProgram.h" - #include "VKCommonDecompiler.h" #include "VKHelpers.h" +#include "../Common/GLSLCommon.h" #include "../GCM.h" std::string VKFragmentDecompilerThread::getFloatTypeName(size_t elementCount) diff --git a/rpcs3/Emu/RSX/VK/VKVertexProgram.cpp b/rpcs3/Emu/RSX/VK/VKVertexProgram.cpp index 197e970575..96beb21b16 100644 --- a/rpcs3/Emu/RSX/VK/VKVertexProgram.cpp +++ b/rpcs3/Emu/RSX/VK/VKVertexProgram.cpp @@ -4,6 +4,7 @@ #include "VKVertexProgram.h" #include "VKCommonDecompiler.h" #include "VKHelpers.h" +#include "../Common/GLSLCommon.h" std::string VKVertexDecompilerThread::getFloatTypeName(size_t elementCount) { @@ -205,7 +206,7 @@ void VKVertexDecompilerThread::insertMainStart(std::stringstream & OS) properties2.low_precision_tests = false; glsl::insert_glsl_legacy_function(OS, properties2); - glsl::insert_vertex_input_fetch(OS, glsl::glsl_rules_rpirv); + glsl::insert_vertex_input_fetch(OS, glsl::glsl_rules_spirv); std::string parameters = ""; for (int i = 0; i < 16; ++i)