Skip to content

Commit 8ecae4e

Browse files
committed
committing requested changes in stages.
1 parent 6ec7321 commit 8ecae4e

File tree

11 files changed

+65
-248
lines changed

11 files changed

+65
-248
lines changed

attachments/simple_engine/install_dependencies_windows.bat

Lines changed: 33 additions & 153 deletions
Original file line numberDiff line numberDiff line change
@@ -4,160 +4,40 @@ REM This script installs all required dependencies for building the Simple Game
44

55
echo Installing Simple Game Engine dependencies for Windows...
66

7-
REM Check if running as administrator
8-
REM Administrator privileges are not required. Proceeding without elevation.
9-
net session >nul 2>&1
10-
if %errorLevel% == 0 (
11-
echo Running as administrator (optional).
12-
) else (
13-
echo Running without administrator privileges.
14-
)
15-
16-
REM vcpkg detection and optional local install
17-
set "VCPKG_EXE="
18-
where vcpkg >nul 2>&1
19-
if %errorlevel%==0 (
20-
echo vcpkg found in PATH
21-
set "VCPKG_EXE=vcpkg"
22-
) else (
23-
echo vcpkg not found in PATH.
24-
set "VCPKG_HOME=%USERPROFILE%\vcpkg"
25-
set /p INSTALL_VCPKG="Install vcpkg locally to %VCPKG_HOME%? (Y/N): "
26-
if /I "%INSTALL_VCPKG%"=="Y" (
27-
if not exist "%VCPKG_HOME%" (
28-
echo Cloning vcpkg into %VCPKG_HOME% ...
29-
git clone https://github.com/Microsoft/vcpkg.git "%VCPKG_HOME%"
30-
if %errorlevel% neq 0 (
31-
echo Failed to clone vcpkg. Ensure Git is installed and try again.
32-
goto AFTER_VCPKG
33-
)
34-
) else (
35-
echo vcpkg directory already exists at %VCPKG_HOME%
36-
)
37-
pushd "%VCPKG_HOME%"
38-
call bootstrap-vcpkg.bat
39-
if %errorlevel% neq 0 (
40-
echo Failed to bootstrap vcpkg.
41-
popd
42-
goto AFTER_VCPKG
43-
)
44-
popd
45-
set "VCPKG_EXE=%VCPKG_HOME%\vcpkg.exe"
46-
set /p ADD_VCPKG_PATH="Add vcpkg to PATH for this session? (Y/N): "
47-
if /I "%ADD_VCPKG_PATH%"=="Y" set "PATH=%PATH%;%VCPKG_HOME%"
48-
) else (
49-
echo Skipping vcpkg installation.
50-
)
51-
)
52-
:AFTER_VCPKG
53-
54-
REM Tool checks (no forced install)
55-
where cmake >nul 2>&1
56-
if %errorlevel%==0 (
57-
echo CMake found in PATH
58-
) else (
59-
echo CMake not found in PATH.
60-
set /p OPEN_CMAKE="Open CMake download page in browser? (Y/N): "
61-
if /I "%OPEN_CMAKE%"=="Y" start "" "https://cmake.org/download/"
62-
)
63-
64-
where git >nul 2>&1
65-
if %errorlevel%==0 (
66-
echo Git found in PATH
67-
) else (
68-
echo Git not found in PATH.
69-
set /p OPEN_GIT="Open Git for Windows download page? (Y/N): "
70-
if /I "%OPEN_GIT%"=="Y" start "" "https://git-scm.com/download/win"
71-
)
72-
73-
REM Vulkan SDK detection (no forced install)
74-
set "HAVE_VULKAN_SDK="
75-
if defined VULKAN_SDK set "HAVE_VULKAN_SDK=1"
76-
where vulkaninfo >nul 2>&1
77-
if %errorlevel%==0 set "HAVE_VULKAN_SDK=1"
78-
if defined HAVE_VULKAN_SDK (
79-
echo Vulkan SDK detected.
80-
) else (
81-
echo Vulkan SDK not detected.
82-
set /p OPEN_VULKAN="Open Vulkan SDK download page (LunarG) in browser? (Y/N): "
83-
if /I "%OPEN_VULKAN%"=="Y" start "" "https://vulkan.lunarg.com/sdk/home#windows"
84-
)
85-
86-
REM Optional vcpkg package installation
87-
if defined VCPKG_EXE (
88-
set /p INSTALL_VCPKG_PKGS="Install common dependencies via vcpkg (glfw3, glm, openal-soft, ktx, tinygltf)? (Y/N): "
89-
if /I "%INSTALL_VCPKG_PKGS%"=="Y" (
90-
set "VCPKG_DEFAULT_TRIPLET=x64-windows"
91-
echo Installing packages with %VCPKG_EXE% (triplet %VCPKG_DEFAULT_TRIPLET%) ...
92-
"%VCPKG_EXE%" install glfw3:%VCPKG_DEFAULT_TRIPLET% glm:%VCPKG_DEFAULT_TRIPLET% openal-soft:%VCPKG_DEFAULT_TRIPLET% ktx:%VCPKG_DEFAULT_TRIPLET% tinygltf:%VCPKG_DEFAULT_TRIPLET%
93-
if %errorlevel% neq 0 (
94-
echo Warning: Some vcpkg installations may have failed. Please review output.
95-
)
96-
) else (
97-
echo Skipping vcpkg package installation.
98-
)
99-
) else (
100-
echo vcpkg not available; skipping vcpkg package installation.
101-
)
102-
103-
REM Slang compiler detection and optional install
104-
set "SLANGC_EXE="
105-
where slangc >nul 2>&1
106-
if %errorlevel%==0 (
107-
echo Slang compiler found in PATH
108-
set "SLANGC_EXE=slangc"
109-
) else (
110-
if defined VULKAN_SDK (
111-
if exist "%VULKAN_SDK%\Bin\slangc.exe" set "SLANGC_EXE=%VULKAN_SDK%\Bin\slangc.exe"
112-
if not defined SLANGC_EXE if exist "%VULKAN_SDK%\Bin64\slangc.exe" set "SLANGC_EXE=%VULKAN_SDK%\Bin64\slangc.exe"
113-
)
114-
)
115-
116-
if defined SLANGC_EXE (
117-
echo Using Slang at %SLANGC_EXE%
118-
) else (
119-
echo Slang compiler (slangc) not found.
120-
set /p INSTALL_SLANG="Download and install latest Slang locally (no admin)? (Y/N): "
121-
if /I "%INSTALL_SLANG%"=="Y" (
122-
set "SLANG_ROOT=%LOCALAPPDATA%\slang"
123-
if not exist "%SLANG_ROOT%" mkdir "%SLANG_ROOT%"
124-
echo Downloading latest Slang release...
125-
powershell -NoProfile -ExecutionPolicy Bypass -Command "$ErrorActionPreference='Stop'; $r=Invoke-RestMethod 'https://api.github.com/repos/shader-slang/slang/releases/latest'; $asset=$r.assets | Where-Object { $_.name -match 'win64.*\.zip$' } | Select-Object -First 1; if(-not $asset){ throw 'No win64 asset found'; } $out=Join-Path $env:TEMP $asset.name; Invoke-WebRequest $asset.browser_download_url -OutFile $out; Expand-Archive -Path $out -DestinationPath $env:LOCALAPPDATA\slang -Force; Write-Host ('Downloaded Slang ' + $r.tag_name)"
126-
echo Locating slangc.exe...
127-
set "SLANGC_PATH="
128-
for /f "delims=" %%F in ('dir /b /s "%LOCALAPPDATA%\slang\slangc.exe" 2^>nul') do (
129-
set "SLANGC_PATH=%%F"
130-
goto FOUND_SLANG
131-
)
132-
:FOUND_SLANG
133-
if defined SLANGC_PATH (
134-
echo Found slangc at "%SLANGC_PATH%"
135-
for %%D in ("%SLANGC_PATH%") do set "SLANG_BIN=%%~dpD"
136-
set /p ADD_SLANG_PATH="Add Slang to PATH for this session? (Y/N): "
137-
if /I "%ADD_SLANG_PATH%"=="Y" set "PATH=%SLANG_BIN%;%PATH%"
138-
set "SLANGC_EXE=%SLANGC_PATH%"
139-
) else (
140-
echo Failed to locate slangc after extraction. Please install manually if needed: https://github.com/shader-slang/slang/releases
141-
)
142-
) else (
143-
echo Skipping Slang installation.
144-
)
145-
)
146-
147-
REM Final guidance (no machine-wide env changes)
7+
:: Check if vcpkg is installed
8+
where vcpkg >nul 2>nul
9+
if %ERRORLEVEL% neq 0 (
10+
echo vcpkg not found. Please install vcpkg first.
11+
echo Visit https://github.com/microsoft/vcpkg for installation instructions.
12+
echo Typically, you would:
13+
echo 1. git clone https://github.com/Microsoft/vcpkg.git
14+
echo 2. cd vcpkg
15+
echo 3. .\bootstrap-vcpkg.bat
16+
echo 4. Add vcpkg to your PATH
17+
exit /b 1
18+
)
19+
20+
:: Enable binary caching for vcpkg
21+
echo Enabling binary caching for vcpkg...
22+
set VCPKG_BINARY_SOURCES=clear;files,%TEMP%\vcpkg-cache,readwrite
23+
24+
:: Create cache directory if it doesn't exist
25+
if not exist %TEMP%\vcpkg-cache mkdir %TEMP%\vcpkg-cache
26+
27+
:: Install all dependencies at once using vcpkg with parallel installation
28+
echo Installing all dependencies...
29+
vcpkg install --triplet=x64-windows --x-manifest-root=%~dp0\.. --feature-flags=binarycaching,manifests --x-install-root=%VCPKG_INSTALLATION_ROOT%/installed
30+
31+
:: Remind about Vulkan SDK
14832
echo.
149-
echo Dependencies check completed!
33+
echo Don't forget to install the Vulkan SDK from https://vulkan.lunarg.com/
15034
echo.
151-
echo Build instructions:
152-
echo 1. Open a new command prompt (if you added tools to PATH for this session).
153-
echo 2. cd to attachments\simple_engine
154-
echo 3. mkdir build ^&^& cd build
155-
echo 4. If using vcpkg toolchain, run:
156-
echo cmake .. -DCMAKE_TOOLCHAIN_FILE=%VCPKG_HOME%\scripts\buildsystems\vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows
157-
echo (adjust path if you installed vcpkg elsewhere; or omit this flag if not using vcpkg)
158-
echo 5. cmake --build . --config Release
159-
echo.
160-
echo Alternatively open CMakeLists.txt in Visual Studio and configure normally.
35+
36+
echo All dependencies have been installed successfully!
37+
echo You can now use CMake to build your Vulkan project.
16138
echo.
39+
echo Example CMake command:
40+
echo cmake -B build -S . -DCMAKE_TOOLCHAIN_FILE=[path\to\vcpkg]\scripts\buildsystems\vcpkg.cmake
41+
echo cmake --build build
16242

163-
pause
43+
exit /b 0
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"name": "vulkan-game-engine-tutorial",
3+
"version": "1.0.0",
4+
"dependencies": [
5+
"glfw3",
6+
"glm",
7+
"openal-soft",
8+
"ktx",
9+
"tinygltf",
10+
"nlohmann-json"
11+
]
12+
}

en/Building_a_Simple_Engine/Tooling/01_introduction.adoc

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
1-
::pp: {plus}{plus}
1+
:pp: {plus}{plus}
22

33
= Tooling: Introduction
4-
:doctype: book
5-
:sectnums:
6-
:sectnumlevels: 4
7-
:toc: left
8-
:icons: font
9-
:source-highlighter: highlightjs
10-
:source-language: c++
114

125
== Introduction to Engine Tooling
136

@@ -17,23 +10,21 @@ Effective tooling is critical for maintaining productivity, ensuring quality, an
1710

1811
=== What We'll Cover
1912

20-
In this chapter, we'll explore:
13+
This chapter will equip you with the professional tooling ecosystem that transforms a working Vulkan application into a maintainable, debuggable, and deployable product. We'll begin by implementing a continuous integration and continuous deployment pipeline specifically designed for Vulkan's unique requirements. This foundation ensures that your application builds consistently across platforms while catching integration issues before they reach users.
2114

