aboutsummaryrefslogtreecommitdiff
path: root/PxShared/include
diff options
context:
space:
mode:
Diffstat (limited to 'PxShared/include')
-rw-r--r--PxShared/include/cudamanager/PxCudaContextManager.h24
-rw-r--r--PxShared/include/foundation/PxIntrinsics.h4
-rw-r--r--PxShared/include/foundation/PxPreprocessor.h14
-rw-r--r--PxShared/include/foundation/nx/PxNXIntrinsics.h138
-rw-r--r--PxShared/include/task/PxTask.h39
-rw-r--r--PxShared/include/task/PxTaskManager.h3
6 files changed, 39 insertions, 183 deletions
diff --git a/PxShared/include/cudamanager/PxCudaContextManager.h b/PxShared/include/cudamanager/PxCudaContextManager.h
index 24f4370..aca1112 100644
--- a/PxShared/include/cudamanager/PxCudaContextManager.h
+++ b/PxShared/include/cudamanager/PxCudaContextManager.h
@@ -23,7 +23,7 @@
// components in life support devices or systems without express written approval of
// NVIDIA Corporation.
//
-// Copyright (c) 2008-2014 NVIDIA Corporation. All rights reserved.
+// Copyright (c) 2008-2017 NVIDIA Corporation. All rights reserved.
#ifndef PXCUDACONTEXTMANAGER_PXCUDACONTEXTMANAGER_H
@@ -42,6 +42,7 @@
/* Forward decl to avoid inclusion of cuda.h */
typedef struct CUctx_st *CUcontext;
typedef struct CUgraphicsResource_st *CUgraphicsResource;
+typedef int CUdevice;
namespace physx
{
@@ -58,7 +59,6 @@ struct PxCudaInteropMode
enum Enum
{
NO_INTEROP = 0,
- D3D9_INTEROP,
D3D10_INTEROP,
D3D11_INTEROP,
OGL_INTEROP,
@@ -154,6 +154,9 @@ public:
* to every CUDA work submission, so we recommend that you carefully tune
* this initial base memory size to closely approximate the amount of
* memory your application will consume.
+
+ Note: This is currently not used by PxSceneFlag::eENABLE_GPU_DYNAMICS. Memory allocation properties are configured
+ for GPU rigid bodies using PxSceneDesc::gpuDynamicsConfig.
*/
uint32_t memoryBaseSize[PxCudaBufferMemorySpace::COUNT];
@@ -162,11 +165,17 @@ public:
*
* The memory manager will dynamically grow and shrink in blocks multiple of
* this page size. Size has to be power of two and bigger than 0.
+
+ Note: This is currently not used by PxSceneFlag::eENABLE_GPU_DYNAMICS. Memory allocation properties are configured
+ for GPU rigid bodies using PxSceneDesc::gpuDynamicsConfig.
*/
uint32_t memoryPageSize[PxCudaBufferMemorySpace::COUNT];
/**
* \brief Maximum size of memory that the memory manager will allocate
+
+ Note: This is currently not used by PxSceneFlag::eENABLE_GPU_DYNAMICS. Memory allocation properties are configured
+ for GPU rigid bodies using PxSceneDesc::gpuDynamicsConfig.
*/
uint32_t maxMemorySize[PxCudaBufferMemorySpace::COUNT];
@@ -223,7 +232,7 @@ public:
* harmfull to (re)acquire the context in code that is shared between
* GpuTasks and non-task functions.
*/
- virtual CUcontext acquireContext() = 0;
+ virtual void acquireContext() = 0;
/**
* \brief Release the CUDA context from the current thread
@@ -234,9 +243,16 @@ public:
*/
virtual void releaseContext() = 0;
+ /**
+ * \brief Return the CUcontext
+ */
+ virtual CUcontext getContext() = 0;
+
/**
* \brief Return the PxCudaMemoryManager instance associated with this
* CUDA context
+ * Note: This is currently not used by PxSceneFlag::eENABLE_GPU_DYNAMICS. Memory allocation properties are configured
+ * for GPU rigid bodies using PxSceneDesc::gpuDynamicsConfig.
*/
virtual PxCudaMemoryManager *getMemoryManager() = 0;
@@ -268,6 +284,7 @@ public:
virtual bool supportsArchSM35() const = 0; //!< GK110
virtual bool supportsArchSM50() const = 0; //!< GM100
virtual bool supportsArchSM52() const = 0; //!< GM200
+ virtual bool supportsArchSM60() const = 0; //!< GP100
virtual bool isIntegrated() const = 0; //!< true if GPU is an integrated (MCP) part
virtual bool canMapHostMemory() const = 0; //!< true if GPU map host memory to GPU (0-copy)
virtual int getDriverVersion() const = 0; //!< returns cached value of cuGetDriverVersion()
@@ -278,6 +295,7 @@ public:
virtual int getSharedMemPerMultiprocessor() const = 0; //!< returns total amount of shared memory available per multiprocessor in bytes
virtual unsigned int getMaxThreadsPerBlock() const = 0; //!< returns the maximum number of threads per block
virtual const char *getDeviceName() const = 0; //!< returns device name retrieved from driver
+ virtual CUdevice getDevice() const = 0; //!< returns device handle retrieved from driver
virtual PxCudaInteropMode::Enum getInteropMode() const = 0; //!< interop mode the context was created with
virtual void setUsingConcurrentStreams(bool) = 0; //!< turn on/off using concurrent streams for GPU work
diff --git a/PxShared/include/foundation/PxIntrinsics.h b/PxShared/include/foundation/PxIntrinsics.h
index 471f934..b4aff28 100644
--- a/PxShared/include/foundation/PxIntrinsics.h
+++ b/PxShared/include/foundation/PxIntrinsics.h
@@ -38,8 +38,8 @@
#include "foundation/unix/PxUnixIntrinsics.h"
#elif PX_XBOXONE
#include "foundation/XboxOne/PxXboxOneIntrinsics.h"
-#elif PX_NX
-#include "foundation/nx/PxNXIntrinsics.h"
+#elif PX_SWITCH
+#include "foundation/switch/PxSwitchIntrinsics.h"
#else
#error "Platform not supported!"
#endif
diff --git a/PxShared/include/foundation/PxPreprocessor.h b/PxShared/include/foundation/PxPreprocessor.h
index 446ca76..9b6e0f4 100644
--- a/PxShared/include/foundation/PxPreprocessor.h
+++ b/PxShared/include/foundation/PxPreprocessor.h
@@ -88,7 +88,7 @@ Operating system defines, see http://sourceforge.net/p/predef/wiki/OperatingSyst
#elif defined(__ORBIS__)
#define PX_PS4 1
#elif defined(__NX__)
-#define PX_NX 1
+#define PX_SWITCH 1
#else
#error "Unknown operating system"
#endif
@@ -161,8 +161,8 @@ define anything not defined on this platform to 0
#ifndef PX_PS4
#define PX_PS4 0
#endif
-#ifndef PX_NX
-#define PX_NX 0
+#ifndef PX_SWITCH
+#define PX_SWITCH 0
#endif
#ifndef PX_X64
#define PX_X64 0
@@ -425,7 +425,7 @@ General defines
*/
// static assert
-#if(defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7))) || (PX_PS4) || (PX_APPLE_FAMILY) || (PX_NX) || (PX_CLANG && PX_ARM)
+#if(defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7))) || (PX_PS4) || (PX_APPLE_FAMILY) || (PX_SWITCH) || (PX_CLANG && PX_ARM)
#define PX_COMPILE_TIME_ASSERT(exp) typedef char PxCompileTimeAssert_Dummy[(exp) ? 1 : -1] __attribute__((unused))
#else
#define PX_COMPILE_TIME_ASSERT(exp) typedef char PxCompileTimeAssert_Dummy[(exp) ? 1 : -1]
@@ -532,5 +532,11 @@ protected:
#define PX_SUPPORT_COMPUTE_PHYSX 0
+#ifndef PX_SUPPORT_EXTERN_TEMPLATE
+#define PX_SUPPORT_EXTERN_TEMPLATE ((!PX_ANDROID) && (PX_VC != 11))
+#else
+#define PX_SUPPORT_EXTERN_TEMPLATE 0
+#endif
+
/** @} */
#endif // #ifndef PXFOUNDATION_PXPREPROCESSOR_H
diff --git a/PxShared/include/foundation/nx/PxNXIntrinsics.h b/PxShared/include/foundation/nx/PxNXIntrinsics.h
deleted file mode 100644
index adf3bf5..0000000
--- a/PxShared/include/foundation/nx/PxNXIntrinsics.h
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved.
- *
- * NVIDIA CORPORATION and its licensors retain all intellectual property
- * and proprietary rights in and to this software, 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.
- */
-// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
-// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
-
-
-#ifndef PX_FOUNDATION_PX_NX_INTRINSICS_H
-#define PX_FOUNDATION_PX_NX_INTRINSICS_H
-
-#include "foundation/Px.h"
-#include "foundation/PxAssert.h"
-
-#if !PX_NX
- #error "This file should only be included by NX builds!!"
-#endif
-
-#include <math.h>
-#include <float.h>
-
-#include "nn/cstd/cstd_CMath.h"
-
-#if !PX_DOXYGEN
-namespace physx
-{
-namespace intrinsics
-{
-#endif
-
- //! \brief platform-specific absolute value
- PX_CUDA_CALLABLE PX_FORCE_INLINE float abs(float a) { return ::fabsf(a); }
-
- //! \brief platform-specific select float
- PX_CUDA_CALLABLE PX_FORCE_INLINE float fsel(float a, float b, float c) { return (a >= 0.0f) ? b : c; }
-
- //! \brief platform-specific sign
- PX_CUDA_CALLABLE PX_FORCE_INLINE float sign(float a) { return (a >= 0.0f) ? 1.0f : -1.0f; }
-
- //! \brief platform-specific reciprocal
- PX_CUDA_CALLABLE PX_FORCE_INLINE float recip(float a) { return 1.0f/a; }
-
- //! \brief platform-specific reciprocal estimate
- PX_CUDA_CALLABLE PX_FORCE_INLINE float recipFast(float a) { return 1.0f/a; }
-
- //! \brief platform-specific square root
- PX_CUDA_CALLABLE PX_FORCE_INLINE float sqrt(float a) { return ::sqrtf(a); }
-
- //! \brief platform-specific reciprocal square root
- PX_CUDA_CALLABLE PX_FORCE_INLINE float recipSqrt(float a) { return 1.0f/::sqrtf(a); }
-
- //! \brief platform-specific reciprocal square root estimate
- PX_CUDA_CALLABLE PX_FORCE_INLINE float recipSqrtFast(float a) { return 1.0f/::sqrtf(a); }
-
- //! \brief platform-specific sine
- PX_CUDA_CALLABLE PX_FORCE_INLINE float sin(float a) { return ::sinf(a); }
-
- //! \brief platform-specific cosine
- PX_CUDA_CALLABLE PX_FORCE_INLINE float cos(float a) { return ::cosf(a); }
-
- //! \brief platform-specific minimum
- PX_CUDA_CALLABLE PX_FORCE_INLINE float selectMin(float a, float b) { return a<b ? a : b; }
-
- //! \brief platform-specific maximum
- PX_CUDA_CALLABLE PX_FORCE_INLINE float selectMax(float a, float b) { return a>b ? a : b; }
-
- //! \brief platform-specific finiteness check
- PX_CUDA_CALLABLE PX_FORCE_INLINE bool isFinite(float a)
- {
-#ifdef __CUDACC__
- return isfinite(a) ? true : false;
-#else
- return !nn::cstd::IsNan(a) && !nn::cstd::IsInf(a);
-#endif
- }
-
- //! \brief platform-specific finiteness check
- PX_CUDA_CALLABLE PX_FORCE_INLINE bool isFinite(double a)
- {
-#ifdef __CUDACC__
- return isfinite(a) ? true : false;
-#else
- return !nn::cstd::IsNan(a) && !nn::cstd::IsInf(a);
-#endif
- }
-
- /*!
- Sets \c count bytes starting at \c dst to zero.
- */
- PX_FORCE_INLINE void* memZero(void* PX_RESTRICT dest, uint32_t count)
- {
- return memset(dest, 0, count);
- }
-
- /*!
- Sets \c count bytes starting at \c dst to \c c.
- */
- PX_FORCE_INLINE void* memSet(void* PX_RESTRICT dest, int32_t c, uint32_t count)
- {
- return memset(dest, c, count);
- }
-
- /*!
- Copies \c count bytes from \c src to \c dst. User memMove if regions overlap.
- */
- PX_FORCE_INLINE void* memCopy(void* PX_RESTRICT dest, const void* PX_RESTRICT src, uint32_t count)
- {
- return memcpy(dest, src, count);
- }
-
- /*!
- Copies \c count bytes from \c src to \c dst. Supports overlapping regions.
- */
- PX_FORCE_INLINE void* memMove(void* PX_RESTRICT dest, const void* PX_RESTRICT src, uint32_t count)
- {
- return memmove(dest, src, count);
- }
-
- /*!
- Set 128B to zero starting at \c dst+offset. Must be aligned.
- */
- PX_FORCE_INLINE void memZero128(void* PX_RESTRICT dest, uint32_t offset = 0)
- {
- PX_ASSERT(((size_t(dest)+offset) & 0x7f) == 0);
- memSet((char* PX_RESTRICT)dest+offset, 0, 128);
- }
-
-#if !PX_DOXYGEN
-} // namespace intrinsics
-} // namespace physx
-#endif
-
-#endif
diff --git a/PxShared/include/task/PxTask.h b/PxShared/include/task/PxTask.h
index 2761109..85d91da 100644
--- a/PxShared/include/task/PxTask.h
+++ b/PxShared/include/task/PxTask.h
@@ -45,7 +45,7 @@ namespace physx
class PxBaseTask
{
public:
- PxBaseTask() : mEventID(0xFFFF), mProfileStat(0), mTm(0) {}
+ PxBaseTask() : mContextID(0), mTm(NULL) {}
virtual ~PxBaseTask() {}
/**
@@ -78,50 +78,24 @@ public:
* references to it - so it may safely run its destructor, recycle itself, etc.
* provided no additional user references to the task exist
*/
-
virtual void release() = 0;
- /**
- * \brief Execute user run method with wrapping profiling events.
- *
- * Optional entry point for use by CpuDispatchers.
- *
- * \param[in] threadId The threadId of the thread that executed the task.
- */
- PX_INLINE void runProfiled(uint32_t threadId=0)
- {
- mTm->emitStartEvent(*this, threadId);
- run();
- mTm->emitStopEvent(*this, threadId);
- }
-
- /**
- * \brief Specify stop event statistic
- *
- * If called before or while the task is executing, the given value
- * will appear in the task's event bar in the profile viewer
- *
- * \param[in] stat The stat to signal when the task is finished
- */
- PX_INLINE void setProfileStat( uint16_t stat )
- {
- mProfileStat = stat;
- }
-
/**
* \brief Return PxTaskManager to which this task was submitted
*
* Note, can return NULL if task was not submitted, or has been
* completed.
*/
- PX_INLINE PxTaskManager* getTaskManager() const
+ PX_FORCE_INLINE PxTaskManager* getTaskManager() const
{
return mTm;
}
+ PX_FORCE_INLINE void setContextId(PxU64 id) { mContextID = id; }
+ PX_FORCE_INLINE PxU64 getContextId() const { return mContextID; }
+
protected:
- uint16_t mEventID; //!< Registered profile event ID
- uint16_t mProfileStat; //!< Profiling statistic
+ PxU64 mContextID; //!< Context ID for profiler interface
PxTaskManager* mTm; //!< Owning PxTaskManager instance
friend class PxTaskMgr;
@@ -212,7 +186,6 @@ public:
{
mStreamIndex = 0;
mPreSyncRequired = false;
- mProfileStat = 0;
}
/**
diff --git a/PxShared/include/task/PxTaskManager.h b/PxShared/include/task/PxTaskManager.h
index f6f29c4..f40f7b1 100644
--- a/PxShared/include/task/PxTaskManager.h
+++ b/PxShared/include/task/PxTaskManager.h
@@ -215,9 +215,6 @@ protected:
virtual void decrReference(PxLightCpuTask&) = 0;
virtual void addReference(PxLightCpuTask&) = 0;
- virtual void emitStartEvent(PxBaseTask&, uint32_t threadId=0) = 0;
- virtual void emitStopEvent(PxBaseTask&, uint32_t threadId=0) = 0;
-
/*! \endcond */
friend class PxBaseTask;