diff options
| author | sschirm <[email protected]> | 2016-12-23 14:20:36 +0100 |
|---|---|---|
| committer | sschirm <[email protected]> | 2016-12-23 14:56:17 +0100 |
| commit | ef6937e69e8ee3f409cf9d460d5ad300a65d5924 (patch) | |
| tree | 710426e8daa605551ce3f34b581897011101c30f /APEX_1.4/common | |
| parent | Initial commit: (diff) | |
| download | physx-3.4-ef6937e69e8ee3f409cf9d460d5ad300a65d5924.tar.xz physx-3.4-ef6937e69e8ee3f409cf9d460d5ad300a65d5924.zip | |
PhysX 3.4 / APEX 1.4 release candidate @21506124
Diffstat (limited to 'APEX_1.4/common')
| -rw-r--r-- | APEX_1.4/common/include/ApexMirrored.h | 15 | ||||
| -rw-r--r-- | APEX_1.4/common/include/P4Info.h | 4 | ||||
| -rw-r--r-- | APEX_1.4/common/src/ApexPvdClient.cpp | 48 |
3 files changed, 54 insertions, 13 deletions
diff --git a/APEX_1.4/common/include/ApexMirrored.h b/APEX_1.4/common/include/ApexMirrored.h index 3ae808f7..c232d261 100644 --- a/APEX_1.4/common/include/ApexMirrored.h +++ b/APEX_1.4/common/include/ApexMirrored.h @@ -20,18 +20,21 @@ #include "PxTaskManager.h" #include "PxGpuDispatcher.h" -#include "PxGpuCopyDesc.h" -#include "PxGpuCopyDescQueue.h" -#include "PxCudaContextManager.h" -#include "PxCudaMemoryManager.h" -//#include <cuda.h> #if defined(__CUDACC__) #error "Mirrored arrays should not be visible to CUDA code. Send device pointers to CUDA kernels." #endif -#if !PX_SUPPORT_GPU_PHYSX +#if APEX_CUDA_SUPPORT + +#include "PxGpuCopyDesc.h" +#include "PxGpuCopyDescQueue.h" +#include "PxCudaContextManager.h" +#include "PxCudaMemoryManager.h" + //#include <cuda.h> +#else + #define PX_ALLOC_INFO(name, ID) __FILE__, __LINE__, name, physx::PxAllocId::ID #define PX_ALLOC_INFO_PARAMS_DECL(p0, p1, p2, p3) const char* file = p0, int line = p1, const char* allocName = p2, physx::PxAllocId::Enum allocId = physx::PxAllocId::p3 #define PX_ALLOC_INFO_PARAMS_DEF() const char* file, int line, const char* allocName, physx::PxAllocId::Enum allocId diff --git a/APEX_1.4/common/include/P4Info.h b/APEX_1.4/common/include/P4Info.h index 16ad7efb..5f89a15a 100644 --- a/APEX_1.4/common/include/P4Info.h +++ b/APEX_1.4/common/include/P4Info.h @@ -23,7 +23,7 @@ // components in life support devices or systems without express written approval of // NVIDIA Corporation. // -// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. +// Copyright (c) 2008-2013 NVIDIA Corporation. All rights reserved. #ifndef P4_INFO_H #define P4_INFO_H @@ -36,7 +36,7 @@ #define P4_APEX_BRANCH "trunk" -#define P4_BUILD_TIME "12:20:57, Fri Oct 21, 2016" +#define P4_BUILD_TIME "14:04:28, Thu Aug 6, 2015" #define AUTHOR_DISTRO "empty" diff --git a/APEX_1.4/common/src/ApexPvdClient.cpp b/APEX_1.4/common/src/ApexPvdClient.cpp index 95d24512..5df789e1 100644 --- a/APEX_1.4/common/src/ApexPvdClient.cpp +++ b/APEX_1.4/common/src/ApexPvdClient.cpp @@ -61,6 +61,33 @@ struct SimpleAllocator : public PxAllocatorCallback }; static SimpleAllocator sAllocator; +class SceneRendererClient : public RendererEventClient, public physx::shdfnd::UserAllocated +{ + PX_NOCOPY(SceneRendererClient) +public: + SceneRendererClient(PvdUserRenderer* renderer, PxPvd* pvd) :mRenderer(renderer) + { + mStream = PvdDataStream::create(pvd); + mStream->createInstance(renderer); + } + + ~SceneRendererClient() + { + mStream->destroyInstance(mRenderer); + mStream->release(); + } + + virtual void handleBufferFlush(const uint8_t* inData, uint32_t inLength) + { + mStream->setPropertyValue(mRenderer, "events", inData, inLength); + } + +private: + + PvdUserRenderer* mRenderer; + PvdDataStream* mStream; +}; + class ApexPvdClientImpl : public UserAllocated, public ApexPvdClient, public PxAllocatorCallback { PX_NOCOPY(ApexPvdClientImpl) @@ -70,6 +97,7 @@ class ApexPvdClientImpl : public UserAllocated, public ApexPvdClient, public PxA Array<void*> mInstances; PvdDataStream* mDataStream; PvdUserRenderer* mRenderer; + RendererEventClient* mRenderClient; PvdParameterizedHandler* mParameterizedHandler; public: @@ -83,6 +111,7 @@ public: ApexPvdClientImpl( PxPvd* inPvd ) : mDataStream( NULL ) , mRenderer( NULL ) + , mRenderClient(NULL) , mParameterizedHandler( NULL ) , mIsConnected(false) { @@ -119,6 +148,8 @@ public: mIsConnected = true; mDataStream = PvdDataStream::create(mPvd); mRenderer = PvdUserRenderer::create(); + mRenderClient = PX_NEW(SceneRendererClient)(mRenderer, mPvd); + mRenderer->setClient(mRenderClient); mParameterizedHandler = PX_NEW(PvdParameterizedHandler)(*mDataStream); @@ -156,6 +187,12 @@ public: mDataStream = NULL; } + if (mRenderClient != NULL) + { + PX_DELETE(mRenderClient); + mRenderClient = NULL; + } + if ( mRenderer != NULL ) { mRenderer->release(); @@ -205,12 +242,13 @@ public: //mDataStream->setPropertyValue( ensureInstance( inInstance ), 1, createSection( SectionType::End ) ); - PxPvdTransport* transport = mPvd->getTransport(); - if ( transport ) - { + //PxPvdTransport* transport = mPvd->getTransport(); + //if ( transport ) + //{ //Flushes memory and profiling events out of any buffered areas. - transport->flush(); - } + // transport->flush(); + //} + mPvd->flush(); mDataStream->endSection( ensureInstance( inInstance ), "ApexFrame"); |