diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 0000000..d7b7979
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,44 @@
+#
+# Copyright (c) 2019 The Aquarium Project Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+#
+
+###############################################################################
+# Set default behavior to automatically normalize line endings.
+###############################################################################
+* text=auto
+* text eol=lf
+
+###############################################################################
+# Set the merge driver for project and solution files
+#
+# Merging from the command prompt will add diff markers to the files if there
+# are conflicts (Merging from VS is not affected by the settings below, in VS
+# the diff markers are never inserted). Diff markers may cause the following
+# file extensions to fail to load in VS. An alternative would be to treat
+# these files as binary and thus will always conflict and require user
+# intervention with every merge. To do so, just uncomment the entries below
+###############################################################################
+#*.sln merge=binary
+#*.csproj merge=binary
+#*.vbproj merge=binary
+#*.vcxproj merge=binary
+#*.vcproj merge=binary
+#*.dbproj merge=binary
+#*.fsproj merge=binary
+#*.lsproj merge=binary
+#*.wixproj merge=binary
+#*.modelproj merge=binary
+#*.sqlproj merge=binary
+#*.wwaproj merge=binary
+
+###############################################################################
+# behavior for image files
+#
+# image files are treated as binary by default.
+###############################################################################
+#*.jpg binary
+#*.png binary
+#*.gif binary
+
diff --git a/.gn b/.gn
index 7ce62e5..f896c4c 100644
--- a/.gn
+++ b/.gn
@@ -1,20 +1,20 @@
-#
-# Copyright (c) 2019 The Aquarium Project Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-#
-
-buildconfig = "//build/config/BUILDCONFIG.gn"
-
-default_args = {
- clang_use_chrome_plugins = false
- treat_warnings_as_errors = false
-}
-
-check_targets = [
- # Everything in BUILD.gn
- "//:*",
-
- # Everything in third_party/BUILD.gn
- "//third_party/:*",
-]
+#
+# Copyright (c) 2019 The Aquarium Project Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+#
+
+buildconfig = "//build/config/BUILDCONFIG.gn"
+
+default_args = {
+ clang_use_chrome_plugins = false
+}
+
+check_targets = [
+ # Everything in BUILD.gn
+ "//:*",
+
+ # Everything in third_party/BUILD.gn
+ "//third_party/:*",
+]
+
diff --git a/BUILD.gn b/BUILD.gn
index be2dad1..7df77e2 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -1,245 +1,237 @@
-#
-# Copyright (c) 2019 The Aquarium Project Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-#
-
-declare_args() {
- enable_dawn = is_win || is_linux || is_mac
- enable_angle = false
- enable_d3d12 = is_win
- enable_opengl = is_win || is_linux || is_mac
-}
-
-executable("aquarium") {
- libs = []
-
- sources = [
- "src/common/AQUARIUM_ASSERT.h",
- "src/common/FPSTimer.cpp",
- "src/common/FPSTimer.h",
- "src/aquarium-optimized/Aquarium.cpp",
- "src/aquarium-optimized/Aquarium.h",
- "src/aquarium-optimized/Buffer.h",
- "src/aquarium-optimized/Context.h",
- "src/aquarium-optimized/ContextFactory.cpp",
- "src/aquarium-optimized/ContextFactory.h",
- "src/aquarium-optimized/FishModel.h",
- "src/aquarium-optimized/Main.cpp",
- "src/aquarium-optimized/Matrix.h",
- "src/aquarium-optimized/Model.cpp",
- "src/aquarium-optimized/Model.h",
- "src/aquarium-optimized/Program.h",
- "src/aquarium-optimized/ResourceHelper.h",
- "src/aquarium-optimized/ResourceHelper.cpp",
- "src/aquarium-optimized/SeaweedModel.h",
- "src/aquarium-optimized/Texture.cpp",
- "src/aquarium-optimized/Texture.h",
- ]
-
- deps = [
- "third_party:stb",
- "third_party:imgui",
- ]
-
- include_dirs = [
- "third_party/rapidjson/include",
- "third_party/stb",
- "src",
- "third_party/imgui",
- "third_party/imgui/examples",
- ]
-
- if(enable_angle || enable_opengl) {
- sources += [
- "src/aquarium-optimized/opengl/BufferGL.cpp",
- "src/aquarium-optimized/opengl/BufferGL.h",
- "src/aquarium-optimized/opengl/ContextGL.cpp",
- "src/aquarium-optimized/opengl/ContextGL.h",
- "src/aquarium-optimized/opengl/FishModelGL.cpp",
- "src/aquarium-optimized/opengl/FishModelGL.h",
- "src/aquarium-optimized/opengl/GenericModelGL.cpp",
- "src/aquarium-optimized/opengl/GenericModelGL.h",
- "src/aquarium-optimized/opengl/InnerModelGL.cpp",
- "src/aquarium-optimized/opengl/InnerModelGL.h",
- "src/aquarium-optimized/opengl/OutsideModelGL.cpp",
- "src/aquarium-optimized/opengl/OutsideModelGL.h",
- "src/aquarium-optimized/opengl/ProgramGL.cpp",
- "src/aquarium-optimized/opengl/ProgramGL.h",
- "src/aquarium-optimized/opengl/SeaweedModelGL.cpp",
- "src/aquarium-optimized/opengl/SeaweedModelGL.h",
- "src/aquarium-optimized/opengl/TextureGL.cpp",
- "src/aquarium-optimized/opengl/TextureGL.h",
- "src/aquarium-optimized/opengl/imgui_impl_opengl3.h",
- "src/aquarium-optimized/opengl/imgui_impl_opengl3.cpp",
- ]
- }
-
- defines = []
-
- if (enable_angle) {
- enable_dawn = false
- enable_d3d12 = false
-
- defines += [ "EGL_EGL_PROTOTYPES",
- "IMGUI_IMPL_OPENGL_LOADER_CUSTOM",
- "IMGUI_IMPL_OPENGL_ES3", ]
-
- include_dirs += [
- "third_party/angle/include",
- "third_party/angle/util",
- ]
-
- deps += [
- "third_party/angle:libANGLE",
- "third_party/angle:libGLESv2",
- "third_party/angle:libEGL",
- "third_party/angle:angle_util_static",
- ]
- } else {
- deps += [ "third_party:glad" ]
-
- include_dirs += [ "third_party/glad/include" ]
- defines += [ "IMGUI_IMPL_OPENGL_LOADER_GLAD", ]
- }
-
- if (enable_dawn) {
- defines += [ "ENABLE_DAWN_BACKEND" ]
-
- include_dirs += [ "third_party/dawn/src" ]
-
- sources += [
- "src/aquarium-optimized/dawn/BufferDawn.cpp",
- "src/aquarium-optimized/dawn/BufferDawn.h",
- "src/aquarium-optimized/dawn/ContextDawn.cpp",
- "src/aquarium-optimized/dawn/ContextDawn.h",
- "src/aquarium-optimized/dawn/FishModelDawn.cpp",
- "src/aquarium-optimized/dawn/FishModelDawn.h",
- "src/aquarium-optimized/dawn/FishModelInstancedDrawDawn.cpp",
- "src/aquarium-optimized/dawn/FishModelInstancedDrawDawn.h",
- "src/aquarium-optimized/dawn/GenericModelDawn.cpp",
- "src/aquarium-optimized/dawn/GenericModelDawn.h",
- "src/aquarium-optimized/dawn/InnerModelDawn.cpp",
- "src/aquarium-optimized/dawn/InnerModelDawn.h",
- "src/aquarium-optimized/dawn/OutsideModelDawn.cpp",
- "src/aquarium-optimized/dawn/OutsideModelDawn.h",
- "src/aquarium-optimized/dawn/ProgramDawn.cpp",
- "src/aquarium-optimized/dawn/ProgramDawn.h",
- "src/aquarium-optimized/dawn/SeaweedModelDawn.cpp",
- "src/aquarium-optimized/dawn/SeaweedModelDawn.h",
- "src/aquarium-optimized/dawn/TextureDawn.cpp",
- "src/aquarium-optimized/dawn/TextureDawn.h",
- "src/aquarium-optimized/dawn/imgui_impl_dawn.cpp",
- "src/aquarium-optimized/dawn/imgui_impl_dawn.h",
- ]
-
- deps += [
- "third_party/dawn/src/dawn:dawn_headers",
- "third_party/dawn:dawn_utils",
- "third_party/dawn/src/dawn:libdawn",
- "third_party/dawn:libdawn_native",
- "third_party/dawn/third_party/shaderc:libshaderc",
- ]
-
- include_dirs += [
- "third_party/dawn/third_party/glfw/include",
- "third_party/dawn/third_party/shaderc/libshaderc/include",
- ]
- } else {
- deps += [ "third_party:glfw" ]
-
- include_dirs += [
- "third_party/glfw/include",
- ]
- }
-
- if (enable_d3d12) {
- defines += [ "ENABLE_D3D12_BACKEND" ]
-
- include_dirs += [
- "src/include/d3d12",
- ]
-
- libs += [
- "d3d12.lib",
- "dxgi.lib",
- "d3dcompiler.lib",
- ]
-
- sources += [
- "src/aquarium-optimized/d3d12/BufferD3D12.cpp",
- "src/aquarium-optimized/d3d12/BufferD3D12.h",
- "src/aquarium-optimized/d3d12/ContextD3D12.cpp",
- "src/aquarium-optimized/d3d12/ContextD3D12.h",
- "src/aquarium-optimized/d3d12/FishModelD3D12.cpp",
- "src/aquarium-optimized/d3d12/FishModelD3D12.h",
- "src/aquarium-optimized/d3d12/FishModelInstancedDrawD3D12.cpp",
- "src/aquarium-optimized/d3d12/FishModelInstancedDrawD3D12.h",
- "src/aquarium-optimized/d3d12/GenericModelD3D12.cpp",
- "src/aquarium-optimized/d3d12/GenericModelD3D12.h",
- "src/aquarium-optimized/d3d12/InnerModelD3D12.cpp",
- "src/aquarium-optimized/d3d12/InnerModelD3D12.h",
- "src/aquarium-optimized/d3d12/OutsideModelD3D12.cpp",
- "src/aquarium-optimized/d3d12/OutsideModelD3D12.h",
- "src/aquarium-optimized/d3d12/ProgramD3D12.cpp",
- "src/aquarium-optimized/d3d12/ProgramD3D12.h",
- "src/aquarium-optimized/d3d12/SeaweedModelD3D12.cpp",
- "src/aquarium-optimized/d3d12/SeaweedModelD3D12.h",
- "src/aquarium-optimized/d3d12/TextureD3D12.cpp",
- "src/aquarium-optimized/d3d12/TextureD3D12.h",
- "src/aquarium-optimized/d3d12/imgui_impl_dx12.h",
- "src/aquarium-optimized/d3d12/imgui_impl_dx12.cpp",
- ]
- }
-
- cflags_cc = [
- "-Wno-string-conversion",
- "-Wno-unused-result",
- "-Wno-format-security",
- "-Wno-microsoft-enum-forward-reference",
- ]
-}
-
-executable("aquarium-direct-map") {
- sources = [
- "src/common/AQUARIUM_ASSERT.h",
- "src/common/FPSTimer.h",
- "src/common/FPSTimer.cpp",
- "src/aquarium-direct-map/AttribBuffer.h",
- "src/aquarium-direct-map/AttribBuffer.cpp",
- "src/aquarium-direct-map/Buffer.h",
- "src/aquarium-direct-map/Buffer.cpp",
- "src/aquarium-direct-map/Globals.h",
- "src/aquarium-direct-map/Main.cpp",
- "src/aquarium-direct-map/Matrix.h",
- "src/aquarium-direct-map/Model.h",
- "src/aquarium-direct-map/Model.cpp",
- "src/aquarium-direct-map/Program.h",
- "src/aquarium-direct-map/Program.cpp",
- "src/aquarium-direct-map/Scene.h",
- "src/aquarium-direct-map/Scene.cpp",
- "src/aquarium-direct-map/Texture.h",
- "src/aquarium-direct-map/Texture.cpp",
- "src/aquarium-direct-map/Uniform.h",
- "src/aquarium-direct-map/Uniform.cpp",
- ]
-
- deps = [
- "third_party:stb",
- "third_party:glad",
- "third_party:glfw",
- ]
-
- include_dirs = [
- "third_party/glad/include",
- "third_party/rapidjson/include",
- "third_party/stb",
- "third_party/glfw/include",
- "src",
- ]
-
- cflags_cc = [
- "-Wno-string-conversion",
- "-Wno-unused-result",
- ]
+#
+# Copyright (c) 2019 The Aquarium Project Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+#
+
+declare_args() {
+ enable_dawn = is_win || is_linux || is_mac
+ enable_angle = is_win
+ enable_d3d12 = is_win
+ enable_opengl = is_win || is_linux || is_mac
+}
+
+executable("aquarium") {
+ libs = []
+
+ sources = [
+ "src/common/AQUARIUM_ASSERT.h",
+ "src/common/FPSTimer.cpp",
+ "src/common/FPSTimer.h",
+ "src/aquarium-optimized/Aquarium.cpp",
+ "src/aquarium-optimized/Aquarium.h",
+ "src/aquarium-optimized/Buffer.h",
+ "src/aquarium-optimized/Context.h",
+ "src/aquarium-optimized/ContextFactory.cpp",
+ "src/aquarium-optimized/ContextFactory.h",
+ "src/aquarium-optimized/FishModel.h",
+ "src/aquarium-optimized/Main.cpp",
+ "src/aquarium-optimized/Matrix.h",
+ "src/aquarium-optimized/Model.cpp",
+ "src/aquarium-optimized/Model.h",
+ "src/aquarium-optimized/Program.h",
+ "src/aquarium-optimized/ResourceHelper.h",
+ "src/aquarium-optimized/ResourceHelper.cpp",
+ "src/aquarium-optimized/SeaweedModel.h",
+ "src/aquarium-optimized/Texture.cpp",
+ "src/aquarium-optimized/Texture.h",
+ ]
+
+ deps = [
+ "third_party:stb",
+ "third_party:imgui",
+ ]
+
+ include_dirs = [
+ "third_party/rapidjson/include",
+ "third_party/stb",
+ "src",
+ "third_party/imgui",
+ "third_party/imgui/examples",
+ ]
+
+ if(enable_angle || enable_opengl) {
+ sources += [
+ "src/aquarium-optimized/opengl/BufferGL.cpp",
+ "src/aquarium-optimized/opengl/BufferGL.h",
+ "src/aquarium-optimized/opengl/ContextGL.cpp",
+ "src/aquarium-optimized/opengl/ContextGL.h",
+ "src/aquarium-optimized/opengl/FishModelGL.cpp",
+ "src/aquarium-optimized/opengl/FishModelGL.h",
+ "src/aquarium-optimized/opengl/GenericModelGL.cpp",
+ "src/aquarium-optimized/opengl/GenericModelGL.h",
+ "src/aquarium-optimized/opengl/InnerModelGL.cpp",
+ "src/aquarium-optimized/opengl/InnerModelGL.h",
+ "src/aquarium-optimized/opengl/OutsideModelGL.cpp",
+ "src/aquarium-optimized/opengl/OutsideModelGL.h",
+ "src/aquarium-optimized/opengl/ProgramGL.cpp",
+ "src/aquarium-optimized/opengl/ProgramGL.h",
+ "src/aquarium-optimized/opengl/SeaweedModelGL.cpp",
+ "src/aquarium-optimized/opengl/SeaweedModelGL.h",
+ "src/aquarium-optimized/opengl/TextureGL.cpp",
+ "src/aquarium-optimized/opengl/TextureGL.h",
+ "src/aquarium-optimized/opengl/imgui_impl_opengl3.h",
+ "src/aquarium-optimized/opengl/imgui_impl_opengl3.cpp",
+ "src/aquarium-optimized/opengl/OpenGLPlatforms.h",
+ "src/aquarium-optimized/opengl/OpenGLFunctions.h",
+ "src/aquarium-optimized/opengl/OpenGLFunctions.cpp",
+ ]
+ }
+
+ defines = []
+
+ if (enable_angle) {
+ defines += [ "EGL_EGL_PROTOTYPES",
+ "IMGUI_IMPL_OPENGL_LOADER_CUSTOM",
+ "IMGUI_IMPL_OPENGL_ES3", ]
+
+ include_dirs += [
+ "third_party/angle/include",
+ ]
+
+ deps += [
+ "third_party/angle:libGLESv2",
+ "third_party/angle:libEGL",
+ ]
+ }
+
+ if (enable_dawn) {
+ defines += [ "ENABLE_DAWN_BACKEND" ]
+
+ include_dirs += [ "third_party/dawn/src" ]
+
+ sources += [
+ "src/aquarium-optimized/dawn/BufferDawn.cpp",
+ "src/aquarium-optimized/dawn/BufferDawn.h",
+ "src/aquarium-optimized/dawn/ContextDawn.cpp",
+ "src/aquarium-optimized/dawn/ContextDawn.h",
+ "src/aquarium-optimized/dawn/FishModelDawn.cpp",
+ "src/aquarium-optimized/dawn/FishModelDawn.h",
+ "src/aquarium-optimized/dawn/FishModelInstancedDrawDawn.cpp",
+ "src/aquarium-optimized/dawn/FishModelInstancedDrawDawn.h",
+ "src/aquarium-optimized/dawn/GenericModelDawn.cpp",
+ "src/aquarium-optimized/dawn/GenericModelDawn.h",
+ "src/aquarium-optimized/dawn/InnerModelDawn.cpp",
+ "src/aquarium-optimized/dawn/InnerModelDawn.h",
+ "src/aquarium-optimized/dawn/OutsideModelDawn.cpp",
+ "src/aquarium-optimized/dawn/OutsideModelDawn.h",
+ "src/aquarium-optimized/dawn/ProgramDawn.cpp",
+ "src/aquarium-optimized/dawn/ProgramDawn.h",
+ "src/aquarium-optimized/dawn/SeaweedModelDawn.cpp",
+ "src/aquarium-optimized/dawn/SeaweedModelDawn.h",
+ "src/aquarium-optimized/dawn/TextureDawn.cpp",
+ "src/aquarium-optimized/dawn/TextureDawn.h",
+ "src/aquarium-optimized/dawn/imgui_impl_dawn.cpp",
+ "src/aquarium-optimized/dawn/imgui_impl_dawn.h",
+ ]
+
+ deps += [
+ "third_party/dawn/src/dawn:dawn_headers",
+ "third_party/dawn:dawn_utils",
+ "third_party/dawn/src/dawn:libdawn",
+ "third_party/dawn:libdawn_native",
+ "third_party/shaderc:libshaderc",
+ ]
+
+ include_dirs += [
+ "third_party/dawn/third_party/glfw/include",
+ "third_party/shaderc/libshaderc/include",
+ ]
+ } else {
+ deps += [ "third_party:glfw" ]
+
+ include_dirs += [
+ "third_party/glfw/include",
+ ]
+ }
+
+ if (enable_d3d12) {
+ defines += [ "ENABLE_D3D12_BACKEND" ]
+
+ include_dirs += [
+ "src/include/d3d12",
+ ]
+
+ libs += [
+ "d3d12.lib",
+ "dxgi.lib",
+ "d3dcompiler.lib",
+ ]
+
+ sources += [
+ "src/aquarium-optimized/d3d12/BufferD3D12.cpp",
+ "src/aquarium-optimized/d3d12/BufferD3D12.h",
+ "src/aquarium-optimized/d3d12/ContextD3D12.cpp",
+ "src/aquarium-optimized/d3d12/ContextD3D12.h",
+ "src/aquarium-optimized/d3d12/FishModelD3D12.cpp",
+ "src/aquarium-optimized/d3d12/FishModelD3D12.h",
+ "src/aquarium-optimized/d3d12/FishModelInstancedDrawD3D12.cpp",
+ "src/aquarium-optimized/d3d12/FishModelInstancedDrawD3D12.h",
+ "src/aquarium-optimized/d3d12/GenericModelD3D12.cpp",
+ "src/aquarium-optimized/d3d12/GenericModelD3D12.h",
+ "src/aquarium-optimized/d3d12/InnerModelD3D12.cpp",
+ "src/aquarium-optimized/d3d12/InnerModelD3D12.h",
+ "src/aquarium-optimized/d3d12/OutsideModelD3D12.cpp",
+ "src/aquarium-optimized/d3d12/OutsideModelD3D12.h",
+ "src/aquarium-optimized/d3d12/ProgramD3D12.cpp",
+ "src/aquarium-optimized/d3d12/ProgramD3D12.h",
+ "src/aquarium-optimized/d3d12/SeaweedModelD3D12.cpp",
+ "src/aquarium-optimized/d3d12/SeaweedModelD3D12.h",
+ "src/aquarium-optimized/d3d12/TextureD3D12.cpp",
+ "src/aquarium-optimized/d3d12/TextureD3D12.h",
+ "src/aquarium-optimized/d3d12/imgui_impl_dx12.h",
+ "src/aquarium-optimized/d3d12/imgui_impl_dx12.cpp",
+ ]
+ }
+
+ cflags_cc = [
+ "-Wno-string-conversion",
+ "-Wno-unused-result",
+ "-Wno-format-security",
+ "-Wno-microsoft-enum-forward-reference",
+ ]
+}
+
+executable("aquarium-direct-map") {
+ sources = [
+ "src/common/AQUARIUM_ASSERT.h",
+ "src/common/FPSTimer.h",
+ "src/common/FPSTimer.cpp",
+ "src/aquarium-direct-map/AttribBuffer.h",
+ "src/aquarium-direct-map/AttribBuffer.cpp",
+ "src/aquarium-direct-map/Buffer.h",
+ "src/aquarium-direct-map/Buffer.cpp",
+ "src/aquarium-direct-map/Globals.h",
+ "src/aquarium-direct-map/Main.cpp",
+ "src/aquarium-direct-map/Matrix.h",
+ "src/aquarium-direct-map/Model.h",
+ "src/aquarium-direct-map/Model.cpp",
+ "src/aquarium-direct-map/Program.h",
+ "src/aquarium-direct-map/Program.cpp",
+ "src/aquarium-direct-map/Scene.h",
+ "src/aquarium-direct-map/Scene.cpp",
+ "src/aquarium-direct-map/Texture.h",
+ "src/aquarium-direct-map/Texture.cpp",
+ "src/aquarium-direct-map/Uniform.h",
+ "src/aquarium-direct-map/Uniform.cpp",
+ ]
+
+ deps = [
+ "third_party:stb",
+ "third_party:glad",
+ "third_party:glfw",
+ ]
+
+ include_dirs = [
+ "third_party/glad/include",
+ "third_party/rapidjson/include",
+ "third_party/stb",
+ "third_party/glfw/include",
+ "src",
+ ]
+
+ cflags_cc = [
+ "-Wno-string-conversion",
+ "-Wno-unused-result",
+ ]
}
\ No newline at end of file
diff --git a/DEPS b/DEPS
index 0f8c55a..7834e14 100644
--- a/DEPS
+++ b/DEPS
@@ -1,140 +1,145 @@
-#
-# Copyright (c) 2019 The Aquarium Project Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-#
-
-vars = {
- 'chromium_git': 'https://chromium.googlesource.com',
- 'github_git': 'https://github.com',
- 'dawn_git': 'https://dawn.googlesource.com',
- 'dawn_revision': '9d2ccaf65c2a370c5f203e119e194a44fa039481',
- 'imgui_git': 'https://github.com/ocornut',
- 'imgui_revision': 'e16564e67a2e88d4cbe3afa6594650712790fba3',
- 'angle_root': 'third_party/angle',
- 'angle_revision': '6c824a1bc17b286b86cf05a0228ec549875351eb',
- 'glslang_revision': '11805e41d992a9950a9f7f84c505bb7305fbd09f',
- 'build_revision': '54ea0e7fd122348de2f73ac21d1b6eafb9b78969',
- 'buildtools_revision': 'd5c58b84d50d256968271db459cd29b22bff1ba2',
- 'tools_clang_revision': '210f1dc3ebf8504ae246d925e9110ec427eef43f',
- 'spirv_tools_revision': '2090d7a2d26cb9bb0b8738f36a156ed3084a7ab0',
- 'spirv_headers_revision': 'de99d4d834aeb51dd9f099baa285bd44fd04bb3d',
-}
-
-deps = {
- # Dependencies required to use GN/Clang in standalone
- # This revision should be the same as the one in third_party/angle/DEPS
- 'build': {
- 'url': '{chromium_git}/chromium/src/build@{build_revision}',
- },
- # This revision should be the same as the one in third_party/angle/DEPS
- 'buildtools': {
- 'url': '{chromium_git}/chromium/src/buildtools@{buildtools_revision}',
- },
- # This revision should be the same as the one in third_party/angle/DEPS
- 'tools/clang': {
- 'url': '{chromium_git}/chromium/src/tools/clang@{tools_clang_revision}',
- },
- # This revision should be the same as the one in third_party/angle/DEPS
- 'testing': {
- 'url': '{chromium_git}/chromium/src/testing@083d633e752e7a57cbe62a468a06e51e28c49ee9',
- },
- # This revision should be the same as the one in third_party/angle/DEPS
- 'third_party/glslang': {
- 'url': '{chromium_git}/external/github.com/KhronosGroup/glslang@{glslang_revision}',
- },
-
- 'third_party/googletest': {
- 'url': '{chromium_git}/external/github.com/google/googletest@5ec7f0c4a113e2f18ac2c6cc7df51ad6afc24081',
- },
- 'third_party/stb': {
- 'url': '{github_git}/nothings/stb.git@c7110588a4d24c4bb5155c184fbb77dd90b3116e',
- },
- 'third_party/glfw': {
- 'url': '{chromium_git}/external/github.com/glfw/glfw@2de2589f910b1a85905f425be4d32f33cec092df',
- 'condition': 'dawn_standalone',
- },
- 'third_party/rapidjson': {
- 'url': '{github_git}/Tencent/rapidjson.git',
- },
- 'third_party/dawn': {
- 'url': '{dawn_git}/dawn.git@{dawn_revision}',
- },
- 'third_party/angle': {
- 'url': '{chromium_git}/angle/angle.git@{angle_revision}',
- },
- 'third_party/spirv-tools': {
- 'url': '{chromium_git}/external/github.com/KhronosGroup/SPIRV-Tools@{spirv_tools_revision}',
- },
- 'third_party/spirv-headers': {
- 'url': '{chromium_git}/external/github.com/KhronosGroup/SPIRV-Headers@{spirv_headers_revision}',
- },
- 'third_party/imgui': {
- 'url': '{imgui_git}/imgui.git@{imgui_revision}',
- },
-}
-
-hooks = [
- # Pull the compilers and system libraries for hermetic builds
- {
- 'name': 'sysroot_x86',
- 'pattern': '.',
- 'condition': 'checkout_linux and ((checkout_x86 or checkout_x64))',
- 'action': ['python', 'build/linux/sysroot_scripts/install-sysroot.py',
- '--arch=x86'],
- },
- {
- 'name': 'sysroot_x64',
- 'pattern': '.',
- 'condition': 'checkout_linux and (checkout_x64)',
- 'action': ['python', 'build/linux/sysroot_scripts/install-sysroot.py',
- '--arch=x64'],
- },
- {
- # Update the Windows toolchain if necessary. Must run before 'clang' below.
- 'name': 'win_toolchain',
- 'pattern': '.',
- 'condition': 'checkout_win',
- 'action': ['python', 'build/vs_toolchain.py', 'update', '--force'],
- },
- {
- # Update the Mac toolchain if necessary.
- 'name': 'mac_toolchain',
- 'pattern': '.',
- 'condition': 'checkout_mac',
- 'action': ['python', '{angle_root}/build/mac_toolchain.py'],
- },
- {
- # Note: On Win, this should run after win_toolchain, as it may use it.
- 'name': 'clang',
- 'pattern': '.',
- 'action': ['python', 'tools/clang/scripts/update.py'],
- 'condition': 'dawn_standalone',
- },
- {
- # Pull rc binaries using checked-in hashes.
- 'name': 'rc_win',
- 'pattern': '.',
- 'condition': 'checkout_win and (host_os == "win")',
- 'action': [ 'download_from_google_storage',
- '--no_resume',
- '--no_auth',
- '--bucket', 'chromium-browser-clang/rc',
- '-s', 'build/toolchain/win/rc/win/rc.exe.sha1',
- ],
- },
- # Update build/util/LASTCHANGE.
- {
- 'name': 'lastchange',
- 'pattern': '.',
- 'action': ['python', 'build/util/lastchange.py',
- '-o', 'build/util/LASTCHANGE'],
- },
-]
-
-recursedeps = [
- # buildtools provides clang_format, libc++, and libc++abi
- 'buildtools',
- 'third_party/dawn',
- 'third_party/angle',
-]
+#
+# Copyright (c) 2019 The Aquarium Project Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+#
+
+vars = {
+ 'chromium_git': 'https://chromium.googlesource.com',
+ 'github_git': 'https://github.com',
+ 'dawn_git': 'https://dawn.googlesource.com',
+ 'dawn_revision': '9d2ccaf65c2a370c5f203e119e194a44fa039481',
+ 'imgui_git': 'https://github.com/ocornut',
+ 'imgui_revision': 'e16564e67a2e88d4cbe3afa6594650712790fba3',
+ 'angle_root': 'third_party/angle',
+ 'angle_revision': '6c824a1bc17b286b86cf05a0228ec549875351eb',
+ 'glslang_revision': '11805e41d992a9950a9f7f84c505bb7305fbd09f',
+ 'build_revision': '54ea0e7fd122348de2f73ac21d1b6eafb9b78969',
+ 'buildtools_revision': 'd5c58b84d50d256968271db459cd29b22bff1ba2',
+ 'tools_clang_revision': '210f1dc3ebf8504ae246d925e9110ec427eef43f',
+ 'spirv_tools_revision': '2090d7a2d26cb9bb0b8738f36a156ed3084a7ab0',
+ 'spirv_headers_revision': 'de99d4d834aeb51dd9f099baa285bd44fd04bb3d',
+ 'shaderc_git': 'https://github.com/google',
+ 'shaderc_revision': 'd289a55e46ff1c931ca0d90785218370f5ce68e0',
+}
+
+deps = {
+ # Dependencies required to use GN/Clang in standalone
+ # This revision should be the same as the one in third_party/angle/DEPS
+ 'build': {
+ 'url': '{chromium_git}/chromium/src/build@{build_revision}',
+ },
+ # This revision should be the same as the one in third_party/angle/DEPS
+ 'buildtools': {
+ 'url': '{chromium_git}/chromium/src/buildtools@{buildtools_revision}',
+ },
+ # This revision should be the same as the one in third_party/angle/DEPS
+ 'tools/clang': {
+ 'url': '{chromium_git}/chromium/src/tools/clang@{tools_clang_revision}',
+ },
+ # This revision should be the same as the one in third_party/angle/DEPS
+ 'testing': {
+ 'url': '{chromium_git}/chromium/src/testing@083d633e752e7a57cbe62a468a06e51e28c49ee9',
+ },
+ # This revision should be the same as the one in third_party/angle/DEPS
+ 'third_party/glslang': {
+ 'url': '{chromium_git}/external/github.com/KhronosGroup/glslang@{glslang_revision}',
+ },
+
+ 'third_party/googletest': {
+ 'url': '{chromium_git}/external/github.com/google/googletest@5ec7f0c4a113e2f18ac2c6cc7df51ad6afc24081',
+ },
+ 'third_party/stb': {
+ 'url': '{github_git}/nothings/stb.git@c7110588a4d24c4bb5155c184fbb77dd90b3116e',
+ },
+ 'third_party/glfw': {
+ 'url': '{chromium_git}/external/github.com/glfw/glfw@2de2589f910b1a85905f425be4d32f33cec092df',
+ 'condition': 'dawn_standalone',
+ },
+ 'third_party/rapidjson': {
+ 'url': '{github_git}/Tencent/rapidjson.git',
+ },
+ 'third_party/dawn': {
+ 'url': '{dawn_git}/dawn.git@{dawn_revision}',
+ },
+ 'third_party/angle': {
+ 'url': '{chromium_git}/angle/angle.git@{angle_revision}',
+ },
+ 'third_party/spirv-tools': {
+ 'url': '{chromium_git}/external/github.com/KhronosGroup/SPIRV-Tools@{spirv_tools_revision}',
+ },
+ 'third_party/spirv-headers': {
+ 'url': '{chromium_git}/external/github.com/KhronosGroup/SPIRV-Headers@{spirv_headers_revision}',
+ },
+ 'third_party/imgui': {
+ 'url': '{imgui_git}/imgui.git@{imgui_revision}',
+ },
+ 'third_party/shaderc': {
+ 'url': '{shaderc_git}/shaderc.git@{shaderc_revision}',
+ },
+}
+
+hooks = [
+ # Pull the compilers and system libraries for hermetic builds
+ {
+ 'name': 'sysroot_x86',
+ 'pattern': '.',
+ 'condition': 'checkout_linux and ((checkout_x86 or checkout_x64))',
+ 'action': ['python', 'build/linux/sysroot_scripts/install-sysroot.py',
+ '--arch=x86'],
+ },
+ {
+ 'name': 'sysroot_x64',
+ 'pattern': '.',
+ 'condition': 'checkout_linux and (checkout_x64)',
+ 'action': ['python', 'build/linux/sysroot_scripts/install-sysroot.py',
+ '--arch=x64'],
+ },
+ {
+ # Update the Windows toolchain if necessary. Must run before 'clang' below.
+ 'name': 'win_toolchain',
+ 'pattern': '.',
+ 'condition': 'checkout_win',
+ 'action': ['python', 'build/vs_toolchain.py', 'update', '--force'],
+ },
+ {
+ # Update the Mac toolchain if necessary.
+ 'name': 'mac_toolchain',
+ 'pattern': '.',
+ 'condition': 'checkout_mac',
+ 'action': ['python', '{angle_root}/build/mac_toolchain.py'],
+ },
+ {
+ # Note: On Win, this should run after win_toolchain, as it may use it.
+ 'name': 'clang',
+ 'pattern': '.',
+ 'action': ['python', 'tools/clang/scripts/update.py'],
+ 'condition': 'dawn_standalone',
+ },
+ {
+ # Pull rc binaries using checked-in hashes.
+ 'name': 'rc_win',
+ 'pattern': '.',
+ 'condition': 'checkout_win and (host_os == "win")',
+ 'action': [ 'download_from_google_storage',
+ '--no_resume',
+ '--no_auth',
+ '--bucket', 'chromium-browser-clang/rc',
+ '-s', 'build/toolchain/win/rc/win/rc.exe.sha1',
+ ],
+ },
+ # Update build/util/LASTCHANGE.
+ {
+ 'name': 'lastchange',
+ 'pattern': '.',
+ 'action': ['python', 'build/util/lastchange.py',
+ '-o', 'build/util/LASTCHANGE'],
+ },
+]
+
+recursedeps = [
+ # buildtools provides clang_format, libc++, and libc++abi
+ 'buildtools',
+ 'third_party/dawn',
+ 'third_party/angle',
+]
diff --git a/README.md b/README.md
index 9f54b3c..9905e51 100644
--- a/README.md
+++ b/README.md
@@ -1,25 +1,25 @@
-# Aquarium
-Aquarium is a native implementation of [WebGL Aquarium](https://github.com/WebGLSamples/WebGLSamples.github.io). The goal of this project is to compare the performance of WebGL version to its native counterparts, such as OpenGL, D3D, Vulkan, Metal, ANGLE and Dawn.
-
-# Progress
-
-
- | OS |
- Backend |
- Supported |
- MSAA |
- Dynamic Buffer Offset |
- Instanced Draw |
- Dynamically choose GPU |
-
-
- | Linux |
- OpenGL |
- Y |
- Y |
- Not supported |
- N |
- Not supported |
+# Aquarium
+Aquarium is a native implementation of [WebGL Aquarium](https://github.com/WebGLSamples/WebGLSamples.github.io). The goal of this project is to compare the performance of WebGL version to its native counterparts, such as OpenGL, D3D, Vulkan, Metal, ANGLE and Dawn.
+
+# Progress
+
+
+ | OS |
+ Backend |
+ Supported |
+ MSAA |
+ Dynamic Buffer Offset |
+ Instanced Draw |
+ Dynamically choose GPU |
+
+
+ | Linux |
+ OpenGL |
+ Y |
+ Y |
+ Not supported |
+ N |
+ Not supported |
| Linux |
@@ -29,284 +29,263 @@ Aquarium is a native implementation of [WebGL Aquarium](https://github.com/WebGL
Y |
Y |
Y |
-
-
- | macOS |
- OpenGL |
- Y |
- Y |
- Not supported |
- N |
- Not supported |
-
-
- | macOS |
- Dawn/Metal |
- Y |
- Y |
- Y |
- Y |
- Y |
-
-
- | Windows |
- OpenGL |
- Y |
- Y |
- Not supported |
- N |
- Not supported |
-
-
- | Windows |
- ANGLE/D3D11 |
- Y |
- N |
- Not supported |
- N |
- Not supported |
-
-
- | Windows |
- Dawn/D3D12 |
- Y |
- Y |
- N |
- Y |
- Y |
-
-
- | Windows |
- Dawn/Vulkan |
- Y |
- Y |
- Y |
- Y |
- Y |
-
-
- | Windows |
- D3D12 |
- Y |
- Y |
- Y |
- Y |
- Y |
-
-
- | Linux |
- ANGLE/OpenGL |
- N |
- N |
- Not supported |
- N |
- Not supported |
-
-
- | Linux |
- ANGLE/Vulkan |
- N |
- N |
- N |
- N |
- N |
-
-
- | Linux |
- Vulkan |
- N |
- N |
- N |
- N |
- N |
-
-
- | macOS |
- ANGLE/OpenGL |
- N |
- N |
- Not supported |
- N |
- Not supported |
-
-
- | macOS |
- Metal |
- N |
- N |
- N |
- N |
- N |
-
-
- | Windows |
- ANGLE/OpenGL |
- N |
- N |
- Not supported |
- N |
- Not supported |
-
-
- | Windows |
- ANGLE/Vulkan |
- N |
- N |
- N |
- N |
- N |
-
-
- | Windows |
- D3D11 |
- N |
- N |
- Not supported |
- N |
- Not supported |
-
-
- | Windows |
- Vulkan |
- N |
- N |
- N |
- N |
- N |
-
-
-
-# Required Tools and Configurations
-Configure [depot_tools](http://dev.chromium.org/developers/how-tos/install-depot-tools) on all platforms.
-
-## Windows Requirement
-The OpenGL version is required to >= 4.5 on Windows.
-Windows sdk version is required to be over
-[10.0.17134.0](https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk) to support D3D12 backend.
-Visual Studio 2017 is recommand if you want to debug into the code.
-## Linux Requirement
-The OpenGL version is required to >= 4.5 on Linux. To run vulkan of Dawn, please install vulkan driver on ubuntu.
-If you are using Mesa driver, you should install the following library:
-```sh
-sudo apt-get install mesa-vulkan-drivers
-```
-If you are using Nvidia gpu, you should check if the driver support vulkan.
-## macOS Requirement
-The OpenGL version is required to >= 4.1 on macOS. To run Dawn/Metal backend, please check if your macOS support metal.
-```sh
-ps aux | grep -i "metal"
-```
-
-## Build OpenGL, D3D12 and Dawn backends
-
-Aquarium uses gn to build on Linux, macOS and Windows.
-
-```sh
-# Aquarium contains two projects, aquarium-direct-map is a direct map version to WebGL repo, and only has OpenGL backend. The aquarium
-# project contains many backends.
-
-# cd the repo
-cd aquarium
-
-# Download thirdparty
-gclient sync
-
-# Build on aquarium by ninja on Windows, Linux and macOS.
-# On windows, opengl, d3d12 and dawn backends are enabled by default.
-# On linux and macOS, opengl and dawn are enabled by default.
-# Enable or disable a specific platform, you can add 'enable_opengl', 'enable_d3d12', and 'enable_dawn' to gn args.
-# To build a release version, specify 'is_debug=false'.
-gn gen out/Release --args="is_debug=false"
-ninja -C out/Release aquarium
-ninja -C out/Release aquarium-direct-map
-
-# Build on Windows by vs
-gn gen out/build --ide=vs
-open out/build/all.sln using visual studio.
-build aquarium by vs
-
-# Build on macOS by xcode
-gn gen out/build --ide=xcode
-build aquarium by xcode
-```
-
-## Build ANGLE backend
-
-Because ANGLE headers have conflicts with other backends, it can only build individually. To build ANGLE version on Windows, please refer to the following steps (ANGLE backend is only supported on Windows now).
-```sh
-# cd the repo
-cd aquarium
-
-# download thirdparty
-gclient sync
-
-#Build aquarium ninja
-gn gen out/Release --args="is_debug=false enable_angle=true"
-ninja -C out/Release aquarium
-
-# Build on Windows by vs
-gn gen out/Release --ide=vs --args="is_debug=false enable_angle=true"
-open out/Release/all.sln using visual studio.
-build aquarium by vs
-```
-
-# Run
-```sh
-# "--num-fish" : specifies how many fishes will be rendered
-# "--backend" : specifies running a certain backend, 'opengl', 'dawn_d3d12', 'dawn_vulkan', 'dawn_metal', 'dawn_opengl', 'angle'
-# "--enable-full-screen-mode" : specifies rendering a full screen mode
-
-# run on Windows
-aquarium.exe --num-fish 10000 --backend dawn_d3d12
-aquarium.exe --num-fish 10000 --backend dawn_vulkan
-aquarium.exe --num-fish 10000 --backend angle
-
-# run on Linux
-./aquarium --num-fish 10000 --backend opengl
-./aquarium.exe --num-fish 10000 --backend dawn_vulkan
-
-# run on macOS
-./aquarium --num-fish 10000 --backend opengl
-./aquarium.exe --num-fish 10000 --backend dawn_metal
-
-# "--enable-instanced-draws" : specifies rendering fishes by instanced draw. By default fishes
-# are rendered by individual draw. Instanced rendering is only supported on dawn and d3d12 backend now.
-
-aquarium.exe --num-fish 10000 --backend dawn_d3d12 --enable-instanced-draws
-aquarium.exe --num-fish 10000 --backend dawn_vulkan --enable-instanced-draws
-aquarium.exe --num-fish 10000 --backend d3d12 --enable-instanced-draws
-
-# MSAA is disabled by default. To Enable MSAA, "--enable-msaa", 4 samples.
-# MSAA of ANGLE is not supported now.
-
-aquarium.exe --num-fish 10000 --backend opengl --enable-msaa
-
-
-# “--disable-dynamic-buffer-offset” :The path is to test individual draw by creating many binding groups on dawn backend.
-# By default, dynamic buffer offset is enabled. This arg is only supported on dawn backend.
-
-aquarium.exe --num-fish 10000 --backend dawn_d3d12 --disable-dynamic-buffer-offset
-aquarium.exe --num-fish 10000 --backend dawn_vulkan --disable-dynamic-buffer-offset
-
-# "--integrated-gpu", "--discrete-gpu": Specifies which gpu to render the application. The two args are exclusive.
-# This is an optional arg. By default, a default adapter will be created.
-# The option is only supported on dawn and d3d12 backend.
-aquarium.exe --num-fish 10000 --backend dawn_d3d12 --integrated-gpu
-aquarium.exe --num-fish 10000 --backend dawn_vulkan --discrete-gpu
-
-# aquarium-direct-map only has OpenGL backend
-# Enable MSAA
-./aquarium-direct-map --num-fish 10000 --backend opengl --enable-msaa
-
-```
-
-# TODO
-* Dawn Vulkan backend doesn't work now. We need to implement recreate swap chain in Dawn.
-* Debug mode of Dawn Metal backend has some issues to be fixed.
-* Extra semicolon in dawn/third_party/shaderc throws warning when build the project. This should be fixed in Dawn.
-* Texture without VK_IMAGE_USAGE_TRANSFER_DST_BIT should not be cleared. This is a warning of Dawn Vulkan backend.
-* Enable dynamic choosing backend for ANGLE backend.
-* Enable MSAA mode for ANGLE backend.
-* Support Imgui for Direct Map Aquarium.
-* Check and create the highest OpenGL version supported on each of the platforms.
-* Check if some feature is available for D3D12 backend.
+
+
+ | macOS |
+ OpenGL |
+ Y |
+ Y |
+ Not supported |
+ N |
+ Not supported |
+
+
+ | macOS |
+ Dawn/Metal |
+ Y |
+ Y |
+ Y |
+ Y |
+ Y |
+
+
+ | Windows |
+ OpenGL |
+ Y |
+ Y |
+ Not supported |
+ N |
+ Not supported |
+
+
+ | Windows |
+ ANGLE/D3D11 |
+ Y |
+ N |
+ Not supported |
+ N |
+ Not supported |
+
+
+ | Windows |
+ Dawn/D3D12 |
+ Y |
+ Y |
+ N |
+ Y |
+ Y |
+
+
+ | Windows |
+ Dawn/Vulkan |
+ Y |
+ Y |
+ Y |
+ Y |
+ Y |
+
+
+ | Windows |
+ D3D12 |
+ Y |
+ Y |
+ Y |
+ Y |
+ Y |
+
+
+ | Linux |
+ ANGLE/OpenGL |
+ N |
+ N |
+ Not supported |
+ N |
+ Not supported |
+
+
+ | Linux |
+ ANGLE/Vulkan |
+ N |
+ N |
+ N |
+ N |
+ N |
+
+
+ | Linux |
+ Vulkan |
+ N |
+ N |
+ N |
+ N |
+ N |
+
+
+ | macOS |
+ ANGLE/OpenGL |
+ N |
+ N |
+ Not supported |
+ N |
+ Not supported |
+
+
+ | macOS |
+ Metal |
+ N |
+ N |
+ N |
+ N |
+ N |
+
+
+ | Windows |
+ ANGLE/OpenGL |
+ N |
+ N |
+ Not supported |
+ N |
+ Not supported |
+
+
+ | Windows |
+ ANGLE/Vulkan |
+ N |
+ N |
+ N |
+ N |
+ N |
+
+
+ | Windows |
+ D3D11 |
+ N |
+ N |
+ Not supported |
+ N |
+ Not supported |
+
+
+ | Windows |
+ Vulkan |
+ N |
+ N |
+ N |
+ N |
+ N |
+
+
+
+# Required Tools and Configurations
+Configure [depot_tools](http://dev.chromium.org/developers/how-tos/install-depot-tools) on all platforms.
+
+## Windows Requirement
+The OpenGL version is required to >= 4.5 on Windows.
+Windows sdk version is required to be over
+[10.0.17134.0](https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk) to support D3D12 backend.
+Visual Studio 2017 is recommand if you want to debug into the code.
+## Linux Requirement
+The OpenGL version is required to >= 4.5 on Linux. To run vulkan of Dawn, please install vulkan driver on ubuntu.
+If you are using Mesa driver, you should install the following library:
+```sh
+sudo apt-get install mesa-vulkan-drivers
+```
+If you are using Nvidia gpu, you should check if the driver support vulkan.
+## macOS Requirement
+The OpenGL version is required to >= 4.1 on macOS. To run Dawn/Metal backend, please check if your macOS support metal.
+```sh
+ps aux | grep -i "metal"
+```
+
+## Build OpenGL, D3D12 and Dawn backends
+
+Aquarium uses gn to build on Linux, macOS and Windows.
+
+```sh
+# Aquarium contains two projects, aquarium-direct-map is a direct map version to WebGL repo, and only has OpenGL backend. The aquarium
+# project contains many backends.
+
+# cd the repo
+cd aquarium
+
+# Download thirdparty
+gclient sync
+
+# Build on aquarium by ninja on Windows, Linux and macOS.
+# On Windows, OpenGL, D3D12,ANGLE and Dawn backends are enabled by default.
+# On Linux and macOS, Opengl and Dawn are enabled by default.
+# Enable or disable a specific platform, you can add 'enable_opengl', 'enable_d3d12', 'enable_angle', and 'enable_dawn' to gn args.
+# To build a release version, specify 'is_debug=false'.
+gn gen out/Release --args="is_debug=false"
+ninja -C out/Release aquarium
+ninja -C out/Release aquarium-direct-map
+
+# Build on Windows by vs
+gn gen out/build --ide=vs
+open out/build/all.sln using visual studio.
+build aquarium by vs
+
+# Build on macOS by xcode
+gn gen out/build --ide=xcode
+build aquarium by xcode
+```
+
+# Run
+```sh
+# "--num-fish" : specifies how many fishes will be rendered
+# "--backend" : specifies running a certain backend, 'opengl', 'dawn_d3d12', 'dawn_vulkan', 'dawn_metal', 'dawn_opengl', 'angle'
+# "--enable-full-screen-mode" : specifies rendering a full screen mode
+
+# run on Windows
+aquarium.exe --num-fish 10000 --backend dawn_d3d12
+aquarium.exe --num-fish 10000 --backend dawn_vulkan
+aquarium.exe --num-fish 10000 --backend angle
+
+# run on Linux
+./aquarium --num-fish 10000 --backend opengl
+./aquarium.exe --num-fish 10000 --backend dawn_vulkan
+
+# run on macOS
+./aquarium --num-fish 10000 --backend opengl
+./aquarium.exe --num-fish 10000 --backend dawn_metal
+
+# "--enable-instanced-draws" : specifies rendering fishes by instanced draw. By default fishes
+# are rendered by individual draw. Instanced rendering is only supported on dawn and d3d12 backend now.
+
+aquarium.exe --num-fish 10000 --backend dawn_d3d12 --enable-instanced-draws
+aquarium.exe --num-fish 10000 --backend dawn_vulkan --enable-instanced-draws
+aquarium.exe --num-fish 10000 --backend d3d12 --enable-instanced-draws
+
+# MSAA is disabled by default. To Enable MSAA, "--enable-msaa", 4 samples.
+# MSAA of ANGLE is not supported now.
+
+aquarium.exe --num-fish 10000 --backend opengl --enable-msaa
+
+
+# “--disable-dynamic-buffer-offset” :The path is to test individual draw by creating many binding groups on dawn backend.
+# By default, dynamic buffer offset is enabled. This arg is only supported on dawn backend.
+
+aquarium.exe --num-fish 10000 --backend dawn_d3d12 --disable-dynamic-buffer-offset
+aquarium.exe --num-fish 10000 --backend dawn_vulkan --disable-dynamic-buffer-offset
+
+# "--integrated-gpu", "--discrete-gpu": Specifies which gpu to render the application. The two args are exclusive.
+# This is an optional arg. By default, a default adapter will be created.
+# The option is only supported on dawn and d3d12 backend.
+aquarium.exe --num-fish 10000 --backend dawn_d3d12 --integrated-gpu
+aquarium.exe --num-fish 10000 --backend dawn_vulkan --discrete-gpu
+
+# aquarium-direct-map only has OpenGL backend
+# Enable MSAA
+./aquarium-direct-map --num-fish 10000 --backend opengl --enable-msaa
+
+```
+
+# TODO
+* Dawn Vulkan backend doesn't work now. We need to implement recreate swap chain in Dawn.
+* Debug mode of Dawn Metal backend has some issues to be fixed.
+* Texture without VK_IMAGE_USAGE_TRANSFER_DST_BIT should not be cleared. This is a warning of Dawn Vulkan backend.
+* Enable dynamic choosing backend for ANGLE backend.
+* Enable MSAA mode for ANGLE backend.
+* Support Imgui for Direct Map Aquarium.
+* Check and create the highest OpenGL version supported on each of the platforms.
+* Check if some feature is available for D3D12 backend.
diff --git a/build_overrides/dawn.gni b/build_overrides/dawn.gni
index 61bb34b..973588e 100644
--- a/build_overrides/dawn.gni
+++ b/build_overrides/dawn.gni
@@ -1,12 +1,12 @@
-#
-# Copyright (c) 2019 The Aquarium Project Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-#
-
-dawn_glfw_dir = "//third_party/dawn/third_party/glfw"
-dawn_jinja2_dir = "//third_party/dawn/third_party/jinja2"
-dawn_googletest_dir = "//third_party/dawn/third_party/googletest"
-dawn_shaderc_dir = "//third_party/dawn/third_party/shaderc"
-dawn_spirv_cross_dir = "//third_party/dawn/third_party/spirv-cross"
-dawn_spirv_tools_dir = "//third_party/spirv-tools"
+#
+# Copyright (c) 2019 The Aquarium Project Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+#
+
+dawn_glfw_dir = "//third_party/dawn/third_party/glfw"
+dawn_jinja2_dir = "//third_party/dawn/third_party/jinja2"
+dawn_googletest_dir = "//third_party/dawn/third_party/googletest"
+dawn_shaderc_dir = "//third_party/shaderc"
+dawn_spirv_cross_dir = "//third_party/dawn/third_party/spirv-cross"
+dawn_spirv_tools_dir = "//third_party/spirv-tools"
diff --git a/src/aquarium-direct-map/AttribBuffer.cpp b/src/aquarium-direct-map/AttribBuffer.cpp
index 33e1568..2159528 100644
--- a/src/aquarium-direct-map/AttribBuffer.cpp
+++ b/src/aquarium-direct-map/AttribBuffer.cpp
@@ -1,32 +1,32 @@
-//
-// Copyright (c) 2019 The Aquarium Project Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// AttribBuffer.cpp: Implement AttribBuffer.
-
-#include "AttribBuffer.h"
-
-AttribBuffer::AttribBuffer(int numComponents,
- const std::vector &buffer,
- int size,
- const std::string &opt_type)
- : type(opt_type),
- bufferFloat(buffer),
- bufferUShort(),
- numComponents(numComponents),
- numElements(size / numComponents)
-{
-}
-
-AttribBuffer::AttribBuffer(int numComponents,
- const std::vector &buffer,
- int size,
- const std::string &opt_type)
- : type(opt_type),
- bufferFloat(),
- bufferUShort(buffer),
- numComponents(numComponents),
- numElements(size / numComponents)
-{
-}
+//
+// Copyright (c) 2019 The Aquarium Project Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+// AttribBuffer.cpp: Implement AttribBuffer.
+
+#include "AttribBuffer.h"
+
+AttribBuffer::AttribBuffer(int numComponents,
+ const std::vector &buffer,
+ int size,
+ const std::string &opt_type)
+ : type(opt_type),
+ bufferFloat(buffer),
+ bufferUShort(),
+ numComponents(numComponents),
+ numElements(size / numComponents)
+{
+}
+
+AttribBuffer::AttribBuffer(int numComponents,
+ const std::vector &buffer,
+ int size,
+ const std::string &opt_type)
+ : type(opt_type),
+ bufferFloat(),
+ bufferUShort(buffer),
+ numComponents(numComponents),
+ numElements(size / numComponents)
+{
+}
diff --git a/src/aquarium-direct-map/AttribBuffer.h b/src/aquarium-direct-map/AttribBuffer.h
index ffdff1d..de2d10b 100644
--- a/src/aquarium-direct-map/AttribBuffer.h
+++ b/src/aquarium-direct-map/AttribBuffer.h
@@ -1,39 +1,42 @@
-//
-// Copyright (c) 2019 The Aquarium Project Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// AttribBuffer.h: Define AttribBuffer Class. Store vertex attributes such as positions and indexes.
-
-#ifndef ATTRIBBUFFER_H
-#define ATTRIBBUFFER_H
-
-#include
-#include
-
-class AttribBuffer
-{
-public:
- AttribBuffer() {}
- AttribBuffer(int numComponents, const std::vector &buffer, int size, const std::string &opt_type);
- AttribBuffer(int numComponents,
- const std::vector &buffer,
- int size,
- const std::string &opt_type);
-
- int getNumComponents() const { return numComponents; }
- int getNumElements() const { return numElements; }
-
- const std::vector &getBufferFloat() const { return bufferFloat; }
- const std::vector &getBufferUShort() const { return bufferUShort; }
- const std::string &getType() const { return type; }
-
-private:
- std::string type;
- std::vector bufferFloat;
- std::vector bufferUShort;
- int numComponents;
- int numElements;
-};
-
-#endif // ATTRIBBUFFER_H
+//
+// Copyright (c) 2019 The Aquarium Project Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+// AttribBuffer.h: Define AttribBuffer Class. Store vertex attributes such as positions and indexes.
+
+#ifndef ATTRIBBUFFER_H
+#define ATTRIBBUFFER_H
+
+#include
+#include
+
+class AttribBuffer
+{
+ public:
+ AttribBuffer() {}
+ AttribBuffer(int numComponents,
+ const std::vector &buffer,
+ int size,
+ const std::string &opt_type);
+ AttribBuffer(int numComponents,
+ const std::vector &buffer,
+ int size,
+ const std::string &opt_type);
+
+ int getNumComponents() const { return numComponents; }
+ int getNumElements() const { return numElements; }
+
+ const std::vector &getBufferFloat() const { return bufferFloat; }
+ const std::vector &getBufferUShort() const { return bufferUShort; }
+ const std::string &getType() const { return type; }
+
+ private:
+ std::string type;
+ std::vector bufferFloat;
+ std::vector bufferUShort;
+ int numComponents;
+ int numElements;
+};
+
+#endif // ATTRIBBUFFER_H
diff --git a/src/aquarium-direct-map/Buffer.cpp b/src/aquarium-direct-map/Buffer.cpp
index a5d17d6..17d8505 100644
--- a/src/aquarium-direct-map/Buffer.cpp
+++ b/src/aquarium-direct-map/Buffer.cpp
@@ -1,58 +1,58 @@
-//
-// Copyright (c) 2019 The Aquarium Project Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// Buffer.cpp: Implement the index or vertex buffer wrappers and resource bindings of OpenGL.
-
-#include
-
-#include "Buffer.h"
-
-#include "common/AQUARIUM_ASSERT.h"
-
-Buffer::Buffer(const AttribBuffer &attribBuffer, GLenum target)
- : mBuf(0),
- mNumComponents(attribBuffer.getNumComponents()),
- mNumElements(attribBuffer.getNumElements()),
- mTotalComponents(0),
- mType(0),
- mNormalize(true),
- mStride(0),
- mOffset(nullptr)
-
-{
- glGenBuffers(1, &mBuf);
-
- glBindBuffer(target, mBuf);
-
- mTotalComponents = mNumComponents * mNumElements;
-
- auto bufferFloat = attribBuffer.getBufferFloat();
- auto bufferUShort = attribBuffer.getBufferUShort();
-
- if (attribBuffer.getType() == "Float32Array")
- {
- mType = GL_FLOAT;
- mNormalize = false;
- glBufferData(target, sizeof(GLfloat) * bufferFloat.size(), bufferFloat.data(),
- GL_STATIC_DRAW);
- }
- else if (attribBuffer.getType() == "Uint16Array")
- {
- mType = GL_UNSIGNED_SHORT;
- glBufferData(target, sizeof(GLushort) * bufferUShort.size(), bufferUShort.data(),
- GL_STATIC_DRAW);
- }
- else
- {
- std::cout << "bindBufferData undefined type." << std::endl;
- }
-
- ASSERT(glGetError() == GL_NO_ERROR);
-}
-
-Buffer::~Buffer()
-{
- glDeleteBuffers(1, &mBuf);
-}
+//
+// Copyright (c) 2019 The Aquarium Project Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+// Buffer.cpp: Implement the index or vertex buffer wrappers and resource bindings of OpenGL.
+
+#include
+
+#include "Buffer.h"
+
+#include "common/AQUARIUM_ASSERT.h"
+
+Buffer::Buffer(const AttribBuffer &attribBuffer, GLenum target)
+ : mBuf(0),
+ mNumComponents(attribBuffer.getNumComponents()),
+ mNumElements(attribBuffer.getNumElements()),
+ mTotalComponents(0),
+ mType(0),
+ mNormalize(true),
+ mStride(0),
+ mOffset(nullptr)
+
+{
+ glGenBuffers(1, &mBuf);
+
+ glBindBuffer(target, mBuf);
+
+ mTotalComponents = mNumComponents * mNumElements;
+
+ auto bufferFloat = attribBuffer.getBufferFloat();
+ auto bufferUShort = attribBuffer.getBufferUShort();
+
+ if (attribBuffer.getType() == "Float32Array")
+ {
+ mType = GL_FLOAT;
+ mNormalize = false;
+ glBufferData(target, sizeof(GLfloat) * bufferFloat.size(), bufferFloat.data(),
+ GL_STATIC_DRAW);
+ }
+ else if (attribBuffer.getType() == "Uint16Array")
+ {
+ mType = GL_UNSIGNED_SHORT;
+ glBufferData(target, sizeof(GLushort) * bufferUShort.size(), bufferUShort.data(),
+ GL_STATIC_DRAW);
+ }
+ else
+ {
+ std::cout << "bindBufferData undefined type." << std::endl;
+ }
+
+ ASSERT(glGetError() == GL_NO_ERROR);
+}
+
+Buffer::~Buffer()
+{
+ glDeleteBuffers(1, &mBuf);
+}
diff --git a/src/aquarium-direct-map/Buffer.h b/src/aquarium-direct-map/Buffer.h
index 4bfffb0..9e2b5e2 100644
--- a/src/aquarium-direct-map/Buffer.h
+++ b/src/aquarium-direct-map/Buffer.h
@@ -1,43 +1,43 @@
-//
-// Copyright (c) 2019 The Aquarium Project Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// Buffer.h : Define Buffer Class and upload buffers to gpu.
-
-#ifndef BUFFER_H
-#define BUFFER_H
-
-#include
-
-#include "AttribBuffer.h"
-#include "glad/glad.h"
-
-class Buffer
-{
-public:
- Buffer() {}
- Buffer(const AttribBuffer &array, GLenum target);
- ~Buffer();
-
- GLuint getBuffer() const { return mBuf; }
- int getNumComponents() const { return mNumComponents; }
- int getNumElements() const { return mNumElements; }
- int getTotalComponents() const { return mTotalComponents; }
- GLenum getType() const { return mType; }
- bool getNormalize() const { return mNormalize; }
- GLsizei getStride() const { return mStride; }
- void *getOffset() const { return mOffset; }
-
-private:
- GLuint mBuf;
- int mNumComponents;
- int mNumElements;
- int mTotalComponents;
- GLenum mType;
- bool mNormalize;
- GLsizei mStride;
- void *mOffset;
-};
-
-#endif // !BUFFER_H
+//
+// Copyright (c) 2019 The Aquarium Project Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+// Buffer.h : Define Buffer Class and upload buffers to gpu.
+
+#ifndef BUFFER_H
+#define BUFFER_H
+
+#include
+
+#include "AttribBuffer.h"
+#include "glad/glad.h"
+
+class Buffer
+{
+ public:
+ Buffer() {}
+ Buffer(const AttribBuffer &array, GLenum target);
+ ~Buffer();
+
+ GLuint getBuffer() const { return mBuf; }
+ int getNumComponents() const { return mNumComponents; }
+ int getNumElements() const { return mNumElements; }
+ int getTotalComponents() const { return mTotalComponents; }
+ GLenum getType() const { return mType; }
+ bool getNormalize() const { return mNormalize; }
+ GLsizei getStride() const { return mStride; }
+ void *getOffset() const { return mOffset; }
+
+ private:
+ GLuint mBuf;
+ int mNumComponents;
+ int mNumElements;
+ int mTotalComponents;
+ GLenum mType;
+ bool mNormalize;
+ GLsizei mStride;
+ void *mOffset;
+};
+
+#endif // !BUFFER_H
diff --git a/src/aquarium-direct-map/Globals.h b/src/aquarium-direct-map/Globals.h
index b1d0291..b5ce6a9 100644
--- a/src/aquarium-direct-map/Globals.h
+++ b/src/aquarium-direct-map/Globals.h
@@ -1,229 +1,231 @@
-//
-// Copyright (c) 2019 The Aquarium Project Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// Globals.h: Define global variables, constant variables, global texture map, program map and
-// scene map.
-
-#pragma once
-#ifndef GLOBALS_H
-#define GLOBALS_H
-
-#include
-#include