diff options
| author | Yong He <yonghe@outlook.com> | 2024-08-28 22:27:23 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-08-28 22:27:23 -0700 |
| commit | 7893b4534a1034a001fd7670f3a2ad6d1db66bad (patch) | |
| tree | cd69a185a12bba9f8f9f96ad204745758557a2b6 /source | |
| parent | 69e0f878e02d61280110b379f9d346acde7575a8 (diff) | |
Add `ReportIntersectionOptix` for optix. (#4949)
Diffstat (limited to 'source')
| -rw-r--r-- | source/slang/hlsl.meta.slang | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/source/slang/hlsl.meta.slang b/source/slang/hlsl.meta.slang index 21cb9ef18..10a6254c1 100644 --- a/source/slang/hlsl.meta.slang +++ b/source/slang/hlsl.meta.slang @@ -15881,6 +15881,20 @@ bool ReportHit(float tHit, uint hitKind, A attributes) } } +__generic<each T : __BuiltinIntegerType> +[ForceInline] +[require(cuda_glsl_hlsl_spirv, raytracing_intersection)] +bool ReportHitOptix(float tHit, uint hitKind, expand each T attribs) +{ + __target_switch + { + case cuda: + __intrinsic_asm "optixReportIntersection"; + default: + return ReportHit(tHit, hitKind, makeTuple(expand each attribs)); + } +} + // 10.3.4 [require(cuda_glsl_hlsl_spirv, raytracing_anyhit)] void IgnoreHit() |
