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