summaryrefslogtreecommitdiff
path: root/tests/hlsl-intrinsic/shader-execution-reordering
AgeCommit message (Collapse)Author
2025-09-02render-test: Change D3D12 default to sm_6_5 (#8320)James Helferty (NVIDIA)
Changes default for render-test to sm_6_5. Since sm_6_5 is the new default, remove the -use-dxil option, add -use-dxcb option Remove -use-dxil option from all test cases. Add -use-dxcb to two tests that needed it. Fixes #7611
2025-05-27Add LSS intrinsics (#7200)Mukund Keshava
* WiP: LSS intrinsics: initial commit * format code * Fix CI failures * Address review comment --------- Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
2025-05-26Implement shader execution reordering support for OptiX (#7211)Harsh Aggarwal (NVIDIA)
* Implement shader execution reordering support for OptiX Added OptiX backend support for Shader Execution Reordering (SER) features as outlined in issue #6647. This implementation: 1. Added CUDA target support for HitObject API 2. Implemented core SER functionality (TraceRay, MakeHit/Miss, Invoke) 3. Added OptiX-specific hit object handling functions 4. Added test case for OptiX SER functionality * format code --------- Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
2025-05-12cluster acceleration structure optix 6431 (#7028)Harsh Aggarwal (NVIDIA)
* Add cluster geometry intrinsics for ray tracing - Added GetClusterID() method to HitObject class - Added CandidateClusterID() and CommittedClusterID() methods to RayQuery class - Added SPV_NV_cluster_acceleration_structure extension support - Added GL_NV_cluster_acceleration_structure extension support - Added test files for RayQuery and HitObject cluster methods Fixes #6431 * OpRayQueryGetIntersectionClusterIdNV - unrecognized spirv Disabling spirv backend for SPV_NV_cluster_acceleration_structure hlsl.meta.slang(18674): error 29100: unrecognized spirv opcode: OpRayQueryGetIntersectionClusterIdNV result:$$int = OpRayQueryGetIntersectionClusterIdNV &this $iCandidateOrCommitted; ^~~~~~ hlsl.meta.slang(18670): error 30019: expected an expression of type 'int', got 'void' return spirv_asm ^~~~~~~~~ ninja: build stopped: subcommand failed. * 6431 - Fix spirv opcode * Remove tests * Add relevant tests * Review - Simplify tests
2024-03-15Implement raytracing extension(s); resolves #3560 for GLSL & SPIR-V targets ↵ArielG-NV
(#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.
2023-10-02Add SPIRV intrinsics for ShaderExecutionReordering and RW/Buffer. (#3252)Yong He
* Add SPIRV intrinsics for ShaderExecutionReordering. * Add intrinsics for `Buffer` and `RWBuffer`. * Various spirv fixes. * Marshal bool vector type. * Inline global constants + OpFOrdNotEqual->OpFUnordNotEqual. * Fix. --------- Co-authored-by: Yong He <yhe@nvidia.com>
2023-09-03Proper lowering of functiosn that returns NonCopyable values. (#3179)Yong He
* Proper lowering of functiosn that returns NonCopyable values. * Fix tests. * Fix clang errors. * Fix. * Fix clang error. --------- Co-authored-by: Yong He <yhe@nvidia.com>
2023-09-01Fix GLSL code gen around RayQuery and HitObject types. (#3173)Yong He
* Update slang-llvm. * Fix. * fix. * Fix unit tests for multi-thread execution. * Fix tests. * fixes. * update tests. * Add gfx-smoke to linux expected failure list. * Try fix test. --------- Co-authored-by: Yong He <yhe@nvidia.com>
2023-08-31Inline all RayQuery/HitObject typed functions when targeting GLSL. (#3172)Yong He
* Inline all RayQuery/HitObject typed functions when targeting GLSL. * update test. --------- Co-authored-by: Yong He <yhe@nvidia.com>
2023-08-21Compile append and consume structured buffers to glsl. (#3142)Yong He
* Compile append and consume structured buffers to glsl. * Fix. * Update CI config. --------- Co-authored-by: Yong He <yhe@nvidia.com>
2023-08-16Simplify IfElse instructions with a single trivial block (#3114)Ellie Hermaszewska
2023-08-14Support per field matrix layout (#3101)Yong He
* Support per field matrix layout * Fix warnings. * Fix. * Fix tests. * Fix spiv gen. * Fix. * More test fixes. * Fix. * Run only GPU tests on self-hosted servers. * Remove -use-glsl-matrix-layout-modifier. * Fix. --------- Co-authored-by: Yong He <yhe@nvidia.com>
2023-08-09Support implciit casted swizzled lvalue. (#3077)Yong He
* Support implciit casted swizzled lvalue. * Fix warnings. * Fix. * fix comment. * Prefer mangled linkage name for global params. * Update tests. --------- Co-authored-by: Yong He <yhe@nvidia.com>
2023-07-12Use scratchData on `IRInst` to replace HashSets. (#2978)Yong He
* Use scratchData on `IRInst` to replace HashSets. * Update test results. * Initialize scratchData. * Update autodiff documentation. * Use enum instead of bool. --------- Co-authored-by: Yong He <yhe@nvidia.com>
2023-06-13Fixes for Shader Execution Reordering on VK (#2929)Theresa Foley
* Fixes for Shader Execution Reordering on VK There are some mismatches between the way that hit objects are handled between the current NVAPI/HLSL and proposed GLSL extensions for shader execution reordering. These mismatches create complications for generating valid GLSL/SPIR-V code from input Slang. Many of the problems that apply to `HitObject` also apply to the existing `RayQuery<>` type used for "inline" ray tracing. In the case of `RayQuery<>` we have that for *both* HLSL and GLSL/SPIR-V: * A `RayQuery` (or `rayQueryEXT`) is an opaque handle to underlying mutable storage * The storage that backs a `RayQuery` is allocated as part of the "defualt constructor" for a local variable declared with type `RayQuery`. * The `RayQuery` API provides numerous operations that mutate the storage referred to by the opaque handle. The key difference between HLSL and GLSL/SPIR-V for the case of a `RayQuery` amounts to: * In HLSL, local variables of type `RayQuery` can be assigned to, and assignment has by-reference semantics. It is possible to create multiple aliased handles to the same underlying storage. * In GLSL/SPIR-V, local variables of type `rayQueryEXT` cannot be assigned to, returned from functions, etc. It is impossible to create multiple aliased handles to the same underlying storage. The case for `HitObject`s is signicantly *more* messy, because: * In NVAPI/HLSL a `HitObject` is effectively a "value type" in that it only exposes constructors, and there is no way to mutate the state of a `HitObject` other than by assignment to a variable of that type. It makes no semantic difference whether a `HitObject` directly stores the value(s), or if it is a handle, since there is no way to introduce aliasing of mutable state. Assignment of `HitObject`s semantically creates a copy. * In GLSL/SPIR-V, a `hitObjectNV` is, like a `rayQueryEXT`, a handle to underlying mutable state. These handles cannot be assigned, returned from functions, etc. There is no way to make a copy of a hit object. This change includes several changes to how *both* `RayQuery<>` and `HitObject` are implemented, with the intention of getting more cases to work correctly when compiling for GLSL/SPIR-V, and to set up a more clear mental model for the semantics we want to give to these types in Slang, and how those semantics can/should map to our targets. An overview of important changes: * Marked a few operations on `RayQuery` as `[mutating]` that realistically should have already been that way. * Marked the `HitObject` type as being non-copyable (an attribute we do not currently enforce), and marked the various GLSL operations that construct a hit object as having an `out` parameter of the `HitObject` type (even if they are nominally specified in GLSL as not writing to the correspondign parameter). * Added a distinct IR opcode (`allocateOpaqueHandle`) to represent the implicit allocation that happens when declaring a variable of type `HitObject` or `RayQuery`, and made the "implicit constructor" for those types map to the new op. This operation took a lot of tweaking to get emitting in a reasonable way, and I'm still not 100% sure that all of the emission-related logic for it is strictly required (or correct). * Added new IR instructions for `HitObject` and `RayQuery` types, and made the stdlib types map to those IR instructions. * Treat `HitObject` and `RayQuery` as resource types for the purpose of our existing pass that specializes calls to functions that have outputs of resource type * Added a new test case that includes a function that returns a `HitObject` as its result. * Many test cases saw slight changes in their output (especially around the relative ordering of declarations of `HitObject`s and `RayQuery`s with other instructions) * Remove debugging logic
2023-04-26For C-like targets, emit resource declarations before other globals (#2843)Sai Praveen Bangaru
* For C-like targets, emit resource declarations before other globals * Remove unused tests
2023-03-23Fix optimization pass not converging. (#2725)Yong He
* Fix optimization pass not converging. * Fix. * Fix tests. --------- Co-authored-by: Yong He <yhe@nvidia.com>
2023-02-24More control flow simplifications. (#2673)Yong He
* More control flow and Phi param simplifications. * Fix. * Fix gcc error. * Fix. * More IR cleanup. * Fix bug in phi param dce + ifelse simplify. * Propagate and DCE side-effect-free functions. * Enhance CFG simplifcation to remove loops with no side effects. * Fix. * Fixes. * Fix tests. Add [__AlwaysFoldIntoUseSite] for rayPayloadLocation. * More cleanup. * Fixes. * Fix. --------- Co-authored-by: Yong He <yhe@nvidia.com>
2023-02-16Overhaul global inst deduplication and cpp/cuda backend. (#2654)Yong He
* Overhaul global inst deduplication and cpp/cuda backend. * Update IR documentation. --------- Co-authored-by: Yong He <yhe@nvidia.com>
2023-02-07Arithmetic simplifications and more IR clean up logic. (#2632)Yong He
2023-01-27Register allocation during phi elimination. (#2613)Yong He
* Register allocation during phi elimination. * Enhance the test case. * Cleanup line breaks in test case. * remove unncessary line break changes. * More cleanups. --------- Co-authored-by: Yong He <yhe@nvidia.com>
2023-01-23Full address insts elimination for backward autodiff. (#2604)Yong He
Co-authored-by: Yong He <yhe@nvidia.com>
2022-12-07Lower-to-ir no longer produce `Construct` inst. (#2553)Yong He
Co-authored-by: Yong He <yhe@nvidia.com>
2022-11-18Small fixes around SER on VK (#2522)jsmall-nvidia
* #include an absolute path didn't work - because paths were taken to always be relative. * Fixes for Shader Execution Reordering for VK based on testing via GLSLANG with SER support. * Update test results with SER VK fixes.
2022-11-15Shader Execution Reordering for VK (#2491)jsmall-nvidia
* #include an absolute path didn't work - because paths were taken to always be relative. * Fixes around MakeMiss. * Add preliminary support for HitObject::MakeHit. * Make Nop. * Add HitObject::TraceRay. * HitObject::Invoke for VK. * Remove line numbers from SER GLSL output. * Add support for HitObjectAttributes Add support for GLSL HitObject.GetAttributes<T>() Simplified code around getting locations. * Be more explicit about requiring GL_EXT_ray_tracing in SER. * Split out LocationTracker from CLikeEmitter. * Small doc improvements. * Add motion ray support. * Use inlining to get correct GLSL behavior around hitObjectNV. * Add assignment HitObject test. * Add a HitObject array test. Shows doesn't work correctly for VK/GLSL. * Add call to `hitObjectGetAttributesNV` before getting attributes.
2022-11-15Specify downstream compiler include paths (#2517)jsmall-nvidia
* #include an absolute path didn't work - because paths were taken to always be relative. * WIP around testing with NVAPI. * Make -I work for downstream compilers. Update docs. * Small improvement around ignoring tests.
2022-11-03Shader Execution Reordering without HLSL2021 (#2489)jsmall-nvidia
* #include an absolute path didn't work - because paths were taken to always be relative. * Disable SER tests and enabling HLSL2021 by default. * Small typos fix. Improve SER coverage in testing. * Fix typo.
2022-11-03Disable HLSL2021 by default (#2488)jsmall-nvidia
* #include an absolute path didn't work - because paths were taken to always be relative. * Disable SER tests and enabling HLSL2021 by default.
2022-11-02Shader Execution Reordering (via NVAPI) (#2484)jsmall-nvidia
* #include an absolute path didn't work - because paths were taken to always be relative. * Preliminary SER NVAPI support. * Set the DXC compiler version. Fix typo in premake5.lua * Improve DXC version detection. Enable HLSL2021 on late enough version of DXC. * Fix typo. * Fix launch. * Test via DXIL output. * Update dxc-error output.