summaryrefslogtreecommitdiffstats
path: root/tools
Commit message (Collapse)AuthorAge
...
* Migrate render-test away from deprecated compile request API (#6514)Anders Leino2025-03-12
| | | | | | | | | | | | | | | | | | * Add a simple interface parameter test Since there's no documentation, it's nice to have a simple test case in order to experiment with this feature of the testing framework. * Add shader entry point attributes to tests * Fix specialization arguments for tests - Add some missing arguments - Rremove one extraneous argument. * Stop using deprecated compile request in render-test Use a session object instead of the deprecated compile request object. This closes issue #4760.
* Don't crash when precompiling twice (#6576)cheneym22025-03-11
| | | | | Abort precompileForTarget if it's already done. Fixes #6516
* Add missing error check (#6570)cheneym22025-03-11
| | | Bail from test if shader doesn't compile.
* Support SPIR-V deferred linking option (#6500)cheneym22025-03-05
| | | | | | | | | | | | | | | | | | | | | | | The new option "SkipDownstreamLinking" will defer final downstream IR linking to the user application. This option only has an effect if there are modules that were precompiled to the target IR using precompileForTarget(). Until now, the default behavior for SPIR-V was to use deferred linking, and the default behavior for DXIL was to use immediate/internal linking in Slang. This change only affects the SPIR-V behavior such that both deferred and non-deferred linking is supported based on the new option. To support the non-deferred option, Slang will internally call into SPIRV-Tools-link to reconstitute a complete SPIR-V shader program when necessary (due to modules having been precompiled to target IR). Otherwise, if SkipDownstreamLinking is enabled, the shader returned by e.g. getTargetCode() or getEntryPointCode() may have import linkage to the SPIR-V embedded in the constituent modules. Closes #4994 Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
* Fix codegen bug when targeting PTX with new API (#6506)Anders Leino2025-03-05
| | | | | | | | | | | | | | | | | | | | | | * Add cuda codegen bug repro This just compiles tests/compute/simlpe.slang for PTX with the new compilation API, in order to reproduce a code generation bug. * Detect entrypoint more robustly when applying ConstRef hack during lowring For shaders like tests/compute/simple.slang, which have a 'numthreads' attribute but no 'shader' attribute, the old compile request API would add an EntryPointAttribute to the AST node of the entry point. However, the new API doesn't, and so a certain ConstRef hack doesn't get applied when using the new API, leading to subsequent code generation issues. This patch also checks for a 'numthreads' attribute when deciding whether to apply the ConstRef hack. This closes issue #6507 and helps to resolve issue #4760. * Add expected failure list for GitHub runners Our GitHub runners don't have the CUDA toolkits installed, so they can't run all tests.
* Document how unit tests are defined and run (#6448)Anders Leino2025-03-03
| | | This closes issue #4771.
* Fix build error when SLANG_ENABLE_TESTS is set to OFF (#6420)Jay Kwak2025-02-28
| | | | | | | | | | | | | | | | | | | | | | * Fix build error when SLANG_ENABLE_TESTS is set to OFF When SLANG_ENABLE_TESTS is disabled but SLANG_ENABLE_GFX is enabled, cmake was failing. It turned out that gfx build target was trying to copy some of files to the directory where slang-test uses. When SLANG_ENABLE_TESTS is disabled, the directory information became unavailable, because slang-test target became unavailable. This commit makes the copying behavior conditional on SLANG_ENABLE_TESTS in the gfx build target. * format code (#42) Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com> --------- Co-authored-by: slangbot <ellieh+slangbot@nvidia.com> Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com> Co-authored-by: Ellie Hermaszewska <ellieh@nvidia.com>
* Resolve 'extern' types during type layout generation if possible (#6450)Ellie Hermaszewska2025-02-28
| | | | | | | | | | | | | * Resolve 'extern' types during type layout generation if possible Closes https://github.com/shader-slang/slang/issues/5994 Closes https://github.com/shader-slang/slang/issues/6437 * format code --------- Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com> Co-authored-by: Yong He <yonghe@outlook.com>
* Prepare for render test api migration (#6498)Anders Leino2025-02-28
| | | | | | | | | | | | | * Remove tests/compute/dump-repro The -load-repro option is no longer maintained. This helps to address issue #4760. * Rename ShaderCompilerUtil::Output::session to globalSession * Remove the load-repro codepath * Lifetime bugfix
* Remove adapter option from slang-test (#6475)Mukund Keshava2025-02-27
| | | | | | | | | | | | | Fixes #6390 This commit removes the deprecated -adapter command-line option from slang-test. This change aligns with commit 015bde8d5a46f32979c00dbb1feb4b3d80729c44, which previously removed the adapter option from render-test and implemented the more AdapterLUID mechanism. Co-authored-by: Ellie Hermaszewska <ellieh@nvidia.com> Co-authored-by: Yong He <yonghe@outlook.com>
* update slang-rhi (shader object refactor) (#6251)Simon Kallweit2025-02-27
| | | | | | | | | | | | | | | * remove unused resource * define buffer data * add vs2022 build presets * update slang-rhi API usage * update slang-rhi --------- Co-authored-by: Yong He <yonghe@outlook.com>
* Allow `.member` syntax on vector and scalars. (#6424)Yong He2025-02-27
| | | | | | | | | | | | | | | | | * Allow `.member` syntax on vector and scalars. * Fix. * fix. * Fix. * update comment. * Fix tests. * Fix warning. * Add more tests.
* Fix precompiledTargetModule tests (#6455)cheneym22025-02-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Fix precompiledTargetModule tests Add SPIRV-Tool linker support to gfx unit tests and use the linker in precompileModule tests that use precompiled modules to reconstitute SPIRV shaders that were modularly compiled. Fix a Slang reference count bug in the precompile service. * Use sm_6_6 New DXC requires higher version for linkability. * Rename helper function, pass by reference * Link through slang-glslang * Add missing files * Fix metal * format code --------- Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com> Co-authored-by: Yong He <yonghe@outlook.com>
* Add implementation for 'uploadTextureData' in metal (#6443)kaizhangNV2025-02-24
| | | | | | | | | Close issue: #6386. - Implement uploadTextureData in metal - Fix a bug in 'copyTextureToBuffer' in metal The last parameter for Metal::copyFromTexture is the 'destinationBytesPerImage', but previous implementation fill in the destination size which is wrong in 3-D texture.
* Improve performance when compiling small shaders. (#6396)Yong He2025-02-23
| | | | | | | Improve performance when compiling small shaders. Avoid copying witness table entries that are not getting used during linking. Avoid copying auto-diff related decorations and derivative functions during linking, if the user modules doesn't use autodiff. Cache operator overload resolution results on global session, so each new Session doesn't need to repetitively run through overload resolution from scratch.
* Fix slang raytracing test (#6404)ksavoie-nv2025-02-21
| | | | | | | | | | | | | | | | | * Plumb raytracing shaders through render-test-main RenderTestApp is missing handling for RayTracing in a few places. * fixup formatting * enable optix test category by default * Revert "enable optix test category by default" This reverts commit d142068058a827843fd7ebcf89a6ec252fd3c69a. --------- Co-authored-by: cheneym2 <acheney@nvidia.com>
* Metal fix (#6413)kaizhangNV2025-02-20
| | | | | | | | | | | Partially fix #6378 * Fix invalid access mode for texture_buffer * Fix texture view create issue in metal In newTextureView, levelRange should represent the mipmap level range, while sliceRange should represent the texture layer range for texture array. But the implement inverse those two wrongly.
* Show adapter info in slang-test (#6388)cheneym22025-02-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When -show-adapter-info is provided to slang-test, there is a subsequent pass over all available APIs to ask render-api to show which adapter will be used. > .\slang-test.exe -show-adapter-info Supported backends: fxc dxc glslang spirv-dis clang visualstudio genericcpp nvrtc llvm spirv-opt tint Check vk,vulkan: Supported Check dx12,d3d12: Supported Check dx11,d3d11: Supported Check cuda: Supported Check wgpu,webgpu: Supported Adapter Information for Available APIs: vk,vulkan: Using graphics adapter: NVIDIA RTX A3000 Laptop GPU dx12,d3d12: Using graphics adapter: NVIDIA RTX A3000 Laptop GPU dx11,d3d11: Using graphics adapter: Intel(R) UHD Graphics cpu: cuda: wgpu,webgpu: Using graphics adapter: default passed test: 'tests/autodiff/arithmetic-jvp.slang (dx11)' ... closes #5600 * format code --------- Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
* Cleanups for render-api (#6360)Anders Leino2025-02-18
| | | | | | | | | | | * Clean up unused code * Clean up support interface * Rename the compile output requests to mark them DEPRECATED --------- Co-authored-by: Yong He <yonghe@outlook.com>
* Fix metal issue (#6361)kaizhangNV2025-02-14
| | | | | | | | | | | | | * Fix metal issue - implement waitForFences for metal backend - fix a bug that it misses clear the entryPoints when initializing RootShaderObject * format --------- Co-authored-by: Yong He <yonghe@outlook.com>
* Disallow only resources in constant buffers in parameterblocks on metal (#6342)Ellie Hermaszewska2025-02-13
| | | | | | | | | | | | | * Neaten metal parameter block checking * Disallow only resources in constant buffers in parameterblocks on metal closes https://github.com/shader-slang/slang/issues/6200 * add unit test for metal parameterblock cbuffer --------- Co-authored-by: Yong He <yonghe@outlook.com>
* Reflection Fixes. (#6346)Yong He2025-02-13
| | | | | | | | | | | * Fix 6317. * Fixes #6316. * Fix cmake preset. --------- Co-authored-by: Ellie Hermaszewska <ellieh@nvidia.com>
* Migrate slang-test away from deprecated Slang API (#6343)Anders Leino2025-02-13
| | | This helps to address #4760.
* Allow LHS of `where` to be any type. (#6333)Yong He2025-02-12
| | | | | | | | | | | | | * Allow LHS of `where` to be any type. * Register free-form extensions when loading precompiled module. * Fix test. * Fix. * Fix `as<IRType>`. * try fix precompiled module test.
* Correct dependencies on core module source (#6340)Ellie Hermaszewska2025-02-12
| | | | | | | | | | | | | | | | | | | | | | | * Publicly link core module sources Closes https://github.com/shader-slang/slang/issues/6037 * format * format * remove unnecessary conditional * comments * neaten * Only build embedded core modules when necessary * Make dependencies on core module source more precise * more precice dependencies on core module source * Neaten
* Add test for visibility in translation unit with multiple source files (#6306)Anders Leino2025-02-07
| | | This closes #6221.
* Enable D3D12 experimental feature to use coopvec (#6290)Jay Kwak2025-02-05
| | | | | | This commit enables "D3D12-experimenta-feature" in render-test. This is required to use CoopVec feature with dxcompiler.dll. But it is enabled only when "-dx12-experimental" is used, because it appears that DX12 becomes unstable when the experimental feature is enabled, which causes bunch of tests randomly failing.
* Feature/initialize list side branch (#6058)kaizhangNV2025-02-05
| | | | | | | | | | | | | | | | | | | | | | * SP004: implement initialize list translation to ctor - We synthesize a member-wise constructor for each struct follow the rules described in SP004. - Add logic to translate the initialize list to constructor invoke - Add cuda-host decoration for the synthesized constructor - Remove the default constructor when we have a valid member init constructor - Disable -zero-initialize option, will re-implement it in followup (#6109). - Fix the overload lookup issue When creating invoke expression for ctor, we need to call ResolveInvoke() to find us the best candidates, however the existing lookup logic could find us the base constructor for child struct, we should eliminate this case by providing the LookupOptions::IgnoreInheritance to lookup, this requires us to create a subcontext on SemanticsVisitor to indicate that we only want to use this option on looking the constructor. - Do not implicit initialize a struct that doesn't have explicit default constructor. Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
* Correct NVAPI include (#6263)Ellie Hermaszewska2025-02-04
|
* Update Slang-RHI and enable any debug layers up-front (#6226)Anders Leino2025-01-31
| | | | | | | | | | | | | | | | | | | | * Update Slang-RHI and enable any debug layers up-front As [1] shows, creating a D3D12 device and then enabling debug layers causes future device creation to fail. That means enabling debug layers is a process-wide decision that should be done at startup, and not just before creating an individual device. Previously, Slang-RHI enabled debug layers as part of device creation. The new Slang-RHI revision doesn't do that anymore, but instead allows the user to enable debug layers earlier, with a separate API. This change calls the mentioned API before creating any device. This closes #6172. * Compile fixes needed after updating slang-rhi --------- Co-authored-by: Yong He <yonghe@outlook.com>
* Support cooperative vector including Vulkan-Header (#6228)Jay Kwak2025-01-30
| | | | | * Support cooperative vector including Vulkan-Header Adding a Slang support for cooperative vector with vulkan-header update.
* Support cooperative vector (#6223)Jay Kwak2025-01-30
| | | | | | | * Support cooperative vector without Vulkan-header update Adding a Slang support for cooperative vector. But this commit doesn't have Vulkan-header update.
* Fix geometry shader related modifier lowering. (#6197)Yong He2025-01-28
| | | | | | | | | | | * Fix geometry shader related modifier lowering. * Cleanup. * Delete obselete test. * Enable geometryShader test on windows only. * Fix test.
* Add a unit test to cover type-conformance compilation API. (#6178)Yong He2025-01-28
| | | Co-authored-by: Anders Leino <aleino@nvidia.com>
* Fix static build and install (#6158)Dario Mylonopoulos2025-01-24
| | | | | | | * Add SLANG_ENABLE_RELEASE_LTO cmake option * Fix cmake static build * Disable install SlangTargets to avoid static build failing
* Cache and reuse glsl module. (#6152)Yong He2025-01-22
| | | | | | | | | | | * Cache and reuse glsl module. * Fix. * Implement record/replay for the new api. * Fix record replay. * Fix test.
* test-server should use d3d12core.dll from bin directory (#6095)Jay Kwak2025-01-17
|
* Add groupshared atomic array test. (#6107)Yong He2025-01-17
| | | | | * Add groupshared atomic array test. * Fix test.
* Avoid using the backend validation when using test server (#6094)Jay Kwak2025-01-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | * Avoid using the backend validation when using test server Currently with a debug build, the backend validation such as Vulkan-Validation-Layer or DXC validation is enabled all the time. It means there is a higher chance that we see warning messages while running slang-test with a debug build. However, those warning messages incorrectly treated as the testing result when using test-server. This is mainly because of the fact that the Slang implemention for the RPC commucation expects only one time output result. As soon as any warning is printed, the testing process is incorrectly considered as completed even though it might be still in the middle of initializing the device. This commit disables the backend validation when using the test-server. * format code (#31) Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com> --------- Co-authored-by: slangbot <ellieh+slangbot@nvidia.com> Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com> Co-authored-by: Yong He <yonghe@outlook.com>
* Fix argument buffer tier2 layout computation. (#6101)Yong He2025-01-15
|
* slang-test: Ensure runtime is consistent (#6021)Anders Leino2025-01-08
| | | | | | | I hit issue #5305 again after re-generating the build directory, building and then running slang-test. In other words, D3D12 and Slang-RHI/WebGPU/D3D12 failed to create a device due to the runtime being incosistent. Bilding copy-prebuilt-binaries fixed it, and so it's best to make this step a dependency of slang-test.
* Add backtraces to examples (#5973)Anders Leino2025-01-07
| | | | | | | | | | | | | | | * examples: Log stack trace on exceptions For now, this is only implemented on Windows. This helps to address #5520. * examples: Print log file if there is any * format code --------- Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com> Co-authored-by: Yong He <yonghe@outlook.com>
* Lower varying parameters as pointers instead of SSA values. (#5919)Yong He2025-01-07
| | | | | * Add executable test on matrix-typed vertex input. * Fix emit logic of matrix layout qualifier. * Pass fragment shader varying input by constref to allow EvaluateAttributeAtCentroid etc. to be implemented correctly.
* Fix some robustness issues in the examples (#5984)Anders Leino2025-01-07
| | | | | | | | | | | | | | | * examples: Make hello-world example exit gracefully if VK cannot be initialized - Check if VK API function pointers are valid before using them - Return 0 and exit if VK initialization fails - Enable hello-world example * examples: Fixes for ray-tracing examples - Assert that accelleration structure buffer is not nullptr - Check if buffer creation succeeded before proceeding - This makes initialization not hang, but it still fails. Therefore, the test expectations are just updated to point to another issue. - Enable ray-tracing tests on Windows
* Properly set D3D12SDKPath (#5993)Jay Kwak2025-01-06
| | | | | | | | | | | | | | | * Properly set D3D12SDKPath Closes https://github.com/shader-slang/slang/issues/5992 This commit have an effect on slang-test.exe and test-server.exe. When we run slang-test.exe, it uses D3D12Core.DLL located at `build/{Release,Debug}/bin/D3D12`, which is `D3D12` from where the executable file is located at. This has been working fine but we found a case where it doesn't work properly. This commit sets D3D12SDKPath value explicitly to avoid potential problems.
* Create DirectDeclRef when creating Decl to prevent invalid dedup. (#5945)Yong He2025-01-03
| | | | | | | | | * Create DirectDeclRef when creating Decl to prevent invalid dedup. * Fix test. * fix * update slang-rhi
* Fix parameter location reflection for pure data paramblocks. (#5956)Yong He2025-01-03
|
* Allow explicit test root (#5980)bspeice2025-01-01
|
* Support dispatchComputeIndirect and draw(Indexed)Indirect with count buffer ↵AdamYuan2024-12-26
| | | | | | | | | | | | | | | for Vulkan (#5929) * Support gfx ComputeCommandEncoder::dispatchComputeIndirect for Vulkan * Support count buffer for Vulkan in gfx RenderCommandEncoder::drawIndirect and RenderCommandEncoder::drawIndexedIndirect * Fix an unintended change * Fix format issue --------- Co-authored-by: Yong He <yonghe@outlook.com>
* Fix metadata of register space and varying params. (#5906)Yong He2024-12-18
|