From 9c28abafad1f13a3a75f1b2002c3b4603dce77fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Thu, 7 Feb 2019 17:49:47 -0800 Subject: [PATCH] Cleanup. --- include/bx/inline/rng.inl | 4 ++++ include/bx/inline/spscqueue.inl | 5 ++++- include/bx/macros.h | 6 +++++- include/bx/rng.h | 4 +--- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/include/bx/inline/rng.inl b/include/bx/inline/rng.inl index 5df2f84..4ac2970 100644 --- a/include/bx/inline/rng.inl +++ b/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++) diff --git a/include/bx/inline/spscqueue.inl b/include/bx/inline/spscqueue.inl index 16dd96c..94c05d8 100644 --- a/include/bx/inline/spscqueue.inl +++ b/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) ) diff --git a/include/bx/macros.h b/include/bx/macros.h index 4e428a0..7a9b643 100644 --- a/include/bx/macros.h +++ b/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__) diff --git a/include/bx/rng.h b/include/bx/rng.h index 083bb33..5469b5e 100644 --- a/include/bx/rng.h +++ b/include/bx/rng.h @@ -67,9 +67,7 @@ namespace bx template 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.