Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
594 commits
Select commit Hold shift + click to select a range
f202ef5
utility func to get items per wg
keptsecret May 29, 2025
3ccb6f9
Implemented nan height value handling
Przemog1 May 29, 2025
52d5670
Added test polyline draw
Przemog1 May 29, 2025
8a4fde3
Merge branch 'dtm' of github.com:Devsh-Graphics-Programming/Nabla-Exa…
Przemog1 May 29, 2025
93b7810
added check for vk spec requirement
keptsecret May 30, 2025
f72a308
Fixed vertex shader so it now compiles with emulated float
Przemog1 May 30, 2025
5d139c4
Updated media
Przemog1 May 31, 2025
7762984
Updated media
Przemog1 May 31, 2025
00a1a1d
GRID DTM Small Fixes
Erfan-Ahmadi May 31, 2025
cd802d6
fixed memcmp in DtmSettings ==
Erfan-Ahmadi May 31, 2025
3a3aaa9
removed maxComputeWorkgroupSubgroups*subgroupsize check
keptsecret Jun 2, 2025
6581ed4
Merge branch 'master' into new_wg_scan_test
keptsecret Jun 2, 2025
6340d2f
logging in DrawResourcesFiller
Erfan-Ahmadi Jun 2, 2025
9e0448c
Saving work
Przemog1 Jun 3, 2025
8d50e3e
Resolved conflicts, merged dtm
Przemog1 Jun 3, 2025
fef1cd5
first outline
Jun 3, 2025
27cd66f
Implemented grid dilation
Przemog1 Jun 3, 2025
157bd8f
outline how I want stuff reorganised
Jun 4, 2025
8370719
temporarily disable some things that I couldn't figure out withour Ar…
Jun 4, 2025
83443a7
factored out the `CSwapchainFramebuffersAndDepth` into `nbl/examples/…
Jun 4, 2025
90ba926
various minor adjustments to unit tests
keptsecret Jun 5, 2025
19d7fe0
simplified data accessors
keptsecret Jun 5, 2025
fdace31
tests for native and emulated subgroup op
keptsecret Jun 5, 2025
d6680f2
removed redundant stuff
keptsecret Jun 5, 2025
bafad3e
bind swapchain image directly, explicit surface format swapchain
keptsecret Jun 6, 2025
32dc78f
shared data accessor header between test and bench, same shader adjus…
keptsecret Jun 6, 2025
2aef6d3
generate benchmark inputs with xoroshiro
keptsecret Jun 6, 2025
149a237
only have to benchmark plus op
keptsecret Jun 6, 2025
00ed9be
benchmark all reduce/scan in one run (lots of shaders)
keptsecret Jun 6, 2025
d1a4e8e
Added diagonal mode info to grid DTM height map
Przemog1 Jun 7, 2025
a5a21fd
minor changes to passing subgroup size and items per wg
keptsecret Jun 9, 2025
1710b69
push constant stores array of output addresses directly because stati…
keptsecret Jun 9, 2025
47dec6d
IUtilities constructor to static create function
Erfan-Ahmadi Jun 9, 2025
0777434
allocateDrawResourcesWithinAvailableVRAM
Erfan-Ahmadi Jun 9, 2025
6c78e29
rework PCH for examples, save work and test with 01 - successfully
AnastaZIuk Jun 11, 2025
fdae6f9
actually some example headers I removed can be used in PCH with small…
AnastaZIuk Jun 11, 2025
ed51dee
remove old header references from 29_MeshLoaders/main.cpp which are i…
AnastaZIuk Jun 11, 2025
971ee34
wipe all EXCLUDE_FROM_ALL except common directory, group all examples…
AnastaZIuk Jun 11, 2025
c9f610f
use NBL_ADJUST_FOLDERS with examples namespace
AnastaZIuk Jun 11, 2025
307f7f9
un-premultiply alpha
Erfan-Ahmadi Jun 12, 2025
f0c2d5e
Fixed DTM diagonal info flushing
Przemog1 Jun 12, 2025
55b8313
Merge branch 'dtm' of github.com:Devsh-Graphics-Programming/Nabla-Exa…
Przemog1 Jun 12, 2025
b9f3f13
Fix example to use reworked shader spec itnerface
Jun 13, 2025
60319f4
Fix picking the wrong diff when merging with master
Jun 13, 2025
fbf6740
Bringing Francisco's changes to DrawResourcesFiller
Erfan-Ahmadi Jun 13, 2025
bb0e4fd
Fix merge by using master code
Jun 14, 2025
04e32ad
Fix example 64,67,70,71
Jun 14, 2025
3866e2d
Saving work
Przemog1 Jun 14, 2025
9ed92e5
Fixed Geometry Fixes
Erfan-Ahmadi Jun 16, 2025
4c10dc1
use config header file for workgroup sizes
keptsecret Jun 16, 2025
6c6c645
simplified some cpp code, write all benchmark descriptors at beginning
keptsecret Jun 16, 2025
d33791e
Merge branch 'master' into stageless_shaders
Jun 16, 2025
638846e
Fix ray tracing pipeline demo alpha
Jun 16, 2025
6c251d1
Remove test code in ray query geometry shaders
Jun 16, 2025
95d8f78
Merge branch 'stageless_shaders' into rework_pipeline_shader_spec_info
Jun 16, 2025
2076b66
simplified data accessor template + usage
keptsecret Jun 16, 2025
c111500
Added option to draw grid without height texture provided
Przemog1 Jun 16, 2025
1ee11d2
Merge branch 'dtm' of github.com:Devsh-Graphics-Programming/Nabla-Exa…
Przemog1 Jun 16, 2025
a7cfeeb
Fix
Przemog1 Jun 16, 2025
d1a8113
prep the push constants a little and move onto scene conversion
Jun 16, 2025
9f5da5c
Fixed warnings
Przemog1 Jun 16, 2025
629a0ac
correct small typos, get stuff to compile
Jun 16, 2025
37330ab
add more test geometries
Jun 16, 2025
5200ea1
fire up the converter and handle ownership between queues
Jun 16, 2025
a89ffbe
make accessor template nicer to read
keptsecret Jun 17, 2025
272a269
use Asset Converter for ICPUPolygonGeometry, and split into Scene and…
Jun 17, 2025
8df4f58
Initial neighbouring cells drawing
Przemog1 Jun 17, 2025
3a487ac
make example 30 run again
Jun 17, 2025
8fd7f5d
fix ex 11 fft
keptsecret Jun 18, 2025
e5d4a35
Fix fft bloom example to use the reworked shader spec info interface
Jun 18, 2025
c06b97e
Merge branch 'master' into rework_pipeline_shader_spec_info
Jun 18, 2025
8ae32e1
removed redundant barrier
keptsecret Jun 18, 2025
7121e8b
Fix example 05
Jun 18, 2025
683aa87
use builtin bda accessor
keptsecret Jun 18, 2025
1c56eb0
reduce workgroup macro definitions, use config string
keptsecret Jun 18, 2025
3e910b5
similar config string thing but for subgroups
keptsecret Jun 18, 2025
c446d7e
prep for the final stretch in ex 09 (shaders)
Jun 18, 2025
e76bfcc
move ex09 renderer to its own include
Jun 18, 2025
0ba8eed
apply reduced macro definitions to benchmark ex
keptsecret Jun 18, 2025
e06c9af
Merge pull request #192 from Devsh-Graphics-Programming/new_wg_scan_test
devshgraphicsprogramming Jun 18, 2025
c3786df
prep for shader loading
Jun 18, 2025
18bb325
Merge branch 'master' into rework_pipeline_shader_spec_info
Jun 18, 2025
173a3c9
Fix compile error for example 23 and 29
Jun 18, 2025
643b8d8
Merge pull request #195 from Devsh-Graphics-Programming/rework_pipeli…
devshgraphicsprogramming Jun 18, 2025
d03f31b
kill a CMakeLists.txt not used in the example PCH branch
Jun 18, 2025
f6aebbf
commit shaders somewhere for now
Jun 18, 2025
00be524
Merge remote-tracking branch 'remotes/origin/master' into mesh_loaders
Jun 18, 2025
8965fb3
get ex 09 in line with Stageless Shaders
Jun 18, 2025
a860c43
fix up examples before the PCH PR
Jun 18, 2025
2dc2682
prep example 71 for @kevinyu
Jun 18, 2025
be46ec3
prep example 67 for further work
Jun 18, 2025
9aa7483
@AnastaZIuk I need your help for getting the mounting of `common/incl…
Jun 18, 2025
846d2fd
prep UI example for further work
Jun 18, 2025
a347562
note down embedding TODOs for arek
Jun 19, 2025
cf4e279
remove unused shaders
Jun 19, 2025
08c28ef
get the example to find shaders and create pipelines, but nothing on …
Jun 19, 2025
17b0579
scene was empty, no wonder nothing drew
Jun 19, 2025
62f1a26
index type was not being set
Jun 19, 2025
fcae0b4
Initial commit for example 71 to use ICPUPolygonGeometry
Jun 19, 2025
312ca61
pull Matt and resolve conflicts
AnastaZIuk Jun 19, 2025
e419580
docs docs docs, adjust to comments and test on 01 after updates
AnastaZIuk Jun 19, 2025
cfd609c
matrix math in linalg was fine, I made a typo
Jun 20, 2025
6242357
fix a caption bug
Jun 20, 2025
ef865e7
Small change
Erfan-Ahmadi Jun 21, 2025
19df6e1
Merge remote-tracking branch 'remotes/origin/mlBuildUpdates' into mes…
Jun 21, 2025
19167c5
leave pointers on how to port example 62_CAD, also `EXCLUDE_FROM_ALL`…
Jun 21, 2025
a0622f3
kill old meshloaders example that didn't work since forever
Jun 21, 2025
f494d85
yes `NBL_EMBED_BUILTIN_RESOURCES` should control both Nable and examp…
Jun 21, 2025
ce268fb
Adjust all examples after splitting `MonoAssetManagerAndBuiltinResour…
Jun 21, 2025
20a5438
correct namespace ambiguities affecting example 23 and 29
Jun 21, 2025
21a88ff
aaah the `BuiltinResourcesApplication.hpp` header needs some special …
Jun 22, 2025
1b3c19c
make the `BuiltinResourcesApplication` work for examples without buil…
Jun 23, 2025
8b89fa2
WIP Grid DTM Work
Erfan-Ahmadi Jun 23, 2025
de1ccfa
WIP contours in grid dtms
Erfan-Ahmadi Jun 23, 2025
bb68b7b
create REGISTER_COMMON_BUILTINS, register example API source & includ…
AnastaZIuk Jun 23, 2025
7ec6846
make CSwapchainFramebuffersAndDepth support runtime depth buffer resi…
Jun 23, 2025
64e7b26
remake example 61, not thoroughly tested, some TODOs remain for @Anas…
Jun 23, 2025
2872604
fix bugs in ex 61:
Jun 23, 2025
20cc57e
Push Mesh Loader example
Jun 24, 2025
1b8135b
Grid Outlines SDF with Correct Dilation Logic
Erfan-Ahmadi Jun 24, 2025
b397df5
small fix
Erfan-Ahmadi Jun 24, 2025
73c5652
comment
Erfan-Ahmadi Jun 24, 2025
792f539
Small fixes with DTMS
Erfan-Ahmadi Jun 24, 2025
161733f
Fix example 71
Jun 25, 2025
86cc7dd
decouple `CSimpleDebugRenderer` from `CGeometryCreatorScene`
Jun 25, 2025
3cf8194
Auto-Submit for Triangle DTMS
Erfan-Ahmadi Jun 25, 2025
8a0043b
small fix
Erfan-Ahmadi Jun 25, 2025
e4c3f8b
Fix reindexing in auto submit triangle dtms
Erfan-Ahmadi Jun 25, 2025
cbcc1c9
create INTERFACE_TO_BUILTINS, add NblExtExamplesAPIBuiltinsSPIRV targ…
AnastaZIuk Jun 25, 2025
e790c84
more improvements to make the Simple Debug Renderer more runtime frie…
Jun 25, 2025
eaa1320
prep the conversion
Jun 25, 2025
c71e386
update CMake to support (NOT NBL_EMBED_BUILTIN_RESOURCES) mode but it…
AnastaZIuk Jun 25, 2025
d54bd98
Reimplemented height shading
Przemog1 Jun 25, 2025
7d2d282
Merge branch 'dtm' of github.com:Devsh-Graphics-Programming/Nabla-Exa…
Przemog1 Jun 25, 2025
91de837
outline phaseShift
Erfan-Ahmadi Jun 26, 2025
1a61230
Forgot to actually set the phaseshift
Erfan-Ahmadi Jun 26, 2025
ed437eb
DTM Contour Fixes and GRID DTM refactor
Erfan-Ahmadi Jun 26, 2025
71a41f3
small revert
Erfan-Ahmadi Jun 26, 2025
3a7b90d
Small Fix
Erfan-Ahmadi Jun 26, 2025
5929be1
just some todo markup
Jun 26, 2025
52c1aa5
ready changes for mesh_loaders merge, requires examples.hpp from mesh…
keptsecret Jun 27, 2025
d596f75
merge mesh_loaders, fix conflict
keptsecret Jun 27, 2025
c43c93b
cpp fixes so it compiles at least
keptsecret Jun 27, 2025
8b31859
a bazillion fixes since last time bxdf usages changed
keptsecret Jun 27, 2025
229b521
remove my tests and assume pre-compiled SPIRV for CSimpleDebugRendere…
AnastaZIuk Jun 27, 2025
7d4e1f4
Shader Fixes and Improvements
Erfan-Ahmadi Jun 30, 2025
d3590dd
shader fixes and improvements on dtm
Erfan-Ahmadi Jun 30, 2025
f23411e
adding rotation to viewport
Erfan-Ahmadi Jun 30, 2025
8f6c7bc
get the spanner PLY loading!
Jul 1, 2025
0cbb83e
Merge pull request #197 from Devsh-Graphics-Programming/mesh_loaders
devshgraphicsprogramming Jul 1, 2025
f66d952
Add more geometry to geometry creator demo
Jul 1, 2025
0bc0557
Fix example 67
Jul 1, 2025
01c2b69
Fix example 67 indentation to use tabs
Jul 1, 2025
0b30462
Fix example 71 normal computation for more geometry
Jul 1, 2025
83394e4
Fix normal computation for icosphere example 67
Jul 1, 2025
82c0d90
Moved grid only calculations from screen to grid space
Przemog1 Jul 1, 2025
0c13db5
we'll do Normal Quantization and cache load/store in another example
Jul 1, 2025
d51c739
start extending the mesh loader example for conditionally enabled ext…
Jul 1, 2025
050a201
Moved grid DTM color calculation from screen to grid space
Przemog1 Jul 1, 2025
adbd5f0
display reconstructed (face) normals when per-vertex aren't available
Jul 1, 2025
13a835b
fix `removeGeometry` to actually deallocate slots in the Suballocated…
Jul 2, 2025
0cd6f7e
Merge branch 'master' of github.com:Devsh-Graphics-Programming/Nabla-…
AnastaZIuk Jul 2, 2025
1b3a341
Find the bug causing us to crash on mesh reload.
Jul 2, 2025
0144b2d
add missing file from last commit
Jul 2, 2025
6e05533
lay out separate geomtries along the X-axis
Jul 2, 2025
4ed18fa
fix integer overflow issue
Jul 2, 2025
26302a3
adjust to AABB changes
Jul 2, 2025
66e486c
Merge pull request #201 from Devsh-Graphics-Programming/mitsuba_seria…
devshgraphicsprogramming Jul 2, 2025
822af13
Merge branch 'master' into mesh_loaders_kevin
Jul 3, 2025
5287dab
Add arrow geometry to example 67
Jul 3, 2025
9eb0615
Merge branch 'master' of github.com:Devsh-Graphics-Programming/Nabla-…
AnastaZIuk Jul 3, 2025
60bdf1b
use NBL_REGISTER_BUILD_MOUNT_POINT, update BuiltinResourcesApplicatio…
AnastaZIuk Jul 3, 2025
767e6c4
update common/src/nbl/examples/CMakeLists.txt
AnastaZIuk Jul 3, 2025
c573951
update some examples after moving spirv target field
AnastaZIuk Jul 3, 2025
acf32da
update media submodule
Jul 4, 2025
89ab539
update CMakeLists.txt files after changes, remove .hlsl ext part from…
AnastaZIuk Jul 6, 2025
e074ad3
use json canonical KEY field, update common/src/nbl/examples/CMakeLis…
AnastaZIuk Jul 7, 2025
5e4180c
Fixed out of bounds height map array access
Przemog1 Jul 8, 2025
710e2f7
Fixed emulated float compilation errors
Przemog1 Jul 9, 2025
a6271a4
adjust to new API changes
AnastaZIuk Jul 10, 2025
e6417f4
Renamed CASE_BUG after bug fix
Przemog1 Jul 10, 2025
ea00599
Fixed compilation errors
Przemog1 Jul 10, 2025
e6c50ac
Fix raytrace hit shader
Jul 10, 2025
663f2f2
In progress
Jul 10, 2025
06d839d
Enabled grid DTM height map view format validation
Przemog1 Jul 11, 2025
3a05642
Use cpu ray tracing pipeline asset conversion on rt pipeline demo
Jul 10, 2025
0de0bc3
stylo and corrections, adjust to changes
AnastaZIuk Jul 16, 2025
e82ba9e
Shader Edits
Erfan-Ahmadi Jul 17, 2025
81f710c
Small Fix
Erfan-Ahmadi Jul 17, 2025
d0eb190
Merge branch 'master' into dtm
Erfan-Ahmadi Jul 17, 2025
3dd782e
Fix Compiler Errors with new changes
Erfan-Ahmadi Jul 17, 2025
c4e311a
Merge pull request #200 from Devsh-Graphics-Programming/exBuiltinArch…
devshgraphicsprogramming Jul 17, 2025
4483e3c
save work
AnastaZIuk Jul 17, 2025
41acb8a
Merge branch 'master' of github.com:Devsh-Graphics-Programming/Nabla-…
AnastaZIuk Jul 17, 2025
d3ad677
Shader Compilation Fixes
Erfan-Ahmadi Jul 18, 2025
aafa641
WIP: Transformations and ScreenToWorld Fixes
Erfan-Ahmadi Jul 18, 2025
0cf6cd9
vertex input attributes no longer recommended
Jul 21, 2025
76cedea
Need a different tutorial
Jul 21, 2025
251c070
make CI always test ex 12, remove ex 29 which is duplicate of old 12
Jul 21, 2025
6d48373
update examples 23, 27 and 29, perform tests on both built-in off/on …
AnastaZIuk Jul 21, 2025
fbbec19
Miter(PolylineConnector) Fix with Viewport Rotation
Erfan-Ahmadi Jul 22, 2025
d65d08f
Merge branch 'master' into dtm
Erfan-Ahmadi Jul 22, 2025
59f92aa
Merge branch 'master' of github.com:Devsh-Graphics-Programming/Nabla-…
AnastaZIuk Jul 22, 2025
fc0f38b
Fix Small Contour Bug
Erfan-Ahmadi Jul 22, 2025
620aba9
remove workaround
Erfan-Ahmadi Jul 22, 2025
6dfc0fe
remove GLOB expressions from 23,27,29 exs
AnastaZIuk Jul 22, 2025
ae5676b
Merge branch 'dtm'
Erfan-Ahmadi Jul 23, 2025
2262bbc
Merge branch 'master' of github.com:Devsh-Graphics-Programming/Nabla-…
AnastaZIuk Jul 23, 2025
76cdec9
Merge pull request #204 from Devsh-Graphics-Programming/exUpdates
AnastaZIuk Jul 23, 2025
cafd680
forgot about you 22, targetSpirvVersion fix
AnastaZIuk Jul 23, 2025
24e5f12
Merge branch 'master' of github.com:Devsh-Graphics-Programming/Nabla-…
AnastaZIuk Jul 23, 2025
3899c45
Fixed emulated float compilation error
Przemog1 Jul 24, 2025
1bbfd09
Fix example 67
Jul 25, 2025
25f1cd4
Fix example 71
Jul 25, 2025
8125ddd
Merge pull request #206 from Devsh-Graphics-Programming/ef64_fix
Erfan-Ahmadi Jul 29, 2025
6048631
Merge branch 'mesh_loaders_kevin' into rt_pipeline_asset_conversion
Jul 30, 2025
6f58d05
Fix after merge
Jul 30, 2025
261203d
Add no null intersection shader
Jul 30, 2025
1898a9d
Merge branch 'rt_pipeline_asset_conversion' of github.com:Devsh-Graph…
Jul 30, 2025
48bdaca
Cad Example: SingleLineText to take wchar
Erfan-Ahmadi Jul 31, 2025
30a5a19
Remore normal type unknown from demo
Aug 4, 2025
33015ee
parse --savemesh argument
YasInvolved Aug 5, 2025
4a01642
save loaded mesh (requires improvements)
YasInvolved Aug 5, 2025
4551f28
argparse by relative path
YasInvolved Aug 11, 2025
128fe5b
only geometry is intended to be written
YasInvolved Aug 11, 2025
4dabe03
fix naming, write mesh on reload
YasInvolved Aug 11, 2025
f1f0c5b
Merge remote-tracking branch 'remotes/origin/mesh_loaders_kevin'
Aug 11, 2025
3de2363
re-add newly reworked examples to CI pipeline
Aug 11, 2025
7899653
prompt user to choose the file to which the geometry will be saved
YasInvolved Aug 12, 2025
9c24b52
check if geometry is null on exit and null it out after saving, log w…
YasInvolved Aug 12, 2025
2c879de
allow user to specify path in additional optional argument
YasInvolved Aug 12, 2025
b51add6
change sharedInputCWD to localOutputCWD in geometry saving function
YasInvolved Aug 12, 2025
f67c026
Merge branch 'master' into rt_pipeline_asset_conversion
Aug 13, 2025
052158c
Use spirv intrinsics for raytracing command and builtin
Aug 15, 2025
cd6b9f0
Add comment referring to https://github.com/microsoft/DirectXShaderCo…
Aug 15, 2025
f472acc
Use inline spirv to replace ReportHit
Aug 18, 2025
10263b0
simplify geometry writing logic
YasInvolved Aug 18, 2025
0e2115d
initialize m_saveGeomPrefixPath when everything is ready
YasInvolved Aug 19, 2025
6537b72
fix a bug where m_specifiedGeomSavePath is never set
YasInvolved Aug 19, 2025
c21e4cc
change cmdline argument naming to match the naming scheme
YasInvolved Aug 19, 2025
872d71d
made geometry writer work async
YasInvolved Aug 19, 2025
a19bf5f
Turn InstanceID() and PrimitiveIndex() to inline spirv
Aug 20, 2025
e1972c7
Convert more PrimitiveIndex() into inline spirv
Aug 20, 2025
53b9ae1
Merge remote-tracking branch 'remotes/origin/ray_tracing_spirv_intrin…
Aug 21, 2025
7ed614c
fix data race hazard, await running async before running a new one
YasInvolved Aug 21, 2025
1a63f5a
multiple tasks support
YasInvolved Aug 21, 2025
99945dc
revert: fix data race hazard, await running async before running a ne…
YasInvolved Aug 21, 2025
ddafc21
Add disk geometry to example 67
Aug 25, 2025
b4807ad
Merge pull request #207 from Devsh-Graphics-Programming/yas_mesh_loaders
devshgraphicsprogramming Aug 26, 2025
ac36695
Merge branch 'master' into hlsl_path_tracer
keptsecret Aug 28, 2025
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
4 changes: 2 additions & 2 deletions 01_HelloCoreSystemAsset/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// This file is part of the "Nabla Engine".
// For conditions of distribution and use, see copyright notice in nabla.h

// always include nabla first before std:: headers
#include "nabla.h"
// <nabla.h> public interface and common examples API, always include first before std:: headers
#include "nbl/examples/examples.hpp"

#include "nbl/system/IApplicationFramework.h"

Expand Down
6 changes: 3 additions & 3 deletions 02_HelloCompute/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ class HelloComputeApp final : public nbl::application_templates::MonoSystemMonoL
// The convention is that an `ICPU` object represents a potentially Mutable (and in the past, Serializable) recipe for creating an `IGPU` object, and later examples will show automated systems for doing that.
// The Assets always form a Directed Acyclic Graph and our type system enforces that property at compile time (i.e. an `IBuffer` cannot reference an `IImageView` even indirectly).
// Another reason for the 1:1 pairing of types is that one can use a CPU-to-GPU associative cache (asset manager has a default one) and use the pointers to the CPU objects as UUIDs.
// The ICPUShader is just a mutable container for source code (can be high level like HLSL needing compilation to SPIR-V or SPIR-V itself) held in an `nbl::asset::ICPUBuffer`.
// The IShader is just a mutable container for source code (can be high level like HLSL needing compilation to SPIR-V or SPIR-V itself) held in an `nbl::asset::ICPUBuffer`.
// They can be created: from buffers of code, by compilation from some other source code, or loaded from files (next example will do that).
smart_refctd_ptr<nbl::asset::ICPUShader> cpuShader;
smart_refctd_ptr<nbl::asset::IShader> cpuShader;
{
// Normally we'd use the ISystem and the IAssetManager to load shaders flexibly from (virtual) files for ease of development (syntax highlighting and Intellisense),
// but I want to show the full process of assembling a shader from raw source code at least once.
Expand Down Expand Up @@ -138,7 +138,7 @@ class HelloComputeApp final : public nbl::application_templates::MonoSystemMonoL
}

// Note how each ILogicalDevice method takes a smart-pointer r-value, so that the GPU objects refcount their dependencies
smart_refctd_ptr<nbl::video::IGPUShader> shader = device->createShader(cpuShader.get());
smart_refctd_ptr<IShader> shader = device->compileShader({.source = cpuShader.get()});
if (!shader)
return logFail("Failed to create a GPU Shader, seems the Driver doesn't like the SPIR-V we're feeding it!\n");

Expand Down
28 changes: 15 additions & 13 deletions 03_DeviceSelectionAndSharedSources/Testers.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
#ifndef _NBL_TESTERS_H_INCLUDED_
#define _NBL_TESTERS_H_INCLUDED_

#include "nbl/application_templates/MonoDeviceApplication.hpp"
#include "nbl/application_templates/MonoAssetManagerAndBuiltinResourceApplication.hpp"
#include "nbl/examples/examples.hpp"

using namespace nbl;

Expand All @@ -24,7 +23,7 @@ class IntrospectionTesterBase
const std::string m_functionToTestName = "";

protected:
static std::pair<smart_refctd_ptr<ICPUShader>, smart_refctd_ptr<const CSPIRVIntrospector::CStageIntrospectionData>> compileHLSLShaderAndTestIntrospection(
static std::pair<smart_refctd_ptr<IShader>, smart_refctd_ptr<const CSPIRVIntrospector::CStageIntrospectionData>> compileHLSLShaderAndTestIntrospection(
video::IPhysicalDevice* physicalDevice, video::ILogicalDevice* device, system::ILogger* logger, asset::IAssetManager* assetMgr, const std::string& shaderPath, CSPIRVIntrospector& introspector)
{
IAssetLoader::SAssetLoadParams lp = {};
Expand All @@ -33,15 +32,18 @@ class IntrospectionTesterBase
// this time we load a shader directly from a file
auto assetBundle = assetMgr->getAsset(shaderPath, lp);
const auto assets = assetBundle.getContents();
if (assets.empty())
const auto* metadata = assetBundle.getMetadata();
if (assets.empty() || assetBundle.getAssetType() != IAsset::ET_SHADER)
{
logFail(logger, "Could not load shader!");
assert(0);
}
const auto hlslMetadata = static_cast<const CHLSLMetadata*>(metadata);
const auto shaderStage = hlslMetadata->shaderStages->front();

// It would be super weird if loading a shader from a file produced more than 1 asset
assert(assets.size() == 1);
smart_refctd_ptr<ICPUShader> source = IAsset::castDown<ICPUShader>(assets[0]);
smart_refctd_ptr<IShader> source = IAsset::castDown<IShader>(assets[0]);

smart_refctd_ptr<const CSPIRVIntrospector::CStageIntrospectionData> introspection;
{
Expand All @@ -53,8 +55,8 @@ class IntrospectionTesterBase
// The Shader Asset Loaders deduce the stage from the file extension,
// if the extension is generic (.glsl or .hlsl) the stage is unknown.
// But it can still be overriden from within the source with a `#pragma shader_stage`
options.stage = source->getStage() == IShader::E_SHADER_STAGE::ESS_COMPUTE ? source->getStage() : IShader::E_SHADER_STAGE::ESS_VERTEX; // TODO: do smth with it
options.targetSpirvVersion = device->getPhysicalDevice()->getLimits().spirvVersion;
options.stage = shaderStage == IShader::E_SHADER_STAGE::ESS_COMPUTE ? shaderStage : IShader::E_SHADER_STAGE::ESS_VERTEX; // TODO: do smth with it
options.preprocessorOptions.targetSpirvVersion = device->getPhysicalDevice()->getLimits().spirvVersion;
// we need to perform an unoptimized compilation with source debug info or we'll lose names of variable sin the introspection
options.spirvOptimizer = nullptr;
options.debugInfoFlags |= IShaderCompiler::E_DEBUG_INFO_FLAGS::EDIF_SOURCE_BIT;
Expand Down Expand Up @@ -186,7 +188,7 @@ class PredefinedLayoutTester final : public IntrospectionTesterBase
constexpr uint32_t MERGE_TEST_SHADERS_CNT = mergeTestShadersPaths.size();

