diff options
| author | Tim Foley <tfoleyNV@users.noreply.github.com> | 2018-11-12 09:57:46 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-11-12 09:57:46 -0800 |
| commit | 039c233d9e4617ba9edd702a8275df0837ca8365 (patch) | |
| tree | 75d22b74eb2e163bf5d57dc1a202b1b90aba10bd /source/slang/options.cpp | |
| parent | c07f60af241b1b0f7b7eba62c65d9fe750f8f3b7 (diff) | |
Add callable shader support for Vulkan ray tracing (#718)
* Add callable shader support for Vulkan ray tracing
This change extends the previous work to update Vulkan ray tracing support for the finished `GL_NV_ray_tracing` spec.
One of the features missing in the experimental extension that was added to the final spec is "callable shaders," which allow ray tracing shaders to call other shaders as general-purpose subroutines.
Most of the implementation work here mirrors what was done for the `TraceRay()` function to map it to `traceNV()`.
We map the generic `CallShader<P>` function to the non-generic `executeCallableNV`, with a payload identifier that indicates a specific global variable of type `P` (the global variable being generated from a `static` local in `CallShader`). A new modifier is added to identify the payload structure, and the parameter binding/layout logic introduces a new resource kind for callable-shader payload data (where previously the logic had assumed ray and callable payloads should use the same resource kind).
Two test shaders are included: one for the callable shader (`callable.slang`) and one for a ray generation shader that calls it (`callable-caller.slang`). Just for kicks, the payload data type is defined in a shared file so that we can be sure the two agree (trying to emulate what might be good practice, and ensure that ray tracing support works together with other Slang mechanisms).
* Typo fix: assocaited->associated
One instance was found in review, but I went ahead and fixed a bunch since I seem to make this typo a lot.
* Typo fix: defintiion->definition
Diffstat (limited to 'source/slang/options.cpp')
| -rw-r--r-- | source/slang/options.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/slang/options.cpp b/source/slang/options.cpp index 9f65d0e5c..f1a5798ce 100644 --- a/source/slang/options.cpp +++ b/source/slang/options.cpp @@ -103,7 +103,7 @@ struct OptionsParser // An entry point represents a function to be checked and possibly have // code generated in one of our translation units. An entry point - // needs to have an assocaited stage, which might come via the + // needs to have an associated stage, which might come via the // `-stage` command line option, or a `[shader("...")]` attribute // in the source code. // @@ -1176,7 +1176,7 @@ struct OptionsParser // need to support output formats that can store multiple // entry points in one file). - // If an output doesn't have a target assocaited with + // If an output doesn't have a target associated with // it, then search for the target with the matching format. if( rawOutput.targetIndex == -1 ) { |
