This commit is contained in:
Бранимир Караџић
2019-02-07 17:49:47 -08:00
parent cf8b4725e1
commit 9c28abafad
4 changed files with 14 additions and 5 deletions

View File

@@ -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++)

View File

@@ -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) )

View File

@@ -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__)

View File

@@ -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.