CSPIRVIntrospector introspector[MERGE_TEST_SHADERS_CNT];
smart_refctd_ptr<ICPUShader> sources[MERGE_TEST_SHADERS_CNT];
smart_refctd_ptr<IShader> sources[MERGE_TEST_SHADERS_CNT];

for (uint32_t i = 0u; i < MERGE_TEST_SHADERS_CNT; ++i)
{
Expand All @@ -201,7 +203,7 @@ class PredefinedLayoutTester final : public IntrospectionTesterBase
.binding = 0,
.type = nbl::asset::IDescriptor::E_TYPE::ET_STORAGE_BUFFER,
.createFlags = ICPUDescriptorSetLayout::SBinding::E_CREATE_FLAGS::ECF_NONE,
.stageFlags = ICPUShader::E_SHADER_STAGE::ESS_COMPUTE,
.stageFlags = IShader::E_SHADER_STAGE::ESS_COMPUTE,
.count = 1,
.immutableSamplers = nullptr
}
Expand All @@ -213,15 +215,15 @@ class PredefinedLayoutTester final : public IntrospectionTesterBase
.binding = 0,
.type = nbl::asset::IDescriptor::E_TYPE::ET_STORAGE_BUFFER,
.createFlags = ICPUDescriptorSetLayout::SBinding::E_CREATE_FLAGS::ECF_NONE,
.stageFlags = ICPUShader::E_SHADER_STAGE::ESS_COMPUTE,
.stageFlags = IShader::E_SHADER_STAGE::ESS_COMPUTE,
.count = 1,
.immutableSamplers = nullptr
},
{
.binding = 1,
.type = nbl::asset::IDescriptor::E_TYPE::ET_STORAGE_BUFFER,
.createFlags = ICPUDescriptorSetLayout::SBinding::E_CREATE_FLAGS::ECF_NONE,
.stageFlags = ICPUShader::E_SHADER_STAGE::ESS_COMPUTE,
.stageFlags = IShader::E_SHADER_STAGE::ESS_COMPUTE,
.count = 2,
.immutableSamplers = nullptr
}
Expand Down Expand Up @@ -251,9 +253,9 @@ class PredefinedLayoutTester final : public IntrospectionTesterBase
bool pplnCreationSuccess[MERGE_TEST_SHADERS_CNT];
for (uint32_t i = 0u; i < MERGE_TEST_SHADERS_CNT; ++i)
{
ICPUShader::SSpecInfo specInfo;
ICPUPipelineBase::SShaderSpecInfo specInfo;
specInfo.entryPoint = "main";
specInfo.shader = sources[i].get();
specInfo.shader = sources[i];
pplnCreationSuccess[i] = static_cast<bool>(introspector[i].createApproximateComputePipelineFromIntrospection(specInfo, core::smart_refctd_ptr<ICPUPipelineLayout>(predefinedPplnLayout)));
}