22-
* *CI/CD for Vulkan Projects*: We'll implement a continuous integration and continuous deployment pipeline specifically tailored for Vulkan applications, ensuring consistent builds and automated testing across different platforms.
15+
Debugging Vulkan applications presents unique challenges that traditional debugging approaches can't address effectively. We'll master both Vulkan's built-in debugging extensions like VK_KHR_debug_utils and external tools like RenderDoc, creating a comprehensive debugging workflow that can diagnose everything from validation layer warnings to complex rendering pipeline issues.
2316

24-
* *Debugging with VK_KHR_debug_utils and RenderDoc*: We'll explore how to use Vulkan's debugging extensions and external tools like RenderDoc to identify and fix issues in your rendering pipeline.
17+
Robust crash handling becomes crucial as your application moves toward production deployment. We'll implement systems that can gracefully handle unexpected failures, generate detailed minidumps for post-mortem analysis, and provide users with meaningful recovery options rather than abrupt terminations.
2518

26-
* *Crash Handling and Minidumps*: We'll implement robust crash handling mechanisms and learn how to generate and analyze minidumps to diagnose issues in production environments.
27-
28-
* *Vulkan Extensions for Robustness*: We'll explore extensions like VK_EXT_robustness2 that can help make your application more resilient to undefined behavior.
19+
Finally, we'll explore Vulkan extensions designed specifically for application robustness, such as VK_EXT_robustness2, which help your application handle edge cases and undefined behavior gracefully. These extensions transform potential crashes into recoverable situations, improving the overall user experience.
2920

3021
=== Prerequisites
3122

