diff options
| author | Miles Macklin <[email protected]> | 2017-03-10 14:51:31 +1300 |
|---|---|---|
| committer | Miles Macklin <[email protected]> | 2017-03-10 14:51:31 +1300 |
| commit | ad3d90fafe5ee79964bdfe1f1e0704c3ffcdfd5f (patch) | |
| tree | 4cc6f3288363889d7342f7f8407c0251e6904819 /extensions | |
| download | flex-ad3d90fafe5ee79964bdfe1f1e0704c3ffcdfd5f.tar.xz flex-ad3d90fafe5ee79964bdfe1f1e0704c3ffcdfd5f.zip | |
Initial 1.1.0 binary release
Diffstat (limited to 'extensions')
46 files changed, 6785 insertions, 0 deletions
diff --git a/extensions/compiler/makeandroid/Makefile b/extensions/compiler/makeandroid/Makefile new file mode 100644 index 0000000..e03f411 --- /dev/null +++ b/extensions/compiler/makeandroid/Makefile @@ -0,0 +1,202 @@ +#!/usr/bin/make +# Makefile generated by XPJ for android + +DEPSDIR = .deps +NDKROOT = "$(NDK_ROOT)"/"$(NDK_VERSION)" +NDK_BIN_DIR = "$(NDK_ROOT)"/"$(NDK_VERSION)"/toolchains/"$(NDK_TOOLCHAIN)"/prebuilt/"linux-x86_64"/bin +NDK_PREFIX = arm-linux-androideabi- +JAVA_HOME = ./../xpj/"$(JAVA_HOME)" +ANT_TOOL = ./../xpj/"$(ANT_HOME}"/bin/ant +#default defines +OBJS_DIR = build +RMDIR = rm -fr +ECHO = echo +CCLD = $(NDK_BIN_DIR)/$(NDK_PREFIX)g++ +CXX = $(NDK_BIN_DIR)/$(NDK_PREFIX)g++ +CC = $(NDK_BIN_DIR)/$(NDK_PREFIX)gcc +RANLIB = $(NDK_BIN_DIR)/$(NDK_PREFIX)ranlib +AR = $(NDK_BIN_DIR)/$(NDK_PREFIX)ar +STRIP = $(NDK_BIN_DIR)/$(NDK_PREFIX)strip +OBJDUMP = $(NDK_BIN_DIR)/$(NDK_PREFIX)objdump +OBJCOPY = $(NDK_BIN_DIR)/$(NDK_PREFIX)objcopy +-include Makedefs.ANDROID.mk + +all: debug release + +debug: build_flexExtCUDA_debug + +release: build_flexExtCUDA_release + +clean: clean_flexExtCUDA_release clean_flexExtCUDA_debug + rm -rf $(DEPSDIR) + + +clean_release: clean_flexExtCUDA_release + rm -rf $(DEPSDIR) + + +clean_debug: clean_flexExtCUDA_debug + rm -rf $(DEPSDIR) + + +include Makefile.flexExtCUDA.mk + + +# Disable implicit rules to speedup build +.SUFFIXES: +SUFFIXES := +%.out: +%.a: +%.ln: +%.o: +%: %.o +%.c: +%: %.c +%.ln: %.c +%.o: %.c +%.cc: +%: %.cc +%.o: %.cc +%.C: +%: %.C +%.o: %.C +%.cpp: +%: %.cpp +%.o: %.cpp +%.p: +%: %.p +%.o: %.p +%.f: +%: + %.f%.o: %.f +%.F: +%: %.F +%.o: %.F +%.f: %.F +%.r: +%: %.r +%.o: %.r +%.f: %.r +%.y: +%.ln: %.y +%.c: %.y +%.l: +%.ln: %.l +%.c: %.l +%.r: %.l +%.s: +%: %.s +%.o: %.s +%.S: +%: %.S +%.o: %.S +%.s: %.S +%.mod: +%: %.mod +%.o: %.mod +%.sym: +%.def: +%.sym: %.def +%.h: +%.info: +%.dvi: +%.tex: +%.dvi: %.tex +%.texinfo: +%.info: %.texinfo +%.dvi: %.texinfo +%.texi: +%.info: %.texi +%.dvi: %.texi +%.txinfo: +%.info: %.txinfo +%.dvi: %.txinfo +%.w: +%.c: %.w +%.tex: %.w +%.ch: +%.web: +%.p: %.web +%.tex: %.web +%.sh: +%: %.sh +%.elc: +%.el: +(%): % +%.out: % +%.c: %.w %.ch +%.tex: %.w %.ch +%: %,v +%: RCS/%,v +%: RCS/% +%: s.% +%: SCCS/s.% +.web.p: +.l.r: +.dvi: +.F.o: +.l: +.y.ln: +.o: +.y: +.def.sym: +.p.o: +.p: +.txinfo.dvi: +.a: +.l.ln: +.w.c: +.texi.dvi: +.sh: +.cc: +.cc.o: +.def: +.c.o: +.r.o: +.r: +.info: +.elc: +.l.c: +.out: +.C: +.r.f: +.S: +.texinfo.info: +.c: +.w.tex: +.c.ln: +.s.o: +.s: +.texinfo.dvi: +.el: +.texinfo: +.y.c: +.web.tex: +.texi.info: +.DEFAULT: +.h: +.tex.dvi: +.cpp.o: +.cpp: +.C.o: +.ln: +.texi: +.txinfo: +.tex: +.txinfo.info: +.ch: +.S.s: +.mod: +.mod.o: +.F.f: +.w: +.S.o: +.F: +.web: +.sym: +.f: +.f.o: +export VERBOSE +ifndef VERBOSE +.SILENT: +endif diff --git a/extensions/compiler/makeandroid/Makefile.flexCUDA.mk b/extensions/compiler/makeandroid/Makefile.flexCUDA.mk new file mode 100644 index 0000000..2f9e44a --- /dev/null +++ b/extensions/compiler/makeandroid/Makefile.flexCUDA.mk @@ -0,0 +1,225 @@ +# Makefile generated by XPJ for android +-include Makefile.custom +ProjectName = flexCUDA +flexCUDA_cppfiles += ./../../../src/cuda/util.cpp +flexCUDA_cuda_src_cuda_bvh_cu += ./../../../src/cuda/bvh.cu +flexCUDA_cuda_src_cuda_flex_cu += ./../../../src/cuda/flex.cu +flexCUDA_cuda_src_cuda_sort_cu += ./../../../src/cuda/sort.cu + +flexCUDA_cpp_release_dep = $(addprefix $(DEPSDIR)/flexCUDA/release/, $(subst ./, , $(subst ../, , $(patsubst %.cpp, %.cpp.P, $(flexCUDA_cppfiles))))) +flexCUDA_cc_release_dep = $(addprefix $(DEPSDIR)/, $(subst ./, , $(subst ../, , $(patsubst %.cc, %.cc.release.P, $(flexCUDA_ccfiles))))) +flexCUDA_c_release_dep = $(addprefix $(DEPSDIR)/flexCUDA/release/, $(subst ./, , $(subst ../, , $(patsubst %.c, %.c.P, $(flexCUDA_cfiles))))) +flexCUDA_release_dep = $(flexCUDA_cpp_release_dep) $(flexCUDA_cc_release_dep) $(flexCUDA_c_release_dep) +-include $(flexCUDA_release_dep) +flexCUDA_cpp_debug_dep = $(addprefix $(DEPSDIR)/flexCUDA/debug/, $(subst ./, , $(subst ../, , $(patsubst %.cpp, %.cpp.P, $(flexCUDA_cppfiles))))) +flexCUDA_cc_debug_dep = $(addprefix $(DEPSDIR)/, $(subst ./, , $(subst ../, , $(patsubst %.cc, %.cc.debug.P, $(flexCUDA_ccfiles))))) +flexCUDA_c_debug_dep = $(addprefix $(DEPSDIR)/flexCUDA/debug/, $(subst ./, , $(subst ../, , $(patsubst %.c, %.c.P, $(flexCUDA_cfiles))))) +flexCUDA_debug_dep = $(flexCUDA_cpp_debug_dep) $(flexCUDA_cc_debug_dep) $(flexCUDA_c_debug_dep) +-include $(flexCUDA_debug_dep) +flexCUDA_release_hpaths := +flexCUDA_release_hpaths += ./../../.. +flexCUDA_release_hpaths += ./../../../../../../external/android-ndk/android-ndk-r10e-linux/platforms/android-15/arch-arm/usr/include +flexCUDA_release_hpaths += ./../../../../../../external/android-ndk/android-ndk-r10e-linux/sources/cxx-stl/stlport/stlport +flexCUDA_release_hpaths += ./../../../../../../external/CUDA/cuda-6.0-linux/targets/armv7-linux-androideabi/include +flexCUDA_release_lpaths := +flexCUDA_release_lpaths += ./../../../../../../external/CUDA/cuda-6.0-linux/targets/armv7-linux-androideabi/lib +flexCUDA_release_lpaths += ./../../../lib/android +flexCUDA_release_lpaths += ./../../../../../../external/android-ndk/android-ndk-r10e-linux/sources/cxx-stl/stlport/libs/armeabi-v7a +flexCUDA_release_defines := $(flexCUDA_custom_defines) +flexCUDA_release_defines += android +flexCUDA_release_defines += ANDROID=1 +flexCUDA_release_defines += ANDROID_PLAT=1 +flexCUDA_release_defines += DISABLE_IMPORTGL +flexCUDA_release_libraries := +flexCUDA_release_common_cflags := $(flexCUDA_custom_cflags) +flexCUDA_release_common_cflags += -MMD +flexCUDA_release_common_cflags += $(addprefix -D, $(flexCUDA_release_defines)) +flexCUDA_release_common_cflags += $(addprefix -I, $(flexCUDA_release_hpaths)) +flexCUDA_release_cflags := $(flexCUDA_release_common_cflags) +flexCUDA_release_cflags += -Wall -std=c++11 -fpermissive -fno-strict-aliasing -fno-rtti -fno-exceptions +flexCUDA_release_cflags += -O3 -ffast-math +flexCUDA_release_cppflags := $(flexCUDA_release_common_cflags) +flexCUDA_release_cppflags += -Wall -std=c++11 -fpermissive -fno-strict-aliasing -fno-rtti -fno-exceptions +flexCUDA_release_cppflags += -O3 -ffast-math +flexCUDA_release_lflags := $(flexCUDA_custom_lflags) +flexCUDA_release_lflags += $(addprefix -L, $(flexCUDA_release_lpaths)) +flexCUDA_release_lflags += -Wl,--start-group $(addprefix -l, $(flexCUDA_release_libraries)) -Wl,--end-group +flexCUDA_release_objsdir = $(OBJS_DIR)/flexCUDA_release +flexCUDA_release_cpp_o = $(addprefix $(flexCUDA_release_objsdir)/, $(subst ./, , $(subst ../, , $(patsubst %.cpp, %.cpp.o, $(flexCUDA_cppfiles))))) +flexCUDA_release_cc_o = $(addprefix $(flexCUDA_release_objsdir)/, $(subst ./, , $(subst ../, , $(patsubst %.cc, %.cc.o, $(flexCUDA_ccfiles))))) +flexCUDA_release_c_o = $(addprefix $(flexCUDA_release_objsdir)/, $(subst ./, , $(subst ../, , $(patsubst %.c, %.c.o, $(flexCUDA_cfiles))))) +flexCUDA_release_cuda_src_cuda_bvh_cu_o += $(OBJS_DIR)/flexCUDA_release/cuda/src/cudabvh.o +flexCUDA_release_cuda_src_cuda_flex_cu_o += $(OBJS_DIR)/flexCUDA_release/cuda/src/cudaflex.o +flexCUDA_release_cuda_src_cuda_sort_cu_o += $(OBJS_DIR)/flexCUDA_release/cuda/src/cudasort.o +flexCUDA_release_obj = $(flexCUDA_release_cpp_o) $(flexCUDA_release_cc_o) $(flexCUDA_release_c_o) $(flexCUDA_release_cuda_src_cuda_bvh_cu_o) $(flexCUDA_release_cuda_src_cuda_flex_cu_o) $(flexCUDA_release_cuda_src_cuda_sort_cu_o) +flexCUDA_release_bin := ./../../../lib/android/libNvFlexReleaseCUDA_armv7l.a + +clean_flexCUDA_release: + @$(ECHO) clean flexCUDA release + @$(RMDIR) $(flexCUDA_release_objsdir) + @$(RMDIR) $(flexCUDA_release_bin) + @$(RMDIR) $(DEPSDIR)/flexCUDA/release + +build_flexCUDA_release: postbuild_flexCUDA_release +postbuild_flexCUDA_release: mainbuild_flexCUDA_release +mainbuild_flexCUDA_release: prebuild_flexCUDA_release $(flexCUDA_release_bin) +prebuild_flexCUDA_release: + +$(flexCUDA_release_bin): $(flexCUDA_release_obj) + mkdir -p `dirname ./../../../lib/android/libNvFlexReleaseCUDA_armv7l.a` + @$(AR) rcs $(flexCUDA_release_bin) $(flexCUDA_release_obj) + $(ECHO) building $@ complete! + +$(flexCUDA_release_cuda_src_cuda_bvh_cu_o): $(flexCUDA_cuda_src_cuda_bvh_cu) + @mkdir -p `dirname $(OBJS_DIR)/flexCUDA_release/cuda/src/cudabvh.o` + $(ECHO) "../../../../../../external/CUDA/cuda-6.0-linux/bin/nvcc" -ccbin /home/mmacklin/swhost/devrel/libdev/flex/dev/main/../../../external/android-ndk/android-ndk-r10e-linux/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin/arm-linux-androideabi-g++ -target-cpu-arch=ARM -m32 -arch=sm_32 -O3 -Xptxas -dlcm=ca -target-os-variant=Android -I"../../../../../../external/CUDA/cuda-6.0-linux/targets/armv7-linux-androideabi/include" -I"../../.." -I"/home/mmacklin/swhost/devrel/libdev/flex/dev/main/../../../external/android-ndk/android-ndk-r10e-linux/sources/cxx-stl/stlport/stlport" -I"/home/mmacklin/swhost/devrel/libdev/flex/dev/main/../../../external/android-ndk/android-ndk-r10e-linux/platforms/android-15/arch-arm/usr/include" --compile "../../../src/cuda/bvh.cu" -o "$(OBJS_DIR)/flexCUDA_release/cuda/src/cudabvh.o" + "../../../../../../external/CUDA/cuda-6.0-linux/bin/nvcc" -ccbin /home/mmacklin/swhost/devrel/libdev/flex/dev/main/../../../external/android-ndk/android-ndk-r10e-linux/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin/arm-linux-androideabi-g++ -target-cpu-arch=ARM -m32 -arch=sm_32 -O3 -Xptxas -dlcm=ca -target-os-variant=Android -I"../../../../../../external/CUDA/cuda-6.0-linux/targets/armv7-linux-androideabi/include" -I"../../.." -I"/home/mmacklin/swhost/devrel/libdev/flex/dev/main/../../../external/android-ndk/android-ndk-r10e-linux/sources/cxx-stl/stlport/stlport" -I"/home/mmacklin/swhost/devrel/libdev/flex/dev/main/../../../external/android-ndk/android-ndk-r10e-linux/platforms/android-15/arch-arm/usr/include" --compile "../../../src/cuda/bvh.cu" -o "$(OBJS_DIR)/flexCUDA_release/cuda/src/cudabvh.o" + +$(flexCUDA_release_cuda_src_cuda_flex_cu_o): $(flexCUDA_cuda_src_cuda_flex_cu) + @mkdir -p `dirname $(OBJS_DIR)/flexCUDA_release/cuda/src/cudaflex.o` + $(ECHO) "../../../../../../external/CUDA/cuda-6.0-linux/bin/nvcc" -ccbin /home/mmacklin/swhost/devrel/libdev/flex/dev/main/../../../external/android-ndk/android-ndk-r10e-linux/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin/arm-linux-androideabi-g++ -target-cpu-arch=ARM -m32 -arch=sm_32 -O3 -Xptxas -dlcm=ca -target-os-variant=Android -I"../../../../../../external/CUDA/cuda-6.0-linux/targets/armv7-linux-androideabi/include" -I"../../.." -I"/home/mmacklin/swhost/devrel/libdev/flex/dev/main/../../../external/android-ndk/android-ndk-r10e-linux/sources/cxx-stl/stlport/stlport" -I"/home/mmacklin/swhost/devrel/libdev/flex/dev/main/../../../external/android-ndk/android-ndk-r10e-linux/platforms/android-15/arch-arm/usr/include" --compile "../../../src/cuda/flex.cu" -o "$(OBJS_DIR)/flexCUDA_release/cuda/src/cudaflex.o" + "../../../../../../external/CUDA/cuda-6.0-linux/bin/nvcc" -ccbin /home/mmacklin/swhost/devrel/libdev/flex/dev/main/../../../external/android-ndk/android-ndk-r10e-linux/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin/arm-linux-androideabi-g++ -target-cpu-arch=ARM -m32 -arch=sm_32 -O3 -Xptxas -dlcm=ca -target-os-variant=Android -I"../../../../../../external/CUDA/cuda-6.0-linux/targets/armv7-linux-androideabi/include" -I"../../.." -I"/home/mmacklin/swhost/devrel/libdev/flex/dev/main/../../../external/android-ndk/android-ndk-r10e-linux/sources/cxx-stl/stlport/stlport" -I"/home/mmacklin/swhost/devrel/libdev/flex/dev/main/../../../external/android-ndk/android-ndk-r10e-linux/platforms/android-15/arch-arm/usr/include" --compile "../../../src/cuda/flex.cu" -o "$(OBJS_DIR)/flexCUDA_release/cuda/src/cudaflex.o" + +$(flexCUDA_release_cuda_src_cuda_sort_cu_o): $(flexCUDA_cuda_src_cuda_sort_cu) + @mkdir -p `dirname $(OBJS_DIR)/flexCUDA_release/cuda/src/cudasort.o` + $(ECHO) "../../../../../../external/CUDA/cuda-6.0-linux/bin/nvcc" -ccbin /home/mmacklin/swhost/devrel/libdev/flex/dev/main/../../../external/android-ndk/android-ndk-r10e-linux/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin/arm-linux-androideabi-g++ -target-cpu-arch=ARM -m32 -arch=sm_32 -O3 -Xptxas -dlcm=ca -target-os-variant=Android -I"../../../../../../external/CUDA/cuda-6.0-linux/targets/armv7-linux-androideabi/include" -I"../../.." -I"/home/mmacklin/swhost/devrel/libdev/flex/dev/main/../../../external/android-ndk/android-ndk-r10e-linux/sources/cxx-stl/stlport/stlport" -I"/home/mmacklin/swhost/devrel/libdev/flex/dev/main/../../../external/android-ndk/android-ndk-r10e-linux/platforms/android-15/arch-arm/usr/include" --compile "../../../src/cuda/sort.cu" -o "$(OBJS_DIR)/flexCUDA_release/cuda/src/cudasort.o" + "../../../../../../external/CUDA/cuda-6.0-linux/bin/nvcc" -ccbin /home/mmacklin/swhost/devrel/libdev/flex/dev/main/../../../external/android-ndk/android-ndk-r10e-linux/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin/arm-linux-androideabi-g++ -target-cpu-arch=ARM -m32 -arch=sm_32 -O3 -Xptxas -dlcm=ca -target-os-variant=Android -I"../../../../../../external/CUDA/cuda-6.0-linux/targets/armv7-linux-androideabi/include" -I"../../.." -I"/home/mmacklin/swhost/devrel/libdev/flex/dev/main/../../../external/android-ndk/android-ndk-r10e-linux/sources/cxx-stl/stlport/stlport" -I"/home/mmacklin/swhost/devrel/libdev/flex/dev/main/../../../external/android-ndk/android-ndk-r10e-linux/platforms/android-15/arch-arm/usr/include" --compile "../../../src/cuda/sort.cu" -o "$(OBJS_DIR)/flexCUDA_release/cuda/src/cudasort.o" + +flexCUDA_release_DEPDIR = $(dir $(@))/$(*F) +$(flexCUDA_release_cpp_o): $(flexCUDA_release_objsdir)/%.o: + $(ECHO) flexCUDA: compiling release $(filter %$(strip $(subst .cpp.o,.cpp, $(subst $(flexCUDA_release_objsdir),, $@))), $(flexCUDA_cppfiles))... + mkdir -p $(dir $(@)) + $(CXX) $(flexCUDA_release_cppflags) -c $(filter %$(strip $(subst .cpp.o,.cpp, $(subst $(flexCUDA_release_objsdir),, $@))), $(flexCUDA_cppfiles)) -o $@ + @mkdir -p $(dir $(addprefix $(DEPSDIR)/flexCUDA/release/, $(subst ./, , $(subst ../, , $(filter %$(strip $(subst .cpp.o,.cpp, $(subst $(flexCUDA_release_objsdir),, $@))), $(flexCUDA_cppfiles)))))) + cp $(flexCUDA_release_DEPDIR).d $(addprefix $(DEPSDIR)/flexCUDA/release/, $(subst ./, , $(subst ../, , $(filter %$(strip $(subst .cpp.o,.cpp, $(subst $(flexCUDA_release_objsdir),, $@))), $(flexCUDA_cppfiles))))).P; \ + sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \ + -e '/^$$/ d' -e 's/$$/ :/' < $(flexCUDA_release_DEPDIR).d >> $(addprefix $(DEPSDIR)/flexCUDA/release/, $(subst ./, , $(subst ../, , $(filter %$(strip $(subst .cpp.o,.cpp, $(subst $(flexCUDA_release_objsdir),, $@))), $(flexCUDA_cppfiles))))).P; \ + rm -f $(flexCUDA_release_DEPDIR).d + +$(flexCUDA_release_cc_o): $(flexCUDA_release_objsdir)/%.o: + $(ECHO) flexCUDA: compiling release $(filter %$(strip $(subst .cc.o,.cc, $(subst $(flexCUDA_release_objsdir),, $@))), $(flexCUDA_ccfiles))... + mkdir -p $(dir $(@)) + $(CXX) $(flexCUDA_release_cppflags) -c $(filter %$(strip $(subst .cc.o,.cc, $(subst $(flexCUDA_release_objsdir),, $@))), $(flexCUDA_ccfiles)) -o $@ + mkdir -p $(dir $(addprefix $(DEPSDIR)/, $(subst ./, , $(subst ../, , $(filter %$(strip $(subst .cc.o,.cc, $(subst $(flexCUDA_release_objsdir),, $@))), $(flexCUDA_ccfiles)))))) + cp $(flexCUDA_release_DEPDIR).d $(addprefix $(DEPSDIR)/, $(subst ./, , $(subst ../, , $(filter %$(strip $(subst .cc.o,.cc, $(subst $(flexCUDA_release_objsdir),, $@))), $(flexCUDA_ccfiles))))).release.P; \ + sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \ + -e '/^$$/ d' -e 's/$$/ :/' < $(flexCUDA_release_DEPDIR).d >> $(addprefix $(DEPSDIR)/, $(subst ./, , $(subst ../, , $(filter %$(strip $(subst .cc.o,.cc, $(subst $(flexCUDA_release_objsdir),, $@))), $(flexCUDA_ccfiles))))).release.P; \ + rm -f $(flexCUDA_release_DEPDIR).d + +$(flexCUDA_release_c_o): $(flexCUDA_release_objsdir)/%.o: + $(ECHO) flexCUDA: compiling release $(filter %$(strip $(subst .c.o,.c, $(subst $(flexCUDA_release_objsdir),, $@))), $(flexCUDA_cfiles))... + mkdir -p $(dir $(@)) + $(CC) $(flexCUDA_release_cflags) -c $(filter %$(strip $(subst .c.o,.c, $(subst $(flexCUDA_release_objsdir),, $@))), $(flexCUDA_cfiles)) -o $@ + @mkdir -p $(dir $(addprefix $(DEPSDIR)/flexCUDA/release/, $(subst ./, , $(subst ../, , $(filter %$(strip $(subst .c.o,.c, $(subst $(flexCUDA_release_objsdir),, $@))), $(flexCUDA_cfiles)))))) + cp $(flexCUDA_release_DEPDIR).d $(addprefix $(DEPSDIR)/flexCUDA/release/, $(subst ./, , $(subst ../, , $(filter %$(strip $(subst .c.o,.c, $(subst $(flexCUDA_release_objsdir),, $@))), $(flexCUDA_cfiles))))).P; \ + sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \ + -e '/^$$/ d' -e 's/$$/ :/' < $(flexCUDA_release_DEPDIR).d >> $(addprefix $(DEPSDIR)/flexCUDA/release/, $(subst ./, , $(subst ../, , $(filter %$(strip $(subst .c.o,.c, $(subst $(flexCUDA_release_objsdir),, $@))), $(flexCUDA_cfiles))))).P; \ + rm -f $(flexCUDA_release_DEPDIR).d + +flexCUDA_debug_hpaths := +flexCUDA_debug_hpaths += ./../../.. +flexCUDA_debug_hpaths += ./../../../../../../external/android-ndk/android-ndk-r10e-linux/platforms/android-15/arch-arm/usr/include +flexCUDA_debug_hpaths += ./../../../../../../external/android-ndk/android-ndk-r10e-linux/sources/cxx-stl/stlport/stlport +flexCUDA_debug_hpaths += ./../../../../../../external/CUDA/cuda-6.0-linux/targets/armv7-linux-androideabi/include +flexCUDA_debug_lpaths := +flexCUDA_debug_lpaths += ./../../../../../../external/CUDA/cuda-6.0-linux/targets/armv7-linux-androideabi/lib +flexCUDA_debug_lpaths += ./../../../lib/android +flexCUDA_debug_lpaths += ./../../../../../../external/android-ndk/android-ndk-r10e-linux/sources/cxx-stl/stlport/libs/armeabi-v7a +flexCUDA_debug_defines := $(flexCUDA_custom_defines) +flexCUDA_debug_defines += android +flexCUDA_debug_defines += ANDROID=1 +flexCUDA_debug_defines += ANDROID_PLAT=1 +flexCUDA_debug_defines += DISABLE_IMPORTGL +flexCUDA_debug_libraries := +flexCUDA_debug_common_cflags := $(flexCUDA_custom_cflags) +flexCUDA_debug_common_cflags += -MMD +flexCUDA_debug_common_cflags += $(addprefix -D, $(flexCUDA_debug_defines)) +flexCUDA_debug_common_cflags += $(addprefix -I, $(flexCUDA_debug_hpaths)) +flexCUDA_debug_cflags := $(flexCUDA_debug_common_cflags) +flexCUDA_debug_cflags += -Wall -std=c++11 -fpermissive -fno-strict-aliasing -fno-rtti -fno-exceptions +flexCUDA_debug_cflags += -g -O0 +flexCUDA_debug_cppflags := $(flexCUDA_debug_common_cflags) +flexCUDA_debug_cppflags += -Wall -std=c++11 -fpermissive -fno-strict-aliasing -fno-rtti -fno-exceptions +flexCUDA_debug_cppflags += -g -O0 +flexCUDA_debug_lflags := $(flexCUDA_custom_lflags) +flexCUDA_debug_lflags += $(addprefix -L, $(flexCUDA_debug_lpaths)) +flexCUDA_debug_lflags += -Wl,--start-group $(addprefix -l, $(flexCUDA_debug_libraries)) -Wl,--end-group +flexCUDA_debug_objsdir = $(OBJS_DIR)/flexCUDA_debug +flexCUDA_debug_cpp_o = $(addprefix $(flexCUDA_debug_objsdir)/, $(subst ./, , $(subst ../, , $(patsubst %.cpp, %.cpp.o, $(flexCUDA_cppfiles))))) +flexCUDA_debug_cc_o = $(addprefix $(flexCUDA_debug_objsdir)/, $(subst ./, , $(subst ../, , $(patsubst %.cc, %.cc.o, $(flexCUDA_ccfiles))))) +flexCUDA_debug_c_o = $(addprefix $(flexCUDA_debug_objsdir)/, $(subst ./, , $(subst ../, , $(patsubst %.c, %.c.o, $(flexCUDA_cfiles))))) +flexCUDA_debug_cuda_src_cuda_bvh_cu_o += $(OBJS_DIR)/flexCUDA_debug/cuda/src/cudabvh.o +flexCUDA_debug_cuda_src_cuda_flex_cu_o += $(OBJS_DIR)/flexCUDA_debug/cuda/src/cudaflex.o +flexCUDA_debug_cuda_src_cuda_sort_cu_o += $(OBJS_DIR)/flexCUDA_debug/cuda/src/cudasort.o +flexCUDA_debug_obj = $(flexCUDA_debug_cpp_o) $(flexCUDA_debug_cc_o) $(flexCUDA_debug_c_o) $(flexCUDA_debug_cuda_src_cuda_bvh_cu_o) $(flexCUDA_debug_cuda_src_cuda_flex_cu_o) $(flexCUDA_debug_cuda_src_cuda_sort_cu_o) +flexCUDA_debug_bin := ./../../../lib/android/libNvFlexDebugCUDA_armv7l.a + +clean_flexCUDA_debug: + @$(ECHO) clean flexCUDA debug + @$(RMDIR) $(flexCUDA_debug_objsdir) + @$(RMDIR) $(flexCUDA_debug_bin) + @$(RMDIR) $(DEPSDIR)/flexCUDA/debug + +build_flexCUDA_debug: postbuild_flexCUDA_debug +postbuild_flexCUDA_debug: mainbuild_flexCUDA_debug +mainbuild_flexCUDA_debug: prebuild_flexCUDA_debug $(flexCUDA_debug_bin) +prebuild_flexCUDA_debug: + +$(flexCUDA_debug_bin): $(flexCUDA_debug_obj) + mkdir -p `dirname ./../../../lib/android/libNvFlexDebugCUDA_armv7l.a` + @$(AR) rcs $(flexCUDA_debug_bin) $(flexCUDA_debug_obj) + $(ECHO) building $@ complete! + +$(flexCUDA_debug_cuda_src_cuda_bvh_cu_o): $(flexCUDA_cuda_src_cuda_bvh_cu) + @mkdir -p `dirname $(OBJS_DIR)/flexCUDA_debug/cuda/src/cudabvh.o` + $(ECHO) "../../../../../../external/CUDA/cuda-6.0-linux/bin/nvcc" -ccbin /home/mmacklin/swhost/devrel/libdev/flex/dev/main/../../../external/android-ndk/android-ndk-r10e-linux/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin/arm-linux-androideabi-g++ -target-cpu-arch=ARM -m32 -arch=sm_32 -O3 -Xptxas -dlcm=ca -target-os-variant=Android -I"../../../../../../external/CUDA/cuda-6.0-linux/targets/armv7-linux-androideabi/include" -I"../../.." -I"/home/mmacklin/swhost/devrel/libdev/flex/dev/main/../../../external/android-ndk/android-ndk-r10e-linux/sources/cxx-stl/stlport/stlport" -I"/home/mmacklin/swhost/devrel/libdev/flex/dev/main/../../../external/android-ndk/android-ndk-r10e-linux/platforms/android-15/arch-arm/usr/include" --compile "../../../src/cuda/bvh.cu" -o "$(OBJS_DIR)/flexCUDA_debug/cuda/src/cudabvh.o" + "../../../../../../external/CUDA/cuda-6.0-linux/bin/nvcc" -ccbin /home/mmacklin/swhost/devrel/libdev/flex/dev/main/../../../external/android-ndk/android-ndk-r10e-linux/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin/arm-linux-androideabi-g++ -target-cpu-arch=ARM -m32 -arch=sm_32 -O3 -Xptxas -dlcm=ca -target-os-variant=Android -I"../../../../../../external/CUDA/cuda-6.0-linux/targets/armv7-linux-androideabi/include" -I"../../.." -I"/home/mmacklin/swhost/devrel/libdev/flex/dev/main/../../../external/android-ndk/android-ndk-r10e-linux/sources/cxx-stl/stlport/stlport" -I"/home/mmacklin/swhost/devrel/libdev/flex/dev/main/../../../external/android-ndk/android-ndk-r10e-linux/platforms/android-15/arch-arm/usr/include" --compile "../../../src/cuda/bvh.cu" -o "$(OBJS_DIR)/flexCUDA_debug/cuda/src/cudabvh.o" + +$(flexCUDA_debug_cuda_src_cuda_flex_cu_o): $(flexCUDA_cuda_src_cuda_flex_cu) + @mkdir -p `dirname $(OBJS_DIR)/flexCUDA_debug/cuda/src/cudaflex.o` + $(ECHO) "../../../../../../external/CUDA/cuda-6.0-linux/bin/nvcc" -ccbin /home/mmacklin/swhost/devrel/libdev/flex/dev/main/../../../external/android-ndk/android-ndk-r10e-linux/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin/arm-linux-androideabi-g++ -target-cpu-arch=ARM -m32 -arch=sm_32 -O3 -Xptxas -dlcm=ca -target-os-variant=Android -I"../../../../../../external/CUDA/cuda-6.0-linux/targets/armv7-linux-androideabi/include" -I"../../.." -I"/home/mmacklin/swhost/devrel/libdev/flex/dev/main/../../../external/android-ndk/android-ndk-r10e-linux/sources/cxx-stl/stlport/stlport" -I"/home/mmacklin/swhost/devrel/libdev/flex/dev/main/../../../external/android-ndk/android-ndk-r10e-linux/platforms/android-15/arch-arm/usr/include" --compile "../../../src/cuda/flex.cu" -o "$(OBJS_DIR)/flexCUDA_debug/cuda/src/cudaflex.o" + "../../../../../../external/CUDA/cuda-6.0-linux/bin/nvcc" -ccbin /home/mmacklin/swhost/devrel/libdev/flex/dev/main/../../../external/android-ndk/android-ndk-r10e-linux/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin/arm-linux-androideabi-g++ -target-cpu-arch=ARM -m32 -arch=sm_32 -O3 -Xptxas -dlcm=ca -target-os-variant=Android -I"../../../../../../external/CUDA/cuda-6.0-linux/targets/armv7-linux-androideabi/include" -I"../../.." -I"/home/mmacklin/swhost/devrel/libdev/flex/dev/main/../../../external/android-ndk/android-ndk-r10e-linux/sources/cxx-stl/stlport/stlport" -I"/home/mmacklin/swhost/devrel/libdev/flex/dev/main/../../../external/android-ndk/android-ndk-r10e-linux/platforms/android-15/arch-arm/usr/include" --compile "../../../src/cuda/flex.cu" -o "$(OBJS_DIR)/flexCUDA_debug/cuda/src/cudaflex.o" + +$(flexCUDA_debug_cuda_src_cuda_sort_cu_o): $(flexCUDA_cuda_src_cuda_sort_cu) + @mkdir -p `dirname $(OBJS_DIR)/flexCUDA_debug/cuda/src/cudasort.o` + $(ECHO) "../../../../../../external/CUDA/cuda-6.0-linux/bin/nvcc" -ccbin /home/mmacklin/swhost/devrel/libdev/flex/dev/main/../../../external/android-ndk/android-ndk-r10e-linux/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin/arm-linux-androideabi-g++ -target-cpu-arch=ARM -m32 -arch=sm_32 -O3 -Xptxas -dlcm=ca -target-os-variant=Android -I"../../../../../../external/CUDA/cuda-6.0-linux/targets/armv7-linux-androideabi/include" -I"../../.." -I"/home/mmacklin/swhost/devrel/libdev/flex/dev/main/../../../external/android-ndk/android-ndk-r10e-linux/sources/cxx-stl/stlport/stlport" -I"/home/mmacklin/swhost/devrel/libdev/flex/dev/main/../../../external/android-ndk/android-ndk-r10e-linux/platforms/android-15/arch-arm/usr/include" --compile "../../../src/cuda/sort.cu" -o "$(OBJS_DIR)/flexCUDA_debug/cuda/src/cudasort.o" + "../../../../../../external/CUDA/cuda-6.0-linux/bin/nvcc" -ccbin /home/mmacklin/swhost/devrel/libdev/flex/dev/main/../../../external/android-ndk/android-ndk-r10e-linux/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin/arm-linux-androideabi-g++ -target-cpu-arch=ARM -m32 -arch=sm_32 -O3 -Xptxas -dlcm=ca -target-os-variant=Android -I"../../../../../../external/CUDA/cuda-6.0-linux/targets/armv7-linux-androideabi/include" -I"../../.." -I"/home/mmacklin/swhost/devrel/libdev/flex/dev/main/../../../external/android-ndk/android-ndk-r10e-linux/sources/cxx-stl/stlport/stlport" -I"/home/mmacklin/swhost/devrel/libdev/flex/dev/main/../../../external/android-ndk/android-ndk-r10e-linux/platforms/android-15/arch-arm/usr/include" --compile "../../../src/cuda/sort.cu" -o "$(OBJS_DIR)/flexCUDA_debug/cuda/src/cudasort.o" + +flexCUDA_debug_DEPDIR = $(dir $(@))/$(*F) +$(flexCUDA_debug_cpp_o): $(flexCUDA_debug_objsdir)/%.o: + $(ECHO) flexCUDA: compiling debug $(filter %$(strip $(subst .cpp.o,.cpp, $(subst $(flexCUDA_debug_objsdir),, $@))), $(flexCUDA_cppfiles))... + mkdir -p $(dir $(@)) + $(CXX) $(flexCUDA_debug_cppflags) -c $(filter %$(strip $(subst .cpp.o,.cpp, $(subst $(flexCUDA_debug_objsdir),, $@))), $(flexCUDA_cppfiles)) -o $@ + @mkdir -p $(dir $(addprefix $(DEPSDIR)/flexCUDA/debug/, $(subst ./, , $(subst ../, , $(filter %$(strip $(subst .cpp.o,.cpp, $(subst $(flexCUDA_debug_objsdir),, $@))), $(flexCUDA_cppfiles)))))) + cp $(flexCUDA_debug_DEPDIR).d $(addprefix $(DEPSDIR)/flexCUDA/debug/, $(subst ./, , $(subst ../, , $(filter %$(strip $(subst .cpp.o,.cpp, $(subst $(flexCUDA_debug_objsdir),, $@))), $(flexCUDA_cppfiles))))).P; \ + sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \ + -e '/^$$/ d' -e 's/$$/ :/' < $(flexCUDA_debug_DEPDIR).d >> $(addprefix $(DEPSDIR)/flexCUDA/debug/, $(subst ./, , $(subst ../, , $(filter %$(strip $(subst .cpp.o,.cpp, $(subst $(flexCUDA_debug_objsdir),, $@))), $(flexCUDA_cppfiles))))).P; \ + rm -f $(flexCUDA_debug_DEPDIR).d + +$(flexCUDA_debug_cc_o): $(flexCUDA_debug_objsdir)/%.o: + $(ECHO) flexCUDA: compiling debug $(filter %$(strip $(subst .cc.o,.cc, $(subst $(flexCUDA_debug_objsdir),, $@))), $(flexCUDA_ccfiles))... + mkdir -p $(dir $(@)) + $(CXX) $(flexCUDA_debug_cppflags) -c $(filter %$(strip $(subst .cc.o,.cc, $(subst $(flexCUDA_debug_objsdir),, $@))), $(flexCUDA_ccfiles)) -o $@ + mkdir -p $(dir $(addprefix $(DEPSDIR)/, $(subst ./, , $(subst ../, , $(filter %$(strip $(subst .cc.o,.cc, $(subst $(flexCUDA_debug_objsdir),, $@))), $(flexCUDA_ccfiles)))))) + cp $(flexCUDA_debug_DEPDIR).d $(addprefix $(DEPSDIR)/, $(subst ./, , $(subst ../, , $(filter %$(strip $(subst .cc.o,.cc, $(subst $(flexCUDA_debug_objsdir),, $@))), $(flexCUDA_ccfiles))))).debug.P; \ + sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \ + -e '/^$$/ d' -e 's/$$/ :/' < $(flexCUDA_debug_DEPDIR).d >> $(addprefix $(DEPSDIR)/, $(subst ./, , $(subst ../, , $(filter %$(strip $(subst .cc.o,.cc, $(subst $(flexCUDA_debug_objsdir),, $@))), $(flexCUDA_ccfiles))))).debug.P; \ + rm -f $(flexCUDA_debug_DEPDIR).d + +$(flexCUDA_debug_c_o): $(flexCUDA_debug_objsdir)/%.o: + $(ECHO) flexCUDA: compiling debug $(filter %$(strip $(subst .c.o,.c, $(subst $(flexCUDA_debug_objsdir),, $@))), $(flexCUDA_cfiles))... + mkdir -p $(dir $(@)) + $(CC) $(flexCUDA_debug_cflags) -c $(filter %$(strip $(subst .c.o,.c, $(subst $(flexCUDA_debug_objsdir),, $@))), $(flexCUDA_cfiles)) -o $@ + @mkdir -p $(dir $(addprefix $(DEPSDIR)/flexCUDA/debug/, $(subst ./, , $(subst ../, , $(filter %$(strip $(subst .c.o,.c, $(subst $(flexCUDA_debug_objsdir),, $@))), $(flexCUDA_cfiles)))))) + cp $(flexCUDA_debug_DEPDIR).d $(addprefix $(DEPSDIR)/flexCUDA/debug/, $(subst ./, , $(subst ../, , $(filter %$(strip $(subst .c.o,.c, $(subst $(flexCUDA_debug_objsdir),, $@))), $(flexCUDA_cfiles))))).P; \ + sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \ + -e '/^$$/ d' -e 's/$$/ :/' < $(flexCUDA_debug_DEPDIR).d >> $(addprefix $(DEPSDIR)/flexCUDA/debug/, $(subst ./, , $(subst ../, , $(filter %$(strip $(subst .c.o,.c, $(subst $(flexCUDA_debug_objsdir),, $@))), $(flexCUDA_cfiles))))).P; \ + rm -f $(flexCUDA_debug_DEPDIR).d + +clean_flexCUDA: clean_flexCUDA_release clean_flexCUDA_debug + rm -rf $(DEPSDIR) + +export VERBOSE +ifndef VERBOSE +.SILENT: +endif diff --git a/extensions/compiler/makeandroid/Makefile.flexExtCUDA.mk b/extensions/compiler/makeandroid/Makefile.flexExtCUDA.mk new file mode 100644 index 0000000..f8bf780 --- /dev/null +++ b/extensions/compiler/makeandroid/Makefile.flexExtCUDA.mk @@ -0,0 +1,205 @@ +# Makefile generated by XPJ for android +-include Makefile.custom +ProjectName = flexExtCUDA +flexExtCUDA_cppfiles += ./../../flexExtCloth.cpp +flexExtCUDA_cppfiles += ./../../flexExtContainer.cpp +flexExtCUDA_cppfiles += ./../../flexExtMovingFrame.cpp +flexExtCUDA_cppfiles += ./../../flexExtRigid.cpp +flexExtCUDA_cppfiles += ./../../flexExtSoft.cpp +flexExtCUDA_cuda_cuda_flexExt_cu += ./../../cuda/flexExt.cu +flexExtCUDA_cppfiles += ./../../../core/sdf.cpp +flexExtCUDA_cppfiles += ./../../../core/voxelize.cpp +flexExtCUDA_cppfiles += ./../../../core/maths.cpp +flexExtCUDA_cppfiles += ./../../../core/aabbtree.cpp + +flexExtCUDA_cpp_release_dep = $(addprefix $(DEPSDIR)/flexExtCUDA/release/, $(subst ./, , $(subst ../, , $(patsubst %.cpp, %.cpp.P, $(flexExtCUDA_cppfiles))))) +flexExtCUDA_cc_release_dep = $(addprefix $(DEPSDIR)/, $(subst ./, , $(subst ../, , $(patsubst %.cc, %.cc.release.P, $(flexExtCUDA_ccfiles))))) +flexExtCUDA_c_release_dep = $(addprefix $(DEPSDIR)/flexExtCUDA/release/, $(subst ./, , $(subst ../, , $(patsubst %.c, %.c.P, $(flexExtCUDA_cfiles))))) +flexExtCUDA_release_dep = $(flexExtCUDA_cpp_release_dep) $(flexExtCUDA_cc_release_dep) $(flexExtCUDA_c_release_dep) +-include $(flexExtCUDA_release_dep) +flexExtCUDA_cpp_debug_dep = $(addprefix $(DEPSDIR)/flexExtCUDA/debug/, $(subst ./, , $(subst ../, , $(patsubst %.cpp, %.cpp.P, $(flexExtCUDA_cppfiles))))) +flexExtCUDA_cc_debug_dep = $(addprefix $(DEPSDIR)/, $(subst ./, , $(subst ../, , $(patsubst %.cc, %.cc.debug.P, $(flexExtCUDA_ccfiles))))) +flexExtCUDA_c_debug_dep = $(addprefix $(DEPSDIR)/flexExtCUDA/debug/, $(subst ./, , $(subst ../, , $(patsubst %.c, %.c.P, $(flexExtCUDA_cfiles))))) +flexExtCUDA_debug_dep = $(flexExtCUDA_cpp_debug_dep) $(flexExtCUDA_cc_debug_dep) $(flexExtCUDA_c_debug_dep) +-include $(flexExtCUDA_debug_dep) +flexExtCUDA_release_hpaths := +flexExtCUDA_release_hpaths += ./../../.. +flexExtCUDA_release_hpaths += $(NDK_ROOT)/$(NDK_VERSION)/platforms/android-15/arch-arm/usr/include +flexExtCUDA_release_hpaths += $(NDK_ROOT)/$(NDK_VERSION)/sources/cxx-stl/stlport/stlport +flexExtCUDA_release_hpaths += $(CUDA_PATH)/targets/armv7-linux-androideabi/include +flexExtCUDA_release_lpaths := +flexExtCUDA_release_lpaths += $(CUDA_PATH)/targets/armv7-linux-androideabi/lib +flexExtCUDA_release_lpaths += ./../../../lib/android +flexExtCUDA_release_lpaths += $(NDK_ROOT)/$(NDK_VERSION)/sources/cxx-stl/stlport/libs/armeabi-v7a +flexExtCUDA_release_defines := $(flexExtCUDA_custom_defines) +flexExtCUDA_release_defines += android +flexExtCUDA_release_defines += ANDROID=1 +flexExtCUDA_release_defines += ANDROID_PLAT=1 +flexExtCUDA_release_defines += DISABLE_IMPORTGL +flexExtCUDA_release_libraries := +flexExtCUDA_release_libraries += ./../../../lib/android/libNvFlexRelease_armv7l.a +flexExtCUDA_release_common_cflags := $(flexExtCUDA_custom_cflags) +flexExtCUDA_release_common_cflags += -MMD +flexExtCUDA_release_common_cflags += $(addprefix -D, $(flexExtCUDA_release_defines)) +flexExtCUDA_release_common_cflags += $(addprefix -I, $(flexExtCUDA_release_hpaths)) +flexExtCUDA_release_common_cflags += -Wall -std=c++11 -fpermissive -fno-strict-aliasing -fno-rtti -fno-exceptions +flexExtCUDA_release_common_cflags += -O3 -ffast-math +flexExtCUDA_release_cflags := $(flexExtCUDA_release_common_cflags) +flexExtCUDA_release_cppflags := $(flexExtCUDA_release_common_cflags) +flexExtCUDA_release_lflags := $(flexExtCUDA_custom_lflags) +flexExtCUDA_release_lflags += $(addprefix -L, $(flexExtCUDA_release_lpaths)) +flexExtCUDA_release_lflags += -Wl,--start-group $(addprefix -l, $(flexExtCUDA_release_libraries)) -Wl,--end-group +flexExtCUDA_release_objsdir = $(OBJS_DIR)/flexExtCUDA_release +flexExtCUDA_release_cpp_o = $(addprefix $(flexExtCUDA_release_objsdir)/, $(subst ./, , $(subst ../, , $(patsubst %.cpp, %.cpp.o, $(flexExtCUDA_cppfiles))))) +flexExtCUDA_release_cc_o = $(addprefix $(flexExtCUDA_release_objsdir)/, $(subst ./, , $(subst ../, , $(patsubst %.cc, %.cc.o, $(flexExtCUDA_ccfiles))))) +flexExtCUDA_release_c_o = $(addprefix $(flexExtCUDA_release_objsdir)/, $(subst ./, , $(subst ../, , $(patsubst %.c, %.c.o, $(flexExtCUDA_cfiles))))) +flexExtCUDA_release_cuda_cuda_flexExt_cu_o += $(OBJS_DIR)/flexExtCUDA_release/cuda/cudaflexExt.o +flexExtCUDA_release_obj = $(flexExtCUDA_release_cpp_o) $(flexExtCUDA_release_cc_o) $(flexExtCUDA_release_c_o) $(flexExtCUDA_release_cuda_cuda_flexExt_cu_o) +flexExtCUDA_release_bin := ./../../../lib/android/libflexExt_cuda_release_armv7l.a + +clean_flexExtCUDA_release: + @$(ECHO) clean flexExtCUDA release + @$(RMDIR) $(flexExtCUDA_release_objsdir) + @$(RMDIR) $(flexExtCUDA_release_bin) + @$(RMDIR) $(DEPSDIR)/flexExtCUDA/release + +build_flexExtCUDA_release: postbuild_flexExtCUDA_release +postbuild_flexExtCUDA_release: mainbuild_flexExtCUDA_release +mainbuild_flexExtCUDA_release: prebuild_flexExtCUDA_release $(flexExtCUDA_release_bin) +prebuild_flexExtCUDA_release: + +$(flexExtCUDA_release_bin): $(flexExtCUDA_release_obj) + mkdir -p `dirname ./../../../lib/android/libflexExt_cuda_release_armv7l.a` + @$(AR) rcs $(flexExtCUDA_release_bin) $(flexExtCUDA_release_obj) + $(ECHO) building $@ complete! + +$(flexExtCUDA_release_cuda_cuda_flexExt_cu_o): $(flexExtCUDA_cuda_cuda_flexExt_cu) + @mkdir -p `dirname $(OBJS_DIR)/flexExtCUDA_release/cuda/cudaflexExt.o` + $(ECHO) "$(CUDA_PATH)/bin/nvcc" -ccbin $(NDK_ROOT)/$(NDK_VERSION)/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin/arm-linux-androideabi-g++ -target-cpu-arch=ARM -m32 -arch=sm_32 -O3 -Xptxas -dlcm=ca -target-os-variant=Android -I"$(CUDA_PATH)/targets/armv7-linux-androideabi/include" -I"../../.." -I"$(NDK_ROOT)/$(NDK_VERSION)/sources/cxx-stl/stlport/stlport" -I"$(NDK_ROOT)/$(NDK_VERSION)/platforms/android-15/arch-arm/usr/include" --compile "./../../cuda/flexExt.cu" -o "$(OBJS_DIR)/flexExtCUDA_release/cuda/cudaflexExt.o" + "$(CUDA_PATH)/bin/nvcc" -ccbin $(NDK_ROOT)/$(NDK_VERSION)/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin/arm-linux-androideabi-g++ -target-cpu-arch=ARM -m32 -arch=sm_32 -O3 -Xptxas -dlcm=ca -target-os-variant=Android -I"$(CUDA_PATH)/targets/armv7-linux-androideabi/include" -I"../../.." -I"$(NDK_ROOT)/$(NDK_VERSION)/sources/cxx-stl/stlport/stlport" -I"$(NDK_ROOT)/$(NDK_VERSION)/platforms/android-15/arch-arm/usr/include" --compile "./../../cuda/flexExt.cu" -o "$(OBJS_DIR)/flexExtCUDA_release/cuda/cudaflexExt.o" + +flexExtCUDA_release_DEPDIR = $(dir $(@))/$(*F) +$(flexExtCUDA_release_cpp_o): $(flexExtCUDA_release_objsdir)/%.o: + $(ECHO) flexExtCUDA: compiling release $(filter %$(strip $(subst .cpp.o,.cpp, $(subst $(flexExtCUDA_release_objsdir),, $@))), $(flexExtCUDA_cppfiles))... + mkdir -p $(dir $(@)) + $(CXX) $(flexExtCUDA_release_cppflags) -c $(filter %$(strip $(subst .cpp.o,.cpp, $(subst $(flexExtCUDA_release_objsdir),, $@))), $(flexExtCUDA_cppfiles)) -o $@ + @mkdir -p $(dir $(addprefix $(DEPSDIR)/flexExtCUDA/release/, $(subst ./, , $(subst ../, , $(filter %$(strip $(subst .cpp.o,.cpp, $(subst $(flexExtCUDA_release_objsdir),, $@))), $(flexExtCUDA_cppfiles)))))) + cp $(flexExtCUDA_release_DEPDIR).d $(addprefix $(DEPSDIR)/flexExtCUDA/release/, $(subst ./, , $(subst ../, , $(filter %$(strip $(subst .cpp.o,.cpp, $(subst $(flexExtCUDA_release_objsdir),, $@))), $(flexExtCUDA_cppfiles))))).P; \ + sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \ + -e '/^$$/ d' -e 's/$$/ :/' < $(flexExtCUDA_release_DEPDIR).d >> $(addprefix $(DEPSDIR)/flexExtCUDA/release/, $(subst ./, , $(subst ../, , $(filter %$(strip $(subst .cpp.o,.cpp, $(subst $(flexExtCUDA_release_objsdir),, $@))), $(flexExtCUDA_cppfiles))))).P; \ + rm -f $(flexExtCUDA_release_DEPDIR).d + +$(flexExtCUDA_release_cc_o): $(flexExtCUDA_release_objsdir)/%.o: + $(ECHO) flexExtCUDA: compiling release $(filter %$(strip $(subst .cc.o,.cc, $(subst $(flexExtCUDA_release_objsdir),, $@))), $(flexExtCUDA_ccfiles))... + mkdir -p $(dir $(@)) + $(CXX) $(flexExtCUDA_release_cppflags) -c $(filter %$(strip $(subst .cc.o,.cc, $(subst $(flexExtCUDA_release_objsdir),, $@))), $(flexExtCUDA_ccfiles)) -o $@ + mkdir -p $(dir $(addprefix $(DEPSDIR)/, $(subst ./, , $(subst ../, , $(filter %$(strip $(subst .cc.o,.cc, $(subst $(flexExtCUDA_release_objsdir),, $@))), $(flexExtCUDA_ccfiles)))))) + cp $(flexExtCUDA_release_DEPDIR).d $(addprefix $(DEPSDIR)/, $(subst ./, , $(subst ../, , $(filter %$(strip $(subst .cc.o,.cc, $(subst $(flexExtCUDA_release_objsdir),, $@))), $(flexExtCUDA_ccfiles))))).release.P; \ + sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \ + -e '/^$$/ d' -e 's/$$/ :/' < $(flexExtCUDA_release_DEPDIR).d >> $(addprefix $(DEPSDIR)/, $(subst ./, , $(subst ../, , $(filter %$(strip $(subst .cc.o,.cc, $(subst $(flexExtCUDA_release_objsdir),, $@))), $(flexExtCUDA_ccfiles))))).release.P; \ + rm -f $(flexExtCUDA_release_DEPDIR).d + +$(flexExtCUDA_release_c_o): $(flexExtCUDA_release_objsdir)/%.o: + $(ECHO) flexExtCUDA: compiling release $(filter %$(strip $(subst .c.o,.c, $(subst $(flexExtCUDA_release_objsdir),, $@))), $(flexExtCUDA_cfiles))... + mkdir -p $(dir $(@)) + $(CC) $(flexExtCUDA_release_cflags) -c $(filter %$(strip $(subst .c.o,.c, $(subst $(flexExtCUDA_release_objsdir),, $@))), $(flexExtCUDA_cfiles)) -o $@ + @mkdir -p $(dir $(addprefix $(DEPSDIR)/flexExtCUDA/release/, $(subst ./, , $(subst ../, , $(filter %$(strip $(subst .c.o,.c, $(subst $(flexExtCUDA_release_objsdir),, $@))), $(flexExtCUDA_cfiles)))))) + cp $(flexExtCUDA_release_DEPDIR).d $(addprefix $(DEPSDIR)/flexExtCUDA/release/, $(subst ./, , $(subst ../, , $(filter %$(strip $(subst .c.o,.c, $(subst $(flexExtCUDA_release_objsdir),, $@))), $(flexExtCUDA_cfiles))))).P; \ + sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \ + -e '/^$$/ d' -e 's/$$/ :/' < $(flexExtCUDA_release_DEPDIR).d >> $(addprefix $(DEPSDIR)/flexExtCUDA/release/, $(subst ./, , $(subst ../, , $(filter %$(strip $(subst .c.o,.c, $(subst $(flexExtCUDA_release_objsdir),, $@))), $(flexExtCUDA_cfiles))))).P; \ + rm -f $(flexExtCUDA_release_DEPDIR).d + +flexExtCUDA_debug_hpaths := +flexExtCUDA_debug_hpaths += ./../../.. +flexExtCUDA_debug_hpaths += $(NDK_ROOT)/$(NDK_VERSION)/platforms/android-15/arch-arm/usr/include +flexExtCUDA_debug_hpaths += $(NDK_ROOT)/$(NDK_VERSION)/sources/cxx-stl/stlport/stlport +flexExtCUDA_debug_hpaths += $(CUDA_PATH)/targets/armv7-linux-androideabi/include +flexExtCUDA_debug_lpaths := +flexExtCUDA_debug_lpaths += $(CUDA_PATH)/targets/armv7-linux-androideabi/lib +flexExtCUDA_debug_lpaths += ./../../../lib/android +flexExtCUDA_debug_lpaths += $(NDK_ROOT)/$(NDK_VERSION)/sources/cxx-stl/stlport/libs/armeabi-v7a +flexExtCUDA_debug_defines := $(flexExtCUDA_custom_defines) +flexExtCUDA_debug_defines += android +flexExtCUDA_debug_defines += ANDROID=1 +flexExtCUDA_debug_defines += ANDROID_PLAT=1 +flexExtCUDA_debug_defines += DISABLE_IMPORTGL +flexExtCUDA_debug_libraries := +flexExtCUDA_debug_libraries += ./../../../lib/android/libNvFlexDebug_armv7l.a +flexExtCUDA_debug_common_cflags := $(flexExtCUDA_custom_cflags) +flexExtCUDA_debug_common_cflags += -MMD +flexExtCUDA_debug_common_cflags += $(addprefix -D, $(flexExtCUDA_debug_defines)) +flexExtCUDA_debug_common_cflags += $(addprefix -I, $(flexExtCUDA_debug_hpaths)) +flexExtCUDA_debug_common_cflags += -Wall -std=c++11 -fpermissive -fno-strict-aliasing -fno-rtti -fno-exceptions +flexExtCUDA_debug_common_cflags += -g -O0 +flexExtCUDA_debug_cflags := $(flexExtCUDA_debug_common_cflags) +flexExtCUDA_debug_cppflags := $(flexExtCUDA_debug_common_cflags) +flexExtCUDA_debug_lflags := $(flexExtCUDA_custom_lflags) +flexExtCUDA_debug_lflags += $(addprefix -L, $(flexExtCUDA_debug_lpaths)) +flexExtCUDA_debug_lflags += -Wl,--start-group $(addprefix -l, $(flexExtCUDA_debug_libraries)) -Wl,--end-group +flexExtCUDA_debug_objsdir = $(OBJS_DIR)/flexExtCUDA_debug +flexExtCUDA_debug_cpp_o = $(addprefix $(flexExtCUDA_debug_objsdir)/, $(subst ./, , $(subst ../, , $(patsubst %.cpp, %.cpp.o, $(flexExtCUDA_cppfiles))))) +flexExtCUDA_debug_cc_o = $(addprefix $(flexExtCUDA_debug_objsdir)/, $(subst ./, , $(subst ../, , $(patsubst %.cc, %.cc.o, $(flexExtCUDA_ccfiles))))) +flexExtCUDA_debug_c_o = $(addprefix $(flexExtCUDA_debug_objsdir)/, $(subst ./, , $(subst ../, , $(patsubst %.c, %.c.o, $(flexExtCUDA_cfiles))))) +flexExtCUDA_debug_cuda_cuda_flexExt_cu_o += $(OBJS_DIR)/flexExtCUDA_debug/cuda/cudaflexExt.o +flexExtCUDA_debug_obj = $(flexExtCUDA_debug_cpp_o) $(flexExtCUDA_debug_cc_o) $(flexExtCUDA_debug_c_o) $(flexExtCUDA_debug_cuda_cuda_flexExt_cu_o) +flexExtCUDA_debug_bin := ./../../../lib/android/libflexExt_cuda_debug_armv7l.a + +clean_flexExtCUDA_debug: + @$(ECHO) clean flexExtCUDA debug + @$(RMDIR) $(flexExtCUDA_debug_objsdir) + @$(RMDIR) $(flexExtCUDA_debug_bin) + @$(RMDIR) $(DEPSDIR)/flexExtCUDA/debug + +build_flexExtCUDA_debug: postbuild_flexExtCUDA_debug +postbuild_flexExtCUDA_debug: mainbuild_flexExtCUDA_debug +mainbuild_flexExtCUDA_debug: prebuild_flexExtCUDA_debug $(flexExtCUDA_debug_bin) +prebuild_flexExtCUDA_debug: + +$(flexExtCUDA_debug_bin): $(flexExtCUDA_debug_obj) + mkdir -p `dirname ./../../../lib/android/libflexExt_cuda_debug_armv7l.a` + @$(AR) rcs $(flexExtCUDA_debug_bin) $(flexExtCUDA_debug_obj) + $(ECHO) building $@ complete! + +$(flexExtCUDA_debug_cuda_cuda_flexExt_cu_o): $(flexExtCUDA_cuda_cuda_flexExt_cu) + @mkdir -p `dirname $(OBJS_DIR)/flexExtCUDA_debug/cuda/cudaflexExt.o` + $(ECHO) "$(CUDA_PATH)/bin/nvcc" -ccbin $(NDK_ROOT)/$(NDK_VERSION)/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin/arm-linux-androideabi-g++ -target-cpu-arch=ARM -m32 -arch=sm_32 -O3 -Xptxas -dlcm=ca -target-os-variant=Android -I"$(CUDA_PATH)/targets/armv7-linux-androideabi/include" -I"../../.." -I"$(NDK_ROOT)/$(NDK_VERSION)/sources/cxx-stl/stlport/stlport" -I"$(NDK_ROOT)/$(NDK_VERSION)/platforms/android-15/arch-arm/usr/include" --compile "./../../cuda/flexExt.cu" -o "$(OBJS_DIR)/flexExtCUDA_debug/cuda/cudaflexExt.o" + "$(CUDA_PATH)/bin/nvcc" -ccbin $(NDK_ROOT)/$(NDK_VERSION)/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin/arm-linux-androideabi-g++ -target-cpu-arch=ARM -m32 -arch=sm_32 -O3 -Xptxas -dlcm=ca -target-os-variant=Android -I"$(CUDA_PATH)/targets/armv7-linux-androideabi/include" -I"../../.." -I"$(NDK_ROOT)/$(NDK_VERSION)/sources/cxx-stl/stlport/stlport" -I"$(NDK_ROOT)/$(NDK_VERSION)/platforms/android-15/arch-arm/usr/include" --compile "./../../cuda/flexExt.cu" -o "$(OBJS_DIR)/flexExtCUDA_debug/cuda/cudaflexExt.o" + +flexExtCUDA_debug_DEPDIR = $(dir $(@))/$(*F) +$(flexExtCUDA_debug_cpp_o): $(flexExtCUDA_debug_objsdir)/%.o: + $(ECHO) flexExtCUDA: compiling debug $(filter %$(strip $(subst .cpp.o,.cpp, $(subst $(flexExtCUDA_debug_objsdir),, $@))), $(flexExtCUDA_cppfiles))... + mkdir -p $(dir $(@)) + $(CXX) $(flexExtCUDA_debug_cppflags) -c $(filter %$(strip $(subst .cpp.o,.cpp, $(subst $(flexExtCUDA_debug_objsdir),, $@))), $(flexExtCUDA_cppfiles)) -o $@ + @mkdir -p $(dir $(addprefix $(DEPSDIR)/flexExtCUDA/debug/, $(subst ./, , $(subst ../, , $(filter %$(strip $(subst .cpp.o,.cpp, $(subst $(flexExtCUDA_debug_objsdir),, $@))), $(flexExtCUDA_cppfiles)))))) + cp $(flexExtCUDA_debug_DEPDIR).d $(addprefix $(DEPSDIR)/flexExtCUDA/debug/, $(subst ./, , $(subst ../, , $(filter %$(strip $(subst .cpp.o,.cpp, $(subst $(flexExtCUDA_debug_objsdir),, $@))), $(flexExtCUDA_cppfiles))))).P; \ + sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \ + -e '/^$$/ d' -e 's/$$/ :/' < $(flexExtCUDA_debug_DEPDIR).d >> $(addprefix $(DEPSDIR)/flexExtCUDA/debug/, $(subst ./, , $(subst ../, , $(filter %$(strip $(subst .cpp.o,.cpp, $(subst $(flexExtCUDA_debug_objsdir),, $@))), $(flexExtCUDA_cppfiles))))).P; \ + rm -f $(flexExtCUDA_debug_DEPDIR).d + +$(flexExtCUDA_debug_cc_o): $(flexExtCUDA_debug_objsdir)/%.o: + $(ECHO) flexExtCUDA: compiling debug $(filter %$(strip $(subst .cc.o,.cc, $(subst $(flexExtCUDA_debug_objsdir),, $@))), $(flexExtCUDA_ccfiles))... + mkdir -p $(dir $(@)) + $(CXX) $(flexExtCUDA_debug_cppflags) -c $(filter %$(strip $(subst .cc.o,.cc, $(subst $(flexExtCUDA_debug_objsdir),, $@))), $(flexExtCUDA_ccfiles)) -o $@ + mkdir -p $(dir $(addprefix $(DEPSDIR)/, $(subst ./, , $(subst ../, , $(filter %$(strip $(subst .cc.o,.cc, $(subst $(flexExtCUDA_debug_objsdir),, $@))), $(flexExtCUDA_ccfiles)))))) + cp $(flexExtCUDA_debug_DEPDIR).d $(addprefix $(DEPSDIR)/, $(subst ./, , $(subst ../, , $(filter %$(strip $(subst .cc.o,.cc, $(subst $(flexExtCUDA_debug_objsdir),, $@))), $(flexExtCUDA_ccfiles))))).debug.P; \ + sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \ + -e '/^$$/ d' -e 's/$$/ :/' < $(flexExtCUDA_debug_DEPDIR).d >> $(addprefix $(DEPSDIR)/, $(subst ./, , $(subst ../, , $(filter %$(strip $(subst .cc.o,.cc, $(subst $(flexExtCUDA_debug_objsdir),, $@))), $(flexExtCUDA_ccfiles))))).debug.P; \ + rm -f $(flexExtCUDA_debug_DEPDIR).d + +$(flexExtCUDA_debug_c_o): $(flexExtCUDA_debug_objsdir)/%.o: + $(ECHO) flexExtCUDA: compiling debug $(filter %$(strip $(subst .c.o,.c, $(subst $(flexExtCUDA_debug_objsdir),, $@))), $(flexExtCUDA_cfiles))... + mkdir -p $(dir $(@)) + $(CC) $(flexExtCUDA_debug_cflags) -c $(filter %$(strip $(subst .c.o,.c, $(subst $(flexExtCUDA_debug_objsdir),, $@))), $(flexExtCUDA_cfiles)) -o $@ + @mkdir -p $(dir $(addprefix $(DEPSDIR)/flexExtCUDA/debug/, $(subst ./, , $(subst ../, , $(filter %$(strip $(subst .c.o,.c, $(subst $(flexExtCUDA_debug_objsdir),, $@))), $(flexExtCUDA_cfiles)))))) + cp $(flexExtCUDA_debug_DEPDIR).d $(addprefix $(DEPSDIR)/flexExtCUDA/debug/, $(subst ./, , $(subst ../, , $(filter %$(strip $(subst .c.o,.c, $(subst $(flexExtCUDA_debug_objsdir),, $@))), $(flexExtCUDA_cfiles))))).P; \ + sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \ + -e '/^$$/ d' -e 's/$$/ :/' < $(flexExtCUDA_debug_DEPDIR).d >> $(addprefix $(DEPSDIR)/flexExtCUDA/debug/, $(subst ./, , $(subst ../, , $(filter %$(strip $(subst .c.o,.c, $(subst $(flexExtCUDA_debug_objsdir),, $@))), $(flexExtCUDA_cfiles))))).P; \ + rm -f $(flexExtCUDA_debug_DEPDIR).d + +clean_flexExtCUDA: clean_flexExtCUDA_release clean_flexExtCUDA_debug + rm -rf $(DEPSDIR) + +export VERBOSE +ifndef VERBOSE +.SILENT: +endif diff --git a/extensions/compiler/makelinux64/Makefile b/extensions/compiler/makelinux64/Makefile new file mode 100644 index 0000000..798e4b1 --- /dev/null +++ b/extensions/compiler/makelinux64/Makefile @@ -0,0 +1,197 @@ +#!/usr/bin/make +# Makefile generated by XPJ for linux64 + +DEPSDIR = .deps +#default defines +OBJS_DIR = build +RMDIR = rm -fr +ECHO = echo +CCLD = g++ +CXX = g++ +CC = gcc +RANLIB = ranlib +AR = ar +STRIP = strip +OBJDUMP = objdump +OBJCOPY = objcopy +-include Makedefs.linux64.mk + +all: debug release + +debug: build_flexExtCUDA_debug + +release: build_flexExtCUDA_release + +clean: clean_flexExtCUDA_release clean_flexExtCUDA_debug + rm -rf $(DEPSDIR) + + +clean_release: clean_flexExtCUDA_release + rm -rf $(DEPSDIR) + + +clean_debug: clean_flexExtCUDA_debug + rm -rf $(DEPSDIR) + + +include Makefile.flexExtCUDA.mk + + +# Disable implicit rules to speedup build +.SUFFIXES: +SUFFIXES := +%.out: +%.a: +%.ln: +%.o: +%: %.o +%.c: +%: %.c +%.ln: %.c +%.o: %.c +%.cc: +%: %.cc +%.o: %.cc +%.C: +%: %.C +%.o: %.C +%.cpp: +%: %.cpp +%.o: %.cpp +%.p: +%: %.p +%.o: %.p +%.f: +%: + %.f%.o: %.f +%.F: +%: %.F +%.o: %.F +%.f: %.F +%.r: +%: %.r +%.o: %.r +%.f: %.r +%.y: +%.ln: %.y +%.c: %.y +%.l: +%.ln: %.l +%.c: %.l +%.r: %.l +%.s: +%: %.s +%.o: %.s +%.S: +%: %.S +%.o: %.S +%.s: %.S +%.mod: +%: %.mod +%.o: %.mod +%.sym: +%.def: +%.sym: %.def +%.h: +%.info: +%.dvi: +%.tex: +%.dvi: %.tex +%.texinfo: +%.info: %.texinfo +%.dvi: %.texinfo +%.texi: +%.info: %.texi +%.dvi: %.texi +%.txinfo: +%.info: %.txinfo +%.dvi: %.txinfo +%.w: +%.c: %.w +%.tex: %.w +%.ch: +%.web: +%.p: %.web +%.tex: %.web +%.sh: +%: %.sh +%.elc: +%.el: +(%): % +%.out: % +%.c: %.w %.ch +%.tex: %.w %.ch +%: %,v +%: RCS/%,v +%: RCS/% +%: s.% +%: SCCS/s.% +.web.p: +.l.r: +.dvi: +.F.o: +.l: +.y.ln: +.o: +.y: +.def.sym: +.p.o: +.p: +.txinfo.dvi: +.a: +.l.ln: +.w.c: +.texi.dvi: +.sh: +.cc: +.cc.o: +.def: +.c.o: +.r.o: +.r: +.info: +.elc: +.l.c: +.out: +.C: +.r.f: +.S: +.texinfo.info: +.c: +.w.tex: +.c.ln: +.s.o: +.s: +.texinfo.dvi: +.el: +.texinfo: +.y.c: +.web.tex: +.texi.info: +.DEFAULT: +.h: +.tex.dvi: +.cpp.o: +.cpp: +.C.o: +.ln: +.texi: +.txinfo: +.tex: +.txinfo.info: +.ch: +.S.s: +.mod: +.mod.o: +.F.f: +.w: +.S.o: +.F: +.web: +.sym: +.f: +.f.o: +export VERBOSE +ifndef VERBOSE +.SILENT: +endif diff --git a/extensions/compiler/makelinux64/Makefile.flexCUDA.mk b/extensions/compiler/makelinux64/Makefile.flexCUDA.mk new file mode 100644 index 0000000..3d3b9cd --- /dev/null +++ b/extensions/compiler/makelinux64/Makefile.flexCUDA.mk @@ -0,0 +1,217 @@ +# Makefile generated by XPJ for linux64 +-include Makefile.custom +ProjectName = flexCUDA +flexCUDA_cppfiles += ./../../../src/cuda/util.cpp +flexCUDA_cuda_src_cuda_bvh_cu += ./../../../src/cuda/bvh.cu +flexCUDA_cuda_src_cuda_flex_cu += ./../../../src/cuda/flex.cu +flexCUDA_cuda_src_cuda_sort_cu += ./../../../src/cuda/sort.cu + +flexCUDA_cpp_release_dep = $(addprefix $(DEPSDIR)/flexCUDA/release/, $(subst ./, , $(subst ../, , $(patsubst %.cpp, %.cpp.P, $(flexCUDA_cppfiles))))) +flexCUDA_cc_release_dep = $(addprefix $(DEPSDIR)/, $(subst ./, , $(subst ../, , $(patsubst %.cc, %.cc.release.P, $(flexCUDA_ccfiles))))) +flexCUDA_c_release_dep = $(addprefix $(DEPSDIR)/flexCUDA/release/, $(subst ./, , $(subst ../, , $(patsubst %.c, %.c.P, $(flexCUDA_cfiles))))) +flexCUDA_release_dep = $(flexCUDA_cpp_release_dep) $(flexCUDA_cc_release_dep) $(flexCUDA_c_release_dep) +-include $(flexCUDA_release_dep) +flexCUDA_cpp_debug_dep = $(addprefix $(DEPSDIR)/flexCUDA/debug/, $(subst ./, , $(subst ../, , $(patsubst %.cpp, %.cpp.P, $(flexCUDA_cppfiles))))) +flexCUDA_cc_debug_dep = $(addprefix $(DEPSDIR)/, $(subst ./, , $(subst ../, , $(patsubst %.cc, %.cc.debug.P, $(flexCUDA_ccfiles))))) +flexCUDA_c_debug_dep = $(addprefix $(DEPSDIR)/flexCUDA/debug/, $(subst ./, , $(subst ../, , $(patsubst %.c, %.c.P, $(flexCUDA_cfiles))))) +flexCUDA_debug_dep = $(flexCUDA_cpp_debug_dep) $(flexCUDA_cc_debug_dep) $(flexCUDA_c_debug_dep) +-include $(flexCUDA_debug_dep) +flexCUDA_release_hpaths := +flexCUDA_release_hpaths += ./../../../../../../external/CUDA/8.0.44-linux/include +flexCUDA_release_hpaths += ./../../../../../../external/CUDA/8.0.44-linux/extras/cupti/include +flexCUDA_release_hpaths += ./../../.. +flexCUDA_release_lpaths := +flexCUDA_release_lpaths += ./../../../../../../external/CUDA/8.0.44-linux/lib64 +flexCUDA_release_defines := $(flexCUDA_custom_defines) +flexCUDA_release_libraries := +flexCUDA_release_libraries += ./../../../lib/linux64/NvFlexDevice_x64.a +flexCUDA_release_common_cflags := $(flexCUDA_custom_cflags) +flexCUDA_release_common_cflags += -MMD +flexCUDA_release_common_cflags += $(addprefix -D, $(flexCUDA_release_defines)) +flexCUDA_release_common_cflags += $(addprefix -I, $(flexCUDA_release_hpaths)) +flexCUDA_release_common_cflags += -m64 +flexCUDA_release_cflags := $(flexCUDA_release_common_cflags) +flexCUDA_release_cflags += -Wall -std=c++0x -fPIC -fpermissive -fno-strict-aliasing +flexCUDA_release_cflags += -O3 -ffast-math -DNDEBUG +flexCUDA_release_cppflags := $(flexCUDA_release_common_cflags) +flexCUDA_release_cppflags += -Wall -std=c++0x -fPIC -fpermissive -fno-strict-aliasing +flexCUDA_release_cppflags += -O3 -ffast-math -DNDEBUG +flexCUDA_release_lflags := $(flexCUDA_custom_lflags) +flexCUDA_release_lflags += $(addprefix -L, $(flexCUDA_release_lpaths)) +flexCUDA_release_lflags += -Wl,--start-group $(addprefix -l, $(flexCUDA_release_libraries)) -Wl,--end-group +flexCUDA_release_lflags += -m64 +flexCUDA_release_objsdir = $(OBJS_DIR)/flexCUDA_release +flexCUDA_release_cpp_o = $(addprefix $(flexCUDA_release_objsdir)/, $(subst ./, , $(subst ../, , $(patsubst %.cpp, %.cpp.o, $(flexCUDA_cppfiles))))) +flexCUDA_release_cc_o = $(addprefix $(flexCUDA_release_objsdir)/, $(subst ./, , $(subst ../, , $(patsubst %.cc, %.cc.o, $(flexCUDA_ccfiles))))) +flexCUDA_release_c_o = $(addprefix $(flexCUDA_release_objsdir)/, $(subst ./, , $(subst ../, , $(patsubst %.c, %.c.o, $(flexCUDA_cfiles))))) +flexCUDA_release_cuda_src_cuda_bvh_cu_o += $(OBJS_DIR)/flexCUDA_release/cuda/src/cudabvh.o +flexCUDA_release_cuda_src_cuda_flex_cu_o += $(OBJS_DIR)/flexCUDA_release/cuda/src/cudaflex.o +flexCUDA_release_cuda_src_cuda_sort_cu_o += $(OBJS_DIR)/flexCUDA_release/cuda/src/cudasort.o +flexCUDA_release_obj = $(flexCUDA_release_cpp_o) $(flexCUDA_release_cc_o) $(flexCUDA_release_c_o) $(flexCUDA_release_cuda_src_cuda_bvh_cu_o) $(flexCUDA_release_cuda_src_cuda_flex_cu_o) $(flexCUDA_release_cuda_src_cuda_sort_cu_o) +flexCUDA_release_bin := ./../../../lib/linux64/NvFlexReleaseCUDA_x64.a + +clean_flexCUDA_release: + @$(ECHO) clean flexCUDA release + @$(RMDIR) $(flexCUDA_release_objsdir) + @$(RMDIR) $(flexCUDA_release_bin) + @$(RMDIR) $(DEPSDIR)/flexCUDA/release + +build_flexCUDA_release: postbuild_flexCUDA_release +postbuild_flexCUDA_release: mainbuild_flexCUDA_release +mainbuild_flexCUDA_release: prebuild_flexCUDA_release $(flexCUDA_release_bin) +prebuild_flexCUDA_release: + +$(flexCUDA_release_bin): $(flexCUDA_release_obj) + mkdir -p `dirname ./../../../lib/linux64/NvFlexReleaseCUDA_x64.a` + @$(AR) rcs $(flexCUDA_release_bin) $(flexCUDA_release_obj) + $(ECHO) building $@ complete! + +$(flexCUDA_release_cuda_src_cuda_bvh_cu_o): $(flexCUDA_cuda_src_cuda_bvh_cu) + @mkdir -p `dirname $(OBJS_DIR)/flexCUDA_release/cuda/src/cudabvh.o` + $(ECHO) ../../../../../../external/CUDA/8.0.44-linux/bin/nvcc -O3 -g -arch=sm_30 -m64 -Xcompiler -fPIC -D_FORCE_INLINES -I../../.. -I../../../external -I../../../../../../external/CUDA/8.0.44-linux/include -I../../../external/cub-1.3.2 --compile "../../../src/cuda/bvh.cu" -o "$(OBJS_DIR)/flexCUDA_release/cuda/src/cudabvh.o" + ../../../../../../external/CUDA/8.0.44-linux/bin/nvcc -O3 -g -arch=sm_30 -m64 -Xcompiler -fPIC -D_FORCE_INLINES -I../../.. -I../../../external -I../../../../../../external/CUDA/8.0.44-linux/include -I../../../external/cub-1.3.2 --compile "../../../src/cuda/bvh.cu" -o "$(OBJS_DIR)/flexCUDA_release/cuda/src/cudabvh.o" + +$(flexCUDA_release_cuda_src_cuda_flex_cu_o): $(flexCUDA_cuda_src_cuda_flex_cu) + @mkdir -p `dirname $(OBJS_DIR)/flexCUDA_release/cuda/src/cudaflex.o` + $(ECHO) ../../../../../../external/CUDA/8.0.44-linux/bin/nvcc -O3 -g -arch=sm_30 -m64 -Xcompiler -fPIC -D_FORCE_INLINES -I../../.. -I../../../external -I../../../../../../external/CUDA/8.0.44-linux/include -I../../../external/cub-1.3.2 --compile "../../../src/cuda/flex.cu" -o "$(OBJS_DIR)/flexCUDA_release/cuda/src/cudaflex.o" + ../../../../../../external/CUDA/8.0.44-linux/bin/nvcc -O3 -g -arch=sm_30 -m64 -Xcompiler -fPIC -D_FORCE_INLINES -I../../.. -I../../../external -I../../../../../../external/CUDA/8.0.44-linux/include -I../../../external/cub-1.3.2 --compile "../../../src/cuda/flex.cu" -o "$(OBJS_DIR)/flexCUDA_release/cuda/src/cudaflex.o" + +$(flexCUDA_release_cuda_src_cuda_sort_cu_o): $(flexCUDA_cuda_src_cuda_sort_cu) + @mkdir -p `dirname $(OBJS_DIR)/flexCUDA_release/cuda/src/cudasort.o` + $(ECHO) ../../../../../../external/CUDA/8.0.44-linux/bin/nvcc -O3 -g -arch=sm_30 -m64 -Xcompiler -fPIC -D_FORCE_INLINES -I../../.. -I../../../external -I../../../../../../external/CUDA/8.0.44-linux/include -I../../../external/cub-1.3.2 --compile "../../../src/cuda/sort.cu" -o "$(OBJS_DIR)/flexCUDA_release/cuda/src/cudasort.o" + ../../../../../../external/CUDA/8.0.44-linux/bin/nvcc -O3 -g -arch=sm_30 -m64 -Xcompiler -fPIC -D_FORCE_INLINES -I../../.. -I../../../external -I../../../../../../external/CUDA/8.0.44-linux/include -I../../../external/cub-1.3.2 --compile "../../../src/cuda/sort.cu" -o "$(OBJS_DIR)/flexCUDA_release/cuda/src/cudasort.o" + +flexCUDA_release_DEPDIR = $(dir $(@))/$(*F) +$(flexCUDA_release_cpp_o): $(flexCUDA_release_objsdir)/%.o: + $(ECHO) flexCUDA: compiling release $(filter %$(strip $(subst .cpp.o,.cpp, $(subst $(flexCUDA_release_objsdir),, $@))), $(flexCUDA_cppfiles))... + mkdir -p $(dir $(@)) + $(CXX) $(flexCUDA_release_cppflags) -c $(filter %$(strip $(subst .cpp.o,.cpp, $(subst $(flexCUDA_release_objsdir),, $@))), $(flexCUDA_cppfiles)) -o $@ + @mkdir -p $(dir $(addprefix $(DEPSDIR)/flexCUDA/release/, $(subst ./, , $(subst ../, , $(filter %$(strip $(subst .cpp.o,.cpp, $(subst $(flexCUDA_release_objsdir),, $@))), $(flexCUDA_cppfiles)))))) + cp $(flexCUDA_release_DEPDIR).d $(addprefix $(DEPSDIR)/flexCUDA/release/, $(subst ./, , $(subst ../, , $(filter %$(strip $(subst .cpp.o,.cpp, $(subst $(flexCUDA_release_objsdir),, $@))), $(flexCUDA_cppfiles))))).P; \ + sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \ + -e '/^$$/ d' -e 's/$$/ :/' < $(flexCUDA_release_DEPDIR).d >> $(addprefix $(DEPSDIR)/flexCUDA/release/, $(subst ./, , $(subst ../, , $(filter %$(strip $(subst .cpp.o,.cpp, $(subst $(flexCUDA_release_objsdir),, $@))), $(flexCUDA_cppfiles))))).P; \ + rm -f $(flexCUDA_release_DEPDIR).d + +$(flexCUDA_release_cc_o): $(flexCUDA_release_objsdir)/%.o: + $(ECHO) flexCUDA: compiling release $(filter %$(strip $(subst .cc.o,.cc, $(subst $(flexCUDA_release_objsdir),, $@))), $(flexCUDA_ccfiles))... + mkdir -p $(dir $(@)) + $(CXX) $(flexCUDA_release_cppflags) -c $(filter %$(strip $(subst .cc.o,.cc, $(subst $(flexCUDA_release_objsdir),, $@))), $(flexCUDA_ccfiles)) -o $@ + mkdir -p $(dir $(addprefix $(DEPSDIR)/, $(subst ./, , $(subst ../, , $(filter %$(strip $(subst .cc.o,.cc, $(subst $(flexCUDA_release_objsdir),, $@))), $(flexCUDA_ccfiles)))))) + cp $(flexCUDA_release_DEPDIR).d $(addprefix $(DEPSDIR)/, $(subst ./, , $(subst ../, , $(filter %$(strip $(subst .cc.o,.cc, $(subst $(flexCUDA_release_objsdir),, $@))), $(flexCUDA_ccfiles))))).release.P; \ + sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \ + -e '/^$$/ d' -e 's/$$/ :/' < $(flexCUDA_release_DEPDIR).d >> $(addprefix $(DEPSDIR)/, $(subst ./, , $(subst ../, , $(filter %$(strip $(subst .cc.o,.cc, $(subst $(flexCUDA_release_objsdir),, $@))), $(flexCUDA_ccfiles))))).release.P; \ + rm -f $(flexCUDA_release_DEPDIR).d + +$(flexCUDA_release_c_o): $(flexCUDA_release_objsdir)/%.o: + $(ECHO) flexCUDA: compiling release $(filter %$(strip $(subst .c.o,.c, $(subst $(flexCUDA_release_objsdir),, $@))), $(flexCUDA_cfiles))... + mkdir -p $(dir $(@)) + $(CC) $(flexCUDA_release_cflags) -c $(filter %$(strip $(subst .c.o,.c, $(subst $(flexCUDA_release_objsdir),, $@))), $(flexCUDA_cfiles)) -o $@ + @mkdir -p $(dir $(addprefix $(DEPSDIR)/flexCUDA/release/, $(subst ./, , $(subst ../, , $(filter %$(strip $(subst .c.o,.c, $(subst $(flexCUDA_release_objsdir),, $@))), $(flexCUDA_cfiles)))))) + cp $(flexCUDA_release_DEPDIR).d $(addprefix $(DEPSDIR)/flexCUDA/release/, $(subst ./, , $(subst ../, , $(filter %$(strip $(subst .c.o,.c, $(subst $(flexCUDA_release_objsdir),, $@))), $(flexCUDA_cfiles))))).P; \ + sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \ + -e '/^$$/ d' -e 's/$$/ :/' < $(flexCUDA_release_DEPDIR).d >> $(addprefix $(DEPSDIR)/flexCUDA/release/, $(subst ./, , $(subst ../, , $(filter %$(strip $(subst .c.o,.c, $(subst $(flexCUDA_release_objsdir),, $@))), $(flexCUDA_cfiles))))).P; \ + rm -f $(flexCUDA_release_DEPDIR).d + +flexCUDA_debug_hpaths := +flexCUDA_debug_hpaths += ./../../../../../../external/CUDA/8.0.44-linux/include +flexCUDA_debug_hpaths += ./../../../../../../external/CUDA/8.0.44-linux/extras/cupti/include +flexCUDA_debug_hpaths += ./../../.. +flexCUDA_debug_lpaths := +flexCUDA_debug_lpaths += ./../../../../../../external/CUDA/8.0.44-linux/lib64 +flexCUDA_debug_defines := $(flexCUDA_custom_defines) +flexCUDA_debug_libraries := +flexCUDA_debug_libraries += ./../../../lib/linux64/NvFlexDevice_x64.a +flexCUDA_debug_common_cflags := $(flexCUDA_custom_cflags) +flexCUDA_debug_common_cflags += -MMD +flexCUDA_debug_common_cflags += $(addprefix -D, $(flexCUDA_debug_defines)) +flexCUDA_debug_common_cflags += $(addprefix -I, $(flexCUDA_debug_hpaths)) +flexCUDA_debug_common_cflags += -m64 +flexCUDA_debug_cflags := $(flexCUDA_debug_common_cflags) +flexCUDA_debug_cflags += -Wall -std=c++0x -fPIC -fpermissive -fno-strict-aliasing +flexCUDA_debug_cflags += -g -O0 +flexCUDA_debug_cppflags := $(flexCUDA_debug_common_cflags) +flexCUDA_debug_cppflags += -Wall -std=c++0x -fPIC -fpermissive -fno-strict-aliasing +flexCUDA_debug_cppflags += -g -O0 +flexCUDA_debug_lflags := $(flexCUDA_custom_lflags) +flexCUDA_debug_lflags += $(addprefix -L, $(flexCUDA_debug_lpaths)) +flexCUDA_debug_lflags += -Wl,--start-group $(addprefix -l, $(flexCUDA_debug_libraries)) -Wl,--end-group +flexCUDA_debug_lflags += -m64 +flexCUDA_debug_objsdir = $(OBJS_DIR)/flexCUDA_debug +flexCUDA_debug_cpp_o = $(addprefix $(flexCUDA_debug_objsdir)/, $(subst ./, , $(subst ../, , $(patsubst %.cpp, %.cpp.o, $(flexCUDA_cppfiles))))) +flexCUDA_debug_cc_o = $(addprefix $(flexCUDA_debug_objsdir)/, $(subst ./, , $(subst ../, , $(patsubst %.cc, %.cc.o, $(flexCUDA_ccfiles))))) +flexCUDA_debug_c_o = $(addprefix $(flexCUDA_debug_objsdir)/, $(subst ./, , $(subst ../, , $(patsubst %.c, %.c.o, $(flexCUDA_cfiles))))) +flexCUDA_debug_cuda_src_cuda_bvh_cu_o += $(OBJS_DIR)/flexCUDA_debug/cuda/src/cudabvh.o +flexCUDA_debug_cuda_src_cuda_flex_cu_o += $(OBJS_DIR)/flexCUDA_debug/cuda/src/cudaflex.o +flexCUDA_debug_cuda_src_cuda_sort_cu_o += $(OBJS_DIR)/flexCUDA_debug/cuda/src/cudasort.o +flexCUDA_debug_obj = $(flexCUDA_debug_cpp_o) $(flexCUDA_debug_cc_o) $(flexCUDA_debug_c_o) $(flexCUDA_debug_cuda_src_cuda_bvh_cu_o) $(flexCUDA_debug_cuda_src_cuda_flex_cu_o) $(flexCUDA_debug_cuda_src_cuda_sort_cu_o) +flexCUDA_debug_bin := ./../../../lib/linux64/NvFlexDebugCUDA_x64.a + +clean_flexCUDA_debug: + @$(ECHO) clean flexCUDA debug + @$(RMDIR) $(flexCUDA_debug_objsdir) + @$(RMDIR) $(flexCUDA_debug_bin) + @$(RMDIR) $(DEPSDIR)/flexCUDA/debug + +build_flexCUDA_debug: postbuild_flexCUDA_debug +postbuild_flexCUDA_debug: mainbuild_flexCUDA_debug +mainbuild_flexCUDA_debug: prebuild_flexCUDA_debug $(flexCUDA_debug_bin) +prebuild_flexCUDA_debug: + +$(flexCUDA_debug_bin): $(flexCUDA_debug_obj) + mkdir -p `dirname ./../../../lib/linux64/NvFlexDebugCUDA_x64.a` + @$(AR) rcs $(flexCUDA_debug_bin) $(flexCUDA_debug_obj) + $(ECHO) building $@ complete! + +$(flexCUDA_debug_cuda_src_cuda_bvh_cu_o): $(flexCUDA_cuda_src_cuda_bvh_cu) + @mkdir -p `dirname $(OBJS_DIR)/flexCUDA_debug/cuda/src/cudabvh.o` + $(ECHO) ../../../../../../external/CUDA/8.0.44-linux/bin/nvcc -O3 -g -arch=sm_30 -m64 -Xcompiler -fPIC -D_FORCE_INLINES -I../../.. -I../../../external -I../../../../../../external/CUDA/8.0.44-linux/include -I../../../external/cub-1.3.2 --compile "../../../src/cuda/bvh.cu" -o "$(OBJS_DIR)/flexCUDA_debug/cuda/src/cudabvh.o" + ../../../../../../external/CUDA/8.0.44-linux/bin/nvcc -O3 -g -arch=sm_30 -m64 -Xcompiler -fPIC -D_FORCE_INLINES -I../../.. -I../../../external -I../../../../../../external/CUDA/8.0.44-linux/include -I../../../external/cub-1.3.2 --compile "../../../src/cuda/bvh.cu" -o "$(OBJS_DIR)/flexCUDA_debug/cuda/src/cudabvh.o" + +$(flexCUDA_debug_cuda_src_cuda_flex_cu_o): $(flexCUDA_cuda_src_cuda_flex_cu) + @mkdir -p `dirname $(OBJS_DIR)/flexCUDA_debug/cuda/src/cudaflex.o` + $(ECHO) ../../../../../../external/CUDA/8.0.44-linux/bin/nvcc -O3 -g -arch=sm_30 -m64 -Xcompiler -fPIC -D_FORCE_INLINES -I../../.. -I../../../external -I../../../../../../external/CUDA/8.0.44-linux/include -I../../../external/cub-1.3.2 --compile "../../../src/cuda/flex.cu" -o "$(OBJS_DIR)/flexCUDA_debug/cuda/src/cudaflex.o" + ../../../../../../external/CUDA/8.0.44-linux/bin/nvcc -O3 -g -arch=sm_30 -m64 -Xcompiler -fPIC -D_FORCE_INLINES -I../../.. -I../../../external -I../../../../../../external/CUDA/8.0.44-linux/include -I../../../external/cub-1.3.2 --compile "../../../src/cuda/flex.cu" -o "$(OBJS_DIR)/flexCUDA_debug/cuda/src/cudaflex.o" + +$(flexCUDA_debug_cuda_src_cuda_sort_cu_o): $(flexCUDA_cuda_src_cuda_sort_cu) + @mkdir -p `dirname $(OBJS_DIR)/flexCUDA_debug/cuda/src/cudasort.o` + $(ECHO) ../../../../../../external/CUDA/8.0.44-linux/bin/nvcc -O3 -g -arch=sm_30 -m64 -Xcompiler -fPIC -D_FORCE_INLINES -I../../.. -I../../../external -I../../../../../../external/CUDA/8.0.44-linux/include -I../../../external/cub-1.3.2 --compile "../../../src/cuda/sort.cu" -o "$(OBJS_DIR)/flexCUDA_debug/cuda/src/cudasort.o" + ../../../../../../external/CUDA/8.0.44-linux/bin/nvcc -O3 -g -arch=sm_30 -m64 -Xcompiler -fPIC -D_FORCE_INLINES -I../../.. -I../../../external -I../../../../../../external/CUDA/8.0.44-linux/include -I../../../external/cub-1.3.2 --compile "../../../src/cuda/sort.cu" -o "$(OBJS_DIR)/flexCUDA_debug/cuda/src/cudasort.o" + +flexCUDA_debug_DEPDIR = $(dir $(@))/$(*F) +$(flexCUDA_debug_cpp_o): $(flexCUDA_debug_objsdir)/%.o: + $(ECHO) flexCUDA: compiling debug $(filter %$(strip $(subst .cpp.o,.cpp, $(subst $(flexCUDA_debug_objsdir),, $@))), $(flexCUDA_cppfiles))... + mkdir -p $(dir $(@)) + $(CXX) $(flexCUDA_debug_cppflags) -c $(filter %$(strip $(subst .cpp.o,.cpp, $(subst $(flexCUDA_debug_objsdir),, $@))), $(flexCUDA_cppfiles)) -o $@ + @mkdir -p $(dir $(addprefix $(DEPSDIR)/flexCUDA/debug/, $(subst ./, , $(subst ../, , $(filter %$(strip $(subst .cpp.o,.cpp, $(subst $(flexCUDA_debug_objsdir),, $@))), $(flexCUDA_cppfiles)))))) + cp $(flexCUDA_debug_DEPDIR).d $(addprefix $(DEPSDIR)/flexCUDA/debug/, $(subst ./, , $(subst ../, , $(filter %$(strip $(subst .cpp.o,.cpp, $(subst $(flexCUDA_debug_objsdir),, $@))), $(flexCUDA_cppfiles))))).P; \ + sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \ + -e '/^$$/ d' -e 's/$$/ :/' < $(flexCUDA_debug_DEPDIR).d >> $(addprefix $(DEPSDIR)/flexCUDA/debug/, $(subst ./, , $(subst ../, , $(filter %$(strip $(subst .cpp.o,.cpp, $(subst $(flexCUDA_debug_objsdir),, $@))), $(flexCUDA_cppfiles))))).P; \ + rm -f $(flexCUDA_debug_DEPDIR).d + +$(flexCUDA_debug_cc_o): $(flexCUDA_debug_objsdir)/%.o: + $(ECHO) flexCUDA: compiling debug $(filter %$(strip $(subst .cc.o,.cc, $(subst $(flexCUDA_debug_objsdir),, $@))), $(flexCUDA_ccfiles))... + mkdir -p $(dir $(@)) + $(CXX) $(flexCUDA_debug_cppflags) -c $(filter %$(strip $(subst .cc.o,.cc, $(subst $(flexCUDA_debug_objsdir),, $@))), $(flexCUDA_ccfiles)) -o $@ + mkdir -p $(dir $(addprefix $(DEPSDIR)/, $(subst ./, , $(subst ../, , $(filter %$(strip $(subst .cc.o,.cc, $(subst $(flexCUDA_debug_objsdir),, $@))), $(flexCUDA_ccfiles)))))) + cp $(flexCUDA_debug_DEPDIR).d $(addprefix $(DEPSDIR)/, $(subst ./, , $(subst ../, , $(filter %$(strip $(subst .cc.o,.cc, $(subst $(flexCUDA_debug_objsdir),, $@))), $(flexCUDA_ccfiles))))).debug.P; \ + sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \ + -e '/^$$/ d' -e 's/$$/ :/' < $(flexCUDA_debug_DEPDIR).d >> $(addprefix $(DEPSDIR)/, $(subst ./, , $(subst ../, , $(filter %$(strip $(subst .cc.o,.cc, $(subst $(flexCUDA_debug_objsdir),, $@))), $(flexCUDA_ccfiles))))).debug.P; \ + rm -f $(flexCUDA_debug_DEPDIR).d + +$(flexCUDA_debug_c_o): $(flexCUDA_debug_objsdir)/%.o: + $(ECHO) flexCUDA: compiling debug $(filter %$(strip $(subst .c.o,.c, $(subst $(flexCUDA_debug_objsdir),, $@))), $(flexCUDA_cfiles))... + mkdir -p $(dir $(@)) + $(CC) $(flexCUDA_debug_cflags) -c $(filter %$(strip $(subst .c.o,.c, $(subst $(flexCUDA_debug_objsdir),, $@))), $(flexCUDA_cfiles)) -o $@ + @mkdir -p $(dir $(addprefix $(DEPSDIR)/flexCUDA/debug/, $(subst ./, , $(subst ../, , $(filter %$(strip $(subst .c.o,.c, $(subst $(flexCUDA_debug_objsdir),, $@))), $(flexCUDA_cfiles)))))) + cp $(flexCUDA_debug_DEPDIR).d $(addprefix $(DEPSDIR)/flexCUDA/debug/, $(subst ./, , $(subst ../, , $(filter %$(strip $(subst .c.o,.c, $(subst $(flexCUDA_debug_objsdir),, $@))), $(flexCUDA_cfiles))))).P; \ + sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \ + -e '/^$$/ d' -e 's/$$/ :/' < $(flexCUDA_debug_DEPDIR).d >> $(addprefix $(DEPSDIR)/flexCUDA/debug/, $(subst ./, , $(subst ../, , $(filter %$(strip $(subst .c.o,.c, $(subst $(flexCUDA_debug_objsdir),, $@))), $(flexCUDA_cfiles))))).P; \ + rm -f $(flexCUDA_debug_DEPDIR).d + +clean_flexCUDA: clean_flexCUDA_release clean_flexCUDA_debug + rm -rf $(DEPSDIR) + +export VERBOSE +ifndef VERBOSE +.SILENT: +endif diff --git a/extensions/compiler/makelinux64/Makefile.flexExtCUDA.mk b/extensions/compiler/makelinux64/Makefile.flexExtCUDA.mk new file mode 100644 index 0000000..cf13501 --- /dev/null +++ b/extensions/compiler/makelinux64/Makefile.flexExtCUDA.mk @@ -0,0 +1,197 @@ +# Makefile generated by XPJ for linux64 +-include Makefile.custom +ProjectName = flexExtCUDA +flexExtCUDA_cppfiles += ./../../flexExtCloth.cpp +flexExtCUDA_cppfiles += ./../../flexExtContainer.cpp +flexExtCUDA_cppfiles += ./../../flexExtMovingFrame.cpp +flexExtCUDA_cppfiles += ./../../flexExtRigid.cpp +flexExtCUDA_cppfiles += ./../../flexExtSoft.cpp +flexExtCUDA_cuda_cuda_flexExt_cu += ./../../cuda/flexExt.cu +flexExtCUDA_cppfiles += ./../../../core/sdf.cpp +flexExtCUDA_cppfiles += ./../../../core/voxelize.cpp +flexExtCUDA_cppfiles += ./../../../core/maths.cpp +flexExtCUDA_cppfiles += ./../../../core/aabbtree.cpp + +flexExtCUDA_cpp_release_dep = $(addprefix $(DEPSDIR)/flexExtCUDA/release/, $(subst ./, , $(subst ../, , $(patsubst %.cpp, %.cpp.P, $(flexExtCUDA_cppfiles))))) +flexExtCUDA_cc_release_dep = $(addprefix $(DEPSDIR)/, $(subst ./, , $(subst ../, , $(patsubst %.cc, %.cc.release.P, $(flexExtCUDA_ccfiles))))) +flexExtCUDA_c_release_dep = $(addprefix $(DEPSDIR)/flexExtCUDA/release/, $(subst ./, , $(subst ../, , $(patsubst %.c, %.c.P, $(flexExtCUDA_cfiles))))) +flexExtCUDA_release_dep = $(flexExtCUDA_cpp_release_dep) $(flexExtCUDA_cc_release_dep) $(flexExtCUDA_c_release_dep) +-include $(flexExtCUDA_release_dep) +flexExtCUDA_cpp_debug_dep = $(addprefix $(DEPSDIR)/flexExtCUDA/debug/, $(subst ./, , $(subst ../, , $(patsubst %.cpp, %.cpp.P, $(flexExtCUDA_cppfiles))))) +flexExtCUDA_cc_debug_dep = $(addprefix $(DEPSDIR)/, $(subst ./, , $(subst ../, , $(patsubst %.cc, %.cc.debug.P, $(flexExtCUDA_ccfiles))))) +flexExtCUDA_c_debug_dep = $(addprefix $(DEPSDIR)/flexExtCUDA/debug/, $(subst ./, , $(subst ../, , $(patsubst %.c, %.c.P, $(flexExtCUDA_cfiles))))) +flexExtCUDA_debug_dep = $(flexExtCUDA_cpp_debug_dep) $(flexExtCUDA_cc_debug_dep) $(flexExtCUDA_c_debug_dep) +-include $(flexExtCUDA_debug_dep) +flexExtCUDA_release_hpaths := +flexExtCUDA_release_hpaths += $(CUDA_PATH)/include +flexExtCUDA_release_hpaths += $(CUDA_PATH)/extras/cupti/include +flexExtCUDA_release_hpaths += ./../../.. +flexExtCUDA_release_hpaths += ./../../../external/freeglut/include +flexExtCUDA_release_lpaths := +flexExtCUDA_release_lpaths += $(CUDA_PATH)/lib64 +flexExtCUDA_release_defines := $(flexExtCUDA_custom_defines) +flexExtCUDA_release_libraries := +flexExtCUDA_release_libraries += ./../../../lib/linux64/NvFlexReleaseCUDA_x64.a +flexExtCUDA_release_common_cflags := $(flexExtCUDA_custom_cflags) +flexExtCUDA_release_common_cflags += -MMD +flexExtCUDA_release_common_cflags += $(addprefix -D, $(flexExtCUDA_release_defines)) +flexExtCUDA_release_common_cflags += $(addprefix -I, $(flexExtCUDA_release_hpaths)) +flexExtCUDA_release_common_cflags += -m64 +flexExtCUDA_release_common_cflags += -Wall -std=c++0x -fPIC -fpermissive -fno-strict-aliasing +flexExtCUDA_release_common_cflags += -O3 -ffast-math -DNDEBUG +flexExtCUDA_release_cflags := $(flexExtCUDA_release_common_cflags) +flexExtCUDA_release_cppflags := $(flexExtCUDA_release_common_cflags) +flexExtCUDA_release_lflags := $(flexExtCUDA_custom_lflags) +flexExtCUDA_release_lflags += $(addprefix -L, $(flexExtCUDA_release_lpaths)) +flexExtCUDA_release_lflags += -Wl,--start-group $(addprefix -l, $(flexExtCUDA_release_libraries)) -Wl,--end-group +flexExtCUDA_release_lflags += -m64 +flexExtCUDA_release_objsdir = $(OBJS_DIR)/flexExtCUDA_release +flexExtCUDA_release_cpp_o = $(addprefix $(flexExtCUDA_release_objsdir)/, $(subst ./, , $(subst ../, , $(patsubst %.cpp, %.cpp.o, $(flexExtCUDA_cppfiles))))) +flexExtCUDA_release_cc_o = $(addprefix $(flexExtCUDA_release_objsdir)/, $(subst ./, , $(subst ../, , $(patsubst %.cc, %.cc.o, $(flexExtCUDA_ccfiles))))) +flexExtCUDA_release_c_o = $(addprefix $(flexExtCUDA_release_objsdir)/, $(subst ./, , $(subst ../, , $(patsubst %.c, %.c.o, $(flexExtCUDA_cfiles))))) +flexExtCUDA_release_cuda_cuda_flexExt_cu_o += $(OBJS_DIR)/flexExtCUDA_release/cuda/cudaflexExt.o +flexExtCUDA_release_obj = $(flexExtCUDA_release_cpp_o) $(flexExtCUDA_release_cc_o) $(flexExtCUDA_release_c_o) $(flexExtCUDA_release_cuda_cuda_flexExt_cu_o) +flexExtCUDA_release_bin := ./../../../lib/linux64/NvFlexExtReleaseCUDA_x64.a + +clean_flexExtCUDA_release: + @$(ECHO) clean flexExtCUDA release + @$(RMDIR) $(flexExtCUDA_release_objsdir) + @$(RMDIR) $(flexExtCUDA_release_bin) + @$(RMDIR) $(DEPSDIR)/flexExtCUDA/release + +build_flexExtCUDA_release: postbuild_flexExtCUDA_release +postbuild_flexExtCUDA_release: mainbuild_flexExtCUDA_release +mainbuild_flexExtCUDA_release: prebuild_flexExtCUDA_release $(flexExtCUDA_release_bin) +prebuild_flexExtCUDA_release: + +$(flexExtCUDA_release_bin): $(flexExtCUDA_release_obj) + mkdir -p `dirname ./../../../lib/linux64/NvFlexExtReleaseCUDA_x64.a` + @$(AR) rcs $(flexExtCUDA_release_bin) $(flexExtCUDA_release_obj) + $(ECHO) building $@ complete! + +$(flexExtCUDA_release_cuda_cuda_flexExt_cu_o): $(flexExtCUDA_cuda_cuda_flexExt_cu) + @mkdir -p `dirname $(OBJS_DIR)/flexExtCUDA_release/cuda/cudaflexExt.o` + $(ECHO) $(CUDA_PATH)/bin/nvcc -O3 -g -arch=sm_30 -m64 -Xcompiler -fPIC -D_FORCE_INLINES -I../../.. -I../../../external -I$(CUDA_PATH)/include -I../../../external/cub-1.3.2 --compile "./../../cuda/flexExt.cu" -o "$(OBJS_DIR)/flexExtCUDA_release/cuda/cudaflexExt.o" + $(CUDA_PATH)/bin/nvcc -O3 -g -arch=sm_30 -m64 -Xcompiler -fPIC -D_FORCE_INLINES -I../../.. -I../../../external -I$(CUDA_PATH)/include -I../../../external/cub-1.3.2 --compile "./../../cuda/flexExt.cu" -o "$(OBJS_DIR)/flexExtCUDA_release/cuda/cudaflexExt.o" + +flexExtCUDA_release_DEPDIR = $(dir $(@))/$(*F) +$(flexExtCUDA_release_cpp_o): $(flexExtCUDA_release_objsdir)/%.o: + $(ECHO) flexExtCUDA: compiling release $(filter %$(strip $(subst .cpp.o,.cpp, $(subst $(flexExtCUDA_release_objsdir),, $@))), $(flexExtCUDA_cppfiles))... + mkdir -p $(dir $(@)) + $(CXX) $(flexExtCUDA_release_cppflags) -c $(filter %$(strip $(subst .cpp.o,.cpp, $(subst $(flexExtCUDA_release_objsdir),, $@))), $(flexExtCUDA_cppfiles)) -o $@ + @mkdir -p $(dir $(addprefix $(DEPSDIR)/flexExtCUDA/release/, $(subst ./, , $(subst ../, , $(filter %$(strip $(subst .cpp.o,.cpp, $(subst $(flexExtCUDA_release_objsdir),, $@))), $(flexExtCUDA_cppfiles)))))) + cp $(flexExtCUDA_release_DEPDIR).d $(addprefix $(DEPSDIR)/flexExtCUDA/release/, $(subst ./, , $(subst ../, , $(filter %$(strip $(subst .cpp.o,.cpp, $(subst $(flexExtCUDA_release_objsdir),, $@))), $(flexExtCUDA_cppfiles))))).P; \ + sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \ + -e '/^$$/ d' -e 's/$$/ :/' < $(flexExtCUDA_release_DEPDIR).d >> $(addprefix $(DEPSDIR)/flexExtCUDA/release/, $(subst ./, , $(subst ../, , $(filter %$(strip $(subst .cpp.o,.cpp, $(subst $(flexExtCUDA_release_objsdir),, $@))), $(flexExtCUDA_cppfiles))))).P; \ + rm -f $(flexExtCUDA_release_DEPDIR).d + +$(flexExtCUDA_release_cc_o): $(flexExtCUDA_release_objsdir)/%.o: + $(ECHO) flexExtCUDA: compiling release $(filter %$(strip $(subst .cc.o,.cc, $(subst $(flexExtCUDA_release_objsdir),, $@))), $(flexExtCUDA_ccfiles))... + mkdir -p $(dir $(@)) + $(CXX) $(flexExtCUDA_release_cppflags) -c $(filter %$(strip $(subst .cc.o,.cc, $(subst $(flexExtCUDA_release_objsdir),, $@))), $(flexExtCUDA_ccfiles)) -o $@ + mkdir -p $(dir $(addprefix $(DEPSDIR)/, $(subst ./, , $(subst ../, , $(filter %$(strip $(subst .cc.o,.cc, $(subst $(flexExtCUDA_release_objsdir),, $@))), $(flexExtCUDA_ccfiles)))))) + cp $(flexExtCUDA_release_DEPDIR).d $(addprefix $(DEPSDIR)/, $(subst ./, , $(subst ../, , $(filter %$(strip $(subst .cc.o,.cc, $(subst $(flexExtCUDA_release_objsdir),, $@))), $(flexExtCUDA_ccfiles))))).release.P; \ + sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \ + -e '/^$$/ d' -e 's/$$/ :/' < $(flexExtCUDA_release_DEPDIR).d >> $(addprefix $(DEPSDIR)/, $(subst ./, , $(subst ../, , $(filter %$(strip $(subst .cc.o,.cc, $(subst $(flexExtCUDA_release_objsdir),, $@))), $(flexExtCUDA_ccfiles))))).release.P; \ + rm -f $(flexExtCUDA_release_DEPDIR).d + +$(flexExtCUDA_release_c_o): $(flexExtCUDA_release_objsdir)/%.o: + $(ECHO) flexExtCUDA: compiling release $(filter %$(strip $(subst .c.o,.c, $(subst $(flexExtCUDA_release_objsdir),, $@))), $(flexExtCUDA_cfiles))... + mkdir -p $(dir $(@)) + $(CC) $(flexExtCUDA_release_cflags) -c $(filter %$(strip $(subst .c.o,.c, $(subst $(flexExtCUDA_release_objsdir),, $@))), $(flexExtCUDA_cfiles)) -o $@ + @mkdir -p $(dir $(addprefix $(DEPSDIR)/flexExtCUDA/release/, $(subst ./, , $(subst ../, , $(filter %$(strip $(subst .c.o,.c, $(subst $(flexExtCUDA_release_objsdir),, $@))), $(flexExtCUDA_cfiles)))))) + cp $(flexExtCUDA_release_DEPDIR).d $(addprefix $(DEPSDIR)/flexExtCUDA/release/, $(subst ./, , $(subst ../, , $(filter %$(strip $(subst .c.o,.c, $(subst $(flexExtCUDA_release_objsdir),, $@))), $(flexExtCUDA_cfiles))))).P; \ + sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \ + -e '/^$$/ d' -e 's/$$/ :/' < $(flexExtCUDA_release_DEPDIR).d >> $(addprefix $(DEPSDIR)/flexExtCUDA/release/, $(subst ./, , $(subst ../, , $(filter %$(strip $(subst .c.o,.c, $(subst $(flexExtCUDA_release_objsdir),, $@))), $(flexExtCUDA_cfiles))))).P; \ + rm -f $(flexExtCUDA_release_DEPDIR).d + +flexExtCUDA_debug_hpaths := +flexExtCUDA_debug_hpaths += $(CUDA_PATH)/include +flexExtCUDA_debug_hpaths += $(CUDA_PATH)/extras/cupti/include +flexExtCUDA_debug_hpaths += ./../../.. +flexExtCUDA_debug_hpaths += ./../../../external/freeglut/include +flexExtCUDA_debug_lpaths := +flexExtCUDA_debug_lpaths += $(CUDA_PATH)/lib64 +flexExtCUDA_debug_defines := $(flexExtCUDA_custom_defines) +flexExtCUDA_debug_libraries := +flexExtCUDA_debug_libraries += ./../../../lib/linux64/NvFlexDebugCUDA_x64.a +flexExtCUDA_debug_common_cflags := $(flexExtCUDA_custom_cflags) +flexExtCUDA_debug_common_cflags += -MMD +flexExtCUDA_debug_common_cflags += $(addprefix -D, $(flexExtCUDA_debug_defines)) +flexExtCUDA_debug_common_cflags += $(addprefix -I, $(flexExtCUDA_debug_hpaths)) +flexExtCUDA_debug_common_cflags += -m64 +flexExtCUDA_debug_common_cflags += -Wall -std=c++0x -fPIC -fpermissive -fno-strict-aliasing +flexExtCUDA_debug_common_cflags += -g -O0 +flexExtCUDA_debug_cflags := $(flexExtCUDA_debug_common_cflags) +flexExtCUDA_debug_cppflags := $(flexExtCUDA_debug_common_cflags) +flexExtCUDA_debug_lflags := $(flexExtCUDA_custom_lflags) +flexExtCUDA_debug_lflags += $(addprefix -L, $(flexExtCUDA_debug_lpaths)) +flexExtCUDA_debug_lflags += -Wl,--start-group $(addprefix -l, $(flexExtCUDA_debug_libraries)) -Wl,--end-group +flexExtCUDA_debug_lflags += -m64 +flexExtCUDA_debug_objsdir = $(OBJS_DIR)/flexExtCUDA_debug +flexExtCUDA_debug_cpp_o = $(addprefix $(flexExtCUDA_debug_objsdir)/, $(subst ./, , $(subst ../, , $(patsubst %.cpp, %.cpp.o, $(flexExtCUDA_cppfiles))))) +flexExtCUDA_debug_cc_o = $(addprefix $(flexExtCUDA_debug_objsdir)/, $(subst ./, , $(subst ../, , $(patsubst %.cc, %.cc.o, $(flexExtCUDA_ccfiles))))) +flexExtCUDA_debug_c_o = $(addprefix $(flexExtCUDA_debug_objsdir)/, $(subst ./, , $(subst ../, , $(patsubst %.c, %.c.o, $(flexExtCUDA_cfiles))))) +flexExtCUDA_debug_cuda_cuda_flexExt_cu_o += $(OBJS_DIR)/flexExtCUDA_debug/cuda/cudaflexExt.o +flexExtCUDA_debug_obj = $(flexExtCUDA_debug_cpp_o) $(flexExtCUDA_debug_cc_o) $(flexExtCUDA_debug_c_o) $(flexExtCUDA_debug_cuda_cuda_flexExt_cu_o) +flexExtCUDA_debug_bin := ./../../../lib/linux64/NvFlexExtDebugCUDA_x64.a + +clean_flexExtCUDA_debug: + @$(ECHO) clean flexExtCUDA debug + @$(RMDIR) $(flexExtCUDA_debug_objsdir) + @$(RMDIR) $(flexExtCUDA_debug_bin) + @$(RMDIR) $(DEPSDIR)/flexExtCUDA/debug + +build_flexExtCUDA_debug: postbuild_flexExtCUDA_debug +postbuild_flexExtCUDA_debug: mainbuild_flexExtCUDA_debug +mainbuild_flexExtCUDA_debug: prebuild_flexExtCUDA_debug $(flexExtCUDA_debug_bin) +prebuild_flexExtCUDA_debug: + +$(flexExtCUDA_debug_bin): $(flexExtCUDA_debug_obj) + mkdir -p `dirname ./../../../lib/linux64/NvFlexExtDebugCUDA_x64.a` + @$(AR) rcs $(flexExtCUDA_debug_bin) $(flexExtCUDA_debug_obj) + $(ECHO) building $@ complete! + +$(flexExtCUDA_debug_cuda_cuda_flexExt_cu_o): $(flexExtCUDA_cuda_cuda_flexExt_cu) + @mkdir -p `dirname $(OBJS_DIR)/flexExtCUDA_debug/cuda/cudaflexExt.o` + $(ECHO) $(CUDA_PATH)/bin/nvcc -O3 -g -arch=sm_30 -m64 -Xcompiler -fPIC -D_FORCE_INLINES -I../../.. -I../../../external -I$(CUDA_PATH)/include -I../../../external/cub-1.3.2 --compile "./../../cuda/flexExt.cu" -o "$(OBJS_DIR)/flexExtCUDA_debug/cuda/cudaflexExt.o" + $(CUDA_PATH)/bin/nvcc -O3 -g -arch=sm_30 -m64 -Xcompiler -fPIC -D_FORCE_INLINES -I../../.. -I../../../external -I$(CUDA_PATH)/include -I../../../external/cub-1.3.2 --compile "./../../cuda/flexExt.cu" -o "$(OBJS_DIR)/flexExtCUDA_debug/cuda/cudaflexExt.o" + +flexExtCUDA_debug_DEPDIR = $(dir $(@))/$(*F) +$(flexExtCUDA_debug_cpp_o): $(flexExtCUDA_debug_objsdir)/%.o: + $(ECHO) flexExtCUDA: compiling debug $(filter %$(strip $(subst .cpp.o,.cpp, $(subst $(flexExtCUDA_debug_objsdir),, $@))), $(flexExtCUDA_cppfiles))... + mkdir -p $(dir $(@)) + $(CXX) $(flexExtCUDA_debug_cppflags) -c $(filter %$(strip $(subst .cpp.o,.cpp, $(subst $(flexExtCUDA_debug_objsdir),, $@))), $(flexExtCUDA_cppfiles)) -o $@ + @mkdir -p $(dir $(addprefix $(DEPSDIR)/flexExtCUDA/debug/, $(subst ./, , $(subst ../, , $(filter %$(strip $(subst .cpp.o,.cpp, $(subst $(flexExtCUDA_debug_objsdir),, $@))), $(flexExtCUDA_cppfiles)))))) + cp $(flexExtCUDA_debug_DEPDIR).d $(addprefix $(DEPSDIR)/flexExtCUDA/debug/, $(subst ./, , $(subst ../, , $(filter %$(strip $(subst .cpp.o,.cpp, $(subst $(flexExtCUDA_debug_objsdir),, $@))), $(flexExtCUDA_cppfiles))))).P; \ + sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \ + -e '/^$$/ d' -e 's/$$/ :/' < $(flexExtCUDA_debug_DEPDIR).d >> $(addprefix $(DEPSDIR)/flexExtCUDA/debug/, $(subst ./, , $(subst ../, , $(filter %$(strip $(subst .cpp.o,.cpp, $(subst $(flexExtCUDA_debug_objsdir),, $@))), $(flexExtCUDA_cppfiles))))).P; \ + rm -f $(flexExtCUDA_debug_DEPDIR).d + +$(flexExtCUDA_debug_cc_o): $(flexExtCUDA_debug_objsdir)/%.o: + $(ECHO) flexExtCUDA: compiling debug $(filter %$(strip $(subst .cc.o,.cc, $(subst $(flexExtCUDA_debug_objsdir),, $@))), $(flexExtCUDA_ccfiles))... + mkdir -p $(dir $(@)) + $(CXX) $(flexExtCUDA_debug_cppflags) -c $(filter %$(strip $(subst .cc.o,.cc, $(subst $(flexExtCUDA_debug_objsdir),, $@))), $(flexExtCUDA_ccfiles)) -o $@ + mkdir -p $(dir $(addprefix $(DEPSDIR)/, $(subst ./, , $(subst ../, , $(filter %$(strip $(subst .cc.o,.cc, $(subst $(flexExtCUDA_debug_objsdir),, $@))), $(flexExtCUDA_ccfiles)))))) + cp $(flexExtCUDA_debug_DEPDIR).d $(addprefix $(DEPSDIR)/, $(subst ./, , $(subst ../, , $(filter %$(strip $(subst .cc.o,.cc, $(subst $(flexExtCUDA_debug_objsdir),, $@))), $(flexExtCUDA_ccfiles))))).debug.P; \ + sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \ + -e '/^$$/ d' -e 's/$$/ :/' < $(flexExtCUDA_debug_DEPDIR).d >> $(addprefix $(DEPSDIR)/, $(subst ./, , $(subst ../, , $(filter %$(strip $(subst .cc.o,.cc, $(subst $(flexExtCUDA_debug_objsdir),, $@))), $(flexExtCUDA_ccfiles))))).debug.P; \ + rm -f $(flexExtCUDA_debug_DEPDIR).d + +$(flexExtCUDA_debug_c_o): $(flexExtCUDA_debug_objsdir)/%.o: + $(ECHO) flexExtCUDA: compiling debug $(filter %$(strip $(subst .c.o,.c, $(subst $(flexExtCUDA_debug_objsdir),, $@))), $(flexExtCUDA_cfiles))... + mkdir -p $(dir $(@)) + $(CC) $(flexExtCUDA_debug_cflags) -c $(filter %$(strip $(subst .c.o,.c, $(subst $(flexExtCUDA_debug_objsdir),, $@))), $(flexExtCUDA_cfiles)) -o $@ + @mkdir -p $(dir $(addprefix $(DEPSDIR)/flexExtCUDA/debug/, $(subst ./, , $(subst ../, , $(filter %$(strip $(subst .c.o,.c, $(subst $(flexExtCUDA_debug_objsdir),, $@))), $(flexExtCUDA_cfiles)))))) + cp $(flexExtCUDA_debug_DEPDIR).d $(addprefix $(DEPSDIR)/flexExtCUDA/debug/, $(subst ./, , $(subst ../, , $(filter %$(strip $(subst .c.o,.c, $(subst $(flexExtCUDA_debug_objsdir),, $@))), $(flexExtCUDA_cfiles))))).P; \ + sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \ + -e '/^$$/ d' -e 's/$$/ :/' < $(flexExtCUDA_debug_DEPDIR).d >> $(addprefix $(DEPSDIR)/flexExtCUDA/debug/, $(subst ./, , $(subst ../, , $(filter %$(strip $(subst .c.o,.c, $(subst $(flexExtCUDA_debug_objsdir),, $@))), $(flexExtCUDA_cfiles))))).P; \ + rm -f $(flexExtCUDA_debug_DEPDIR).d + +clean_flexExtCUDA: clean_flexExtCUDA_release clean_flexExtCUDA_debug + rm -rf $(DEPSDIR) + +export VERBOSE +ifndef VERBOSE +.SILENT: +endif diff --git a/extensions/compiler/vc12win32/flexExtCUDA.sln b/extensions/compiler/vc12win32/flexExtCUDA.sln new file mode 100644 index 0000000..010e75d --- /dev/null +++ b/extensions/compiler/vc12win32/flexExtCUDA.sln @@ -0,0 +1,24 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "flexExtCUDA", "./flexExtCUDA.vcxproj", "{FD4C9C06-7BEC-CDF8-C631-CD32A428A280}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + debug|Win32 = debug|Win32 + release|Win32 = release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {FD4C9C06-7BEC-CDF8-C631-CD32A428A280}.debug|Win32.ActiveCfg = debug|Win32 + {FD4C9C06-7BEC-CDF8-C631-CD32A428A280}.debug|Win32.Build.0 = debug|Win32 + {FD4C9C06-7BEC-CDF8-C631-CD32A428A280}.release|Win32.ActiveCfg = release|Win32 + {FD4C9C06-7BEC-CDF8-C631-CD32A428A280}.release|Win32.Build.0 = release|Win32 + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + EndGlobalSection + GlobalSection(ExtensibilityAddins) = postSolution + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + EndGlobalSection +EndGlobal diff --git a/extensions/compiler/vc12win32/flexExtCUDA.vcxproj b/extensions/compiler/vc12win32/flexExtCUDA.vcxproj new file mode 100644 index 0000000..43efc87 --- /dev/null +++ b/extensions/compiler/vc12win32/flexExtCUDA.vcxproj @@ -0,0 +1,150 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="debug|Win32"> + <Configuration>debug</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="release|Win32"> + <Configuration>release</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + </ItemGroup> + <PropertyGroup Label="Globals"> + <ProjectGuid>{FD4C9C06-7BEC-CDF8-C631-CD32A428A280}</ProjectGuid> + <RootNamespace>flexExtCUDA</RootNamespace> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug|Win32'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <PlatformToolset>v120</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release|Win32'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <PlatformToolset>v120</PlatformToolset> + <WholeProgramOptimization>true</WholeProgramOptimization> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <ImportGroup Label="ExtensionSettings"> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='debug|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='release|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug|Win32'"> + <OutDir>./../../../bin/win32\</OutDir> + <IntDir>./build/win32/debug\</IntDir> + <TargetExt>.dll</TargetExt> + <TargetName>NvFlexExtDebugCUDA_x86</TargetName> + <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> + <CodeAnalysisRules /> + <CodeAnalysisRuleAssemblies /> + <SkipCopyingSymbolsToOutputDirectory>true</SkipCopyingSymbolsToOutputDirectory> + </PropertyGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='debug|Win32'"> + <ClCompile> + <FloatingPointModel>Precise</FloatingPointModel> + <AdditionalOptions> /d2Zi+</AdditionalOptions> + <Optimization>Disabled</Optimization> + <AdditionalIncludeDirectories>$(CUDA_PATH)/include;$(CUDA_PATH)/extras/cupti/include;./../../../../..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>_CONSOLE;WIN32;_DEBUG;_ITERATOR_DEBUG_LEVEL=0;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <WarningLevel>Level3</WarningLevel> + <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> + <PrecompiledHeader>NotUsing</PrecompiledHeader> + <PrecompiledHeaderFile></PrecompiledHeaderFile> + </ClCompile> + <Link> + <AdditionalDependencies>cudart.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;./../../../lib/win32/NvFlexDebugCUDA_x86.lib;%(AdditionalDependencies)</AdditionalDependencies> + <OutputFile>$(OutDir)NvFlexExtDebugCUDA_x86.dll</OutputFile> + <AdditionalLibraryDirectories>$(CUDA_PATH)/lib/win32;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> + <ProgramDatabaseFile>$(OutDir)/NvFlexExtDebugCUDA_x86.dll.pdb</ProgramDatabaseFile> + <SubSystem>Console</SubSystem> + <ImportLibrary>./../../../lib/win32/NvFlexExtDebugCUDA_x86.lib</ImportLibrary> + <GenerateDebugInformation>true</GenerateDebugInformation> + <TargetMachine>MachineX86</TargetMachine> + </Link> + <ResourceCompile> + </ResourceCompile> + <ProjectReference> + </ProjectReference> + </ItemDefinitionGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release|Win32'"> + <OutDir>./../../../bin/win32\</OutDir> + <IntDir>./build/win32/release\</IntDir> + <TargetExt>.dll</TargetExt> + <TargetName>NvFlexExtReleaseCUDA_x86</TargetName> + <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> + <CodeAnalysisRules /> + <CodeAnalysisRuleAssemblies /> + <SkipCopyingSymbolsToOutputDirectory>true</SkipCopyingSymbolsToOutputDirectory> + </PropertyGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='release|Win32'"> + <ClCompile> + <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet> + <IntrinsicFunctions>true</IntrinsicFunctions> + <FunctionLevelLinking>true</FunctionLevelLinking> + <BufferSecurityCheck>false</BufferSecurityCheck> + <FloatingPointModel>Fast</FloatingPointModel> + <AdditionalOptions> /d2Zi+</AdditionalOptions> + <Optimization>Full</Optimization> + <AdditionalIncludeDirectories>$(CUDA_PATH)/include;$(CUDA_PATH)/extras/cupti/include;./../../../../..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>_CONSOLE;WIN32;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <WarningLevel>Level3</WarningLevel> + <RuntimeLibrary>MultiThreaded</RuntimeLibrary> + <PrecompiledHeader>NotUsing</PrecompiledHeader> + <PrecompiledHeaderFile></PrecompiledHeaderFile> + </ClCompile> + <Link> + <AdditionalDependencies>cudart.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;./../../../lib/win32/NvFlexReleaseCUDA_x86.lib;%(AdditionalDependencies)</AdditionalDependencies> + <OutputFile>$(OutDir)NvFlexExtReleaseCUDA_x86.dll</OutputFile> + <AdditionalLibraryDirectories>$(CUDA_PATH)/lib/win32;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> + <ProgramDatabaseFile>$(OutDir)/NvFlexExtReleaseCUDA_x86.dll.pdb</ProgramDatabaseFile> + <SubSystem>Console</SubSystem> + <ImportLibrary>./../../../lib/win32/NvFlexExtReleaseCUDA_x86.lib</ImportLibrary> + <GenerateDebugInformation>true</GenerateDebugInformation> + <TargetMachine>MachineX86</TargetMachine> + </Link> + <ResourceCompile> + </ResourceCompile> + <ProjectReference> + </ProjectReference> + </ItemDefinitionGroup> + <ItemGroup> + <ClCompile Include="..\..\flexExtCloth.cpp"> + </ClCompile> + <ClCompile Include="..\..\flexExtContainer.cpp"> + </ClCompile> + <ClCompile Include="..\..\flexExtMovingFrame.cpp"> + </ClCompile> + <ClCompile Include="..\..\flexExtRigid.cpp"> + </ClCompile> + <ClCompile Include="..\..\flexExtSoft.cpp"> + </ClCompile> + </ItemGroup> + <ItemGroup> + <CustomBuild Include="..\..\cuda\flexExt.cu"> + <FileType Condition="'$(Configuration)|$(Platform)'=='debug|Win32'">cuda</FileType> + <Command Condition="'$(Configuration)|$(Platform)'=='debug|Win32'">"$(CUDA_PATH)\bin\nvcc.exe" -g -G --compiler-bindir="$(VCInstallDir)bin" --compiler-options=/MTd,/Zi -I"..\..\.." -D_ITERATOR_DEBUG_LEVEL=0 -DCUDA -m32 -arch=sm_30 -prec-div=false -prec-sqrt=false -ftz=true -use_fast_math -c ..\..\cuda\flexExt.cu -o ./Win32/flexExtCUDA/debug/cuda/flexExt.obj</Command> + <Message Condition="'$(Configuration)|$(Platform)'=='debug|Win32'">Building %(Identity)</Message> + <Outputs Condition="'$(Configuration)|$(Platform)'=='debug|Win32'">./Win32/flexExtCUDA/debug/cuda/flexExt.obj;</Outputs> + <FileType Condition="'$(Configuration)|$(Platform)'=='release|Win32'">cuda</FileType> + <Command Condition="'$(Configuration)|$(Platform)'=='release|Win32'">"$(CUDA_PATH)\bin\nvcc.exe" -O3 --compiler-bindir="$(VCInstallDir)bin" --compiler-options=/MT,/Zi -I"..\..\.." -D_ITERATOR_DEBUG_LEVEL=0 -DNDEBUG -DCUDA -m32 -arch=sm_30 -prec-div=false -prec-sqrt=false -ftz=true -use_fast_math -c ..\..\cuda\flexExt.cu -o ./Win32/flexExtCUDA/release/cuda/flexExt.obj</Command> + <Message Condition="'$(Configuration)|$(Platform)'=='release|Win32'">Building %(Identity)</Message> + <Outputs Condition="'$(Configuration)|$(Platform)'=='release|Win32'">./Win32/flexExtCUDA/release/cuda/flexExt.obj;</Outputs> + </CustomBuild> + </ItemGroup> + <ItemGroup> + <ClCompile Include="..\..\..\core\sdf.cpp"> + </ClCompile> + <ClCompile Include="..\..\..\core\voxelize.cpp"> + </ClCompile> + <ClCompile Include="..\..\..\core\maths.cpp"> + </ClCompile> + <ClCompile Include="..\..\..\core\aabbtree.cpp"> + </ClCompile> + </ItemGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"></ImportGroup> +</Project> diff --git a/extensions/compiler/vc12win32/flexExtCUDA.vcxproj.filters b/extensions/compiler/vc12win32/flexExtCUDA.vcxproj.filters new file mode 100644 index 0000000..5c88696 --- /dev/null +++ b/extensions/compiler/vc12win32/flexExtCUDA.vcxproj.filters @@ -0,0 +1,51 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="src">
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\flexExtCloth.cpp">
+ <Filter>src</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\flexExtContainer.cpp">
+ <Filter>src</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\flexExtMovingFrame.cpp">
+ <Filter>src</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\flexExtRigid.cpp">
+ <Filter>src</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\flexExtSoft.cpp">
+ <Filter>src</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <Filter Include="cuda">
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <CustomBuild Include="..\..\cuda\flexExt.cu">
+ <Filter>cuda</Filter>
+ </CustomBuild>
+ </ItemGroup>
+ <ItemGroup>
+ <Filter Include="core">
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\core\sdf.cpp">
+ <Filter>core</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\core\voxelize.cpp">
+ <Filter>core</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\core\maths.cpp">
+ <Filter>core</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\core\aabbtree.cpp">
+ <Filter>core</Filter>
+ </ClCompile>
+ </ItemGroup>
+</Project>
\ No newline at end of file diff --git a/extensions/compiler/vc12win32/flexExtD3D.sln b/extensions/compiler/vc12win32/flexExtD3D.sln new file mode 100644 index 0000000..147f309 --- /dev/null +++ b/extensions/compiler/vc12win32/flexExtD3D.sln @@ -0,0 +1,24 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "flexExtD3D", "./flexExtD3D.vcxproj", "{9B42889D-2F0D-0378-E87E-82C8D918DB4D}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + debug|Win32 = debug|Win32 + release|Win32 = release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {9B42889D-2F0D-0378-E87E-82C8D918DB4D}.debug|Win32.ActiveCfg = debug|Win32 + {9B42889D-2F0D-0378-E87E-82C8D918DB4D}.debug|Win32.Build.0 = debug|Win32 + {9B42889D-2F0D-0378-E87E-82C8D918DB4D}.release|Win32.ActiveCfg = release|Win32 + {9B42889D-2F0D-0378-E87E-82C8D918DB4D}.release|Win32.Build.0 = release|Win32 + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + EndGlobalSection + GlobalSection(ExtensibilityAddins) = postSolution + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + EndGlobalSection +EndGlobal diff --git a/extensions/compiler/vc12win32/flexExtD3D.vcxproj b/extensions/compiler/vc12win32/flexExtD3D.vcxproj new file mode 100644 index 0000000..db0828b --- /dev/null +++ b/extensions/compiler/vc12win32/flexExtD3D.vcxproj @@ -0,0 +1,167 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="debug|Win32"> + <Configuration>debug</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="release|Win32"> + <Configuration>release</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + </ItemGroup> + <PropertyGroup Label="Globals"> + <ProjectGuid>{9B42889D-2F0D-0378-E87E-82C8D918DB4D}</ProjectGuid> + <RootNamespace>flexExtD3D</RootNamespace> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug|Win32'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <PlatformToolset>v120</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release|Win32'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <PlatformToolset>v120</PlatformToolset> + <WholeProgramOptimization>true</WholeProgramOptimization> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <ImportGroup Label="ExtensionSettings"> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='debug|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='release|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug|Win32'"> + <OutDir>./../../../bin/win32\</OutDir> + <IntDir>./build/win32/DX/debug\</IntDir> + <TargetExt>.dll</TargetExt> + <TargetName>NvFlexExtDebugD3D_x86</TargetName> + <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> + <CodeAnalysisRules /> + <CodeAnalysisRuleAssemblies /> + <SkipCopyingSymbolsToOutputDirectory>true</SkipCopyingSymbolsToOutputDirectory> + </PropertyGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='debug|Win32'"> + <ClCompile> + <FloatingPointModel>Precise</FloatingPointModel> + <AdditionalOptions> /d2Zi+</AdditionalOptions> + <Optimization>Disabled</Optimization> + <AdditionalIncludeDirectories>./../../../../..;./../../..;./../../../external/D3D11/include;./../../../external/D3D12/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>_CONSOLE;WIN32;_DEBUG;_ITERATOR_DEBUG_LEVEL=0;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <WarningLevel>Level3</WarningLevel> + <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> + <PrecompiledHeader>NotUsing</PrecompiledHeader> + <PrecompiledHeaderFile></PrecompiledHeaderFile> + </ClCompile> + <Link> + <AdditionalOptions>/DELAYLOAD:d3d11.dll /DELAYLOAD:d3d12.dll</AdditionalOptions> + <AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;delayimp.lib;./../../../lib/win32/NvFlexDebugD3D_x86.lib;%(AdditionalDependencies)</AdditionalDependencies> + <OutputFile>$(OutDir)NvFlexExtDebugD3D_x86.dll</OutputFile> + <AdditionalLibraryDirectories>./../../../external/D3D11/libs/x86;./../../../external/D3D12/libs/x86;./../../../lib/win32;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> + <ProgramDatabaseFile>$(OutDir)/NvFlexExtDebugD3D_x86.dll.pdb</ProgramDatabaseFile> + <SubSystem>Console</SubSystem> + <ImportLibrary>./../../../lib/win32/NvFlexExtDebugD3D_x86.lib</ImportLibrary> + <GenerateDebugInformation>true</GenerateDebugInformation> + <TargetMachine>MachineX86</TargetMachine> + </Link> + <ResourceCompile> + </ResourceCompile> + <ProjectReference> + </ProjectReference> + </ItemDefinitionGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release|Win32'"> + <OutDir>./../../../bin/win32\</OutDir> + <IntDir>./build/win32/DX/release\</IntDir> + <TargetExt>.dll</TargetExt> + <TargetName>NvFlexExtReleaseD3D_x86</TargetName> + <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> + <CodeAnalysisRules /> + <CodeAnalysisRuleAssemblies /> + <SkipCopyingSymbolsToOutputDirectory>true</SkipCopyingSymbolsToOutputDirectory> + </PropertyGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='release|Win32'"> + <ClCompile> + <IntrinsicFunctions>true</IntrinsicFunctions> + <FunctionLevelLinking>true</FunctionLevelLinking> + <BufferSecurityCheck>false</BufferSecurityCheck> + <FloatingPointModel>Fast</FloatingPointModel> + <AdditionalOptions> /d2Zi+</AdditionalOptions> + <Optimization>Full</Optimization> + <AdditionalIncludeDirectories>./../../../../..;./../../..;./../../../external/D3D11/include;./../../../external/D3D12/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>_CONSOLE;WIN32;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <WarningLevel>Level3</WarningLevel> + <RuntimeLibrary>MultiThreaded</RuntimeLibrary> + <PrecompiledHeader>NotUsing</PrecompiledHeader> + <PrecompiledHeaderFile></PrecompiledHeaderFile> + </ClCompile> + <Link> + <AdditionalOptions>/DELAYLOAD:d3d11.dll /DELAYLOAD:d3d12.dll</AdditionalOptions> + <AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;delayimp.lib;./../../../lib/win32/NvFlexReleaseD3D_x86.lib;%(AdditionalDependencies)</AdditionalDependencies> + <OutputFile>$(OutDir)NvFlexExtReleaseD3D_x86.dll</OutputFile> + <AdditionalLibraryDirectories>./../../../external/D3D11/libs/x86;./../../../external/D3D12/libs/x86;./../../../lib/win32;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> + <ProgramDatabaseFile>$(OutDir)/NvFlexExtReleaseD3D_x86.dll.pdb</ProgramDatabaseFile> + <SubSystem>Console</SubSystem> + <ImportLibrary>./../../../lib/win32/NvFlexExtReleaseD3D_x86.lib</ImportLibrary> + <GenerateDebugInformation>true</GenerateDebugInformation> + <TargetMachine>MachineX86</TargetMachine> + </Link> + <ResourceCompile> + </ResourceCompile> + <ProjectReference> + </ProjectReference> + </ItemDefinitionGroup> + <ItemGroup> + <ClCompile Include="..\..\..\core\sdf.cpp"> + </ClCompile> + <ClCompile Include="..\..\..\core\voxelize.cpp"> + </ClCompile> + <ClCompile Include="..\..\..\core\maths.cpp"> + </ClCompile> + <ClCompile Include="..\..\..\core\aabbtree.cpp"> + </ClCompile> + </ItemGroup> + <ItemGroup> + <ClCompile Include="..\..\dx\flexExt.cpp"> + </ClCompile> + <None Include="..\..\dx\flexExt.hlsl"> + </None> + <ClInclude Include="..\..\dx\flexExt_dx_common.h"> + </ClInclude> + <ClCompile Include="..\..\flexExtCloth.cpp"> + </ClCompile> + <ClCompile Include="..\..\flexExtRigid.cpp"> + </ClCompile> + <ClCompile Include="..\..\flexExtSoft.cpp"> + </ClCompile> + <ClCompile Include="..\..\flexExtMovingFrame.cpp"> + </ClCompile> + <ClCompile Include="..\..\flexExtContainer.cpp"> + </ClCompile> + </ItemGroup> + <ItemGroup> + <FxCompile Include="./../../dx/shaders/flexExt.UpdateForceFields.hlsl"> + <ShaderType Condition="'$(Configuration)|$(Platform)'=='debug|Win32'">Compute</ShaderType> + <ShaderModel Condition="'$(Configuration)|$(Platform)'=='debug|Win32'">5.0</ShaderModel> + <EnableDebuggingInformation Condition="'$(Configuration)|$(Platform)'=='debug|Win32'">false</EnableDebuggingInformation> + <DisableOptimizations Condition="'$(Configuration)|$(Platform)'=='debug|Win32'">false</DisableOptimizations> + <EntryPointName Condition="'$(Configuration)|$(Platform)'=='debug|Win32'">UpdateForceFields::execute</EntryPointName> + <TreatWarningAsError Condition="'$(Configuration)|$(Platform)'=='debug|Win32'">false</TreatWarningAsError> + <VariableName Condition="'$(Configuration)|$(Platform)'=='debug|Win32'">g_flexExt_UpdateForceFields</VariableName> + <HeaderFileOutput Condition="'$(Configuration)|$(Platform)'=='debug|Win32'">../../../extensions/dx/shaders/%(Filename).h</HeaderFileOutput> + <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='debug|Win32'"> </ObjectFileOutput> + <ShaderType Condition="'$(Configuration)|$(Platform)'=='release|Win32'">Compute</ShaderType> + <ShaderModel Condition="'$(Configuration)|$(Platform)'=='release|Win32'">5.0</ShaderModel> + <EnableDebuggingInformation Condition="'$(Configuration)|$(Platform)'=='release|Win32'">false</EnableDebuggingInformation> + <DisableOptimizations Condition="'$(Configuration)|$(Platform)'=='release|Win32'">false</DisableOptimizations> + <EntryPointName Condition="'$(Configuration)|$(Platform)'=='release|Win32'">UpdateForceFields::execute</EntryPointName> + <TreatWarningAsError Condition="'$(Configuration)|$(Platform)'=='release|Win32'">false</TreatWarningAsError> + <VariableName Condition="'$(Configuration)|$(Platform)'=='release|Win32'">g_flexExt_UpdateForceFields</VariableName> + <HeaderFileOutput Condition="'$(Configuration)|$(Platform)'=='release|Win32'">../../../extensions/dx/shaders/%(Filename).h</HeaderFileOutput> + <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='release|Win32'"> </ObjectFileOutput> + </FxCompile> + </ItemGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"></ImportGroup> +</Project> diff --git a/extensions/compiler/vc12win32/flexExtD3D.vcxproj.filters b/extensions/compiler/vc12win32/flexExtD3D.vcxproj.filters new file mode 100644 index 0000000..dd65ee0 --- /dev/null +++ b/extensions/compiler/vc12win32/flexExtD3D.vcxproj.filters @@ -0,0 +1,57 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Core">
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\core\sdf.cpp">
+ <Filter>Core</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\core\voxelize.cpp">
+ <Filter>Core</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\core\maths.cpp">
+ <Filter>Core</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\core\aabbtree.cpp">
+ <Filter>Core</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <Filter Include="src">
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\dx\flexExt.cpp">
+ <Filter>src</Filter>
+ </ClCompile>
+ <None Include="..\..\dx\flexExt.hlsl">
+ <Filter>src</Filter>
+ </None>
+ <ClInclude Include="..\..\dx\flexExt_dx_common.h">
+ <Filter>src</Filter>
+ </ClInclude>
+ <ClCompile Include="..\..\flexExtCloth.cpp">
+ <Filter>src</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\flexExtRigid.cpp">
+ <Filter>src</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\flexExtSoft.cpp">
+ <Filter>src</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\flexExtMovingFrame.cpp">
+ <Filter>src</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\flexExtContainer.cpp">
+ <Filter>src</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup><Filter Include="Shader Files"></Filter></ItemGroup>
+ <ItemGroup>
+ <FxCompile Include="./../../dx/shaders/flexExt.UpdateForceFields.hlsl">
+ <Filter>Shader Files</Filter>
+ </FxCompile>
+ </ItemGroup>
+</Project>
\ No newline at end of file diff --git a/extensions/compiler/vc12win32/vc120.pdb b/extensions/compiler/vc12win32/vc120.pdb Binary files differnew file mode 100644 index 0000000..893ff50 --- /dev/null +++ b/extensions/compiler/vc12win32/vc120.pdb diff --git a/extensions/compiler/vc12win64/flexExtCUDA.sln b/extensions/compiler/vc12win64/flexExtCUDA.sln new file mode 100644 index 0000000..45b39d9 --- /dev/null +++ b/extensions/compiler/vc12win64/flexExtCUDA.sln @@ -0,0 +1,24 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "flexExtCUDA", "./flexExtCUDA.vcxproj", "{FD4C9C06-7BEC-CDF8-C631-CD32A428A280}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + debug|x64 = debug|x64 + release|x64 = release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {FD4C9C06-7BEC-CDF8-C631-CD32A428A280}.debug|x64.ActiveCfg = debug|x64 + {FD4C9C06-7BEC-CDF8-C631-CD32A428A280}.debug|x64.Build.0 = debug|x64 + {FD4C9C06-7BEC-CDF8-C631-CD32A428A280}.release|x64.ActiveCfg = release|x64 + {FD4C9C06-7BEC-CDF8-C631-CD32A428A280}.release|x64.Build.0 = release|x64 + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + EndGlobalSection + GlobalSection(ExtensibilityAddins) = postSolution + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + EndGlobalSection +EndGlobal diff --git a/extensions/compiler/vc12win64/flexExtCUDA.vcxproj b/extensions/compiler/vc12win64/flexExtCUDA.vcxproj new file mode 100644 index 0000000..630fc57 --- /dev/null +++ b/extensions/compiler/vc12win64/flexExtCUDA.vcxproj @@ -0,0 +1,150 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="debug|x64"> + <Configuration>debug</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="release|x64"> + <Configuration>release</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + </ItemGroup> + <PropertyGroup Label="Globals"> + <ProjectGuid>{FD4C9C06-7BEC-CDF8-C631-CD32A428A280}</ProjectGuid> + <RootNamespace>flexExtCUDA</RootNamespace> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug|x64'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <PlatformToolset>v120</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release|x64'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <PlatformToolset>v120</PlatformToolset> + <WholeProgramOptimization>true</WholeProgramOptimization> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <ImportGroup Label="ExtensionSettings"> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='debug|x64'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='release|x64'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug|x64'"> + <OutDir>./../../../bin/win64\</OutDir> + <IntDir>./build/win64/debug\</IntDir> + <TargetExt>.dll</TargetExt> + <TargetName>NvFlexExtDebugCUDA_x64</TargetName> + <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> + <CodeAnalysisRules /> + <CodeAnalysisRuleAssemblies /> + <SkipCopyingSymbolsToOutputDirectory>true</SkipCopyingSymbolsToOutputDirectory> + </PropertyGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='debug|x64'"> + <ClCompile> + <FloatingPointModel>Precise</FloatingPointModel> + <AdditionalOptions> /d2Zi+</AdditionalOptions> + <Optimization>Disabled</Optimization> + <AdditionalIncludeDirectories>$(CUDA_PATH)/include;$(CUDA_PATH)/extras/cupti/include;./../../../../..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>_CONSOLE;WIN32;_DEBUG;_ITERATOR_DEBUG_LEVEL=0;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <WarningLevel>Level3</WarningLevel> + <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> + <PrecompiledHeader>NotUsing</PrecompiledHeader> + <PrecompiledHeaderFile></PrecompiledHeaderFile> + </ClCompile> + <Link> + <AdditionalDependencies>cudart.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;./../../../lib/win64/NvFlexDebugCUDA_x64.lib;%(AdditionalDependencies)</AdditionalDependencies> + <OutputFile>$(OutDir)NvFlexExtDebugCUDA_x64.dll</OutputFile> + <AdditionalLibraryDirectories>$(CUDA_PATH)/lib/x64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> + <ProgramDatabaseFile>$(OutDir)/NvFlexExtDebugCUDA_x64.dll.pdb</ProgramDatabaseFile> + <SubSystem>Console</SubSystem> + <ImportLibrary>./../../../lib/win64/NvFlexExtDebugCUDA_x64.lib</ImportLibrary> + <GenerateDebugInformation>true</GenerateDebugInformation> + <TargetMachine>MachineX64</TargetMachine> + </Link> + <ResourceCompile> + </ResourceCompile> + <ProjectReference> + </ProjectReference> + </ItemDefinitionGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release|x64'"> + <OutDir>./../../../bin/win64\</OutDir> + <IntDir>./build/win64/release\</IntDir> + <TargetExt>.dll</TargetExt> + <TargetName>NvFlexExtReleaseCUDA_x64</TargetName> + <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> + <CodeAnalysisRules /> + <CodeAnalysisRuleAssemblies /> + <SkipCopyingSymbolsToOutputDirectory>true</SkipCopyingSymbolsToOutputDirectory> + </PropertyGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='release|x64'"> + <ClCompile> + <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet> + <IntrinsicFunctions>true</IntrinsicFunctions> + <FunctionLevelLinking>true</FunctionLevelLinking> + <BufferSecurityCheck>false</BufferSecurityCheck> + <FloatingPointModel>Fast</FloatingPointModel> + <AdditionalOptions> /d2Zi+</AdditionalOptions> + <Optimization>Full</Optimization> + <AdditionalIncludeDirectories>$(CUDA_PATH)/include;$(CUDA_PATH)/extras/cupti/include;./../../../../..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>_CONSOLE;WIN32;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <WarningLevel>Level3</WarningLevel> + <RuntimeLibrary>MultiThreaded</RuntimeLibrary> + <PrecompiledHeader>NotUsing</PrecompiledHeader> + <PrecompiledHeaderFile></PrecompiledHeaderFile> + </ClCompile> + <Link> + <AdditionalDependencies>cudart.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;./../../../lib/win64/NvFlexReleaseCUDA_x64.lib;%(AdditionalDependencies)</AdditionalDependencies> + <OutputFile>$(OutDir)NvFlexExtReleaseCUDA_x64.dll</OutputFile> + <AdditionalLibraryDirectories>$(CUDA_PATH)/lib/x64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> + <ProgramDatabaseFile>$(OutDir)/NvFlexExtReleaseCUDA_x64.dll.pdb</ProgramDatabaseFile> + <SubSystem>Console</SubSystem> + <ImportLibrary>./../../../lib/win64/NvFlexExtReleaseCUDA_x64.lib</ImportLibrary> + <GenerateDebugInformation>true</GenerateDebugInformation> + <TargetMachine>MachineX64</TargetMachine> + </Link> + <ResourceCompile> + </ResourceCompile> + <ProjectReference> + </ProjectReference> + </ItemDefinitionGroup> + <ItemGroup> + <ClCompile Include="..\..\flexExtCloth.cpp"> + </ClCompile> + <ClCompile Include="..\..\flexExtContainer.cpp"> + </ClCompile> + <ClCompile Include="..\..\flexExtMovingFrame.cpp"> + </ClCompile> + <ClCompile Include="..\..\flexExtRigid.cpp"> + </ClCompile> + <ClCompile Include="..\..\flexExtSoft.cpp"> + </ClCompile> + </ItemGroup> + <ItemGroup> + <CustomBuild Include="..\..\cuda\flexExt.cu"> + <FileType Condition="'$(Configuration)|$(Platform)'=='debug|x64'">cuda</FileType> + <Command Condition="'$(Configuration)|$(Platform)'=='debug|x64'">"$(CUDA_PATH)\bin\nvcc.exe" -g -G --compiler-bindir="$(VCInstallDir)bin" --compiler-options=/MTd,/Zi -I"..\..\.." -D_ITERATOR_DEBUG_LEVEL=0 -DCUDA -arch=sm_30 -prec-div=false -prec-sqrt=false -ftz=true -use_fast_math -c ..\..\cuda\flexExt.cu -o ./x64/flexExtCUDA/debug/cuda/flexExt.obj</Command> + <Message Condition="'$(Configuration)|$(Platform)'=='debug|x64'">Building %(Identity)</Message> + <Outputs Condition="'$(Configuration)|$(Platform)'=='debug|x64'">./x64/flexExtCUDA/debug/cuda/flexExt.obj;</Outputs> + <FileType Condition="'$(Configuration)|$(Platform)'=='release|x64'">cuda</FileType> + <Command Condition="'$(Configuration)|$(Platform)'=='release|x64'">"$(CUDA_PATH)\bin\nvcc.exe" -O3 --compiler-bindir="$(VCInstallDir)bin" --compiler-options=/MT,/Zi -I"..\..\.." -D_ITERATOR_DEBUG_LEVEL=0 -DNDEBUG -DCUDA -arch=sm_30 -prec-div=false -prec-sqrt=false -ftz=true -use_fast_math -c ..\..\cuda\flexExt.cu -o ./x64/flexExtCUDA/release/cuda/flexExt.obj</Command> + <Message Condition="'$(Configuration)|$(Platform)'=='release|x64'">Building %(Identity)</Message> + <Outputs Condition="'$(Configuration)|$(Platform)'=='release|x64'">./x64/flexExtCUDA/release/cuda/flexExt.obj;</Outputs> + </CustomBuild> + </ItemGroup> + <ItemGroup> + <ClCompile Include="..\..\..\core\sdf.cpp"> + </ClCompile> + <ClCompile Include="..\..\..\core\voxelize.cpp"> + </ClCompile> + <ClCompile Include="..\..\..\core\maths.cpp"> + </ClCompile> + <ClCompile Include="..\..\..\core\aabbtree.cpp"> + </ClCompile> + </ItemGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"></ImportGroup> +</Project> diff --git a/extensions/compiler/vc12win64/flexExtCUDA.vcxproj.filters b/extensions/compiler/vc12win64/flexExtCUDA.vcxproj.filters new file mode 100644 index 0000000..5c88696 --- /dev/null +++ b/extensions/compiler/vc12win64/flexExtCUDA.vcxproj.filters @@ -0,0 +1,51 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="src">
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\flexExtCloth.cpp">
+ <Filter>src</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\flexExtContainer.cpp">
+ <Filter>src</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\flexExtMovingFrame.cpp">
+ <Filter>src</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\flexExtRigid.cpp">
+ <Filter>src</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\flexExtSoft.cpp">
+ <Filter>src</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <Filter Include="cuda">
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <CustomBuild Include="..\..\cuda\flexExt.cu">
+ <Filter>cuda</Filter>
+ </CustomBuild>
+ </ItemGroup>
+ <ItemGroup>
+ <Filter Include="core">
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\core\sdf.cpp">
+ <Filter>core</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\core\voxelize.cpp">
+ <Filter>core</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\core\maths.cpp">
+ <Filter>core</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\core\aabbtree.cpp">
+ <Filter>core</Filter>
+ </ClCompile>
+ </ItemGroup>
+</Project>
\ No newline at end of file diff --git a/extensions/compiler/vc12win64/flexExtD3D.sln b/extensions/compiler/vc12win64/flexExtD3D.sln new file mode 100644 index 0000000..de6ba35 --- /dev/null +++ b/extensions/compiler/vc12win64/flexExtD3D.sln @@ -0,0 +1,24 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "flexExtD3D", "./flexExtD3D.vcxproj", "{9B42889D-2F0D-0378-E87E-82C8D918DB4D}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + debug|x64 = debug|x64 + release|x64 = release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {9B42889D-2F0D-0378-E87E-82C8D918DB4D}.debug|x64.ActiveCfg = debug|x64 + {9B42889D-2F0D-0378-E87E-82C8D918DB4D}.debug|x64.Build.0 = debug|x64 + {9B42889D-2F0D-0378-E87E-82C8D918DB4D}.release|x64.ActiveCfg = release|x64 + {9B42889D-2F0D-0378-E87E-82C8D918DB4D}.release|x64.Build.0 = release|x64 + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + EndGlobalSection + GlobalSection(ExtensibilityAddins) = postSolution + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + EndGlobalSection +EndGlobal diff --git a/extensions/compiler/vc12win64/flexExtD3D.vcxproj b/extensions/compiler/vc12win64/flexExtD3D.vcxproj new file mode 100644 index 0000000..8379d5a --- /dev/null +++ b/extensions/compiler/vc12win64/flexExtD3D.vcxproj @@ -0,0 +1,167 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="debug|x64"> + <Configuration>debug</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="release|x64"> + <Configuration>release</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + </ItemGroup> + <PropertyGroup Label="Globals"> + <ProjectGuid>{9B42889D-2F0D-0378-E87E-82C8D918DB4D}</ProjectGuid> + <RootNamespace>flexExtD3D</RootNamespace> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug|x64'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <PlatformToolset>v120</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release|x64'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <PlatformToolset>v120</PlatformToolset> + <WholeProgramOptimization>true</WholeProgramOptimization> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <ImportGroup Label="ExtensionSettings"> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='debug|x64'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='release|x64'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug|x64'"> + <OutDir>./../../../bin/win64\</OutDir> + <IntDir>./build/win64/DX/debug\</IntDir> + <TargetExt>.dll</TargetExt> + <TargetName>NvFlexExtDebugD3D_x64</TargetName> + <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> + <CodeAnalysisRules /> + <CodeAnalysisRuleAssemblies /> + <SkipCopyingSymbolsToOutputDirectory>true</SkipCopyingSymbolsToOutputDirectory> + </PropertyGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='debug|x64'"> + <ClCompile> + <FloatingPointModel>Precise</FloatingPointModel> + <AdditionalOptions> /d2Zi+</AdditionalOptions> + <Optimization>Disabled</Optimization> + <AdditionalIncludeDirectories>./../../../../..;./../../..;./../../../external/D3D11/include;./../../../external/D3D12/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>_CONSOLE;WIN32;_DEBUG;_ITERATOR_DEBUG_LEVEL=0;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <WarningLevel>Level3</WarningLevel> + <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> + <PrecompiledHeader>NotUsing</PrecompiledHeader> + <PrecompiledHeaderFile></PrecompiledHeaderFile> + </ClCompile> + <Link> + <AdditionalOptions>/DELAYLOAD:d3d11.dll /DELAYLOAD:d3d12.dll</AdditionalOptions> + <AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;delayimp.lib;./../../../lib/win64/NvFlexDebugD3D_x64.lib;%(AdditionalDependencies)</AdditionalDependencies> + <OutputFile>$(OutDir)NvFlexExtDebugD3D_x64.dll</OutputFile> + <AdditionalLibraryDirectories>./../../../external/D3D11/libs/x64;./../../../external/D3D12/libs/x64;./../../../lib/win64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> + <ProgramDatabaseFile>$(OutDir)/NvFlexExtDebugD3D_x64.dll.pdb</ProgramDatabaseFile> + <SubSystem>Console</SubSystem> + <ImportLibrary>./../../../lib/win64/NvFlexExtDebugD3D_x64.lib</ImportLibrary> + <GenerateDebugInformation>true</GenerateDebugInformation> + <TargetMachine>MachineX64</TargetMachine> + </Link> + <ResourceCompile> + </ResourceCompile> + <ProjectReference> + </ProjectReference> + </ItemDefinitionGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release|x64'"> + <OutDir>./../../../bin/win64\</OutDir> + <IntDir>./build/win64/DX/release\</IntDir> + <TargetExt>.dll</TargetExt> + <TargetName>NvFlexExtReleaseD3D_x64</TargetName> + <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> + <CodeAnalysisRules /> + <CodeAnalysisRuleAssemblies /> + <SkipCopyingSymbolsToOutputDirectory>true</SkipCopyingSymbolsToOutputDirectory> + </PropertyGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='release|x64'"> + <ClCompile> + <IntrinsicFunctions>true</IntrinsicFunctions> + <FunctionLevelLinking>true</FunctionLevelLinking> + <BufferSecurityCheck>false</BufferSecurityCheck> + <FloatingPointModel>Fast</FloatingPointModel> + <AdditionalOptions> /d2Zi+</AdditionalOptions> + <Optimization>Full</Optimization> + <AdditionalIncludeDirectories>./../../../../..;./../../..;./../../../external/D3D11/include;./../../../external/D3D12/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>_CONSOLE;WIN32;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <WarningLevel>Level3</WarningLevel> + <RuntimeLibrary>MultiThreaded</RuntimeLibrary> + <PrecompiledHeader>NotUsing</PrecompiledHeader> + <PrecompiledHeaderFile></PrecompiledHeaderFile> + </ClCompile> + <Link> + <AdditionalOptions>/DELAYLOAD:d3d11.dll /DELAYLOAD:d3d12.dll</AdditionalOptions> + <AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;delayimp.lib;./../../../lib/win64/NvFlexReleaseD3D_x64.lib;%(AdditionalDependencies)</AdditionalDependencies> + <OutputFile>$(OutDir)NvFlexExtReleaseD3D_x64.dll</OutputFile> + <AdditionalLibraryDirectories>./../../../external/D3D11/libs/x64;./../../../external/D3D12/libs/x64;./../../../lib/win64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> + <ProgramDatabaseFile>$(OutDir)/NvFlexExtReleaseD3D_x64.dll.pdb</ProgramDatabaseFile> + <SubSystem>Console</SubSystem> + <ImportLibrary>./../../../lib/win64/NvFlexExtReleaseD3D_x64.lib</ImportLibrary> + <GenerateDebugInformation>true</GenerateDebugInformation> + <TargetMachine>MachineX64</TargetMachine> + </Link> + <ResourceCompile> + </ResourceCompile> + <ProjectReference> + </ProjectReference> + </ItemDefinitionGroup> + <ItemGroup> + <ClCompile Include="..\..\..\core\sdf.cpp"> + </ClCompile> + <ClCompile Include="..\..\..\core\voxelize.cpp"> + </ClCompile> + <ClCompile Include="..\..\..\core\maths.cpp"> + </ClCompile> + <ClCompile Include="..\..\..\core\aabbtree.cpp"> + </ClCompile> + </ItemGroup> + <ItemGroup> + <ClCompile Include="..\..\dx\flexExt.cpp"> + </ClCompile> + <None Include="..\..\dx\flexExt.hlsl"> + </None> + <ClInclude Include="..\..\dx\flexExt_dx_common.h"> + </ClInclude> + <ClCompile Include="..\..\flexExtCloth.cpp"> + </ClCompile> + <ClCompile Include="..\..\flexExtRigid.cpp"> + </ClCompile> + <ClCompile Include="..\..\flexExtSoft.cpp"> + </ClCompile> + <ClCompile Include="..\..\flexExtMovingFrame.cpp"> + </ClCompile> + <ClCompile Include="..\..\flexExtContainer.cpp"> + </ClCompile> + </ItemGroup> + <ItemGroup> + <FxCompile Include="./../../dx/shaders/flexExt.UpdateForceFields.hlsl"> + <ShaderType Condition="'$(Configuration)|$(Platform)'=='debug|x64'">Compute</ShaderType> + <ShaderModel Condition="'$(Configuration)|$(Platform)'=='debug|x64'">5.0</ShaderModel> + <EnableDebuggingInformation Condition="'$(Configuration)|$(Platform)'=='debug|x64'">false</EnableDebuggingInformation> + <DisableOptimizations Condition="'$(Configuration)|$(Platform)'=='debug|x64'">false</DisableOptimizations> + <EntryPointName Condition="'$(Configuration)|$(Platform)'=='debug|x64'">UpdateForceFields::execute</EntryPointName> + <TreatWarningAsError Condition="'$(Configuration)|$(Platform)'=='debug|x64'">false</TreatWarningAsError> + <VariableName Condition="'$(Configuration)|$(Platform)'=='debug|x64'">g_flexExt_UpdateForceFields</VariableName> + <HeaderFileOutput Condition="'$(Configuration)|$(Platform)'=='debug|x64'">../../../extensions/dx/shaders/%(Filename).h</HeaderFileOutput> + <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='debug|x64'"> </ObjectFileOutput> + <ShaderType Condition="'$(Configuration)|$(Platform)'=='release|x64'">Compute</ShaderType> + <ShaderModel Condition="'$(Configuration)|$(Platform)'=='release|x64'">5.0</ShaderModel> + <EnableDebuggingInformation Condition="'$(Configuration)|$(Platform)'=='release|x64'">false</EnableDebuggingInformation> + <DisableOptimizations Condition="'$(Configuration)|$(Platform)'=='release|x64'">false</DisableOptimizations> + <EntryPointName Condition="'$(Configuration)|$(Platform)'=='release|x64'">UpdateForceFields::execute</EntryPointName> + <TreatWarningAsError Condition="'$(Configuration)|$(Platform)'=='release|x64'">false</TreatWarningAsError> + <VariableName Condition="'$(Configuration)|$(Platform)'=='release|x64'">g_flexExt_UpdateForceFields</VariableName> + <HeaderFileOutput Condition="'$(Configuration)|$(Platform)'=='release|x64'">../../../extensions/dx/shaders/%(Filename).h</HeaderFileOutput> + <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='release|x64'"> </ObjectFileOutput> + </FxCompile> + </ItemGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"></ImportGroup> +</Project> diff --git a/extensions/compiler/vc12win64/flexExtD3D.vcxproj.filters b/extensions/compiler/vc12win64/flexExtD3D.vcxproj.filters new file mode 100644 index 0000000..dd65ee0 --- /dev/null +++ b/extensions/compiler/vc12win64/flexExtD3D.vcxproj.filters @@ -0,0 +1,57 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Core">
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\core\sdf.cpp">
+ <Filter>Core</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\core\voxelize.cpp">
+ <Filter>Core</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\core\maths.cpp">
+ <Filter>Core</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\core\aabbtree.cpp">
+ <Filter>Core</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <Filter Include="src">
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\dx\flexExt.cpp">
+ <Filter>src</Filter>
+ </ClCompile>
+ <None Include="..\..\dx\flexExt.hlsl">
+ <Filter>src</Filter>
+ </None>
+ <ClInclude Include="..\..\dx\flexExt_dx_common.h">
+ <Filter>src</Filter>
+ </ClInclude>
+ <ClCompile Include="..\..\flexExtCloth.cpp">
+ <Filter>src</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\flexExtRigid.cpp">
+ <Filter>src</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\flexExtSoft.cpp">
+ <Filter>src</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\flexExtMovingFrame.cpp">
+ <Filter>src</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\flexExtContainer.cpp">
+ <Filter>src</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup><Filter Include="Shader Files"></Filter></ItemGroup>
+ <ItemGroup>
+ <FxCompile Include="./../../dx/shaders/flexExt.UpdateForceFields.hlsl">
+ <Filter>Shader Files</Filter>
+ </FxCompile>
+ </ItemGroup>
+</Project>
\ No newline at end of file diff --git a/extensions/compiler/vc12win64/vc120.pdb b/extensions/compiler/vc12win64/vc120.pdb Binary files differnew file mode 100644 index 0000000..4b0714b --- /dev/null +++ b/extensions/compiler/vc12win64/vc120.pdb diff --git a/extensions/compiler/vc14win32/flexExtCUDA.sln b/extensions/compiler/vc14win32/flexExtCUDA.sln new file mode 100644 index 0000000..b9eb62d --- /dev/null +++ b/extensions/compiler/vc14win32/flexExtCUDA.sln @@ -0,0 +1,24 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "flexExtCUDA", "./flexExtCUDA.vcxproj", "{FD4C9C06-7BEC-CDF8-C631-CD32A428A280}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + debug|Win32 = debug|Win32 + release|Win32 = release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {FD4C9C06-7BEC-CDF8-C631-CD32A428A280}.debug|Win32.ActiveCfg = debug|Win32 + {FD4C9C06-7BEC-CDF8-C631-CD32A428A280}.debug|Win32.Build.0 = debug|Win32 + {FD4C9C06-7BEC-CDF8-C631-CD32A428A280}.release|Win32.ActiveCfg = release|Win32 + {FD4C9C06-7BEC-CDF8-C631-CD32A428A280}.release|Win32.Build.0 = release|Win32 + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + EndGlobalSection + GlobalSection(ExtensibilityAddins) = postSolution + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + EndGlobalSection +EndGlobal diff --git a/extensions/compiler/vc14win32/flexExtCUDA.vcxproj b/extensions/compiler/vc14win32/flexExtCUDA.vcxproj new file mode 100644 index 0000000..871676c --- /dev/null +++ b/extensions/compiler/vc14win32/flexExtCUDA.vcxproj @@ -0,0 +1,150 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="debug|Win32"> + <Configuration>debug</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="release|Win32"> + <Configuration>release</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + </ItemGroup> + <PropertyGroup Label="Globals"> + <ProjectGuid>{FD4C9C06-7BEC-CDF8-C631-CD32A428A280}</ProjectGuid> + <RootNamespace>flexExtCUDA</RootNamespace> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug|Win32'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <PlatformToolset>v140</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release|Win32'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <PlatformToolset>v140</PlatformToolset> + <WholeProgramOptimization>true</WholeProgramOptimization> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <ImportGroup Label="ExtensionSettings"> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='debug|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='release|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug|Win32'"> + <OutDir>./../../../bin/win32\</OutDir> + <IntDir>./build/win32/debug\</IntDir> + <TargetExt>.dll</TargetExt> + <TargetName>NvFlexExtDebugCUDA_x86</TargetName> + <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> + <CodeAnalysisRules /> + <CodeAnalysisRuleAssemblies /> + <SkipCopyingSymbolsToOutputDirectory>true</SkipCopyingSymbolsToOutputDirectory> + </PropertyGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='debug|Win32'"> + <ClCompile> + <FloatingPointModel>Precise</FloatingPointModel> + <AdditionalOptions> /d2Zi+</AdditionalOptions> + <Optimization>Disabled</Optimization> + <AdditionalIncludeDirectories>$(CUDA_PATH)/include;$(CUDA_PATH)/extras/cupti/include;./../../../../..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>_CONSOLE;WIN32;_DEBUG;_ITERATOR_DEBUG_LEVEL=0;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <WarningLevel>Level3</WarningLevel> + <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> + <PrecompiledHeader>NotUsing</PrecompiledHeader> + <PrecompiledHeaderFile></PrecompiledHeaderFile> + </ClCompile> + <Link> + <AdditionalDependencies>cudart.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;./../../../lib/win32/NvFlexDebugCUDA_x86.lib;%(AdditionalDependencies)</AdditionalDependencies> + <OutputFile>$(OutDir)NvFlexExtDebugCUDA_x86.dll</OutputFile> + <AdditionalLibraryDirectories>$(CUDA_PATH)/lib/win32;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> + <ProgramDatabaseFile>$(OutDir)/NvFlexExtDebugCUDA_x86.dll.pdb</ProgramDatabaseFile> + <SubSystem>Console</SubSystem> + <ImportLibrary>./../../../lib/win32/NvFlexExtDebugCUDA_x86.lib</ImportLibrary> + <GenerateDebugInformation>true</GenerateDebugInformation> + <TargetMachine>MachineX86</TargetMachine> + </Link> + <ResourceCompile> + </ResourceCompile> + <ProjectReference> + </ProjectReference> + </ItemDefinitionGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release|Win32'"> + <OutDir>./../../../bin/win32\</OutDir> + <IntDir>./build/win32/release\</IntDir> + <TargetExt>.dll</TargetExt> + <TargetName>NvFlexExtReleaseCUDA_x86</TargetName> + <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> + <CodeAnalysisRules /> + <CodeAnalysisRuleAssemblies /> + <SkipCopyingSymbolsToOutputDirectory>true</SkipCopyingSymbolsToOutputDirectory> + </PropertyGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='release|Win32'"> + <ClCompile> + <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet> + <IntrinsicFunctions>true</IntrinsicFunctions> + <FunctionLevelLinking>true</FunctionLevelLinking> + <BufferSecurityCheck>false</BufferSecurityCheck> + <FloatingPointModel>Fast</FloatingPointModel> + <AdditionalOptions> /d2Zi+</AdditionalOptions> + <Optimization>Full</Optimization> + <AdditionalIncludeDirectories>$(CUDA_PATH)/include;$(CUDA_PATH)/extras/cupti/include;./../../../../..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>_CONSOLE;WIN32;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <WarningLevel>Level3</WarningLevel> + <RuntimeLibrary>MultiThreaded</RuntimeLibrary> + <PrecompiledHeader>NotUsing</PrecompiledHeader> + <PrecompiledHeaderFile></PrecompiledHeaderFile> + </ClCompile> + <Link> + <AdditionalDependencies>cudart.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;./../../../lib/win32/NvFlexReleaseCUDA_x86.lib;%(AdditionalDependencies)</AdditionalDependencies> + <OutputFile>$(OutDir)NvFlexExtReleaseCUDA_x86.dll</OutputFile> + <AdditionalLibraryDirectories>$(CUDA_PATH)/lib/win32;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> + <ProgramDatabaseFile>$(OutDir)/NvFlexExtReleaseCUDA_x86.dll.pdb</ProgramDatabaseFile> + <SubSystem>Console</SubSystem> + <ImportLibrary>./../../../lib/win32/NvFlexExtReleaseCUDA_x86.lib</ImportLibrary> + <GenerateDebugInformation>true</GenerateDebugInformation> + <TargetMachine>MachineX86</TargetMachine> + </Link> + <ResourceCompile> + </ResourceCompile> + <ProjectReference> + </ProjectReference> + </ItemDefinitionGroup> + <ItemGroup> + <ClCompile Include="..\..\flexExtCloth.cpp"> + </ClCompile> + <ClCompile Include="..\..\flexExtContainer.cpp"> + </ClCompile> + <ClCompile Include="..\..\flexExtMovingFrame.cpp"> + </ClCompile> + <ClCompile Include="..\..\flexExtRigid.cpp"> + </ClCompile> + <ClCompile Include="..\..\flexExtSoft.cpp"> + </ClCompile> + </ItemGroup> + <ItemGroup> + <CustomBuild Include="..\..\cuda\flexExt.cu"> + <FileType Condition="'$(Configuration)|$(Platform)'=='debug|Win32'">cuda</FileType> + <Command Condition="'$(Configuration)|$(Platform)'=='debug|Win32'">"$(CUDA_PATH)\bin\nvcc.exe" -g -G --compiler-bindir="$(VCInstallDir)bin" --compiler-options=/MTd,/Zi -I"..\..\.." -D_ITERATOR_DEBUG_LEVEL=0 -DCUDA -m32 -arch=sm_30 -prec-div=false -prec-sqrt=false -ftz=true -use_fast_math -c ..\..\cuda\flexExt.cu -o ./Win32/flexExtCUDA/debug/cuda/flexExt.obj</Command> + <Message Condition="'$(Configuration)|$(Platform)'=='debug|Win32'">Building %(Identity)</Message> + <Outputs Condition="'$(Configuration)|$(Platform)'=='debug|Win32'">./Win32/flexExtCUDA/debug/cuda/flexExt.obj;</Outputs> + <FileType Condition="'$(Configuration)|$(Platform)'=='release|Win32'">cuda</FileType> + <Command Condition="'$(Configuration)|$(Platform)'=='release|Win32'">"$(CUDA_PATH)\bin\nvcc.exe" -O3 --compiler-bindir="$(VCInstallDir)bin" --compiler-options=/MT,/Zi -I"..\..\.." -D_ITERATOR_DEBUG_LEVEL=0 -DNDEBUG -DCUDA -m32 -arch=sm_30 -prec-div=false -prec-sqrt=false -ftz=true -use_fast_math -c ..\..\cuda\flexExt.cu -o ./Win32/flexExtCUDA/release/cuda/flexExt.obj</Command> + <Message Condition="'$(Configuration)|$(Platform)'=='release|Win32'">Building %(Identity)</Message> + <Outputs Condition="'$(Configuration)|$(Platform)'=='release|Win32'">./Win32/flexExtCUDA/release/cuda/flexExt.obj;</Outputs> + </CustomBuild> + </ItemGroup> + <ItemGroup> + <ClCompile Include="..\..\..\core\sdf.cpp"> + </ClCompile> + <ClCompile Include="..\..\..\core\voxelize.cpp"> + </ClCompile> + <ClCompile Include="..\..\..\core\maths.cpp"> + </ClCompile> + <ClCompile Include="..\..\..\core\aabbtree.cpp"> + </ClCompile> + </ItemGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"></ImportGroup> +</Project> diff --git a/extensions/compiler/vc14win32/flexExtCUDA.vcxproj.filters b/extensions/compiler/vc14win32/flexExtCUDA.vcxproj.filters new file mode 100644 index 0000000..5c88696 --- /dev/null +++ b/extensions/compiler/vc14win32/flexExtCUDA.vcxproj.filters @@ -0,0 +1,51 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="src">
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\flexExtCloth.cpp">
+ <Filter>src</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\flexExtContainer.cpp">
+ <Filter>src</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\flexExtMovingFrame.cpp">
+ <Filter>src</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\flexExtRigid.cpp">
+ <Filter>src</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\flexExtSoft.cpp">
+ <Filter>src</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <Filter Include="cuda">
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <CustomBuild Include="..\..\cuda\flexExt.cu">
+ <Filter>cuda</Filter>
+ </CustomBuild>
+ </ItemGroup>
+ <ItemGroup>
+ <Filter Include="core">
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\core\sdf.cpp">
+ <Filter>core</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\core\voxelize.cpp">
+ <Filter>core</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\core\maths.cpp">
+ <Filter>core</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\core\aabbtree.cpp">
+ <Filter>core</Filter>
+ </ClCompile>
+ </ItemGroup>
+</Project>
\ No newline at end of file diff --git a/extensions/compiler/vc14win32/flexExtD3D.sln b/extensions/compiler/vc14win32/flexExtD3D.sln new file mode 100644 index 0000000..a0855f3 --- /dev/null +++ b/extensions/compiler/vc14win32/flexExtD3D.sln @@ -0,0 +1,24 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "flexExtD3D", "./flexExtD3D.vcxproj", "{9B42889D-2F0D-0378-E87E-82C8D918DB4D}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + debug|Win32 = debug|Win32 + release|Win32 = release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {9B42889D-2F0D-0378-E87E-82C8D918DB4D}.debug|Win32.ActiveCfg = debug|Win32 + {9B42889D-2F0D-0378-E87E-82C8D918DB4D}.debug|Win32.Build.0 = debug|Win32 + {9B42889D-2F0D-0378-E87E-82C8D918DB4D}.release|Win32.ActiveCfg = release|Win32 + {9B42889D-2F0D-0378-E87E-82C8D918DB4D}.release|Win32.Build.0 = release|Win32 + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + EndGlobalSection + GlobalSection(ExtensibilityAddins) = postSolution + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + EndGlobalSection +EndGlobal diff --git a/extensions/compiler/vc14win32/flexExtD3D.vcxproj b/extensions/compiler/vc14win32/flexExtD3D.vcxproj new file mode 100644 index 0000000..ae0a1b2 --- /dev/null +++ b/extensions/compiler/vc14win32/flexExtD3D.vcxproj @@ -0,0 +1,167 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="debug|Win32"> + <Configuration>debug</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="release|Win32"> + <Configuration>release</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + </ItemGroup> + <PropertyGroup Label="Globals"> + <ProjectGuid>{9B42889D-2F0D-0378-E87E-82C8D918DB4D}</ProjectGuid> + <RootNamespace>flexExtD3D</RootNamespace> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug|Win32'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <PlatformToolset>v140</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release|Win32'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <PlatformToolset>v140</PlatformToolset> + <WholeProgramOptimization>true</WholeProgramOptimization> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <ImportGroup Label="ExtensionSettings"> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='debug|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='release|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug|Win32'"> + <OutDir>./../../../bin/win32\</OutDir> + <IntDir>./build/win32/DX/debug\</IntDir> + <TargetExt>.dll</TargetExt> + <TargetName>NvFlexExtDebugD3D_x86</TargetName> + <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> + <CodeAnalysisRules /> + <CodeAnalysisRuleAssemblies /> + <SkipCopyingSymbolsToOutputDirectory>true</SkipCopyingSymbolsToOutputDirectory> + </PropertyGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='debug|Win32'"> + <ClCompile> + <FloatingPointModel>Precise</FloatingPointModel> + <AdditionalOptions> /d2Zi+</AdditionalOptions> + <Optimization>Disabled</Optimization> + <AdditionalIncludeDirectories>./../../../../..;./../../..;./../../../external/D3D11/include;./../../../external/D3D12/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>_CONSOLE;WIN32;_DEBUG;_ITERATOR_DEBUG_LEVEL=0;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <WarningLevel>Level3</WarningLevel> + <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> + <PrecompiledHeader>NotUsing</PrecompiledHeader> + <PrecompiledHeaderFile></PrecompiledHeaderFile> + </ClCompile> + <Link> + <AdditionalOptions>/DELAYLOAD:d3d11.dll /DELAYLOAD:d3d12.dll</AdditionalOptions> + <AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;delayimp.lib;./../../../lib/win32/NvFlexDebugD3D_x86.lib;%(AdditionalDependencies)</AdditionalDependencies> + <OutputFile>$(OutDir)NvFlexExtDebugD3D_x86.dll</OutputFile> + <AdditionalLibraryDirectories>./../../../external/D3D11/libs/x86;./../../../external/D3D12/libs/x86;./../../../lib/win32;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> + <ProgramDatabaseFile>$(OutDir)/NvFlexExtDebugD3D_x86.dll.pdb</ProgramDatabaseFile> + <SubSystem>Console</SubSystem> + <ImportLibrary>./../../../lib/win32/NvFlexExtDebugD3D_x86.lib</ImportLibrary> + <GenerateDebugInformation>true</GenerateDebugInformation> + <TargetMachine>MachineX86</TargetMachine> + </Link> + <ResourceCompile> + </ResourceCompile> + <ProjectReference> + </ProjectReference> + </ItemDefinitionGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release|Win32'"> + <OutDir>./../../../bin/win32\</OutDir> + <IntDir>./build/win32/DX/release\</IntDir> + <TargetExt>.dll</TargetExt> + <TargetName>NvFlexExtReleaseD3D_x86</TargetName> + <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> + <CodeAnalysisRules /> + <CodeAnalysisRuleAssemblies /> + <SkipCopyingSymbolsToOutputDirectory>true</SkipCopyingSymbolsToOutputDirectory> + </PropertyGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='release|Win32'"> + <ClCompile> + <IntrinsicFunctions>true</IntrinsicFunctions> + <FunctionLevelLinking>true</FunctionLevelLinking> + <BufferSecurityCheck>false</BufferSecurityCheck> + <FloatingPointModel>Fast</FloatingPointModel> + <AdditionalOptions> /d2Zi+</AdditionalOptions> + <Optimization>Full</Optimization> + <AdditionalIncludeDirectories>./../../../../..;./../../..;./../../../external/D3D11/include;./../../../external/D3D12/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>_CONSOLE;WIN32;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <WarningLevel>Level3</WarningLevel> + <RuntimeLibrary>MultiThreaded</RuntimeLibrary> + <PrecompiledHeader>NotUsing</PrecompiledHeader> + <PrecompiledHeaderFile></PrecompiledHeaderFile> + </ClCompile> + <Link> + <AdditionalOptions>/DELAYLOAD:d3d11.dll /DELAYLOAD:d3d12.dll</AdditionalOptions> + <AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;delayimp.lib;./../../../lib/win32/NvFlexReleaseD3D_x86.lib;%(AdditionalDependencies)</AdditionalDependencies> + <OutputFile>$(OutDir)NvFlexExtReleaseD3D_x86.dll</OutputFile> + <AdditionalLibraryDirectories>./../../../external/D3D11/libs/x86;./../../../external/D3D12/libs/x86;./../../../lib/win32;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> + <ProgramDatabaseFile>$(OutDir)/NvFlexExtReleaseD3D_x86.dll.pdb</ProgramDatabaseFile> + <SubSystem>Console</SubSystem> + <ImportLibrary>./../../../lib/win32/NvFlexExtReleaseD3D_x86.lib</ImportLibrary> + <GenerateDebugInformation>true</GenerateDebugInformation> + <TargetMachine>MachineX86</TargetMachine> + </Link> + <ResourceCompile> + </ResourceCompile> + <ProjectReference> + </ProjectReference> + </ItemDefinitionGroup> + <ItemGroup> + <ClCompile Include="..\..\..\core\sdf.cpp"> + </ClCompile> + <ClCompile Include="..\..\..\core\voxelize.cpp"> + </ClCompile> + <ClCompile Include="..\..\..\core\maths.cpp"> + </ClCompile> + <ClCompile Include="..\..\..\core\aabbtree.cpp"> + </ClCompile> + </ItemGroup> + <ItemGroup> + <ClCompile Include="..\..\dx\flexExt.cpp"> + </ClCompile> + <None Include="..\..\dx\flexExt.hlsl"> + </None> + <ClInclude Include="..\..\dx\flexExt_dx_common.h"> + </ClInclude> + <ClCompile Include="..\..\flexExtCloth.cpp"> + </ClCompile> + <ClCompile Include="..\..\flexExtRigid.cpp"> + </ClCompile> + <ClCompile Include="..\..\flexExtSoft.cpp"> + </ClCompile> + <ClCompile Include="..\..\flexExtMovingFrame.cpp"> + </ClCompile> + <ClCompile Include="..\..\flexExtContainer.cpp"> + </ClCompile> + </ItemGroup> + <ItemGroup> + <FxCompile Include="./../../dx/shaders/flexExt.UpdateForceFields.hlsl"> + <ShaderType Condition="'$(Configuration)|$(Platform)'=='debug|Win32'">Compute</ShaderType> + <ShaderModel Condition="'$(Configuration)|$(Platform)'=='debug|Win32'">5.0</ShaderModel> + <EnableDebuggingInformation Condition="'$(Configuration)|$(Platform)'=='debug|Win32'">false</EnableDebuggingInformation> + <DisableOptimizations Condition="'$(Configuration)|$(Platform)'=='debug|Win32'">false</DisableOptimizations> + <EntryPointName Condition="'$(Configuration)|$(Platform)'=='debug|Win32'">UpdateForceFields::execute</EntryPointName> + <TreatWarningAsError Condition="'$(Configuration)|$(Platform)'=='debug|Win32'">false</TreatWarningAsError> + <VariableName Condition="'$(Configuration)|$(Platform)'=='debug|Win32'">g_flexExt_UpdateForceFields</VariableName> + <HeaderFileOutput Condition="'$(Configuration)|$(Platform)'=='debug|Win32'">../../../extensions/dx/shaders/%(Filename).h</HeaderFileOutput> + <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='debug|Win32'"> </ObjectFileOutput> + <ShaderType Condition="'$(Configuration)|$(Platform)'=='release|Win32'">Compute</ShaderType> + <ShaderModel Condition="'$(Configuration)|$(Platform)'=='release|Win32'">5.0</ShaderModel> + <EnableDebuggingInformation Condition="'$(Configuration)|$(Platform)'=='release|Win32'">false</EnableDebuggingInformation> + <DisableOptimizations Condition="'$(Configuration)|$(Platform)'=='release|Win32'">false</DisableOptimizations> + <EntryPointName Condition="'$(Configuration)|$(Platform)'=='release|Win32'">UpdateForceFields::execute</EntryPointName> + <TreatWarningAsError Condition="'$(Configuration)|$(Platform)'=='release|Win32'">false</TreatWarningAsError> + <VariableName Condition="'$(Configuration)|$(Platform)'=='release|Win32'">g_flexExt_UpdateForceFields</VariableName> + <HeaderFileOutput Condition="'$(Configuration)|$(Platform)'=='release|Win32'">../../../extensions/dx/shaders/%(Filename).h</HeaderFileOutput> + <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='release|Win32'"> </ObjectFileOutput> + </FxCompile> + </ItemGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"></ImportGroup> +</Project> diff --git a/extensions/compiler/vc14win32/flexExtD3D.vcxproj.filters b/extensions/compiler/vc14win32/flexExtD3D.vcxproj.filters new file mode 100644 index 0000000..dd65ee0 --- /dev/null +++ b/extensions/compiler/vc14win32/flexExtD3D.vcxproj.filters @@ -0,0 +1,57 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Core">
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\core\sdf.cpp">
+ <Filter>Core</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\core\voxelize.cpp">
+ <Filter>Core</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\core\maths.cpp">
+ <Filter>Core</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\core\aabbtree.cpp">
+ <Filter>Core</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <Filter Include="src">
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\dx\flexExt.cpp">
+ <Filter>src</Filter>
+ </ClCompile>
+ <None Include="..\..\dx\flexExt.hlsl">
+ <Filter>src</Filter>
+ </None>
+ <ClInclude Include="..\..\dx\flexExt_dx_common.h">
+ <Filter>src</Filter>
+ </ClInclude>
+ <ClCompile Include="..\..\flexExtCloth.cpp">
+ <Filter>src</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\flexExtRigid.cpp">
+ <Filter>src</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\flexExtSoft.cpp">
+ <Filter>src</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\flexExtMovingFrame.cpp">
+ <Filter>src</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\flexExtContainer.cpp">
+ <Filter>src</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup><Filter Include="Shader Files"></Filter></ItemGroup>
+ <ItemGroup>
+ <FxCompile Include="./../../dx/shaders/flexExt.UpdateForceFields.hlsl">
+ <Filter>Shader Files</Filter>
+ </FxCompile>
+ </ItemGroup>
+</Project>
\ No newline at end of file diff --git a/extensions/compiler/vc14win64/flexExtCUDA.sln b/extensions/compiler/vc14win64/flexExtCUDA.sln new file mode 100644 index 0000000..6e0cf6d --- /dev/null +++ b/extensions/compiler/vc14win64/flexExtCUDA.sln @@ -0,0 +1,24 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "flexExtCUDA", "./flexExtCUDA.vcxproj", "{FD4C9C06-7BEC-CDF8-C631-CD32A428A280}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + debug|x64 = debug|x64 + release|x64 = release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {FD4C9C06-7BEC-CDF8-C631-CD32A428A280}.debug|x64.ActiveCfg = debug|x64 + {FD4C9C06-7BEC-CDF8-C631-CD32A428A280}.debug|x64.Build.0 = debug|x64 + {FD4C9C06-7BEC-CDF8-C631-CD32A428A280}.release|x64.ActiveCfg = release|x64 + {FD4C9C06-7BEC-CDF8-C631-CD32A428A280}.release|x64.Build.0 = release|x64 + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + EndGlobalSection + GlobalSection(ExtensibilityAddins) = postSolution + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + EndGlobalSection +EndGlobal diff --git a/extensions/compiler/vc14win64/flexExtCUDA.vcxproj b/extensions/compiler/vc14win64/flexExtCUDA.vcxproj new file mode 100644 index 0000000..5fe44c7 --- /dev/null +++ b/extensions/compiler/vc14win64/flexExtCUDA.vcxproj @@ -0,0 +1,150 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="debug|x64"> + <Configuration>debug</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="release|x64"> + <Configuration>release</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + </ItemGroup> + <PropertyGroup Label="Globals"> + <ProjectGuid>{FD4C9C06-7BEC-CDF8-C631-CD32A428A280}</ProjectGuid> + <RootNamespace>flexExtCUDA</RootNamespace> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug|x64'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <PlatformToolset>v140</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release|x64'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <PlatformToolset>v140</PlatformToolset> + <WholeProgramOptimization>true</WholeProgramOptimization> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <ImportGroup Label="ExtensionSettings"> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='debug|x64'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='release|x64'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug|x64'"> + <OutDir>./../../../bin/win64\</OutDir> + <IntDir>./build/win64/debug\</IntDir> + <TargetExt>.dll</TargetExt> + <TargetName>NvFlexExtDebugCUDA_x64</TargetName> + <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> + <CodeAnalysisRules /> + <CodeAnalysisRuleAssemblies /> + <SkipCopyingSymbolsToOutputDirectory>true</SkipCopyingSymbolsToOutputDirectory> + </PropertyGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='debug|x64'"> + <ClCompile> + <FloatingPointModel>Precise</FloatingPointModel> + <AdditionalOptions> /d2Zi+</AdditionalOptions> + <Optimization>Disabled</Optimization> + <AdditionalIncludeDirectories>$(CUDA_PATH)/include;$(CUDA_PATH)/extras/cupti/include;./../../../../..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>_CONSOLE;WIN32;_DEBUG;_ITERATOR_DEBUG_LEVEL=0;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <WarningLevel>Level3</WarningLevel> + <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> + <PrecompiledHeader>NotUsing</PrecompiledHeader> + <PrecompiledHeaderFile></PrecompiledHeaderFile> + </ClCompile> + <Link> + <AdditionalDependencies>cudart.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;./../../../lib/win64/NvFlexDebugCUDA_x64.lib;%(AdditionalDependencies)</AdditionalDependencies> + <OutputFile>$(OutDir)NvFlexExtDebugCUDA_x64.dll</OutputFile> + <AdditionalLibraryDirectories>$(CUDA_PATH)/lib/x64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> + <ProgramDatabaseFile>$(OutDir)/NvFlexExtDebugCUDA_x64.dll.pdb</ProgramDatabaseFile> + <SubSystem>Console</SubSystem> + <ImportLibrary>./../../../lib/win64/NvFlexExtDebugCUDA_x64.lib</ImportLibrary> + <GenerateDebugInformation>true</GenerateDebugInformation> + <TargetMachine>MachineX64</TargetMachine> + </Link> + <ResourceCompile> + </ResourceCompile> + <ProjectReference> + </ProjectReference> + </ItemDefinitionGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release|x64'"> + <OutDir>./../../../bin/win64\</OutDir> + <IntDir>./build/win64/release\</IntDir> + <TargetExt>.dll</TargetExt> + <TargetName>NvFlexExtReleaseCUDA_x64</TargetName> + <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> + <CodeAnalysisRules /> + <CodeAnalysisRuleAssemblies /> + <SkipCopyingSymbolsToOutputDirectory>true</SkipCopyingSymbolsToOutputDirectory> + </PropertyGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='release|x64'"> + <ClCompile> + <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet> + <IntrinsicFunctions>true</IntrinsicFunctions> + <FunctionLevelLinking>true</FunctionLevelLinking> + <BufferSecurityCheck>false</BufferSecurityCheck> + <FloatingPointModel>Fast</FloatingPointModel> + <AdditionalOptions> /d2Zi+</AdditionalOptions> + <Optimization>Full</Optimization> + <AdditionalIncludeDirectories>$(CUDA_PATH)/include;$(CUDA_PATH)/extras/cupti/include;./../../../../..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>_CONSOLE;WIN32;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <WarningLevel>Level3</WarningLevel> + <RuntimeLibrary>MultiThreaded</RuntimeLibrary> + <PrecompiledHeader>NotUsing</PrecompiledHeader> + <PrecompiledHeaderFile></PrecompiledHeaderFile> + </ClCompile> + <Link> + <AdditionalDependencies>cudart.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;./../../../lib/win64/NvFlexReleaseCUDA_x64.lib;%(AdditionalDependencies)</AdditionalDependencies> + <OutputFile>$(OutDir)NvFlexExtReleaseCUDA_x64.dll</OutputFile> + <AdditionalLibraryDirectories>$(CUDA_PATH)/lib/x64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> + <ProgramDatabaseFile>$(OutDir)/NvFlexExtReleaseCUDA_x64.dll.pdb</ProgramDatabaseFile> + <SubSystem>Console</SubSystem> + <ImportLibrary>./../../../lib/win64/NvFlexExtReleaseCUDA_x64.lib</ImportLibrary> + <GenerateDebugInformation>true</GenerateDebugInformation> + <TargetMachine>MachineX64</TargetMachine> + </Link> + <ResourceCompile> + </ResourceCompile> + <ProjectReference> + </ProjectReference> + </ItemDefinitionGroup> + <ItemGroup> + <ClCompile Include="..\..\flexExtCloth.cpp"> + </ClCompile> + <ClCompile Include="..\..\flexExtContainer.cpp"> + </ClCompile> + <ClCompile Include="..\..\flexExtMovingFrame.cpp"> + </ClCompile> + <ClCompile Include="..\..\flexExtRigid.cpp"> + </ClCompile> + <ClCompile Include="..\..\flexExtSoft.cpp"> + </ClCompile> + </ItemGroup> + <ItemGroup> + <CustomBuild Include="..\..\cuda\flexExt.cu"> + <FileType Condition="'$(Configuration)|$(Platform)'=='debug|x64'">cuda</FileType> + <Command Condition="'$(Configuration)|$(Platform)'=='debug|x64'">"$(CUDA_PATH)\bin\nvcc.exe" -g -G --compiler-bindir="$(VCInstallDir)bin" --compiler-options=/MTd,/Zi -I"..\..\.." -D_ITERATOR_DEBUG_LEVEL=0 -DCUDA -arch=sm_30 -prec-div=false -prec-sqrt=false -ftz=true -use_fast_math -c ..\..\cuda\flexExt.cu -o ./x64/flexExtCUDA/debug/cuda/flexExt.obj</Command> + <Message Condition="'$(Configuration)|$(Platform)'=='debug|x64'">Building %(Identity)</Message> + <Outputs Condition="'$(Configuration)|$(Platform)'=='debug|x64'">./x64/flexExtCUDA/debug/cuda/flexExt.obj;</Outputs> + <FileType Condition="'$(Configuration)|$(Platform)'=='release|x64'">cuda</FileType> + <Command Condition="'$(Configuration)|$(Platform)'=='release|x64'">"$(CUDA_PATH)\bin\nvcc.exe" -O3 --compiler-bindir="$(VCInstallDir)bin" --compiler-options=/MT,/Zi -I"..\..\.." -D_ITERATOR_DEBUG_LEVEL=0 -DNDEBUG -DCUDA -arch=sm_30 -prec-div=false -prec-sqrt=false -ftz=true -use_fast_math -c ..\..\cuda\flexExt.cu -o ./x64/flexExtCUDA/release/cuda/flexExt.obj</Command> + <Message Condition="'$(Configuration)|$(Platform)'=='release|x64'">Building %(Identity)</Message> + <Outputs Condition="'$(Configuration)|$(Platform)'=='release|x64'">./x64/flexExtCUDA/release/cuda/flexExt.obj;</Outputs> + </CustomBuild> + </ItemGroup> + <ItemGroup> + <ClCompile Include="..\..\..\core\sdf.cpp"> + </ClCompile> + <ClCompile Include="..\..\..\core\voxelize.cpp"> + </ClCompile> + <ClCompile Include="..\..\..\core\maths.cpp"> + </ClCompile> + <ClCompile Include="..\..\..\core\aabbtree.cpp"> + </ClCompile> + </ItemGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"></ImportGroup> +</Project> diff --git a/extensions/compiler/vc14win64/flexExtCUDA.vcxproj.filters b/extensions/compiler/vc14win64/flexExtCUDA.vcxproj.filters new file mode 100644 index 0000000..5c88696 --- /dev/null +++ b/extensions/compiler/vc14win64/flexExtCUDA.vcxproj.filters @@ -0,0 +1,51 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="src">
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\flexExtCloth.cpp">
+ <Filter>src</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\flexExtContainer.cpp">
+ <Filter>src</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\flexExtMovingFrame.cpp">
+ <Filter>src</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\flexExtRigid.cpp">
+ <Filter>src</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\flexExtSoft.cpp">
+ <Filter>src</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <Filter Include="cuda">
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <CustomBuild Include="..\..\cuda\flexExt.cu">
+ <Filter>cuda</Filter>
+ </CustomBuild>
+ </ItemGroup>
+ <ItemGroup>
+ <Filter Include="core">
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\core\sdf.cpp">
+ <Filter>core</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\core\voxelize.cpp">
+ <Filter>core</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\core\maths.cpp">
+ <Filter>core</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\core\aabbtree.cpp">
+ <Filter>core</Filter>
+ </ClCompile>
+ </ItemGroup>
+</Project>
\ No newline at end of file diff --git a/extensions/compiler/vc14win64/flexExtD3D.sln b/extensions/compiler/vc14win64/flexExtD3D.sln new file mode 100644 index 0000000..3275e20 --- /dev/null +++ b/extensions/compiler/vc14win64/flexExtD3D.sln @@ -0,0 +1,24 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "flexExtD3D", "./flexExtD3D.vcxproj", "{9B42889D-2F0D-0378-E87E-82C8D918DB4D}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + debug|x64 = debug|x64 + release|x64 = release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {9B42889D-2F0D-0378-E87E-82C8D918DB4D}.debug|x64.ActiveCfg = debug|x64 + {9B42889D-2F0D-0378-E87E-82C8D918DB4D}.debug|x64.Build.0 = debug|x64 + {9B42889D-2F0D-0378-E87E-82C8D918DB4D}.release|x64.ActiveCfg = release|x64 + {9B42889D-2F0D-0378-E87E-82C8D918DB4D}.release|x64.Build.0 = release|x64 + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + EndGlobalSection + GlobalSection(ExtensibilityAddins) = postSolution + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + EndGlobalSection +EndGlobal diff --git a/extensions/compiler/vc14win64/flexExtD3D.vcxproj b/extensions/compiler/vc14win64/flexExtD3D.vcxproj new file mode 100644 index 0000000..d43e287 --- /dev/null +++ b/extensions/compiler/vc14win64/flexExtD3D.vcxproj @@ -0,0 +1,167 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="debug|x64"> + <Configuration>debug</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="release|x64"> + <Configuration>release</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + </ItemGroup> + <PropertyGroup Label="Globals"> + <ProjectGuid>{9B42889D-2F0D-0378-E87E-82C8D918DB4D}</ProjectGuid> + <RootNamespace>flexExtD3D</RootNamespace> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug|x64'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <PlatformToolset>v140</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release|x64'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <PlatformToolset>v140</PlatformToolset> + <WholeProgramOptimization>true</WholeProgramOptimization> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <ImportGroup Label="ExtensionSettings"> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='debug|x64'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='release|x64'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug|x64'"> + <OutDir>./../../../bin/win64\</OutDir> + <IntDir>./build/win64/DX/debug\</IntDir> + <TargetExt>.dll</TargetExt> + <TargetName>NvFlexExtDebugD3D_x64</TargetName> + <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> + <CodeAnalysisRules /> + <CodeAnalysisRuleAssemblies /> + <SkipCopyingSymbolsToOutputDirectory>true</SkipCopyingSymbolsToOutputDirectory> + </PropertyGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='debug|x64'"> + <ClCompile> + <FloatingPointModel>Precise</FloatingPointModel> + <AdditionalOptions> /d2Zi+</AdditionalOptions> + <Optimization>Disabled</Optimization> + <AdditionalIncludeDirectories>./../../../../..;./../../..;./../../../external/D3D11/include;./../../../external/D3D12/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>_CONSOLE;WIN32;_DEBUG;_ITERATOR_DEBUG_LEVEL=0;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <WarningLevel>Level3</WarningLevel> + <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> + <PrecompiledHeader>NotUsing</PrecompiledHeader> + <PrecompiledHeaderFile></PrecompiledHeaderFile> + </ClCompile> + <Link> + <AdditionalOptions>/DELAYLOAD:d3d11.dll /DELAYLOAD:d3d12.dll</AdditionalOptions> + <AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;delayimp.lib;./../../../lib/win64/NvFlexDebugD3D_x64.lib;%(AdditionalDependencies)</AdditionalDependencies> + <OutputFile>$(OutDir)NvFlexExtDebugD3D_x64.dll</OutputFile> + <AdditionalLibraryDirectories>./../../../external/D3D11/libs/x64;./../../../external/D3D12/libs/x64;./../../../lib/win64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> + <ProgramDatabaseFile>$(OutDir)/NvFlexExtDebugD3D_x64.dll.pdb</ProgramDatabaseFile> + <SubSystem>Console</SubSystem> + <ImportLibrary>./../../../lib/win64/NvFlexExtDebugD3D_x64.lib</ImportLibrary> + <GenerateDebugInformation>true</GenerateDebugInformation> + <TargetMachine>MachineX64</TargetMachine> + </Link> + <ResourceCompile> + </ResourceCompile> + <ProjectReference> + </ProjectReference> + </ItemDefinitionGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release|x64'"> + <OutDir>./../../../bin/win64\</OutDir> + <IntDir>./build/win64/DX/release\</IntDir> + <TargetExt>.dll</TargetExt> + <TargetName>NvFlexExtReleaseD3D_x64</TargetName> + <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> + <CodeAnalysisRules /> + <CodeAnalysisRuleAssemblies /> + <SkipCopyingSymbolsToOutputDirectory>true</SkipCopyingSymbolsToOutputDirectory> + </PropertyGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='release|x64'"> + <ClCompile> + <IntrinsicFunctions>true</IntrinsicFunctions> + <FunctionLevelLinking>true</FunctionLevelLinking> + <BufferSecurityCheck>false</BufferSecurityCheck> + <FloatingPointModel>Fast</FloatingPointModel> + <AdditionalOptions> /d2Zi+</AdditionalOptions> + <Optimization>Full</Optimization> + <AdditionalIncludeDirectories>./../../../../..;./../../..;./../../../external/D3D11/include;./../../../external/D3D12/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>_CONSOLE;WIN32;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <WarningLevel>Level3</WarningLevel> + <RuntimeLibrary>MultiThreaded</RuntimeLibrary> + <PrecompiledHeader>NotUsing</PrecompiledHeader> + <PrecompiledHeaderFile></PrecompiledHeaderFile> + </ClCompile> + <Link> + <AdditionalOptions>/DELAYLOAD:d3d11.dll /DELAYLOAD:d3d12.dll</AdditionalOptions> + <AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;delayimp.lib;./../../../lib/win64/NvFlexReleaseD3D_x64.lib;%(AdditionalDependencies)</AdditionalDependencies> + <OutputFile>$(OutDir)NvFlexExtReleaseD3D_x64.dll</OutputFile> + <AdditionalLibraryDirectories>./../../../external/D3D11/libs/x64;./../../../external/D3D12/libs/x64;./../../../lib/win64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> + <ProgramDatabaseFile>$(OutDir)/NvFlexExtReleaseD3D_x64.dll.pdb</ProgramDatabaseFile> + <SubSystem>Console</SubSystem> + <ImportLibrary>./../../../lib/win64/NvFlexExtReleaseD3D_x64.lib</ImportLibrary> + <GenerateDebugInformation>true</GenerateDebugInformation> + <TargetMachine>MachineX64</TargetMachine> + </Link> + <ResourceCompile> + </ResourceCompile> + <ProjectReference> + </ProjectReference> + </ItemDefinitionGroup> + <ItemGroup> + <ClCompile Include="..\..\..\core\sdf.cpp"> + </ClCompile> + <ClCompile Include="..\..\..\core\voxelize.cpp"> + </ClCompile> + <ClCompile Include="..\..\..\core\maths.cpp"> + </ClCompile> + <ClCompile Include="..\..\..\core\aabbtree.cpp"> + </ClCompile> + </ItemGroup> + <ItemGroup> + <ClCompile Include="..\..\dx\flexExt.cpp"> + </ClCompile> + <None Include="..\..\dx\flexExt.hlsl"> + </None> + <ClInclude Include="..\..\dx\flexExt_dx_common.h"> + </ClInclude> + <ClCompile Include="..\..\flexExtCloth.cpp"> + </ClCompile> + <ClCompile Include="..\..\flexExtRigid.cpp"> + </ClCompile> + <ClCompile Include="..\..\flexExtSoft.cpp"> + </ClCompile> + <ClCompile Include="..\..\flexExtMovingFrame.cpp"> + </ClCompile> + <ClCompile Include="..\..\flexExtContainer.cpp"> + </ClCompile> + </ItemGroup> + <ItemGroup> + <FxCompile Include="./../../dx/shaders/flexExt.UpdateForceFields.hlsl"> + <ShaderType Condition="'$(Configuration)|$(Platform)'=='debug|x64'">Compute</ShaderType> + <ShaderModel Condition="'$(Configuration)|$(Platform)'=='debug|x64'">5.0</ShaderModel> + <EnableDebuggingInformation Condition="'$(Configuration)|$(Platform)'=='debug|x64'">false</EnableDebuggingInformation> + <DisableOptimizations Condition="'$(Configuration)|$(Platform)'=='debug|x64'">false</DisableOptimizations> + <EntryPointName Condition="'$(Configuration)|$(Platform)'=='debug|x64'">UpdateForceFields::execute</EntryPointName> + <TreatWarningAsError Condition="'$(Configuration)|$(Platform)'=='debug|x64'">false</TreatWarningAsError> + <VariableName Condition="'$(Configuration)|$(Platform)'=='debug|x64'">g_flexExt_UpdateForceFields</VariableName> + <HeaderFileOutput Condition="'$(Configuration)|$(Platform)'=='debug|x64'">../../../extensions/dx/shaders/%(Filename).h</HeaderFileOutput> + <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='debug|x64'"> </ObjectFileOutput> + <ShaderType Condition="'$(Configuration)|$(Platform)'=='release|x64'">Compute</ShaderType> + <ShaderModel Condition="'$(Configuration)|$(Platform)'=='release|x64'">5.0</ShaderModel> + <EnableDebuggingInformation Condition="'$(Configuration)|$(Platform)'=='release|x64'">false</EnableDebuggingInformation> + <DisableOptimizations Condition="'$(Configuration)|$(Platform)'=='release|x64'">false</DisableOptimizations> + <EntryPointName Condition="'$(Configuration)|$(Platform)'=='release|x64'">UpdateForceFields::execute</EntryPointName> + <TreatWarningAsError Condition="'$(Configuration)|$(Platform)'=='release|x64'">false</TreatWarningAsError> + <VariableName Condition="'$(Configuration)|$(Platform)'=='release|x64'">g_flexExt_UpdateForceFields</VariableName> + <HeaderFileOutput Condition="'$(Configuration)|$(Platform)'=='release|x64'">../../../extensions/dx/shaders/%(Filename).h</HeaderFileOutput> + <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='release|x64'"> </ObjectFileOutput> + </FxCompile> + </ItemGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"></ImportGroup> +</Project> diff --git a/extensions/compiler/vc14win64/flexExtD3D.vcxproj.filters b/extensions/compiler/vc14win64/flexExtD3D.vcxproj.filters new file mode 100644 index 0000000..dd65ee0 --- /dev/null +++ b/extensions/compiler/vc14win64/flexExtD3D.vcxproj.filters @@ -0,0 +1,57 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Core">
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\core\sdf.cpp">
+ <Filter>Core</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\core\voxelize.cpp">
+ <Filter>Core</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\core\maths.cpp">
+ <Filter>Core</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\core\aabbtree.cpp">
+ <Filter>Core</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <Filter Include="src">
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\dx\flexExt.cpp">
+ <Filter>src</Filter>
+ </ClCompile>
+ <None Include="..\..\dx\flexExt.hlsl">
+ <Filter>src</Filter>
+ </None>
+ <ClInclude Include="..\..\dx\flexExt_dx_common.h">
+ <Filter>src</Filter>
+ </ClInclude>
+ <ClCompile Include="..\..\flexExtCloth.cpp">
+ <Filter>src</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\flexExtRigid.cpp">
+ <Filter>src</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\flexExtSoft.cpp">
+ <Filter>src</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\flexExtMovingFrame.cpp">
+ <Filter>src</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\flexExtContainer.cpp">
+ <Filter>src</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup><Filter Include="Shader Files"></Filter></ItemGroup>
+ <ItemGroup>
+ <FxCompile Include="./../../dx/shaders/flexExt.UpdateForceFields.hlsl">
+ <Filter>Shader Files</Filter>
+ </FxCompile>
+ </ItemGroup>
+</Project>
\ No newline at end of file diff --git a/extensions/compiler/vc14win64/vc140.pdb b/extensions/compiler/vc14win64/vc140.pdb Binary files differnew file mode 100644 index 0000000..fe2e606 --- /dev/null +++ b/extensions/compiler/vc14win64/vc140.pdb diff --git a/extensions/compiler/xpj/flexExtCUDA.xpj b/extensions/compiler/xpj/flexExtCUDA.xpj new file mode 100644 index 0000000..434b2fe --- /dev/null +++ b/extensions/compiler/xpj/flexExtCUDA.xpj @@ -0,0 +1,239 @@ +<?xml version="1.0" encoding="utf-8" ?> + +<XPJ version="4"> + + <template filename="../../../common.xpjt"/> + + <Project name="flexExtCUDA"> + + <!-- depends on flex solver project --> + <Conditional value="${config}" match="internal"> + <Import file="../../../src/compiler/xpj/flexCUDA.xpj" /> + </Conditional> + + <Export platforms="Win32 Win64">../${xpj:TOOL}${xpj:PLATFORM}</Export> + <Export platform="android{x}" tool="make">../makeandroid</Export> + <Export platform="Linux64" tool="make">../makelinux64</Export> + + <Target name="flexExtCUDA"> + + <Var name="ProjectRoot" value="../../.." /> + + <!-- Windows --> + + <Config name="default" type="dll" platforms="Win32 Win64"> + + <apply-template name="windows-common"/> + + <OutDir platform="Win32">../../../bin/win32/</OutDir> + <OutDir platform="Win64">../../../bin/win64/</OutDir> + + <Preprocessor type="define"> + _CONSOLE + WIN32 + </Preprocessor> + + <WarningLevel>3</WarningLevel> + <GenerateDebugInformation>true</GenerateDebugInformation> + <CharacterSet>MultiByte</CharacterSet> + + <SearchPaths type="header"> + ..\..\..\..\.. + </SearchPaths> + + <Libraries> + cudart.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib + </Libraries> + + </Config> + + <Config name="debug" type="dll" platforms="Win32 Win64"> + + <apply-template name="windows-common"/> + + <OutFile platform="Win32">NvFlexExtDebugCUDA_x86.dll</OutFile> + <OutFile platform="Win64">NvFlexExtDebugCUDA_x64.dll</OutFile> + + <IntDir>./build/${xpj:PLATFORM}/debug/</IntDir> + + <Preprocessor type="define"> + _DEBUG + </Preprocessor> + <Preprocessor type="define"> + _ITERATOR_DEBUG_LEVEL=0 + </Preprocessor> + <RuntimeLibrary>MTd</RuntimeLibrary> + <GenerateDebugInformation>true</GenerateDebugInformation> + <FloatingPointModel>Precise</FloatingPointModel> + <ExportLibrary platform="Win32">..\..\..\lib\win32\NvFlexExtDebugCUDA_x86.lib</ExportLibrary> + <ExportLibrary platform="Win64">..\..\..\lib\win64\NvFlexExtDebugCUDA_x64.lib</ExportLibrary> + + <FileTemplate platform="Win32" name="cuda" command=""${user:CUDA_PATH}\bin\nvcc.exe" -g -G --compiler-bindir="$(VCInstallDir)bin" --compiler-options=/MTd,/Zi -I"..\..\.." -D_ITERATOR_DEBUG_LEVEL=0 -DCUDA -m32 -arch=sm_30 -prec-div=false -prec-sqrt=false -ftz=true -use_fast_math -c %s -o %o" buildtype="CustomBuild" filetype="cuda" description="Building %(Identity)" /> + <FileTemplate platform="Win64" name="cuda" command=""${user:CUDA_PATH}\bin\nvcc.exe" -g -G --compiler-bindir="$(VCInstallDir)bin" --compiler-options=/MTd,/Zi -I"..\..\.." -D_ITERATOR_DEBUG_LEVEL=0 -DCUDA -arch=sm_30 -prec-div=false -prec-sqrt=false -ftz=true -use_fast_math -c %s -o %o" buildtype="CustomBuild" filetype="cuda" description="Building %(Identity)" /> + + <Libraries platforms="Win32"> + ${user:ProjectRoot}/lib/win32/NvFlexDebugCUDA_x86.lib + </Libraries> + + <Libraries platforms="Win64"> + ${user:ProjectRoot}/lib/win64/NvFlexDebugCUDA_x64.lib + </Libraries> + + </Config> + + <Config name="release" type="dll" platforms="Win32 Win64"> + + <apply-template name="windows-common"/> + + <OutFile platform="Win32">NvFlexExtReleaseCUDA_x86.dll</OutFile> + <OutFile platform="Win64">NvFlexExtReleaseCUDA_x64.dll</OutFile> + + <IntDir>./build/${xpj:PLATFORM}/release/</IntDir> + + <Preprocessor type="define"> + NDEBUG + </Preprocessor> + <RuntimeLibrary>MT</RuntimeLibrary> + <WholeProgramOptimization>1</WholeProgramOptimization> + <Optimization>3</Optimization> + <EnableIntrinsicFunctions>true</EnableIntrinsicFunctions> + <BufferSecurityCheck>false</BufferSecurityCheck> + <EnableFunctionLevelLinking>true</EnableFunctionLevelLinking> + <EnableEnhancedInstructionSet>2</EnableEnhancedInstructionSet> + <FloatingPointModel>Fast</FloatingPointModel> + + <ExportLibrary platform="Win32">..\..\..\lib\win32\NvFlexExtReleaseCUDA_x86.lib</ExportLibrary> + <ExportLibrary platform="Win64">..\..\..\lib\win64\NvFlexExtReleaseCUDA_x64.lib</ExportLibrary> + + <FileTemplate platform="Win32" name="cuda" command=""${user:CUDA_PATH}\bin\nvcc.exe" -O3 --compiler-bindir="$(VCInstallDir)bin" --compiler-options=/MT,/Zi -I"..\..\.." -D_ITERATOR_DEBUG_LEVEL=0 -DNDEBUG -DCUDA -m32 -arch=sm_30 -prec-div=false -prec-sqrt=false -ftz=true -use_fast_math -c %s -o %o" buildtype="CustomBuild" filetype="cuda" description="Building %(Identity)" /> + <FileTemplate platform="Win64" name="cuda" command=""${user:CUDA_PATH}\bin\nvcc.exe" -O3 --compiler-bindir="$(VCInstallDir)bin" --compiler-options=/MT,/Zi -I"..\..\.." -D_ITERATOR_DEBUG_LEVEL=0 -DNDEBUG -DCUDA -arch=sm_30 -prec-div=false -prec-sqrt=false -ftz=true -use_fast_math -c %s -o %o" buildtype="CustomBuild" filetype="cuda" description="Building %(Identity)" /> + + <Libraries platforms="Win32"> + ${user:ProjectRoot}/lib/win32/NvFlexReleaseCUDA_x86.lib + </Libraries> + + <Libraries platforms="Win64"> + ${user:ProjectRoot}/lib/win64/NvFlexReleaseCUDA_x64.lib + </Libraries> + + </Config> + + <!-- Android --> + + <Config name="default" type="lib" platforms="android{x}"> + + <apply-template name="android-common"/> + + <FileTemplate name="cuda" command='${user:NVCC} ${user:NVCCInclude} --compile "%s" -o "%o"' buildtype="CustomBuild" /> + + <OutDir platforms="android{x}" tool="make">${user:ProjectRoot}/lib/android</OutDir> + + <Preprocessor type="define" platform="android{x}"> + android + ANDROID=1 + ANDROID_PLAT=1 + DISABLE_IMPORTGL + </Preprocessor> + + <CFlags tool="make"> + -Wall -std=c++11 -fpermissive -fno-strict-aliasing -fno-rtti -fno-exceptions + </CFlags> + + </Config> + + <Config name="release" type="lib" platforms="android{x}"> + <cflags> -O3 -ffast-math </cflags> + <OutFile>libflexExt_cuda_release_armv7l.a</OutFile> + + <Libraries> + ${user:ProjectRoot}/lib/android/libNvFlexRelease_armv7l.a + </Libraries> + + </Config> + + <Config name="debug" type="lib" platforms="android{x}"> + <cflags> -g -O0 </cflags> + <OutFile>libflexExt_cuda_debug_armv7l.a</OutFile> + + <Libraries> + ${user:ProjectRoot}/lib/android/libNvFlexDebug_armv7l.a + </Libraries> + + </Config> + + + <!-- Linux --> + + <Config name="default" type="lib" platforms="linux64"> + + <apply-template name="linux-common"/> + + <Var name="Cub" value="${user:External}/cub-1.3.2"/> + <var name="GCC" value="g++"/> + <var name="NVCC" value='${user:CUDA_PATH}/bin/nvcc -O3 -g -arch=sm_30 -m64 -Xcompiler -fPIC -D_FORCE_INLINES'/> + <var name="NVCCInclude" value=' -I${user:ProjectRoot} -I${user:External} -I${user:CUDA_PATH}/include -I${user:Cub} '/> + + <FileTemplate name="cuda" command='${user:NVCC} ${user:NVCCInclude} --compile "%s" -o "%o"' buildtype="CustomBuild"/> + + <OutDir platforms="linux64" tool="make">${user:ProjectRoot}/lib/linux64</OutDir> + + <SearchPaths type="header" tool="make"> + "${user:ProjectRoot}" + "${user:External}/freeglut/include" + </SearchPaths> + + <CFlags tool="make"> + -Wall -std=c++0x -fPIC -fpermissive -fno-strict-aliasing + </CFlags> + </Config> + + <Config name="release" type="lib" platforms="linux64"> + <cflags> -O3 -ffast-math -DNDEBUG</cflags> + <OutFile>NvFlexExtReleaseCUDA_x64.a</OutFile> + + <Libraries> + ${user:ProjectRoot}/lib/linux64/NvFlexReleaseCUDA_x64.a + </Libraries> + + </Config> + + <Config name="debug" type="lib" platforms="linux64"> + <cflags> -g -O0 </cflags> + <OutFile>NvFlexExtDebugCUDA_x64.a</OutFile> + + <Libraries> + ${user:ProjectRoot}/lib/linux64/NvFlexDebugCUDA_x64.a + </Libraries> + </Config> + + <!-- Source --> + + <Files name="src" type="source" root="${user:ProjectRoot}/extensions"> + *.cpp *.h + </Files> + + <Files name="cuda" type="source" root="${user:ProjectRoot}/extensions/cuda" template="cuda"> + *.cu + </Files> + + <Files name="include" type="source" root="${user:ProjectRoot}/include"> + flexExt.h + </Files> + + <Files name="core" type="source" root="${user:ProjectRoot}/core"> + sdf.cpp + voxelize.cpp + maths.cpp + aabbtree.cpp + </Files> + + <Conditional value="${config}" match="internal"> + <Dependencies> + flexCUDA + </Dependencies> + </Conditional> + + </Target> + </Project> + +</XPJ>
\ No newline at end of file diff --git a/extensions/compiler/xpj/flexExtD3D.xpj b/extensions/compiler/xpj/flexExtD3D.xpj new file mode 100644 index 0000000..ff30566 --- /dev/null +++ b/extensions/compiler/xpj/flexExtD3D.xpj @@ -0,0 +1,177 @@ +<?xml version="1.0" encoding="utf-8" ?> + +<XPJ version="4"> + + <Project name="flexExtD3D"> + + <!-- depends on flex solver project --> + <Conditional value="${config}" match="internal"> + <Import file="../../../src/compiler/xpj/flexD3D.xpj" /> + </Conditional> + + <Export platforms="Win32 Win64">../${xpj:TOOL}${xpj:PLATFORM}</Export> + + <Target name="flexExtD3D"> + + <Var name="ProjectRoot" value="../../.." /> + + <!-- Windows --> + + <Config name="default" type="dll" platforms="Win32 Win64"> + + <OutDir platform="Win32">../../../bin/win32/</OutDir> + <OutDir platform="Win64">../../../bin/win64/</OutDir> + + <Preprocessor type="define"> + _CONSOLE + WIN32 + </Preprocessor> + + <WarningLevel>3</WarningLevel> + <GenerateDebugInformation>true</GenerateDebugInformation> + <CharacterSet>MultiByte</CharacterSet> + + <SearchPaths type="header"> + ..\..\..\..\.. + </SearchPaths> + + <Libraries> + kernel32.lib + user32.lib + gdi32.lib + winspool.lib + comdlg32.lib + advapi32.lib + shell32.lib + ole32.lib + oleaut32.lib + uuid.lib + odbc32.lib + odbccp32.lib + delayimp.lib + </Libraries> + + <LFlags>/DELAYLOAD:d3d11.dll /DELAYLOAD:d3d12.dll</LFlags> + + + </Config> + + <Config name="debug" type="dll" platforms="Win32 Win64"> + + <OutFile platform="Win32">NvFlexExtDebugD3D_x86.dll</OutFile> + <OutFile platform="Win64">NvFlexExtDebugD3D_x64.dll</OutFile> + + <IntDir>./build/${xpj:PLATFORM}/DX/debug/</IntDir> + + <Preprocessor type="define"> + _DEBUG + </Preprocessor> + <Preprocessor type="define"> + _ITERATOR_DEBUG_LEVEL=0 + </Preprocessor> + <RuntimeLibrary>MTd</RuntimeLibrary> + <GenerateDebugInformation>true</GenerateDebugInformation> + <FloatingPointModel>Precise</FloatingPointModel> + <ExportLibrary platform="Win32">..\..\..\lib\win32\NvFlexExtDebugD3D_x86.lib</ExportLibrary> + <ExportLibrary platform="Win64">..\..\..\lib\win64\NvFlexExtDebugD3D_x64.lib</ExportLibrary> + + <Libraries platforms="Win32"> + ${user:ProjectRoot}/lib/win32/NvFlexDebugD3D_x86.lib + </Libraries> + + <Libraries platforms="Win64"> + ${user:ProjectRoot}/lib/win64/NvFlexDebugD3D_x64.lib + </Libraries> + + </Config> + + <Config name="release" type="dll" platforms="Win32 Win64"> + + <OutFile platform="Win32">NvFlexExtReleaseD3D_x86.dll</OutFile> + <OutFile platform="Win64">NvFlexExtReleaseD3D_x64.dll</OutFile> + + <IntDir>./build/${xpj:PLATFORM}/DX/release/</IntDir> + + <Preprocessor type="define"> + NDEBUG + </Preprocessor> + <RuntimeLibrary>MT</RuntimeLibrary> + <WholeProgramOptimization>1</WholeProgramOptimization> + <Optimization>3</Optimization> + <EnableIntrinsicFunctions>true</EnableIntrinsicFunctions> + <BufferSecurityCheck>false</BufferSecurityCheck> + <EnableFunctionLevelLinking>true</EnableFunctionLevelLinking> + <FloatingPointModel>Fast</FloatingPointModel> + + <ExportLibrary platform="Win32">..\..\..\lib\win32\NvFlexExtReleaseD3D_x86.lib</ExportLibrary> + <ExportLibrary platform="Win64">..\..\..\lib\win64\NvFlexExtReleaseD3D_x64.lib</ExportLibrary> + + <Libraries platforms="Win32"> + ${user:ProjectRoot}/lib/win32/NvFlexReleaseD3D_x86.lib + </Libraries> + + <Libraries platforms="Win64"> + ${user:ProjectRoot}/lib/win64/NvFlexReleaseD3D_x64.lib + </Libraries> + + </Config> + + + <SearchPaths type="header"> + ..\..\..\ + ..\..\..\external\D3D11\include + ..\..\..\external\D3D12\include + </SearchPaths> + + <SearchPaths type="lib" platform="Win32"> + ..\..\..\external\D3D11\libs\x86 + ..\..\..\external\D3D12\libs\x86 + ..\..\..\lib\win32 + </SearchPaths> + + <SearchPaths type="lib" platform="Win64"> + ..\..\..\external\D3D11\libs\x64 + ..\..\..\external\D3D12\libs\x64 + ..\..\..\lib\win64 + </SearchPaths> + + <!-- Source --> + + <Files name="Core" type="source" root="${user:ProjectRoot}/core"> + sdf.cpp + voxelize.cpp + maths.cpp + aabbtree.cpp + </Files> + + <Files name="src" type="source" root="${user:ProjectRoot}/extensions/dx"> + flexExt.cpp + flexExt.hlsl + flexExt_dx_common.h + </Files> + + <Files name="src" type="source" root="${user:ProjectRoot}/include"> + flexExt.h + </Files> + + <Files name="src" type="source" root="${user:ProjectRoot}/extensions"> + flexExtCloth.cpp + flexExtRigid.cpp + flexExtSoft.cpp + flexExtMovingFrame.cpp + flexExtContainer.cpp + </Files> + + <HLSL Configurations="release" DisableOptim="No" Debug="No" ShaderModel="5.0" Platforms="Win32 Win64" ObjectFileOutput=" " WarningAsErrors="false" OutputHeaderFileName="${user:ProjectRoot}/extensions/dx/shaders/%(Filename).h"> + <File ShaderType="Compute" EntryPoint="UpdateForceFields::execute" OutputHeaderVarName="g_flexExt_UpdateForceFields"> "${user:ProjectRoot}/extensions/dx/shaders/flexExt.UpdateForceFields.hlsl" </File> + </HLSL> + + <Conditional value="${config}" match="internal"> + <Dependencies> + flexD3D + </Dependencies> + </Conditional> + + </Target> + </Project> +</XPJ>
\ No newline at end of file diff --git a/extensions/cuda/flexExt.cu b/extensions/cuda/flexExt.cu new file mode 100644 index 0000000..9f454d4 --- /dev/null +++ b/extensions/cuda/flexExt.cu @@ -0,0 +1,198 @@ +// 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) 20132017 NVIDIA Corporation. All rights reserved. + +#include <cuda.h> +#include <cuda_runtime_api.h> + +#include <vector> +#include <limits> +#include <algorithm> + +#include "../../core/core.h" +#include "../../core/maths.h" + +#include "../../include/NvFlex.h" +#include "../../include/NvFlexExt.h" + +#define CudaCheck(x) { cudaError_t err = x; if (err != cudaSuccess) { printf("Cuda error: %d in %s at %s:%d\n", err, #x, __FILE__, __LINE__); assert(0); } } + +static const int kNumThreadsPerBlock = 256; + +struct NvFlexExtForceFieldCallback +{ + NvFlexExtForceFieldCallback(NvFlexSolver* solver) : mSolver(solver) + { + // force fields + mForceFieldsCpu = NULL; + mForceFieldsGpu = NULL; + mMaxForceFields = 0; + mNumForceFields = 0; + + } + + ~NvFlexExtForceFieldCallback() + { + // force fields + CudaCheck(cudaFreeHost(mForceFieldsCpu)); + CudaCheck(cudaFree(mForceFieldsGpu)); + } + + NvFlexExtForceField* mForceFieldsCpu; // pinned host copy for async transfer + NvFlexExtForceField* mForceFieldsGpu; // device copy + + int mMaxForceFields; + int mNumForceFields; + + NvFlexSolver* mSolver; +}; + +NvFlexExtForceFieldCallback* NvFlexExtCreateForceFieldCallback(NvFlexSolver* solver) +{ + return new NvFlexExtForceFieldCallback(solver); +} + +void NvFlexExtDestroyForceFieldCallback(NvFlexExtForceFieldCallback* callback) +{ + delete callback; +} + + +__global__ void UpdateForceFields(int numParticles, const Vec4* __restrict__ positions, Vec4* __restrict__ velocities, const NvFlexExtForceField* __restrict__ forceFields, int numForceFields, float dt) +{ + const int i = blockIdx.x*blockDim.x + threadIdx.x; + + for (int f = 0; f < numForceFields; f++) + { + const NvFlexExtForceField& forceField = forceFields[f]; + + if (i < numParticles) + { + const int index = i; + + Vec4 p = positions[index]; + Vec3 v = Vec3(velocities[index]); + + Vec3 localPos = Vec3(p.x, p.y, p.z) - Vec3(forceField.mPosition[0], forceField.mPosition[1], forceField.mPosition[2]); + + float length = Length(localPos); + if (length >= forceField.mRadius) + { + continue; + } + + Vec3 fieldDir; + if (length > 0.0f) + { + fieldDir = localPos / length; + } + else + { + fieldDir = localPos; + } + + // If using linear falloff, scale with distance. + float fieldStrength = forceField.mStrength; + if (forceField.mLinearFalloff) + { + fieldStrength *= (1.0f - (length / forceField.mRadius)); + } + + // Apply force + Vec3 force = localPos * fieldStrength; + + float unitMultiplier; + if (forceField.mMode == eNvFlexExtModeForce) + { + unitMultiplier = dt * p.w; // time/mass + } + else if (forceField.mMode == eNvFlexExtModeImpulse) + { + unitMultiplier = p.w; // 1/mass + } + else if (forceField.mMode == eNvFlexExtModeVelocityChange) + { + unitMultiplier = 1.0f; + } + + Vec3 deltaVelocity = fieldDir * fieldStrength * unitMultiplier; + velocities[index] = Vec4(v + deltaVelocity, 0.0f); + } + } +} + +void ApplyForceFieldsCallback(NvFlexSolverCallbackParams params) +{ + // callbacks always have the correct CUDA device set so we can safely launch kernels without acquiring + + NvFlexExtForceFieldCallback* c = (NvFlexExtForceFieldCallback*)params.userData; + + if (params.numActive && c->mNumForceFields) + { + const int kNumBlocks = (params.numActive+kNumThreadsPerBlock-1)/kNumThreadsPerBlock; + + UpdateForceFields<<<kNumBlocks, kNumThreadsPerBlock>>>( + params.numActive, + (Vec4*)params.particles, + (Vec4*)params.velocities, + c->mForceFieldsGpu, + c->mNumForceFields, + params.dt); + } +} + +void NvFlexExtSetForceFields(NvFlexExtForceFieldCallback* c, const NvFlexExtForceField* forceFields, int numForceFields) +{ + // re-alloc if necessary + if (numForceFields > c->mMaxForceFields) + { + CudaCheck(cudaFreeHost(c->mForceFieldsCpu)); + CudaCheck(cudaMallocHost(&c->mForceFieldsCpu, sizeof(NvFlexExtForceField)*numForceFields)); + + CudaCheck(cudaFree(c->mForceFieldsGpu)); + CudaCheck(cudaMalloc(&c->mForceFieldsGpu, sizeof(NvFlexExtForceField)*numForceFields)); + + + c->mMaxForceFields = numForceFields; + } + c->mNumForceFields = numForceFields; + + if (numForceFields > 0) + { + // copy to pinned host memory + memcpy(c->mForceFieldsCpu, forceFields, numForceFields*sizeof(NvFlexExtForceField)); + + cudaMemcpyKind kind = cudaMemcpyHostToDevice; + CudaCheck(cudaMemcpyAsync(c->mForceFieldsGpu, &c->mForceFieldsCpu[0], numForceFields*sizeof(NvFlexExtForceField), kind, 0)); + } + + NvFlexSolverCallback callback; + callback.function = ApplyForceFieldsCallback; + callback.userData = c; + + // register a callback to calculate the forces at the end of the time-step + NvFlexRegisterSolverCallback(c->mSolver, callback, eNvFlexStageUpdateEnd); +} diff --git a/extensions/dx/flexExt.cpp b/extensions/dx/flexExt.cpp new file mode 100644 index 0000000..4dcc0e4 --- /dev/null +++ b/extensions/dx/flexExt.cpp @@ -0,0 +1,193 @@ +// 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) 2013-2017 NVIDIA Corporation. All rights reserved. + +#include "core/core.h" +#include "core/maths.h" + +#include "include/NvFlex.h" +#include "include/NvFlexExt.h" + +#include "src/dx/context/context.h" +#include "src/dx/context/device.h" + +#include "flexExt_dx_common.h" + +#include "shaders\flexExt.UpdateForceFields.h" + + +struct NvFlexExtForceFieldCallback +{ + NvFlexExtForceFieldCallback(NvFlexSolver* solver) : mSolver(solver) + { + // force fields + mMaxForceFields = 0; + mNumForceFields = 0; + + mForceFieldsGpu = NULL; + + mDevice = NULL; + mContext = NULL; + + NvFlexLibrary* lib = NvFlexGetSolverLibrary(solver); + NvFlexGetDeviceAndContext(lib, (void**)&mDevice, (void**)&mContext); + + { + // force field shader + NvFlex::ComputeShaderDesc desc{}; + desc.cs = (void*)g_flexExt_UpdateForceFields; + desc.cs_length = sizeof(g_flexExt_UpdateForceFields); + desc.label = L"NvFlexExtForceFieldCallback"; + desc.NvAPI_Slot = 0; + + mShaderUpdateForceFields = mContext->createComputeShader(&desc); + } + + { + // constant buffer + NvFlex::ConstantBufferDesc desc; + desc.stride = sizeof(int); + desc.dim = 4; + desc.uploadAccess = true; + + mConstantBuffer = mContext->createConstantBuffer(&desc); + } + } + + ~NvFlexExtForceFieldCallback() + { + // force fields + delete mForceFieldsGpu; + delete mConstantBuffer; + delete mShaderUpdateForceFields; + } + + NvFlex::Buffer* mForceFieldsGpu; + + // DX Specific + NvFlex::ComputeShader* mShaderUpdateForceFields; + NvFlex::ConstantBuffer* mConstantBuffer; + + int mMaxForceFields; + int mNumForceFields; + + // D3D device and context wrappers for the solver library + NvFlex::Device* mDevice; + NvFlex::Context* mContext; + + NvFlexSolver* mSolver; + +}; + +NvFlexExtForceFieldCallback* NvFlexExtCreateForceFieldCallback(NvFlexSolver* solver) +{ + return new NvFlexExtForceFieldCallback(solver); +} + +void NvFlexExtDestroyForceFieldCallback(NvFlexExtForceFieldCallback* callback) +{ + delete callback; +} + +void ApplyForceFieldsCallback(NvFlexSolverCallbackParams params) +{ + // callbacks always have the correct CUDA device set so we can safely launch kernels without acquiring + + NvFlexExtForceFieldCallback* c = (NvFlexExtForceFieldCallback*)params.userData; + + if (params.numActive && c->mNumForceFields) + { + const unsigned int numThreadsPerBlock = 256; + const unsigned int kNumBlocks = (params.numActive + numThreadsPerBlock - 1) / numThreadsPerBlock; + + NvFlex::Buffer* particles = (NvFlex::Buffer*)params.particles; + NvFlex::Buffer* velocities = (NvFlex::Buffer*)params.velocities; + + // Init constant buffer + { + FlexExtConstParams constBuffer; + + constBuffer.kNumParticles = params.numActive; + constBuffer.kNumForceFields = c->mNumForceFields; + constBuffer.kDt = params.dt; + + memcpy(c->mContext->map(c->mConstantBuffer), &constBuffer, sizeof(FlexExtConstParams)); + c->mContext->unmap(c->mConstantBuffer); + } + + { + NvFlex::DispatchParams params = {}; + params.shader = c->mShaderUpdateForceFields; + params.readWrite[0] = velocities->getResourceRW(); + params.readOnly[0] = particles->getResource(); + params.readOnly[1] = c->mForceFieldsGpu->getResource(); + params.gridDim = { kNumBlocks , 1, 1 }; + params.rootConstantBuffer = c->mConstantBuffer; + + c->mContext->dispatch(¶ms); + } + } +} + +void NvFlexExtSetForceFields(NvFlexExtForceFieldCallback* c, const NvFlexExtForceField* forceFields, int numForceFields) +{ + // re-alloc if necessary + if (numForceFields > c->mMaxForceFields) + { + delete c->mForceFieldsGpu; + + NvFlex::BufferDesc desc {}; + desc.dim = numForceFields; + desc.stride = sizeof(NvFlexExtForceField); + desc.bufferType = NvFlex::eBuffer | NvFlex::eUAV_SRV | NvFlex::eStructured | NvFlex::eStage; + desc.format = NvFlexFormat::eNvFlexFormat_unknown; + desc.data = NULL; + + c->mForceFieldsGpu = c->mContext->createBuffer(&desc); + + c->mMaxForceFields = numForceFields; + } + c->mNumForceFields = numForceFields; + + if (numForceFields > 0) + { + // update staging buffer + void* dstPtr = c->mContext->mapUpload(c->mForceFieldsGpu); + memcpy(dstPtr, forceFields, numForceFields*sizeof(NvFlexExtForceField)); + c->mContext->unmap(c->mForceFieldsGpu); + + // upload to device buffer + c->mContext->upload(c->mForceFieldsGpu, 0, numForceFields*sizeof(NvFlexExtForceField)); + + } + + NvFlexSolverCallback callback; + callback.function = ApplyForceFieldsCallback; + callback.userData = c; + + // register a callback to calculate the forces at the end of the time-step + NvFlexRegisterSolverCallback(c->mSolver, callback, eNvFlexStageUpdateEnd); +} diff --git a/extensions/dx/flexExt.hlsl b/extensions/dx/flexExt.hlsl new file mode 100644 index 0000000..ebcfcaf --- /dev/null +++ b/extensions/dx/flexExt.hlsl @@ -0,0 +1,106 @@ +// 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) 2013-2017 NVIDIA Corporation. All rights reserved. + +#include "flexExt_dx_common.h" + +#define kNumThreadsPerBlock 256 + +cbuffer consts : register(b0) { FlexExtConstParams gParams; }; + +namespace UpdateForceFields +{ + StructuredBuffer<float4> positions : register(t0); + StructuredBuffer<FlexExtForceFieldD3D> forceFields : register(t1); + + RWStructuredBuffer<float4> velocities : register(u0); + + [numthreads(kNumThreadsPerBlock, 1, 1)] void execute(uint3 globalIdx : SV_DispatchThreadID) + { + const int i = globalIdx.x; + const int numParticles = gParams.kNumParticles; + const int numForceFields = gParams.kNumForceFields; + const float dt = gParams.kDt; + + for (int f = 0; f < numForceFields; f++) + { + const FlexExtForceFieldD3D forceField = forceFields[f]; + + if (i < numParticles) + { + const int index = i; + + float4 p = positions[index]; + float3 v = velocities[index].xyz; + + float3 localPos = float3(p.x, p.y, p.z) - float3(forceField.mPosition[0], forceField.mPosition[1], forceField.mPosition[2]); + + float dist = length(localPos); + if (dist >= forceField.mRadius) + { + continue; + } + + float3 fieldDir; + if (dist > 0.0f) + { + fieldDir = localPos / dist; + } + else + { + fieldDir = localPos; + } + + // If using linear falloff, scale with distance. + float fieldStrength = forceField.mStrength; + if (forceField.mLinearFalloff) + { + fieldStrength *= (1.0f - (dist / forceField.mRadius)); + } + + // Apply force + float3 force = localPos * fieldStrength; + + float unitMultiplier; + if (forceField.mMode == eNvFlexExtModeForce) + { + unitMultiplier = dt * p.w; // time/mass + } + else if (forceField.mMode == eNvFlexExtModeImpulse) + { + unitMultiplier = p.w; // 1/mass + } + else if (forceField.mMode == eNvFlexExtModeVelocityChange) + { + unitMultiplier = 1.0f; + } + + float3 deltaVelocity = fieldDir * fieldStrength * unitMultiplier; + velocities[index] = float4(v + deltaVelocity, 0.0f); + } + } + } +} diff --git a/extensions/dx/flexExt_dx_common.h b/extensions/dx/flexExt_dx_common.h new file mode 100644 index 0000000..55fd50c --- /dev/null +++ b/extensions/dx/flexExt_dx_common.h @@ -0,0 +1,65 @@ +// 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) 2013-2017 NVIDIA Corporation. All rights reserved. + +#ifndef FLEXEXT_DX_COMMON_H +#define FLEXEXT_DX_COMMON_H + +#ifdef WIN32 +#pragma pack(push) +#pragma pack(16) +#endif + +struct FlexExtConstParams +{ + int kNumParticles; + int kNumForceFields; + float kDt; + float _pad; +}; + +#ifdef WIN32 +#pragma pack(pop) +#endif + +// enum FlexForceExtMode +#define eNvFlexExtModeForce 0 +#define eNvFlexExtModeImpulse 1 +#define eNvFlexExtModeVelocityChange 2 + +/** +* Force field data, currently just supports radial fields +*/ +struct FlexExtForceFieldD3D +{ + float mPosition[3]; //!< Center of force field + float mRadius; //!< Radius of the force field + float mStrength; //!< Strength of the force field + int mMode; //!< Mode of field application + bool mLinearFalloff; //!< Linear or no falloff +}; + +#endif // FLEXEXT_DX_COMMON_H diff --git a/extensions/dx/shaders/flexExt.UpdateForceFields.h b/extensions/dx/shaders/flexExt.UpdateForceFields.h new file mode 100644 index 0000000..859f621 --- /dev/null +++ b/extensions/dx/shaders/flexExt.UpdateForceFields.h @@ -0,0 +1,549 @@ +#if 0 +// +// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384 +// +// +// Buffer Definitions: +// +// cbuffer consts +// { +// +// struct FlexExtConstParams +// { +// +// int kNumParticles; // Offset: 0 +// int kNumForceFields; // Offset: 4 +// float kDt; // Offset: 8 +// float _pad; // Offset: 12 +// +// } gParams; // Offset: 0 Size: 16 +// +// } +// +// Resource bind info for UpdateForceFields::positions +// { +// +// float4 $Element; // Offset: 0 Size: 16 +// +// } +// +// Resource bind info for UpdateForceFields::forceFields +// { +// +// struct FlexExtForceFieldD3D +// { +// +// float mPosition[3]; // Offset: 0 +// float mRadius; // Offset: 12 +// float mStrength; // Offset: 16 +// int mMode; // Offset: 20 +// bool mLinearFalloff; // Offset: 24 +// +// } $Element; // Offset: 0 Size: 28 +// +// } +// +// Resource bind info for UpdateForceFields::velocities +// { +// +// float4 $Element; // Offset: 0 Size: 16 +// +// } +// +// +// Resource Bindings: +// +// Name Type Format Dim Slot Elements +// ------------------------------ ---------- ------- ----------- ---- -------- +// UpdateForceFields::positions texture struct r/o 0 1 +// UpdateForceFields::forceFields texture struct r/o 1 1 +// UpdateForceFields::velocities UAV struct r/w 0 1 +// consts cbuffer NA NA 0 1 +// +// +// +// Input signature: +// +// Name Index Mask Register SysValue Format Used +// -------------------- ----- ------ -------- -------- ------- ------ +// no Input +// +// Output signature: +// +// Name Index Mask Register SysValue Format Used +// -------------------- ----- ------ -------- -------- ------- ------ +// no Output +cs_5_0 +dcl_globalFlags refactoringAllowed +dcl_constantbuffer cb0[1], immediateIndexed +dcl_resource_structured t0, 16 +dcl_resource_structured t1, 28 +dcl_uav_structured u0, 16 +dcl_input vThreadID.x +dcl_temps 7 +dcl_thread_group 256, 1, 1 +ilt r0.x, vThreadID.x, cb0[0].x +ld_structured_indexable(structured_buffer, stride=16)(mixed,mixed,mixed,mixed) r1.xyzw, vThreadID.x, l(0), t0.xyzw +mul r0.y, r1.w, cb0[0].z +mov r2.w, l(0) +mov r0.z, l(0) +loop + ige r0.w, r0.z, cb0[0].y + breakc_nz r0.w + if_nz r0.x + ld_structured_indexable(structured_buffer, stride=28)(mixed,mixed,mixed,mixed) r3.xyzw, r0.z, l(0), t1.xyzw + ld_structured_indexable(structured_buffer, stride=16)(mixed,mixed,mixed,mixed) r4.xyz, vThreadID.x, l(0), u0.xyzx + add r3.xyz, r1.xyzx, -r3.xyzx + dp3 r0.w, r3.xyzx, r3.xyzx + sqrt r0.w, r0.w + ge r4.w, r0.w, r3.w + if_nz r4.w + iadd r4.w, r0.z, l(1) + mov r0.z, r4.w + continue + endif + ld_structured_indexable(structured_buffer, stride=28)(mixed,mixed,mixed,mixed) r5.xyz, r0.z, l(16), t1.xyzx + lt r4.w, l(0.000000), r0.w + div r6.xyz, r3.xyzx, r0.wwww + movc r3.xyz, r4.wwww, r6.xyzx, r3.xyzx + div r0.w, r0.w, r3.w + add r0.w, -r0.w, l(1.000000) + mul r0.w, r0.w, r5.x + movc r0.w, r5.z, r0.w, r5.x + ieq r3.w, r5.y, l(1) + movc r3.w, r3.w, r1.w, l(1.000000) + movc r3.w, r5.y, r3.w, r0.y + mul r3.xyz, r0.wwww, r3.xyzx + mad r2.xyz, r3.xyzx, r3.wwww, r4.xyzx + store_structured u0.xyzw, vThreadID.x, l(0), r2.xyzw + endif + iadd r0.z, r0.z, l(1) +endloop +ret +// Approximately 38 instruction slots used +#endif + +const BYTE g_flexExt_UpdateForceFields[] = +{ + 68, 88, 66, 67, 17, 194, + 44, 187, 165, 224, 186, 5, + 255, 188, 158, 209, 34, 42, + 4, 69, 1, 0, 0, 0, + 220, 9, 0, 0, 5, 0, + 0, 0, 52, 0, 0, 0, + 240, 4, 0, 0, 0, 5, + 0, 0, 16, 5, 0, 0, + 64, 9, 0, 0, 82, 68, + 69, 70, 180, 4, 0, 0, + 4, 0, 0, 0, 32, 1, + 0, 0, 4, 0, 0, 0, + 60, 0, 0, 0, 0, 5, + 83, 67, 0, 1, 0, 0, + 128, 4, 0, 0, 82, 68, + 49, 49, 60, 0, 0, 0, + 24, 0, 0, 0, 32, 0, + 0, 0, 40, 0, 0, 0, + 36, 0, 0, 0, 12, 0, + 0, 0, 0, 0, 0, 0, + 188, 0, 0, 0, 5, 0, + 0, 0, 6, 0, 0, 0, + 1, 0, 0, 0, 16, 0, + 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 1, 0, + 0, 0, 217, 0, 0, 0, + 5, 0, 0, 0, 6, 0, + 0, 0, 1, 0, 0, 0, + 28, 0, 0, 0, 1, 0, + 0, 0, 1, 0, 0, 0, + 1, 0, 0, 0, 248, 0, + 0, 0, 6, 0, 0, 0, + 6, 0, 0, 0, 1, 0, + 0, 0, 16, 0, 0, 0, + 0, 0, 0, 0, 1, 0, + 0, 0, 1, 0, 0, 0, + 22, 1, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 1, 0, + 0, 0, 85, 112, 100, 97, + 116, 101, 70, 111, 114, 99, + 101, 70, 105, 101, 108, 100, + 115, 58, 58, 112, 111, 115, + 105, 116, 105, 111, 110, 115, + 0, 85, 112, 100, 97, 116, + 101, 70, 111, 114, 99, 101, + 70, 105, 101, 108, 100, 115, + 58, 58, 102, 111, 114, 99, + 101, 70, 105, 101, 108, 100, + 115, 0, 85, 112, 100, 97, + 116, 101, 70, 111, 114, 99, + 101, 70, 105, 101, 108, 100, + 115, 58, 58, 118, 101, 108, + 111, 99, 105, 116, 105, 101, + 115, 0, 99, 111, 110, 115, + 116, 115, 0, 171, 171, 171, + 22, 1, 0, 0, 1, 0, + 0, 0, 128, 1, 0, 0, + 16, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 188, 0, 0, 0, 1, 0, + 0, 0, 152, 2, 0, 0, + 16, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 217, 0, 0, 0, 1, 0, + 0, 0, 244, 2, 0, 0, + 28, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 248, 0, 0, 0, 1, 0, + 0, 0, 88, 4, 0, 0, + 16, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 168, 1, 0, 0, 0, 0, + 0, 0, 16, 0, 0, 0, + 2, 0, 0, 0, 116, 2, + 0, 0, 0, 0, 0, 0, + 255, 255, 255, 255, 0, 0, + 0, 0, 255, 255, 255, 255, + 0, 0, 0, 0, 103, 80, + 97, 114, 97, 109, 115, 0, + 70, 108, 101, 120, 69, 120, + 116, 67, 111, 110, 115, 116, + 80, 97, 114, 97, 109, 115, + 0, 107, 78, 117, 109, 80, + 97, 114, 116, 105, 99, 108, + 101, 115, 0, 105, 110, 116, + 0, 171, 171, 171, 0, 0, + 2, 0, 1, 0, 1, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 209, 1, 0, 0, 107, 78, + 117, 109, 70, 111, 114, 99, + 101, 70, 105, 101, 108, 100, + 115, 0, 107, 68, 116, 0, + 102, 108, 111, 97, 116, 0, + 171, 171, 0, 0, 3, 0, + 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 16, 2, + 0, 0, 95, 112, 97, 100, + 0, 171, 171, 171, 195, 1, + 0, 0, 216, 1, 0, 0, + 0, 0, 0, 0, 252, 1, + 0, 0, 216, 1, 0, 0, + 4, 0, 0, 0, 12, 2, + 0, 0, 24, 2, 0, 0, + 8, 0, 0, 0, 60, 2, + 0, 0, 24, 2, 0, 0, + 12, 0, 0, 0, 5, 0, + 0, 0, 1, 0, 4, 0, + 0, 0, 4, 0, 68, 2, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 176, 1, 0, 0, 192, 2, + 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 2, 0, + 0, 0, 208, 2, 0, 0, + 0, 0, 0, 0, 255, 255, + 255, 255, 0, 0, 0, 0, + 255, 255, 255, 255, 0, 0, + 0, 0, 36, 69, 108, 101, + 109, 101, 110, 116, 0, 102, + 108, 111, 97, 116, 52, 0, + 1, 0, 3, 0, 1, 0, + 4, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 201, 2, 0, 0, + 192, 2, 0, 0, 0, 0, + 0, 0, 28, 0, 0, 0, + 2, 0, 0, 0, 52, 4, + 0, 0, 0, 0, 0, 0, + 255, 255, 255, 255, 0, 0, + 0, 0, 255, 255, 255, 255, + 0, 0, 0, 0, 70, 108, + 101, 120, 69, 120, 116, 70, + 111, 114, 99, 101, 70, 105, + 101, 108, 100, 68, 51, 68, + 0, 109, 80, 111, 115, 105, + 116, 105, 111, 110, 0, 171, + 0, 0, 3, 0, 1, 0, + 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 16, 2, 0, 0, + 109, 82, 97, 100, 105, 117, + 115, 0, 0, 0, 3, 0, + 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 16, 2, + 0, 0, 109, 83, 116, 114, + 101, 110, 103, 116, 104, 0, + 109, 77, 111, 100, 101, 0, + 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 209, 1, 0, 0, + 109, 76, 105, 110, 101, 97, + 114, 70, 97, 108, 108, 111, + 102, 102, 0, 98, 111, 111, + 108, 0, 0, 0, 1, 0, + 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 207, 3, + 0, 0, 49, 3, 0, 0, + 60, 3, 0, 0, 0, 0, + 0, 0, 96, 3, 0, 0, + 104, 3, 0, 0, 12, 0, + 0, 0, 140, 3, 0, 0, + 104, 3, 0, 0, 16, 0, + 0, 0, 150, 3, 0, 0, + 156, 3, 0, 0, 20, 0, + 0, 0, 192, 3, 0, 0, + 212, 3, 0, 0, 24, 0, + 0, 0, 5, 0, 0, 0, + 1, 0, 7, 0, 0, 0, + 5, 0, 248, 3, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 28, 3, + 0, 0, 192, 2, 0, 0, + 0, 0, 0, 0, 16, 0, + 0, 0, 2, 0, 0, 0, + 208, 2, 0, 0, 0, 0, + 0, 0, 255, 255, 255, 255, + 0, 0, 0, 0, 255, 255, + 255, 255, 0, 0, 0, 0, + 77, 105, 99, 114, 111, 115, + 111, 102, 116, 32, 40, 82, + 41, 32, 72, 76, 83, 76, + 32, 83, 104, 97, 100, 101, + 114, 32, 67, 111, 109, 112, + 105, 108, 101, 114, 32, 54, + 46, 51, 46, 57, 54, 48, + 48, 46, 49, 54, 51, 56, + 52, 0, 171, 171, 73, 83, + 71, 78, 8, 0, 0, 0, + 0, 0, 0, 0, 8, 0, + 0, 0, 79, 83, 71, 78, + 8, 0, 0, 0, 0, 0, + 0, 0, 8, 0, 0, 0, + 83, 72, 69, 88, 40, 4, + 0, 0, 80, 0, 5, 0, + 10, 1, 0, 0, 106, 8, + 0, 1, 89, 0, 0, 4, + 70, 142, 32, 0, 0, 0, + 0, 0, 1, 0, 0, 0, + 162, 0, 0, 4, 0, 112, + 16, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 162, 0, + 0, 4, 0, 112, 16, 0, + 1, 0, 0, 0, 28, 0, + 0, 0, 158, 0, 0, 4, + 0, 224, 17, 0, 0, 0, + 0, 0, 16, 0, 0, 0, + 95, 0, 0, 2, 18, 0, + 2, 0, 104, 0, 0, 2, + 7, 0, 0, 0, 155, 0, + 0, 4, 0, 1, 0, 0, + 1, 0, 0, 0, 1, 0, + 0, 0, 34, 0, 0, 7, + 18, 0, 16, 0, 0, 0, + 0, 0, 10, 0, 2, 0, + 10, 128, 32, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 167, 0, 0, 138, 2, 131, + 0, 128, 131, 153, 25, 0, + 242, 0, 16, 0, 1, 0, + 0, 0, 10, 0, 2, 0, + 1, 64, 0, 0, 0, 0, + 0, 0, 70, 126, 16, 0, + 0, 0, 0, 0, 56, 0, + 0, 8, 34, 0, 16, 0, + 0, 0, 0, 0, 58, 0, + 16, 0, 1, 0, 0, 0, + 42, 128, 32, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 54, 0, 0, 5, 130, 0, + 16, 0, 2, 0, 0, 0, + 1, 64, 0, 0, 0, 0, + 0, 0, 54, 0, 0, 5, + 66, 0, 16, 0, 0, 0, + 0, 0, 1, 64, 0, 0, + 0, 0, 0, 0, 48, 0, + 0, 1, 33, 0, 0, 8, + 130, 0, 16, 0, 0, 0, + 0, 0, 42, 0, 16, 0, + 0, 0, 0, 0, 26, 128, + 32, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, + 4, 3, 58, 0, 16, 0, + 0, 0, 0, 0, 31, 0, + 4, 3, 10, 0, 16, 0, + 0, 0, 0, 0, 167, 0, + 0, 139, 2, 227, 0, 128, + 131, 153, 25, 0, 242, 0, + 16, 0, 3, 0, 0, 0, + 42, 0, 16, 0, 0, 0, + 0, 0, 1, 64, 0, 0, + 0, 0, 0, 0, 70, 126, + 16, 0, 1, 0, 0, 0, + 167, 0, 0, 138, 2, 131, + 0, 128, 131, 153, 25, 0, + 114, 0, 16, 0, 4, 0, + 0, 0, 10, 0, 2, 0, + 1, 64, 0, 0, 0, 0, + 0, 0, 70, 226, 17, 0, + 0, 0, 0, 0, 0, 0, + 0, 8, 114, 0, 16, 0, + 3, 0, 0, 0, 70, 2, + 16, 0, 1, 0, 0, 0, + 70, 2, 16, 128, 65, 0, + 0, 0, 3, 0, 0, 0, + 16, 0, 0, 7, 130, 0, + 16, 0, 0, 0, 0, 0, + 70, 2, 16, 0, 3, 0, + 0, 0, 70, 2, 16, 0, + 3, 0, 0, 0, 75, 0, + 0, 5, 130, 0, 16, 0, + 0, 0, 0, 0, 58, 0, + 16, 0, 0, 0, 0, 0, + 29, 0, 0, 7, 130, 0, + 16, 0, 4, 0, 0, 0, + 58, 0, 16, 0, 0, 0, + 0, 0, 58, 0, 16, 0, + 3, 0, 0, 0, 31, 0, + 4, 3, 58, 0, 16, 0, + 4, 0, 0, 0, 30, 0, + 0, 7, 130, 0, 16, 0, + 4, 0, 0, 0, 42, 0, + 16, 0, 0, 0, 0, 0, + 1, 64, 0, 0, 1, 0, + 0, 0, 54, 0, 0, 5, + 66, 0, 16, 0, 0, 0, + 0, 0, 58, 0, 16, 0, + 4, 0, 0, 0, 7, 0, + 0, 1, 21, 0, 0, 1, + 167, 0, 0, 139, 2, 227, + 0, 128, 131, 153, 25, 0, + 114, 0, 16, 0, 5, 0, + 0, 0, 42, 0, 16, 0, + 0, 0, 0, 0, 1, 64, + 0, 0, 16, 0, 0, 0, + 70, 114, 16, 0, 1, 0, + 0, 0, 49, 0, 0, 7, + 130, 0, 16, 0, 4, 0, + 0, 0, 1, 64, 0, 0, + 0, 0, 0, 0, 58, 0, + 16, 0, 0, 0, 0, 0, + 14, 0, 0, 7, 114, 0, + 16, 0, 6, 0, 0, 0, + 70, 2, 16, 0, 3, 0, + 0, 0, 246, 15, 16, 0, + 0, 0, 0, 0, 55, 0, + 0, 9, 114, 0, 16, 0, + 3, 0, 0, 0, 246, 15, + 16, 0, 4, 0, 0, 0, + 70, 2, 16, 0, 6, 0, + 0, 0, 70, 2, 16, 0, + 3, 0, 0, 0, 14, 0, + 0, 7, 130, 0, 16, 0, + 0, 0, 0, 0, 58, 0, + 16, 0, 0, 0, 0, 0, + 58, 0, 16, 0, 3, 0, + 0, 0, 0, 0, 0, 8, + 130, 0, 16, 0, 0, 0, + 0, 0, 58, 0, 16, 128, + 65, 0, 0, 0, 0, 0, + 0, 0, 1, 64, 0, 0, + 0, 0, 128, 63, 56, 0, + 0, 7, 130, 0, 16, 0, + 0, 0, 0, 0, 58, 0, + 16, 0, 0, 0, 0, 0, + 10, 0, 16, 0, 5, 0, + 0, 0, 55, 0, 0, 9, + 130, 0, 16, 0, 0, 0, + 0, 0, 42, 0, 16, 0, + 5, 0, 0, 0, 58, 0, + 16, 0, 0, 0, 0, 0, + 10, 0, 16, 0, 5, 0, + 0, 0, 32, 0, 0, 7, + 130, 0, 16, 0, 3, 0, + 0, 0, 26, 0, 16, 0, + 5, 0, 0, 0, 1, 64, + 0, 0, 1, 0, 0, 0, + 55, 0, 0, 9, 130, 0, + 16, 0, 3, 0, 0, 0, + 58, 0, 16, 0, 3, 0, + 0, 0, 58, 0, 16, 0, + 1, 0, 0, 0, 1, 64, + 0, 0, 0, 0, 128, 63, + 55, 0, 0, 9, 130, 0, + 16, 0, 3, 0, 0, 0, + 26, 0, 16, 0, 5, 0, + 0, 0, 58, 0, 16, 0, + 3, 0, 0, 0, 26, 0, + 16, 0, 0, 0, 0, 0, + 56, 0, 0, 7, 114, 0, + 16, 0, 3, 0, 0, 0, + 246, 15, 16, 0, 0, 0, + 0, 0, 70, 2, 16, 0, + 3, 0, 0, 0, 50, 0, + 0, 9, 114, 0, 16, 0, + 2, 0, 0, 0, 70, 2, + 16, 0, 3, 0, 0, 0, + 246, 15, 16, 0, 3, 0, + 0, 0, 70, 2, 16, 0, + 4, 0, 0, 0, 168, 0, + 0, 8, 242, 224, 17, 0, + 0, 0, 0, 0, 10, 0, + 2, 0, 1, 64, 0, 0, + 0, 0, 0, 0, 70, 14, + 16, 0, 2, 0, 0, 0, + 21, 0, 0, 1, 30, 0, + 0, 7, 66, 0, 16, 0, + 0, 0, 0, 0, 42, 0, + 16, 0, 0, 0, 0, 0, + 1, 64, 0, 0, 1, 0, + 0, 0, 22, 0, 0, 1, + 62, 0, 0, 1, 83, 84, + 65, 84, 148, 0, 0, 0, + 38, 0, 0, 0, 7, 0, + 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 12, 0, + 0, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 2, 0, + 0, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, + 0, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0 +}; diff --git a/extensions/dx/shaders/flexExt.UpdateForceFields.hlsl b/extensions/dx/shaders/flexExt.UpdateForceFields.hlsl new file mode 100644 index 0000000..b38c84e --- /dev/null +++ b/extensions/dx/shaders/flexExt.UpdateForceFields.hlsl @@ -0,0 +1,28 @@ +// 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) 20132017 NVIDIA Corporation. All rights reserved. + +#include "../flexExt.hlsl" diff --git a/extensions/flexExtCloth.cpp b/extensions/flexExtCloth.cpp new file mode 100644 index 0000000..096299f --- /dev/null +++ b/extensions/flexExtCloth.cpp @@ -0,0 +1,343 @@ +// 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) 2013-2017 NVIDIA Corporation. All rights reserved. + +#include "../include/NvFlexExt.h" + +#include "../core/cloth.h" + +namespace +{ + struct Key + { + Key(int i, float d) : index(i), depth(d) {} + + int index; + float depth; + + bool operator < (const Key& rhs) const { return depth < rhs.depth; } + }; +} + +int NvFlexExtCreateWeldedMeshIndices(const float* vertices, int numVertices, int* uniqueIndices, int* originalToUniqueMap, float threshold) +{ + memset(originalToUniqueMap, -1, numVertices*sizeof(int)); + + const Vec3* positions = (const Vec3*)vertices; + + // use a sweep and prune style search to accelerate neighbor finding + std::vector<Key> keys; + for (int i=0; i < numVertices; i++) + keys.push_back(Key(i, positions[i].z)); + + std::sort(keys.begin(), keys.end()); + + int uniqueCount = 0; + + // sweep keys to find matching verts + for (int i=0; i < numVertices; ++i) + { + // we are a duplicate, skip + if (originalToUniqueMap[keys[i].index] != -1) + continue; + + // scan forward until no vertex can be closer than threshold + for (int j=i+1; j < numVertices && (keys[j].depth-keys[i].depth) <= threshold; ++j) + { + float distance = Length(Vector3(positions[keys[i].index])-Vector3(positions[keys[j].index])); + + if (distance <= threshold) + originalToUniqueMap[keys[j].index] = uniqueCount; + } + + originalToUniqueMap[keys[i].index] = uniqueCount; + + uniqueIndices[uniqueCount++] = keys[i].index; + } + + return uniqueCount; +} + +NvFlexExtAsset* NvFlexExtCreateClothFromMesh(const float* particles, int numVertices, const int* indices, int numTriangles, float stretchStiffness, float bendStiffness, float tetherStiffness, float tetherGive, float pressure) +{ + NvFlexExtAsset* asset = new NvFlexExtAsset(); + memset(asset, 0, sizeof(*asset)); + + asset->particles = new float[numVertices*4]; + memcpy(asset->particles, particles, numVertices*sizeof(float)*4); + + asset->triangleIndices = new int[numTriangles*3]; + memcpy(asset->triangleIndices, indices, numTriangles*3*sizeof(int)); + + asset->numParticles = numVertices; + asset->maxParticles = numVertices; + + asset->numTriangles = numTriangles; + + // create cloth mesh + ClothMesh cloth((Vec4*)particles, numVertices, indices, numTriangles*3, stretchStiffness, bendStiffness, true); + + if (cloth.mValid) + { + // create tethers + if (tetherStiffness > 0.0f) + { + std::vector<int> anchors; + anchors.reserve(numVertices); + + // find anchors + for (int i=0; i < numVertices; ++i) + { + Vec4& particle = ((Vec4*)particles)[i]; + + if (particle.w == 0.0f) + anchors.push_back(i); + } + + if (anchors.size()) + { + // create tethers + for (int i=0; i < numVertices; ++i) + { + Vec4& particle = ((Vec4*)particles)[i]; + if (particle.w == 0.0f) + continue; + + float minSqrDist = FLT_MAX; + int minIndex = -1; + + // find the closest attachment point + for (int a=0; a < int(anchors.size()); ++a) + { + Vec4& attachment = ((Vec4*)particles)[anchors[a]]; + + float distSqr = LengthSq(Vec3(particle)-Vec3(attachment)); + if (distSqr < minSqrDist) + { + minSqrDist = distSqr; + minIndex = anchors[a]; + } + } + + // add a tether + if (minIndex != -1) + { + cloth.mConstraintIndices.push_back(i); + cloth.mConstraintIndices.push_back(minIndex); + cloth.mConstraintRestLengths.push_back(sqrtf(minSqrDist)*(1.0f + tetherGive)); + + // negative stiffness indicates tether (unilateral constraint) + cloth.mConstraintCoefficients.push_back(-tetherStiffness); + } + } + } + } + + const int numSprings = int(cloth.mConstraintCoefficients.size()); + + asset->springIndices = new int[numSprings*2]; + asset->springCoefficients = new float[numSprings]; + asset->springRestLengths = new float[numSprings]; + asset->numSprings = numSprings; + + for (int i=0; i < numSprings; ++i) + { + asset->springIndices[i*2+0] = cloth.mConstraintIndices[i*2+0]; + asset->springIndices[i*2+1] = cloth.mConstraintIndices[i*2+1]; + asset->springRestLengths[i] = cloth.mConstraintRestLengths[i]; + asset->springCoefficients[i] = cloth.mConstraintCoefficients[i]; + } + + if (pressure > 0.0f) + { + asset->inflatable = true; + asset->inflatableVolume = cloth.mRestVolume; + asset->inflatableStiffness = cloth.mConstraintScale; + asset->inflatablePressure = pressure; + } + } + else + { + NvFlexExtDestroyAsset(asset); + return NULL; + } + + return asset; +} + +struct FlexExtTearingClothAsset : public NvFlexExtAsset +{ + ClothMesh* mMesh; +}; + +NvFlexExtAsset* NvFlexExtCreateTearingClothFromMesh(const float* particles, int numParticles, int maxParticles, const int* indices, int numTriangles, float stretchStiffness, float bendStiffness, float pressure) +{ + FlexExtTearingClothAsset* asset = new FlexExtTearingClothAsset(); + memset(asset, 0, sizeof(*asset)); + + asset->particles = new float[maxParticles*4]; + memcpy(asset->particles, particles, numParticles*sizeof(float)*4); + + asset->triangleIndices = new int[numTriangles*3]; + memcpy(asset->triangleIndices, indices, numTriangles*3*sizeof(int)); + + asset->numParticles = numParticles; + asset->maxParticles = maxParticles; + + asset->numTriangles = numTriangles; + + // create and store cloth mesh + asset->mMesh = new ClothMesh((Vec4*)particles, numParticles, indices, numTriangles*3, stretchStiffness, bendStiffness, true); + + ClothMesh& cloth = *asset->mMesh; + + if (cloth.mValid) + { + const int numSprings = int(cloth.mConstraintCoefficients.size()); + + // asset references cloth mesh memory directly + asset->springIndices = &cloth.mConstraintIndices[0]; + asset->springCoefficients = &cloth.mConstraintCoefficients[0]; + asset->springRestLengths = &cloth.mConstraintRestLengths[0]; + asset->numSprings = numSprings; + + if (pressure > 0.0f) + { + asset->inflatable = true; + asset->inflatableVolume = cloth.mRestVolume; + asset->inflatableStiffness = cloth.mConstraintScale; + asset->inflatablePressure = pressure; + } + } + else + { + NvFlexExtDestroyAsset(asset); + return NULL; + } + + return asset; + +} + +void NvFlexExtDestroyTearingCloth(NvFlexExtAsset* asset) +{ + FlexExtTearingClothAsset* tearable = (FlexExtTearingClothAsset*)asset; + + delete[] asset->particles; + delete[] asset->triangleIndices; + + delete tearable->mMesh; + delete tearable; +} + +void NvFlexExtTearClothMesh(NvFlexExtAsset* asset, float maxStrain, int maxSplits, NvFlexExtTearingParticleClone* particleCopies, int* numParticleCopies, int maxCopies, NvFlexExtTearingMeshEdit* triangleEdits, int* numTriangleEdits, int maxEdits) +{ + FlexExtTearingClothAsset* tearable = (FlexExtTearingClothAsset*)asset; + + std::vector<ClothMesh::TriangleUpdate> edits; + std::vector<ClothMesh::VertexCopy> copies; + + int splits = 0; + + maxCopies = Min(maxCopies, tearable->maxParticles-tearable->numParticles); + + // iterate over all edges and tear if beyond maximum strain + for (int i=0; i < tearable->numSprings && int(copies.size()) < maxCopies && splits < maxSplits; ++i) + { + int a = tearable->springIndices[i*2+0]; + int b = tearable->springIndices[i*2+1]; + + Vec3 p = Vec3(&tearable->particles[a*4]); + Vec3 q = Vec3(&tearable->particles[b*4]); + + // check strain and break if greater than max threshold + if (Length(p-q) > tearable->springRestLengths[i]*maxStrain) + { + // skip fixed particles + if (Vec4(&tearable->particles[a*4]).w == 0.0f) + continue; + + if (Vec4(&tearable->particles[b*4]).w == 0.0f) + continue; + + // choose vertex of edge to split + const int splitIndex = Randf() > 0.5f ? a : b; + const Vec3 splitPlane = Normalize(p-q); // todo: use plane perpendicular to normal and edge.. + + std::vector<int> adjacentTriangles; + std::vector<int> adjacentVertices; + + const int newIndex = tearable->mMesh->SplitVertex((Vec4*)tearable->particles, splitIndex, splitPlane, adjacentTriangles, adjacentVertices, edits, copies, maxCopies-int(copies.size())); + + if (newIndex != -1) + { + ++splits; + + // separate each adjacent vertex if it is now singular + for (int s=0; s < int(adjacentVertices.size()); ++s) + { + const int adjacentVertex = adjacentVertices[s]; + + tearable->mMesh->SeparateVertex(adjacentVertex, edits, copies, maxCopies-int(copies.size())); + } + + // also test the new vertex which can become singular + tearable->mMesh->SeparateVertex(newIndex, edits, copies, maxCopies-int(copies.size())); + } + } + } + + // update asset particle count + tearable->numParticles = tearable->mMesh->mNumVertices; + + // output copies + for (int c=0; c < int(copies.size()); ++c) + { + NvFlexExtTearingParticleClone clone; + clone.srcIndex = copies[c].srcIndex; + clone.destIndex = copies[c].destIndex; + + particleCopies[c] = clone; + } + + // output mesh edits, note that some edits will not be reported if edit buffer is not big enough + const int numEdits = Min(int(edits.size()), maxEdits); + + for (int u=0; u < numEdits; ++u) + { + NvFlexExtTearingMeshEdit update; + update.triIndex = edits[u].triangle; + update.newParticleIndex = edits[u].vertex; + + tearable->triangleIndices[update.triIndex] = update.newParticleIndex; + + triangleEdits[u] = update; + } + + + *numTriangleEdits = numEdits; + *numParticleCopies = int(copies.size()); +} diff --git a/extensions/flexExtContainer.cpp b/extensions/flexExtContainer.cpp new file mode 100644 index 0000000..92cb958 --- /dev/null +++ b/extensions/flexExtContainer.cpp @@ -0,0 +1,807 @@ +// 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) 2013-2017 NVIDIA Corporation. All rights reserved. + +#include <vector> +#include <limits> +#include <algorithm> + +#include "../core/core.h" +#include "../core/maths.h" + +#include "../include/NvFlex.h" +#include "../include/NvFlexExt.h" + +class Bitmap +{ +public: + + typedef unsigned int Word; + + static const int kWordSize = sizeof(Word)*8; + + Bitmap(int numBits) : mBits((numBits+kWordSize-1)/kWordSize) + { + } + + inline void Set(int bit) + { + const int wordIndex = bit/kWordSize; + const int bitIndex = bit&(kWordSize-1); + + const Word word = mBits[wordIndex]; + + mBits[wordIndex] = word|(1<<bitIndex); + } + + inline void Reset(int bit) + { + const int wordIndex = bit/kWordSize; + const int bitIndex = bit&(kWordSize-1); + + const Word word = mBits[wordIndex]; + + mBits[wordIndex] = word&~(1<<bitIndex); + } + + inline bool IsSet(int bit) + { + const int wordIndex = bit/kWordSize; + const int bitIndex = bit&(kWordSize-1); + + const Word word = mBits[wordIndex]; + + return (word & (1<<bitIndex)) != 0; + } + +private: + + std::vector<Word> mBits; +}; + + +struct NvFlexExtContainer +{ + int mMaxParticles; + + NvFlexSolver* mSolver; + NvFlexLibrary* mFlexLib; + + // first n indices + NvFlexVector<int> mActiveList; + + std::vector<int> mFreeList; + std::vector<NvFlexExtInstance*> mInstances; + + // particles + NvFlexVector<Vec4> mParticles; + NvFlexVector<Vec4> mParticlesRest; + NvFlexVector<Vec3> mVelocities; + NvFlexVector<int> mPhases; + NvFlexVector<Vec4> mNormals; + + // shapes + NvFlexVector<int> mShapeOffsets; + NvFlexVector<int> mShapeIndices; + NvFlexVector<float> mShapeCoefficients; + NvFlexVector<Quat> mShapeRotations; + NvFlexVector<Vec3> mShapeTranslations; + NvFlexVector<Vec3> mShapeRestPositions; + + // springs + NvFlexVector<int> mSpringIndices; + NvFlexVector<float> mSpringLengths; + NvFlexVector<float> mSpringCoefficients; + + // cloth + NvFlexVector<int> mTriangleIndices; + NvFlexVector<Vec3> mTriangleNormals; + + NvFlexVector<int> mInflatableStarts; + NvFlexVector<int> mInflatableCounts; + NvFlexVector<float> mInflatableRestVolumes; + NvFlexVector<float> mInflatableCoefficients; + NvFlexVector<float> mInflatableOverPressures; + + // bounds (CPU), stored in a vector to ensure transfers can happen asynchronously + NvFlexVector<Vec3> mBoundsLower; + NvFlexVector<Vec3> mBoundsUpper; + + // needs compact + bool mNeedsCompact; + // needs to update active list + bool mNeedsActiveListRebuild; + + NvFlexExtContainer(NvFlexLibrary* l) : + mMaxParticles(0), mSolver(NULL), mFlexLib(l), + mActiveList(l),mParticles(l),mParticlesRest(l),mVelocities(l), + mPhases(l),mNormals(l),mShapeOffsets(l),mShapeIndices(l), + mShapeCoefficients(l),mShapeRotations(l),mShapeTranslations(l), + mShapeRestPositions(l),mSpringIndices(l),mSpringLengths(l), + mSpringCoefficients(l),mTriangleIndices(l),mTriangleNormals(l), + mInflatableStarts(l),mInflatableCounts(l),mInflatableRestVolumes(l), + mInflatableCoefficients(l),mInflatableOverPressures(l), mBoundsLower(l), mBoundsUpper(l), + mNeedsCompact(false), mNeedsActiveListRebuild(false) + {} +}; + + + +namespace +{ + +// compacts all constraints into linear arrays +void CompactObjects(NvFlexExtContainer* c) +{ + int totalNumSprings = 0; + int totalNumTris = 0; + int totalNumShapes = 0; + int totalNumShapeIndices = 0; + + // pre-calculate array sizes + for (size_t i = 0; i < c->mInstances.size(); ++i) + { + NvFlexExtInstance* inst = c->mInstances[i]; + + const NvFlexExtAsset* asset = inst->asset; + + // index into the triangle array for this instance + inst->triangleIndex = totalNumTris; + + totalNumSprings += asset->numSprings; + totalNumTris += asset->numTriangles; + + totalNumShapeIndices += asset->numShapeIndices; + totalNumShapes += asset->numShapes; + } + + //---------------------- + // map buffers + + // springs + c->mSpringIndices.map(); + c->mSpringLengths.map(); + c->mSpringCoefficients.map(); + + // cloth + c->mTriangleIndices.map(); + c->mTriangleNormals.map(); + + // inflatables + c->mInflatableStarts.map(); + c->mInflatableCounts.map(); + c->mInflatableRestVolumes.map(); + c->mInflatableCoefficients.map(); + c->mInflatableOverPressures.map(); + + // shapes + c->mShapeIndices.map(); + c->mShapeRestPositions.map(); + c->mShapeOffsets.map(); + c->mShapeCoefficients.map(); + + c->mShapeTranslations.map(); + c->mShapeRotations.map(); + + //---------------------- + // resize buffers + + // springs + c->mSpringIndices.resize(totalNumSprings * 2); + c->mSpringLengths.resize(totalNumSprings); + c->mSpringCoefficients.resize(totalNumSprings); + + // cloth + c->mTriangleIndices.resize(totalNumTris * 3); + c->mTriangleNormals.resize(totalNumTris); + + // inflatables + c->mInflatableStarts.resize(0); + c->mInflatableCounts.resize(0); + c->mInflatableRestVolumes.resize(0); + c->mInflatableCoefficients.resize(0); + c->mInflatableOverPressures.resize(0); + + // shapes + c->mShapeIndices.resize(totalNumShapeIndices); + c->mShapeRestPositions.resize(totalNumShapeIndices); + c->mShapeOffsets.resize(1 + totalNumShapes); + c->mShapeCoefficients.resize(totalNumShapes); + + c->mShapeTranslations.resize(totalNumShapes); + c->mShapeRotations.resize(totalNumShapes); + + int* __restrict dstSpringIndices = (totalNumSprings) ? &c->mSpringIndices[0] : NULL; + float* __restrict dstSpringLengths = (totalNumSprings) ? &c->mSpringLengths[0] : NULL; + float* __restrict dstSpringCoefficients = (totalNumSprings) ? &c->mSpringCoefficients[0] : NULL; + + int* __restrict dstTriangleIndices = (totalNumTris) ? &c->mTriangleIndices[0] : NULL; + + int* __restrict dstShapeIndices = (totalNumShapeIndices) ? &c->mShapeIndices[0] : NULL; + Vec3* __restrict dstShapeRestPositions = (totalNumShapeIndices) ? &c->mShapeRestPositions[0] : NULL; + int* __restrict dstShapeOffsets = (totalNumShapes) ? &c->mShapeOffsets[0] : NULL; + float* __restrict dstShapeCoefficients = (totalNumShapes) ? &c->mShapeCoefficients[0] : NULL; + Vec3* __restrict dstShapeTranslations = (totalNumShapes) ? &c->mShapeTranslations[0] : NULL; + Quat* __restrict dstShapeRotations = (totalNumShapes) ? &c->mShapeRotations[0] : NULL; + + // push leading zero if necessary + if (totalNumShapes != 0) + { + *dstShapeOffsets = 0; + ++dstShapeOffsets; + } + + int shapeIndexOffset = 0; + int shapeIndex = 0; + + // go through each instance and update springs, shapes, etc + for (size_t i = 0; i < c->mInstances.size(); ++i) + { + NvFlexExtInstance* inst = c->mInstances[i]; + + const NvFlexExtAsset* asset = inst->asset; + + // map indices from the asset to the instance + const int* __restrict remap = &inst->particleIndices[0]; + + // flatten spring data + int numSprings = asset->numSprings; + const int numSpringIndices = asset->numSprings * 2; + const int* __restrict srcSpringIndices = asset->springIndices; + + for (int i = 0; i < numSpringIndices; ++i) + { + *dstSpringIndices = remap[*srcSpringIndices]; + + ++dstSpringIndices; + ++srcSpringIndices; + } + + memcpy(dstSpringLengths, asset->springRestLengths, numSprings*sizeof(float)); + memcpy(dstSpringCoefficients, asset->springCoefficients, numSprings*sizeof(float)); + + dstSpringLengths += numSprings; + dstSpringCoefficients += numSprings; + + // shapes + if (asset->numShapes) + { + const int indexOffset = shapeIndexOffset; + + // store start index into shape array + inst->shapeIndex = shapeIndex; + + int shapeStart = 0; + + for (int s=0; s < asset->numShapes; ++s) + { + dstShapeOffsets[shapeIndex] = asset->shapeOffsets[s] + indexOffset; + dstShapeCoefficients[shapeIndex] = asset->shapeCoefficients[s]; + dstShapeTranslations[shapeIndex] = Vec3(&inst->shapeTranslations[s*3]); + dstShapeRotations[shapeIndex] = Quat(&inst->shapeRotations[s*4]); + + ++shapeIndex; + + const int shapeEnd = asset->shapeOffsets[s]; + + for (int i=shapeStart; i < shapeEnd; ++i) + { + const int firstParticle = asset->shapeIndices[0]; + const int currentParticle = asset->shapeIndices[i]; + + // remap indices and create local space positions for each shape + // To make this calculation more robust, subtract the position of the first particle from both, the positions of the current + // particle and the shapeCenter. Without this one would subtract two very similar floating point values, which can lead to ghost forces. + dstShapeRestPositions[shapeIndexOffset] = (Vec3(&asset->particles[currentParticle*4]) - Vec3(&asset->particles[firstParticle])) + - (Vec3(&asset->shapeCenters[s*3]) - Vec3(&asset->particles[firstParticle])); + + dstShapeIndices[shapeIndexOffset] = remap[asset->shapeIndices[i]]; + + ++shapeIndexOffset; + } + + shapeStart = shapeEnd; + } + } + + if (asset->numTriangles) + { + // triangles + const int numTriIndices = asset->numTriangles * 3; + const int* __restrict srcTriIndices = asset->triangleIndices; + + for (int i = 0; i < numTriIndices; ++i) + { + *dstTriangleIndices = remap[*srcTriIndices]; + + ++dstTriangleIndices; + ++srcTriIndices; + } + + if (asset->inflatable) + { + c->mInflatableStarts.push_back(inst->triangleIndex); + c->mInflatableCounts.push_back(asset->numTriangles); + c->mInflatableRestVolumes.push_back(asset->inflatableVolume); + c->mInflatableCoefficients.push_back(asset->inflatableStiffness); + c->mInflatableOverPressures.push_back(asset->inflatablePressure); + } + } + } + + + //---------------------- + // unmap buffers + + // springs + c->mSpringIndices.unmap(); + c->mSpringLengths.unmap(); + c->mSpringCoefficients.unmap(); + + // cloth + c->mTriangleIndices.unmap(); + c->mTriangleNormals.unmap(); + + // inflatables + c->mInflatableStarts.unmap(); + c->mInflatableCounts.unmap(); + c->mInflatableRestVolumes.unmap(); + c->mInflatableCoefficients.unmap(); + c->mInflatableOverPressures.unmap(); + + // shapes + c->mShapeIndices.unmap(); + c->mShapeRestPositions.unmap(); + c->mShapeOffsets.unmap(); + c->mShapeCoefficients.unmap(); + + c->mShapeTranslations.unmap(); + c->mShapeRotations.unmap(); + + // ---------------------- + // Flex update + + // springs + if (c->mSpringLengths.size()) + NvFlexSetSprings(c->mSolver, c->mSpringIndices.buffer, c->mSpringLengths.buffer, c->mSpringCoefficients.buffer, int(c->mSpringLengths.size())); + else + NvFlexSetSprings(c->mSolver, NULL, NULL, NULL, 0); + + // shapes + if (c->mShapeCoefficients.size()) + { + NvFlexSetRigids(c->mSolver, c->mShapeOffsets.buffer, c->mShapeIndices.buffer, c->mShapeRestPositions.buffer, NULL, c->mShapeCoefficients.buffer, c->mShapeRotations.buffer, c->mShapeTranslations.buffer, int(c->mShapeCoefficients.size()), c->mShapeIndices.size()); + } + else + { + c->mShapeRotations.resize(0); + c->mShapeTranslations.resize(0); + + NvFlexSetRigids(c->mSolver, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0); + } + + // triangles + if (c->mTriangleIndices.size()) + NvFlexSetDynamicTriangles(c->mSolver, c->mTriangleIndices.buffer, NULL, int(c->mTriangleIndices.size()/3)); + else + NvFlexSetDynamicTriangles(c->mSolver, NULL, NULL, 0); + + // inflatables + if (c->mInflatableCounts.size()) + NvFlexSetInflatables(c->mSolver, c->mInflatableStarts.buffer, c->mInflatableCounts.buffer, c->mInflatableRestVolumes.buffer, c->mInflatableOverPressures.buffer, c->mInflatableCoefficients.buffer, int(c->mInflatableCounts.size())); + else + NvFlexSetInflatables(c->mSolver, NULL, NULL, NULL, NULL, NULL, 0); + + c->mNeedsCompact = false; + +} + +} // anonymous namespace + + +NvFlexExtContainer* NvFlexExtCreateContainer(NvFlexLibrary* flexLib, NvFlexSolver* solver, int maxParticles) +{ + NvFlexExtContainer* c = new NvFlexExtContainer(flexLib); + + c->mSolver = solver; + c->mFlexLib = flexLib; + c->mMaxParticles = maxParticles; + + // initialize free list + c->mFreeList.resize(maxParticles); + for (int i=0; i < maxParticles; ++i) + c->mFreeList[i] = i; + + c->mActiveList.init(maxParticles); + c->mParticles.init(maxParticles); + c->mParticlesRest.init(maxParticles); + c->mVelocities.init(maxParticles); + c->mPhases.init(maxParticles); + c->mNormals.init(maxParticles); + + + // ensure we have the corerct CUDA context set + NvFlexAcquireContext(flexLib); + + c->mBoundsLower.init(1); + c->mBoundsUpper.init(1); + + NvFlexRestoreContext(flexLib); + + c->mNeedsCompact = false; + + return c; +} + +void NvFlexExtDestroyContainer(NvFlexExtContainer* c) +{ + // ensure we have the corerct CUDA context set + NvFlexLibrary* lib = c->mFlexLib; + + NvFlexAcquireContext(lib); + + delete c; + + NvFlexRestoreContext(lib); + +} + +int NvFlexExtAllocParticles(NvFlexExtContainer* c, int n, int* indices) +{ + const int numToAlloc = Min(int(c->mFreeList.size()), n); + const int start = int(c->mFreeList.size())-numToAlloc; + + if (numToAlloc) + { + memcpy(indices, &c->mFreeList[start], numToAlloc*sizeof(int)); + c->mFreeList.resize(start); + } + + c->mNeedsActiveListRebuild = true; + + return numToAlloc; +} + +void NvFlexExtFreeParticles(NvFlexExtContainer* c, int n, const int* indices) +{ +#if _DEBUG + for (int i=0; i < n; ++i) + { + // check valid values + assert(indices[i] >= 0 && indices[i] < int(c->mFreeList.capacity())); + + // check for double delete + assert(std::find(c->mFreeList.begin(), c->mFreeList.end(), indices[i]) == c->mFreeList.end()); + } +#endif + + c->mFreeList.insert(c->mFreeList.end(), indices, indices+n); + + c->mNeedsActiveListRebuild = true; +} + +int NvFlexExtGetActiveList(NvFlexExtContainer* c, int* indices) +{ + int count = 0; + + Bitmap inactive(c->mMaxParticles); + + // create bitmap + for (size_t i=0; i < c->mFreeList.size(); ++i) + { + // if this fires then somehow a duplicate has ended up in the free list (double delete) + assert(!inactive.IsSet(c->mFreeList[i])); + + inactive.Set(c->mFreeList[i]); + } + + // iterate bitmap to find active elements + for (int i=0; i < c->mMaxParticles; ++i) + if (inactive.IsSet(i) == false) + indices[count++] = i; + + return count; +} + +NvFlexExtParticleData NvFlexExtMapParticleData(NvFlexExtContainer* c) +{ + NvFlexExtParticleData data; + + c->mParticles.map(); + c->mParticlesRest.map(); + c->mVelocities.map(); + c->mPhases.map(); + c->mNormals.map(); + + c->mBoundsLower.map(); + c->mBoundsUpper.map(); + + if (c->mParticles.size()) + data.particles = (float*)&c->mParticles[0]; + + if (c->mParticlesRest.size()) + data.restParticles = (float*)&c->mParticlesRest[0]; + + if (c->mVelocities.size()) + data.velocities = (float*)&c->mVelocities[0]; + + if (c->mPhases.size()) + data.phases = (int*)&c->mPhases[0]; + + if (c->mNormals.size()) + data.normals = (float*)&c->mNormals[0]; + + data.lower = c->mBoundsLower[0]; + data.upper = c->mBoundsUpper[0]; + + return data; +} + +void NvFlexExtUnmapParticleData(NvFlexExtContainer*c) +{ + c->mParticles.unmap(); + c->mParticlesRest.unmap(); + c->mVelocities.unmap(); + c->mPhases.unmap(); + c->mNormals.unmap(); + + c->mBoundsLower.unmap(); + c->mBoundsUpper.unmap(); +} + +NvFlexExtTriangleData NvFlexExtMapTriangleData(NvFlexExtContainer* c) +{ + NvFlexExtTriangleData data; + + c->mTriangleIndices.map(); + c->mTriangleNormals.map(); + + if (c->mTriangleIndices.size()) + data.indices = &c->mTriangleIndices[0]; + + if (c->mTriangleNormals.size()) + data.normals = (float*)&c->mTriangleNormals[0]; + + return data; +} + +void NvFlexExtUnmapTriangleData(NvFlexExtContainer* c) +{ + c->mTriangleIndices.unmap(); + c->mTriangleNormals.unmap(); +} + +NvFlexExtShapeData NvFlexExtMapShapeData(NvFlexExtContainer* c) +{ + NvFlexExtShapeData data; + + c->mShapeRotations.map(); + c->mShapeTranslations.map(); + + if (c->mShapeRotations.size()) + data.rotations = (float*)&c->mShapeRotations[0]; + + if (c->mShapeTranslations.size()) + data.positions = (float*)&c->mShapeTranslations[0]; + + return data; +} + +void NvFlexExtUnmapShapeData(NvFlexExtContainer* c) +{ + c->mShapeRotations.unmap(); + c->mShapeTranslations.unmap(); +} + + +NvFlexExtInstance* NvFlexExtCreateInstance(NvFlexExtContainer* c, NvFlexExtParticleData* particleData, const NvFlexExtAsset* asset, const float* transform, float vx, float vy, float vz, int phase, float invMassScale) +{ + const int numParticles = asset->numParticles; + + // check if asset will fit + if (int(c->mFreeList.size()) < numParticles) + return NULL; + + NvFlexExtInstance* inst = new NvFlexExtInstance(); + + inst->asset = asset; + inst->triangleIndex = -1; + inst->shapeIndex = -1; + inst->inflatableIndex = -1; + inst->userData = NULL; + inst->numParticles = numParticles; + + assert(inst->numParticles <= asset->maxParticles); + + // allocate particles for instance + inst->particleIndices = new int[asset->maxParticles]; + int n = NvFlexExtAllocParticles(c, numParticles, &inst->particleIndices[0]); + assert(n == numParticles); + (void)n; + + c->mInstances.push_back(inst); + + const Matrix44 xform(transform); + + for (int i=0; i < numParticles; ++i) + { + const int index = inst->particleIndices[i]; + + // add transformed particles to the locked particle data + ((Vec4*)(particleData->particles))[index] = xform*Vec4(Vec3(&asset->particles[i*4]), 1.0f); + ((Vec4*)(particleData->particles))[index].w = asset->particles[i*4+3]*invMassScale; + ((Vec4*)(particleData->restParticles))[index] = Vec4(&asset->particles[i*4]); + + ((Vec3*)(particleData->velocities))[index] = Vec3(vx, vy, vz); + ((int*)(particleData->phases))[index] = phase; + ((Vec4*)(particleData->normals))[index] = Vec4(0.0f); + } + + const int numShapes = asset->numShapes; + + // allocate memory for shape transforms + Vec3* shapeTranslations = new Vec3[numShapes]; + Quat* shapeRotations = new Quat[numShapes]; + + Quat rotation = Quat(Matrix33(xform.GetAxis(0), xform.GetAxis(1), xform.GetAxis(2))); + + for (int i=0; i < numShapes; ++i) + { + shapeTranslations[i] = Vec3(xform*Vec4(asset->shapeCenters[i*3+0], asset->shapeCenters[i*3+1], asset->shapeCenters[i*3+2], 1.0)); + shapeRotations[i] = rotation; + } + + inst->shapeTranslations = (float*)shapeTranslations; + inst->shapeRotations = (float*)shapeRotations; + + // mark container as dirty + c->mNeedsCompact = true; + c->mNeedsActiveListRebuild = true; + + return inst; +} + +void NvFlexExtDestroyInstance(NvFlexExtContainer* c, const NvFlexExtInstance* inst) +{ + NvFlexExtFreeParticles(c, inst->numParticles, &inst->particleIndices[0]); + delete[] inst->particleIndices; + + delete[] inst->shapeRotations; + delete[] inst->shapeTranslations; + + // TODO: O(N) remove + std::vector<NvFlexExtInstance*>::iterator iter = std::find(c->mInstances.begin(), c->mInstances.end(), inst); + assert(iter != c->mInstances.end()); + c->mInstances.erase(iter); + + c->mNeedsCompact = true; + c->mNeedsActiveListRebuild = true; + + delete inst; +} + +void NvFlexExtTickContainer(NvFlexExtContainer* c, float dt, int substeps, bool enableTiming) +{ + // update the device + NvFlexExtPushToDevice(c); + + // update solver + NvFlexUpdateSolver(c->mSolver, dt, substeps, enableTiming); + + // update host + NvFlexExtPullFromDevice(c); +} + +void NvFlexExtNotifyAssetChanged(NvFlexExtContainer* c, const NvFlexExtAsset* asset) +{ + c->mNeedsCompact = true; +} + +void NvFlexExtPushToDevice(NvFlexExtContainer* c) +{ + if (c->mNeedsActiveListRebuild) + { + // update active list + c->mActiveList.map(); + int n = NvFlexExtGetActiveList(c, &c->mActiveList[0]); + c->mActiveList.unmap(); + + NvFlexSetActive(c->mSolver, c->mActiveList.buffer, n); + + c->mNeedsActiveListRebuild = false; + } + + // push any changes to solver + NvFlexSetParticles(c->mSolver, c->mParticles.buffer, int(c->mParticles.size())); + NvFlexSetRestParticles(c->mSolver, c->mParticlesRest.buffer, int(c->mParticlesRest.size())); + + NvFlexSetVelocities(c->mSolver, c->mVelocities.buffer, int(c->mVelocities.size())); + NvFlexSetPhases(c->mSolver, c->mPhases.buffer, int(c->mPhases.size())); + NvFlexSetNormals(c->mSolver, c->mNormals.buffer, int(c->mNormals.size())); + + if (c->mNeedsCompact) + CompactObjects(c); +} + +void NvFlexExtPullFromDevice(NvFlexExtContainer* c) +{ + + // read back particle data + NvFlexGetParticles(c->mSolver, c->mParticles.buffer, int(c->mParticles.size())); + NvFlexGetVelocities(c->mSolver, c->mVelocities.buffer, int(c->mVelocities.size())); + NvFlexGetPhases(c->mSolver, c->mPhases.buffer, int(c->mPhases.size())); + NvFlexGetNormals(c->mSolver, c->mNormals.buffer, int(c->mNormals.size())); + NvFlexGetBounds(c->mSolver, c->mBoundsLower.buffer, c->mBoundsUpper.buffer); + + // read back shape transforms + if (c->mShapeCoefficients.size()) + NvFlexGetRigidTransforms(c->mSolver, c->mShapeRotations.buffer, c->mShapeTranslations.buffer); + +} + +void NvFlexExtUpdateInstances(NvFlexExtContainer* c) +{ + c->mShapeTranslations.map(); + c->mShapeRotations.map(); + + for (int i=0; i < int(c->mInstances.size()); ++i) + { + NvFlexExtInstance* inst = c->mInstances[i]; + + // copy data back to per-instance memory from the container's memory + const int numShapes = inst->asset->numShapes; + const int shapeStart = inst->shapeIndex; + + if (shapeStart == -1) + continue; + + for (int s=0; s < numShapes; ++s) + { + ((Vec3*)inst->shapeTranslations)[s] = c->mShapeTranslations[shapeStart + s]; + ((Quat*)inst->shapeRotations)[s] = c->mShapeRotations[shapeStart + s]; + } + } + + c->mShapeTranslations.unmap(); + c->mShapeRotations.unmap(); +} + +void NvFlexExtDestroyAsset(NvFlexExtAsset* asset) +{ + delete[] asset->particles; + delete[] asset->springIndices; + delete[] asset->springCoefficients; + delete[] asset->springRestLengths; + delete[] asset->triangleIndices; + delete[] asset->shapeIndices; + delete[] asset->shapeOffsets; + delete[] asset->shapeCenters; + delete[] asset->shapeCoefficients; + + delete asset; +} + + diff --git a/extensions/flexExtMovingFrame.cpp b/extensions/flexExtMovingFrame.cpp new file mode 100644 index 0000000..623450e --- /dev/null +++ b/extensions/flexExtMovingFrame.cpp @@ -0,0 +1,127 @@ +#include "../include/NvFlexExt.h" + +#include "../core/maths.h" + +namespace +{ + +// internal version of the public NvFlexExtMovingFrame type +// this must be a byte exact copy of of NvFlexExtMovingFrame +// we just separate the internal types to avoid exposing +// our math types on the API + +struct MovingFrame +{ + Vec3 position; + Quat rotation; + + Vec3 velocity; + Vec3 omega; + + Vec3 acceleration; + Vec3 tau; + + Matrix44 delta; + + MovingFrame(Vec3 worldTranslation, Quat worldRotation) + { + position = worldTranslation; + rotation = worldRotation; + delta = Matrix44::kIdentity; + } + + // update the frame, returns a matrix representing the delta transform that + // can be applied to particles to teleport them to the frame's new location + void Move(Vec3 newPosition, Quat newRotation, float dt) + { + const float invDt = 1.0f/dt; + + // calculate new velocity + Vec3 newVelocity = (newPosition-position)*invDt; + Vec3 newOmega = 2.0f*Vec3(Quat(newRotation-rotation)*Inverse(rotation)*invDt); + + // calculate new acceleration + Vec3 newAcceleration = (newVelocity-velocity)*invDt; + Vec3 newTau = (newOmega-omega)*invDt; + + // calculate delta transform + Matrix44 LocalFromOld = AffineInverse(TranslationMatrix(Point3(position))*RotationMatrix(rotation)); + Matrix44 NewFromLocal = TranslationMatrix(Point3(newPosition))*RotationMatrix(newRotation); + + // update delta transform + delta = NewFromLocal*LocalFromOld; + + // position + position = newPosition; + rotation = newRotation; + + // update velocity + velocity = newVelocity; + omega = newOmega; + + acceleration = newAcceleration; + tau = newTau; + } + + inline Vec3 GetLinearForce() const + { + return -acceleration; + } + + inline Vec3 GetAngularForce(Vec3 p) const + { + Vec3 d = p-position; + + // forces due to rotation + Vec3 centrifugalForce = -Cross(omega, Cross(omega, d)); + Vec3 eulerForce = -Cross(tau, d); + + return centrifugalForce + eulerForce; + } + +}; + +static_assert(sizeof(NvFlexExtMovingFrame) == sizeof(MovingFrame), "Size mismatch for NvFlexExtMovingFrame"); + +} // anonymous namespace + +void NvFlexExtMovingFrameInit(NvFlexExtMovingFrame* frame, const float* worldTranslation, const float* worldRotation) +{ + ((MovingFrame&)(*frame)) = MovingFrame(Vec3(worldTranslation), Quat(worldRotation)); +} + +void NvFlexExtMovingFrameUpdate(NvFlexExtMovingFrame* frame, const float* worldTranslation, const float* worldRotation, float dt) +{ + ((MovingFrame&)(*frame)).Move(Vec3(worldTranslation), Quat(worldRotation), dt); +} + +void NvFlexExtMovingFrameApply(NvFlexExtMovingFrame* frame, float* positions, float* velocities, int numParticles, float linearScale, float angularScale, float dt) +{ + const MovingFrame& f = (MovingFrame&)(*frame); + + // linear force constant for all particles + Vec3 linearForce = f.GetLinearForce()*linearScale; + + for (int i=0; i < numParticles; ++i) + { + Vec3 particlePos = Vec3(&positions[i*4]); + Vec3 particleVel = Vec3(&velocities[i*3]); + + // angular force depends on particles position + Vec3 angularForce = f.GetAngularForce(particlePos)*angularScale; + + // transform particle to frame's new location + particlePos = Vec3(f.delta*Vec4(particlePos, 1.0f)); + particleVel += (linearForce + angularForce)*dt; + + // update positions + positions[i*4+0] = particlePos.x; + positions[i*4+1] = particlePos.y; + positions[i*4+2] = particlePos.z; + + velocities[i*3+0] = particleVel.x; + velocities[i*3+1] = particleVel.y; + velocities[i*3+2] = particleVel.z; + + } +} diff --git a/extensions/flexExtRigid.cpp b/extensions/flexExtRigid.cpp new file mode 100644 index 0000000..9c37c28 --- /dev/null +++ b/extensions/flexExtRigid.cpp @@ -0,0 +1,195 @@ +// 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) 20132017 NVIDIA Corporation. All rights reserved. + +#include "../include/NvFlexExt.h" + +#include "../core/maths.h" +#include "../core/voxelize.h" +#include "../core/sdf.h" + +#include <vector> + +namespace +{ + +float SampleSDF(const float* sdf, int dim, int x, int y, int z) +{ + assert(x < dim && x >= 0); + assert(y < dim && y >= 0); + assert(z < dim && z >= 0); + + return sdf[z*dim*dim + y*dim + x]; +} + +// return normal of signed distance field +Vec3 SampleSDFGrad(const float* sdf, int dim, int x, int y, int z) +{ + int x0 = std::max(x-1, 0); + int x1 = std::min(x+1, dim-1); + + int y0 = std::max(y-1, 0); + int y1 = std::min(y+1, dim-1); + + int z0 = std::max(z-1, 0); + int z1 = std::min(z+1, dim-1); + + float dx = (SampleSDF(sdf, dim, x1, y, z) - SampleSDF(sdf, dim, x0, y, z))*(dim*0.5f); + float dy = (SampleSDF(sdf, dim, x, y1, z) - SampleSDF(sdf, dim, x, y0, z))*(dim*0.5f); + float dz = (SampleSDF(sdf, dim, x, y, z1) - SampleSDF(sdf, dim, x, y, z0))*(dim*0.5f); + + return Vec3(dx, dy, dz); +} + +} // anonymous namespace + +NvFlexExtAsset* NvFlexExtCreateRigidFromMesh(const float* vertices, int numVertices, const int* indices, int numTriangleIndices, float spacing, float expand) +{ + std::vector<Vec4> particles; + std::vector<Vec4> normals; + std::vector<int> phases; + + const Vec3* positions = (Vec3*)vertices; + + Vec3 meshLower(FLT_MAX), meshUpper(-FLT_MAX); + for (int i=0; i < numVertices; ++i) + { + meshLower = Min(meshLower, positions[i]); + meshUpper = Max(meshUpper, positions[i]); + } + + Vec3 edges = meshUpper-meshLower; + float maxEdge = std::max(std::max(edges.x, edges.y), edges.z); + + // tweak spacing to avoid edge cases for particles laying on the boundary + // just covers the case where an edge is a whole multiple of the spacing. + float spacingEps = spacing*(1.0f - 1e-4f); + + // make sure to have at least one particle in each dimension + int dx, dy, dz; + dx = spacing > edges.x ? 1 : int(edges.x/spacingEps); + dy = spacing > edges.y ? 1 : int(edges.y/spacingEps); + dz = spacing > edges.z ? 1 : int(edges.z/spacingEps); + + int maxDim = std::max(std::max(dx, dy), dz); + + // expand border by two voxels to ensure adequate sampling at edges + meshLower -= 2.0f*Vec3(spacing); + meshUpper += 2.0f*Vec3(spacing); + maxDim += 4; + + // we shift the voxelization bounds so that the voxel centers + // lie symmetrically to the center of the object. this reduces the + // chance of missing features, and also better aligns the particles + // with the mesh + Vec3 meshOffset; + meshOffset.x = 0.5f * (spacing - (edges.x - (dx-1)*spacing)); + meshOffset.y = 0.5f * (spacing - (edges.y - (dy-1)*spacing)); + meshOffset.z = 0.5f * (spacing - (edges.z - (dz-1)*spacing)); + meshLower -= meshOffset; + + // don't allow samplings with > 64 per-side + if (maxDim > 64) + return NULL; + + std::vector<uint32_t> voxels(maxDim*maxDim*maxDim); + + Voxelize(vertices, numVertices, indices, numTriangleIndices, maxDim, maxDim, maxDim, &voxels[0], meshLower, meshLower + Vec3(maxDim*spacing)); + + std::vector<float> sdf(maxDim*maxDim*maxDim); + MakeSDF(&voxels[0], maxDim, maxDim, maxDim, &sdf[0]); + + Vec3 center; + + for (int x=0; x < maxDim; ++x) + { + for (int y=0; y < maxDim; ++y) + { + for (int z=0; z < maxDim; ++z) + { + const int index = z*maxDim*maxDim + y*maxDim + x; + + // if voxel is marked as occupied the add a particle + if (voxels[index]) + { + Vec3 position = meshLower + spacing*Vec3(float(x) + 0.5f, float(y) + 0.5f, float(z) + 0.5f); + + // normalize the sdf value and transform to world scale + Vec3 n = SafeNormalize(SampleSDFGrad(&sdf[0], maxDim, x, y, z)); + float d = sdf[index]*maxEdge; + + // move particles inside or outside shape + position += n*expand; + + normals.push_back(Vec4(n, d)); + particles.push_back(Vec4(position.x, position.y, position.z, 1.0f)); + phases.push_back(0); + + center += position; + } + } + } + } + + NvFlexExtAsset* asset = new NvFlexExtAsset(); + memset(asset, 0, sizeof(*asset)); + + if (particles.size()) + { + const int numParticles = int(particles.size()); + + asset->numParticles = numParticles; + asset->maxParticles = numParticles; + + asset->particles = new float[numParticles*4]; + memcpy(asset->particles, &particles[0], sizeof(Vec4)*numParticles); + + // store center of mass + center /= float(numParticles); + + asset->numShapes = 1; + asset->numShapeIndices = numParticles; + + // for rigids we just reference all particles in the shape + asset->shapeIndices = new int[numParticles]; + + for (int i = 0; i < numParticles; ++i) + asset->shapeIndices[i] = i; + + asset->shapeCenters = new float[4]; + asset->shapeCenters[0] = center.x; + asset->shapeCenters[1] = center.y; + asset->shapeCenters[2] = center.z; + + asset->shapeCoefficients = new float[1]; + asset->shapeCoefficients[0] = 1.0f; + + asset->shapeOffsets = new int[1]; + asset->shapeOffsets[0] = numParticles; + } + + return asset; +} diff --git a/extensions/flexExtSoft.cpp b/extensions/flexExtSoft.cpp new file mode 100644 index 0000000..53537c4 --- /dev/null +++ b/extensions/flexExtSoft.cpp @@ -0,0 +1,623 @@ +// 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) 20132017 NVIDIA Corporation. All rights reserved. + +#include "../include/NvFlexExt.h" + +#include "../core/core.h" +#include "../core/maths.h" +#include "../core/voxelize.h" + +#include <vector> +#include <algorithm> + +using namespace std; + +// Soft body support functions + +namespace +{ + +Vec3 CalculateMean(const Vec3* particles, const int* indices, int numIndices) +{ + Vec3 sum; + + for (int i = 0; i < numIndices; ++i) + sum += Vec3(particles[indices[i]]); + + if (numIndices) + return sum / float(numIndices); + else + return sum; +} + +float CalculateRadius(const Vec3* particles, Vec3 center, const int* indices, int numIndices) +{ + float radiusSq = 0.0f; + + for (int i = 0; i < numIndices; ++i) + { + float dSq = LengthSq(Vec3(particles[indices[i]]) - center); + if (dSq > radiusSq) + radiusSq = dSq; + } + + return sqrtf(radiusSq); +} + +struct Cluster +{ + Vec3 mean; + float radius; + + // indices of particles belonging to this cluster + std::vector<int> indices; +}; + +struct Seed +{ + int index; + float priority; + + bool operator < (const Seed& rhs) const + { + return priority < rhs.priority; + } +}; + +// basic SAP based acceleration structure for point cloud queries +struct SweepAndPrune +{ + struct Entry + { + Entry(Vec3 p, int i) : point(p), index(i) {} + + Vec3 point; + int index; + }; + + SweepAndPrune(const Vec3* points, int n) + { + entries.reserve(n); + for (int i=0; i < n; ++i) + entries.push_back(Entry(points[i], i)); + + struct SortOnAxis + { + int axis; + + SortOnAxis(int axis) : axis(axis) {} + + bool operator()(const Entry& lhs, const Entry& rhs) const + { + return lhs.point[axis] < rhs.point[axis]; + } + }; + + // calculate particle bounds and longest axis + Vec3 lower(FLT_MAX), upper(-FLT_MAX); + for (int i=0; i < n; ++i) + { + lower = Min(points[i], lower); + upper = Max(points[i], upper); + } + + Vec3 edges = upper-lower; + + if (edges.x > edges.y && edges.x > edges.z) + longestAxis = 0; + else if (edges.y > edges.z) + longestAxis = 1; + else + longestAxis = 2; + + std::sort(entries.begin(), entries.end(), SortOnAxis(longestAxis)); + } + + void QuerySphere(Vec3 center, float radius, std::vector<int>& indices) + { + // find start point in the array + int low = 0; + int high = int(entries.size()); + + // the point we are trying to find + float queryLower = center[longestAxis] - radius; + float queryUpper = center[longestAxis] + radius; + + // binary search to find the start point in the sorted entries array + while (low < high) + { + const int mid = (high+low)/2; + + if (queryLower > entries[mid].point[longestAxis]) + low = mid+1; + else + high = mid; + } + + // scan forward over potential overlaps + float radiusSq = radius*radius; + + for (int i=low; i < int(entries.size()); ++i) + { + Vec3 p = entries[i].point; + + if (LengthSq(p-center) < radiusSq) + { + indices.push_back(entries[i].index); + } + else if (entries[i].point[longestAxis] > queryUpper) + { + // early out if ther are no more possible candidates + break; + } + } + } + + int longestAxis; // [0,2] -> x,y,z + + std::vector<Entry> entries; +}; + +int CreateClusters(Vec3* particles, const float* priority, int numParticles, std::vector<int>& outClusterOffsets, std::vector<int>& outClusterIndices, std::vector<Vec3>& outClusterPositions, float radius, float smoothing = 0.0f) +{ + std::vector<Seed> seeds; + std::vector<Cluster> clusters; + + // flags a particle as belonging to at least one cluster + std::vector<bool> used(numParticles, false); + + // initialize seeds + for (int i = 0; i < numParticles; ++i) + { + Seed s; + s.index = i; + s.priority = priority[i]; + + seeds.push_back(s); + } + + // sort seeds on priority + std::stable_sort(seeds.begin(), seeds.end()); + + SweepAndPrune sap(particles, numParticles); + + while (seeds.size()) + { + // pick highest unused particle from the seeds list + Seed seed = seeds.back(); + seeds.pop_back(); + + if (!used[seed.index]) + { + Cluster c; + + sap.QuerySphere(Vec3(particles[seed.index]), radius, c.indices); + + // mark overlapping particles as used so they are removed from the list of potential cluster seeds + for (int i=0; i < int(c.indices.size()); ++i) + used[c.indices[i]] = true; + + c.mean = CalculateMean(particles, &c.indices[0], int(c.indices.size())); + + clusters.push_back(c); + } + } + + if (smoothing > 0.0f) + { + for (int i = 0; i < int(clusters.size()); ++i) + { + Cluster& c = clusters[i]; + + // clear cluster indices + c.indices.resize(0); + + // calculate cluster particles using cluster mean and smoothing radius + sap.QuerySphere(c.mean, smoothing, c.indices); + + c.mean = CalculateMean(particles, &c.indices[0], int(c.indices.size())); + } + } + + // write out cluster indices + int count = 0; + + for (int c = 0; c < int(clusters.size()); ++c) + { + const Cluster& cluster = clusters[c]; + + const int clusterSize = int(cluster.indices.size()); + + // skip empty clusters + if (clusterSize) + { + // write cluster indices + for (int i = 0; i < clusterSize; ++i) + outClusterIndices.push_back(cluster.indices[i]); + + // write cluster offset + outClusterOffsets.push_back(int(outClusterIndices.size())); + + // write center + outClusterPositions.push_back(cluster.mean); + + ++count; + } + } + + return count; +} + +// creates distance constraints between particles within some radius +int CreateLinks(const Vec3* particles, int numParticles, std::vector<int>& outSpringIndices, std::vector<float>& outSpringLengths, std::vector<float>& outSpringStiffness, float radius, float stiffness = 1.0f) +{ + int count = 0; + + std::vector<int> neighbors; + SweepAndPrune sap(particles, numParticles); + + for (int i = 0; i < numParticles; ++i) + { + neighbors.resize(0); + + sap.QuerySphere(Vec3(particles[i]), radius, neighbors); + + for (int j = 0; j < int(neighbors.size()); ++j) + { + const int nj = neighbors[j]; + + if (nj != i) + { + outSpringIndices.push_back(i); + outSpringIndices.push_back(nj); + outSpringLengths.push_back(Length(Vec3(particles[i]) - Vec3(particles[nj]))); + outSpringStiffness.push_back(stiffness); + + ++count; + } + } + } + + return count; +} + +void CreateSkinning(const Vec3* vertices, int numVertices, const Vec3* clusters, int numClusters, float* outWeights, int* outIndices, float falloff, float maxdist) +{ + const int maxBones = 4; + + SweepAndPrune sap(clusters, numClusters); + + std::vector<int> influences; + + // for each vertex, find the closest n clusters + for (int i = 0; i < numVertices; ++i) + { + int indices[4] = { -1, -1, -1, -1 }; + float distances[4] = { FLT_MAX, FLT_MAX, FLT_MAX, FLT_MAX }; + float weights[maxBones]; + + influences.resize(0); + sap.QuerySphere(vertices[i], maxdist, influences); + + for (int c = 0; c < int(influences.size()); ++c) + { + float dSq = LengthSq(vertices[i] - clusters[influences[c]]); + + // insertion sort + int w = 0; + for (; w < maxBones; ++w) + if (dSq < distances[w]) + break; + + if (w < maxBones) + { + // shuffle down + for (int s = maxBones - 1; s > w; --s) + { + indices[s] = indices[s - 1]; + distances[s] = distances[s - 1]; + } + + distances[w] = dSq; + indices[w] = influences[c]; + } + } + + // weight particles according to distance + float wSum = 0.0f; + + for (int w = 0; w < maxBones; ++w) + { + if (distances[w] > Sqr(maxdist)) + { + // clamp bones over a given distance to zero + weights[w] = 0.0f; + } + else + { + // weight falls off inversely with distance + weights[w] = 1.0f / (powf(distances[w], falloff) + 0.0001f); + } + + wSum += weights[w]; + } + + if (wSum == 0.0f) + { + // if all weights are zero then just + // rigidly skin to the closest bone + weights[0] = 1.0f; + } + else + { + // normalize weights + for (int w = 0; w < maxBones; ++w) + { + weights[w] = weights[w] / wSum; + } + } + + // output + for (int j = 0; j < maxBones; ++j) + { + outWeights[i*maxBones + j] = weights[j]; + outIndices[i*maxBones + j] = indices[j]; + } + } +} + +// creates mesh interior and surface sample points and clusters them into particles +void SampleMesh(const Vec3* vertices, int numVertices, const int* indices, int numIndices, float radius, float volumeSampling, float surfaceSampling, std::vector<Vec3>& outPositions) +{ + Vec3 meshLower(FLT_MAX); + Vec3 meshUpper(-FLT_MAX); + + for (int i = 0; i < numVertices; ++i) + { + meshLower = Min(meshLower, vertices[i]); + meshUpper = Max(meshUpper, vertices[i]); + } + + std::vector<Vec3> samples; + + if (volumeSampling > 0.0f) + { + // recompute expanded edges + Vec3 edges = meshUpper - meshLower; + + // use a higher resolution voxelization as a basis for the particle decomposition + float spacing = radius / volumeSampling; + + // tweak spacing to avoid edge cases for particles laying on the boundary + // just covers the case where an edge is a whole multiple of the spacing. + float spacingEps = spacing*(1.0f - 1e-4f); + + // make sure to have at least one particle in each dimension + int dx, dy, dz; + dx = spacing > edges.x ? 1 : int(edges.x / spacingEps); + dy = spacing > edges.y ? 1 : int(edges.y / spacingEps); + dz = spacing > edges.z ? 1 : int(edges.z / spacingEps); + + int maxDim = max(max(dx, dy), dz); + + // expand border by two voxels to ensure adequate sampling at edges + meshLower -= 2.0f*Vec3(spacing); + meshUpper += 2.0f*Vec3(spacing); + maxDim += 4; + + vector<uint32_t> voxels(maxDim*maxDim*maxDim); + + // we shift the voxelization bounds so that the voxel centers + // lie symmetrically to the center of the object. this reduces the + // chance of missing features, and also better aligns the particles + // with the mesh + Vec3 meshOffset; + meshOffset.x = 0.5f * (spacing - (edges.x - (dx - 1)*spacing)); + meshOffset.y = 0.5f * (spacing - (edges.y - (dy - 1)*spacing)); + meshOffset.z = 0.5f * (spacing - (edges.z - (dz - 1)*spacing)); + meshLower -= meshOffset; + + Voxelize((const float*)vertices, numVertices, indices, numIndices, maxDim, maxDim, maxDim, &voxels[0], meshLower, meshLower + Vec3(maxDim*spacing)); + + // sample interior + for (int x = 0; x < maxDim; ++x) + { + for (int y = 0; y < maxDim; ++y) + { + for (int z = 0; z < maxDim; ++z) + { + const int index = z*maxDim*maxDim + y*maxDim + x; + + // if voxel is marked as occupied the add a particle + if (voxels[index]) + { + Vec3 position = meshLower + spacing*Vec3(float(x) + 0.5f, float(y) + 0.5f, float(z) + 0.5f); + + // normalize the sdf value and transform to world scale + samples.push_back(position); + } + } + } + } + } + + if (surfaceSampling > 0.0f) + { + // sample vertices + for (int i = 0; i < numVertices; ++i) + samples.push_back(vertices[i]); + + // random surface sampling (non-uniform) + const int numSamples = int(50000 * surfaceSampling); + const int numTriangles = numIndices/3; + + RandInit(); + + for (int i = 0; i < numSamples; ++i) + { + int t = Rand() % numTriangles; + float u = Randf(); + float v = Randf()*(1.0f - u); + float w = 1.0f - u - v; + + int a = indices[t*3 + 0]; + int b = indices[t*3 + 1]; + int c = indices[t*3 + 2]; + + Vec3 p = vertices[a] * u + vertices[b] * v + vertices[c] * w; + + samples.push_back(p); + } + } + + std::vector<int> clusterIndices; + std::vector<int> clusterOffsets; + std::vector<Vec3> clusterPositions; + std::vector<float> priority(samples.size()); + + // cluster mesh sample points into actual particles + CreateClusters(&samples[0], &priority[0], int(samples.size()), clusterOffsets, clusterIndices, outPositions, radius); +} + +} // anonymous namespace + +// API methods + +NvFlexExtAsset* NvFlexExtCreateSoftFromMesh(const float* vertices, int numVertices, const int* indices, int numIndices, float particleSpacing, float volumeSampling, float surfaceSampling, float clusterSpacing, float clusterRadius, float clusterStiffness, float linkRadius, float linkStiffness, float globalStiffness) +{ + // construct asset definition + NvFlexExtAsset* asset = new NvFlexExtAsset(); + + // create particle sampling + std::vector<Vec3> samples; + SampleMesh((Vec3*)vertices, numVertices, indices, numIndices, particleSpacing, volumeSampling, surfaceSampling, samples); + + const int numParticles = int(samples.size()); + + std::vector<int> clusterIndices; + std::vector<int> clusterOffsets; + std::vector<Vec3> clusterPositions; + std::vector<float> clusterCoefficients; + + // priority (not currently used) + std::vector<float> priority(numParticles); + for (int i = 0; i < int(priority.size()); ++i) + priority[i] = 0.0f; + + // cluster particles into shape matching groups + int numClusters = CreateClusters(&samples[0], &priority[0], int(samples.size()), clusterOffsets, clusterIndices, clusterPositions, clusterSpacing, clusterRadius); + + // assign all clusters the same stiffness + clusterCoefficients.resize(numClusters, clusterStiffness); + + // create links between clusters + if (linkRadius > 0.0f) + { + std::vector<int> springIndices; + std::vector<float> springLengths; + std::vector<float> springStiffness; + + // create links between particles + int numLinks = CreateLinks(&samples[0], int(samples.size()), springIndices, springLengths, springStiffness, linkRadius, linkStiffness); + + // assign links + if (numLinks) + { + asset->springIndices = new int[numLinks * 2]; + memcpy(asset->springIndices, &springIndices[0], sizeof(int)*springIndices.size()); + + asset->springCoefficients = new float[numLinks]; + memcpy(asset->springCoefficients, &springStiffness[0], sizeof(float)*numLinks); + + asset->springRestLengths = new float[numLinks]; + memcpy(asset->springRestLengths, &springLengths[0], sizeof(float)*numLinks); + + asset->numSprings = numLinks; + } + } + + // add an additional global cluster with stiffness = globalStiffness + if (globalStiffness > 0.0f) + { + numClusters += 1; + clusterCoefficients.push_back(globalStiffness); + + for (int i = 0; i < numParticles; ++i) + { + clusterIndices.push_back(i); + } + + clusterOffsets.push_back((int)clusterIndices.size()); + + // the mean of the global cluster is the mean of all particles + Vec3 globalMeanPosition(0.0f); + + for (int i = 0; i < numParticles; ++i) + { + globalMeanPosition += samples[i]; + } + globalMeanPosition /= float(numParticles); + + clusterPositions.push_back(globalMeanPosition); + } + + // assign particles + asset->particles = new float[numParticles * 4]; + asset->numParticles = numParticles; + asset->maxParticles = numParticles; + + for (int i = 0; i < numParticles; ++i) + { + asset->particles[i*4+0] = samples[i].x; + asset->particles[i*4+1] = samples[i].y; + asset->particles[i*4+2] = samples[i].z; + asset->particles[i*4+3] = 1.0f; + } + + // assign shapes + asset->shapeIndices = new int[clusterIndices.size()]; + memcpy(asset->shapeIndices, &clusterIndices[0], sizeof(int)*clusterIndices.size()); + + asset->shapeOffsets = new int[numClusters]; + memcpy(asset->shapeOffsets, &clusterOffsets[0], sizeof(int)*numClusters); + + asset->shapeCenters = new float[numClusters*3]; + memcpy(asset->shapeCenters, &clusterPositions[0], sizeof(float)*numClusters*3); + + asset->shapeCoefficients = new float[numClusters]; + memcpy(asset->shapeCoefficients, &clusterCoefficients[0], sizeof(float)*numClusters); + + asset->numShapeIndices = int(clusterIndices.size()); + asset->numShapes = numClusters; + + return asset; +} + +void NvFlexExtCreateSoftMeshSkinning(const float* vertices, int numVertices, const float* bones, int numBones, float falloff, float maxDistance, float* skinningWeights, int* skinningIndices) +{ + CreateSkinning((Vec3*)vertices, numVertices, (Vec3*)bones, numBones, skinningWeights, skinningIndices, falloff, maxDistance); +} |