Skip to content
Open
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
263 commits
Select commit Hold shift + click to select a range
87f5668
add vertex format from samples
convextriangle Jul 27, 2025
5f9dd1a
remove fullscreen disabling
convextriangle Jul 27, 2025
e08bd3d
add primitive batching utilities
convextriangle Jul 27, 2025
e87d11d
add missing types to display
convextriangle Jul 27, 2025
4234bbf
log commands for debugging (prototyping?)
convextriangle Jul 29, 2025
c671de9
change extern/CMakeLists.txt to add target only on msvc
convextriangle Aug 3, 2025
52cc1dc
remove redundant header
convextriangle Aug 3, 2025
b3f752d
sample texture upload heap...
convextriangle Aug 6, 2025
0cfaaef
move rendering code to a separate class
convextriangle Aug 9, 2025
ee101c0
formatting
convextriangle Aug 10, 2025
426317d
port graemephi's LegacyDisplay to... Display?
convextriangle Aug 10, 2025
20b7d39
remove clearing batcher stuffs
convextriangle Aug 10, 2025
97c90f7
remove WaitForPreviousFrame from Renderer interface
convextriangle Aug 10, 2025
55cba7e
rename WaitForPreviousFrame
convextriangle Aug 10, 2025
3811992
add texture update commands
convextriangle Aug 10, 2025
d7f6a67
remove Renderer::OnUpdate
convextriangle Aug 10, 2025
b82f8de
move stuff into regions
convextriangle Aug 10, 2025
28f03e9
fix clear color
convextriangle Aug 10, 2025
23430f5
add D3D12MemoryAllocator
convextriangle Aug 10, 2025
501c777
test memory allocator compilation
convextriangle Aug 10, 2025
8be5b82
check for work graphs support
convextriangle Aug 13, 2025
a61e760
initial re-drawcommanding
convextriangle Aug 13, 2025
040a5d3
don't overcomplicate it, silly goose
convextriangle Aug 13, 2025
8ca1767
push RenderState only before draws or if it has changed
convextriangle Aug 13, 2025
8f77114
remove redundant branching in RenderState setters
convextriangle Aug 13, 2025
48e072a
refactor draw / state queueing
convextriangle Aug 14, 2025
c1bf098
extract vertices into a separate buffer
convextriangle Aug 14, 2025
979eb28
DrawMode stub
convextriangle Aug 14, 2025
2499d2c
port sprite draw modes from RageDisplay_D3D to Display
convextriangle Aug 14, 2025
9aa3097
replace sample Vertex with RageSpriteVertex (breaking colors in the p…
convextriangle Aug 15, 2025
769e3b2
fix RageVColor conversion in shaders...
convextriangle Aug 16, 2025
269b1fe
replace old allocations with D3D12MemAlloc
convextriangle Aug 16, 2025
3e21dca
switch to DXC
convextriangle Aug 16, 2025
762257f
add buffer setup for compute shaders (for draw command thingies)
convextriangle Aug 17, 2025
6700841
throw if can't create compiler
convextriangle Aug 18, 2025
f8e04d4
cleanup for ExecuteIndirect
convextriangle Aug 22, 2025
eaecb90
Merge branch 'unstable_d3d' of https://github.com/convextriangle/ette…
convextriangle Aug 22, 2025
cb22055
add IndirectCommand signature
convextriangle Aug 23, 2025
a92533c
executeindirect shaders part 0/infinity
convextriangle Aug 23, 2025
a7bd4e7
heap setup for IndirectCommand stub
convextriangle Aug 23, 2025
268c841
uncscrewup root signatures
convextriangle Aug 23, 2025
ba03a49
add IndirectCommandShader blob
convextriangle Aug 24, 2025
4a979f8
bundle up pipeline things into a struct
convextriangle Aug 24, 2025
1af8572
separate compute shader stuff from graphics pipeline
convextriangle Aug 24, 2025
8c652f6
remove old debug check
convextriangle Aug 24, 2025
3915863
replace counter with AppendStructuredBuffer
convextriangle Aug 24, 2025
33c847e
fix descriptor offsets
convextriangle Aug 24, 2025
ef2c363
virtual insanity
convextriangle Aug 24, 2025
225f97e
share the fence between compute and graphics shaders
convextriangle Aug 24, 2025
c2b4026
wait without WaitForSingleObject?
convextriangle Aug 28, 2025
799f7c9
add command upload helpers
convextriangle Aug 28, 2025
008072f
adjust command batching
convextriangle Aug 29, 2025
b61ffd3
adjust indirect command shaders
convextriangle Aug 29, 2025
9b98eab
threading
convextriangle Aug 29, 2025
eb8c32f
actually pass indirect commands to the compute shader
convextriangle Aug 29, 2025
1bfb893
fix helper resource states (for now)
convextriangle Aug 30, 2025
9287686
add drawcommandargument stub
convextriangle Aug 30, 2025
817a13c
fix shader compilation
convextriangle Aug 30, 2025
f8174a5
goofing around
convextriangle Aug 30, 2025
f14b712
fix indirectCommandArgSrvDesc (kinda)
convextriangle Aug 30, 2025
358a869
fix compute shader thing
convextriangle Aug 30, 2025
6b32cb3
add texture stub
convextriangle Aug 30, 2025
4cf3ba9
linker errors yay
convextriangle Aug 30, 2025
19196e5
make outputcommandbuffer... not null?
convextriangle Aug 30, 2025
db8fb99
resource sync patch
convextriangle Aug 30, 2025
68a7410
adjust shader stuffs
convextriangle Aug 31, 2025
e32ea1e
reduce amount of DrawInstanced calls
convextriangle Sep 1, 2025
9ec7999
copy small buffer prefix instead of the whole buffer
convextriangle Sep 1, 2025
b85f930
Merge branch 'develop' of https://github.com/etternagame/etterna into…
convextriangle Sep 7, 2025
8157b32
serious buisness
convextriangle Sep 7, 2025
e080937
Merge branch 'develop' of https://github.com/etternagame/etterna into…
convextriangle Oct 24, 2025
aeca0d4
vulkanized beginnings
convextriangle Oct 31, 2025
0438ffa
add RendererVK stub
convextriangle Oct 31, 2025
bd904ab
add vulkan dependencies
convextriangle Oct 31, 2025
2ad0c41
add implementation stub
convextriangle Oct 31, 2025
6ef5d96
vulkan-hpp?
convextriangle Nov 1, 2025
65933c1
RendererVK beginnings
convextriangle Nov 1, 2025
05fe6e9
fix Win32 surface creation
convextriangle Nov 2, 2025
c818186
add drawing outside of swapchain images
convextriangle Nov 2, 2025
a15b80a
add shader compilation
convextriangle Nov 2, 2025
6e642b0
fix shader lookups
convextriangle Nov 2, 2025
f50c088
wow
convextriangle Nov 2, 2025
61d4438
don't do silly things
convextriangle Nov 2, 2025
3e6dd1d
fix shaderc dependency
convextriangle Nov 2, 2025
2aba3bd
fix formatting
convextriangle Nov 2, 2025
e53218e
vkCmdDrawIndirect pt. 1
convextriangle Nov 6, 2025
d2009ef
add initializing graphics pipeline
convextriangle Nov 7, 2025
d29f053
resolve various errors reported by vk validation layers
convextriangle Nov 7, 2025
84cce43
vk cleanup
convextriangle Nov 8, 2025
99328eb
patch up CommandBatcher
convextriangle Nov 13, 2025
a3a2b05
cyber induction by icontrolyourworld
convextriangle Nov 13, 2025
662b604
doublecheck if shader colors work
convextriangle Nov 13, 2025
f80282f
add frames in the flight
convextriangle Nov 13, 2025
b0884a5
add copying command batches to buffers
convextriangle Nov 14, 2025
48615fc
don't draw empty buffers
convextriangle Nov 14, 2025
a713e69
adjust viewport
convextriangle Nov 14, 2025
20a7c55
render basic stuff
convextriangle Nov 14, 2025
42d99b4
fix the viewport again
convextriangle Nov 14, 2025
984353f
remove old functions...
convextriangle Jan 16, 2026
165f2e0
textures part 0
convextriangle Jan 16, 2026
8d66782
move BufferHelper to a separate file
convextriangle Jan 16, 2026
9a7e7e6
textures part 1
convextriangle Jan 17, 2026
ffd8b8d
load textures (sort of)
convextriangle Jan 18, 2026
62a83f3
smol cleanup
convextriangle Jan 23, 2026
890ddae
cat in calculus 3 class: whart? :3
convextriangle Jan 23, 2026
12f230a
port graemephi's waka-laka...
convextriangle Jan 24, 2026
59b8a51
make triangles with null textures actually null
convextriangle Jan 25, 2026
beaba47
readd vulkan-hpp
convextriangle Jan 25, 2026
6138123
fix shaderc
convextriangle Jan 26, 2026
86f439d
fix shaderc compilation
convextriangle Jan 26, 2026
ffc82b9
maybe just use the OOP-y implementation
convextriangle Jan 26, 2026
280b5f7
use multiple buffering in the rest of the code...
convextriangle Jan 26, 2026
27435a7
fix cmake stuffs
convextriangle Jan 26, 2026
77cd306
don't use code that's already in Vulkan SDK
convextriangle Jan 26, 2026
e77e42c
stickiest of the icky
convextriangle Jan 26, 2026
a763799
don't duplicate indices
convextriangle Jan 26, 2026
1828da0
make vulkan required
convextriangle Jan 26, 2026
b9ebce2
disable validation/debug on release builds
convextriangle Jan 26, 2026
45b34f5
transition from pipeline to shader objects
convextriangle Jan 27, 2026
8e00bc4
Revert "transition from pipeline to shader objects"
convextriangle Jan 27, 2026
6ef09c5
fix validation layers for release builds
convextriangle Jan 27, 2026
828cfae
implement screenshots
convextriangle Feb 7, 2026
b8caa0f
transition towards indexed draws pt. 1
convextriangle Feb 15, 2026
912cefb
transition towards indexed draws pt. 2
convextriangle Feb 15, 2026
7447bb8
model rendering pt. 1
convextriangle Feb 16, 2026
ee1327b
fix culling for 3d models
convextriangle Feb 16, 2026
43c1f14
render targets pt. 1
convextriangle Feb 16, 2026
53ac815
render target mockup
convextriangle Feb 21, 2026
33e6aed
fix movie textures (sort of)
convextriangle Feb 21, 2026
ee42d47
make render targets visible (sort of)
convextriangle Feb 27, 2026
79736d9
fix render target alpha handling
convextriangle Feb 27, 2026
c37c9ab
remove debug patch
convextriangle Feb 27, 2026
2fa5956
remove shader silliness
convextriangle Feb 27, 2026
64fc0c2
shader swapping: teh beginnings
convextriangle Feb 27, 2026
edce6d2
shaders pt. 1
convextriangle Feb 27, 2026
ffeb3fb
shaders pt. 2
convextriangle Feb 28, 2026
282c28b
texture mangling part 1
convextriangle Mar 3, 2026
e55b74e
update textures only when needed instead of per-frame
convextriangle Mar 3, 2026
8143058
moltenvk (kind of sort of)
convextriangle Mar 5, 2026
338d013
remove old Display constant
convextriangle Mar 5, 2026
64d1770
?_?
convextriangle Mar 5, 2026
e53cb89
remove renderstate from batcher
convextriangle Mar 6, 2026
6f8385b
fix up error handling (a bit)
convextriangle Mar 8, 2026
a4aceb6
replace texture handling w/ magic
convextriangle Mar 8, 2026
09768f5
preparation for wackiness
convextriangle Mar 10, 2026
e65f56e
fix up RendererVK destructor
convextriangle Mar 11, 2026
eb26d3c
render graph pt 1
convextriangle Mar 13, 2026
80681ed
sort render graph by distance from leafs, not topologically
convextriangle Mar 13, 2026
f70da33
render graph pt 2
convextriangle Mar 13, 2026
34a1ef7
fix push constants
convextriangle Mar 13, 2026
fab5096
unbork drawing (kinda)
convextriangle Mar 14, 2026
a61c2af
do you believe in love after love
convextriangle Mar 14, 2026
77e27a3
fix draw call merging
convextriangle Mar 14, 2026
b15fcc4
shader args pt. 1
convextriangle Mar 15, 2026
a366337
add vulkan sdk installation to CI
convextriangle Mar 15, 2026
c9203dd
Merge branch 'develop' into unstable_vk
convextriangle Mar 15, 2026
27a88ab
ooga chaka
convextriangle Mar 15, 2026
8c327ed
Merge branch 'unstable_vk' of https://github.com/convextriangle/etter…
convextriangle Mar 15, 2026
bab384d
switch from shaderc to glslang because macos
convextriangle Mar 15, 2026
f6b31ba
fix glslang gitignore and add a heap of files
convextriangle Mar 15, 2026
3473b99
fix even more gitignores
convextriangle Mar 15, 2026
8c669cc
try fixing glslang gitignore again
convextriangle Mar 15, 2026
7195f4d
Revert "try fixing glslang gitignore again"
convextriangle Mar 16, 2026
d6e0b4c
compilation errors and such
convextriangle Mar 16, 2026
679cd44
patch up more build errors
convextriangle Mar 16, 2026
70ecd02
unbump macos version for reasons
convextriangle Mar 16, 2026
1f9ff63
remove filesystem dependency from shaderc
convextriangle Mar 16, 2026
1b444de
linux pt. 1
convextriangle Mar 16, 2026
05f7bfe
rework TryVideoMode
convextriangle Mar 18, 2026
025bc1c
resolve x11 naming collisions (kind of)
convextriangle Mar 18, 2026
e7fee5a
don't do workarounds for conditional compilation hell
convextriangle Mar 18, 2026
f18b008
create x11 window without opengl stuff (for vk)
convextriangle Mar 20, 2026
2d44bf4
Merge branch 'develop' into unstable_vk
convextriangle Mar 20, 2026
b9f55c3
tiny fix for LowLevelWindowVK
convextriangle Mar 20, 2026
ded2810
fix GetDisplaySpecs for penguin
convextriangle Mar 20, 2026
fa71c4a
patch vkbootstrap for macos (kind of)
convextriangle Mar 20, 2026
5e21a9d
try patching up vkbootstrap again...
convextriangle Mar 20, 2026
4b7052c
patch again...
convextriangle Mar 20, 2026
39879c6
funky
convextriangle Mar 20, 2026
37de164
even more patching!
convextriangle Mar 20, 2026
6268077
more patchery
convextriangle Mar 21, 2026
7cc6229
more patching?
convextriangle Mar 21, 2026
f767ef4
remove old enums
convextriangle Mar 21, 2026
384f7f4
revert or smth
convextriangle Mar 21, 2026
59a0712
shader args part 1
convextriangle Mar 22, 2026
cb16a1c
try to fix lua enum compilation
convextriangle Mar 23, 2026
ac69eef
adjust buffer device address calls to not error out the ass
convextriangle Mar 23, 2026
8f181c7
smol error check
convextriangle Mar 23, 2026
bc18378
shader args pt 2
convextriangle Mar 23, 2026
c94a825
disable vulkan on apple builds for now
convextriangle Mar 23, 2026
c1c7ca8
add GetDisplaySpecs for teh windows
convextriangle Mar 23, 2026
5dcb164
more reverts
convextriangle Mar 25, 2026
9fddd7e
allow textures to be accessed in vertex shaders (sorta)
convextriangle Mar 25, 2026
ce49f1d
adjust docs
convextriangle Mar 25, 2026
c923d07
add moar logs
convextriangle Mar 26, 2026
2f615bf
just in case
convextriangle Mar 26, 2026
6baedd1
nitpick
convextriangle Mar 26, 2026
1844618
remove unused vulkan features
convextriangle Mar 26, 2026
080c36e
try to use shaderc from the sdk
convextriangle Mar 26, 2026
12cb3cf
Merge branch 'unstable_vk' of https://github.com/convextriangle/etter…
convextriangle Mar 26, 2026
3b96308
more shaderc stuff
convextriangle Mar 26, 2026
55dfae2
try to get glslang to link
convextriangle Mar 26, 2026
3b312c1
make debug libraries optional for CI
convextriangle Mar 26, 2026
db16749
use same libs for debug on non-windows
convextriangle Mar 26, 2026
210a08b
shaderc compilation part n
convextriangle Mar 26, 2026
7b65731
try to fix vulkan sdk installation in CI
convextriangle Mar 26, 2026
460204c
hm
convextriangle Mar 26, 2026
8d73f6f
try to patch env vars
convextriangle Mar 26, 2026
dac9fc1
more CI debugging
convextriangle Mar 26, 2026
bdd79f4
even more debugging
convextriangle Mar 26, 2026
000c674
try to install properly on findows
convextriangle Mar 26, 2026
7a284d9
this never ends does it
convextriangle Mar 26, 2026
e7a6294
fix windows install directory for vulkan sdk
convextriangle Mar 26, 2026
aeae88c
remove glslang leftovers
convextriangle Mar 26, 2026
0c87701
try to add option to unscrew-up the linker mess
convextriangle Mar 26, 2026
db70716
crashpad made my build crash
convextriangle Mar 26, 2026
88e74c9
nuke shaderc
convextriangle Mar 26, 2026
532c9d4
try installing the sdk on linux
convextriangle Mar 27, 2026
b1a47fe
try to fix VK_ERROR_OUT_OF_DEVICE_MEMORY
convextriangle Mar 28, 2026
a9b6fcc
silly test
convextriangle Mar 29, 2026
69205c2
Merge branch 'unstable_vk' of https://github.com/convextriangle/etter…
convextriangle Mar 29, 2026
44c78cc
don't pad textures
convextriangle Apr 1, 2026
2286e09
switch to more sane texture/matrix index handling
convextriangle Apr 1, 2026
f66d05d
fix fragment shader... or something
convextriangle Apr 1, 2026
8f7f791
remove debug code
convextriangle Apr 1, 2026
386185d
move arch specific code out of DisplayAdapter::Display
convextriangle Apr 5, 2026
f51ef91
borderless stuffs
convextriangle Apr 5, 2026
0701d9a
don't multiply matrices per-vertex when it can be done per-actor
convextriangle Apr 5, 2026
004a33d
actually clear all textures
convextriangle Apr 5, 2026
cdaf0eb
texture big
convextriangle Apr 5, 2026
c004868
ok maybe no
convextriangle Apr 5, 2026
ec53f85
reuse command buffers for textures
convextriangle Apr 5, 2026
c79d469
use VMA from the SDK
convextriangle Apr 5, 2026
7f8807a
the sdk is evil
convextriangle Apr 5, 2026
88a30db
the sdk is evil 2
convextriangle Apr 5, 2026
03be471
make vulkan opt-out
convextriangle Apr 5, 2026
7def5de
fix WITH_VULKAN preprocessor macro
convextriangle Apr 5, 2026
374799d
try installing Vulkan SDK on macOS
convextriangle Apr 7, 2026
b56eb91
patch up VMA again
convextriangle Apr 7, 2026
9d68fa1
less silly textures
convextriangle Apr 11, 2026
d79adb6
wack
convextriangle Apr 11, 2026
ee53045
fix holds from being culled. or something
convextriangle Apr 11, 2026
19bada7
maybe don't break 3d models when fixing holds
convextriangle Apr 11, 2026
dd7143e
fix linux mouse issue or something
convextriangle Apr 16, 2026
a64ffd6
add vsync of sorts
convextriangle Apr 17, 2026
f6c3f6d
Merge branch 'unstable_vk' of https://github.com/convextriangle/etter…
convextriangle Apr 17, 2026
a899577
blending and depth tests and such
convextriangle Apr 17, 2026
ff5a18a
more blending...
convextriangle Apr 17, 2026
98dca60
wacky blending error
convextriangle Apr 17, 2026
e796096
try to fix depth issues
convextriangle Apr 17, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
103 changes: 103 additions & 0 deletions .ci/vulkan_prebuilt_helpers.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
# MIT License

# Copyright (c) 2022 humbletim

# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:

# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.

# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

# helper functions for downloading/installing platform-specific Vulkan SDKs
# originally meant for use from GitHub Actions
# see: https://github.com/humbletim/install-vulkan-sdk
# -- humbletim 2022.02

# example of running manually:
# $ . vulkan_prebuilt_helpers.
# $ VULKAN_SDK_VERSION=1.3.204.0 download_linux # fetches vulkan_sdk.tar.gz
# $ VULKAN_SDK=$PWD/VULKAN_SDK install_linux # installs

function _os_filename() {
case $1 in
mac) echo vulkan_sdk.zip ;;
linux) echo vulkan_sdk.tar.gz ;;
windows) echo vulkan_sdk.exe ;;
*) echo "unknown $1" >&2 ; exit 9 ;;
esac
}

