aboutsummaryrefslogtreecommitdiff
path: root/sdk/globals/include
diff options
context:
space:
mode:
authorBryan Galdrikian <[email protected]>2018-05-31 11:36:08 -0700
committerBryan Galdrikian <[email protected]>2018-05-31 11:36:08 -0700
commit7115f60b91b5717d90f643fd692010905c7004db (patch)
treeeffd68c6978751c517d54c2f2bb5bb6e7dc93e18 /sdk/globals/include
parentUpdating BlastTool zip (diff)
downloadblast-1.1.3_rc1.tar.xz
blast-1.1.3_rc1.zip
Blast 1.1.3. See docs/release_notes.txt.v1.1.3_rc1
Diffstat (limited to 'sdk/globals/include')
-rwxr-xr-x[-rw-r--r--]sdk/globals/include/NvBlastAllocator.h138
-rwxr-xr-x[-rw-r--r--]sdk/globals/include/NvBlastDebugRender.h128
-rwxr-xr-x[-rw-r--r--]sdk/globals/include/NvBlastGlobals.h554
-rwxr-xr-x[-rw-r--r--]sdk/globals/include/NvBlastProfiler.h196
4 files changed, 508 insertions, 508 deletions
diff --git a/sdk/globals/include/NvBlastAllocator.h b/sdk/globals/include/NvBlastAllocator.h
index 5dfed5c..e8dc38e 100644..100755
--- a/sdk/globals/include/NvBlastAllocator.h
+++ b/sdk/globals/include/NvBlastAllocator.h
@@ -1,69 +1,69 @@
-// This code contains NVIDIA Confidential Information and is disclosed to you
-// under a form of NVIDIA software license agreement provided separately to you.
-//
-// Notice
-// NVIDIA Corporation and its licensors retain all intellectual property and
-// proprietary rights in and to this software and related documentation and
-// any modifications thereto. Any use, reproduction, disclosure, or
-// distribution of this software and related documentation without an express
-// license agreement from NVIDIA Corporation is strictly prohibited.
-//
-// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES
-// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
-// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT,
-// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// Information and code furnished is believed to be accurate and reliable.
-// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such
-// information or for any infringement of patents or other rights of third parties that may
-// result from its use. No license is granted by implication or otherwise under any patent
-// or patent rights of NVIDIA Corporation. Details are subject to change without notice.
-// This code supersedes and replaces all information previously supplied.
-// NVIDIA Corporation products are not authorized for use as critical
-// components in life support devices or systems without express written approval of
-// NVIDIA Corporation.
-//
-// Copyright (c) 2016-2018 NVIDIA Corporation. All rights reserved.
-
-
-#ifndef NVBLASTALLOCATOR_H
-#define NVBLASTALLOCATOR_H
-
-#include "NvBlastGlobals.h"
-
-/**
-This file contains AllocatorCallback wrappers compatible with PxShared containers.
-*/
-
-namespace Nv
-{
-namespace Blast
-{
-
-/**
-Allocator uses global AllocatorCallback.
-*/
-class Allocator
-{
-public:
- Allocator(const char* = 0)
- {
- }
-
- void* allocate(size_t size, const char* filename, int line)
- {
- return NvBlastGlobalGetAllocatorCallback()->allocate(size, nullptr, filename, line);
- }
-
- void deallocate(void* ptr)
- {
- NvBlastGlobalGetAllocatorCallback()->deallocate(ptr);
- }
-};
-
-
-} // namespace Blast
-} // namespace Nv
-
-
-#endif // #ifndef NVBLASTALLOCATOR_H
+// This code contains NVIDIA Confidential Information and is disclosed to you
+// under a form of NVIDIA software license agreement provided separately to you.
+//
+// Notice
+// NVIDIA Corporation and its licensors retain all intellectual property and
+// proprietary rights in and to this software and related documentation and
+// any modifications thereto. Any use, reproduction, disclosure, or
+// distribution of this software and related documentation without an express
+// license agreement from NVIDIA Corporation is strictly prohibited.
+//
+// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES
+// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
+// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT,
+// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.
+//
+// Information and code furnished is believed to be accurate and reliable.
+// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such
+// information or for any infringement of patents or other rights of third parties that may
+// result from its use. No license is granted by implication or otherwise under any patent
+// or patent rights of NVIDIA Corporation. Details are subject to change without notice.
+// This code supersedes and replaces all information previously supplied.
+// NVIDIA Corporation products are not authorized for use as critical
+// components in life support devices or systems without express written approval of
+// NVIDIA Corporation.
+//
+// Copyright (c) 2016-2018 NVIDIA Corporation. All rights reserved.
+
+
+#ifndef NVBLASTALLOCATOR_H
+#define NVBLASTALLOCATOR_H
+
+#include "NvBlastGlobals.h"
+
+/**
+This file contains AllocatorCallback wrappers compatible with PxShared containers.
+*/
+
+namespace Nv
+{
+namespace Blast
+{
+
+/**
+Allocator uses global AllocatorCallback.
+*/
+class Allocator
+{
+public:
+ Allocator(const char* = 0)
+ {
+ }
+
+ void* allocate(size_t size, const char* filename, int line)
+ {
+ return NvBlastGlobalGetAllocatorCallback()->allocate(size, nullptr, filename, line);
+ }
+
+ void deallocate(void* ptr)
+ {
+ NvBlastGlobalGetAllocatorCallback()->deallocate(ptr);
+ }
+};
+
+
+} // namespace Blast
+} // namespace Nv
+
+
+#endif // #ifndef NVBLASTALLOCATOR_H
diff --git a/sdk/globals/include/NvBlastDebugRender.h b/sdk/globals/include/NvBlastDebugRender.h
index 635a65f..3586d31 100644..100755
--- a/sdk/globals/include/NvBlastDebugRender.h
+++ b/sdk/globals/include/NvBlastDebugRender.h
@@ -1,64 +1,64 @@
-// This code contains NVIDIA Confidential Information and is disclosed to you
-// under a form of NVIDIA software license agreement provided separately to you.
-//
-// Notice
-// NVIDIA Corporation and its licensors retain all intellectual property and
-// proprietary rights in and to this software and related documentation and
-// any modifications thereto. Any use, reproduction, disclosure, or
-// distribution of this software and related documentation without an express
-// license agreement from NVIDIA Corporation is strictly prohibited.
-//
-// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES
-// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
-// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT,
-// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// Information and code furnished is believed to be accurate and reliable.
-// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such
-// information or for any infringement of patents or other rights of third parties that may
-// result from its use. No license is granted by implication or otherwise under any patent
-// or patent rights of NVIDIA Corporation. Details are subject to change without notice.
-// This code supersedes and replaces all information previously supplied.
-// NVIDIA Corporation products are not authorized for use as critical
-// components in life support devices or systems without express written approval of
-// NVIDIA Corporation.
-//
-// Copyright (c) 2016-2018 NVIDIA Corporation. All rights reserved.
-
-#pragma once
-
-#include <NvCTypes.h>
-
-namespace Nv
-{
-namespace Blast
-{
-
-
-/**
-Used to store a single line and colour for debug rendering.
-*/
-struct DebugLine
-{
- DebugLine(const NvcVec3& p0, const NvcVec3& p1, uint32_t c)
- : pos0(p0), color0(c), pos1(p1), color1(c) {}
-
- NvcVec3 pos0;
- uint32_t color0;
- NvcVec3 pos1;
- uint32_t color1;
-};
-
-
-/**
-Debug Buffer
-*/
-struct DebugBuffer
-{
- const DebugLine* lines;
- uint32_t lineCount;
-};
-
-
-} // namespace Blast
-} // namespace Nv
+// This code contains NVIDIA Confidential Information and is disclosed to you
+// under a form of NVIDIA software license agreement provided separately to you.
+//
+// Notice
+// NVIDIA Corporation and its licensors retain all intellectual property and
+// proprietary rights in and to this software and related documentation and
+// any modifications thereto. Any use, reproduction, disclosure, or
+// distribution of this software and related documentation without an express
+// license agreement from NVIDIA Corporation is strictly prohibited.
+//
+// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES
+// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
+// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT,
+// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.
+//
+// Information and code furnished is believed to be accurate and reliable.
+// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such
+// information or for any infringement of patents or other rights of third parties that may
+// result from its use. No license is granted by implication or otherwise under any patent
+// or patent rights of NVIDIA Corporation. Details are subject to change without notice.
+// This code supersedes and replaces all information previously supplied.
+// NVIDIA Corporation products are not authorized for use as critical
+// components in life support devices or systems without express written approval of
+// NVIDIA Corporation.
+//
+// Copyright (c) 2016-2018 NVIDIA Corporation. All rights reserved.
+
+#pragma once
+
+#include <NvCTypes.h>
+
+namespace Nv
+{
+namespace Blast
+{
+
+
+/**
+Used to store a single line and colour for debug rendering.
+*/
+struct DebugLine
+{
+ DebugLine(const NvcVec3& p0, const NvcVec3& p1, uint32_t c)
+ : pos0(p0), color0(c), pos1(p1), color1(c) {}
+
+ NvcVec3 pos0;
+ uint32_t color0;
+ NvcVec3 pos1;
+ uint32_t color1;
+};
+
+
+/**
+Debug Buffer
+*/
+struct DebugBuffer
+{
+ const DebugLine* lines;
+ uint32_t lineCount;
+};
+
+
+} // namespace Blast
+} // namespace Nv
diff --git a/sdk/globals/include/NvBlastGlobals.h b/sdk/globals/include/NvBlastGlobals.h
index ce21d38..c1ffd5e 100644..100755
--- a/sdk/globals/include/NvBlastGlobals.h
+++ b/sdk/globals/include/NvBlastGlobals.h
@@ -1,277 +1,277 @@
-// This code contains NVIDIA Confidential Information and is disclosed to you
-// under a form of NVIDIA software license agreement provided separately to you.
-//
-// Notice
-// NVIDIA Corporation and its licensors retain all intellectual property and
-// proprietary rights in and to this software and related documentation and
-// any modifications thereto. Any use, reproduction, disclosure, or
-// distribution of this software and related documentation without an express
-// license agreement from NVIDIA Corporation is strictly prohibited.
-//
-// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES
-// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
-// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT,
-// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// Information and code furnished is believed to be accurate and reliable.
-// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such
-// information or for any infringement of patents or other rights of third parties that may
-// result from its use. No license is granted by implication or otherwise under any patent
-// or patent rights of NVIDIA Corporation. Details are subject to change without notice.
-// This code supersedes and replaces all information previously supplied.
-// NVIDIA Corporation products are not authorized for use as critical
-// components in life support devices or systems without express written approval of
-// NVIDIA Corporation.
-//
-// Copyright (c) 2016-2018 NVIDIA Corporation. All rights reserved.
-
-
-#ifndef NVBLASTGLOBALS_H
-#define NVBLASTGLOBALS_H
-
-#include <new>
-#include "NvBlastTypes.h"
-
-
-namespace Nv
-{
-namespace Blast
-{
-
-
-/**
-\brief Abstract base class for an application defined memory allocator that can be used by toolkit (Tk) or any extension (Ext).
-*/
-class AllocatorCallback
-{
-public:
- /**
- \brief destructor
- */
- virtual ~AllocatorCallback()
- {
- }
-
- /**
- \brief Allocates size bytes of memory, which must be 16-byte aligned.
-
- This method should never return NULL. If you run out of memory, then
- you should terminate the app or take some other appropriate action.
-
- \param size Number of bytes to allocate.
- \param typeName Name of the datatype that is being allocated
- \param filename The source file which allocated the memory
- \param line The source line which allocated the memory
- \return The allocated block of memory.
- */
- virtual void* allocate(size_t size, const char* typeName, const char* filename, int line) = 0;
-
- /**
- \brief Frees memory previously allocated by allocate().
-
- \param ptr Memory to free.
- */
- virtual void deallocate(void* ptr) = 0;
-};
-
-
-/**
-\brief Error codes
-
-These error codes are passed to #ErrorCallback
-
-\note: It's actually the copy of PxErrorCallback's PxErrorCode so it can be easily casted to it. Keep that
-in mind if you are going to change this enum.
-
-@see ErrorCallback
-*/
-struct ErrorCode
-{
- enum Enum
- {
- eNO_ERROR = 0,
-
- //! \brief An informational message.
- eDEBUG_INFO = 1,
-
- //! \brief a warning message for the user to help with debugging
- eDEBUG_WARNING = 2,
-
- //! \brief method called with invalid parameter(s)
- eINVALID_PARAMETER = 4,
-
- //! \brief method was called at a time when an operation is not possible
- eINVALID_OPERATION = 8,
-
- //! \brief method failed to allocate some memory
- eOUT_OF_MEMORY = 16,
-
- /** \brief The library failed for some reason.
- Possibly you have passed invalid values like NaNs, which are not checked for.
- */
- eINTERNAL_ERROR = 32,
-
- //! \brief An unrecoverable error, execution should be halted and log output flushed
- eABORT = 64,
-
- //! \brief The SDK has determined that an operation may result in poor performance.
- ePERF_WARNING = 128,
-
- //! \brief A bit mask for including all errors
- eMASK_ALL = -1
- };
-};
-
-
-/**
-\brief User defined interface class. Used by the library to emit debug information.
-
-\note The SDK state should not be modified from within any error reporting functions.
-*/
-class ErrorCallback
-{
-public:
- virtual ~ErrorCallback()
- {
- }
-
- /**
- \brief Reports an error code.
- \param code Error code, see #ErrorCode
- \param message Message to display.
- \param file File error occured in.
- \param line Line number error occured on.
- */
- virtual void reportError(ErrorCode::Enum code, const char* message, const char* file, int line) = 0;
-};
-
-
-} // namespace Blast
-} // namespace Nv
-
-
-//////// Global API to Access Global AllocatorCallback and ErrorCallback ////////
-
-/**
-Retrieve a pointer to the global AllocatorCallback. Default implementation with std allocator is used if user didn't provide
-it's own. It always exist, 'nullptr' will never be returned.
-
-\return the pointer to the global AllocatorCallback.
-*/
-NVBLAST_API Nv::Blast::AllocatorCallback* NvBlastGlobalGetAllocatorCallback();
-
-/**
-Set global AllocatorCallback. If 'nullptr' is passed the default AllocatorCallback with std allocator is set.
-*/
-NVBLAST_API void NvBlastGlobalSetAllocatorCallback(Nv::Blast::AllocatorCallback* allocatorCallback);
-
-/**
-Retrieve a pointer to the global ErrorCallback. Default implementation which writes messages to stdout is used if user didn't provide
-it's own. It always exist, 'nullptr' will never be returned.
-
-\return the pointer to the global ErrorCallback.
-*/
-NVBLAST_API Nv::Blast::ErrorCallback* NvBlastGlobalGetErrorCallback();
-
-/**
-Set global ErrorCallback. If 'nullptr' is passed the default ErrorCallback that writes messages to stdout is set.
-*/
-NVBLAST_API void NvBlastGlobalSetErrorCallback(Nv::Blast::ErrorCallback* errorCallback);
-
-
-//////// Helper Global Functions ////////
-
-namespace Nv
-{
-namespace Blast
-{
-
-
-/**
-Logging wrapper compatible with NvBlastLog. @see NvBlastLog.
-
-Pass this function to LowLevel function calls in order to get logging into global ErrorCallback.
-*/
-NV_INLINE void logLL(int type, const char* msg, const char* file, int line)
-{
- ErrorCode::Enum errorCode = ErrorCode::eNO_ERROR;
- switch (type)
- {
- case NvBlastMessage::Error: errorCode = ErrorCode::eINVALID_OPERATION; break;
- case NvBlastMessage::Warning: errorCode = ErrorCode::eDEBUG_WARNING; break;
- case NvBlastMessage::Info: errorCode = ErrorCode::eDEBUG_INFO; break;
- case NvBlastMessage::Debug: errorCode = ErrorCode::eNO_ERROR; break;
- }
-
- NvBlastGlobalGetErrorCallback()->reportError(errorCode, msg, file, line);
-}
-
-
-} // namespace Blast
-} // namespace Nv
-
-
-
-//////// Allocator macros ////////
-
-/**
-Alloc/Free macros that use global AllocatorCallback. Thus allocated memory is 16-byte aligned.
-*/
-#define NVBLAST_ALLOC(_size) NvBlastGlobalGetAllocatorCallback()->allocate(_size, nullptr, __FILE__, __LINE__)
-#define NVBLAST_ALLOC_NAMED(_size, _name) NvBlastGlobalGetAllocatorCallback()->allocate(_size, _name, __FILE__, __LINE__)
-#define NVBLAST_FREE(_mem) NvBlastGlobalGetAllocatorCallback()->deallocate(_mem)
-
-/**
-Placement new with ExtContext allocation.
-Example: Foo* foo = NVBLAST_NEW(Foo, context) (params);
-*/
-#define NVBLAST_NEW(T) new (NvBlastGlobalGetAllocatorCallback()->allocate(sizeof(T), #T, __FILE__, __LINE__)) T
-
-/**
-Respective delete to NVBLAST_NEW
-Example: NVBLAST_DELETE(foo, Foo, context);
-*/
-#define NVBLAST_DELETE(obj, T) \
- (obj)->~T(); \
- NvBlastGlobalGetAllocatorCallback()->deallocate(obj)
-
-
-
-//////// Log macros ////////
-
-/**
-Logging macros that use global AllocatorCallback.
-*/
-#define NVBLAST_LOG(_code, _msg) NvBlastGlobalGetErrorCallback()->reportError(_code, _msg, __FILE__, __LINE__)
-#define NVBLAST_LOG_ERROR(_msg) NVBLAST_LOG(Nv::Blast::ErrorCode::eINVALID_OPERATION, _msg)
-#define NVBLAST_LOG_WARNING(_msg) NVBLAST_LOG(Nv::Blast::ErrorCode::eDEBUG_WARNING, _msg)
-#define NVBLAST_LOG_INFO(_msg) NVBLAST_LOG(Nv::Blast::ErrorCode::eDEBUG_INFO, _msg)
-#define NVBLAST_LOG_DEBUG(_msg) NVBLAST_LOG(Nv::Blast::ErrorCode::eNO_ERROR, _msg)
-
-/**
-Check macros that use global AllocatorCallback. The idea is that you pass an expression to check, if it fails
-it logs and calls '_onFail' code you passed.
-*/
-#define NVBLAST_CHECK(_code, _expr, _msg, _onFail) \
- { \
- if(!(_expr)) \
- { \
- NVBLAST_LOG(_code, _msg); \
- { _onFail; }; \
- } \
- }
-
-#define NVBLAST_CHECK_ERROR(_expr, _msg, _onFail) NVBLAST_CHECK(Nv::Blast::ErrorCode::eINVALID_OPERATION, _expr, _msg, _onFail)
-#define NVBLAST_CHECK_WARNING(_expr, _msg, _onFail) NVBLAST_CHECK(Nv::Blast::ErrorCode::eDEBUG_WARNING, _expr, _msg, _onFail)
-#define NVBLAST_CHECK_INFO(_expr, _msg, _onFail) NVBLAST_CHECK(Nv::Blast::ErrorCode::eDEBUG_INFO, _expr, _msg, _onFail)
-#define NVBLAST_CHECK_DEBUG(_expr, _msg, _onFail) NVBLAST_CHECK(Nv::Blast::ErrorCode::eNO_ERROR, _expr, _msg, _onFail)
-
-
-//////// Misc ////////
-
-
-// Macro to load a uint32_t (or larger) with four characters
-#define NVBLAST_FOURCC(_a, _b, _c, _d) ( (uint32_t)(_a) | (uint32_t)(_b)<<8 | (uint32_t)(_c)<<16 | (uint32_t)(_d)<<24 )
-
-
-#endif // ifndef NVBLASTGLOBALS_H
+// This code contains NVIDIA Confidential Information and is disclosed to you
+// under a form of NVIDIA software license agreement provided separately to you.
+//
+// Notice
+// NVIDIA Corporation and its licensors retain all intellectual property and
+// proprietary rights in and to this software and related documentation and
+// any modifications thereto. Any use, reproduction, disclosure, or
+// distribution of this software and related documentation without an express
+// license agreement from NVIDIA Corporation is strictly prohibited.
+//
+// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES
+// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
+// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT,
+// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.
+//
+// Information and code furnished is believed to be accurate and reliable.
+// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such
+// information or for any infringement of patents or other rights of third parties that may
+// result from its use. No license is granted by implication or otherwise under any patent
+// or patent rights of NVIDIA Corporation. Details are subject to change without notice.
+// This code supersedes and replaces all information previously supplied.
+// NVIDIA Corporation products are not authorized for use as critical
+// components in life support devices or systems without express written approval of
+// NVIDIA Corporation.
+//
+// Copyright (c) 2016-2018 NVIDIA Corporation. All rights reserved.
+
+
+#ifndef NVBLASTGLOBALS_H
+#define NVBLASTGLOBALS_H
+
+#include <new>
+#include "NvBlastTypes.h"
+
+
+namespace Nv
+{
+namespace Blast
+{
+
+
+/**
+\brief Abstract base class for an application defined memory allocator that can be used by toolkit (Tk) or any extension (Ext).
+*/
+class AllocatorCallback
+{
+public:
+ /**
+ \brief destructor
+ */
+ virtual ~AllocatorCallback()
+ {
+ }
+
+ /**
+ \brief Allocates size bytes of memory, which must be 16-byte aligned.
+
+ This method should never return NULL. If you run out of memory, then
+ you should terminate the app or take some other appropriate action.
+
+ \param size Number of bytes to allocate.
+ \param typeName Name of the datatype that is being allocated
+ \param filename The source file which allocated the memory
+ \param line The source line which allocated the memory
+ \return The allocated block of memory.
+ */
+ virtual void* allocate(size_t size, const char* typeName, const char* filename, int line) = 0;
+
+ /**
+ \brief Frees memory previously allocated by allocate().
+
+ \param ptr Memory to free.
+ */
+ virtual void deallocate(void* ptr) = 0;
+};
+
+
+/**
+\brief Error codes
+
+These error codes are passed to #ErrorCallback
+
+\note: It's actually the copy of PxErrorCallback's PxErrorCode so it can be easily casted to it. Keep that
+in mind if you are going to change this enum.
+
+@see ErrorCallback
+*/
+struct ErrorCode
+{
+ enum Enum
+ {
+ eNO_ERROR = 0,
+
+ //! \brief An informational message.
+ eDEBUG_INFO = 1,
+
+ //! \brief a warning message for the user to help with debugging
+ eDEBUG_WARNING = 2,
+
+ //! \brief method called with invalid parameter(s)
+ eINVALID_PARAMETER = 4,
+
+ //! \brief method was called at a time when an operation is not possible
+ eINVALID_OPERATION = 8,
+
+ //! \brief method failed to allocate some memory
+ eOUT_OF_MEMORY = 16,
+
+ /** \brief The library failed for some reason.
+ Possibly you have passed invalid values like NaNs, which are not checked for.
+ */
+ eINTERNAL_ERROR = 32,
+
+ //! \brief An unrecoverable error, execution should be halted and log output flushed
+ eABORT = 64,
+
+ //! \brief The SDK has determined that an operation may result in poor performance.
+ ePERF_WARNING = 128,
+
+ //! \brief A bit mask for including all errors
+ eMASK_ALL = -1
+ };
+};
+
+
+/**
+\brief User defined interface class. Used by the library to emit debug information.
+
+\note The SDK state should not be modified from within any error reporting functions.
+*/
+class ErrorCallback
+{
+public:
+ virtual ~ErrorCallback()
+ {
+ }
+
+ /**
+ \brief Reports an error code.
+ \param code Error code, see #ErrorCode
+ \param message Message to display.
+ \param file File error occured in.
+ \param line Line number error occured on.
+ */
+ virtual void reportError(ErrorCode::Enum code, const char* message, const char* file, int line) = 0;
+};
+
+
+} // namespace Blast
+} // namespace Nv
+
+
+//////// Global API to Access Global AllocatorCallback and ErrorCallback ////////
+
+/**
+Retrieve a pointer to the global AllocatorCallback. Default implementation with std allocator is used if user didn't provide
+it's own. It always exist, 'nullptr' will never be returned.
+
+\return the pointer to the global AllocatorCallback.
+*/
+NVBLAST_API Nv::Blast::AllocatorCallback* NvBlastGlobalGetAllocatorCallback();
+
+/**
+Set global AllocatorCallback. If 'nullptr' is passed the default AllocatorCallback with std allocator is set.
+*/
+NVBLAST_API void NvBlastGlobalSetAllocatorCallback(Nv::Blast::AllocatorCallback* allocatorCallback);
+
+/**
+Retrieve a pointer to the global ErrorCallback. Default implementation which writes messages to stdout is used if user didn't provide
+it's own. It always exist, 'nullptr' will never be returned.
+
+\return the pointer to the global ErrorCallback.
+*/
+NVBLAST_API Nv::Blast::ErrorCallback* NvBlastGlobalGetErrorCallback();
+
+/**
+Set global ErrorCallback. If 'nullptr' is passed the default ErrorCallback that writes messages to stdout is set.
+*/
+NVBLAST_API void NvBlastGlobalSetErrorCallback(Nv::Blast::ErrorCallback* errorCallback);
+
+
+//////// Helper Global Functions ////////
+
+namespace Nv
+{
+namespace Blast
+{
+
+
+/**
+Logging wrapper compatible with NvBlastLog. @see NvBlastLog.
+
+Pass this function to LowLevel function calls in order to get logging into global ErrorCallback.
+*/
+NV_INLINE void logLL(int type, const char* msg, const char* file, int line)
+{
+ ErrorCode::Enum errorCode = ErrorCode::eNO_ERROR;
+ switch (type)
+ {
+ case NvBlastMessage::Error: errorCode = ErrorCode::eINVALID_OPERATION; break;
+ case NvBlastMessage::Warning: errorCode = ErrorCode::eDEBUG_WARNING; break;
+ case NvBlastMessage::Info: errorCode = ErrorCode::eDEBUG_INFO; break;
+ case NvBlastMessage::Debug: errorCode = ErrorCode::eNO_ERROR; break;
+ }
+
+ NvBlastGlobalGetErrorCallback()->reportError(errorCode, msg, file, line);
+}
+
+
+} // namespace Blast
+} // namespace Nv
+
+
+
+//////// Allocator macros ////////
+
+/**
+Alloc/Free macros that use global AllocatorCallback. Thus allocated memory is 16-byte aligned.
+*/
+#define NVBLAST_ALLOC(_size) NvBlastGlobalGetAllocatorCallback()->allocate(_size, nullptr, __FILE__, __LINE__)
+#define NVBLAST_ALLOC_NAMED(_size, _name) NvBlastGlobalGetAllocatorCallback()->allocate(_size, _name, __FILE__, __LINE__)
+#define NVBLAST_FREE(_mem) NvBlastGlobalGetAllocatorCallback()->deallocate(_mem)
+
+/**
+Placement new with ExtContext allocation.
+Example: Foo* foo = NVBLAST_NEW(Foo, context) (params);
+*/
+#define NVBLAST_NEW(T) new (NvBlastGlobalGetAllocatorCallback()->allocate(sizeof(T), #T, __FILE__, __LINE__)) T
+
+/**
+Respective delete to NVBLAST_NEW
+Example: NVBLAST_DELETE(foo, Foo, context);
+*/
+#define NVBLAST_DELETE(obj, T) \
+ (obj)->~T(); \
+ NvBlastGlobalGetAllocatorCallback()->deallocate(obj)
+
+
+
+//////// Log macros ////////
+
+/**
+Logging macros that use global AllocatorCallback.
+*/
+#define NVBLAST_LOG(_code, _msg) NvBlastGlobalGetErrorCallback()->reportError(_code, _msg, __FILE__, __LINE__)
+#define NVBLAST_LOG_ERROR(_msg) NVBLAST_LOG(Nv::Blast::ErrorCode::eINVALID_OPERATION, _msg)
+#define NVBLAST_LOG_WARNING(_msg) NVBLAST_LOG(Nv::Blast::ErrorCode::eDEBUG_WARNING, _msg)
+#define NVBLAST_LOG_INFO(_msg) NVBLAST_LOG(Nv::Blast::ErrorCode::eDEBUG_INFO, _msg)
+#define NVBLAST_LOG_DEBUG(_msg) NVBLAST_LOG(Nv::Blast::ErrorCode::eNO_ERROR, _msg)
+
+/**
+Check macros that use global AllocatorCallback. The idea is that you pass an expression to check, if it fails
+it logs and calls '_onFail' code you passed.
+*/
+#define NVBLAST_CHECK(_code, _expr, _msg, _onFail) \
+ { \
+ if(!(_expr)) \
+ { \
+ NVBLAST_LOG(_code, _msg); \
+ { _onFail; }; \
+ } \
+ }
+
+#define NVBLAST_CHECK_ERROR(_expr, _msg, _onFail) NVBLAST_CHECK(Nv::Blast::ErrorCode::eINVALID_OPERATION, _expr, _msg, _onFail)
+#define NVBLAST_CHECK_WARNING(_expr, _msg, _onFail) NVBLAST_CHECK(Nv::Blast::ErrorCode::eDEBUG_WARNING, _expr, _msg, _onFail)
+#define NVBLAST_CHECK_INFO(_expr, _msg, _onFail) NVBLAST_CHECK(Nv::Blast::ErrorCode::eDEBUG_INFO, _expr, _msg, _onFail)
+#define NVBLAST_CHECK_DEBUG(_expr, _msg, _onFail) NVBLAST_CHECK(Nv::Blast::ErrorCode::eNO_ERROR, _expr, _msg, _onFail)
+
+
+//////// Misc ////////
+
+
+// Macro to load a uint32_t (or larger) with four characters
+#define NVBLAST_FOURCC(_a, _b, _c, _d) ( (uint32_t)(_a) | (uint32_t)(_b)<<8 | (uint32_t)(_c)<<16 | (uint32_t)(_d)<<24 )
+
+
+#endif // ifndef NVBLASTGLOBALS_H
diff --git a/sdk/globals/include/NvBlastProfiler.h b/sdk/globals/include/NvBlastProfiler.h
index cf7b626..42f0130 100644..100755
--- a/sdk/globals/include/NvBlastProfiler.h
+++ b/sdk/globals/include/NvBlastProfiler.h
@@ -1,98 +1,98 @@
-// This code contains NVIDIA Confidential Information and is disclosed to you
-// under a form of NVIDIA software license agreement provided separately to you.
-//
-// Notice
-// NVIDIA Corporation and its licensors retain all intellectual property and
-// proprietary rights in and to this software and related documentation and
-// any modifications thereto. Any use, reproduction, disclosure, or
-// distribution of this software and related documentation without an express
-// license agreement from NVIDIA Corporation is strictly prohibited.
-//
-// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES
-// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
-// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT,
-// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// Information and code furnished is believed to be accurate and reliable.
-// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such
-// information or for any infringement of patents or other rights of third parties that may
-// result from its use. No license is granted by implication or otherwise under any patent
-// or patent rights of NVIDIA Corporation. Details are subject to change without notice.
-// This code supersedes and replaces all information previously supplied.
-// NVIDIA Corporation products are not authorized for use as critical
-// components in life support devices or systems without express written approval of
-// NVIDIA Corporation.
-//
-// Copyright (c) 2016-2018 NVIDIA Corporation. All rights reserved.
-
-
-#ifndef NVBLASTPROFILER_H
-#define NVBLASTPROFILER_H
-
-#include "NvBlastPreprocessor.h"
-
-
-namespace Nv
-{
-namespace Blast
-{
-
-
-/**
-Custom Blast profiler interface.
-*/
-class ProfilerCallback
-{
-protected:
- virtual ~ProfilerCallback() {}
-
-public:
- /**
- Called when a nested profile zone starts.
- */
- virtual void zoneStart(const char* name) = 0;
-
- /**
- Called when the current profile zone ends.
- */
- virtual void zoneEnd() = 0;
-};
-
-
-/**
-Profiler detail to be reported. The higher setting is used, the more details are reported.
-*/
-struct ProfilerDetail
-{
- enum Level
- {
- LOW,
- MEDIUM,
- HIGH
- };
-};
-
-
-} // namespace Blast
-} // namespace Nv
-
-
-/**
-Profiler features are only active in checked, debug and profile builds.
-*/
-
-/**
-Set a custom profiler callback. May be nullptr (the default).
-*/
-NVBLAST_API void NvBlastProfilerSetCallback(Nv::Blast::ProfilerCallback* pcb);
-
-
-/**
-Sets the depth of reported profile zones.
-Higher levels (more nesting) of instrumentation can have a significant impact.
-Defaults to Nv::Blast::ProfilerDetail::Level::LOW.
-*/
-NVBLAST_API void NvBlastProfilerSetDetail(Nv::Blast::ProfilerDetail::Level);
-
-
-#endif
+// This code contains NVIDIA Confidential Information and is disclosed to you
+// under a form of NVIDIA software license agreement provided separately to you.
+//
+// Notice
+// NVIDIA Corporation and its licensors retain all intellectual property and
+// proprietary rights in and to this software and related documentation and
+// any modifications thereto. Any use, reproduction, disclosure, or
+// distribution of this software and related documentation without an express
+// license agreement from NVIDIA Corporation is strictly prohibited.
+//
+// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES
+// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
+// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT,
+// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.
+//
+// Information and code furnished is believed to be accurate and reliable.
+// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such
+// information or for any infringement of patents or other rights of third parties that may
+// result from its use. No license is granted by implication or otherwise under any patent
+// or patent rights of NVIDIA Corporation. Details are subject to change without notice.
+// This code supersedes and replaces all information previously supplied.
+// NVIDIA Corporation products are not authorized for use as critical
+// components in life support devices or systems without express written approval of
+// NVIDIA Corporation.
+//
+// Copyright (c) 2016-2018 NVIDIA Corporation. All rights reserved.
+
+
+#ifndef NVBLASTPROFILER_H
+#define NVBLASTPROFILER_H
+
+#include "NvBlastPreprocessor.h"
+
+
+namespace Nv
+{
+namespace Blast
+{
+
+
+/**
+Custom Blast profiler interface.
+*/
+class ProfilerCallback
+{
+protected:
+ virtual ~ProfilerCallback() {}
+
+public:
+ /**
+ Called when a nested profile zone starts.
+ */
+ virtual void zoneStart(const char* name) = 0;
+
+ /**
+ Called when the current profile zone ends.
+ */
+ virtual void zoneEnd() = 0;
+};
+
+
+/**
+Profiler detail to be reported. The higher setting is used, the more details are reported.
+*/
+struct ProfilerDetail
+{
+ enum Level
+ {
+ LOW,
+ MEDIUM,
+ HIGH
+ };
+};
+
+
+} // namespace Blast
+} // namespace Nv
+
+
+/**
+Profiler features are only active in checked, debug and profile builds.
+*/
+
+/**
+Set a custom profiler callback. May be nullptr (the default).
+*/
+NVBLAST_API void NvBlastProfilerSetCallback(Nv::Blast::ProfilerCallback* pcb);
+
+
+/**
+Sets the depth of reported profile zones.
+Higher levels (more nesting) of instrumentation can have a significant impact.
+Defaults to Nv::Blast::ProfilerDetail::Level::LOW.
+*/
+NVBLAST_API void NvBlastProfilerSetDetail(Nv::Blast::ProfilerDetail::Level);
+
+
+#endif