diff --git a/.gitignore b/.gitignore
index 0fdb6e0..43887ea 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,6 +7,8 @@
*.userosscache
*.sln.docstates
+Logs/
+
# Build results
[Dd]ebug/
[Dd]ebugPublic/
diff --git a/CUGL.pro b/CUGL.pro
index 0a16416..b764b11 100644
--- a/CUGL.pro
+++ b/CUGL.pro
@@ -37,6 +37,7 @@ SOURCES += main.cpp\
texture.cpp \
texturepopup.cpp \
utilities.cpp \
+ savable.cpp \
HEADERS += mainwindow.h \
glwidget.h \
@@ -61,7 +62,7 @@ HEADERS += mainwindow.h \
texture.h \
texturepopup.h \
utilities.h \
- serializable.h \
+ savable.h \
FORMS += mainwindow.ui
@@ -80,11 +81,11 @@ OBJECTS_DIR = debug/obj # directory where .obj files will be saved
#CUDA Settings
CUDA_OBJECTS_DIR = debug/obj # directory where .obj of cuda file will be saved
-CUDA_DIR = "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v6.5"
+CUDA_DIR = "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v7.5"
SYSTEM_NAME = x64 # Depending on your system either 'Win32', 'x64', or 'Win64'
SYSTEM_TYPE = 64 # '32' or '64', depending on your system
CUDA_ARCH = sm_35 # Type of CUDA architecture, for example 'compute_10', 'compute_11', 'sm_10'
-NVCC_OPTIONS += --use_fast_math # default setting
+NVCC_OPTIONS += --use_fast_math # default setting22
INCLUDE_FORMATTED = $$join(CUDA_DIR,'"', '"', '/include"')
LIB_FORMATTED = $$join(CUDA_DIR,'"', '"', '/lib/x64"')
@@ -95,7 +96,7 @@ NVCC_FORMATTED = $$join(CUDA_DIR,'"', '"', '/bin/nvcc"')
INCLUDEPATH += $$CUDA_DIR/include
# library directories
-QMAKE_LIBDIR += $$CUDA_DIR/lib/$$SYSTEM_NAME #"C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v6.5/lib/x64"
+QMAKE_LIBDIR += $$CUDA_DIR/lib/$$SYSTEM_NAME
# Add the necessary libraries
CUDA_LIBS= -lcuda -lcudart
diff --git a/CUGL.sdf b/CUGL.sdf
deleted file mode 100644
index 5a772d4..0000000
Binary files a/CUGL.sdf and /dev/null differ
diff --git a/CUGL.sln b/CUGL.sln
deleted file mode 100644
index f285cfa..0000000
--- a/CUGL.sln
+++ /dev/null
@@ -1,22 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 2013
-VisualStudioVersion = 12.0.31101.0
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CUGL", "CUGL.vcxproj", "{542D2B32-3337-39AE-9735-4C0B989A3A7E}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|x64 = Debug|x64
- Release|x64 = Release|x64
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {542D2B32-3337-39AE-9735-4C0B989A3A7E}.Debug|x64.ActiveCfg = Debug|x64
- {542D2B32-3337-39AE-9735-4C0B989A3A7E}.Debug|x64.Build.0 = Debug|x64
- {542D2B32-3337-39AE-9735-4C0B989A3A7E}.Release|x64.ActiveCfg = Release|x64
- {542D2B32-3337-39AE-9735-4C0B989A3A7E}.Release|x64.Build.0 = Release|x64
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
diff --git a/CUGL.v12.suo b/CUGL.v12.suo
deleted file mode 100644
index 5c9b18c..0000000
Binary files a/CUGL.v12.suo and /dev/null differ
diff --git a/CUGL.vcxproj b/CUGL.vcxproj
deleted file mode 100644
index 61f0bc5..0000000
--- a/CUGL.vcxproj
+++ /dev/null
@@ -1,635 +0,0 @@
-
-
-
-
- Release
- x64
-
-
- Debug
- x64
-
-
-
- {542D2B32-3337-39AE-9735-4C0B989A3A7E}
- CUGL
- Qt4VSv1.0
-
-
-
- v120
- release\
- false
- NotSet
- Application
- release\obj\
- CUGL
-
-
- v120
- debug\
- false
- NotSet
- Application
- debug\obj\
- CUGL
-
-
-
-
-
-
-
-
-
-
-
- release\
- $(Platform)\$(Configuration)\
- CUGL
- true
- false
- debug\
- $(Platform)\$(Configuration)\
- CUGL
- true
-
-
-
- .;.;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.5\include;$(QTDIR)\include;$(QTDIR)\include\QtWidgets;$(QTDIR)\include\QtGui;$(QTDIR)\include\QtANGLE;$(QTDIR)\include\QtCore;release;.;$(QTDIR)\mkspecs\win32-msvc2013;.\GeneratedFiles;%(AdditionalIncludeDirectories)
- -Zc:strictStrings -w34100 -w34189 -w44996 %(AdditionalOptions)
- release\obj\
- false
- None
- Sync
- $(IntDir)
- MaxSpeed
- _WINDOWS;UNICODE;WIN32;WIN64;QT_NO_DEBUG;QT_WIDGETS_LIB;QT_GUI_LIB;QT_CORE_LIB;NDEBUG;%(PreprocessorDefinitions)
- false
- $(IntDir)vc$(PlatformToolsetVersion).pdb
- MultiThreadedDLL
- true
- true
- true
- Level3
-
-
- $(QTDIR)\lib\qtmain.lib;shell32.lib;C:/qt/5.5/msvc2013_64/lib\Qt5Core.lib;"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.5\lib\x64\cuda.lib";"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.5\lib\x64\cudart.lib";$(QTDIR)\lib\Qt5Widgets.lib;$(QTDIR)\lib\Qt5Gui.lib;$(QTDIR)\lib\Qt5Core.lib;%(AdditionalDependencies)
- $(QTDIR)\lib;C:/qt/5.5/msvc2013_64/lib;$(QTDIR)\lib;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.5\lib\x64;%(AdditionalLibraryDirectories)
- "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" %(AdditionalOptions)
- true
- false
- true
- false
- $(OutDir)\CUGL.exe
- true
- Windows
- true
-
-
- Unsigned
- None
- 0
-
-
- _WINDOWS;UNICODE;WIN32;WIN64;QT_NO_DEBUG;QT_WIDGETS_LIB;QT_GUI_LIB;QT_CORE_LIB;%(PreprocessorDefinitions)
-
-
-
-
- .;.;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.5\include;$(QTDIR)\include;$(QTDIR)\include\QtWidgets;$(QTDIR)\include\QtGui;$(QTDIR)\include\QtANGLE;$(QTDIR)\include\QtCore;debug;.;$(QTDIR)\mkspecs\win32-msvc2013;.\GeneratedFiles;%(AdditionalIncludeDirectories)
- -w34100 -w34189 -w44996 %(AdditionalOptions)
- debug\obj\
- false
- ProgramDatabase
- Sync
- $(IntDir)
- Disabled
- _WINDOWS;UNICODE;WIN32;WIN64;QT_WIDGETS_LIB;QT_GUI_LIB;QT_CORE_LIB;%(PreprocessorDefinitions)
- false
- MultiThreadedDebugDLL
- true
- true
- true
- Level3
- $(IntDir)vc$(PlatformToolsetVersion).pdb
-
-
- $(QTDIR)\lib\qtmaind.lib;shell32.lib;C:/qt/5.5/msvc2013_64/lib\Qt5Cored.lib;"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.5\lib\x64\cuda.lib";"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.5\lib\x64\cudart.lib";$(QTDIR)\lib\Qt5Widgetsd.lib;$(QTDIR)\lib\Qt5Guid.lib;$(QTDIR)\lib\Qt5Cored.lib;%(AdditionalDependencies)
- $(QTDIR)\lib;C:/qt/5.5/msvc2013_64/lib;$(QTDIR)\lib;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.5\lib\x64;%(AdditionalLibraryDirectories)
- "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" %(AdditionalOptions)
- true
- true
- true
- $(OutDir)\CUGL.exe
- true
- Windows
- true
-
-
- Unsigned
- None
- 0
-
-
- _WINDOWS;UNICODE;WIN32;WIN64;QT_WIDGETS_LIB;QT_GUI_LIB;QT_CORE_LIB;_DEBUG;%(PreprocessorDefinitions)
-
-
-
-
-
-
-
-
-
-
-
- true
-
-
- true
-
-
- true
-
-
- true
-
-
- true
-
-
- true
-
-
- true
-
-
- true
-
-
- true
-
-
- true
-
-
- true
-
-
- true
-
-
- true
-
-
- true
-
-
- true
-
-
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- true
-
-
- true
-
-
- true
-
-
- true
-
-
- true
-
-
- true
-
-
- true
-
-
- true
-
-
- true
-
-
- true
-
-
- true
-
-
- true
-
-
- true
-
-
- true
-
-
- true
-
-
- true
-
-
-
-
-
-
-
-
-
- setlocal
-if errorlevel 1 goto VCEnd
-
-if errorlevel 1 goto VCEnd
-endlocal
-"$(QTDIR)\bin\moc.exe" "%(FullPath)" -o "$(ConfigurationName)\moc_%(Filename).cpp" -D_WINDOWS -DUNICODE -DWIN32 -DWIN64 -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DNDEBUG "-I." "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.5\include" "-I$(QTDIR)\include" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtANGLE" "-I$(QTDIR)\include\QtCore" "-I.\release" "-I$(QTDIR)\mkspecs\win32-msvc2013"
- Moc%27ing bufferpopup.h...
- setlocal
-if errorlevel 1 goto VCEnd
-
-if errorlevel 1 goto VCEnd
-endlocal
-"$(QTDIR)\bin\moc.exe" "%(FullPath)" -o "$(ConfigurationName)\moc_%(Filename).cpp" -D_WINDOWS -DUNICODE -DWIN32 -DWIN64 -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB "-I." "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.5\include" "-I$(QTDIR)\include" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtANGLE" "-I$(QTDIR)\include\QtCore" "-I.\debug" "-I$(QTDIR)\mkspecs\win32-msvc2013"
- Moc%27ing bufferpopup.h...
- $(ConfigurationName)\moc_%(Filename).cpp
- $(ConfigurationName)\moc_%(Filename).cpp
- $(QTDIR)\bin\moc.exe;%(FullPath)
- $(QTDIR)\bin\moc.exe;%(FullPath)
-
-
-
- setlocal
-if errorlevel 1 goto VCEnd
-
-if errorlevel 1 goto VCEnd
-endlocal
-"$(QTDIR)\bin\moc.exe" "%(FullPath)" -o "$(ConfigurationName)\moc_%(Filename).cpp" -D_WINDOWS -DUNICODE -DWIN32 -DWIN64 -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DNDEBUG "-I." "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.5\include" "-I$(QTDIR)\include" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtANGLE" "-I$(QTDIR)\include\QtCore" "-I.\release" "-I$(QTDIR)\mkspecs\win32-msvc2013"
- Moc%27ing controltab.h...
- setlocal
-if errorlevel 1 goto VCEnd
-
-if errorlevel 1 goto VCEnd
-endlocal
-"$(QTDIR)\bin\moc.exe" "%(FullPath)" -o "$(ConfigurationName)\moc_%(Filename).cpp" -D_WINDOWS -DUNICODE -DWIN32 -DWIN64 -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB "-I." "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.5\include" "-I$(QTDIR)\include" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtANGLE" "-I$(QTDIR)\include\QtCore" "-I.\debug" "-I$(QTDIR)\mkspecs\win32-msvc2013"
- Moc%27ing controltab.h...
- $(ConfigurationName)\moc_%(Filename).cpp
- $(ConfigurationName)\moc_%(Filename).cpp
- $(QTDIR)\bin\moc.exe;%(FullPath)
- $(QTDIR)\bin\moc.exe;%(FullPath)
-
-
- setlocal
-if errorlevel 1 goto VCEnd
-
-if errorlevel 1 goto VCEnd
-endlocal
-"$(QTDIR)\bin\moc.exe" "%(FullPath)" -o "$(ConfigurationName)\moc_%(Filename).cpp" -D_WINDOWS -DUNICODE -DWIN32 -DWIN64 -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DNDEBUG "-I." "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.5\include" "-I$(QTDIR)\include" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtANGLE" "-I$(QTDIR)\include\QtCore" "-I.\release" "-I$(QTDIR)\mkspecs\win32-msvc2013"
- Moc%27ing cubuffertab.h...
- setlocal
-if errorlevel 1 goto VCEnd
-
-if errorlevel 1 goto VCEnd
-endlocal
-"$(QTDIR)\bin\moc.exe" "%(FullPath)" -o "$(ConfigurationName)\moc_%(Filename).cpp" -D_WINDOWS -DUNICODE -DWIN32 -DWIN64 -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB "-I." "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.5\include" "-I$(QTDIR)\include" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtANGLE" "-I$(QTDIR)\include\QtCore" "-I.\debug" "-I$(QTDIR)\mkspecs\win32-msvc2013"
- Moc%27ing cubuffertab.h...
- $(ConfigurationName)\moc_%(Filename).cpp
- $(ConfigurationName)\moc_%(Filename).cpp
- $(QTDIR)\bin\moc.exe;%(FullPath)
- $(QTDIR)\bin\moc.exe;%(FullPath)
-
-
- setlocal
-if errorlevel 1 goto VCEnd
-
-if errorlevel 1 goto VCEnd
-endlocal
-"$(QTDIR)\bin\moc.exe" "%(FullPath)" -o "$(ConfigurationName)\moc_%(Filename).cpp" -D_WINDOWS -DUNICODE -DWIN32 -DWIN64 -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DNDEBUG "-I." "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.5\include" "-I$(QTDIR)\include" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtANGLE" "-I$(QTDIR)\include\QtCore" "-I.\release" "-I$(QTDIR)\mkspecs\win32-msvc2013"
- Moc%27ing cugeneraltab.h...
- setlocal
-if errorlevel 1 goto VCEnd
-
-if errorlevel 1 goto VCEnd
-endlocal
-"$(QTDIR)\bin\moc.exe" "%(FullPath)" -o "$(ConfigurationName)\moc_%(Filename).cpp" -D_WINDOWS -DUNICODE -DWIN32 -DWIN64 -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB "-I." "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.5\include" "-I$(QTDIR)\include" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtANGLE" "-I$(QTDIR)\include\QtCore" "-I.\debug" "-I$(QTDIR)\mkspecs\win32-msvc2013"
- Moc%27ing cugeneraltab.h...
- $(ConfigurationName)\moc_%(Filename).cpp
- $(ConfigurationName)\moc_%(Filename).cpp
- $(QTDIR)\bin\moc.exe;%(FullPath)
- $(QTDIR)\bin\moc.exe;%(FullPath)
-
-
-
- setlocal
-if errorlevel 1 goto VCEnd
-
-if errorlevel 1 goto VCEnd
-endlocal
-"$(QTDIR)\bin\moc.exe" "%(FullPath)" -o "$(ConfigurationName)\moc_%(Filename).cpp" -D_WINDOWS -DUNICODE -DWIN32 -DWIN64 -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DNDEBUG "-I." "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.5\include" "-I$(QTDIR)\include" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtANGLE" "-I$(QTDIR)\include\QtCore" "-I.\release" "-I$(QTDIR)\mkspecs\win32-msvc2013"
- Moc%27ing cusettings.h...
- setlocal
-if errorlevel 1 goto VCEnd
-
-if errorlevel 1 goto VCEnd
-endlocal
-"$(QTDIR)\bin\moc.exe" "%(FullPath)" -o "$(ConfigurationName)\moc_%(Filename).cpp" -D_WINDOWS -DUNICODE -DWIN32 -DWIN64 -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB "-I." "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.5\include" "-I$(QTDIR)\include" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtANGLE" "-I$(QTDIR)\include\QtCore" "-I.\debug" "-I$(QTDIR)\mkspecs\win32-msvc2013"
- Moc%27ing cusettings.h...
- $(ConfigurationName)\moc_%(Filename).cpp
- $(ConfigurationName)\moc_%(Filename).cpp
- $(QTDIR)\bin\moc.exe;%(FullPath)
- $(QTDIR)\bin\moc.exe;%(FullPath)
-
-
- setlocal
-if errorlevel 1 goto VCEnd
-
-if errorlevel 1 goto VCEnd
-endlocal
-"$(QTDIR)\bin\moc.exe" "%(FullPath)" -o "$(ConfigurationName)\moc_%(Filename).cpp" -D_WINDOWS -DUNICODE -DWIN32 -DWIN64 -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DNDEBUG "-I." "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.5\include" "-I$(QTDIR)\include" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtANGLE" "-I$(QTDIR)\include\QtCore" "-I.\release" "-I$(QTDIR)\mkspecs\win32-msvc2013"
- Moc%27ing glbuffertab.h...
- setlocal
-if errorlevel 1 goto VCEnd
-
-if errorlevel 1 goto VCEnd
-endlocal
-"$(QTDIR)\bin\moc.exe" "%(FullPath)" -o "$(ConfigurationName)\moc_%(Filename).cpp" -D_WINDOWS -DUNICODE -DWIN32 -DWIN64 -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB "-I." "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.5\include" "-I$(QTDIR)\include" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtANGLE" "-I$(QTDIR)\include\QtCore" "-I.\debug" "-I$(QTDIR)\mkspecs\win32-msvc2013"
- Moc%27ing glbuffertab.h...
- $(ConfigurationName)\moc_%(Filename).cpp
- $(ConfigurationName)\moc_%(Filename).cpp
- $(QTDIR)\bin\moc.exe;%(FullPath)
- $(QTDIR)\bin\moc.exe;%(FullPath)
-
-
- setlocal
-if errorlevel 1 goto VCEnd
-
-if errorlevel 1 goto VCEnd
-endlocal
-"$(QTDIR)\bin\moc.exe" "%(FullPath)" -o "$(ConfigurationName)\moc_%(Filename).cpp" -D_WINDOWS -DUNICODE -DWIN32 -DWIN64 -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DNDEBUG "-I." "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.5\include" "-I$(QTDIR)\include" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtANGLE" "-I$(QTDIR)\include\QtCore" "-I.\release" "-I$(QTDIR)\mkspecs\win32-msvc2013"
- Moc%27ing glgeneraltab.h...
- setlocal
-if errorlevel 1 goto VCEnd
-
-if errorlevel 1 goto VCEnd
-endlocal
-"$(QTDIR)\bin\moc.exe" "%(FullPath)" -o "$(ConfigurationName)\moc_%(Filename).cpp" -D_WINDOWS -DUNICODE -DWIN32 -DWIN64 -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB "-I." "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.5\include" "-I$(QTDIR)\include" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtANGLE" "-I$(QTDIR)\include\QtCore" "-I.\debug" "-I$(QTDIR)\mkspecs\win32-msvc2013"
- Moc%27ing glgeneraltab.h...
- $(ConfigurationName)\moc_%(Filename).cpp
- $(ConfigurationName)\moc_%(Filename).cpp
- $(QTDIR)\bin\moc.exe;%(FullPath)
- $(QTDIR)\bin\moc.exe;%(FullPath)
-
-
- setlocal
-if errorlevel 1 goto VCEnd
-
-if errorlevel 1 goto VCEnd
-endlocal
-"$(QTDIR)\bin\moc.exe" "%(FullPath)" -o "$(ConfigurationName)\moc_%(Filename).cpp" -D_WINDOWS -DUNICODE -DWIN32 -DWIN64 -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DNDEBUG "-I." "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.5\include" "-I$(QTDIR)\include" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtANGLE" "-I$(QTDIR)\include\QtCore" "-I.\release" "-I$(QTDIR)\mkspecs\win32-msvc2013"
- Moc%27ing glsettings.h...
- setlocal
-if errorlevel 1 goto VCEnd
-
-if errorlevel 1 goto VCEnd
-endlocal
-"$(QTDIR)\bin\moc.exe" "%(FullPath)" -o "$(ConfigurationName)\moc_%(Filename).cpp" -D_WINDOWS -DUNICODE -DWIN32 -DWIN64 -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB "-I." "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.5\include" "-I$(QTDIR)\include" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtANGLE" "-I$(QTDIR)\include\QtCore" "-I.\debug" "-I$(QTDIR)\mkspecs\win32-msvc2013"
- Moc%27ing glsettings.h...
- $(ConfigurationName)\moc_%(Filename).cpp
- $(ConfigurationName)\moc_%(Filename).cpp
- $(QTDIR)\bin\moc.exe;%(FullPath)
- $(QTDIR)\bin\moc.exe;%(FullPath)
-
-
- setlocal
-if errorlevel 1 goto VCEnd
-
-if errorlevel 1 goto VCEnd
-endlocal
-"$(QTDIR)\bin\moc.exe" "%(FullPath)" -o "$(ConfigurationName)\moc_%(Filename).cpp" -D_WINDOWS -DUNICODE -DWIN32 -DWIN64 -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DNDEBUG "-I." "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.5\include" "-I$(QTDIR)\include" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtANGLE" "-I$(QTDIR)\include\QtCore" "-I.\release" "-I$(QTDIR)\mkspecs\win32-msvc2013"
- Moc%27ing glwidget.h...
- setlocal
-if errorlevel 1 goto VCEnd
-
-if errorlevel 1 goto VCEnd
-endlocal
-"$(QTDIR)\bin\moc.exe" "%(FullPath)" -o "$(ConfigurationName)\moc_%(Filename).cpp" -D_WINDOWS -DUNICODE -DWIN32 -DWIN64 -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB "-I." "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.5\include" "-I$(QTDIR)\include" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtANGLE" "-I$(QTDIR)\include\QtCore" "-I.\debug" "-I$(QTDIR)\mkspecs\win32-msvc2013"
- Moc%27ing glwidget.h...
- $(ConfigurationName)\moc_%(Filename).cpp
- $(ConfigurationName)\moc_%(Filename).cpp
- $(QTDIR)\bin\moc.exe;%(FullPath)
- $(QTDIR)\bin\moc.exe;%(FullPath)
-
-
-
-
- setlocal
-if errorlevel 1 goto VCEnd
-
-if errorlevel 1 goto VCEnd
-endlocal
-"$(QTDIR)\bin\moc.exe" "%(FullPath)" -o "$(ConfigurationName)\moc_%(Filename).cpp" -D_WINDOWS -DUNICODE -DWIN32 -DWIN64 -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DNDEBUG "-I." "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.5\include" "-I$(QTDIR)\include" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtANGLE" "-I$(QTDIR)\include\QtCore" "-I.\release" "-I$(QTDIR)\mkspecs\win32-msvc2013"
- Moc%27ing mainwindow.h...
- setlocal
-if errorlevel 1 goto VCEnd
-
-if errorlevel 1 goto VCEnd
-endlocal
-"$(QTDIR)\bin\moc.exe" "%(FullPath)" -o "$(ConfigurationName)\moc_%(Filename).cpp" -D_WINDOWS -DUNICODE -DWIN32 -DWIN64 -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB "-I." "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.5\include" "-I$(QTDIR)\include" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtANGLE" "-I$(QTDIR)\include\QtCore" "-I.\debug" "-I$(QTDIR)\mkspecs\win32-msvc2013"
- Moc%27ing mainwindow.h...
- $(ConfigurationName)\moc_%(Filename).cpp
- $(ConfigurationName)\moc_%(Filename).cpp
- $(QTDIR)\bin\moc.exe;%(FullPath)
- $(QTDIR)\bin\moc.exe;%(FullPath)
-
-
-
- setlocal
-if errorlevel 1 goto VCEnd
-
-if errorlevel 1 goto VCEnd
-endlocal
-"$(QTDIR)\bin\moc.exe" "%(FullPath)" -o "$(ConfigurationName)\moc_%(Filename).cpp" -D_WINDOWS -DUNICODE -DWIN32 -DWIN64 -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DNDEBUG "-I." "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.5\include" "-I$(QTDIR)\include" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtANGLE" "-I$(QTDIR)\include\QtCore" "-I.\release" "-I$(QTDIR)\mkspecs\win32-msvc2013"
- Moc%27ing objectpopup.h...
- setlocal
-if errorlevel 1 goto VCEnd
-
-if errorlevel 1 goto VCEnd
-endlocal
-"$(QTDIR)\bin\moc.exe" "%(FullPath)" -o "$(ConfigurationName)\moc_%(Filename).cpp" -D_WINDOWS -DUNICODE -DWIN32 -DWIN64 -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB "-I." "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.5\include" "-I$(QTDIR)\include" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtANGLE" "-I$(QTDIR)\include\QtCore" "-I.\debug" "-I$(QTDIR)\mkspecs\win32-msvc2013"
- Moc%27ing objectpopup.h...
- $(ConfigurationName)\moc_%(Filename).cpp
- $(ConfigurationName)\moc_%(Filename).cpp
- $(QTDIR)\bin\moc.exe;%(FullPath)
- $(QTDIR)\bin\moc.exe;%(FullPath)
-
-
- setlocal
-if errorlevel 1 goto VCEnd
-
-if errorlevel 1 goto VCEnd
-endlocal
-"$(QTDIR)\bin\moc.exe" "%(FullPath)" -o "$(ConfigurationName)\moc_%(Filename).cpp" -D_WINDOWS -DUNICODE -DWIN32 -DWIN64 -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DNDEBUG "-I." "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.5\include" "-I$(QTDIR)\include" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtANGLE" "-I$(QTDIR)\include\QtCore" "-I.\release" "-I$(QTDIR)\mkspecs\win32-msvc2013"
- Moc%27ing objecttab.h...
- setlocal
-if errorlevel 1 goto VCEnd
-
-if errorlevel 1 goto VCEnd
-endlocal
-"$(QTDIR)\bin\moc.exe" "%(FullPath)" -o "$(ConfigurationName)\moc_%(Filename).cpp" -D_WINDOWS -DUNICODE -DWIN32 -DWIN64 -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB "-I." "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.5\include" "-I$(QTDIR)\include" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtANGLE" "-I$(QTDIR)\include\QtCore" "-I.\debug" "-I$(QTDIR)\mkspecs\win32-msvc2013"
- Moc%27ing objecttab.h...
- $(ConfigurationName)\moc_%(Filename).cpp
- $(ConfigurationName)\moc_%(Filename).cpp
- $(QTDIR)\bin\moc.exe;%(FullPath)
- $(QTDIR)\bin\moc.exe;%(FullPath)
-
-
- setlocal
-if errorlevel 1 goto VCEnd
-
-if errorlevel 1 goto VCEnd
-endlocal
-"$(QTDIR)\bin\moc.exe" "%(FullPath)" -o "$(ConfigurationName)\moc_%(Filename).cpp" -D_WINDOWS -DUNICODE -DWIN32 -DWIN64 -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DNDEBUG "-I." "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.5\include" "-I$(QTDIR)\include" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtANGLE" "-I$(QTDIR)\include\QtCore" "-I.\release" "-I$(QTDIR)\mkspecs\win32-msvc2013"
- Moc%27ing outputsettings.h...
- setlocal
-if errorlevel 1 goto VCEnd
-
-if errorlevel 1 goto VCEnd
-endlocal
-"$(QTDIR)\bin\moc.exe" "%(FullPath)" -o "$(ConfigurationName)\moc_%(Filename).cpp" -D_WINDOWS -DUNICODE -DWIN32 -DWIN64 -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB "-I." "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.5\include" "-I$(QTDIR)\include" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtANGLE" "-I$(QTDIR)\include\QtCore" "-I.\debug" "-I$(QTDIR)\mkspecs\win32-msvc2013"
- Moc%27ing outputsettings.h...
- $(ConfigurationName)\moc_%(Filename).cpp
- $(ConfigurationName)\moc_%(Filename).cpp
- $(QTDIR)\bin\moc.exe;%(FullPath)
- $(QTDIR)\bin\moc.exe;%(FullPath)
-
-
- setlocal
-if errorlevel 1 goto VCEnd
-
-if errorlevel 1 goto VCEnd
-endlocal
-"$(QTDIR)\bin\moc.exe" "%(FullPath)" -o "$(ConfigurationName)\moc_%(Filename).cpp" -D_WINDOWS -DUNICODE -DWIN32 -DWIN64 -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DNDEBUG "-I." "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.5\include" "-I$(QTDIR)\include" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtANGLE" "-I$(QTDIR)\include\QtCore" "-I.\release" "-I$(QTDIR)\mkspecs\win32-msvc2013"
- Moc%27ing paramtab.h...
- setlocal
-if errorlevel 1 goto VCEnd
-
-if errorlevel 1 goto VCEnd
-endlocal
-"$(QTDIR)\bin\moc.exe" "%(FullPath)" -o "$(ConfigurationName)\moc_%(Filename).cpp" -D_WINDOWS -DUNICODE -DWIN32 -DWIN64 -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB "-I." "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.5\include" "-I$(QTDIR)\include" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtANGLE" "-I$(QTDIR)\include\QtCore" "-I.\debug" "-I$(QTDIR)\mkspecs\win32-msvc2013"
- Moc%27ing paramtab.h...
- $(ConfigurationName)\moc_%(Filename).cpp
- $(ConfigurationName)\moc_%(Filename).cpp
- $(QTDIR)\bin\moc.exe;%(FullPath)
- $(QTDIR)\bin\moc.exe;%(FullPath)
-
-
-
-
-
- setlocal
-if errorlevel 1 goto VCEnd
-
-if errorlevel 1 goto VCEnd
-endlocal
-"$(QTDIR)\bin\moc.exe" "%(FullPath)" -o "$(ConfigurationName)\moc_%(Filename).cpp" -D_WINDOWS -DUNICODE -DWIN32 -DWIN64 -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DNDEBUG "-I." "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.5\include" "-I$(QTDIR)\include" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtANGLE" "-I$(QTDIR)\include\QtCore" "-I.\release" "-I$(QTDIR)\mkspecs\win32-msvc2013"
- Moc%27ing texturepopup.h...
- setlocal
-if errorlevel 1 goto VCEnd
-
-if errorlevel 1 goto VCEnd
-endlocal
-"$(QTDIR)\bin\moc.exe" "%(FullPath)" -o "$(ConfigurationName)\moc_%(Filename).cpp" -D_WINDOWS -DUNICODE -DWIN32 -DWIN64 -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB "-I." "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.5\include" "-I$(QTDIR)\include" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtANGLE" "-I$(QTDIR)\include\QtCore" "-I.\debug" "-I$(QTDIR)\mkspecs\win32-msvc2013"
- Moc%27ing texturepopup.h...
- $(ConfigurationName)\moc_%(Filename).cpp
- $(ConfigurationName)\moc_%(Filename).cpp
- $(QTDIR)\bin\moc.exe;%(FullPath)
- $(QTDIR)\bin\moc.exe;%(FullPath)
-
-
- setlocal
-if errorlevel 1 goto VCEnd
-
-if errorlevel 1 goto VCEnd
-endlocal
-"$(QTDIR)\bin\moc.exe" "%(FullPath)" -o "$(ConfigurationName)\moc_%(Filename).cpp" -D_WINDOWS -DUNICODE -DWIN32 -DWIN64 -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DNDEBUG "-I." "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.5\include" "-I$(QTDIR)\include" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtANGLE" "-I$(QTDIR)\include\QtCore" "-I.\release" "-I$(QTDIR)\mkspecs\win32-msvc2013"
- Moc%27ing texturetab.h...
- setlocal
-if errorlevel 1 goto VCEnd
-
-if errorlevel 1 goto VCEnd
-endlocal
-"$(QTDIR)\bin\moc.exe" "%(FullPath)" -o "$(ConfigurationName)\moc_%(Filename).cpp" -D_WINDOWS -DUNICODE -DWIN32 -DWIN64 -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB "-I." "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.5\include" "-I$(QTDIR)\include" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtANGLE" "-I$(QTDIR)\include\QtCore" "-I.\debug" "-I$(QTDIR)\mkspecs\win32-msvc2013"
- Moc%27ing texturetab.h...
- $(ConfigurationName)\moc_%(Filename).cpp
- $(ConfigurationName)\moc_%(Filename).cpp
- $(QTDIR)\bin\moc.exe;%(FullPath)
- $(QTDIR)\bin\moc.exe;%(FullPath)
-
-
-
-
-
- Document
- $(QTDIR)\bin\uic.exe;%(AdditionalInputs)
- "$(QTDIR)\bin\uic.exe" -o ".\GeneratedFiles\ui_%(Filename).h" "%(FullPath)"
- Uic%27ing %(Identity)...
- .\GeneratedFiles\ui_%(Filename).h;%(Outputs)
- $(QTDIR)\bin\uic.exe;%(AdditionalInputs)
- "$(QTDIR)\bin\uic.exe" -o ".\GeneratedFiles\ui_%(Filename).h" "%(FullPath)"
- Uic%27ing %(Identity)...
- .\GeneratedFiles\ui_%(Filename).h;%(Outputs)
-
-
-
-
- Kernels\kernel.cu;%(AdditionalInputs)
- setlocal
-if errorlevel 1 goto VCEnd
-"C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v6.5/bin/nvcc" --use_fast_math -I"C:/Users/Anth/Documents/GitHub/CUGL/" -I"C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v6.5/include" -lcuda -lcudart --machine 64 -arch=sm_35 --compile -cudart static -DWIN32 -D_MBCS -Xcompiler /wd4819,/EHsc,/W3,/nologo,/O2,/Zi -Xcompiler /MD -c -o debug\obj\kernel_cuda.obj Kernels\kernel.cu
-if errorlevel 1 goto VCEnd
-endlocal
- "C:/Program
- debug\obj\kernel_cuda.obj;%(Outputs)
-
-
-
-
- Kernels\kernel.cu;%(AdditionalInputs)
- setlocal
-if errorlevel 1 goto VCEnd
-"C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v6.5/bin/nvcc" -D_DEBUG --use_fast_math -I"C:/Users/Anth/Documents/GitHub/CUGL/" -I"C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v6.5/include" -lcuda -lcudart --machine 64 -arch=sm_35 --compile -cudart static -g -G -DWIN32 -D_MBCS -Xcompiler /wd4819,/EHsc,/W3,/nologo,/Od,/Zi,/RTC1 -Xcompiler /MDd -c -o debug\obj\kernel_cuda.obj Kernels\kernel.cu
-if errorlevel 1 goto VCEnd
-endlocal
- "C:/Program
- debug\obj\kernel_cuda.obj;%(Outputs)
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/CUGL.vcxproj.filters b/CUGL.vcxproj.filters
deleted file mode 100644
index 647fbae..0000000
--- a/CUGL.vcxproj.filters
+++ /dev/null
@@ -1,322 +0,0 @@
-
-
-
-
- {99349809-55BA-4b9d-BF79-8FDBB0286EB3}
- ui
- false
-
-
- {99349809-55BA-4b9d-BF79-8FDBB0286EB3}
- ui
- false
-
-
- {71ED8ED8-ACB9-4CE9-BBE1-E00B30144E11}
- cpp;c;cxx;moc;h;def;odl;idl;res;
-
-
- {71ED8ED8-ACB9-4CE9-BBE1-E00B30144E11}
- cpp;c;cxx;moc;h;def;odl;idl;res;
-
-
- {93995380-89BD-4b04-88EB-625FBE52EBFB}
- h;hpp;hxx;hm;inl;inc;xsd
-
-
- {93995380-89BD-4b04-88EB-625FBE52EBFB}
- h;hpp;hxx;hm;inl;inc;xsd
-
-
- {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
- cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx
-
-
- {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
- cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx
-
-
- {E0D8C965-CC5F-43d7-AD63-FAEF0BBC0F85}-cuda
- false
-
-
- {E0D8C965-CC5F-43d7-AD63-FAEF0BBC0F85}-cuda_d
- false
-
-
- {5ff8a653-a367-4660-9a27-27cf7b8d218c}
- cpp;moc
- False
-
-
- {c27b95d4-e4c3-47a3-9bc3-6d0f43086709}
- cpp;moc
- False
-
-
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Generated Files\Debug
-
-
- Generated Files\Release
-
-
- Generated Files\Debug
-
-
- Generated Files\Release
-
-
- Generated Files\Debug
-
-
- Generated Files\Release
-
-
- Generated Files\Debug
-
-
- Generated Files\Release
-
-
- Generated Files\Debug
-
-
- Generated Files\Release
-
-
- Generated Files\Debug
-
-
- Generated Files\Release
-
-
- Generated Files\Debug
-
-
- Generated Files\Release
-
-
- Generated Files\Debug
-
-
- Generated Files\Release
-
-
- Generated Files\Debug
-
-
- Generated Files\Release
-
-
- Generated Files\Debug
-
-
- Generated Files\Release
-
-
- Generated Files\Debug
-
-
- Generated Files\Release
-
-
- Generated Files\Debug
-
-
- Generated Files\Release
-
-
- Generated Files\Debug
-
-
- Generated Files\Release
-
-
- Generated Files\Debug
-
-
- Generated Files\Release
-
-
- Generated Files\Debug
-
-
- Generated Files\Release
-
-
- Generated Files\Debug
-
-
- Generated Files\Release
-
-
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
-
-
-
- Form Files
-
-
-
-
- cuda
-
-
-
-
- cuda_d
-
-
-
-
- Generated Files
-
-
- Header Files
-
-
-
\ No newline at end of file
diff --git a/CUGL.vcxproj.user b/CUGL.vcxproj.user
deleted file mode 100644
index ab23433..0000000
--- a/CUGL.vcxproj.user
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
- C:\Qt\5.5\msvc2013_64
- PATH=$(QTDIR)\bin%3b$(PATH)
-
-
- C:\Qt\5.5\msvc2013_64
- PATH=$(QTDIR)\bin%3b$(PATH)
-
-
\ No newline at end of file
diff --git a/GeneratedFiles/ui_mainwindow.h b/GeneratedFiles/ui_mainwindow.h
deleted file mode 100644
index f5746ce..0000000
--- a/GeneratedFiles/ui_mainwindow.h
+++ /dev/null
@@ -1,145 +0,0 @@
-/********************************************************************************
-** Form generated from reading UI file 'mainwindow.ui'
-**
-** Created by: Qt User Interface Compiler version 5.5.1
-**
-** WARNING! All changes made in this file will be lost when recompiling UI file!
-********************************************************************************/
-
-#ifndef UI_MAINWINDOW_H
-#define UI_MAINWINDOW_H
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-QT_BEGIN_NAMESPACE
-
-class Ui_MainWindow
-{
-public:
- QAction *actionExit;
- QAction *actionOpenGL;
- QAction *actionOpenGL_2;
- QAction *actionCUDA;
- QAction *actionOutput;
- QWidget *centralWidget;
- QMenuBar *menuBar;
- QMenu *menuFile;
- QMenu *menuView;
- QMenu *menuSettings;
- QMenu *menuHelp;
- QMenu *menuAbout;
- QStatusBar *statusBar;
-
- void setupUi(QMainWindow *MainWindow)
- {
- if (MainWindow->objectName().isEmpty())
- MainWindow->setObjectName(QStringLiteral("MainWindow"));
- MainWindow->resize(1200, 900);
- actionExit = new QAction(MainWindow);
- actionExit->setObjectName(QStringLiteral("actionExit"));
- actionOpenGL = new QAction(MainWindow);
- actionOpenGL->setObjectName(QStringLiteral("actionOpenGL"));
- actionOpenGL->setCheckable(true);
- actionOpenGL->setChecked(true);
- actionOpenGL_2 = new QAction(MainWindow);
- actionOpenGL_2->setObjectName(QStringLiteral("actionOpenGL_2"));
- actionOpenGL_2->setCheckable(true);
- actionOpenGL_2->setChecked(true);
- actionCUDA = new QAction(MainWindow);
- actionCUDA->setObjectName(QStringLiteral("actionCUDA"));
- actionCUDA->setCheckable(true);
- actionCUDA->setChecked(true);
- actionOutput = new QAction(MainWindow);
- actionOutput->setObjectName(QStringLiteral("actionOutput"));
- actionOutput->setCheckable(true);
- actionOutput->setChecked(false);
- centralWidget = new QWidget(MainWindow);
- centralWidget->setObjectName(QStringLiteral("centralWidget"));
- MainWindow->setCentralWidget(centralWidget);
- menuBar = new QMenuBar(MainWindow);
- menuBar->setObjectName(QStringLiteral("menuBar"));
- menuBar->setGeometry(QRect(0, 0, 400, 21));
- menuFile = new QMenu(menuBar);
- menuFile->setObjectName(QStringLiteral("menuFile"));
- menuView = new QMenu(menuBar);
- menuView->setObjectName(QStringLiteral("menuView"));
- menuSettings = new QMenu(menuView);
- menuSettings->setObjectName(QStringLiteral("menuSettings"));
- menuHelp = new QMenu(menuBar);
- menuHelp->setObjectName(QStringLiteral("menuHelp"));
- menuAbout = new QMenu(menuBar);
- menuAbout->setObjectName(QStringLiteral("menuAbout"));
- MainWindow->setMenuBar(menuBar);
- statusBar = new QStatusBar(MainWindow);
- statusBar->setObjectName(QStringLiteral("statusBar"));
- statusBar->setEnabled(true);
- statusBar->setFocusPolicy(Qt::NoFocus);
- statusBar->setAutoFillBackground(false);
- MainWindow->setStatusBar(statusBar);
-
- menuBar->addAction(menuFile->menuAction());
- menuBar->addAction(menuView->menuAction());
- menuBar->addAction(menuHelp->menuAction());
- menuBar->addAction(menuAbout->menuAction());
- menuFile->addAction(actionExit);
- menuView->addAction(actionOpenGL);
- menuView->addAction(menuSettings->menuAction());
- menuSettings->addAction(actionOpenGL_2);
- menuSettings->addAction(actionCUDA);
- menuSettings->addAction(actionOutput);
-
- retranslateUi(MainWindow);
-
- QMetaObject::connectSlotsByName(MainWindow);
- } // setupUi
-
- void retranslateUi(QMainWindow *MainWindow)
- {
- MainWindow->setWindowTitle(QApplication::translate("MainWindow", "MainWindow", 0));
- actionExit->setText(QApplication::translate("MainWindow", "Exit", 0));
- actionExit->setShortcut(QApplication::translate("MainWindow", "Esc", 0));
- actionOpenGL->setText(QApplication::translate("MainWindow", "OpenGL", 0));
-#ifndef QT_NO_TOOLTIP
- actionOpenGL->setToolTip(QApplication::translate("MainWindow", "OpenGL Window", 0));
-#endif // QT_NO_TOOLTIP
- actionOpenGL->setShortcut(QApplication::translate("MainWindow", "Shift+O", 0));
- actionOpenGL_2->setText(QApplication::translate("MainWindow", "OpenGL", 0));
-#ifndef QT_NO_TOOLTIP
- actionOpenGL_2->setToolTip(QApplication::translate("MainWindow", "OpenGL Settings", 0));
-#endif // QT_NO_TOOLTIP
- actionOpenGL_2->setShortcut(QApplication::translate("MainWindow", "Shift+Q", 0));
- actionCUDA->setText(QApplication::translate("MainWindow", "CUDA", 0));
-#ifndef QT_NO_TOOLTIP
- actionCUDA->setToolTip(QApplication::translate("MainWindow", "CUDA Settings", 0));
-#endif // QT_NO_TOOLTIP
- actionCUDA->setShortcut(QApplication::translate("MainWindow", "Shift+W", 0));
- actionOutput->setText(QApplication::translate("MainWindow", "Output", 0));
-#ifndef QT_NO_TOOLTIP
- actionOutput->setToolTip(QApplication::translate("MainWindow", "Output Settings", 0));
-#endif // QT_NO_TOOLTIP
- actionOutput->setShortcut(QApplication::translate("MainWindow", "Shift+E", 0));
- menuFile->setTitle(QApplication::translate("MainWindow", "File", 0));
- menuView->setTitle(QApplication::translate("MainWindow", "View", 0));
- menuSettings->setTitle(QApplication::translate("MainWindow", "Settings", 0));
- menuHelp->setTitle(QApplication::translate("MainWindow", "Help", 0));
- menuAbout->setTitle(QApplication::translate("MainWindow", "About", 0));
- } // retranslateUi
-
-};
-
-namespace Ui {
- class MainWindow: public Ui_MainWindow {};
-} // namespace Ui
-
-QT_END_NAMESPACE
-
-#endif // UI_MAINWINDOW_H
diff --git a/Kernels/kernel.cu b/Kernels/kernel.cu
index b3dc18b..4f97f98 100644
--- a/Kernels/kernel.cu
+++ b/Kernels/kernel.cu
@@ -11,61 +11,502 @@
#include
#include
#include
+#include
+#include
#include
#include
+#include
#include "math_constants.h"
#include "helper_math.h"
#include "utilities.h"
-#define N 4096
-#define N_ITERS 10
-#define BLOCK_SIZE 256
-#define N_BLOCKS (N + BLOCK_SIZE - 1) / BLOCK_SIZE
+//non-pow2 PBO doesn't work
+#define N_X 256 //not inc ghost
+#define N_Y 256 //not inc ghost
+#define N N_X * N_Y //not inc ghost
+#define BLOCK_SIZE_X 16 //inc ghost/overlap //large size should hide wasted threads better - CHECK!
+#define BLOCK_SIZE_Y 16 //inc ghost/overlap
+#define BLOCK_SIZE_COPY_X 16
+#define BLOCK_SIZE_COPY_Y 16
+#define N_BLOCKS_X (N_X + (BLOCK_SIZE_X - 2) - 1) / (BLOCK_SIZE_X - 2) //-2 for increased no blocks for ghost cells
+#define N_BLOCKS_Y (N_Y + (BLOCK_SIZE_Y - 2) - 1) / (BLOCK_SIZE_Y - 2)
+#define N_BLOCKS_RAND (N + (BLOCK_SIZE_X * BLOCK_SIZE_Y) - 1) / (BLOCK_SIZE_X * BLOCK_SIZE_Y)
+#define N_BLOCKS_COPY_X (N_X + BLOCK_SIZE_COPY_X - 1) / BLOCK_SIZE_COPY_X
+#define N_BLOCKS_COPY_Y (N_Y + BLOCK_SIZE_COPY_Y - 1) / BLOCK_SIZE_COPY_Y
+#define STREAM_COUNT 5
-__global__ void setup_rand(curandState *state){
+namespace CUMath
+{
+ //non-empty constructor was drastically slowing down performance (1->10ms)
+ __host__ __device__ SimpleComplex::SimpleComplex()
+ {
+ //real = 0.0f;
+ //imag = 0.0f;
+ }
+
+ __host__ __device__ SimpleComplex::SimpleComplex(float real, float imag)
+ {
+ this->real = real;
+ this->imag = imag;
+ }
+
+ __host__ __device__ SimpleComplex SimpleComplex::Polar(float amp, float theta)
+ {
+ return SimpleComplex(cosf(theta) * amp, sinf(theta) * amp);
+ }
+
+ __host__ __device__ float SimpleComplex::abs()
+ {
+ return sqrt(real * real + imag * imag);
+ }
+ __host__ __device__ float SimpleComplex::absSq()
+ {
+ return real * real + imag * imag;
+ }
+
+ __host__ __device__ float SimpleComplex::Angle()
+ {
+ float angle = 0.0f;
+ angle = atan2f(imag, real);
+
+ if(real < 0)
+ {
+ angle += CUDART_PI_F;
+ }
+ else if(angle < 0)
+ {
+ angle += CUDART_PI_F * 2.0f;
+ }
+
+ return angle;
+ }
- int idx = threadIdx.x + blockIdx.x * blockDim.x;
- curand_init(1234, idx, 0, &state[idx]);
+ __host__ __device__ SimpleComplex SimpleComplex::operator*(const float& f) const
+ {
+ return SimpleComplex(real * f, imag * f);
+ }
+
+ __host__ __device__ SimpleComplex SimpleComplex::operator/(const float& f) const
+ {
+ return SimpleComplex(real / f, imag / f);
+ }
+
+ __host__ __device__ SimpleComplex SimpleComplex::operator+(const SimpleComplex& c) const
+ {
+ return SimpleComplex(real + c.real, imag + c.imag);
+ }
}
-inline
-__device__ unsigned char countAliveCells(int *data, size_t x0, size_t x1, size_t x2,
- size_t y0, size_t y1, size_t y2)
+struct HQubit
{
- return data[x0 + y0] + data[x1 + y0] + data[x2 + y0]
- + data[x0 + y1] + data[x2 + y1]
- + data[x0 + y2] + data[x1 + y2] + data[x2 + y2];
-}
+ std::complex zero = std::complex();
+ std::complex one = std::complex();
-__global__
-void GOL(uchar4 *texBuf, int *lifeBuf, int *output, size_t width, size_t height)
+ HQubit(){};
+
+ HQubit(float amp, float theta)
+ {
+ one = std::polar(amp, theta); //std::complex(amp, theta);
+ zero = std::polar(1 - amp, theta);
+ }
+
+ //QCA
+ //|modulus| of sum of surrounding neighbours = rule to apply
+
+ void Normalise()
+ {
+ double norm = sqrt(abs(zero) * abs(zero) + abs(one) * abs(one)); //sqrt(pow(abs(zero), 2) + pow(abs(one), 2));
+ zero /= norm;
+ one /= norm;
+ }
+
+ int Measure()
+ {
+ float oneProb = abs(one) * abs(one); //pow(abs(one), 2);
+ float roll = (rand() / (float)RAND_MAX);
+
+ if(roll < oneProb)
+ {
+ return 1;
+ }
+ else
+ {
+ return 0;
+ }
+ }
+};
+
+struct DQubit
+{
+ CUMath::SimpleComplex zero, one;
+
+ __host__ __device__ DQubit(){}
+
+ __host__ __device__ DQubit(float amp, float theta)
+ {
+ one = CUMath::SimpleComplex::Polar(amp, theta);
+ zero = CUMath::SimpleComplex::Polar(sqrtf(1.0f - (amp * amp)), theta);
+ }
+
+ //QCA
+ //|modulus| of sum of surrounding neighbours = rule to apply
+ //sum of phase = theta to use in OP
+
+ __host__ __device__ void Normalise()
+ {
+ float norm = sqrtf(zero.absSq() + one.absSq()); //sqrt(pow(abs(zero), 2) + pow(thrust::abs(one), 2));
+ one = one / norm;
+ zero = zero / norm;
+ }
+
+ //to-do: implement prob field with white = dead % and varying colours (from angle) = alive
+ //look up gradient implementation
+ __device__ int Measure(curandState *state)
+ {
+ //prob of finding qubit in |1>
+ float oneProb = one.absSq();
+
+ //curand 0-1
+ if(curand_uniform(state) < oneProb)
+ {
+ return 1;
+ }
+ else
+ {
+ return 0;
+ }
+ }
+};
+
+__device__ curandState randArray[N]; //rand doesn't need extra
+
+static curandState* randPtr;
+static int *lifePtr;
+static int *lifeTempPtr;
+static DQubit *qubitPtr;
+static DQubit *qubitTempPtr;
+static int *cornersPtr;
+static CUTimer t("Timings\\QGoL_Shared_256_5.txt");
+static cudaStream_t streams[STREAM_COUNT];
+
+__global__ void setup_rand(curandState *state)
{
int x = threadIdx.x + blockIdx.x * blockDim.x;
int y = threadIdx.y + blockIdx.y * blockDim.y;
int offset = x + y * blockDim.x * gridDim.x;
+ if(offset < (N_X * N_Y))
+ {
+ curand_init((unsigned long long)clock(), offset, 0, &state[offset]); //random seed of (unsigned long long)clock()
+ }
+}
+
+__global__ void CopyToTop(int *life, DQubit *qubits)
+{
+ //copy bottom row to top (ghost cells)
+ int x = threadIdx.x + blockIdx.x * blockDim.x + 1; //threads = 1 <= N_X
- if(offset < N)
+ if(x <= N_X)
{
- size_t x1 = offset % width;
- size_t y1 = offset - x1;
- size_t y0 = (y1 + (width * height) - width) % (width * height);
- size_t y2 = (y1 + width) % (width * height);
- size_t x0 = (x1 + width - 1) % width;
- size_t x2 = (x1 + 1) % width;
+ life[x] = life[x + N_Y * (N_X + 2)]; //N_Y
+ qubits[x] = qubits[x + N_Y * (N_X + 2)];
+ }
+}
+
+__global__ void CopyToBottom(int *life, DQubit *qubits)
+{
+ //copy top row to bottom (ghost cells)
+ int x = threadIdx.x + blockIdx.x * blockDim.x + 1; //threads = 1 <= N_X
- unsigned char aliveCells = countAliveCells(lifeBuf, x0, x1, x2, y0, y1, y2);
- output[y1 + x1] =
- aliveCells == 3 || (aliveCells == 2 && lifeBuf[x1 + y1]) ? 1 : 0;
+ if(x <= N_X)
+ {
+ life[x + (N_Y + 1) * (N_X + 2)] = life[x + N_X + 2];
+ qubits[x + (N_Y + 1) * (N_X + 2)] = qubits[x + N_X + 2];
}
}
+__global__ void CopyToLeft(int *life, DQubit *qubits)
+{
+ //copy right column to left (ghost cells)
+ int x = threadIdx.x + blockIdx.x * blockDim.x + 1; //threads = 1 <= N_Y
+
+ if(x <= N_Y)
+ {
+ x *= N_X + 2; //transform to vertical
+
+ life[x] = life[x + N_X];
+ qubits[x] = qubits[x + N_X];
+ }
+}
+
+__global__ void CopyToRight(int *life, DQubit *qubits)
+{
+ //copy left column to right (ghost cells)
+ int x = threadIdx.x + blockIdx.x * blockDim.x + 1; //threads = 1 <= N_Y
+
+ if(x <= N_Y)
+ {
+ x *= N_X + 2; //transform to vertical
+
+ life[x + (N_X + 1)] = life[x + 1];
+ qubits[x + (N_X + 1)] = qubits[x + 1];
+ }
+}
+
+//ids contains destination and source ids (0-3 = dest, 4-7 = source)
+__global__ void CopyToCorners(int *life, DQubit *qubits, int ids[])
+{
+ //copy left column to right (ghost cells)
+ int x = threadIdx.x + blockIdx.x * blockDim.x; //threads = 0 < 4
+ life[ids[x]] = life[ids[x + 4]];
+ qubits[ids[x]] = qubits[ids[x + 4]];
+}
+
+inline
+__device__ void BirthOp(DQubit *q, float thetaSum, float multiplier = 1.0f)
+{
+ //a+|b|e^(i*theta)
+
+ //*q = (*q + DQubit::Polar(q->ZeroStateAmp, thetaSum)) * multiplier;
+ q->one = (q->one + CUMath::SimpleComplex::Polar(q->zero.abs(), thetaSum)) * multiplier;
+ q->zero = CUMath::SimpleComplex(0.0f, 0.0f);
+}
+
+//|0> angle does not effect simulations?
+inline
+__device__ void DeathOp(DQubit *q, float thetaSum, float multiplier = 1.0f)
+{
+ //b + |a|e^(i*theta)
+
+ //*q = (DQubit::Polar(q->ZeroStateAmp, q->Angle()) + DQubit::Polar(q->cAbs(), thetaSum)) * multiplier;
+ q->zero = (q->zero + CUMath::SimpleComplex::Polar(q->one.abs(), thetaSum)) * multiplier;
+ q->one = CUMath::SimpleComplex(0.0f, 0.0f);
+}
+
+//optimise qubits passed in
+//load in block to shared
+//watch out for overlap (load extra or use global sparingly)
+inline
+__device__ CUMath::SimpleComplex SumNeighbours(DQubit(*qubits)[BLOCK_SIZE_X][BLOCK_SIZE_Y], int(*lifeData)[BLOCK_SIZE_X][BLOCK_SIZE_Y], int x, int y)
+{
+ //sum of all surrounding superpositions (Ae^(i*theta))
+
+ CUMath::SimpleComplex sum = CUMath::SimpleComplex(0.0f, 0.0f);
+
+ if((*lifeData)[x - 1][y - 1] == 1)
+ sum = sum + (*qubits)[x - 1][y - 1].one;
+ if((*lifeData)[x][y - 1] == 1)
+ sum = sum + (*qubits)[x][y - 1].one;
+ if((*lifeData)[x + 1][y - 1] == 1)
+ sum = sum + (*qubits)[x + 1][y - 1].one;
+ if((*lifeData)[x - 1][y] == 1)
+ sum = sum + (*qubits)[x - 1][y].one;
+ if((*lifeData)[x + 1][y] == 1)
+ sum = sum + (*qubits)[x + 1][y].one;
+ if((*lifeData)[x - 1][y + 1] == 1)
+ sum = sum + (*qubits)[x - 1][y + 1].one;
+ if((*lifeData)[x][y + 1] == 1)
+ sum = sum + (*qubits)[x][y + 1].one;
+ if((*lifeData)[x + 1][y + 1] == 1)
+ sum = sum + (*qubits)[x + 1][y + 1].one;
+
+ //no if statements - causes NaN errors with NSIGHT (probably from casting 0 to float)
+ /*sum += (*qubits)[x - 1][y - 1].one * (float)(*lifeData)[x - 1][y - 1];
+ sum += (*qubits)[x][y - 1].one * (float)(*lifeData)[x][y - 1];
+ sum += (*qubits)[x + 1][y - 1].one * (float)(*lifeData)[x + 1][y - 1];
+ sum += (*qubits)[x - 1][y].one * (float)(*lifeData)[x - 1][y];
+ sum += (*qubits)[x + 1][y].one * (float)(*lifeData)[x + 1][y];
+ sum += (*qubits)[x - 1][y + 1].one * (float)(*lifeData)[x - 1][y + 1];
+ sum += (*qubits)[x][y + 1].one * (float)(*lifeData)[x][y + 1];
+ sum += (*qubits)[x + 1][y + 1].one * (float)(*lifeData)[x + 1][y + 1];*/
+
+ return sum;
+}
+
+//remove temps from params
+__global__
+void QGOL(float *topProb, float *bottomProb, int *lifeBuf, int *output, DQubit *qubits, DQubit *tempQubits, curandState *states)
+{
+ int t_X = threadIdx.x;
+ int t_Y = threadIdx.y;
+ //new x/y coords with ghost cells
+ int x = t_X + blockIdx.x * (blockDim.x - 2); //pushback id to cover overlap column from prev block
+ int y = t_Y + blockIdx.y * (blockDim.y - 2); //pushback id to cover overlap row from prev block
+ int offset = x + y * (N_X + 2); //use N_X over blockDim * gridDim due to overlapping blocks
+ int innerOffset = (x - 1) + (y - 1) * N_X; //move up/left diag and put into inner grid dim
+
+ //change to 1D array and test perf
+ __shared__ int s_Life[BLOCK_SIZE_X][BLOCK_SIZE_Y];
+ __shared__ DQubit s_Qubits[BLOCK_SIZE_X][BLOCK_SIZE_Y];
+
+ //if in range (inc ghost cells)
+ if(x < (N_X + 2) && y < (N_Y + 2))
+ {
+ s_Life[t_X][t_Y] = lifeBuf[offset];
+ s_Qubits[t_X][t_Y] = qubits[offset];
+ }
+
+ __syncthreads();
+
+ if(x > 0 && y > 0 && x < (N_X + 1) && y < (N_Y + 1)) //skips ghost cells
+ {
+ if(t_X > 0 && t_X < blockDim.x - 1 && t_Y > 0 && t_Y < blockDim.y - 1) //skip overlap cells
+ {
+ //sum neighbours
+ //take abs(sum) for neighbour count
+ //take angle from sum to use in various ops
+ //perform op
+ //normalise
+
+ curandState localState = states[innerOffset]; //use inner grid id to reduce number of rand variables
+ DQubit q = s_Qubits[t_X][t_Y];
+ DQubit qtemp = q;
+
+ CUMath::SimpleComplex sum = SumNeighbours(&s_Qubits, &s_Life, t_X, t_Y);
+ float mod = sum.abs();
+ float sumAngle = sum.Angle();
+
+ //determine op from mod
+ //0 <= A <= 1 op = D
+ //1 < A <= 2 op = (sqrt(2)+1)(2-A)D + (A-1)S
+ //2 < A <= 3 op = (sqrt(2)+1)(3-A)S + (A-2)B
+ //3 < A < 4 op = (sqrt(2)+1)(4-A)B + (A-3)D
+ //A >= 4 op = D
+
+ if(mod >= 0 && mod <= 1)
+ {
+ //D
+ DeathOp(&q, sumAngle); //.imag != angle //change 1st/last OP to q = 0 for optimisation
+ }
+ else if(mod > 1 && mod <= 2)
+ {
+ //D & S
+ DeathOp(&q, sumAngle, (sqrtf(2.0f) + 1.0f) * (2.0f - mod));
+ qtemp.zero = qtemp.zero * (mod - 1.0f);
+ qtemp.one = qtemp.one * (mod - 1.0f);
+ q.zero = q.zero + qtemp.zero;
+ q.one = q.one + qtemp.one;
+ }
+ else if(mod > 2 && mod <= 3)
+ {
+ //S & B
+ q.zero = q.zero * (sqrtf(2.0f) + 1.0f) * (3.0f - mod);
+ q.one = q.one * (sqrtf(2.0f) + 1.0f) * (3.0f - mod);
+ BirthOp(&qtemp, sumAngle, (mod - 2.0f));
+ q.zero = q.zero + qtemp.zero;
+ q.one = q.one + qtemp.one;
+ }
+ else if(mod > 3 && mod < 4)
+ {
+ //B & D
+ BirthOp(&q, sumAngle, (sqrtf(2.0f) + 1.0f) * (4.0f - mod));
+ DeathOp(&qtemp, sumAngle, (mod - 3.0f));
+ q.zero = q.zero + qtemp.zero;
+ q.one = q.one + qtemp.one;
+ }
+ else if(mod >= 4)
+ {
+ //D
+ DeathOp(&q, sumAngle);
+ }
+ else
+ {
+ //something went wrong
+ assert(0);
+ }
+
+ //measure state to update lifebuf
+ //update tex
+
+ q.Normalise();
+
+ int alive = q.Measure(&localState);
+
+ output[offset] = alive;
+ topProb[innerOffset] = q.one.absSq();
+ bottomProb[innerOffset] = q.zero.absSq();
+ //texBuf[innerOffset].x = (alive == 0) ? 255 : 0; //check perf
+ //texBuf[offset].y = (abs(qtemp2.one) == 0) ? 255 : 0; //for multi-colour cells (D/D = White|D/A = Green|A/D = Purple|A/A = Black)
+ //texBuf[offset].y = (alive == 0) ? 255 : 0;
+ //texBuf[offset].z = (alive == 0) ? 255 : 0;
+ //texBuf[offset].w = 255;
+ tempQubits[offset] = q;
+ }
+ }
+}
+
+void FindCornerIDs(int *ids)
+{
+ ids[0] = 0; //top left
+ ids[1] = N_X + 1; //top right
+ ids[2] = (N_X + 2) * (N_Y + 2) - (N_X + 2); //bottom left
+ ids[3] = (N_X + 2) * (N_Y + 2) - 1; //bottom right
+ ids[4] = ids[3] - (N_X + 2) - 1;
+ ids[5] = ids[4] - (N_X - 1);
+ ids[6] = (N_X + 2) + 1 + (N_X - 1);
+ ids[7] = ids[6] - (N_X - 1);
+}
+
+void CUSetup()
+{
+ //cudaOccupancyMaxPotentialBlockSize(...
+ for(int i = 0; i < STREAM_COUNT; i++)
+ {
+ cudaStreamCreate(&streams[i]);
+ }
+
+ ERRORCHECK(cudaGetSymbolAddress((void**)&randPtr, randArray));
+ setup_rand << > >(randPtr);
+ ERRORCHECK(cudaGetLastError());
+
+ int *hCornerPtr = (int*)malloc(8 * sizeof(int));
+ FindCornerIDs(hCornerPtr);
+ ERRORCHECK(cudaMalloc((void**)&cornersPtr, 8 * sizeof(int)));
+ ERRORCHECK(cudaMemcpy(cornersPtr, hCornerPtr, 8 * sizeof(int), cudaMemcpyHostToDevice));
+
+ int *hLifePtr = (int*)malloc((N_X + 2) * (N_Y + 2) * sizeof(int));
+ DQubit *hQubitPtr = (DQubit*)malloc((N_X + 2) * (N_Y + 2) * sizeof(DQubit));
+
+ for(int i = 0; i < (N_X + 2) * (N_Y + 2); ++i)
+ {
+ hLifePtr[i] = (1.5f - 0.5f) * (rand() / (float)RAND_MAX) + 0.5f;
+ hQubitPtr[i] = DQubit(hLifePtr[i], (rand() / (float)RAND_MAX) * (2 * CUDART_PI_F));
+ }
+
+ ERRORCHECK(cudaMalloc((void**)&lifePtr, (N_X + 2) * (N_Y + 2) * sizeof(int)));
+ ERRORCHECK(cudaMalloc((void**)&lifeTempPtr, (N_X + 2) * (N_Y + 2) * sizeof(int)));
+ ERRORCHECK(cudaMemcpy(lifePtr, hLifePtr, (N_X + 2) * (N_Y + 2) * sizeof(int), cudaMemcpyHostToDevice));
+ ERRORCHECK(cudaMemcpy(lifeTempPtr, lifePtr, (N_X + 2) * (N_Y + 2) * sizeof(int), cudaMemcpyDeviceToDevice));
+
+ ERRORCHECK(cudaMalloc((void**)&qubitPtr, (N_X + 2) * (N_Y + 2) * sizeof(DQubit)));
+ ERRORCHECK(cudaMalloc((void**)&qubitTempPtr, (N_X + 2) * (N_Y + 2) * sizeof(DQubit)));
+ ERRORCHECK(cudaMemcpy(qubitPtr, hQubitPtr, (N_X + 2) * (N_Y + 2) * sizeof(DQubit), cudaMemcpyHostToDevice));
+ ERRORCHECK(cudaMemcpy(qubitTempPtr, qubitPtr, (N_X + 2) * (N_Y + 2) * sizeof(DQubit), cudaMemcpyDeviceToDevice));
+
+ free(hCornerPtr);
+ free(hLifePtr);
+ free(hQubitPtr);
+}
+
//UI option for iterations
void CUExecuteKernel(std::vector *params) //std::vector *params, size_t instances, float dt
{
- //CUTimer t;
- //t.Begin();
- GOL<<>>((uchar4*)(params->at(0)), (int*)(params->at(1)), (int*)(params->at(2)));
+ t.Begin();
+
+ CopyToTop << > >(lifePtr, qubitPtr);
+ CopyToBottom << > >(lifePtr, qubitPtr);
+ CopyToLeft << > >(lifePtr, qubitPtr);
+ CopyToRight << > >(lifePtr, qubitPtr);
+ CopyToCorners << <1, 4, 0, streams[4] >> >(lifePtr, qubitPtr, cornersPtr);
+
+ cudaDeviceSynchronize();
+
+ QGOL << > >((float*)(params->at(0)), (float*)(params->at(1)), lifePtr, lifeTempPtr, qubitPtr, qubitTempPtr, randPtr);
+
+ t.End();
+
+ //normal swap since static
+ std::swap(lifePtr, lifeTempPtr);
+ std::swap(qubitPtr, qubitTempPtr);
ERRORCHECK(cudaGetLastError());
- //t.End();
}
\ No newline at end of file
diff --git a/Savable.h b/Savable.h
new file mode 100644
index 0000000..80a2bca
--- /dev/null
+++ b/Savable.h
@@ -0,0 +1,12 @@
+#pragma once
+
+#include
+#include
+
+class Savable
+{
+public:
+ virtual ~Savable();
+ virtual void Save(QTextStream *output, std::vector *varList);
+};
+
diff --git a/Shaders/bottom_prob_3_3.vert b/Shaders/bottom_prob_3_3.vert
new file mode 100644
index 0000000..ea2e7d7
--- /dev/null
+++ b/Shaders/bottom_prob_3_3.vert
@@ -0,0 +1,15 @@
+#version 330
+
+uniform highp mat4 uModelMatrix;
+uniform highp mat4 uViewMatrix;
+uniform highp mat4 uProjMatrix;
+
+in highp vec3 aPos;
+in int gl_InstanceID;
+
+void main()
+{
+ vec3 iPos = vec3(gl_InstanceID % 256, 0, gl_InstanceID / 256);
+ iPos *= 2.0f; //2 = cell width
+ gl_Position = uProjMatrix * uViewMatrix * uModelMatrix * vec4(aPos + iPos, 1.0);
+}
\ No newline at end of file
diff --git a/Shaders/heightmap.frag b/Shaders/heightmap.frag
new file mode 100644
index 0000000..adaf08b
--- /dev/null
+++ b/Shaders/heightmap.frag
@@ -0,0 +1,14 @@
+#version 330
+
+uniform sampler2D texture;
+
+in mediump vec2 texCoords;
+
+layout(location = 0) out highp vec4 colour;
+
+void main()
+{
+ colour = texture2D(texture, texCoords);
+ colour.g += colour.r;
+ colour.b += colour.r;
+}
\ No newline at end of file
diff --git a/Shaders/heightmap.vert b/Shaders/heightmap.vert
new file mode 100644
index 0000000..6b5f8e2
--- /dev/null
+++ b/Shaders/heightmap.vert
@@ -0,0 +1,22 @@
+#version 330
+
+uniform highp mat4 uModelMatrix;
+uniform highp mat4 uViewMatrix;
+uniform highp mat4 uProjMatrix;
+uniform sampler2D texture;
+
+in highp vec3 aPos;
+in highp vec4 iPos;
+in mediump vec2 aUV;
+
+out mediump vec2 texCoords;
+
+void main()
+{
+ vec4 colour = texture2D(texture, aUV);
+ texCoords = aUV;
+
+ vec4 position = vec4(aPos + iPos.xyz, 1.0);
+ position.y += colour.r;
+ gl_Position = uProjMatrix * uViewMatrix * uModelMatrix * position;
+}
\ No newline at end of file
diff --git a/Shaders/prob_3_3.frag b/Shaders/prob_3_3.frag
new file mode 100644
index 0000000..b3f8245
--- /dev/null
+++ b/Shaders/prob_3_3.frag
@@ -0,0 +1,14 @@
+#version 330
+
+uniform sampler2D tex;
+
+layout(location = 0) out highp vec4 colour;
+in mediump vec2 texCoords;
+
+void main()
+{
+ colour = texture2D(tex, texCoords);
+
+ if(colour == vec4(1.0, 1.0, 1.0, 1.0))
+ colour = vec4(1.0, 0.0, 0.0, 1.0);
+}
\ No newline at end of file
diff --git a/Shaders/simple_3_3.frag b/Shaders/simple_3_3.frag
index d6dab31..adaf08b 100644
--- a/Shaders/simple_3_3.frag
+++ b/Shaders/simple_3_3.frag
@@ -9,4 +9,6 @@ layout(location = 0) out highp vec4 colour;
void main()
{
colour = texture2D(texture, texCoords);
+ colour.g += colour.r;
+ colour.b += colour.r;
}
\ No newline at end of file
diff --git a/Shaders/simple_3_3.vert b/Shaders/simple_3_3.vert
index 5966ad7..773c2c8 100644
--- a/Shaders/simple_3_3.vert
+++ b/Shaders/simple_3_3.vert
@@ -1,13 +1,13 @@
#version 330
-in highp vec3 aPos;
-in highp vec4 iPos;
-in mediump vec2 aUV;
-
uniform highp mat4 uModelMatrix;
uniform highp mat4 uViewMatrix;
uniform highp mat4 uProjMatrix;
+in highp vec3 aPos;
+in highp vec4 iPos;
+in mediump vec2 aUV;
+
out mediump vec2 texCoords;
void main()
diff --git a/Shaders/top_prob_3_3.vert b/Shaders/top_prob_3_3.vert
new file mode 100644
index 0000000..7ee6b8a
--- /dev/null
+++ b/Shaders/top_prob_3_3.vert
@@ -0,0 +1,31 @@
+#version 330
+
+uniform highp mat4 uModelMatrix;
+uniform highp mat4 uViewMatrix;
+uniform highp mat4 uProjMatrix;
+
+in highp vec3 aPos;
+in mediump vec2 aUV;
+in float tProb;
+in float bProb;
+in int gl_InstanceID;
+
+out mediump vec2 texCoords;
+
+void main()
+{
+ texCoords = aUV;
+
+ vec3 iPos = vec3(gl_InstanceID % 256, 0, gl_InstanceID / 256);
+ iPos *= 2.0f; //2 = cell width
+
+ vec4 gridPos = vec4(aPos + iPos, 1.0);
+
+ if(gridPos.y > 0)
+ {
+ gridPos.y *= (50 * tProb);
+ //texCoords.y *= (50 * tProb);
+ }
+
+ gl_Position = uProjMatrix * uViewMatrix * uModelMatrix * gridPos;
+}
\ No newline at end of file
diff --git a/bufferpopup.cpp b/bufferpopup.cpp
index f05ce66..5d2342d 100644
--- a/bufferpopup.cpp
+++ b/bufferpopup.cpp
@@ -1,41 +1,13 @@
#include "bufferpopup.h"
#include "glsettings.h"
-#pragma region Shapes
-float quad[] =
-{
- -0.5f, -0.5f, 0.0f,
- -0.5f, 0.5f, 0.0f,
- 0.5f, 0.5f, 0.0f,
- 0.5f, 0.5f, 0.0f,
- 0.5f, -0.5f, 0.0f,
- -0.5f, -0.5f, 0.0f
-};
-
-float quadUV[] =
-{
- 0.0f, 1.0f,
- 0.0f, 0.0f,
- 1.0f, 0.0f,
- 1.0f, 0.0f,
- 1.0f, 1.0f,
- 0.0f, 1.0f
-};
-
-GLfloat triangle[] =
-{
- -1.0f, -1.0f, 0.0f,
- 0.0f, 1.0f, 0.0f,
- 1.0f, -1.0f, 0.0f,
-};
-#pragma endregion Shapes
-
BufferPopup::BufferPopup(QWidget* parent) : QDialog(parent, Qt::WindowTitleHint | Qt::WindowCloseButtonHint)
{
append = false;
//Object detail popup
//setup layouts/widgets
mainLayout = new QGridLayout;
+ checkboxLayout = new QHBoxLayout;
nameLabel = new QLabel("Name/ID:");
targetLabel = new QLabel("Target:");
@@ -46,12 +18,14 @@ BufferPopup::BufferPopup(QWidget* parent) : QDialog(parent, Qt::WindowTitleHint
attribCapacityLabel = new QLabel("Attribute Capacity:");
typeLabel = new QLabel("Type:");
normalisedLabel = new QLabel("Normalised:");
+ perInstanceLabel = new QLabel("Per Instance:");
nameBox = new QLineEdit;
//SIGNAL/SLOT if there's parameters
targetBox = new QComboBox;
targetBox->addItem("GL_ARRAY_BUFFER");
+ targetBox->addItem("GL_ELEMENT_ARRAY_BUFFER");
targetBox->addItem("GL_PIXEL_UNPACK_BUFFER");
targetBox->connect(targetBox, SIGNAL(currentIndexChanged(int)), this, SLOT(TargetChanged(int)));
@@ -63,7 +37,10 @@ BufferPopup::BufferPopup(QWidget* parent) : QDialog(parent, Qt::WindowTitleHint
dataPickerBox = new QComboBox;
dataPickerBox->addItem("Custom");
dataPickerBox->addItem("Screen Aligned Quad Vertices");
- dataPickerBox->addItem("Screen Aligned Quad UV");
+ dataPickerBox->addItem("Screen Aligned Quad UVs");
+ dataPickerBox->addItem("Cube Vertices");
+ dataPickerBox->addItem("Cube UVs");
+ dataPickerBox->addItem("Cube Indices");
dataPickerBox->connect(dataPickerBox, SIGNAL(currentIndexChanged(int)), this, SLOT(DataChanged(int)));
dataBox = new QLineEdit;
@@ -74,6 +51,7 @@ BufferPopup::BufferPopup(QWidget* parent) : QDialog(parent, Qt::WindowTitleHint
{
textureBox->addItem(GLSettings::TextureList.at(i)->Name());
}
+ textureBox->connect(textureBox, SIGNAL(currentIndexChanged(int)), this, SLOT(TextureChanged(int)));
textureBox->hide();
usageBox = new QComboBox;
@@ -101,6 +79,12 @@ BufferPopup::BufferPopup(QWidget* parent) : QDialog(parent, Qt::WindowTitleHint
typeBox->addItem("GL_UNSIGNED_BYTE");
normalisedBox = new QCheckBox;
+ perInstanceBox = new QCheckBox;
+
+ checkboxLayout->addWidget(normalisedLabel);
+ checkboxLayout->addWidget(normalisedBox);
+ checkboxLayout->addWidget(perInstanceLabel);
+ checkboxLayout->addWidget(perInstanceBox);
buttons = new QDialogButtonBox(QDialogButtonBox::Save | QDialogButtonBox::Cancel);
connect(buttons, SIGNAL(accepted()), this, SLOT(Save()));
@@ -124,8 +108,7 @@ BufferPopup::BufferPopup(QWidget* parent) : QDialog(parent, Qt::WindowTitleHint
mainLayout->addWidget(attribCapacityBox, 7, 1);
mainLayout->addWidget(typeLabel, 8, 0);
mainLayout->addWidget(typeBox, 8, 1);
- mainLayout->addWidget(normalisedLabel, 9, 0);
- mainLayout->addWidget(normalisedBox, 9, 1);
+ mainLayout->addLayout(checkboxLayout, 9, 0, 1, 2);
mainLayout->addWidget(buttons, 10, 1);
setLayout(mainLayout);
@@ -150,13 +133,28 @@ BufferPopup::BufferPopup(QWidget* parent, CUGLBuffer *b) : BufferPopup(parent)
dataPickerBox->setCurrentIndex(2);
DisableBufferBoxes(true);
}
+ else if(b->bName == "Cube Vertices")
+ {
+ dataPickerBox->setCurrentIndex(3);
+ DisableBufferBoxes(true);
+ }
+ else if(b->bName == "Cube UVs")
+ {
+ dataPickerBox->setCurrentIndex(4);
+ DisableBufferBoxes(true);
+ }
+ else if(b->bName == "Cube Indices")
+ {
+ dataPickerBox->setCurrentIndex(5);
+ DisableBufferBoxes(true);
+ }
else
{
dataPickerBox->setCurrentIndex(0);
dataBox->setText(b->bDataPath);
DisableBufferBoxes(false);
}
-
+
usageBox->setCurrentIndex(usageBox->findText(b->bUsage.second));
attribNameBox->setText(b->aID.first);
attribCapacityBox->setValue(b->aSize);
@@ -166,30 +164,6 @@ BufferPopup::BufferPopup(QWidget* parent, CUGLBuffer *b) : BufferPopup(parent)
BufferPopup::~BufferPopup()
{
- delete nameLabel;
- delete targetLabel;
- delete capacityLabel;
- delete dataLabel;
- delete usageLabel;
- delete attribNameLabel;
- delete attribCapacityLabel;
- delete typeLabel;
- delete normalisedLabel;
-
- delete nameBox;
- delete dataPickerBox;
- delete dataBox;
- delete textureBox;
- delete attribNameBox;
- delete capacityBox;
- delete attribCapacityBox;
- delete targetBox;
- delete usageBox;
- delete typeBox;
- delete normalisedBox;
-
- delete buttons;
-
delete mainLayout;
}
@@ -206,18 +180,18 @@ bool BufferPopup::Validation()
{
nameBox->setStyleSheet("");
}
-
+
//set bool for correct custom load
//if not empty, check for successful load
//if blank, set data as 0
/*if(dataBox->text().isEmpty()) //or if file fails to load
{
- dataBox->setStyleSheet("border: 2px solid red");
- result = false;
+ dataBox->setStyleSheet("border: 2px solid red");
+ result = false;
}
else
{
- dataBox->setStyleSheet("");
+ dataBox->setStyleSheet("");
}*/
if(attribNameBox->text().isEmpty()) //if string, check returned id
@@ -258,75 +232,43 @@ void BufferPopup::TargetChanged(int i)
{
switch(i)
{
- case 0:
- {
- dataLabel->setText("Data:");
- dataPickerBox->show();
- dataBox->show();
+ case 0:
+ case 1:
+ {
+ dataLabel->setText("Data:");
+ dataPickerBox->show();
+ dataBox->show();
- capacityLabel->show();
- capacityBox->show();
+ capacityLabel->show();
+ capacityBox->show();
+ capacityBox->setValue(0);
- textureBox->hide();
- break;
- }
- case 1:
- {
- dataLabel->setText("Texture:");
- dataPickerBox->hide();
- dataBox->hide();
+ textureBox->hide();
+ break;
+ }
+ case 2:
+ {
+ dataLabel->setText("Texture:");
+ dataPickerBox->hide();
+ dataBox->hide();
- capacityLabel->hide();
- capacityBox->hide();
+ capacityLabel->hide();
+ capacityBox->hide();
- textureBox->show();
- break;
- }
+ textureBox->show();
+ textureBox->setCurrentIndex(-1);
+ textureBox->setCurrentIndex(0);
+ break;
}
-}
-
-void BufferPopup::SetTarget()
-{
- switch(targetBox->currentIndex())
- {
- case 0:
- {
- target.first = GL_ARRAY_BUFFER;
- break;
- }
- case 1:
- {
- target.first = GL_PIXEL_UNPACK_BUFFER;
- break;
- }
}
-
- target.second = targetBox->currentText();
}
-void BufferPopup::SetData()
+void BufferPopup::TextureChanged(int i)
{
- if(targetBox->currentIndex() == 0)
- {
- switch(dataPickerBox->currentIndex())
- {
- case 1:
- {
- data = quad;
- break;
- }
- case 2:
- {
- data = quadUV;
- break;
- }
- }
- }
- else
+ if(i != -1)
{
Texture *t = GLSettings::TextureList.at(textureBox->currentIndex());
- capacityBox->setValue(t->ImageSize().width() * t->ImageSize().height() * 4);
- data = nullptr;//(void*)t->Data();
+ capacityBox->setValue(t->ImageSize().width() * t->ImageSize().height() * t->FormatCount());
}
}
@@ -334,43 +276,85 @@ void BufferPopup::DataChanged(int i)
{
switch(i)
{
- case 0:
- nameBox->setText("");
- capacityBox->setValue(1);
- attribNameBox->setText("");
- attribCapacityBox->setValue(0);
-
- DisableBufferBoxes(false);
- CustomDataClicked();
- break;
- case 1:
- //SAQ Verts
- nameBox->setText("Screen Aligned Quad Vertices");
- capacityBox->setValue(18);
- targetBox->setCurrentIndex(0);
- dataBox->setText("");
- usageBox->setCurrentIndex(0);
- attribNameBox->setText("aPos");
- attribCapacityBox->setValue(3);
- typeBox->setCurrentIndex(0);
- normalisedBox->setChecked(false);
-
- DisableBufferBoxes(true);
- break;
- case 2:
- //SAQ UVs
- nameBox->setText("Screen Aligned Quad UVs");
- capacityBox->setValue(12);
- targetBox->setCurrentIndex(0);
- dataBox->setText("");
- usageBox->setCurrentIndex(0);
- attribNameBox->setText("aUV");
- attribCapacityBox->setValue(2);
- typeBox->setCurrentIndex(0);
- normalisedBox->setChecked(false);
-
- DisableBufferBoxes(true);
- break;
+ case 0:
+ nameBox->setText("");
+ capacityBox->setValue(1);
+ attribNameBox->setText("");
+ attribCapacityBox->setValue(0);
+
+ DisableBufferBoxes(false);
+ CustomDataClicked();
+ break;
+ case 1:
+ //SAQ Verts
+ nameBox->setText("Screen Aligned Quad Vertices");
+ targetBox->setCurrentIndex(0);
+ capacityBox->setValue(18);
+ dataBox->setText("");
+ usageBox->setCurrentIndex(0);
+ attribNameBox->setText("aPos");
+ attribCapacityBox->setValue(3);
+ typeBox->setCurrentIndex(0);
+ normalisedBox->setChecked(false);
+
+ DisableBufferBoxes(true);
+ break;
+ case 2:
+ //SAQ UVs
+ nameBox->setText("Screen Aligned Quad UVs");
+ targetBox->setCurrentIndex(0);
+ capacityBox->setValue(12);
+ dataBox->setText("");
+ usageBox->setCurrentIndex(0);
+ attribNameBox->setText("aUV");
+ attribCapacityBox->setValue(2);
+ typeBox->setCurrentIndex(0);
+ normalisedBox->setChecked(false);
+
+ DisableBufferBoxes(true);
+ break;
+ case 3:
+ //Cube
+ nameBox->setText("Cube Vertices");
+ targetBox->setCurrentIndex(0);
+ capacityBox->setValue(108);
+ dataBox->setText("");
+ usageBox->setCurrentIndex(0);
+ attribNameBox->setText("aPos");
+ attribCapacityBox->setValue(3);
+ typeBox->setCurrentIndex(0);
+ normalisedBox->setChecked(false);
+
+ DisableBufferBoxes(true);
+ break;
+ case 4:
+ //Cube
+ nameBox->setText("Cube UVs");
+ targetBox->setCurrentIndex(0);
+ capacityBox->setValue(72);
+ dataBox->setText("");
+ usageBox->setCurrentIndex(0);
+ attribNameBox->setText("aUV");
+ attribCapacityBox->setValue(2);
+ typeBox->setCurrentIndex(0);
+ normalisedBox->setChecked(false);
+
+ DisableBufferBoxes(true);
+ break;
+ case 5:
+ //Cube
+ nameBox->setText("Cube Indices");
+ targetBox->setCurrentIndex(1);
+ capacityBox->setValue(36);
+ dataBox->setText("");
+ usageBox->setCurrentIndex(0);
+ attribNameBox->setText("aIndex");
+ attribCapacityBox->setValue(1);
+ typeBox->setCurrentIndex(6);
+ normalisedBox->setChecked(false);
+
+ DisableBufferBoxes(true);
+ break;
}
}
@@ -379,7 +363,7 @@ void BufferPopup::CustomDataClicked()
QString s;
QString title = "Open Data File";
QString filter = "";
-
+
s = QFileDialog::getOpenFileName(this, title, QDir::currentPath(), filter);
if(s.size() == 0)
return; //cancelled
@@ -388,108 +372,35 @@ void BufferPopup::CustomDataClicked()
dataBox->setCursorPosition(s.size());
}
-void BufferPopup::SetUsage()
-{
- switch(usageBox->currentIndex())
- {
- case 0:
- usage.first = GL_DYNAMIC_DRAW;
- break;
- case 1:
- usage.first = GL_DYNAMIC_COPY;
- break;
- case 2:
- usage.first = GL_STATIC_DRAW;
- break;
- case 3:
- usage.first = GL_STATIC_COPY;
- break;
- }
-
- usage.second = usageBox->currentText();
-}
-
-void BufferPopup::SetType()
-{
- GLenum typeEnum;
- QString typeString = typeBox->currentText();
- int size;
-
- switch(typeBox->currentIndex())
- {
- case 0:
- typeEnum = GL_FLOAT;
- size = sizeof(float);
- break;
- case 1:
- typeEnum = GL_HALF_FLOAT;
- size = sizeof(float) / 2;
- break;
- case 2:
- typeEnum = GL_DOUBLE;
- size = sizeof(double);
- break;
- case 3:
- typeEnum = GL_INT;
- size = sizeof(int);
- break;
- case 4:
- typeEnum = GL_UNSIGNED_INT;
- size = sizeof(unsigned int);
- break;
- case 5:
- typeEnum = GL_SHORT;
- size = sizeof(short);
- break;
- case 6:
- typeEnum = GL_UNSIGNED_SHORT;
- size = sizeof(unsigned short);
- break;
- case 7:
- typeEnum = GL_BYTE;
- size = sizeof(byte);
- break;
- case 8:
- typeEnum = GL_UNSIGNED_BYTE;
- size = sizeof(byte);
- break;
- }
-
- type = std::make_tuple(typeEnum, typeString, size);
-}
-
void BufferPopup::Save()
{
if(Validation())
{
- SetTarget();
- SetData();
- SetUsage();
- SetType();
-
QString name = nameBox->text();
+ QString target = targetBox->currentText();
+ QString dataType = dataPickerBox->currentText();
int capacity = capacityBox->value();
- QString dataPath = dataBox->text();
- std::pair aID(attribNameBox->text(), -1);
+ QString dataPath = (targetBox->currentIndex() == 2) ? QString::number(textureBox->currentIndex()) : dataBox->text();
+ QString usage = usageBox->currentText();
+ QString aID = attribNameBox->text();
int aCapacity = attribCapacityBox->value();
+ QString type = typeBox->currentText();
bool norm = normalisedBox->isChecked();
+ bool perInstance = perInstanceBox->isChecked();
if(!append)
{
CUGLBuffer* b;
+ b = new CUGLBuffer(name, capacity, target, dataType, dataPath, usage, aID, aCapacity, type, norm, perInstance);
- if(dataPickerBox->isVisible() && dataPickerBox->currentIndex() == 0)
- b = new CUGLBuffer(name, capacity, target, dataPath, usage, aID, aCapacity, type, norm);
- else
- b = new CUGLBuffer(name, capacity, target, data, usage, aID, aCapacity, type, norm);
- if(targetBox->currentIndex() == 1)
+ if(targetBox->currentIndex() == 2)
GLSettings::TextureList.at(textureBox->currentIndex())->PBO(b->bufID);
GLSettings::BufferList.push_back(b);
static_cast(parent())->AddToTable(b);
}
else
{
- appBuf->bName = name;
+ /*appBuf->bName = name;
appBuf->bCap = capacity;
appBuf->bTarget = target;
if(dataPath != "")
@@ -500,7 +411,7 @@ void BufferPopup::Save()
appBuf->aID = aID;
appBuf->aSize = aCapacity;
appBuf->bType = type;
- appBuf->norm = norm;
+ appBuf->norm = norm;*/
}
close();
diff --git a/bufferpopup.h b/bufferpopup.h
index 313c8ff..9520374 100644
--- a/bufferpopup.h
+++ b/bufferpopup.h
@@ -30,39 +30,31 @@ class BufferPopup : public QDialog
void CustomDataClicked();
void DisableBufferBoxes(bool b);
bool Validation();
- void SetTarget();
- void SetData();
- void SetUsage();
- void SetType();
QWidget* parentWidget;
QGridLayout* mainLayout;
+ QHBoxLayout* checkboxLayout;
QLabel *nameLabel, *targetLabel,
- *capacityLabel, *dataLabel,
- *usageLabel, *attribNameLabel,
- *attribCapacityLabel, *typeLabel,
- *normalisedLabel;
+ *capacityLabel, *dataLabel,
+ *usageLabel, *attribNameLabel,
+ *attribCapacityLabel, *typeLabel,
+ *normalisedLabel, *perInstanceLabel;
//*handledLabel;
QLineEdit *nameBox, *dataBox, *attribNameBox;
QSpinBox *capacityBox, *attribCapacityBox;
QComboBox *targetBox, *dataPickerBox, *textureBox, *usageBox, *typeBox;
- QCheckBox* normalisedBox; //*handledBox;
+ QCheckBox* normalisedBox, *perInstanceBox;
QDialogButtonBox* buttons;
- void *data;
- std::pair target, usage;
- std::tuple type;
-
bool append;
CUGLBuffer *appBuf;
-private slots:
+ private slots:
bool eventFilter(QObject* object, QEvent* event);
void TargetChanged(int i);
void DataChanged(int i);
+ void TextureChanged(int i);
void Save();
};
-#endif // BUFFERPOPUP_H
-
-
+#endif // BUFFERPOPUP_H
\ No newline at end of file
diff --git a/controltab.cpp b/controltab.cpp
index e0e8781..20d9eb0 100644
--- a/controltab.cpp
+++ b/controltab.cpp
@@ -9,11 +9,13 @@ ControlTab::ControlTab(QWidget* parent) : QWidget(parent)
back = new QPushButton("Step Back");
stop = new QPushButton("Stop");
play = new QPushButton("Play");
- connect(play, SIGNAL(clicked()), this, SLOT(PlayClicked()));
-
forward = new QPushButton("Step Forward");
last = new QPushButton("Last");
+ connect(back, SIGNAL(clicked()), this, SLOT(StepBackward()));
+ connect(play, SIGNAL(clicked()), this, SLOT(PlayClicked()));
+ connect(forward, SIGNAL(clicked()), this, SLOT(StepForward()));
+
mainLayout->addWidget(first);
mainLayout->addWidget(back);
mainLayout->addWidget(stop);
@@ -26,14 +28,7 @@ ControlTab::ControlTab(QWidget* parent) : QWidget(parent)
ControlTab::~ControlTab()
{
- delete mainLayout;
-
- delete first;
- delete back;
- delete stop;
- delete play;
- delete forward;
- delete last;
+ delete mainLayout;
}
void ControlTab::PlayClicked()
@@ -50,3 +45,15 @@ void ControlTab::PlayClicked()
}
}
+void ControlTab::StepForward()
+{
+ GLWidget::StepForward();
+ //update frame counter
+ //implement frame counter
+}
+
+void ControlTab::StepBackward()
+{
+ GLWidget::StepBackward();
+}
+
diff --git a/controltab.h b/controltab.h
index 6b9a9cf..8d385f4 100644
--- a/controltab.h
+++ b/controltab.h
@@ -19,10 +19,13 @@ class ControlTab : public QWidget
signals:
- public slots :
+public slots :
- private slots :
- void PlayClicked();
+private slots :
+ void PlayClicked();
+ void StepForward();
+ void StepBackward();
+
};
#endif // CONTROLSTAB_H
diff --git a/cubuffertab.cpp b/cubuffertab.cpp
index f8b1b75..53cd848 100644
--- a/cubuffertab.cpp
+++ b/cubuffertab.cpp
@@ -47,6 +47,7 @@ CUBufferTab::CUBufferTab(QWidget* parent) : QWidget(parent)
CUBufferTab::~CUBufferTab()
{
+ delete mainLayout;
}
void CUBufferTab::Update()
@@ -68,9 +69,7 @@ void CUBufferTab::Update()
void CUBufferTab::BufferChanged(int i)
{
- if(i == -1)
- int j = 10;
- else
+ if(i != -1)
{
activateBox->setChecked(GLSettings::BufferList.at(i)->Cuda());
paramIDBox->setValue(GLSettings::BufferList.at(i)->ParamID());
@@ -81,6 +80,7 @@ void CUBufferTab::ActivatedChanged(int i)
{
CUGLBuffer *b = GLSettings::BufferList.at(bufferBox->currentIndex());
b->Cuda((i == 0) ? false : true);
+ CUSettings::BufferList.push_back(b);
}
void CUBufferTab::ParamIDChanged(int i)
diff --git a/cugeneraltab.cpp b/cugeneraltab.cpp
index 13066cb..ff69c5d 100644
--- a/cugeneraltab.cpp
+++ b/cugeneraltab.cpp
@@ -63,21 +63,7 @@ CUGeneralTab::CUGeneralTab(QWidget* parent) : QWidget(parent)
CUGeneralTab::~CUGeneralTab()
{
- delete mainLayout;
- delete widthLabel;
- delete heightLabel;
- delete drawLabel;
- delete colourLabel;
- delete vsyncLabel;
- delete msaaLabel;
- delete fovLabel;
- delete widthBox;
- delete heightBox;
- delete fovBox;
- delete drawBox;
- delete colourBox;
- delete vsyncBox;
- delete msaaBox;
+ delete mainLayout;
}
void CUGeneralTab::WidthChanged(int i)
diff --git a/cugeneraltab.h b/cugeneraltab.h
index 94ba3db..ea8d2e4 100644
--- a/cugeneraltab.h
+++ b/cugeneraltab.h
@@ -12,9 +12,8 @@
#include
#include "colourtextbox.h"
-#include "serializable.h"
-class CUGeneralTab : public QWidget//, public Serializable
+class CUGeneralTab : public QWidget
{
Q_OBJECT
diff --git a/cuglbuffer.cpp b/cuglbuffer.cpp
index 22ab7de..127d528 100644
--- a/cuglbuffer.cpp
+++ b/cuglbuffer.cpp
@@ -1,58 +1,166 @@
#include "cuglbuffer.h"
+#include "glsettings.h"
-CUGLBuffer::CUGLBuffer(QString name, int capacity, std::pair target, QString data, std::pair usage, std::pair attribID, int attribCapacity, std::tuple type, bool norm) : bName(name),
-bCap(capacity),
-bTarget(target),
-bDataPath(data),
-bUsage(usage),
-aID(attribID),
-aSize(attribCapacity),
-bType(type),
-norm(norm),
-cuda(false),
-paramID(-1)
+#pragma region Shapes
+float quad[] =
{
- glFuncs = 0;
+ -0.5f, -0.5f, 0.0f,
+ -0.5f, 0.5f, 0.0f,
+ 0.5f, 0.5f, 0.0f,
+ 0.5f, 0.5f, 0.0f,
+ 0.5f, -0.5f, 0.0f,
+ -0.5f, -0.5f, 0.0f
+};
- GLWidget::MakeCurrent();
- glFuncs = QOpenGLContext::currentContext()->versionFunctions();
- if(!glFuncs)
- {
- qWarning() << "Could not obtain required OpenGL context version";
- exit(1);
- }
+float quadUV[] =
+{
+ 0.0f, 1.0f,
+ 0.0f, 0.0f,
+ 1.0f, 0.0f,
+ 1.0f, 0.0f,
+ 1.0f, 1.0f,
+ 0.0f, 1.0f
+};
- bSize = bCap * std::get<2>(bType);
+float triangle[] =
+{
+ -1.0f, -1.0f, 0.0f,
+ 0.0f, 1.0f, 0.0f,
+ 1.0f, -1.0f, 0.0f,
+};
- if(!LoadData())
- {
- qWarning() << "Buffer data could not be loaded";
- exit(1);
- }
+float cube_vertices[] = {
+ // front
+ -1.0, -1.0, 1.0,
+ 1.0, -1.0, 1.0,
+ 1.0, 1.0, 1.0,
+ 1.0, 1.0, 1.0,
+ -1.0, 1.0, 1.0,
+ -1.0, -1.0, 1.0,
+ // top
+ -1.0, 1.0, 1.0,
+ 1.0, 1.0, 1.0,
+ 1.0, 1.0, -1.0,
+ 1.0, 1.0, -1.0,
+ -1.0, 1.0, -1.0,
+ -1.0, 1.0, 1.0,
+ // back
+ 1.0, -1.0, -1.0,
+ -1.0, -1.0, -1.0,
+ -1.0, 1.0, -1.0,
+ -1.0, 1.0, -1.0,
+ 1.0, 1.0, -1.0,
+ 1.0, -1.0, -1.0,
+ // bottom
+ -1.0, -1.0, -1.0,
+ 1.0, -1.0, -1.0,
+ 1.0, -1.0, 1.0,
+ 1.0, -1.0, 1.0,
+ -1.0, -1.0, 1.0,
+ -1.0, -1.0, -1.0,
+ // left
+ -1.0, -1.0, -1.0,
+ -1.0, -1.0, 1.0,
+ -1.0, 1.0, 1.0,
+ -1.0, 1.0, 1.0,
+ -1.0, 1.0, -1.0,
+ -1.0, -1.0, -1.0,
+ // right
+ 1.0, -1.0, 1.0,
+ 1.0, -1.0, -1.0,
+ 1.0, 1.0, -1.0,
+ 1.0, 1.0, -1.0,
+ 1.0, 1.0, 1.0,
+ 1.0, -1.0, 1.0,
+};
- if(!InitVBO())
- {
- qWarning() << "Buffer could not be initialised";
- exit(1);
- }
+float cube_texcoords[] = {
+ // front
+ 0.0, 0.0,
+ 1.0, 0.0,
+ 1.0, 1.0,
+ 1.0, 1.0,
+ 0.0, 1.0,
+ 0.0, 0.0,
+ // top
+ 0.0, 0.0,
+ 1.0, 0.0,
+ 1.0, 1.0,
+ 1.0, 1.0,
+ 0.0, 1.0,
+ 0.0, 0.0,
+ // back
+ 0.0, 0.0,
+ 1.0, 0.0,
+ 1.0, 1.0,
+ 1.0, 1.0,
+ 0.0, 1.0,
+ 0.0, 0.0,
+ // bottom
+ 0.0, 0.0,
+ 1.0, 0.0,
+ 1.0, 1.0,
+ 1.0, 1.0,
+ 0.0, 1.0,
+ 0.0, 0.0,
+ // left
+ 0.0, 0.0,
+ 1.0, 0.0,
+ 1.0, 1.0,
+ 1.0, 1.0,
+ 0.0, 1.0,
+ 0.0, 0.0,
+ // right
+ 0.0, 0.0,
+ 1.0, 0.0,
+ 1.0, 1.0,
+ 1.0, 1.0,
+ 0.0, 1.0,
+ 0.0, 0.0,
+};
- GLWidget::DoneCurrent();
-}
+GLushort cube_elements[] = {
+ // front
+ 0, 1, 2,
+ 2, 3, 0,
+ // top
+ 4, 5, 6,
+ 6, 7, 4,
+ // back
+ 8, 9, 10,
+ 10, 11, 8,
+ // bottom
+ 12, 13, 14,
+ 14, 15, 12,
+ // left
+ 16, 17, 18,
+ 18, 19, 16,
+ // right
+ 20, 21, 22,
+ 22, 23, 20,
+};
+
+#pragma endregion Shapes
-CUGLBuffer::CUGLBuffer(QString name, int capacity, std::pair target, void *data, std::pair usage, std::pair attribName, int attribCapacity, std::tuple type, bool norm) : bName(name),
-bCap(capacity),
-bTarget(target),
-bData(data),
-bUsage(usage),
-aID(attribName),
-aSize(attribCapacity),
-bType(type),
-norm(norm),
-cuda(false),
-paramID(-1)
+CUGLBuffer::CUGLBuffer(QString name, int capacity, QString target, QString data, QString dataPath, QString usage, QString attribID, int attribCapacity, QString type, bool norm, bool perInst)
{
+ GetGLTarget(target);
+ GetGLUsage(usage);
+ aID = std::make_pair(attribID, -1); //refactor?
+ GetGLType(type);
+
glFuncs = 0;
+ bName = name;
+ bCap = capacity;
+ bDataType = data; //e.g. SAQ/Custom etc (not var type!)
+ bDataPath = dataPath;
+ aSize = attribCapacity;
+ norm = norm;
+ cuda = false;
+ perInstance = perInst;
+ paramID = -1;
+
GLWidget::MakeCurrent();
glFuncs = QOpenGLContext::currentContext()->versionFunctions();
if(!glFuncs)
@@ -63,6 +171,12 @@ paramID(-1)
bSize = bCap * std::get<2>(bType);
+ if(!LoadData(data))
+ {
+ qWarning() << "Buffer data could not be loaded";
+ exit(1);
+ }
+
if(!InitVBO())
{
qWarning() << "Buffer could not be initialised";
@@ -113,19 +227,13 @@ bool CUGLBuffer::InitVBO()
{
glFuncs->glGenBuffers(1, &bufID);
glFuncs->glBindBuffer(bTarget.first, bufID);
- glFuncs->glBufferData(bTarget.first, bSize, bData, bUsage.first); //bData?
+ glFuncs->glBufferData(bTarget.first, bSize, bData, bUsage.first);
cudaBuf = RegisterBuffer(bufID);
return true;
}
-void CUGLBuffer::Randomise(float *data, int n) {
- for(int i = 0; i < n; i++) {
- data[i] = 2.0f * (rand() / (float)RAND_MAX) - 1.0f;
- }
-}
-
std::vector &split(const std::string &s, char delim, std::vector &elems) {
std::stringstream ss(s);
std::string item;
@@ -136,57 +244,185 @@ std::vector &split(const std::string &s, char delim, std::vector((int*)bData, bCap, 0.5, 1.5);
+ else
+ ParseFile((byte*)bData);
+ }
+ break;
+ }
+ case GL_ELEMENT_ARRAY_BUFFER:
+ {
+ if(dataType.contains("Cube"))
+ bData = cube_elements;
+ break;
+ }
+
+ case GL_PIXEL_UNPACK_BUFFER:
+ {
+ bData = (void*)GLSettings::TextureList.at(bDataPath.toInt())->Data();
+ break;
+ }
+ }
+
+ return true;
+}
+
+void CUGLBuffer::GetGLTarget(QString targetString)
+{
+ if(targetString == "GL_ARRAY_BUFFER")
+ {
+ bTarget.first = GL_ARRAY_BUFFER;
+ }
+
+ if(targetString == "GL_ELEMENT_ARRAY_BUFFER")
+ {
+ bTarget.first = GL_ELEMENT_ARRAY_BUFFER;
+ }
+
+ if(targetString == "GL_PIXEL_UNPACK_BUFFER")
+ {
+ bTarget.first = GL_PIXEL_UNPACK_BUFFER;
+ }
+
+ bTarget.second = targetString;
+}
+
+void CUGLBuffer::GetGLUsage(QString usageString)
{
- std::ifstream in(bDataPath.toStdString());
- std::string s = "|";
- std::vector elems;
- int counter = 0;
+ if(usageString == "GL_DYNAMIC_DRAW")
+ {
+ bUsage.first = GL_DYNAMIC_DRAW;
+ }
- getline(in, s);
- while(s.size() != 0)
- {
- split(s, ' ', elems);
- data[counter + 0] = elems.at(0).toFloat();
- data[counter + 1] = elems.at(1).toFloat();
- data[counter + 2] = elems.at(2).toFloat();
- data[counter + 3] = elems.at(3).toFloat();
- //sscanf(s.c_str(), "%f %f %f %f", , data[counter + 1], data[counter + 2], data[counter + 3]); //change format on type and aSize
- counter += 4;
- elems.clear();
- getline(in, s);
+ if(usageString == "GL_DYNAMIC_COPY")
+ {
+ bUsage.first = GL_DYNAMIC_COPY;
}
+
+ if(usageString == "GL_STATIC_DRAW")
+ {
+ bUsage.first = GL_STATIC_DRAW;
+ }
+
+ if(usageString == "GL_STATIC_COPY")
+ {
+ bUsage.first = GL_STATIC_COPY;
+ }
+
+ bUsage.second = usageString;
}
-bool CUGLBuffer::LoadData()
+void CUGLBuffer::GetAttribID(QString attribString)
{
- switch(bTarget.first)
+
+}
+
+void CUGLBuffer::GetGLType(QString typeString)
+{
+ GLenum typeEnum;
+ int size;
+
+ if(typeString == "GL_FLOAT")
{
- case GL_ARRAY_BUFFER:
+ typeEnum = GL_FLOAT;
+ size = sizeof(float);
+ }
+
+ if(typeString == "GL_HALF_FLOAT")
{
- bData = malloc(bSize);
-
- if(bDataPath == "")
- RandomData((int*)bData, bCap, 0.5, 1.5);//Randomise((float*)bData, bCap);
- else
- ParseFile((float*)bData);
- break;
+ typeEnum = GL_HALF_FLOAT;
+ size = sizeof(float) / 2;
}
- /*use texture selector instead
- case GL_PIXEL_UNPACK_BUFFER:
+
+ if(typeString == "GL_DOUBLE")
{
- //change to texture selector or accept nullptr
- img = QImage(bDataPath);
- texSize = img.size();
- bSize = texSize.width() * texSize.height() * 4;
- img = img.convertToFormat(QImage::Format_RGB32);
- bData = (void*)img.constBits();
- InitTex();
- break;
- }*/
+ typeEnum = GL_DOUBLE;
+ size = sizeof(double);
}
- return true;
+ if(typeString == "GL_INT")
+ {
+ typeEnum = GL_INT;
+ size = sizeof(int);
+ }
+
+ if(typeString == "GL_UNSIGNED_INT")
+ {
+ typeEnum = GL_UNSIGNED_INT;
+ size = sizeof(unsigned int);
+ }
+
+ if(typeString == "GL_SHORT")
+ {
+ typeEnum = GL_SHORT;
+ size = sizeof(short);
+ }
+
+ if(typeString == "GL_UNSIGNED_SHORT")
+ {
+ typeEnum = GL_UNSIGNED_SHORT;
+ size = sizeof(unsigned short);
+ }
+
+ if(typeString == "GL_BYTE")
+ {
+ typeEnum = GL_BYTE;
+ size = sizeof(byte);
+ }
+
+ if(typeString == "GL_UNSIGNED_BYTE")
+ {
+ typeEnum = GL_UNSIGNED_BYTE;
+ size = sizeof(byte);
+ }
+
+ bType = std::make_tuple(typeEnum, typeString, size);
+}
+
+void CUGLBuffer::Save(QTextStream *output, std::vector *varList)
+{
+ varList->push_back("b_");
+ varList->push_back(bName);
+ varList->push_back(QString::number(bCap));
+ varList->push_back(bTarget.second);
+ varList->push_back(bDataType);
+ varList->push_back(bDataPath);
+ varList->push_back(bUsage.second);
+ varList->push_back(aID.first);
+ varList->push_back(QString::number(aSize));
+ varList->push_back(std::get<1>(bType));
+ varList->push_back(QString::number(norm));
+ varList->push_back(QString::number(perInstance));
+
+ Savable::Save(output, varList);
}
void CUGLBuffer::Bind()
@@ -211,6 +447,7 @@ void CUGLBuffer::UnregisterBuffer(void* res)
ERRORCHECK(cudaGraphicsUnregisterResource((cudaGraphicsResource *)res));
}
+//Back off Open-GL
void* CUGLBuffer::MapResource(void* res)
{
void* devPtr = 0;
diff --git a/cuglbuffer.h b/cuglbuffer.h
index 5f86cf7..a6b23fa 100644
--- a/cuglbuffer.h
+++ b/cuglbuffer.h
@@ -19,12 +19,12 @@
#include "glwidget.h"
#include "utilities.h"
+#include "savable.h"
-class CUGLBuffer
+class CUGLBuffer : public Savable
{
public:
- CUGLBuffer(QString name, int capacity, std::pair target, QString data, std::pair usage, std::pair attribID, int attribCapacity, std::tuple type, bool norm);
- CUGLBuffer(QString name, int capacity, std::pair target, void *data, std::pair usage, std::pair attribID, int attribCapacity, std::tuple type, bool norm);
+ CUGLBuffer(QString name, int capacity, QString target, QString data, QString dataPath, QString usage, QString attribID, int attribCapacity, QString type, bool norm, bool perInst);
~CUGLBuffer();
static void* RegisterBuffer(GLuint buf);
@@ -41,9 +41,12 @@ class CUGLBuffer
void Cuda(bool val) { cuda = val; }
int ParamID() const { return paramID; }
void ParamID(int val) { paramID = val; }
+ bool PerInstance() const { return perInstance; }
+
+ virtual void Save(QTextStream *output, std::vector *varList) override;
GLuint bufID;
- QString bName, bDataPath;
+ QString bName, bDataType, bDataPath;
void *bData;
int bCap, bSize, aSize;
@@ -55,14 +58,18 @@ class CUGLBuffer
void InitTex();
void Randomise(float *data, int n);
void ParseFile(float *data);
- bool LoadData();
+ bool LoadData(QString dataType);
+ void GetGLTarget(QString targetString);
+ void GetGLUsage(QString usageString);
+ void GetAttribID(QString attribString);
+ void GetGLType(QString typeString);
QOpenGLFunctions_3_3_Core* glFuncs;
GLuint tex;
void *cudaBuf;
QImage img;
QSize texSize;
- bool cuda;
+ bool cuda, perInstance;
int paramID;
template
@@ -73,6 +80,30 @@ class CUGLBuffer
data[i] = (max - min) * (rand() / (float)RAND_MAX) + min;
}
}
+
+ //parse file of type T
+ //storing
+ template
+ inline void ParseFile(T *data, const char& delim = ' ')
+ {
+ std::ifstream in(bDataPath.toStdString());
+ std::string s = "|";
+ std::vector elems;
+ int counter = 0;
+
+ getline(in, s);
+ while(s.size() != 0)
+ {
+ split(s, delim, elems);
+ for(int i = 0; i < s.size(); ++i)
+ {
+ data[counter + i] = elems.at(i).toDouble();
+ }
+ counter += s.size();
+ elems.clear();
+ getline(in, s);
+ }
+ }
};
#endif // CUGLBUFFER_H
diff --git a/cusettings.cpp b/cusettings.cpp
index 71784ca..d466fb6 100644
--- a/cusettings.cpp
+++ b/cusettings.cpp
@@ -1,5 +1,7 @@
#include "cusettings.h"
+std::vector CUSettings::BufferList;
+
//param > buffer
//param - select from objects properties, buffers - order
@@ -27,10 +29,7 @@ CUSettings::CUSettings(QWidget* parent) : QWidget(parent)
CUSettings::~CUSettings()
{
- delete tabs;
- delete settingsLayout;
- delete settingsGroup;
- delete mainLayout;
+ delete mainLayout;
}
void CUSettings::CUInit()
@@ -49,7 +48,6 @@ void CUSettings::CUInit()
printf("Device %i: %s", d.handle, d.name);
}
- //change current device in cugeneral + save/load
cudaSetDevice(0);
}
diff --git a/cusettings.h b/cusettings.h
index 3961e75..97cebf6 100644
--- a/cusettings.h
+++ b/cusettings.h
@@ -29,6 +29,8 @@ class CUSettings : public QWidget
virtual QSize minimumSizeHint() const override;
virtual QSize sizeHint() const override;
+ static std::vector BufferList;
+
std::vector deviceList;
private:
@@ -42,10 +44,10 @@ class CUSettings : public QWidget
signals:
-public slots :
+ public slots :
-private slots :
- void TabChanged(int i);
+ private slots :
+ void TabChanged(int i);
};
#endif // CUSETTINGS_H
diff --git a/debug/obj/kernel_cuda.obj b/debug/obj/kernel_cuda.obj
deleted file mode 100644
index 45839f7..0000000
Binary files a/debug/obj/kernel_cuda.obj and /dev/null differ
diff --git a/glbuffertab.cpp b/glbuffertab.cpp
index 316d4ca..82474cc 100644
--- a/glbuffertab.cpp
+++ b/glbuffertab.cpp
@@ -3,49 +3,7 @@
GLBufferTab::GLBufferTab(QWidget* parent) : QWidget(parent)
{
- mainLayout = new QGridLayout;
- buttonLayout = new QHBoxLayout;
-
- add = new QPushButton("+");
- connect(add, &QPushButton::clicked, this, &GLBufferTab::Popup);
-
- remove = new QPushButton("-");
- connect(remove, &QPushButton::clicked, this, &GLBufferTab::RemoveBuffer);
-
- buttonLayout->addWidget(add);
- buttonLayout->addWidget(remove);
-
- mainLayout->addLayout(buttonLayout, 0, 0);
-
- listModel = new QStringListModel();
- bufferStringList = QStringList();
-
- for(int i = 0; i < GLSettings::TextureList.size(); ++i)
- {
- bufferStringList.push_back(QString(GLSettings::BufferList.at(i)->bName));
- }
-
- listModel->setStringList(bufferStringList);
-
- listView = new QListView;
- listView->setModel(listModel);
- connect(listView->selectionModel(), SIGNAL(selectionChanged(QItemSelection, QItemSelection)), this, SLOT(BufferSelected(QItemSelection)));
- connect(listView->itemDelegate(), SIGNAL(closeEditor(QWidget*, QAbstractItemDelegate::EndEditHint)), this, SLOT(ListEditEnd(QWidget*, QAbstractItemDelegate::EndEditHint)));
- mainLayout->addWidget(listView, 1, 0);
- mainLayout->setColumnStretch(0, 1);
-
- BufferPopup *p = new BufferPopup(this);
-
- detailScroll = new QScrollArea;
- detailScroll->setBackgroundRole(QPalette::Dark);
- detailScroll->setWidget(p);
-
- mainLayout->addWidget(detailScroll, 1, 1);
- mainLayout->setColumnStretch(1, 4);
-
- setLayout(mainLayout);
-
- /*mainLayout = new QVBoxLayout;
+ mainLayout = new QVBoxLayout;
buttonLayout = new QHBoxLayout;
add = new QPushButton("Add");
@@ -70,37 +28,12 @@ GLBufferTab::GLBufferTab(QWidget* parent) : QWidget(parent)
table->setSelectionMode(QAbstractItemView::SingleSelection);
connect(table, &QTableWidget::doubleClicked, this, &GLBufferTab::TableDoubleClicked);
mainLayout->addWidget(table);
- setLayout(mainLayout);*/
+ setLayout(mainLayout);
}
GLBufferTab::~GLBufferTab()
{
- delete add;
- delete remove;
- delete buttonLayout;
- //delete table;
- delete mainLayout;
-}
-
-void GLBufferTab::BufferSelected(const QItemSelection& selection)
-{
- if(selection.indexes().isEmpty())
- {
- //nothing selected
- //unselect if white space is clicked in list
- }
- else
- {
- //texturePreview->setPixmap(QPixmap(QPixmap::fromImage(GLSettings::TextureList.at(selection.indexes().first().row())->Image())));
- }
-}
-
-void GLBufferTab::ListEditEnd(QWidget *editor, QAbstractItemDelegate::EndEditHint)
-{
- int id = listView->currentIndex().row();
- QString s = reinterpret_cast(editor)->text(); //new name
- bufferStringList.replaceInStrings(bufferStringList.at(id), s);
- GLSettings::BufferList.at(id)->bName = s;
+ delete mainLayout;
}
void GLBufferTab::Popup()
@@ -175,4 +108,5 @@ void GLBufferTab::RemoveBuffer()
table->insertRow(0);
}
}
-}
\ No newline at end of file
+}
+
diff --git a/glbuffertab.h b/glbuffertab.h
index cd99a76..ec82ae0 100644
--- a/glbuffertab.h
+++ b/glbuffertab.h
@@ -8,9 +8,6 @@
#include
#include
#include
-#include
-#include
-#include
#include "cuglbuffer.h"
#include "bufferpopup.h"
@@ -26,22 +23,17 @@ class GLBufferTab : public QWidget
void AddToTable(CUGLBuffer* b);
private:
- QGridLayout *mainLayout;
- QHBoxLayout *bufferLayout, *buttonLayout;
+ QVBoxLayout* mainLayout;
+ QHBoxLayout* buttonLayout;
QPushButton* add;
QPushButton* remove;
QTableWidget* table;
- QStringList bufferStringList;
- QStringListModel *listModel;
- QListView *listView;
- QScrollArea *detailScroll;
-signals:
+
+ signals:
public slots:
private slots:
- void BufferSelected(const QItemSelection& selection);
- void ListEditEnd(QWidget *editor, QAbstractItemDelegate::EndEditHint);
void TableDoubleClicked();
void RemoveBuffer();
void Popup();
diff --git a/glgeneraltab.cpp b/glgeneraltab.cpp
index 9357050..451bf9f 100644
--- a/glgeneraltab.cpp
+++ b/glgeneraltab.cpp
@@ -106,21 +106,7 @@ GLGeneralTab::GLGeneralTab(QWidget* parent) : QWidget(parent)
GLGeneralTab::~GLGeneralTab()
{
- delete mainLayout;
- delete widthLabel;
- delete heightLabel;
- delete drawLabel;
- delete colourLabel;
- delete vsyncLabel;
- delete msaaLabel;
- delete fovLabel;
- delete widthBox;
- delete heightBox;
- delete fovBox;
- delete drawBox;
- delete colourBox;
- delete vsyncBox;
- delete msaaBox;
+ delete mainLayout;
}
void GLGeneralTab::WidthChanged(int i)
diff --git a/glsettings.cpp b/glsettings.cpp
index c6d2da4..849711b 100644
--- a/glsettings.cpp
+++ b/glsettings.cpp
@@ -11,10 +11,10 @@ GLSettings::GLSettings(QWidget* parent) : QWidget(parent)
settingsGroup = new QGroupBox("OpenGL Settings");
tabs = new QTabWidget();
- tabs->addTab(new GLGeneralTab(this), "General");
- tabs->addTab(new ObjectTab(this), "Objects");
- tabs->addTab(new GLBufferTab(this), "Buffers");
- tabs->addTab(new TextureTab(this), "Textures");
+ tabs->addTab(genTab = new GLGeneralTab(this), "General");
+ tabs->addTab(objTab = new ObjectTab(this), "Objects");
+ tabs->addTab(bufTab = new GLBufferTab(this), "Buffers");
+ tabs->addTab(texTab = new TextureTab(this), "Textures");
tabs->addTab(new ControlTab(this), "Controls");
settingsLayout->addWidget(tabs);
settingsGroup->setLayout(settingsLayout);
@@ -25,10 +25,6 @@ GLSettings::GLSettings(QWidget* parent) : QWidget(parent)
GLSettings::~GLSettings()
{
- delete tabs;
- delete settingsLayout;
- delete settingsGroup;
-
for each (Object *o in ObjectList)
{
delete o;
@@ -47,6 +43,51 @@ GLSettings::~GLSettings()
delete mainLayout;
}
+void GLSettings::AddTexture(Texture *tex)
+{
+ TextureList.push_back(tex);
+ texTab->AddToList(tex);
+}
+
+void GLSettings::AddBuffer(CUGLBuffer *buf)
+{
+ BufferList.push_back(buf);
+ bufTab->AddToTable(buf);
+}
+
+void GLSettings::AddObject(Object *obj)
+{
+ ObjectList.push_back(obj);
+ objTab->AddToTable(obj);
+}
+
+void GLSettings::AddTextures(std::vector *texList)
+{
+ for each (Texture* t in *texList)
+ {
+ TextureList.push_back(t);
+ texTab->AddToList(t);
+ }
+}
+
+void GLSettings::AddBuffers(std::vector *bufList)
+{
+ for each (CUGLBuffer* b in *bufList)
+ {
+ BufferList.push_back(b);
+ bufTab->AddToTable(b);
+ }
+}
+
+void GLSettings::AddObjects(std::vector