function download_vulkan_installer() {
local os=$1
local filename=$(_os_filename $os)
local url=https://sdk.lunarg.com/sdk/download/$VULKAN_SDK_VERSION/$os/$filename?Human=true
echo "_download_os_installer $os $filename $url" >&2
if [[ -f $filename ]] ; then
echo "using cached: $filename" >&2
else
curl --fail-with-body -s -L -o ${filename}.tmp $url || { echo "curl failed with error code: $?" >&2 ; curl -s -L --head $url >&2 ; exit 32 ; }
test -f ${filename}.tmp
mv -v ${filename}.tmp ${filename}
fi
ls -lh $filename >&2
}

function unpack_vulkan_installer() {
local os=$1
local filename=$(_os_filename $os)
test -f $filename
install_${os}
}

function install_linux() {
test -d $VULKAN_SDK && test -f vulkan_sdk.tar.gz
echo "extract just the SDK's prebuilt binaries ($VULKAN_SDK_VERSION/x86_64) from vulkan_sdk.tar.gz into $VULKAN_SDK" >&2
tar -C "$VULKAN_SDK" --strip-components 2 -xf vulkan_sdk.tar.gz $VULKAN_SDK_VERSION/x86_64
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah this doesn't work for aarch64 for obvious reasons...

}

