Бранимир Караџић 6 лет назад
Родитель
Сommit
9c28abafad
4 измененных файлов с 14 добавлено и 5 удалено
  1. 4 0
      include/bx/inline/rng.inl
  2. 4 1
      include/bx/inline/spscqueue.inl
  3. 5 1
      include/bx/macros.h
  4. 1 3
      include/bx/rng.h

+ 4 - 0
include/bx/inline/rng.inl

@@ -103,6 +103,10 @@ namespace bx
 
 	inline void generateSphereHammersley(void* _data, uint32_t _stride, uint32_t _num, float _scale)
 	{
+		// Reference(s):
+		// - Sampling with Hammersley and Halton Points
+		//   https://web.archive.org/web/20190207230709/http://www.cse.cuhk.edu.hk/~ttwong/papers/udpoint/udpoints.html
+
 		uint8_t* data = (uint8_t*)_data;
 
 		for (uint32_t ii = 0; ii < _num; ii++)

+ 4 - 1
include/bx/inline/spscqueue.inl

@@ -9,7 +9,10 @@
 
 namespace bx
 {
-	// http://drdobbs.com/article/print?articleId=210604448&siteSectionName=
+	// Reference(s):
+	// - Writing Lock-Free Code: A Corrected Queue
+	//   https://web.archive.org/web/20190207230604/http://www.drdobbs.com/parallel/writing-lock-free-code-a-corrected-queue/210604448
+	//
 	inline SpScUnboundedQueue::SpScUnboundedQueue(AllocatorI* _allocator)
 		: m_allocator(_allocator)
 		, m_first(BX_NEW(m_allocator, Node)(NULL) )

+ 5 - 1
include/bx/macros.h

@@ -115,7 +115,11 @@
 
 /// The return value of the function is solely a function of the arguments.
 ///
-#define BX_CONSTEXPR_FUNC constexpr BX_CONST_FUNC
+#if BX_COMPILER_MSVC && (BX_COMPILER_MSVC <= 1900)
+#	define BX_CONSTEXPR_FUNC BX_CONST_FUNC
+#else
+#	define BX_CONSTEXPR_FUNC constexpr BX_CONST_FUNC
+#endif // BX_COMPILER_MSVC && (BX_COMPILER_MSVC <= 1900)
 
 ///
 #define BX_STATIC_ASSERT(_condition, ...) static_assert(_condition, "" __VA_ARGS__)

+ 1 - 3
include/bx/rng.h

@@ -67,9 +67,7 @@ namespace bx
 	template <typename Ty>
 	bx::Vec3 randUnitHemisphere(Ty* _rng, const bx::Vec3& _normal);
 
-	/// Sampling with Hammersley and Halton Points
-	/// http://www.cse.cuhk.edu.hk/~ttwong/papers/udpoint/udpoints.html
-	///
+	/// Sampling with Hammersley and Halton Points.
 	void generateSphereHammersley(void* _data, uint32_t _stride, uint32_t _num, float _scale = 1.0f);
 
 	/// Fisher-Yates shuffle.