32-
Before diving into this chapter, you should be familiar with:
23+
This chapter assumes solid understanding of the Vulkan fundamentals and engine architecture we've built throughout the previous chapters. The tooling we'll implement needs to integrate with your existing systems—CI/CD pipelines must understand your project structure, debugging tools must work with your rendering pipeline, and crash handling must respect your engine's resource management patterns.
24+
25+
Experience with modern C++ concepts becomes particularly important here, as professional tooling often leverages advanced language features for reliability and maintainability. C++17 and C++20 features like structured bindings, concepts, and coroutines appear frequently in production tooling code, and understanding these patterns will help you implement robust solutions.
3326

34-
* The basics of Vulkan and our engine architecture from previous chapters
35-
* Modern C++ concepts, particularly those introduced in C++17 and C++20
36-
* Basic understanding of software development workflows and tools
27+
A basic familiarity with software development workflows and tools will provide context for the systems we'll build. While we'll explain the specific implementations, understanding why continuous integration matters, how debugging fits into development cycles, and why crash reporting improves user experience will help you appreciate the architectural decisions we make throughout this chapter.
3728

3829
Let's begin by exploring how to set up a CI/CD pipeline for Vulkan projects.
3930

en/Building_a_Simple_Engine/Tooling/02_cicd.adoc

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
1-
::pp: {plus}{plus}
1+
:pp: {plus}{plus}
22

33
= Tooling: CI/CD for Vulkan Projects
4-
:doctype: book
5-
:sectnums:
6-
:sectnumlevels: 4
7-
:toc: left
8-
:icons: font
9-
:source-highlighter: highlightjs
10-
:source-language: c++
114

125
== Continuous Integration and Deployment for Vulkan
136

en/Building_a_Simple_Engine/Tooling/03_debugging_and_renderdoc.adoc

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
1-
::pp: {plus}{plus}
1+
:pp: {plus}{plus}
22

33
= Tooling: Debugging with VK_KHR_debug_utils and RenderDoc
4-
:doctype: book
5-
:sectnums:
6-
:sectnumlevels: 4
7-
:toc: left
8-
:icons: font
9-
:source-highlighter: highlightjs
10-
:source-language: c++
114

125
== Debugging Vulkan Applications
136

en/Building_a_Simple_Engine/Tooling/04_crash_minidump.adoc

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
1-
::pp: {plus}{plus}
1+
:pp: {plus}{plus}
22

33
= Tooling: Crash Handling and Minidumps
4-
:doctype: book
5-
:sectnums:
6-
:sectnumlevels: 4
7-
:toc: left
8-
:icons: font
9-
:source-highlighter: highlightjs
10-
:source-language: c++
114

125
== Crash Handling in Vulkan Applications
136

en/Building_a_Simple_Engine/Tooling/05_extensions.adoc

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
1-
::pp: {plus}{plus}
1+
:pp: {plus}{plus}
22

33
= Tooling: Vulkan Extensions for Robustness
4-
:doctype: book
5-
:sectnums:
6-
:sectnumlevels: 4
7-
:toc: left
8-
:icons: font
9-
:source-highlighter: highlightjs
10-
:source-language: c++
114

125
== Vulkan Extensions for Robustness
136

en/Building_a_Simple_Engine/Tooling/06_packaging_and_distribution.adoc

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
1-
::pp: {plus}{plus}
1+
:pp: {plus}{plus}
22

33
= Tooling: Packaging and Distribution
4-
:doctype: book
5-
:sectnums:
6-
:sectnumlevels: 4
7-
:toc: left
8-
:icons: font
9-
:source-highlighter: highlightjs
10-
:source-language: c++
114

125
== Packaging and Distributing Vulkan Applications
136

en/Building_a_Simple_Engine/Tooling/07_conclusion.adoc

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
1-
::pp: {plus}{plus}
1+
:pp: {plus}{plus}
22

33
= Tooling: Conclusion
4-
:doctype: book
5-
:sectnums:
6-
:sectnumlevels: 4
7-
:toc: left
8-
:icons: font
9-
:source-highlighter: highlightjs
10-
:source-language: c++
114

125
== Conclusion
136

en/Building_a_Simple_Engine/Tooling/index.adoc

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
1-
::pp: {plus}{plus}
1+
:pp: {plus}{plus}
22

33
= Tooling
4-
:doctype: book
5-
:sectnums:
6-
:sectnumlevels: 4
7-
:toc: left
8-
:icons: font
9-
:source-highlighter: highlightjs
10-
:source-language: c++
114

125
This chapter covers essential tooling and techniques for developing, debugging, and distributing Vulkan applications, with a focus on using modern C++20 modules and the vk::raii namespace.
136

0 commit comments

Comments
 (0)