Expand Down
43 changes: 26 additions & 17 deletions 03_DeviceSelectionAndSharedSources/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,20 @@
// This file is part of the "Nabla Engine".
// For conditions of distribution and use, see copyright notice in nabla.h

#include "nbl/application_templates/MonoDeviceApplication.hpp"
#include "nbl/application_templates/MonoAssetManagerAndBuiltinResourceApplication.hpp"
#include "CommonPCH/PCH.hpp"

#include "nbl/examples/examples.hpp"
// TODO: why isn't this in `nabla.h` ?
#include "nbl/asset/metadata/CHLSLMetadata.h"


using namespace nbl;
using namespace core;
using namespace system;
using namespace asset;
using namespace video;
using namespace nbl::core;
using namespace nbl::hlsl;
using namespace nbl::system;
using namespace nbl::asset;
using namespace nbl::ui;
using namespace nbl::video;
using namespace nbl::examples;

// TODO[Przemek]: update comments

Expand All @@ -21,10 +26,10 @@ using namespace video;
constexpr bool ENABLE_TESTS = false;

// This time we create the device in the base class and also use a base class to give us an Asset Manager and an already mounted built-in resource archive
class DeviceSelectionAndSharedSourcesApp final : public application_templates::MonoDeviceApplication, public application_templates::MonoAssetManagerAndBuiltinResourceApplication
class DeviceSelectionAndSharedSourcesApp final : public application_templates::MonoDeviceApplication, public BuiltinResourcesApplication
{
using device_base_t = application_templates::MonoDeviceApplication;
using asset_base_t = application_templates::MonoAssetManagerAndBuiltinResourceApplication;
using asset_base_t = BuiltinResourcesApplication;
public:
// Yay thanks to multiple inheritance we cannot forward ctors anymore
DeviceSelectionAndSharedSourcesApp(const path& _localInputCWD, const path& _localOutputCWD, const path& _sharedInputCWD, const path& _sharedOutputCWD) :
Expand Down Expand Up @@ -60,9 +65,9 @@ class DeviceSelectionAndSharedSourcesApp final : public application_templates::M
//shaderIntrospection->debugPrint(m_logger.get());

// We've now skipped the manual creation of a descriptor set layout, pipeline layout
ICPUShader::SSpecInfo specInfo;
ICPUPipelineBase::SShaderSpecInfo specInfo;
specInfo.entryPoint = "main";
specInfo.shader = source.get();
specInfo.shader = source;

smart_refctd_ptr<nbl::asset::ICPUComputePipeline> cpuPipeline = introspector.createApproximateComputePipelineFromIntrospection(specInfo);

Expand Down Expand Up @@ -236,7 +241,7 @@ class DeviceSelectionAndSharedSourcesApp final : public application_templates::M
// Whether to keep invoking the above. In this example because its headless GPU compute, we do all the work in the app initialization.
bool keepRunning() override { return false; }

std::pair<smart_refctd_ptr<ICPUShader>, smart_refctd_ptr<const CSPIRVIntrospector::CStageIntrospectionData>> compileShaderAndTestIntrospection(
std::pair<smart_refctd_ptr<IShader>, smart_refctd_ptr<const CSPIRVIntrospector::CStageIntrospectionData>> compileShaderAndTestIntrospection(
const std::string& shaderPath, CSPIRVIntrospector& introspector)
{
IAssetLoader::SAssetLoadParams lp = {};
Expand All @@ -245,15 +250,19 @@ class DeviceSelectionAndSharedSourcesApp final : public application_templates::M
// this time we load a shader directly from a file
auto assetBundle = m_assetMgr->getAsset(shaderPath, lp);
const auto assets = assetBundle.getContents();
if (assets.empty())
if (assets.empty() || assetBundle.getAssetType() != IAsset::ET_SHADER)
{
logFail("Could not load shader!");
assert(0);
}

const auto* metadata = assetBundle.getMetadata();
const auto hlslMetadata = static_cast<const CHLSLMetadata*>(metadata);
const auto shaderStage = hlslMetadata->shaderStages->front();

// It would be super weird if loading a shader from a file produced more than 1 asset
assert(assets.size() == 1);
smart_refctd_ptr<ICPUShader> source = IAsset::castDown<ICPUShader>(assets[0]);
smart_refctd_ptr<IShader> source = IAsset::castDown<IShader>(assets[0]);

smart_refctd_ptr<const CSPIRVIntrospector::CStageIntrospectionData> introspection;
{
Expand All @@ -265,8 +274,8 @@ class DeviceSelectionAndSharedSourcesApp final : public application_templates::M
// The Shader Asset Loaders deduce the stage from the file extension,
// if the extension is generic (.glsl or .hlsl) the stage is unknown.
// But it can still be overriden from within the source with a `#pragma shader_stage`
options.stage = source->getStage() == IShader::E_SHADER_STAGE::ESS_COMPUTE ? source->getStage() : IShader::E_SHADER_STAGE::ESS_VERTEX; // TODO: do smth with it
options.targetSpirvVersion = m_device->getPhysicalDevice()->getLimits().spirvVersion;
options.stage = shaderStage == IShader::E_SHADER_STAGE::ESS_COMPUTE ? shaderStage : IShader::E_SHADER_STAGE::ESS_VERTEX; // TODO: do smth with it
options.preprocessorOptions.targetSpirvVersion = m_device->getPhysicalDevice()->getLimits().spirvVersion;
// we need to perform an unoptimized compilation with source debug info or we'll lose names of variable sin the introspection
options.spirvOptimizer = nullptr;
options.debugInfoFlags |= IShaderCompiler::E_DEBUG_INFO_FLAGS::EDIF_SOURCE_BIT;
Expand All @@ -277,7 +286,7 @@ class DeviceSelectionAndSharedSourcesApp final : public application_templates::M
options.preprocessorOptions.includeFinder = compilerSet->getShaderCompiler(source->getContentType())->getDefaultIncludeFinder();

auto spirvUnspecialized = compilerSet->compileToSPIRV(source.get(), options);
const CSPIRVIntrospector::CStageIntrospectionData::SParams inspctParams = { .entryPoint = "main", .shader = spirvUnspecialized };
const CSPIRVIntrospector::CStageIntrospectionData::SParams inspctParams = { .entryPoint = "main", .shader = spirvUnspecialized, .stage = shaderStage };

introspection = introspector.introspect(inspctParams);
introspection->debugPrint(m_logger.get());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ template<typename capability_traits=nbl::hlsl::jit::device_capabilities_traits>
void dummyTraitTest() {}

[numthreads(WorkgroupSize,1,1)]
[shader("compute")]
void main(uint32_t3 ID : SV_DispatchThreadID)
{
dummyTraitTest();
Expand Down
23 changes: 10 additions & 13 deletions 05_StreamingAndBufferDeviceAddressApp/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

// I've moved out a tiny part of this example into a shared header for reuse, please open and read it.
#include "nbl/application_templates/MonoDeviceApplication.hpp"
#include "nbl/application_templates/MonoAssetManagerAndBuiltinResourceApplication.hpp"
#include "nbl/examples/common/BuiltinResourcesApplication.hpp"


using namespace nbl;
Expand All @@ -20,10 +20,10 @@ using namespace video;


// In this application we'll cover buffer streaming, Buffer Device Address (BDA) and push constants
class StreamingAndBufferDeviceAddressApp final : public application_templates::MonoDeviceApplication, public application_templates::MonoAssetManagerAndBuiltinResourceApplication
class StreamingAndBufferDeviceAddressApp final : public application_templates::MonoDeviceApplication, public examples::BuiltinResourcesApplication
{
using device_base_t = application_templates::MonoDeviceApplication;
using asset_base_t = application_templates::MonoAssetManagerAndBuiltinResourceApplication;
using asset_base_t = examples::BuiltinResourcesApplication;

// This is the first example that submits multiple workloads in-flight.
// What the shader does is it computes the minimum distance of each point against K other random input points.
Expand Down Expand Up @@ -91,7 +91,7 @@ class StreamingAndBufferDeviceAddressApp final : public application_templates::M
return false;

// this time we load a shader directly from a file
smart_refctd_ptr<IGPUShader> shader;
smart_refctd_ptr<IShader> shader;
{
IAssetLoader::SAssetLoadParams lp = {};
lp.logger = m_logger.get();
Expand All @@ -102,23 +102,19 @@ class StreamingAndBufferDeviceAddressApp final : public application_templates::M
return logFail("Could not load shader!");

// lets go straight from ICPUSpecializedShader to IGPUSpecializedShader
auto source = IAsset::castDown<ICPUShader>(assets[0]);
const auto shaderSource = IAsset::castDown<IShader>(assets[0]);
shader = m_device->compileShader({shaderSource.get()});
// The down-cast should not fail!
assert(source);

// this time we skip the use of the asset converter since the ICPUShader->IGPUShader path is quick and simple
shader = m_device->createShader(source.get());
if (!shader)
return logFail("Creation of a GPU Shader to from CPU Shader source failed!");
assert(shader);
}

// The StreamingTransientDataBuffers are actually composed on top of another useful utility called `CAsyncSingleBufferSubAllocator`
// The difference is that the streaming ones are made on top of ranges of `IGPUBuffer`s backed by mappable memory, whereas the
// `CAsyncSingleBufferSubAllocator` just allows you suballocate subranges of any `IGPUBuffer` range with deferred/latched frees.
constexpr uint32_t DownstreamBufferSize = sizeof(output_t)<<23;
constexpr uint32_t UpstreamBufferSize = sizeof(input_t)<<23;

m_utils = make_smart_refctd_ptr<IUtilities>(smart_refctd_ptr(m_device),smart_refctd_ptr(m_logger),DownstreamBufferSize,UpstreamBufferSize);
m_utils = IUtilities::create(smart_refctd_ptr(m_device),smart_refctd_ptr(m_logger),DownstreamBufferSize,UpstreamBufferSize);
if (!m_utils)
return logFail("Failed to create Utilities!");
m_upStreamingBuffer = m_utils->getDefaultUpStreamingBuffer();
Expand All @@ -139,6 +135,7 @@ class StreamingAndBufferDeviceAddressApp final : public application_templates::M
IGPUComputePipeline::SCreationParams params = {};
params.layout = layout.get();
params.shader.shader = shader.get();
params.shader.entryPoint = "main";
if (!m_device->createComputePipelines(nullptr,{&params,1},&m_pipeline))
return logFail("Failed to create compute pipeline!\n");
}
Expand Down
20 changes: 11 additions & 9 deletions 06_HelloGraphicsQueue/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,20 @@
// For conditions of distribution and use, see copyright notice in nabla.h


// I've moved out a tiny part of this example into a shared header for reuse, please open and read it.
#include "nbl/application_templates/MonoDeviceApplication.hpp"
#include "nbl/application_templates/MonoAssetManagerAndBuiltinResourceApplication.hpp"
#include "nbl/examples/examples.hpp"

#include "nbl/ext/ScreenShot/ScreenShot.h"


using namespace nbl;
using namespace core;
using namespace system;
using namespace asset;
using namespace video;
using namespace nbl::core;
using namespace nbl::hlsl;
using namespace nbl::system;
using namespace nbl::asset;
using namespace nbl::ui;
using namespace nbl::video;
using namespace nbl::examples;


// Here we showcase the use of Graphics Queue only
// Steps we take in this example:
Expand All @@ -26,10 +28,10 @@ using namespace video;
// - save the smallImg to disk
//
// all without using IUtilities.
class HelloGraphicsQueueApp final : public application_templates::MonoDeviceApplication, public application_templates::MonoAssetManagerAndBuiltinResourceApplication
class HelloGraphicsQueueApp final : public application_templates::MonoDeviceApplication, public BuiltinResourcesApplication
{
using device_base_t = application_templates::MonoDeviceApplication;
using asset_base_t = application_templates::MonoAssetManagerAndBuiltinResourceApplication;
using asset_base_t = BuiltinResourcesApplication;

public:
// Yay thanks to multiple inheritance we cannot forward ctors anymore.
Expand Down
6 changes: 0 additions & 6 deletions 06_MeshLoaders/CMakeLists.txt

This file was deleted.

Loading