mirror of
				https://github.com/PabloMK7/citra.git
				synced 2025-10-31 05:40:04 +00:00 
			
		
		
		
	Serialize GSP service
This commit is contained in:
		
							parent
							
								
									754f63af1a
								
							
						
					
					
						commit
						30494c06a4
					
				
					 6 changed files with 37 additions and 2 deletions
				
			
		
							
								
								
									
										3
									
								
								TODO
									
										
									
									
									
								
							
							
						
						
									
										3
									
								
								TODO
									
										
									
									
									
								
							|  | @ -81,7 +81,8 @@ | |||
|         ✔ ERR @done(19-12-26 18:14) | ||||
|         ✔ FRD @done(19-12-26 19:09) | ||||
|         ✔ FS @done(19-12-27 11:46) | ||||
|         ☐ GSP | ||||
|         ✔ GSP @done(19-12-30 12:45) | ||||
|             ☐ Fix the global weak_ptr to gsp | ||||
|         ☐ HID | ||||
|         ☐ HTTP | ||||
|         ☐ IR | ||||
|  |  | |||
|  | @ -10,7 +10,7 @@ | |||
| 
 | ||||
| namespace Service::GSP { | ||||
| 
 | ||||
| static std::weak_ptr<GSP_GPU> gsp_gpu; | ||||
| static std::weak_ptr<GSP_GPU> gsp_gpu; // TODO: Fix this for the love of god
 | ||||
| 
 | ||||
| void SignalInterrupt(InterruptId interrupt_id) { | ||||
|     auto gpu = gsp_gpu.lock(); | ||||
|  |  | |||
|  | @ -3,6 +3,7 @@ | |||
| // Refer to the license.txt file included.
 | ||||
| 
 | ||||
| #include <vector> | ||||
| #include "common/archives.h" | ||||
| #include "common/bit_field.h" | ||||
| #include "common/microprofile.h" | ||||
| #include "common/swap.h" | ||||
|  | @ -21,6 +22,10 @@ | |||
| #include "video_core/debug_utils/debug_utils.h" | ||||
| #include "video_core/gpu_debugger.h" | ||||
| 
 | ||||
| SERIALIZE_EXPORT_IMPL(Service::GSP::SessionData) | ||||
| SERIALIZE_EXPORT_IMPL(Service::GSP::GSP_GPU) | ||||
| SERVICE_CONSTRUCT_IMPL(Service::GSP::GSP_GPU) | ||||
| 
 | ||||
| // Main graphics debugger object - TODO: Here is probably not the best place for this
 | ||||
| GraphicsDebugger g_debugger; | ||||
| 
 | ||||
|  |  | |||
|  | @ -199,6 +199,16 @@ public: | |||
|     u32 thread_id; | ||||
|     /// Whether RegisterInterruptRelayQueue was called for this session
 | ||||
|     bool registered = false; | ||||
| 
 | ||||
| private: | ||||
|     template <class Archive> | ||||
|     void serialize(Archive& ar, const unsigned int) { | ||||
|         ar& gsp; | ||||
|         ar& interrupt_event; | ||||
|         ar& thread_id; | ||||
|         ar& registered; | ||||
|     } | ||||
|     friend class boost::serialization::access; | ||||
| }; | ||||
| 
 | ||||
| class GSP_GPU final : public ServiceFramework<GSP_GPU, SessionData> { | ||||
|  | @ -431,8 +441,22 @@ private: | |||
|     std::array<bool, MaxGSPThreads> used_thread_ids = {false, false, false, false}; | ||||
| 
 | ||||
|     friend class SessionData; | ||||
| 
 | ||||
|     template <class Archive> | ||||
|     void serialize(Archive& ar, const unsigned int) { | ||||
|         ar& shared_memory; | ||||
|         ar& active_thread_id; | ||||
|         ar& first_initialization; | ||||
|         ar& used_thread_ids; | ||||
|     } | ||||
| 
 | ||||
|     friend class boost::serialization::access; | ||||
| }; | ||||
| 
 | ||||
| ResultCode SetBufferSwap(u32 screen_id, const FrameBufferInfo& info); | ||||
| 
 | ||||
| } // namespace Service::GSP
 | ||||
| 
 | ||||
| BOOST_CLASS_EXPORT_KEY(Service::GSP::SessionData) | ||||
| BOOST_CLASS_EXPORT_KEY(Service::GSP::GSP_GPU) | ||||
| SERVICE_CONSTRUCT(Service::GSP::GSP_GPU) | ||||
|  |  | |||
|  | @ -2,9 +2,12 @@ | |||
| // Licensed under GPLv2 or any later version
 | ||||
| // Refer to the license.txt file included.
 | ||||
| 
 | ||||
| #include "common/archives.h" | ||||
| #include "core/hle/ipc_helpers.h" | ||||
| #include "core/hle/service/gsp/gsp_lcd.h" | ||||
| 
 | ||||
| SERIALIZE_EXPORT_IMPL(Service::GSP::GSP_LCD) | ||||
| 
 | ||||
| namespace Service::GSP { | ||||
| 
 | ||||
| GSP_LCD::GSP_LCD() : ServiceFramework("gsp::Lcd") { | ||||
|  |  | |||
|  | @ -15,3 +15,5 @@ public: | |||
| }; | ||||
| 
 | ||||
| } // namespace Service::GSP
 | ||||
| 
 | ||||
| BOOST_CLASS_EXPORT_KEY(Service::GSP::GSP_LCD) | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue