diff options
| author | ArielG-NV <159081215+ArielG-NV@users.noreply.github.com> | 2024-03-15 16:14:32 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-15 16:14:32 -0400 |
| commit | 9b434e50f02f9ec02ce230de9042ce7448bae451 (patch) | |
| tree | 092aaecc785047a8005462764404f9c530e3a69c /source/slang/slang-emit.cpp | |
| parent | 9ee88a43f4e67d9c714c27bf968401b6bf7524af (diff) | |
Implement raytracing extension(s); resolves #3560 for GLSL & SPIR-V targets (#3675)
The following PR implements raytracing extensions (GLSL_EXT_ray_tracing, GLSL_EXT_ray_query, GLSL_NV_shader_invocation_reorder & GLSL_NV_ray_tracing_motion_blur); for GLSL & SPIR-V targets. Fully implements all functions, built-in variables, & syntax; resolves #3560 for GLSL & SPIR-V Targets.
notes of worth:
* __rayPayloadFromLocation, __rayAttributeFromLocation, and __rayCallableFromLocation, were added as SPIR-V Intrinsics to refer to location's of raytracing objects in SPIR-V for when using GLSL syntax.
Diffstat (limited to 'source/slang/slang-emit.cpp')
| -rw-r--r-- | source/slang/slang-emit.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source/slang/slang-emit.cpp b/source/slang/slang-emit.cpp index 43f54d04f..ee38996e6 100644 --- a/source/slang/slang-emit.cpp +++ b/source/slang/slang-emit.cpp @@ -17,6 +17,7 @@ #include "slang-ir-defunctionalization.h" #include "slang-ir-dll-export.h" #include "slang-ir-dll-import.h" +#include "slang-ir-early-raytracing-intrinsic-simplification.h" #include "slang-ir-eliminate-phis.h" #include "slang-ir-eliminate-multilevel-break.h" #include "slang-ir-entry-point-uniforms.h" @@ -242,7 +243,7 @@ Result linkAndOptimizeIR( // If the user specified the flag that they want us to dump // IR, then do it here, for the target-specific, but // un-specialized IR. - dumpIRIfEnabled(codeGenContext, irModule); + dumpIRIfEnabled(codeGenContext, irModule, "POST IR VALIDATION"); if(!isKhronosTarget(targetRequest)) lowerGLSLShaderStorageBufferObjectsToStructuredBuffers(irModule, sink); @@ -1038,6 +1039,9 @@ Result linkAndOptimizeIR( } } + replaceLocationIntrinsicsWithRaytracingObject(targetProgram, irModule, sink); + validateIRModuleIfEnabled(codeGenContext, irModule); + // Run a final round of simplifications to clean up unused things after phi-elimination. simplifyNonSSAIR(targetProgram, irModule, IRSimplificationOptions::getFast()); |
