diff options
| author | git perforce import user <a@b> | 2016-10-25 12:29:14 -0600 |
|---|---|---|
| committer | Sheikh Dawood Abdul Ajees <Sheikh Dawood Abdul Ajees> | 2016-10-25 18:56:37 -0500 |
| commit | 3dfe2108cfab31ba3ee5527e217d0d8e99a51162 (patch) | |
| tree | fa6485c169e50d7415a651bf838f5bcd0fd3bfbd /PhysX_3.4/Source/PhysXGpu/include | |
| download | physx-3.4-3dfe2108cfab31ba3ee5527e217d0d8e99a51162.tar.xz physx-3.4-3dfe2108cfab31ba3ee5527e217d0d8e99a51162.zip | |
Initial commit:
PhysX 3.4.0 Update @ 21294896
APEX 1.4.0 Update @ 21275617
[CL 21300167]
Diffstat (limited to 'PhysX_3.4/Source/PhysXGpu/include')
| -rw-r--r-- | PhysX_3.4/Source/PhysXGpu/include/PxParticleDeviceExclusive.h | 252 | ||||
| -rw-r--r-- | PhysX_3.4/Source/PhysXGpu/include/PxPhysXGpu.h | 239 | ||||
| -rw-r--r-- | PhysX_3.4/Source/PhysXGpu/include/PxPhysXIndicatorDeviceExclusive.h | 71 | ||||
| -rw-r--r-- | PhysX_3.4/Source/PhysXGpu/include/PxRigidBodyAccessGpu.h | 68 | ||||
| -rw-r--r-- | PhysX_3.4/Source/PhysXGpu/include/PxSceneGpu.h | 104 | ||||
| -rw-r--r-- | PhysX_3.4/Source/PhysXGpu/include/Pxg.h | 61 |
6 files changed, 795 insertions, 0 deletions
diff --git a/PhysX_3.4/Source/PhysXGpu/include/PxParticleDeviceExclusive.h b/PhysX_3.4/Source/PhysXGpu/include/PxParticleDeviceExclusive.h new file mode 100644 index 00000000..a26c6915 --- /dev/null +++ b/PhysX_3.4/Source/PhysXGpu/include/PxParticleDeviceExclusive.h @@ -0,0 +1,252 @@ +// 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) 2008-2016 NVIDIA Corporation. All rights reserved. +// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved. +// Copyright (c) 2001-2004 NovodeX AG. All rights reserved. + + +#ifndef PX_PARTICLE_DEVICE_EXCLUSIVE_H +#define PX_PARTICLE_DEVICE_EXCLUSIVE_H + +#include "foundation/PxFlags.h" +#include "PxPhysXCommonConfig.h" + +typedef PX_DEPRECATED struct CUstream_st *CUstream; + +namespace physx +{ + +class PxBaseTask; + +/** +\brief Internal per particle flags to mark changes in device particle data. (deprecated) + +\deprecated The PhysX particle feature has been deprecated in PhysX version 3.4 + +@see PxParticleDeviceExclusive.getReadWriteCudaBuffers +*/ +struct PX_DEPRECATED PxInternalParticleFlagGpu +{ + enum Enum + { + //reserved (1<<0), + //reserved (1<<1), + //reserved (1<<2), + //reserved (1<<3), + //reserved (1<<4), + //reserved (1<<5), + eCUDA_NOTIFY_CREATE = (1<<6), + eCUDA_NOTIFY_SET_POSITION = (1<<7) + }; +}; + +/** +\brief Combined api and internal flags for device particle data. (deprecated) + +\deprecated The PhysX particle feature has been deprecated in PhysX version 3.4 + +@see PxInternalParticleFlagGpu, PxParticleDeviceExclusive.getReadWriteCudaBuffers +*/ +struct PX_DEPRECATED PxParticleFlagGpu +{ + PxParticleFlagGpu(PxU16 apiFlags, PxU16 lowFlags) + : api(apiFlags) + , low(lowFlags) + {} + + PxParticleFlagGpu() {} + + PxU16 api; // PxParticleFlag + PxU16 low; // PxInternalParticleFlagGpu +}; + +/** +\brief Device particle buffer descriptor. (deprecated) + +\deprecated The PhysX particle feature has been deprecated in PhysX version 3.4 +*/ +struct PX_DEPRECATED PxCudaReadWriteParticleBuffers +{ + PxVec4* positions; + PxVec4* velocities; + PxVec4* collisionNormals; + PxVec4* collisionVelocities; + PxF32* densities; + PxF32* restOffset; + PxParticleFlagGpu* flags; + PxU32 maxParticles; +}; + +/** +\brief Flags to control whether the particle simulation updates positions for new and externally moved particles. (deprecated) +When updating particle positions through the device (by adding particles or setting the position of particles) +collisions with the environment can't be resolved for the corresponding particles. Sometimes it's better +to avoid particle positions being changed by the simulation in these cases, to void missing collisions +against static actors. + +\deprecated The PhysX particle feature has been deprecated in PhysX version 3.4 + +@see PxParticleDeviceExclusive.setFlags +*/ +struct PX_DEPRECATED PxParticleDeviceExclusiveFlag +{ + enum Enum + { + eDISABLE_POSITION_UPDATE_ON_CREATE = (1 << 0), + eDISABLE_POSITION_UPDATE_ON_SETPOS = (1 << 1) + }; +}; + +typedef PX_DEPRECATED PxFlags<PxParticleDeviceExclusiveFlag::Enum, PxU32> PxParticleDeviceExclusiveFlags; +PX_FLAGS_OPERATORS(PxParticleDeviceExclusiveFlag::Enum, PxU32) + +/** +\brief API for gpu specific particle functionality. (deprecated) + +\deprecated The PhysX particle feature has been deprecated in PhysX version 3.4 +*/ +class PX_DEPRECATED PxParticleDeviceExclusive +{ +public: + + /** + \brief Experimental method for particle data read/write access from cuda device memory. + + By calling this method, the cuda particle system enters a "device exclusive" mode. This + means that particles can't be read nor updated through the host side PxParticleBase + interface. Additionally, it's not possible to enter the device exclusive mode after particles were + already added through the host side interface. + + Particle systems need to be part of a scene and need to have the PxParticleBaseFlag::eGPU raised in order + to enter the device exclusive mode successfully. Particle systems that are removed from a scene leave the + device exclusive mode. + + Note: particle systems in device exclusive mode are not displayed with the PhysX Visual Debugger. + @see PxParticleDeviceExclusive.isEnabled + */ + PX_PHYSX_CORE_API static void enable(class PxParticleBase& particleBase); + + /** + \brief Returns whether particle system is in device exclusive mode. + + @see PxParticleDeviceExclusive.enable + */ + PX_PHYSX_CORE_API static bool isEnabled(class PxParticleBase& particleBase); + + /** + \brief Experimental method for getting particle data read/write access through cuda device memory. + + Protocol for creating, releasing and updating particles: + + Initial particle state: + - all fields uninitialized but flags set to 0 + + Creating: + - set position + - set velocity + - set flags: PxParticleFlagGpu.api = PxParticleFlag::eVALID, PxParticleFlagGpu.low = PxInternalParticleFlagGpu::eCUDA_NOTIFY_CREATE + + Releasing: + - set flags to 0 + + Updating positions: + - set position + - set flags: PxParticleFlagGpu.low |= PxInternalParticleFlagGpu::eCUDA_NOTIFY_SET_POSITION + + Updating velocities: + - set velocity + + Updating with forces: + - not supported + + Updating restOffsets: + - not supported yet + + \param[in] particleBase PxParticleBase instance to fetch cuda buffers from. + \param[out] buffers Descriptor for cuda device particle data. + */ + PX_PHYSX_CORE_API static void getReadWriteCudaBuffers(class PxParticleBase& particleBase, PxCudaReadWriteParticleBuffers& buffers); + + /** + \brief Experimental method for optionally setting the valid particle range in device exclusive mode. + + By default PxParticleBase::getMaxParticles is used to define the range at which particle are processed in "device exclusive" mode. + Optionally this can be optimized by the application using this method. This method should be called for every following + call to PxScene::simulate(), otherwise PxParticleBase::getMaxParticles is assumed. + + \param[in] particleBase PxParticleBase instance to fetch cuda buffers from. + \param[in] validParticleRange valid particle range (index+1, with index being the highest particle index with (PxCudaReadWriteParticleBuffers::flags[index].api & PxParticleFlag::eVALID != 0) + + @see PxParticleDeviceExclusive.getReadWriteCudaBuffers + */ + PX_PHYSX_CORE_API static void setValidParticleRange(class PxParticleBase& particleBase, PxU32 validParticleRange); + + /** + \brief Set flags to control position update for added particles and particles for which position has been set. + @see PxParticleDeviceExclusiveFlags + */ + PX_PHYSX_CORE_API static void setFlags(class PxParticleBase& particleBase, PxParticleDeviceExclusiveFlags flags); + + /** + \brief Query task that launches PhysX particle kernels. + */ + PX_PHYSX_CORE_API static class physx::PxBaseTask* getLaunchTask(class PxParticleBase& particleBase); + + /** + \brief Adds a dependency to the PhysX particle kernel launch task. + + Similarly to PxGpuDispatcher.addPreLaunchDependent and PxGpuDispatcher.addPostLaunchDependent + this adds a reference to the launch task. + */ + PX_PHYSX_CORE_API static void addLaunchTaskDependent(class PxParticleBase& particleBase, class physx::PxBaseTask& dependent); + + /** + \brief Query the cuda stream that is used for the PhysX particle kernels. + \note The stream is not valid if getLaunchTask returns NULL. + \return the cuda stream. + */ + PX_PHYSX_CORE_API static CUstream getCudaStream(class PxParticleBase& particleBase); +}; + +/** +Internal class providing device exclusive mode functionality. (deprecated) + +\deprecated The PhysX particle feature has been deprecated in PhysX version 3.4 +*/ +class PX_DEPRECATED PxParticleDeviceExclusiveAccess +{ +public: + virtual void getReadWriteCudaBuffers(PxCudaReadWriteParticleBuffers& buffers) const = 0; + virtual void setValidParticleRange(PxU32 validParticleRange) = 0; + virtual void setFlags(PxU32 flags) = 0; + virtual class physx::PxBaseTask* getLaunchTask() const = 0; + virtual void addLaunchTaskDependent(class physx::PxBaseTask& dependent) = 0; + virtual size_t getCudaStream() const = 0; +}; + +} + +#endif // PX_SUPPORT_GPU_PHYSX diff --git a/PhysX_3.4/Source/PhysXGpu/include/PxPhysXGpu.h b/PhysX_3.4/Source/PhysXGpu/include/PxPhysXGpu.h new file mode 100644 index 00000000..2d0893cc --- /dev/null +++ b/PhysX_3.4/Source/PhysXGpu/include/PxPhysXGpu.h @@ -0,0 +1,239 @@ +// 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) 2008-2016 NVIDIA Corporation. All rights reserved. +// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved. +// Copyright (c) 2001-2004 NovodeX AG. All rights reserved. + + +#ifndef PX_PHYSX_GPU_H +#define PX_PHYSX_GPU_H + +#include "task/PxTask.h" + +#include "Pxg.h" +#include "Ps.h" +#include "PsArray.h" +#include "PxSceneGpu.h" +#include "foundation/PxBounds3.h" +#include "CmPhysXCommon.h" + +namespace physx +{ + +class PxFoundation; +class PxCudaContextManagerDesc; +struct PxTriangleMeshCacheStatistics; +class PxvNphaseImplementationContext; +class PxsContext; +class PxsKernelWranglerManager; +class PxvNphaseImplementationFallback; +struct PxgDynamicsMemoryConfig; +class PxsMemoryManager; +class PxsHeapMemoryAllocatorManager; +class PxsSimulationController; +class PxsSimulationControllerCallback; + +struct PxvSimStats; + +namespace Bp +{ + class BroadPhase; +} + +namespace Dy +{ + class Context; +} + +namespace IG +{ + class IslandSim; + class SimpleIslandManager; +} + +namespace Cm +{ + class RenderBuffer; + class FlushPool; +} + +/** +\brief Interface to create and run CUDA enabled PhysX features. + +The methods of this interface are expected not to be called concurrently. +Also they are expected to not be called concurrently with any methods of PxSceneGpu and any tasks spawned before the end pipeline ... TODO make clear. +*/ +class PxPhysXGpu +{ +public: + /** + \brief Closes this instance of the interface. + */ + virtual void release() = 0; + + /** + \brief Create a gpu scene instance. (deprecated) + + \param contextManager The PxCudaContextManager the scene is supposed to use. + \param rigidBodyAccess The PxRigidBodyAccessGpu implementation the scene is supposed to use. + \return pointer to gpu scene class (might be NULL on failure). + + \deprecated The PhysX particle feature has been deprecated in PhysX version 3.4 + */ + PX_DEPRECATED virtual class PxSceneGpu* createScene(physx::PxCudaContextManager& contextManager, + class PxRigidBodyAccessGpu& rigidBodyAccess) = 0; + + /** + Mirror a triangle mesh onto the gpu memory corresponding to contextManager. Returns a handle for the mirrored mesh, PX_INVALID_U32 if failed. (deprecated) + + \deprecated The PhysX particle feature has been deprecated in PhysX version 3.4 + */ + PX_DEPRECATED virtual physx::PxU32 createTriangleMeshMirror(const class PxTriangleMesh& triangleMesh, physx::PxCudaContextManager& contextManager) = 0; + + /** + Mirror a height field mesh onto the gpu memory corresponding to contextManager. Returns a handle for the mirrored mesh, PX_INVALID_U32 if failed. (deprecated) + + \deprecated The PhysX particle feature has been deprecated in PhysX version 3.4 + */ + PX_DEPRECATED virtual physx::PxU32 createHeightFieldMirror(const class PxHeightField& heightField, physx::PxCudaContextManager& contextManager) = 0; + + /** + Mirror a convex mesh onto the gpu memory corresponding to contextManager. Returns a handle for the mirrored mesh, PX_INVALID_U32 if failed. (deprecated) + + \deprecated The PhysX particle feature has been deprecated in PhysX version 3.4 + */ + PX_DEPRECATED virtual physx::PxU32 createConvexMeshMirror(const class PxConvexMesh& convexMesh, physx::PxCudaContextManager& contextManager) = 0; + + /** + Release a mesh mirror, providing the mirror handle. The mesh might still be mirrored implicitly if its in contact with particle systems. (deprecated) + + \deprecated The PhysX particle feature has been deprecated in PhysX version 3.4 + */ + PX_DEPRECATED virtual void releaseMirror(physx::PxU32 mirrorHandle) = 0; + + /** + Set the explicit count down counter to explicitly flush the cuda push buffer. (deprecated) + + \deprecated The PhysX particle feature has been deprecated in PhysX version 3.4 + */ + PX_DEPRECATED virtual void setExplicitCudaFlushCountHint(const class PxgSceneGpu& scene, physx::PxU32 cudaFlushCount) = 0; + + /** + Set the amount of memory for triangle mesh cache. Returns true if cache memory is sucessfully allocated, false otherwise. (deprecated) + + \deprecated The PhysX particle feature has been deprecated in PhysX version 3.4 + */ + PX_DEPRECATED virtual bool setTriangleMeshCacheSizeHint(const class PxgSceneGpu& scene, physx::PxU32 size) = 0; + + /** + Gets the usage statistics for triangle mesh cache. Returns PxTriangleMeshCacheStatistics. (deprecated) + + \deprecated The PhysX particle feature has been deprecated in PhysX version 3.4 + */ + PX_DEPRECATED virtual const physx::PxTriangleMeshCacheStatistics& getTriangleMeshCacheStatistics(const class PxgSceneGpu& scene) const = 0; + + /** + Create GPU cloth factory. + */ + virtual cloth::Factory* createClothFactory(int, void*) = 0; + + /** + Create GPU memory manager. + */ + virtual PxsMemoryManager* createGpuMemoryManager(PxGpuDispatcher* gpuDispatcher, class PxGraphicsContextManager* graphicsContextManager) = 0; + + virtual PxsHeapMemoryAllocatorManager* createGpuHeapMemoryAllocatorManager( + const PxU32 heapCapacity, + PxsMemoryManager* memoryManager, + const PxU32 gpuComputeVersion) = 0; + + /** + Create GPU kernel wrangler manager. + */ + virtual PxsKernelWranglerManager* createGpuKernelWranglerManager( + PxGpuDispatcher* gpuDispatcher, + PxErrorCallback& errorCallback, + const PxU32 gpuComputeVersion) = 0; + + /** + Create GPU broadphase. + */ + virtual Bp::BroadPhase* createGpuBroadPhase( + PxsKernelWranglerManager* gpuKernelWrangler, + PxGpuDispatcher* gpuDispatch, + PxGraphicsContextManager* graphicsContext, + const PxU32 gpuComputeVersion, + const PxgDynamicsMemoryConfig& config, + PxsHeapMemoryAllocatorManager* heapMemoryManager) = 0; + + /** + Create GPU narrow phase context. + */ + virtual PxvNphaseImplementationContext* createGpuNphaseImplementationContext(PxsContext& context, + PxsKernelWranglerManager* gpuKernelWrangler, + PxvNphaseImplementationFallback* fallbackForUnsupportedCMs, + const PxgDynamicsMemoryConfig& gpuDynamicsConfig, void* contactStreamBase, void* patchStreamBase, void* forceAndIndiceStreamBase, + Ps::Array<PxBounds3, Ps::VirtualAllocator>& bounds, IG::IslandSim* islandSim, + physx::Dy::Context* dynamicsContext, const PxU32 gpuComputeVersion, PxsHeapMemoryAllocatorManager* heapMemoryManager) = 0; + + /** + Create GPU simulation controller. + */ + virtual PxsSimulationController* createGpuSimulationController(PxsKernelWranglerManager* gpuWranglerManagers, + PxGpuDispatcher* gpuDispatcher, PxGraphicsContextManager* graphicsContextManager, + Dy::Context* dynamicContext, PxvNphaseImplementationContext* npContext, Bp::BroadPhase* bp, + const bool useGpuBroadphase, IG::SimpleIslandManager* simpleIslandSim, + PxsSimulationControllerCallback* callback, const PxU32 gpuComputeVersion, PxsHeapMemoryAllocatorManager* heapMemoryManager) = 0; + + /** + Create GPU dynamics context. + */ + virtual Dy::Context* createGpuDynamicsContext(Cm::FlushPool& taskPool, PxsKernelWranglerManager* gpuKernelWragler, + PxGpuDispatcher* gpuDispatcher, PxGraphicsContextManager* graphicsContextManager, + const PxgDynamicsMemoryConfig& config, IG::IslandSim* accurateIslandSim, const PxU32 maxNumPartitions, + const bool enableStabilization, const bool useEnhancedDeterminism, const bool useAdaptiveForce, + const PxU32 gpuComputeVersion, PxvSimStats& simStats, PxsHeapMemoryAllocatorManager* heapMemoryManager) = 0; + +}; + +} + +/** +Create PxPhysXGpu interface class. +*/ +PX_C_EXPORT PX_PHYSX_GPU_API physx::PxPhysXGpu* PX_CALL_CONV PxCreatePhysXGpu(); + +/** +Create a cuda context manager. +*/ +PX_C_EXPORT PX_PHYSX_GPU_API physx::PxCudaContextManager* PX_CALL_CONV PxCreateCudaContextManager(physx::PxFoundation& foundation, const physx::PxCudaContextManagerDesc& desc); + +/** +Query the device ordinal - depends on control panel settings. +*/ +PX_C_EXPORT PX_PHYSX_GPU_API int PX_CALL_CONV PxGetSuggestedCudaDeviceOrdinal(physx::PxErrorCallback& errc); + +#endif // PX_PHYSX_GPU_H diff --git a/PhysX_3.4/Source/PhysXGpu/include/PxPhysXIndicatorDeviceExclusive.h b/PhysX_3.4/Source/PhysXGpu/include/PxPhysXIndicatorDeviceExclusive.h new file mode 100644 index 00000000..891ace29 --- /dev/null +++ b/PhysX_3.4/Source/PhysXGpu/include/PxPhysXIndicatorDeviceExclusive.h @@ -0,0 +1,71 @@ +// 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) 2008-2016 NVIDIA Corporation. All rights reserved. +// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved. +// Copyright (c) 2001-2004 NovodeX AG. All rights reserved. + + +#ifndef PX_PHYSX_INDICATOR_DEVICE_EXCLUSIVE_H +#define PX_PHYSX_INDICATOR_DEVICE_EXCLUSIVE_H + +#include "PxPhysXCommonConfig.h" + +namespace physx +{ + +/** +\brief API for gpu specific PhysX Indicator functionality. +*/ +class PxPhysXIndicatorDeviceExclusive +{ +public: + + /** + \brief Register external Gpu client of PhysX Indicator. + + By calling this method, the PhysX Indicator will increment the number of external Cpu clients by one. + + \param[in] physics PxPhysics to register the client in. + + @see PxPhysXIndicatorDeviceExclusive.unregisterPhysXIndicatorGpuClient + */ + PX_PHYSX_CORE_API static void registerPhysXIndicatorGpuClient(class PxPhysics& physics); + + /** + \brief Unregister external Gpu client of PhysX Indicator. + + By calling this method, the PhysX Indicator will decrement the number of external Cpu clients by one. + + \param[in] physics PxPhysics to unregister the client in. + + @see PxPhysXIndicatorDeviceExclusive.registerPhysXIndicatorGpuClient + */ + PX_PHYSX_CORE_API static void unregisterPhysXIndicatorGpuClient(class PxPhysics& physics); +}; + +} + +#endif // PX_PHYSX_INDICATOR_DEVICE_EXCLUSIVE_H diff --git a/PhysX_3.4/Source/PhysXGpu/include/PxRigidBodyAccessGpu.h b/PhysX_3.4/Source/PhysXGpu/include/PxRigidBodyAccessGpu.h new file mode 100644 index 00000000..0d1ec748 --- /dev/null +++ b/PhysX_3.4/Source/PhysXGpu/include/PxRigidBodyAccessGpu.h @@ -0,0 +1,68 @@ +// 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) 2008-2016 NVIDIA Corporation. All rights reserved. +// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved. +// Copyright (c) 2001-2004 NovodeX AG. All rights reserved. + + +#ifndef PX_RIGID_BODY_ACCESS_GPU_H +#define PX_RIGID_BODY_ACCESS_GPU_H + +#include "foundation/PxTransform.h" +#include "foundation/PxStrideIterator.h" +#include "GuGeometryUnion.h" + +namespace physx +{ + +class PxRigidBodyAccessGpu +{ +public: + + struct ShapeProperties + { + PxTransform* ownerToWorld; + PxTransform* shapeToOwner; + Gu::GeometryUnion* geometry; + }; + + struct BodyProperties + { + PxStrideIterator<PxTransform> currentTransforms; + PxStrideIterator<PxTransform> previousTransforms; + PxStrideIterator<PxVec3> linearVelocities; + PxStrideIterator<PxVec3> angularVelocities; + PxStrideIterator<PxTransform> body2ActorTransforms; + PxStrideIterator<size_t> cpuBodyHandle; + }; + + virtual void copyShapeProperties(ShapeProperties& shapeProperties, const size_t shape, const size_t body) const = 0; + virtual void copyBodyProperties(BodyProperties& bodyProperties, const size_t* bodies, PxU32 numBodies) const = 0; +}; + +} + +#endif // PX_RIGID_BODY_ACCESS_GPU_H diff --git a/PhysX_3.4/Source/PhysXGpu/include/PxSceneGpu.h b/PhysX_3.4/Source/PhysXGpu/include/PxSceneGpu.h new file mode 100644 index 00000000..5234c93f --- /dev/null +++ b/PhysX_3.4/Source/PhysXGpu/include/PxSceneGpu.h @@ -0,0 +1,104 @@ +// 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) 2008-2016 NVIDIA Corporation. All rights reserved. +// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved. +// Copyright (c) 2001-2004 NovodeX AG. All rights reserved. + + +#ifndef PX_SCENE_GPU_H +#define PX_SCENE_GPU_H + +#include "Ps.h" + +namespace physx +{ + + class PxBaseTask; + +namespace cloth +{ + class Factory; + class Cloth; +} + +namespace Pt +{ + class ParticleSystemSim; + struct ParticleSystemStateDataDesc; + struct ParticleSystemParameter; + struct ParticleShapesUpdateInput; +} + +/** +\brief Interface to manage a set of cuda accelerated feature instances that share the same physx::PxCudaContextManager and PxRigidBodyAccessGpu instance. +*/ +class PxSceneGpu +{ +public: + + /** + \brief release instance. + */ + virtual void release() = 0; + + /** + Adds a particle system to the cuda PhysX lowlevel. Currently the particle system is just associated with a CudaContextManager. + Later it will be will be is some kind of scene level context for batched stepping. + + \param state The particle state to initialize the particle system. For initialization with 0 particles, Pt::ParticleSystemStateDataDesc::validParticleRange == 0. + \param parameter To configure the particle system pipeline + */ + virtual Pt::ParticleSystemSim* addParticleSystem(const Pt::ParticleSystemStateDataDesc& state, const Pt::ParticleSystemParameter& parameter) = 0; + + /** + Removed a particle system from the cuda PhysX lowlevel. + */ + virtual void removeParticleSystem(Pt::ParticleSystemSim* particleSystem) = 0; + + /** + Notify shape change + */ + virtual void onShapeChange(size_t shapeHandle, size_t bodyHandle, bool isDynamic) = 0; + + /** + Batched scheduling of shape generation. Pt::ParticleShapesUpdateInput::shapes ownership transfered to callee. + */ + virtual physx::PxBaseTask& scheduleParticleShapeUpdate(Pt::ParticleSystemSim** particleSystems, Pt::ParticleShapesUpdateInput* inputs, physx::PxU32 batchSize, physx::PxBaseTask& continuation) = 0; + + /** + Batched scheduling of collision input update. + */ + virtual physx::PxBaseTask& scheduleParticleCollisionInputUpdate(Pt::ParticleSystemSim** particleSystems, physx::PxU32 batchSize, physx::PxBaseTask& continuation) = 0; + + /** + Batched scheduling of particles update. + */ + virtual physx::PxBaseTask& scheduleParticlePipeline(Pt::ParticleSystemSim** particleSystems, physx::PxU32 batchSize, physx::PxBaseTask& continuation) = 0; +}; + +} + +#endif // PX_SCENE_GPU_H diff --git a/PhysX_3.4/Source/PhysXGpu/include/Pxg.h b/PhysX_3.4/Source/PhysXGpu/include/Pxg.h new file mode 100644 index 00000000..32f58a67 --- /dev/null +++ b/PhysX_3.4/Source/PhysXGpu/include/Pxg.h @@ -0,0 +1,61 @@ +// 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) 2008-2016 NVIDIA Corporation. All rights reserved. +// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved. +// Copyright (c) 2001-2004 NovodeX AG. All rights reserved. + + +#ifndef PX_GPU_NX +#define PX_GPU_NX + +#include "foundation/Px.h" +#include "PxPhysXConfig.h" + +#if PX_SUPPORT_GPU_PHYSX + +// define API function declaration +#if PX_WINDOWS + #if defined PX_PHYSX_GPU_EXPORTS + #define PX_PHYSX_GPU_API __declspec(dllexport) + #else + #define PX_PHYSX_GPU_API __declspec(dllimport) + #endif +#elif PX_UNIX_FAMILY + #define PX_PHYSX_GPU_API PX_UNIX_EXPORT +#else + #define PX_PHYSX_GPU_API +#endif + +#ifndef PX_C_EXPORT +#define PX_C_EXPORT extern "C" +#endif + +#else // PX_SUPPORT_GPU_PHYSX +#pragma message("Pxg.h is only supported on GPGPU platforms!") +#endif // PX_SUPPORT_GPU_PHYSX + +#endif // PX_GPU_NX + |