Update environment variable to CUDA_PATH (was NVSDKCOMPUTE_ROOT) and fix a few bugs that prevented the NVIDIA OpenCLClothDemo to run properly.
This commit is contained in:
@@ -136,14 +136,14 @@ IF(MSVC)
|
||||
OPTION(BUILD_AMD_OPENCL_DEMOS "Build OpenCL demos for AMD (GPU or CPU)" OFF)
|
||||
ENDIF()
|
||||
|
||||
FIND_PATH(NVIDIA_OPENCL_BASE_DIR OpenCL/common/inc/CL/cl.h PATH $ENV{NVSDKCOMPUTE_ROOT} )
|
||||
FIND_PATH(NVIDIA_OPENCL_BASE_DIR include/CL/cl.h PATH $ENV{CUDA_PATH} )
|
||||
IF(NVIDIA_OPENCL_BASE_DIR)
|
||||
SET(NVIDIA_OPENCL_INCLUDES ${NVIDIA_OPENCL_BASE_DIR}/OpenCL/common/inc )
|
||||
SET(NVIDIA_OPENCL_INCLUDES ${NVIDIA_OPENCL_BASE_DIR}/include )
|
||||
MESSAGE(${NVIDIA_OPENCL_INCLUDES})
|
||||
IF (CMAKE_CL_64)
|
||||
SET(CMAKE_NVSDKCOMPUTE_LIBPATH ${NVIDIA_OPENCL_BASE_DIR}/OpenCL/common/lib/x64 )
|
||||
SET(CMAKE_NVSDKCOMPUTE_LIBPATH ${NVIDIA_OPENCL_BASE_DIR}/lib/x64 )
|
||||
ELSE(CMAKE_CL_64)
|
||||
SET(CMAKE_NVSDKCOMPUTE_LIBPATH ${NVIDIA_OPENCL_BASE_DIR}/OpenCL/common/lib/Win32 )
|
||||
SET(CMAKE_NVSDKCOMPUTE_LIBPATH ${NVIDIA_OPENCL_BASE_DIR}/lib/Win32 )
|
||||
ENDIF(CMAKE_CL_64)
|
||||
SET(NVIDIA_OPENCL_LIBRARIES ${CMAKE_NVSDKCOMPUTE_LIBPATH}/OpenCL.lib)
|
||||
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
|
||||
|
||||
ADD_DEFINITIONS(-DUSE_NVIDIA_OPENCL)
|
||||
ADD_DEFINITIONS(-DCL_PLATFORM_NVIDIA)
|
||||
|
||||
INCLUDE_DIRECTORIES(
|
||||
${BULLET_PHYSICS_SOURCE_DIR}/src
|
||||
${BULLET_PHYSICS_SOURCE_DIR}/Demos/SharedOpenCL
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
|
||||
|
||||
ADD_DEFINITIONS(-DUSE_NVIDIA_OPENCL)
|
||||
ADD_DEFINITIONS(-DCL_PLATFORM_NVIDIA)
|
||||
|
||||
|
||||
INCLUDE_DIRECTORIES(
|
||||
${BULLET_PHYSICS_SOURCE_DIR}/src
|
||||
${BULLET_PHYSICS_SOURCE_DIR}/Demos/SharedOpenCL
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
|
||||
ADD_DEFINITIONS(-DUSE_NVIDIA_OPENCL)
|
||||
ADD_DEFINITIONS(-DCL_PLATFORM_NVIDIA)
|
||||
|
||||
INCLUDE_DIRECTORIES(
|
||||
${BULLET_PHYSICS_SOURCE_DIR}/src
|
||||
${NVIDIA_OPENCL_INCLUDES}
|
||||
|
||||
@@ -1,17 +1,4 @@
|
||||
/*
|
||||
Bullet Continuous Collision Detection and Physics Library
|
||||
Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/
|
||||
|
||||
This software is provided 'as-is', without any express or implied warranty.
|
||||
In no event will the authors be held liable for any damages arising from the use of this software.
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it freely,
|
||||
subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
MSTRINGIFY(
|
||||
|
||||
cbuffer OutputToVertexArrayCB : register( b0 )
|
||||
{
|
||||
@@ -54,4 +41,6 @@ OutputToVertexArrayKernel( uint3 Gid : SV_GroupID, uint3 DTid : SV_DispatchThrea
|
||||
g_vertexBuffer[normalDestination+1] = nodeN.y;
|
||||
g_vertexBuffer[normalDestination+2] = nodeN.z;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
);
|
||||
@@ -524,8 +524,8 @@ bool btOpenCLSoftBodySolverSIMDAware::buildShaders()
|
||||
|
||||
m_updatePositionsFromVelocitiesKernel = m_clFunctions.compileCLKernelFromString( UpdatePositionsFromVelocitiesCLString, "UpdatePositionsFromVelocitiesKernel", "" );
|
||||
m_solvePositionsFromLinksKernel = m_clFunctions.compileCLKernelFromString( SolvePositionsCLString, "SolvePositionsFromLinksKernel", wavefrontMacros );
|
||||
m_updateVelocitiesFromPositionsWithVelocitiesKernel = m_clFunctions.compileCLKernelFromString( UpdateNodesCLString, "m_updateVelocitiesFromPositionsWithVelocitiesKernel", "" );
|
||||
m_updateVelocitiesFromPositionsWithoutVelocitiesKernel = m_clFunctions.compileCLKernelFromString( UpdatePositionsCLString, "m_updateVelocitiesFromPositionsWithoutVelocitiesKernel", "" );
|
||||
m_updateVelocitiesFromPositionsWithVelocitiesKernel = m_clFunctions.compileCLKernelFromString( UpdateNodesCLString, "updateVelocitiesFromPositionsWithVelocitiesKernel", "" );
|
||||
m_updateVelocitiesFromPositionsWithoutVelocitiesKernel = m_clFunctions.compileCLKernelFromString( UpdatePositionsCLString, "updateVelocitiesFromPositionsWithoutVelocitiesKernel", "" );
|
||||
m_integrateKernel = m_clFunctions.compileCLKernelFromString( IntegrateCLString, "IntegrateKernel", "" );
|
||||
m_applyForcesKernel = m_clFunctions.compileCLKernelFromString( ApplyForcesCLString, "ApplyForcesKernel", "" );
|
||||
m_solveCollisionsAndUpdateVelocitiesKernel = m_clFunctions.compileCLKernelFromString( SolveCollisionsAndUpdateVelocitiesCLString, "SolveCollisionsAndUpdateVelocitiesKernel", "" );
|
||||
|
||||
@@ -37,7 +37,6 @@ protected:
|
||||
btSoftBodyLinkDataOpenCLSIMDAware m_linkData;
|
||||
|
||||
|
||||
bool m_shadersInitialized;
|
||||
|
||||
|
||||
bool buildShaders();
|
||||
|
||||
Reference in New Issue
Block a user