Move shaders into glsl and hlsl directories

Move `data/shaders` to `data/shaders/glsl`
Move `data/hlsl` to `data/shaders/hlsl`

Fix up shader paths in the cpp files to point to the new glsl location.

`data/shaders/hlsl/compile.py` still overwrites the glsl .spv files (for
now).

Issue: #723
This commit is contained in:
Ben Clayton 2020-05-29 16:08:53 +01:00
parent cac1d2e850
commit ca884587a4
1043 changed files with 1207 additions and 1201 deletions

View file

@ -28,7 +28,7 @@ A comprehensive collection of open source C++ examples for [Vulkan®](https://ww
## <a name="Khronossamples"></a> Official Khronos Vulkan Samples
Khronos recently made an official Vulkan Samples repository available to the public ([press release](https://www.khronos.org/blog/vulkan-releases-unified-samples-repository?utm_source=Khronos%20Blog&utm_medium=Twitter&utm_campaign=Vulkan%20Repository)).
Khronos recently made an official Vulkan Samples repository available to the public ([press release](https://www.khronos.org/blog/vulkan-releases-unified-samples-repository?utm_source=Khronos%20Blog&utm_medium=Twitter&utm_campaign=Vulkan%20Repository)).
You can find this repository at https://github.com/KhronosGroup/Vulkan-Samples
@ -39,7 +39,7 @@ This repository contains submodules for external dependencies, so when doing a f
```
git clone --recursive https://github.com/SaschaWillems/Vulkan.git
```
```
Existing repositories can be updated manually:
@ -63,7 +63,7 @@ See [BUILD.md](BUILD.md) for details on how to build for the different platforms
## <a name="Shaders"></a> Shaders
Vulkan consumes shaders in an intermediate representation called SPIR-V. This makes it possible to use different shader languages by compiling them to that bytecode format. The primary shader language used here is [GLSL](data/shaders) but thanks to an external contribution you'll also find [HLSL](data/hlsl) shader sources.
Vulkan consumes shaders in an intermediate representation called SPIR-V. This makes it possible to use different shader languages by compiling them to that bytecode format. The primary shader language used here is [GLSL](data/shaders/glsl) but thanks to an external contribution you'll also find [HLSL](data/shaders/hlsl) shader sources.
## <a name="Examples"></a> Examples
@ -118,7 +118,7 @@ Uses input attachments to read framebuffer contents from a previous sub pass at
#### [13 - Sub passes](examples/subpasses/)
Advanced example that uses sub passes and input attachments to write and read back data from framebuffer attachments (same location only) in single render pass. This is used to implement deferred render composition with added forward transparency in a single pass.
Advanced example that uses sub passes and input attachments to write and read back data from framebuffer attachments (same location only) in single render pass. This is used to implement deferred render composition with added forward transparency in a single pass.
#### [14 - Offscreen rendering](examples/offscreen/)
@ -144,7 +144,7 @@ Implements multisample anti-aliasing (MSAA) using a renderpass with multisampled
#### [03 - High dynamic range](examples/hdr/)
Implements a high dynamic range rendering pipeline using 16/32 bit floating point precision for all internal formats, textures and calculations, including a bloom pass, manual exposure and tone mapping.
Implements a high dynamic range rendering pipeline using 16/32 bit floating point precision for all internal formats, textures and calculations, including a bloom pass, manual exposure and tone mapping.
#### [04 - Shadow mapping](examples/shadowmapping/)
@ -164,7 +164,7 @@ Generating a complete mip-chain at runtime instead of loading it from a file, by
#### [08 - Skeletal animation](examples/skeletalanimation/)
Loads and renders an animated skinned 3D model. Skinning is done on the GPU by passing per-vertex bone weights and translation matrices.
Loads and renders an animated skinned 3D model. Skinning is done on the GPU by passing per-vertex bone weights and translation matrices.
#### [09 - Capturing screenshots](examples/screenshot/)
@ -278,7 +278,7 @@ Renders a terrain using tessellation shaders for height displacement (based on a
Uses curved PN-triangles ([paper](http://alex.vlachos.com/graphics/CurvedPNTriangles.pdf)) for adding details to a low-polygon model.
### <a name="Headless"></a> Headless
### <a name="Headless"></a> Headless
Examples that run one-time tasks and don't make use of visual output (no window system integration). These can be run in environments where no user interface is available ([blog entry](https://www.saschawillems.de/tutorials/vulkan/headless_examples)).
@ -320,7 +320,7 @@ Implements multiple texture mapping methods to simulate depth based on texture i
#### [04 - Spherical environment mapping](examples/sphericalenvmapping/)
Uses a spherical material capture texture array defining environment lighting and reflection information to fake complex lighting.
Uses a spherical material capture texture array defining environment lighting and reflection information to fake complex lighting.
### <a name="Extensions"></a> Extensions

View file

@ -43,8 +43,8 @@ task copyTask {
}
copy {
from '../../../data/shaders/base'
into "assets/shaders/base"
from '../../../data/shaders/glsl/base'
into 'assets/shaders/glsl/base'
include '*.spv'
}

View file

@ -43,14 +43,14 @@ task copyTask {
}
copy {
from '../../../data/shaders/base'
into "assets/shaders/base"
from '../../../data/shaders/glsl/base'
into 'assets/shaders/glsl/base'
include '*.spv'
}
copy {
from '../../../data/shaders/bloom'
into 'assets/shaders/bloom'
from '../../../data/shaders/glsl/bloom'
into 'assets/shaders/glsl/bloom'
include '*.*'
}

View file

@ -43,14 +43,14 @@ task copyTask {
}
copy {
from '../../../data/shaders/base'
into "assets/shaders/base"
from '../../../data/shaders/glsl/base'
into 'assets/shaders/glsl/base'
include '*.spv'
}
copy {
from '../../../data/shaders/computecloth'
into 'assets/shaders/computecloth'
from '../../../data/shaders/glsl/computecloth'
into 'assets/shaders/glsl/computecloth'
include '*.*'
}

View file

@ -43,14 +43,14 @@ task copyTask {
}
copy {
from '../../../data/shaders/base'
into "assets/shaders/base"
from '../../../data/shaders/glsl/base'
into 'assets/shaders/glsl/base'
include '*.spv'
}
copy {
from '../../../data/shaders/computecullandlod'
into 'assets/shaders/computecullandlod'
from '../../../data/shaders/glsl/computecullandlod'
into 'assets/shaders/glsl/computecullandlod'
include '*.*'
}

View file

@ -43,14 +43,14 @@ task copyTask {
}
copy {
from '../../../data/shaders/base'
into "assets/shaders/base"
from '../../../data/shaders/glsl/base'
into 'assets/shaders/glsl/base'
include '*.spv'
}
copy {
from '../../../data/shaders/computeheadless'
into 'assets/shaders/computeheadless'
from '../../../data/shaders/glsl/computeheadless'
into 'assets/shaders/glsl/computeheadless'
include '*.*'
}

View file

@ -43,14 +43,14 @@ task copyTask {
}
copy {
from '../../../data/shaders/base'
into "assets/shaders/base"
from '../../../data/shaders/glsl/base'
into 'assets/shaders/glsl/base'
include '*.spv'
}
copy {
from '../../../data/shaders/computenbody'
into 'assets/shaders/computenbody'
from '../../../data/shaders/glsl/computenbody'
into 'assets/shaders/glsl/computenbody'
include '*.*'
}

View file

@ -43,14 +43,14 @@ task copyTask {
}
copy {
from '../../../data/shaders/base'
into "assets/shaders/base"
from '../../../data/shaders/glsl/base'
into 'assets/shaders/glsl/base'
include '*.spv'
}
copy {
from '../../../data/shaders/computeparticles'
into 'assets/shaders/computeparticles'
from '../../../data/shaders/glsl/computeparticles'
into 'assets/shaders/glsl/computeparticles'
include '*.*'
}

View file

@ -43,14 +43,14 @@ task copyTask {
}
copy {
from '../../../data/shaders/base'
into "assets/shaders/base"
from '../../../data/shaders/glsl/base'
into 'assets/shaders/glsl/base'
include '*.spv'
}
copy {
from '../../../data/shaders/computeraytracing'
into 'assets/shaders/computeraytracing'
from '../../../data/shaders/glsl/computeraytracing'
into 'assets/shaders/glsl/computeraytracing'
include '*.*'
}

View file

@ -43,14 +43,14 @@ task copyTask {
}
copy {
from '../../../data/shaders/base'
into "assets/shaders/base"
from '../../../data/shaders/glsl/base'
into 'assets/shaders/glsl/base'
include '*.spv'
}
copy {
from '../../../data/shaders/computeshader'
into 'assets/shaders/computeshader'
from '../../../data/shaders/glsl/computeshader'
into 'assets/shaders/glsl/computeshader'
include '*.*'
}

View file

@ -43,14 +43,14 @@ task copyTask {
}
copy {
from '../../../data/shaders/base'
into "assets/shaders/base"
from '../../../data/shaders/glsl/base'
into 'assets/shaders/glsl/base'
include '*.spv'
}
copy {
from '../../../data/shaders/conservativeraster'
into 'assets/shaders/conservativeraster'
from '../../../data/shaders/glsl/conservativeraster'
into 'assets/shaders/glsl/conservativeraster'
include '*.*'
}

View file

@ -43,14 +43,14 @@ task copyTask {
}
copy {
from '../../../data/shaders/base'
into "assets/shaders/base"
from '../../../data/shaders/glsl/base'
into 'assets/shaders/glsl/base'
include '*.spv'
}
copy {
from '../../../data/shaders/debugmarker'
into 'assets/shaders/debugmarker'
from '../../../data/shaders/glsl/debugmarker'
into 'assets/shaders/glsl/debugmarker'
include '*.*'
}

View file

@ -43,14 +43,14 @@ task copyTask {
}
copy {
from '../../../data/shaders/base'
into "assets/shaders/base"
from '../../../data/shaders/glsl/base'
into 'assets/shaders/glsl/base'
include '*.spv'
}
copy {
from '../../../data/shaders/deferred'
into 'assets/shaders/deferred'
from '../../../data/shaders/glsl/deferred'
into 'assets/shaders/glsl/deferred'
include '*.*'
}

View file

@ -43,14 +43,14 @@ task copyTask {
}
copy {
from '../../../data/shaders/base'
into "assets/shaders/base"
from '../../../data/shaders/glsl/base'
into 'assets/shaders/glsl/base'
include '*.spv'
}
copy {
from '../../../data/shaders/deferredmultisampling'
into 'assets/shaders/deferredmultisampling'
from '../../../data/shaders/glsl/deferredmultisampling'
into 'assets/shaders/glsl/deferredmultisampling'
include '*.*'
}

View file

@ -43,14 +43,14 @@ task copyTask {
}
copy {
from '../../../data/shaders/base'
into "assets/shaders/base"
from '../../../data/shaders/glsl/base'
into 'assets/shaders/glsl/base'
include '*.spv'
}
copy {
from '../../../data/shaders/deferredshadows'
into 'assets/shaders/deferredshadows'
from '../../../data/shaders/glsl/deferredshadows'
into 'assets/shaders/glsl/deferredshadows'
include '*.*'
}

View file

@ -43,14 +43,14 @@ task copyTask {
}
copy {
from '../../../data/shaders/base'
into "assets/shaders/base"
from '../../../data/shaders/glsl/base'
into 'assets/shaders/glsl/base'
include '*.spv'
}
copy {
from '../../../data/shaders/descriptorsets'
into 'assets/shaders/descriptorsets'
from '../../../data/shaders/glsl/descriptorsets'
into 'assets/shaders/glsl/descriptorsets'
include '*.*'
}

View file

@ -43,14 +43,14 @@ task copyTask {
}
copy {
from '../../../data/shaders/base'
into "assets/shaders/base"
from '../../../data/shaders/glsl/base'
into 'assets/shaders/glsl/base'
include '*.spv'
}
copy {
from '../../../data/shaders/displacement'
into 'assets/shaders/displacement'
from '../../../data/shaders/glsl/displacement'
into 'assets/shaders/glsl/displacement'
include '*.*'
}

View file

@ -43,14 +43,14 @@ task copyTask {
}
copy {
from '../../../data/shaders/base'
into "assets/shaders/base"
from '../../../data/shaders/glsl/base'
into 'assets/shaders/glsl/base'
include '*.spv'
}
copy {
from '../../../data/shaders/distancefieldfonts'
into 'assets/shaders/distancefieldfonts'
from '../../../data/shaders/glsl/distancefieldfonts'
into 'assets/shaders/glsl/distancefieldfonts'
include '*.*'
}

View file

@ -43,14 +43,14 @@ task copyTask {
}
copy {
from '../../../data/shaders/base'
into "assets/shaders/base"
from '../../../data/shaders/glsl/base'
into 'assets/shaders/glsl/base'
include '*.spv'
}
copy {
from '../../../data/shaders/dynamicuniformbuffer'
into 'assets/shaders/dynamicuniformbuffer'
from '../../../data/shaders/glsl/dynamicuniformbuffer'
into 'assets/shaders/glsl/dynamicuniformbuffer'
include '*.*'
}

View file

@ -43,14 +43,14 @@ task copyTask {
}
copy {
from '../../../data/shaders/base'
into "assets/shaders/base"
from '../../../data/shaders/glsl/base'
into 'assets/shaders/glsl/base'
include '*.spv'
}
copy {
from '../../../data/shaders/gears'
into 'assets/shaders/gears'
from '../../../data/shaders/glsl/gears'
into 'assets/shaders/glsl/gears'
include '*.*'
}

View file

@ -43,14 +43,14 @@ task copyTask {
}
copy {
from '../../../data/shaders/base'
into "assets/shaders/base"
from '../../../data/shaders/glsl/base'
into 'assets/shaders/glsl/base'
include '*.spv'
}
copy {
from '../../../data/shaders/geometryshader'
into 'assets/shaders/geometryshader'
from '../../../data/shaders/glsl/geometryshader'
into 'assets/shaders/glsl/geometryshader'
include '*.*'
}

View file

@ -43,14 +43,14 @@ task copyTask {
}
copy {
from '../../../data/shaders/base'
into "assets/shaders/base"
from '../../../data/shaders/glsl/base'
into 'assets/shaders/glsl/base'
include '*.spv'
}
copy {
from '../../../data/shaders/gltfscene'
into 'assets/shaders/gltfscene'
from '../../../data/shaders/glsl/gltfscene'
into 'assets/shaders/glsl/gltfscene'
include '*.*'
}

View file

@ -43,14 +43,14 @@ task copyTask {
}
copy {
from '../../../data/shaders/base'
into "assets/shaders/base"
from '../../../data/shaders/glsl/base'
into 'assets/shaders/glsl/base'
include '*.spv'
}
copy {
from '../../../data/shaders/hdr'
into 'assets/shaders/hdr'
from '../../../data/shaders/glsl/hdr'
into 'assets/shaders/glsl/hdr'
include '*.*'
}

View file

@ -43,14 +43,14 @@ task copyTask {
}
copy {
from '../../../data/shaders/base'
into "assets/shaders/base"
from '../../../data/shaders/glsl/base'
into 'assets/shaders/glsl/base'
include '*.spv'
}
copy {
from '../../../data/shaders/imgui'
into 'assets/shaders/imgui'
from '../../../data/shaders/glsl/imgui'
into 'assets/shaders/glsl/imgui'
include '*.*'
}

View file

@ -43,14 +43,14 @@ task copyTask {
}
copy {
from '../../../data/shaders/base'
into "assets/shaders/base"
from '../../../data/shaders/glsl/base'
into 'assets/shaders/glsl/base'
include '*.spv'
}
copy {
from '../../../data/shaders/indirectdraw'
into 'assets/shaders/indirectdraw'
from '../../../data/shaders/glsl/indirectdraw'
into 'assets/shaders/glsl/indirectdraw'
include '*.*'
}

View file

@ -43,14 +43,14 @@ task copyTask {
}
copy {
from '../../../data/shaders/base'
into "assets/shaders/base"
from '../../../data/shaders/glsl/base'
into 'assets/shaders/glsl/base'
include '*.spv'
}
copy {
from '../../../data/shaders/inlineuniformblocks'
into 'assets/shaders/inlineuniformblocks'
from '../../../data/shaders/glsl/inlineuniformblocks'
into 'assets/shaders/glsl/inlineuniformblocks'
include '*.*'
}

View file

@ -48,14 +48,14 @@ task copyTask {
}
copy {
from '../../../data/shaders/base'
into "assets/shaders/base"
from '../../../data/shaders/glsl/base'
into 'assets/shaders/glsl/base'
include '*.spv'
}
copy {
from '../../../data/shaders/inputattachments'
into 'assets/shaders/inputattachments'
from '../../../data/shaders/glsl/inputattachments'
into 'assets/shaders/glsl/inputattachments'
include '*.*'
}
@ -64,7 +64,7 @@ task copyTask {
into 'assets/models'
include 'treasure_smooth.dae'
}
}
preBuild.dependsOn copyTask

View file

@ -43,14 +43,14 @@ task copyTask {
}
copy {
from '../../../data/shaders/base'
into "assets/shaders/base"
from '../../../data/shaders/glsl/base'
into 'assets/shaders/glsl/base'
include '*.spv'
}
copy {
from '../../../data/shaders/instancing'
into 'assets/shaders/instancing'
from '../../../data/shaders/glsl/instancing'
into 'assets/shaders/glsl/instancing'
include '*.*'
}

View file

@ -43,14 +43,14 @@ task copyTask {
}
copy {
from '../../../data/shaders/base'
into "assets/shaders/base"
from '../../../data/shaders/glsl/base'
into 'assets/shaders/glsl/base'
include '*.spv'
}
copy {
from '../../../data/shaders/multisampling'
into 'assets/shaders/mesh'
from '../../../data/shaders/glsl/multisampling'
into 'assets/shaders/glsl/mesh'
include '*.*'
}

View file

@ -43,14 +43,14 @@ task copyTask {
}
copy {
from '../../../data/shaders/base'
into "assets/shaders/base"
from '../../../data/shaders/glsl/base'
into 'assets/shaders/glsl/base'
include '*.spv'
}
copy {
from '../../../data/shaders/multithreading'
into 'assets/shaders/multithreading'
from '../../../data/shaders/glsl/multithreading'
into 'assets/shaders/glsl/multithreading'
include '*.*'
}

View file

@ -43,14 +43,14 @@ task copyTask {
}
copy {
from '../../../data/shaders/base'
into "assets/shaders/base"
from '../../../data/shaders/glsl/base'
into 'assets/shaders/glsl/base'
include '*.spv'
}
copy {
from '../../../data/shaders/multiview'
into 'assets/shaders/multiview'
from '../../../data/shaders/glsl/multiview'
into 'assets/shaders/glsl/multiview'
include '*.*'
}

View file

@ -43,14 +43,14 @@ task copyTask {
}
copy {
from '../../../data/shaders/base'
into "assets/shaders/base"
from '../../../data/shaders/glsl/base'
into 'assets/shaders/glsl/base'
include '*.spv'
}
copy {
from '../../../data/shaders/negativeviewportheight'
into 'assets/shaders/negativeviewportheight'
from '../../../data/shaders/glsl/negativeviewportheight'
into 'assets/shaders/glsl/negativeviewportheight'
include '*.*'
}

View file

@ -43,14 +43,14 @@ task copyTask {
}
copy {
from '../../../data/shaders/base'
into "assets/shaders/base"
from '../../../data/shaders/glsl/base'
into 'assets/shaders/glsl/base'
include '*.spv'
}
copy {
from '../../../data/shaders/occlusionquery'
into 'assets/shaders/occlusionquery'
from '../../../data/shaders/glsl/occlusionquery'
into 'assets/shaders/glsl/occlusionquery'
include '*.*'
}

View file

@ -43,14 +43,14 @@ task copyTask {
}
copy {
from '../../../data/shaders/base'
into "assets/shaders/base"
from '../../../data/shaders/glsl/base'
into 'assets/shaders/glsl/base'
include '*.spv'
}
copy {
from '../../../data/shaders/offscreen'
into 'assets/shaders/offscreen'
from '../../../data/shaders/glsl/offscreen'
into 'assets/shaders/glsl/offscreen'
include '*.*'
}

View file

@ -43,14 +43,14 @@ task copyTask {
}
copy {
from '../../../data/shaders/base'
into "assets/shaders/base"
from '../../../data/shaders/glsl/base'
into 'assets/shaders/glsl/base'
include '*.spv'
}
copy {
from '../../../data/shaders/parallaxmapping'
into 'assets/shaders/parallaxmapping'
from '../../../data/shaders/glsl/parallaxmapping'
into 'assets/shaders/glsl/parallaxmapping'
include '*.*'
}

View file

@ -43,14 +43,14 @@ task copyTask {
}
copy {
from '../../../data/shaders/base'
into "assets/shaders/base"
from '../../../data/shaders/glsl/base'
into 'assets/shaders/glsl/base'
include '*.spv'
}
copy {
from '../../../data/shaders/particlefire'
into 'assets/shaders/particlefire'
from '../../../data/shaders/glsl/particlefire'
into 'assets/shaders/glsl/particlefire'
include '*.*'
}

View file

@ -43,14 +43,14 @@ task copyTask {
}
copy {
from '../../../data/shaders/base'
into "assets/shaders/base"
from '../../../data/shaders/glsl/base'
into 'assets/shaders/glsl/base'
include '*.spv'
}
copy {
from '../../../data/shaders/pbrbasic'
into 'assets/shaders/pbrbasic'
from '../../../data/shaders/glsl/pbrbasic'
into 'assets/shaders/glsl/pbrbasic'
include '*.*'
}

View file

@ -43,14 +43,14 @@ task copyTask {
}
copy {
from '../../../data/shaders/base'
into "assets/shaders/base"
from '../../../data/shaders/glsl/base'
into 'assets/shaders/glsl/base'
include '*.spv'
}
copy {
from '../../../data/shaders/pbribl'
into 'assets/shaders/pbribl'
from '../../../data/shaders/glsl/pbribl'
into 'assets/shaders/glsl/pbribl'
include '*.*'
}

View file

@ -43,14 +43,14 @@ task copyTask {
}
copy {
from '../../../data/shaders/base'
into "assets/shaders/base"
from '../../../data/shaders/glsl/base'
into 'assets/shaders/glsl/base'
include '*.spv'
}
copy {
from '../../../data/shaders/pbrtexture'
into 'assets/shaders/pbrtexture'
from '../../../data/shaders/glsl/pbrtexture'
into 'assets/shaders/glsl/pbrtexture'
include '*.*'
}

View file

@ -43,14 +43,14 @@ task copyTask {
}
copy {
from '../../../data/shaders/base'
into "assets/shaders/base"
from '../../../data/shaders/glsl/base'
into 'assets/shaders/glsl/base'
include '*.spv'
}
copy {
from '../../../data/shaders/pipelines'
into 'assets/shaders/pipelines'
from '../../../data/shaders/glsl/pipelines'
into 'assets/shaders/glsl/pipelines'
include '*.*'
}

View file

@ -43,14 +43,14 @@ task copyTask {
}
copy {
from '../../../data/shaders/base'
into "assets/shaders/base"
from '../../../data/shaders/glsl/base'
into 'assets/shaders/glsl/base'
include '*.spv'
}
copy {
from '../../../data/shaders/pipelinestatistics'
into 'assets/shaders/pipelinestatistics'
from '../../../data/shaders/glsl/pipelinestatistics'
into 'assets/shaders/glsl/pipelinestatistics'
include '*.*'
}

View file

@ -43,14 +43,14 @@ task copyTask {
}
copy {
from '../../../data/shaders/base'
into "assets/shaders/base"
from '../../../data/shaders/glsl/base'
into 'assets/shaders/glsl/base'
include '*.spv'
}
copy {
from '../../../data/shaders/pushconstants'
into 'assets/shaders/pushconstants'
from '../../../data/shaders/glsl/pushconstants'
into 'assets/shaders/glsl/pushconstants'
include '*.*'
}

View file

@ -43,14 +43,14 @@ task copyTask {
}
copy {
from '../../../data/shaders/base'
into "assets/shaders/base"
from '../../../data/shaders/glsl/base'
into 'assets/shaders/glsl/base'
include '*.spv'
}
copy {
from '../../../data/shaders/pushdescriptors'
into 'assets/shaders/pushdescriptors'
from '../../../data/shaders/glsl/pushdescriptors'
into 'assets/shaders/glsl/pushdescriptors'
include '*.*'
}

View file

@ -43,14 +43,14 @@ task copyTask {
}
copy {
from '../../../data/shaders/base'
into "assets/shaders/base"
from '../../../data/shaders/glsl/base'
into 'assets/shaders/glsl/base'
include '*.spv'
}
copy {
from '../../../data/shaders/radialblur'
into 'assets/shaders/radialblur'
from '../../../data/shaders/glsl/radialblur'
into 'assets/shaders/glsl/radialblur'
include '*.*'
}

View file

@ -43,14 +43,14 @@ task copyTask {
}
copy {
from '../../../data/shaders/base'
into "assets/shaders/base"
from '../../../data/shaders/glsl/base'
into 'assets/shaders/glsl/base'
include '*.spv'
}
copy {
from '../../../data/shaders/renderheadless'
into 'assets/shaders/renderheadless'
from '../../../data/shaders/glsl/renderheadless'
into 'assets/shaders/glsl/renderheadless'
include '*.*'
}

View file

@ -43,14 +43,14 @@ task copyTask {
}
copy {
from '../../../data/shaders/base'
into "assets/shaders/base"
from '../../../data/shaders/glsl/base'
into 'assets/shaders/glsl/base'
include '*.spv'
}
copy {
from '../../../data/shaders/scenerendering'
into 'assets/shaders/scenerendering'
from '../../../data/shaders/glsl/scenerendering'
into 'assets/shaders/glsl/scenerendering'
include '*.*'
}

View file

@ -43,14 +43,14 @@ task copyTask {
}
copy {
from '../../../data/shaders/base'
into "assets/shaders/base"
from '../../../data/shaders/glsl/base'
into 'assets/shaders/glsl/base'
include '*.spv'
}
copy {
from '../../../data/shaders/screenshot'
into 'assets/shaders/screenshot'
from '../../../data/shaders/glsl/screenshot'
into 'assets/shaders/glsl/screenshot'
include '*.*'
}

View file

@ -43,14 +43,14 @@ task copyTask {
}
copy {
from '../../../data/shaders/base'
into "assets/shaders/base"
from '../../../data/shaders/glsl/base'
into 'assets/shaders/glsl/base'
include '*.spv'
}
copy {
from '../../../data/shaders/shadowmapping'
into 'assets/shaders/shadowmapping'
from '../../../data/shaders/glsl/shadowmapping'
into 'assets/shaders/glsl/shadowmapping'
include '*.*'
}

View file

@ -43,14 +43,14 @@ task copyTask {
}
copy {
from '../../../data/shaders/base'
into "assets/shaders/base"
from '../../../data/shaders/glsl/base'
into 'assets/shaders/glsl/base'
include '*.spv'
}
copy {
from '../../../data/shaders/shadowmappingcascade'
into 'assets/shaders/shadowmappingcascade'
from '../../../data/shaders/glsl/shadowmappingcascade'
into 'assets/shaders/glsl/shadowmappingcascade'
include '*.*'
}

View file

@ -43,14 +43,14 @@ task copyTask {
}
copy {
from '../../../data/shaders/base'
into "assets/shaders/base"
from '../../../data/shaders/glsl/base'
into 'assets/shaders/glsl/base'
include '*.spv'
}
copy {
from '../../../data/shaders/shadowmapomni'
into 'assets/shaders/shadowmapomni'
from '../../../data/shaders/glsl/shadowmapomni'
into 'assets/shaders/glsl/shadowmapomni'
include '*.*'
}

View file

@ -43,14 +43,14 @@ task copyTask {
}
copy {
from '../../../data/shaders/base'
into "assets/shaders/base"
from '../../../data/shaders/glsl/base'
into 'assets/shaders/glsl/base'
include '*.spv'
}
copy {
from '../../../data/shaders/skeletalanimation'
into 'assets/shaders/skeletalanimation'
from '../../../data/shaders/glsl/skeletalanimation'
into 'assets/shaders/glsl/skeletalanimation'
include '*.*'
}

View file

@ -43,14 +43,14 @@ task copyTask {
}
copy {
from '../../../data/shaders/base'
into "assets/shaders/base"
from '../../../data/shaders/glsl/base'
into 'assets/shaders/glsl/base'
include '*.spv'
}
copy {
from '../../../data/shaders/specializationconstants'
into 'assets/shaders/specializationconstants'
from '../../../data/shaders/glsl/specializationconstants'
into 'assets/shaders/glsl/specializationconstants'
include '*.*'
}

View file

@ -43,14 +43,14 @@ task copyTask {
}
copy {
from '../../../data/shaders/base'
into "assets/shaders/base"
from '../../../data/shaders/glsl/base'
into 'assets/shaders/glsl/base'
include '*.spv'
}
copy {
from '../../../data/shaders/sphericalenvmapping'
into 'assets/shaders/sphericalenvmapping'
from '../../../data/shaders/glsl/sphericalenvmapping'
into 'assets/shaders/glsl/sphericalenvmapping'
include '*.*'
}

View file

@ -43,14 +43,14 @@ task copyTask {
}
copy {
from '../../../data/shaders/base'
into "assets/shaders/base"
from '../../../data/shaders/glsl/base'
into 'assets/shaders/glsl/base'
include '*.spv'
}
copy {
from '../../../data/shaders/ssao'
into 'assets/shaders/ssao'
from '../../../data/shaders/glsl/ssao'
into 'assets/shaders/glsl/ssao'
include '*.*'
}

View file

@ -43,14 +43,14 @@ task copyTask {
}
copy {
from '../../../data/shaders/base'
into "assets/shaders/base"
from '../../../data/shaders/glsl/base'
into 'assets/shaders/glsl/base'
include '*.spv'
}
copy {
from '../../../data/shaders/stencilbuffer'
into 'assets/shaders/stencilbuffer'
from '../../../data/shaders/glsl/stencilbuffer'
into 'assets/shaders/glsl/stencilbuffer'
include '*.*'
}

View file

@ -43,14 +43,14 @@ task copyTask {
}
copy {
from '../../../data/shaders/base'
into "assets/shaders/base"
from '../../../data/shaders/glsl/base'
into 'assets/shaders/glsl/base'
include '*.spv'
}
copy {
from '../../../data/shaders/subpasses'
into 'assets/shaders/subpasses'
from '../../../data/shaders/glsl/subpasses'
into 'assets/shaders/glsl/subpasses'
include '*.*'
}

View file

@ -43,14 +43,14 @@ task copyTask {
}
copy {
from '../../../data/shaders/base'
into "assets/shaders/base"
from '../../../data/shaders/glsl/base'
into 'assets/shaders/glsl/base'
include '*.spv'
}
copy {
from '../../../data/shaders/terraintessellation'
into 'assets/shaders/terraintessellation'
from '../../../data/shaders/glsl/terraintessellation'
into 'assets/shaders/glsl/terraintessellation'
include '*.*'
}

View file

@ -43,14 +43,14 @@ task copyTask {
}
copy {
from '../../../data/shaders/base'
into "assets/shaders/base"
from '../../../data/shaders/glsl/base'
into 'assets/shaders/glsl/base'
include '*.spv'
}
copy {
from '../../../data/shaders/tessellation'
into 'assets/shaders/tessellation'
from '../../../data/shaders/glsl/tessellation'
into 'assets/shaders/glsl/tessellation'
include '*.*'
}

View file

@ -43,14 +43,14 @@ task copyTask {
}
copy {
from '../../../data/shaders/base'
into "assets/shaders/base"
from '../../../data/shaders/glsl/base'
into 'assets/shaders/glsl/base'
include '*.spv'
}
copy {
from '../../../data/shaders/textoverlay'
into 'assets/shaders/textoverlay'
from '../../../data/shaders/glsl/textoverlay'
into 'assets/shaders/glsl/textoverlay'
include '*.*'
}

View file

@ -43,14 +43,14 @@ task copyTask {
}
copy {
from '../../../data/shaders/base'
into "assets/shaders/base"
from '../../../data/shaders/glsl/base'
into 'assets/shaders/glsl/base'
include '*.spv'
}
copy {
from '../../../data/shaders/texture'
into 'assets/shaders/texture'
from '../../../data/shaders/glsl/texture'
into 'assets/shaders/glsl/texture'
include '*.*'
}

View file

@ -43,14 +43,14 @@ task copyTask {
}
copy {
from '../../../data/shaders/base'
into "assets/shaders/base"
from '../../../data/shaders/glsl/base'
into 'assets/shaders/glsl/base'
include '*.spv'
}
copy {
from '../../../data/shaders/texture3d'
into 'assets/shaders/texture3d'
from '../../../data/shaders/glsl/texture3d'
into 'assets/shaders/glsl/texture3d'
include '*.*'
}

View file

@ -43,14 +43,14 @@ task copyTask {
}
copy {
from '../../../data/shaders/base'
into "assets/shaders/base"
from '../../../data/shaders/glsl/base'
into 'assets/shaders/glsl/base'
include '*.spv'
}
copy {
from '../../../data/shaders/texturearray'
into 'assets/shaders/texturearray'
from '../../../data/shaders/glsl/texturearray'
into 'assets/shaders/glsl/texturearray'
include '*.*'
}

View file

@ -43,14 +43,14 @@ task copyTask {
}
copy {
from '../../../data/shaders/base'
into "assets/shaders/base"
from '../../../data/shaders/glsl/base'
into 'assets/shaders/glsl/base'
include '*.spv'
}
copy {
from '../../../data/shaders/texturecubemap'
into 'assets/shaders/texturecubemap'
from '../../../data/shaders/glsl/texturecubemap'
into 'assets/shaders/glsl/texturecubemap'
include '*.*'
}

View file

@ -43,14 +43,14 @@ task copyTask {
}
copy {
from '../../../data/shaders/base'
into "assets/shaders/base"
from '../../../data/shaders/glsl/base'
into 'assets/shaders/glsl/base'
include '*.spv'
}
copy {
from '../../../data/shaders/texturemipmapgen'
into 'assets/shaders/texturemipmapgen'
from '../../../data/shaders/glsl/texturemipmapgen'
into 'assets/shaders/glsl/texturemipmapgen'
include '*.*'
}

View file

@ -43,14 +43,14 @@ task copyTask {
}
copy {
from '../../../data/shaders/base'
into "assets/shaders/base"
from '../../../data/shaders/glsl/base'
into 'assets/shaders/glsl/base'
include '*.spv'
}
copy {
from '../../../data/shaders/triangle'
into 'assets/shaders/triangle'
from '../../../data/shaders/glsl/triangle'
into 'assets/shaders/glsl/triangle'
include '*.*'
}

View file

@ -43,14 +43,14 @@ task copyTask {
}
copy {
from '../../../data/shaders/base'
into "assets/shaders/base"
from '../../../data/shaders/glsl/base'
into 'assets/shaders/glsl/base'
include '*.spv'
}
copy {
from '../../../data/shaders/viewportarray'
into 'assets/shaders/viewportarray'
from '../../../data/shaders/glsl/viewportarray'
into 'assets/shaders/glsl/viewportarray'
include '*.*'
}

View file

@ -43,14 +43,14 @@ task copyTask {
}
copy {
from '../../../data/shaders/base'
into "assets/shaders/base"
from '../../../data/shaders/glsl/base'
into 'assets/shaders/glsl/base'
include '*.spv'
}
copy {
from '../../../data/shaders/vulkanscene'
into 'assets/shaders/vulkanscene'
from '../../../data/shaders/glsl/vulkanscene'
into 'assets/shaders/glsl/vulkanscene'
include '*.*'
}

View file

@ -19,6 +19,11 @@ const std::string getAssetPath()
#endif
}
const std::string getShadersPath()
{
return getAssetPath() + "shaders/glsl/";
}
namespace vks
{
namespace tools
@ -152,7 +157,7 @@ namespace vks
break;
case VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL:
// Image is a transfer source
// Image is a transfer source
// Make sure any reads from the image have been finished
imageMemoryBarrier.srcAccessMask = VK_ACCESS_TRANSFER_READ_BIT;
break;

View file

@ -60,6 +60,7 @@
#endif
const std::string getAssetPath();
const std::string getShadersPath();
namespace vks
{
@ -113,7 +114,7 @@ namespace vks
void exitFatal(std::string message, int32_t exitCode);
void exitFatal(std::string message, VkResult resultCode);
// Load a SPIR-V shader (binary)
// Load a SPIR-V shader (binary)
#if defined(__ANDROID__)
VkShaderModule loadShader(AAssetManager* assetManager, const char *fileName, VkDevice device);
#else

View file

@ -17,7 +17,7 @@ VkResult VulkanExampleBase::createInstance(bool enableValidation)
// Validation can also be forced via a define
#if defined(_VALIDATION)
this->settings.validation = true;
#endif
#endif
VkApplicationInfo appInfo = {};
appInfo.sType = VK_STRUCTURE_TYPE_APPLICATION_INFO;
@ -66,7 +66,7 @@ VkResult VulkanExampleBase::createInstance(bool enableValidation)
if (settings.validation)
{
// The VK_LAYER_KHRONOS_validation contains all current validation functionality.
// Note that on Android this layer requires at least NDK r20
// Note that on Android this layer requires at least NDK r20
const char* validationLayerName = "VK_LAYER_KHRONOS_validation";
// Check if this layer is available at instance level
uint32_t instanceLayerCount;
@ -155,8 +155,8 @@ void VulkanExampleBase::prepare()
UIOverlay.device = vulkanDevice;
UIOverlay.queue = queue;
UIOverlay.shaders = {
loadShader(getAssetPath() + "shaders/base/uioverlay.vert.spv", VK_SHADER_STAGE_VERTEX_BIT),
loadShader(getAssetPath() + "shaders/base/uioverlay.frag.spv", VK_SHADER_STAGE_FRAGMENT_BIT),
loadShader(getShadersPath() + "base/uioverlay.vert.spv", VK_SHADER_STAGE_VERTEX_BIT),
loadShader(getShadersPath() + "base/uioverlay.frag.spv", VK_SHADER_STAGE_FRAGMENT_BIT),
};
UIOverlay.prepareResources();
UIOverlay.preparePipeline(pipelineCache, renderPass);
@ -685,7 +685,7 @@ VulkanExampleBase::VulkanExampleBase(bool enableValidation)
benchmark.outputFrameTimes = true;
}
}
#if defined(VK_USE_PLATFORM_ANDROID_KHR)
// Vulkan library is loaded dynamically on Android
bool libLoaded = vks::android::loadVulkanLibrary();
@ -822,7 +822,7 @@ bool VulkanExampleBase::initVulkan()
// Defaults to the first device unless specified by command line
uint32_t selectedDevice = 0;
#if !defined(VK_USE_PLATFORM_ANDROID_KHR)
#if !defined(VK_USE_PLATFORM_ANDROID_KHR)
// GPU selection via command line argument
for (size_t i = 0; i < args.size(); i++)
{
@ -832,11 +832,11 @@ bool VulkanExampleBase::initVulkan()
char* endptr;
uint32_t index = strtol(args[i + 1], &endptr, 10);
if (endptr != args[i + 1])
{
{
if (index > gpuCount - 1)
{
std::cerr << "Selected device index " << index << " is out of range, reverting to device 0 (use -listgpus to show available Vulkan devices)" << std::endl;
}
}
else
{
std::cout << "Selected Vulkan device " << index << std::endl;
@ -1794,7 +1794,7 @@ xcb_window_t VulkanExampleBase::setupWindow()
&(atom_wm_fullscreen->atom));
free(atom_wm_fullscreen);
free(atom_wm_state);
}
}
xcb_map_window(connection, window);
@ -1888,7 +1888,7 @@ void VulkanExampleBase::handleEvent(const xcb_generic_event_t *event)
break;
}
}
break;
break;
case XCB_KEY_RELEASE:
{
const xcb_key_release_event_t *keyEvent = (const xcb_key_release_event_t *)event;
@ -2127,7 +2127,7 @@ void VulkanExampleBase::windowResize()
vkDestroyImageView(device, depthStencil.view, nullptr);
vkDestroyImage(device, depthStencil.image, nullptr);
vkFreeMemory(device, depthStencil.mem, nullptr);
setupDepthStencil();
setupDepthStencil();
for (uint32_t i = 0; i < frameBuffers.size(); i++) {
vkDestroyFramebuffer(device, frameBuffers[i], nullptr);
}
@ -2200,7 +2200,7 @@ void VulkanExampleBase::initSwapchain()
{
#if defined(_WIN32)
swapChain.initSurface(windowInstance, window);
#elif defined(VK_USE_PLATFORM_ANDROID_KHR)
#elif defined(VK_USE_PLATFORM_ANDROID_KHR)
swapChain.initSurface(androidApp->window);
#elif (defined(VK_USE_PLATFORM_IOS_MVK) || defined(VK_USE_PLATFORM_MACOS_MVK))
swapChain.initSurface(view);

Some files were not shown because too many files have changed in this diff Show more