Sfoglia il codice sorgente

Added getter for job name (#695)

Related to godot-jolt/godot-jolt#507.

This adds a JobSystem::Job::GetName method for getting the job name.
Mikael Hermansson 1 anno fa
parent
commit
577c849204
1 ha cambiato i file con 5 aggiunte e 0 eliminazioni
  1. 5 0
      Jolt/Core/JobSystem.h

+ 5 - 0
Jolt/Core/JobSystem.h

@@ -266,6 +266,11 @@ protected:
 		/// Test if the job finished executing
 		inline bool			IsDone() const								{ return mNumDependencies.load(memory_order_relaxed) == cDoneState; }
 
+	#if defined(JPH_EXTERNAL_PROFILE) || defined(JPH_PROFILE_ENABLED)
+		/// Get the name of the job
+		const char *		GetName() const								{ return mJobName; }
+	#endif // defined(JPH_EXTERNAL_PROFILE) || defined(JPH_PROFILE_ENABLED)
+
 		static constexpr uint32 cExecutingState = 0xe0e0e0e0;			///< Value of mNumDependencies when job is executing
 		static constexpr uint32 cDoneState		= 0xd0d0d0d0;			///< Value of mNumDependencies when job is done executing