mirror of
				https://github.com/PabloMK7/citra.git
				synced 2025-10-31 05:40:04 +00:00 
			
		
		
		
	build: Update to support multi-arch builds.
This commit is contained in:
		
							parent
							
								
									0e325255f3
								
							
						
					
					
						commit
						a8848cce43
					
				
					 25 changed files with 114 additions and 66 deletions
				
			
		|  | @ -87,6 +87,10 @@ add_library(video_core STATIC | |||
|     shader/shader.h | ||||
|     shader/shader_interpreter.cpp | ||||
|     shader/shader_interpreter.h | ||||
|     shader/shader_jit_x64.cpp | ||||
|     shader/shader_jit_x64_compiler.cpp | ||||
|     shader/shader_jit_x64.h | ||||
|     shader/shader_jit_x64_compiler.h | ||||
|     swrasterizer/clipper.cpp | ||||
|     swrasterizer/clipper.h | ||||
|     swrasterizer/framebuffer.cpp | ||||
|  | @ -144,24 +148,13 @@ add_dependencies(video_core shaders) | |||
| 
 | ||||
| target_include_directories(video_core PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) | ||||
| 
 | ||||
| if(ARCHITECTURE_x86_64) | ||||
|     target_sources(video_core | ||||
|         PRIVATE | ||||
|             shader/shader_jit_x64.cpp | ||||
|             shader/shader_jit_x64_compiler.cpp | ||||
| 
 | ||||
|             shader/shader_jit_x64.h | ||||
|             shader/shader_jit_x64_compiler.h | ||||
|     ) | ||||
| endif() | ||||
| 
 | ||||
| create_target_directory_groups(video_core) | ||||
| 
 | ||||
| target_link_libraries(video_core PUBLIC common core) | ||||
| target_link_libraries(video_core PRIVATE glad nihstro-headers Boost::serialization) | ||||
| set_target_properties(video_core PROPERTIES INTERPROCEDURAL_OPTIMIZATION ${ENABLE_LTO}) | ||||
| 
 | ||||
| if (ARCHITECTURE_x86_64) | ||||
| if ("x86_64" IN_LIST ARCHITECTURE) | ||||
|     target_link_libraries(video_core PUBLIC xbyak) | ||||
| endif() | ||||
| 
 | ||||
|  |  | |||
|  | @ -4,6 +4,7 @@ | |||
| 
 | ||||
| #include <cmath> | ||||
| #include <cstring> | ||||
| #include "common/arch.h" | ||||
| #include "common/bit_set.h" | ||||
| #include "common/logging/log.h" | ||||
| #include "common/microprofile.h" | ||||
|  | @ -12,9 +13,9 @@ | |||
| #include "video_core/regs_shader.h" | ||||
| #include "video_core/shader/shader.h" | ||||
| #include "video_core/shader/shader_interpreter.h" | ||||
| #ifdef ARCHITECTURE_x86_64 | ||||
| #if CITRA_ARCH(x86_64) | ||||
| #include "video_core/shader/shader_jit_x64.h" | ||||
| #endif // ARCHITECTURE_x86_64
 | ||||
| #endif // CITRA_ARCH(x86_64)
 | ||||
| #include "video_core/video_core.h" | ||||
| 
 | ||||
| namespace Pica::Shader { | ||||
|  | @ -134,13 +135,13 @@ void GSUnitState::ConfigOutput(const ShaderRegs& config) { | |||
| 
 | ||||
| MICROPROFILE_DEFINE(GPU_Shader, "GPU", "Shader", MP_RGB(50, 50, 240)); | ||||
| 
 | ||||
| #ifdef ARCHITECTURE_x86_64 | ||||
| #if CITRA_ARCH(x86_64) | ||||
| static std::unique_ptr<JitX64Engine> jit_engine; | ||||
| #endif // ARCHITECTURE_x86_64
 | ||||
| #endif // CITRA_ARCH(x86_64)
 | ||||
| static InterpreterEngine interpreter_engine; | ||||
| 
 | ||||
| ShaderEngine* GetEngine() { | ||||
| #ifdef ARCHITECTURE_x86_64 | ||||
| #if CITRA_ARCH(x86_64) | ||||
|     // TODO(yuriks): Re-initialize on each change rather than being persistent
 | ||||
|     if (VideoCore::g_shader_jit_enabled) { | ||||
|         if (jit_engine == nullptr) { | ||||
|  | @ -148,15 +149,15 @@ ShaderEngine* GetEngine() { | |||
|         } | ||||
|         return jit_engine.get(); | ||||
|     } | ||||
| #endif // ARCHITECTURE_x86_64
 | ||||
| #endif // CITRA_ARCH(x86_64)
 | ||||
| 
 | ||||
|     return &interpreter_engine; | ||||
| } | ||||
| 
 | ||||
| void Shutdown() { | ||||
| #ifdef ARCHITECTURE_x86_64 | ||||
| #if CITRA_ARCH(x86_64) | ||||
|     jit_engine = nullptr; | ||||
| #endif // ARCHITECTURE_x86_64
 | ||||
| #endif // CITRA_ARCH(x86_64)
 | ||||
| } | ||||
| 
 | ||||
| } // namespace Pica::Shader
 | ||||
|  |  | |||
|  | @ -2,6 +2,9 @@ | |||
| // Licensed under GPLv2 or any later version
 | ||||
| // Refer to the license.txt file included.
 | ||||
| 
 | ||||
| #include "common/arch.h" | ||||
| #if CITRA_ARCH(x86_64) | ||||
| 
 | ||||
| #include "common/microprofile.h" | ||||
| #include "video_core/shader/shader.h" | ||||
| #include "video_core/shader/shader_jit_x64.h" | ||||
|  | @ -43,3 +46,5 @@ void JitX64Engine::Run(const ShaderSetup& setup, UnitState& state) const { | |||
| } | ||||
| 
 | ||||
| } // namespace Pica::Shader
 | ||||
| 
 | ||||
| #endif // CITRA_ARCH(x86_64)
 | ||||
|  |  | |||
|  | @ -4,6 +4,9 @@ | |||
| 
 | ||||
| #pragma once | ||||
| 
 | ||||
| #include "common/arch.h" | ||||
| #if CITRA_ARCH(x86_64) | ||||
| 
 | ||||
| #include <memory> | ||||
| #include <unordered_map> | ||||
| #include "common/common_types.h" | ||||
|  | @ -26,3 +29,5 @@ private: | |||
| }; | ||||
| 
 | ||||
| } // namespace Pica::Shader
 | ||||