function install_windows() {
test -d $VULKAN_SDK && test -f vulkan_sdk.exe
./vulkan_sdk.exe in --al --am -c -t $VULKAN_SDK
}

function install_mac() {
test -d $VULKAN_SDK && test -f vulkan_sdk.zip
unzip vulkan_sdk.zip
local InstallVulkan
if [[ -d InstallVulkan-${VULKAN_SDK_VERSION}.app/Contents ]] ; then
InstallVulkan=InstallVulkan-${VULKAN_SDK_VERSION}
elif [[ -d vulkansdk-macOS-${VULKAN_SDK_VERSION}.app/Contents ]] ; then
InstallVulkan=vulkansdk-macOS-${VULKAN_SDK_VERSION}
elif [[ -d InstallVulkan.app/Contents ]] ; then
InstallVulkan=InstallVulkan
else
echo "expecting ..vulkan.app/Contents folder (perhaps lunarg changed the archive layout again?): vulkan_sdk.zip" >&2
echo "file vulkan_sdk.zip" >&2
file vulkan_sdk.zip
echo "unzip -t vulkan_sdk.zip" >&2
unzip -t vulkan_sdk.zip
exit 7
fi
echo "recognized zip layout 'vulkan_sdk.zip' ${InstallVulkan}.app/Contents" >&2
local sdk_temp=${VULKAN_SDK}.tmp
sudo ${InstallVulkan}.app/Contents/MacOS/${InstallVulkan} --root "$sdk_temp" --accept-licenses --default-answer --confirm-command install
du -hs $sdk_temp
test -d $sdk_temp/macOS || { echo "unrecognized dmg folder layout: $sdk_temp" ; ls -l $sdk_temp ; exit 10 ; }
cp -r $sdk_temp/macOS/* $VULKAN_SDK/
if [[ -d ${InstallVulkan}.app/Contents ]] ; then
sudo rm -rf "$sdk_temp"
rm -rf ${InstallVulkan}.app
fi
}
55 changes: 55 additions & 0 deletions .ci/vulkan_setup_env.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# MIT License

# Copyright (c) 2022 humbletim

# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:

# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.

# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

# helper functions for downloading/installing platform-specific Vulkan SDKs
# originally meant for use from GitHub Actions
# see: https://github.com/humbletim/install-vulkan-sdk
# -- humbletim 2022.02

function preset_env() {
basedir=$PWD
runner_os=${RUNNER_OS:-`uname -s`}
case $runner_os in
macOS|Darwin) os=mac ;;
Linux) os=linux ;;
Windows|MINGW*) os=windows ; basedir=$(pwd -W) ;;
*) echo "unknown runner_os: $runner_os" ; exit 7 ; ;;
esac
version='latest' # hi hello
sdk_dir=${VULKAN_SDK:-$basedir/VULKAN_SDK}
test -d $sdk_dir || mkdir -pv $sdk_dir
if [[ $version == 'latest' ]] ; then
url=https://vulkan.lunarg.com/sdk/latest/$os.txt
echo "note: resolving '$version' for '$os' via webservices lookup: $url" >&2
version=$(curl -sL $url)
test -n "$version" || { echo "could not resolve latest version" ; exit 9 ; }
echo "::notice title=Using Vulkan SDK $version::resolved via '$url'"
fi

export VULKAN_SDK="$sdk_dir"
export VULKAN_SDK_VERSION="$version"
export VULKAN_SDK_PLATFORM="$os"

echo "VULKAN_SDK=$sdk_dir" >> "$GITHUB_ENV"
echo "VULKAN_SDK_VERSION=$version" >> "$GITHUB_ENV"
echo "VULKAN_SDK_PLATFORM=$os" >> "$GITHUB_ENV"
}
47 changes: 46 additions & 1 deletion .github/workflows/ci-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,22 @@ jobs:
with:
repository: etternagame/CrashpadTools
path: tools

- name: Install Vulkan SDK
shell: bash
run: |
. main/.ci/vulkan_setup_env.sh
preset_env
. main/.ci/vulkan_prebuilt_helpers.sh
download_vulkan_installer ${VULKAN_SDK_PLATFORM}
unpack_vulkan_installer ${VULKAN_SDK_PLATFORM}

- name: Install apt packages
run: sudo apt update && sudo apt install ${{ matrix.cfg.cpp-version }} nasm ninja-build libglew-dev libxrandr-dev libxtst-dev libpulse-dev libasound-dev libogg-dev libvorbis-dev xorg-dev libcurl4-openssl-dev
- name: Install OpenSSL 3.5
run: mkdir -p tmp/openssl && cd tmp/openssl && wget https://github.com/openssl/openssl/releases/download/openssl-3.5.1/openssl-3.5.1.tar.gz && tar -xf openssl-3.5.1.tar.gz && cd openssl-3.5.1 && ./Configure --prefix="${HOME}/toolchain" && make -j `nproc` && make test -j `nproc` && sudo make install
- name: Generate CMake
run: mkdir main/build && cd main/build && cmake -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_TESTS=FALSE -DBUILD_EXAMPLES=FALSE -DOPENSSL_ROOT_DIR=~/toolchain/ ..
run: mkdir main/build && cd main/build && cmake -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_TESTS=FALSE -DBUILD_EXAMPLES=FALSE -DOPENSSL_ROOT_DIR=~/toolchain/ -DCMAKE_CXX_FLAGS="-D_DEBUG" ..
env:
CXX: ${{matrix.cfg.cpp-version}}

Expand Down Expand Up @@ -123,6 +132,15 @@ jobs:
repository: etternagame/CrashpadTools
path: tools

- name: Install Vulkan SDK
shell: bash
run: |
. main/.ci/vulkan_setup_env.sh
preset_env
. main/.ci/vulkan_prebuilt_helpers.sh
download_vulkan_installer ${VULKAN_SDK_PLATFORM}
unpack_vulkan_installer ${VULKAN_SDK_PLATFORM}

- name: Install homebrew packages
run: brew install cmake nasm ninja openssl

Expand Down Expand Up @@ -234,6 +252,15 @@ jobs:
uses: actions/setup-python@v6
with:
python-version: '3.12'

- name: Install Vulkan SDK
shell: bash
run: |
. main/.ci/vulkan_setup_env.sh
preset_env
. main/.ci/vulkan_prebuilt_helpers.sh
download_vulkan_installer ${VULKAN_SDK_PLATFORM}
unpack_vulkan_installer ${VULKAN_SDK_PLATFORM}

- name: Update CPack Environment
if: ${{matrix.cfg.dist}}
Expand Down Expand Up @@ -325,6 +352,15 @@ jobs:
repository: etternagame/CrashpadTools
path: tools

- name: Install Vulkan SDK
shell: bash
run: |
. main/.ci/vulkan_setup_env.sh
preset_env
. main/.ci/vulkan_prebuilt_helpers.sh
download_vulkan_installer ${VULKAN_SDK_PLATFORM}
unpack_vulkan_installer ${VULKAN_SDK_PLATFORM}

- name: Install homebrew packages
run: brew install cmake nasm ninja openssl && brew tap etternagame/etterna && brew update && HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1

Expand Down Expand Up @@ -420,6 +456,15 @@ jobs:
repository: nico-abram/dxsdk
path: dxsdk

- name: Install Vulkan SDK
shell: bash
run: |
. main/.ci/vulkan_setup_env.sh
preset_env
. main/.ci/vulkan_prebuilt_helpers.sh
download_vulkan_installer ${VULKAN_SDK_PLATFORM}
unpack_vulkan_installer ${VULKAN_SDK_PLATFORM}

- name: Update Environment Variables
run: |
echo "${{github.workspace}}/tools/win/" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
Expand Down
19 changes: 16 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ set(CMAKE_POLICY_DEFAULT_CMP0077 NEW) # Tell CMake to use the new policy for CMP
## We statically link the CRT by default. If you would like to dynamically
## link the CRT, you can append "DLL" to the end of the variable below.
## More Info: https://cmake.org/cmake/help/latest/variable/CMAKE_MSVC_RUNTIME_LIBRARY.html
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")

set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL")

# PROJECT WIDE SETUP
project(Etterna
Expand All @@ -42,6 +43,7 @@ add_executable(Etterna)

# Project Compile Options
set(WITH_CRASHPAD TRUE CACHE BOOL "Compile with Crash Handler (Requires depot_tools installed)")
set(WITH_VULKAN TRUE CACHE BOOL "Compile Vulkan support (Requires Vulkan SDK to be installed and VULKAN_SDK environment variable to be set to SDK root dir)")

## Setting Target Properties
### Set a different name for each output binary depending on what build configuration is.
Expand Down Expand Up @@ -115,8 +117,19 @@ target_link_libraries(Etterna PRIVATE plog::plog)
target_link_libraries(Etterna PRIVATE nowide::nowide)
target_link_libraries(Etterna PRIVATE ghc_filesystem)

if(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "arm64")
target_link_libraries(Etterna PRIVATE sse2neon)
if(WITH_VULKAN)
add_compile_definitions(Etterna PRIVATE WITH_VULKAN)
target_link_libraries(Etterna PRIVATE vk-bootstrap::vk-bootstrap)
target_link_libraries(Etterna PRIVATE VulkanMemoryAllocator)

find_package(Vulkan REQUIRED COMPONENTS shaderc_combined)
target_link_libraries(Etterna PRIVATE
Vulkan::Vulkan
Vulkan::shaderc_combined)

if(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "arm64")
target_link_libraries(Etterna PRIVATE sse2neon)
endif()
endif()

# If the user wants crashpad, and the target exists (in-case
Expand Down
23 changes: 23 additions & 0 deletions Data/Shaders/Vulkan/fragment.glsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#version 460
#extension GL_EXT_nonuniform_qualifier : enable
#extension GL_EXT_samplerless_texture_functions : enable

layout(set = 0, binding = 2) uniform texture2D textures[];
layout(set = 0, binding = 3) uniform sampler samplers[];

layout(location = 0) in vec4 vertexColor;
layout(location = 1) flat in uint textureIndex;
layout (location = 2) flat in uint samplerIndex;
layout(location = 3) in vec2 vertexUV;

layout(location = 0) out vec4 fragmentColor;

void main() {
if(textureIndex == 0){
fragmentColor = vertexColor;
return;
}

vec4 textureColor = texture(sampler2D(textures[nonuniformEXT(textureIndex)], samplers[nonuniformEXT(samplerIndex)]), vertexUV);
fragmentColor = vertexColor * textureColor;
}
70 changes: 70 additions & 0 deletions Data/Shaders/Vulkan/vertex.glsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
#version 460
#extension GL_EXT_nonuniform_qualifier : enable

struct Vertex {
float pos[3];
float normal[3];
uint color;
float uv[2];
uint MatrixIndex;
uint TextureIndex;
uint SamplerIndex;
};

layout(std430, set = 0, binding = 0) readonly buffer VertexBuffer {
Vertex vertices[];
};

struct MatrixState {
mat4 wvp;
mat4 texture;
};

layout(std430, set = 0, binding = 1) readonly buffer MatrixStateBuffer {
MatrixState matrices[];
};

layout(location = 0) out vec4 vertexColor;
layout(location = 1) out uint textureIndex;
layout(location = 2) out uint samplerIndex;
layout(location = 3) out vec2 vertexUV;

vec2 unpackVec2(float array[2]){
return vec2(array[0], array[1]);
}

vec3 unpackVec3(float array[3]){
return vec3(array[0], array[1], array[2]);
}

vec4 unpackColor(uint c)
{
float b = float(c & 0xFFu);
float g = float((c >> 8) & 0xFFu);
float r = float((c >> 16) & 0xFFu);
float a = float((c >> 24) & 0xFFu);

return vec4(r, g, b, a) / 255.0;
}

void main() {
Vertex currentVertex = vertices[gl_VertexIndex];

vertexColor = unpackColor(currentVertex.color);

textureIndex = currentVertex.TextureIndex;
samplerIndex = currentVertex.SamplerIndex;

uint matrixIndex = currentVertex.MatrixIndex;
mat4 wvp = matrices[matrixIndex].wvp;
mat4 tex = matrices[matrixIndex].texture;

vec4 pos = wvp * vec4(unpackVec3(currentVertex.pos), 1.0);
pos.z = 0.0; // whart?

gl_Position = pos;

vertexUV = unpackVec2(currentVertex.uv);
vertexUV.x += tex[3][0];
vertexUV.y += tex[3][1];
}
2 changes: 2 additions & 0 deletions Docs/Building.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ cmake -DOPENSSL_ROOT_DIR="/usr/local/opt/openssl" -G "Xcode" .. # macOS
- macOS: `brew install openssl`
- Windows: A CMake compatible version of OpenSSL is available at [Shining Light Productions](https://slproweb.com/products/Win32OpenSSL.html) website. You will need the 32bit and 64bit installers if you plan on building both versions. It's recommended to uninstall old versions to make sure CMake can find the correct latest version. Direct links: [32bit](https://slproweb.com/download/Win32OpenSSL-1_1_1t.exe), [64bit](https://slproweb.com/download/Win64OpenSSL-1_1_1t.exe). If these links are dead, look for the OpenSSL v1.1.1 install links (EXE or MSI) on the Shining Light Productions site. Typically we use the full versions rather than the Light versions.
- [depot_tools](https://dev.chromium.org/developers/how-tos/install-depot-tools) - Installation is platform specific. To skip installing this, follow the relevant instructions in [CLI Project Generation](CLI-Project-Generation).
- [Vulkan SDK](https://vulkan.lunarg.com/sdk/home) - note that you might need to set the `VULKAN_SDK` environment variable
to the SDK's root directory [for CMake to find](https://cmake.org/cmake/help/latest/module/FindVulkan.html#hints).

### Linux Dependencies

Expand Down
Loading
Loading