Apple contribution for OSX SSE and iOS NEON optimizations unit tests, thanks to Jordan Hubbard, Ian Ollmann and Hristo Hristov.

For OSX:
cd build
./premake_osx xcode4
for iOS:
cd build
./ios_build.sh
./ios_run.sh

Also integrated the branches/StackAllocation to make it easier to multi-thread collision detection in the near future. It avoids changing the btCollisionObject while performing collision detection.

As this is a large patch, some stuff might be temporarily broken, I'll keep an eye out on issues.
This commit is contained in:
erwin.coumans
2012-06-07 00:56:30 +00:00
parent 777b92a2ad
commit 73b217fb07
323 changed files with 30730 additions and 13635 deletions

42
build/Info.plist Executable file
View File

@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIcons</key>
<dict>
<key>CFBundlePrimaryIcon</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>icon.png</string>
</array>
</dict>
</dict>
<key>CFBundleIdentifier</key>
<string>com.yourcompany.${PRODUCT_NAME:identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.5</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIStatusBarHidden</key>
<true/>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
</array>
</dict>
</plist>

66
build/autoexp_dat.txt Normal file
View File

@@ -0,0 +1,66 @@
;------------------------------------------------------------------------------
; Microsoft Visual Studio Debug Visualization for Bullet btVector3 and btAlignedObjectArray
;
; Copy and paste the contents of this file to the end of autoexp.dat, usually located at
; C:\Program Files\Microsoft Visual Studio 8\Common7\Packages\Debugger\autoexp.dat
;------------------------------------------------------------------------------
[Visualizer]
;------------------------------------------------------------------------------
; btVector3
;------------------------------------------------------------------------------
btVector3{
children
(
#array
(
expr : ($c.m_floats)[$i],
size : 4
)
)
preview
(
#(
"[",
#array
(
expr : ($c.m_floats)[$i],
size : 4
),
"]"
)
)
}
;------------------------------------------------------------------------------
; btAlignedObjectArray
;------------------------------------------------------------------------------
btAlignedObjectArray<*>{
children
(
#array
(
expr : ($c.m_data)[$i],
size : $c.m_size
)
)
preview
(
#(
"[",
$c.m_size ,
"](",
#array
(
expr : ($c.m_data)[$i],
size : $c.m_size
),
")"
)
)
}

29
build/bullet.rc Normal file
View File

@@ -0,0 +1,29 @@
// This file is generated automatically.
1 VERSIONINFO
FILEVERSION 2, 79, 0, 0
PRODUCTVERSION 2, 79, 0, 0
#ifdef CS_DEBUG
FILEFLAGS 0x1
#else
FILEFLAGS 0x0
#endif
{
BLOCK "StringFileInfo"
{
BLOCK "040904E4"
{
VALUE "ProductName", "Bullet Continuous Collision Detection and Physics Library"
VALUE "ProductVersion", "2.79"
VALUE "FileVersion", "2.79"
VALUE "LegalCopyright", "Copyright (c) 2005-2011 Erwin Coumans"
#ifdef CS_DEBUG
VALUE "Comments", "Debug build"
#else
VALUE "Comments", "Release build"
#endif
VALUE "WWW", "http://www.bulletphysics.org"
}
}
}
1 ICON "bullet_ico.ico"

BIN
build/bullet_ico.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

36
build/findDirectX11.lua Normal file
View File

@@ -0,0 +1,36 @@
function findDirectX11()
local dx11path = os.getenv("DXSDK_DIR")
if (dx11path) then
local filepath = string.format("%s%s",dx11path,"Include/D3D11.h")
headerdx11 = io.open(filepath, "r")
if (headerdx11) then
printf("Found DX11: '%s'", filepath)
return true
end
end
return false
end
function initDirectX11()
configuration {}
local dx11path = os.getenv("DXSDK_DIR")
defines { "ADL_ENABLE_DX11"}
includedirs {"$(DXSDK_DIR)/include"}
configuration "x32"
libdirs {"$(DXSDK_DIR)/Lib/x86"}
configuration "x64"
libdirs {"$(DXSDK_DIR)/Lib/x64"}
configuration {}
links {"d3dcompiler",
"dxerr",
"dxguid",
"d3dx9",
"d3d9",
"winmm",
"comctl32",
"d3dx11"
}
return true
end

84
build/findOpenCL.lua Normal file
View File

@@ -0,0 +1,84 @@
-- todo: add Apple OpenCL environment vars
function findOpenCL_AMD()
local amdopenclpath = os.getenv("AMDAPPSDKROOT")
if (amdopenclpath) then
return true
end
return false
end
function findOpenCL_NVIDIA()
local nvidiaopenclpath = os.getenv("CUDA_PATH")
if (nvidiaopenclpath) then
return true
end
return false
end
function findOpenCL_Intel()
local intelopenclpath = os.getenv("INTELOCLSDKROOT")
if (intelopenclpath) then
return true
end
return false
end
function initOpenCL_AMD()
configuration {}
local amdopenclpath = os.getenv("AMDAPPSDKROOT")
if (amdopenclpath) then
defines { "ADL_ENABLE_CL" , "CL_PLATFORM_AMD"}
includedirs {
"$(AMDAPPSDKROOT)/include"
}
configuration "x32"
libdirs {"$(AMDAPPSDKROOT)/lib/x86"}
configuration "x64"
libdirs {"$(AMDAPPSDKROOT)/lib/x86_64"}
configuration {}
links {"OpenCL"}
return true
end
return false
end
function initOpenCL_NVIDIA()
configuration {}
local nvidiaopenclpath = os.getenv("CUDA_PATH")
if (nvidiaopenclpath) then
defines { "ADL_ENABLE_CL" , "CL_PLATFORM_NVIDIA"}
includedirs {
"$(CUDA_PATH)/include"
}
configuration "x32"
libdirs {"$(CUDA_PATH)/lib/Win32"}
configuration "x64"
libdirs {"$(CUDA_PATH)/lib/x64"}
configuration {}
links {"OpenCL"}
return true
end
return false
end
function initOpenCL_Intel()
configuration {}
local intelopenclpath = os.getenv("INTELOCLSDKROOT")
if (intelopenclpath) then
defines { "ADL_ENABLE_CL" , "CL_PLATFORM_INTEL"}
includedirs {
"$(INTELOCLSDKROOT)/include"
}
configuration "x32"
libdirs {"$(INTELOCLSDKROOT)/lib/x86"}
configuration "x64"
libdirs {"$(INTELOCLSDKROOT)/lib/x64"}
configuration {}
links {"OpenCL"}
return true
end
return false
end

BIN
build/fruitstrap_osx Executable file

Binary file not shown.

BIN
build/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

3
build/ios_build.sh Executable file
View File

@@ -0,0 +1,3 @@
#!/bin/sh
./premake4_osx --ios xcode4
xcodebuild -project xcode4ios/AppUnitTest.xcodeproj -configuration Release -arch armv7

2
build/ios_run.sh Executable file
View File

@@ -0,0 +1,2 @@
#!/bin/sh
./fruitstrap_osx -d -n -b ../Test/bin/AppUnitTestx32ios.app

BIN
build/premake4.exe Normal file

Binary file not shown.

182
build/premake4.lua Normal file
View File

@@ -0,0 +1,182 @@
--add the 0 so the solution comes first in the directory (when sorted on name)
--print "uncomment this hello premake4 world for debugging the script"
solution "0BulletSolution"
newoption {
trigger = "ios",
description = "Enable iOS target (requires xcode4)"
}
newoption {
trigger = "with-demos",
description = "Enable demos and extras"
}
newoption {
trigger = "with-nacl",
description = "Enable Native Client build"
}
newoption {
trigger = "with-dx11",
description = "Enable DirectX11 build"
}
newoption {
trigger = "with-opencl",
description = "Enable OpenCL builds (various SDKs)"
}
newoption {
trigger = "with-opencl-amd",
description = "Enable OpenCL builds (AMD SDK)"
}
newoption {
trigger = "with-opencl-intel",
description = "Enable OpenCL builds (Intel SDK)"
}
newoption {
trigger = "with-opencl-nvidia",
description = "Enable OpenCL builds (NVIDIA SDK)"
}
configurations {"Release", "Debug"}
configuration "Release"
flags { "Optimize", "StaticRuntime", "NoMinimalRebuild", "FloatFast"}
configuration "Debug"
flags { "Symbols", "StaticRuntime" , "NoMinimalRebuild", "NoEditAndContinue" ,"FloatFast"}
--platforms {"x32", "x64"}
platforms {"x32"}
configuration {"Windows"}
defines { "_CRT_SECURE_NO_WARNINGS","_CRT_SECURE_NO_DEPRECATE"}
configuration{}
postfix="";
if _ACTION == "xcode4" then
if _OPTIONS["ios"] then
postfix = "ios";
defines {"ARM_NEON_GCC_COMPATIBILITY"}
xcodebuildsettings
{
'INFOPLIST_FILE = "../../Test/Info.plist"',
'CODE_SIGN_IDENTITY = "iPhone Developer"',
"SDKROOT = iphoneos",
'ARCHS = "armv7"',
'TARGETED_DEVICE_FAMILY = "1,2"',
'VALID_ARCHS = "armv7"',
}
else
xcodebuildsettings
{
'ARCHS = "$(ARCHS_STANDARD_32_BIT) $(ARCHS_STANDARD_64_BIT)"',
'VALID_ARCHS = "x86_64 i386"',
}
end
else
end
configuration "x32"
targetsuffix ("x32" .. postfix)
configuration "x64"
targetsuffix ("x64" .. postfix)
configuration {"x64", "debug"}
targetsuffix ("x64Debug" .. postfix)
configuration {"x64", "release"}
targetsuffix ("x64" .. postfix)
configuration {"x32", "debug"}
targetsuffix ("Debug" .. postfix)
configuration{}
if not _OPTIONS["with-nacl"] then
flags { "NoRTTI"}
targetdir "../bin"
-- Disable exception handling on MSVC 2008 and higher. MSVC 2005 without service pack has some linker issue (ConvexDecompositionDemo uses STL through HACD library)
if _ACTION == "vs2010" or _ACTION=="vs2008" then
flags { "NoExceptions"}
defines { "_HAS_EXCEPTIONS=0" }
end
-- Multithreaded compiling
if _ACTION == "vs2010" then
buildoptions { "/MP" }
end
else
targetdir "../bin_html"
end
dofile ("findOpenCL.lua")
dofile ("findDirectX11.lua")
language "C++"
location("./" .. _ACTION .. postfix)
if _OPTIONS["with-dx11"] then
include "../Demos/DX11ClothDemo"
include "../src/BulletMultiThreaded/GpuSoftBodySolvers/DX11"
end
--choose any OpenCL sdk that is installed on the system
if _OPTIONS["with-opencl"] then
include "../Demos/OpenCLClothDemo/AMD"
include "../src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/AMD"
include "../Demos/OpenCLClothDemo/NVidia"
include "../src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/NVidia"
include "../Demos/OpenCLClothDemo/Intel"
include "../src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/Intel"
end
--choose a particular OpenCL sdk, this is useful for distributing project files that just work for one OpenCL SDK
if _OPTIONS["with-opencl-amd"] then
include "../Demos/OpenCLClothDemo/AMD"
include "../Demos/OpenGL"
include "../Demos/SoftDemo/AMD"
include "../src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/AMD"
end
if _OPTIONS["with-opencl-intel"] then
include "../Demos/OpenCLClothDemo/Intel"
include "../src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/Intel"
end
if _OPTIONS["with-opencl-nvidia"] then
include "../Demos/OpenCLClothDemo/NVidia"
include "../src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/NVidia"
end
if _OPTIONS["with-demos"] then
include "../Demos"
include "../Extras"
end
if _OPTIONS["with-nacl"] then
include "../Demos/NativeClient"
else
include "../src/LinearMath"
include "../src/BulletCollision"
include "../src/BulletDynamics"
include "../src/BulletSoftBody"
end
include "../Test"
include "../Demos/HelloWorld"
include "../Demos/Benchmarks"

BIN
build/premake4_linux Executable file

Binary file not shown.

BIN
build/premake4_osx Executable file

Binary file not shown.

4
build/vs2005.bat Normal file
View File

@@ -0,0 +1,4 @@
premake4 vs2005
pause

10
build/vs2008.bat Normal file
View File

@@ -0,0 +1,10 @@
rem premake4 --no-pelibs vs2008
rem premake4 --no-pedemos vs2008
rem premake4 --no-bulletlibs --no-pelibs vs2008
rem premake4 --with-nacl vs2008
premake4 vs2008
pause

4
build/vs2010.bat Normal file
View File

@@ -0,0 +1,4 @@
premake4 --with-demos vs2010
pause

5
build/vs2010_dx11.bat Normal file
View File

@@ -0,0 +1,5 @@
premake4 --with-dx11 vs2010
rename vs2010 vs2010_dx11
pause

8
build/vs2010_opencl.bat Normal file
View File

@@ -0,0 +1,8 @@
premake4 --with-opencl-amd vs2010
rename vs2010 vs2010_opencl_amd
pause

36
build/vs_all.bat Normal file
View File

@@ -0,0 +1,36 @@
rem this script is mainly to create distributable visual studio project file
premake4 --with-opencl-nvidia vs2008
rename vs2008 vs2008_opencl_nvidia
premake4 --with-opencl-intel vs2008
rename vs2008 vs2008_opencl_intel
premake4 --with-opencl-amd vs2008
rename vs2008 vs2008_opencl_amd
premake4 --with-opencl-nvidia vs2010
rename vs2010 vs2010_opencl_nvidia
premake4 --with-opencl-intel vs2010
rename vs2010 vs2010_opencl_intel
premake4 --with-opencl-amd vs2010
rename vs2010 vs2010_opencl_amd
premake4 --with-dx11 vs2008
rename vs2008 vs2008_dx11
premake4 --with-dx11 vs2010
rename vs2010 vs2010_dx11
premake4 --with-dx11 vs2005
rename vs2005 vs2005_dx11
premake4 vs2005
premake4 vs2008
premake4 vs2010
pause