| 
 | ||||
| #endif // CITRA_ARCH(x86_64)
 | ||||
|  |  | |||
|  | @ -2,6 +2,9 @@ | |||
| // Licensed under GPLv2 or any later version
 | ||||
| // Refer to the license.txt file included.
 | ||||
| 
 | ||||
| #include "common/arch.h" | ||||
| #if CITRA_ARCH(x86_64) | ||||
| 
 | ||||
| #include <algorithm> | ||||
| #include <cmath> | ||||
| #include <cstdint> | ||||
|  | @ -1131,3 +1134,5 @@ Xbyak::Label JitShader::CompilePrelude_Exp2() { | |||
| } | ||||
| 
 | ||||
| } // namespace Pica::Shader
 | ||||
| 
 | ||||
| #endif // CITRA_ARCH(x86_64)
 | ||||
|  |  | |||
|  | @ -4,6 +4,9 @@ | |||
| 
 | ||||
| #pragma once | ||||
| 
 | ||||
| #include "common/arch.h" | ||||
| #if CITRA_ARCH(x86_64) | ||||
| 
 | ||||
| #include <array> | ||||
| #include <bitset> | ||||
| #include <cstddef> | ||||
|  | @ -138,3 +141,5 @@ private: | |||
| }; | ||||
| 
 | ||||
| } // namespace Pica::Shader
 | ||||
| 
 | ||||
| #endif | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue