-
Notifications
You must be signed in to change notification settings - Fork 17
Precompile and cache EX31 path tracer variants #262
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
AnastaZIuk
wants to merge
35
commits into
master
Choose a base branch
from
unroll
base: master
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 28 commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
adf0db4
Restore EX31 precompiled shader flow
AnastaZIuk 13f0920
Reorganize EX31 precompiled shader variants
AnastaZIuk 6fec0e4
Add EX31 pipeline cache and warmup
AnastaZIuk 25d3f00
Improve path tracer startup and UI
AnastaZIuk 3b9b2f3
Fix path tracer debug warmup
AnastaZIuk f966e19
Add path tracer build mode switch
AnastaZIuk 6b5ff68
Polish path tracer diagnostics
AnastaZIuk 200cb4a
Trim trailing whitespace
AnastaZIuk b78500c
Clarify path tracer build mode comment
AnastaZIuk 1a64e82
Persist path tracer validation markers
AnastaZIuk db1e1cf
Polish path tracer cache layout
AnastaZIuk 20587db
Refine path tracer cleanup
AnastaZIuk 764d4ef
Compact path tracer variant payload
AnastaZIuk 9215e38
Trim path tracer example boilerplate
AnastaZIuk 4a68db6
Remove dead path tracer shader roots
AnastaZIuk 704ef5f
Use argparse in EX31 startup
AnastaZIuk 3fd1ae6
Use generated keys header in EX31
AnastaZIuk bfaa4a2
Fix EX31 generated keys usage
AnastaZIuk 615ae45
Align EX31 NSC rule usage
AnastaZIuk caaf16c
Fix EX31 generated keys include seam
AnastaZIuk 079b6e4
Use standard EX31 generated keys seam
AnastaZIuk fc1ae32
Fix EX31 generated keys wrapper seam
AnastaZIuk 8424767
Fix EX31 NSC include usage
AnastaZIuk 018757b
Simplify EX31 NSC rule usage
AnastaZIuk a3ef360
Seed EX31 trimmer validation cache
AnastaZIuk 339cb3e
Wire EX31 NSC rule dependencies
AnastaZIuk 04863f9
Restore EX31 NSC direct include usage
AnastaZIuk 7b6c154
Refine EX31 CMake helpers
AnastaZIuk 520e26f
Simplify EX31 precompiled variants
AnastaZIuk 7e0e7f9
Address EX31 review feedback locally
AnastaZIuk 7c0858b
Commonize EX31 cached pipeline state
AnastaZIuk 6b05636
Rename common cached pipeline seam
AnastaZIuk d50719c
Use system include workaround for builtin roots
AnastaZIuk 2d663f5
Merge remote-tracking branch 'origin/master' into unroll
AnastaZIuk 887100f
Merge remote-tracking branch 'origin/master' into unroll
AnastaZIuk 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
62 changes: 62 additions & 0 deletions
62
31_HLSLPathTracer/app_resources/hlsl/compute.render.common.hlsl
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,62 @@ | ||
| #ifndef PATH_TRACER_USE_RWMC | ||
| #error PATH_TRACER_USE_RWMC must be defined before including compute.render.common.hlsl | ||
| #endif | ||
|
|
||
| #ifndef PATH_TRACER_ENABLE_LINEAR | ||
| #define PATH_TRACER_ENABLE_LINEAR 1 | ||
| #endif | ||
|
|
||
| #ifndef PATH_TRACER_ENABLE_PERSISTENT | ||
| #define PATH_TRACER_ENABLE_PERSISTENT 1 | ||
| #endif | ||
|
|
||
| #if !PATH_TRACER_ENABLE_LINEAR && !PATH_TRACER_ENABLE_PERSISTENT | ||
| #error At least one path tracer entrypoint mode must be enabled | ||
| #endif | ||
|
|
||
| #include "nbl/builtin/hlsl/cpp_compat.hlsl" | ||
| #include "nbl/builtin/hlsl/glsl_compat/core.hlsl" | ||
| #include "nbl/builtin/hlsl/random/pcg.hlsl" | ||
| #include "nbl/builtin/hlsl/random/xoroshiro.hlsl" | ||
| #if PATH_TRACER_ENABLE_PERSISTENT | ||
| #include "nbl/builtin/hlsl/morton.hlsl" | ||
| #endif | ||
| #include "nbl/builtin/hlsl/bxdf/reflection.hlsl" | ||
| #include "nbl/builtin/hlsl/bxdf/transmission.hlsl" | ||
| #include "nbl/builtin/hlsl/path_tracing/basic_ray_gen.hlsl" | ||
| #include "nbl/builtin/hlsl/path_tracing/unidirectional.hlsl" | ||
| #include "render_common.hlsl" | ||
|
|
||
| #if PATH_TRACER_USE_RWMC | ||
| #include "nbl/builtin/hlsl/rwmc/CascadeAccumulator.hlsl" | ||
| #include "render_rwmc_common.hlsl" | ||
| #else | ||
| #include "nbl/builtin/hlsl/path_tracing/default_accumulator.hlsl" | ||
| #endif | ||
|
|
||
| #if PATH_TRACER_USE_RWMC | ||
| [[vk::push_constant]] RenderRWMCPushConstants pc; | ||
| #else | ||
| [[vk::push_constant]] RenderPushConstants pc; | ||
| #endif | ||
|
|
||
| [[vk::combinedImageSampler]] [[vk::binding(0, 0)]] Texture2D<float3> envMap; | ||
| [[vk::combinedImageSampler]] [[vk::binding(0, 0)]] SamplerState envSampler; | ||
|
|
||
| [[vk::combinedImageSampler]] [[vk::binding(1, 0)]] Texture2D<uint2> scramblebuf; | ||
| [[vk::combinedImageSampler]] [[vk::binding(1, 0)]] SamplerState scrambleSampler; | ||
|
|
||
| [[vk::image_format("rgba16f")]] [[vk::binding(2, 0)]] RWTexture2DArray<float32_t4> outImage; | ||
|
|
||
| #if PATH_TRACER_USE_RWMC | ||
| [[vk::image_format("rgba16f")]] [[vk::binding(3, 0)]] RWTexture2DArray<float32_t4> cascade; | ||
| #endif | ||
|
|
||
| #include "example_common.hlsl" | ||
| #include "rand_gen.hlsl" | ||
| #include "intersector.hlsl" | ||
| #include "material_system.hlsl" | ||
| #include "next_event_estimator.hlsl" | ||
|
|
||
| using namespace nbl; | ||
| using namespace hlsl; |
25 changes: 25 additions & 0 deletions
25
31_HLSLPathTracer/app_resources/hlsl/compute.render.linear.entrypoints.hlsl
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,25 @@ | ||
| #ifndef PATH_TRACER_ENTRYPOINT_NAME | ||
| #define PATH_TRACER_ENTRYPOINT_NAME main | ||
| #endif | ||
|
|
||
| #ifndef PATH_TRACER_ENTRYPOINT_POLYGON_METHOD | ||
| #ifdef PATH_TRACER_RUNTIME_POLYGON_METHOD | ||
| #define PATH_TRACER_ENTRYPOINT_POLYGON_METHOD PATH_TRACER_RUNTIME_POLYGON_METHOD | ||
| #else | ||
| #define PATH_TRACER_ENTRYPOINT_POLYGON_METHOD PPM_APPROX_PROJECTED_SOLID_ANGLE | ||
| #endif | ||
| #endif | ||
|
|
||
| #if !PATH_TRACER_ENABLE_LINEAR | ||
| #error Linear entrypoint requested while PATH_TRACER_ENABLE_LINEAR is disabled | ||
| #endif | ||
|
|
||
| [numthreads(RenderWorkgroupSize, 1, 1)] | ||
| [shader("compute")] | ||
| void PATH_TRACER_ENTRYPOINT_NAME(uint32_t3 threadID : SV_DispatchThreadID) | ||
| { | ||
| pathtracer_render_variant::runLinear(threadID, PATH_TRACER_ENTRYPOINT_POLYGON_METHOD); | ||
| } | ||
|
|
||
| #undef PATH_TRACER_ENTRYPOINT_POLYGON_METHOD | ||
| #undef PATH_TRACER_ENTRYPOINT_NAME |
25 changes: 25 additions & 0 deletions
25
31_HLSLPathTracer/app_resources/hlsl/compute.render.persistent.entrypoints.hlsl
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,25 @@ | ||
| #ifndef PATH_TRACER_ENTRYPOINT_NAME | ||
| #define PATH_TRACER_ENTRYPOINT_NAME mainPersistent | ||
| #endif | ||
|
|
||
| #ifndef PATH_TRACER_ENTRYPOINT_POLYGON_METHOD | ||
| #ifdef PATH_TRACER_RUNTIME_POLYGON_METHOD | ||
| #define PATH_TRACER_ENTRYPOINT_POLYGON_METHOD PATH_TRACER_RUNTIME_POLYGON_METHOD | ||
| #else | ||
| #define PATH_TRACER_ENTRYPOINT_POLYGON_METHOD PPM_APPROX_PROJECTED_SOLID_ANGLE | ||
| #endif | ||
| #endif | ||
|
|
||
| #if !PATH_TRACER_ENABLE_PERSISTENT | ||
| #error Persistent entrypoint requested while PATH_TRACER_ENABLE_PERSISTENT is disabled | ||
| #endif | ||
|
|
||
| [numthreads(RenderWorkgroupSize, 1, 1)] | ||
| [shader("compute")] | ||
| void PATH_TRACER_ENTRYPOINT_NAME(uint32_t3 threadID : SV_DispatchThreadID) | ||
| { | ||
| pathtracer_render_variant::runPersistent(PATH_TRACER_ENTRYPOINT_POLYGON_METHOD); | ||
| } | ||
|
|
||
| #undef PATH_TRACER_ENTRYPOINT_POLYGON_METHOD | ||
| #undef PATH_TRACER_ENTRYPOINT_NAME | ||
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.
why not just make a
Configstruct withNBL_CONSTEXPR_STATIC_INLINEmembers and then we don't need to change definitions, so: