summaryrefslogtreecommitdiff
path: root/tests/bugs
AgeCommit message (Collapse)Author
2024-10-28Replace the word stdlib or standard-library with core-module for source code ↵Jay Kwak
(#5415) This commit changes the word "stdlib" or "standard library" to "core module" in the source code.
2024-10-20Properly check switch case. (#5341)Yong He
2024-10-19Remove use of Variable Pointer capability. (#5352)Yong He
* Remove use of Variable Pointer capability.
2024-10-17Cleanup atomic intrinsics. (#5324)Yong He
* Cleanup atomic intrinsics. * Fix. * Fix glsl. * Remove hacky intrinsic expansion logic for glsl image atomics. * Fix all tests. * Fix. * Add `InterlockedAddF16Emulated`. * Fix glsl intrinsic. * Fix.
2024-10-15Fix type checking on generic extensions. (#5316)Yong He
Add fcpw library to test suite.
2024-10-15Enable WebGPU tests in CI (#5239)Anders Leino
2024-10-09Fix spirv lowering logic around pointer to unsized array. (#5243)Yong He
* Fix spirv lowering logic around pointer to unsized array. * Fix. --------- Co-authored-by: Ellie Hermaszewska <ellieh@nvidia.com>
2024-10-08Look through attributes and rates when determining by reference ↵Ellie Hermaszewska
initialization (#5023) * Look through attributes and rates when determining by reference initialization Closes #5022 * Make type of unwrapAttributedType more specific * loosen type of unwrapAttributedType * Discard changes to source/slang/slang-emit-spirv.cpp * Discard changes to source/slang/slang-ir-check-differentiability.cpp * Discard changes to source/slang/slang-ir.cpp * Discard changes to source/slang/slang-ir.h * Update slang-ir-use-uninitialized-values.cpp * Remove redundant cast --------- Co-authored-by: Yong He <yonghe@outlook.com>
2024-09-27Fix bug in `translateGlslGlobalVar()`. (#5181)Yong He
2024-09-27Fix l-value computation for subscript call. (#5177)Yong He
2024-09-18Lower the priority of looking up the rank of scope (#5065)kaizhangNV
* Lower the priority of looking up the rank of scope In the previous change of #5060, we propose a way to resolve the ambiguous call when considering the scope of a function. But this rule should be considered as a low priority than "specialized candidate", aka. we should consider more "specialized candiate" first. * Count distance between reference site to declaration site Compare the candidate by calculating distance from reference site to declaration site via nearest common prefix in the scope tree. This will involve finding the common parent node of two child nodes and how sum the distance from the common parent to the two child nodes. * Change the priority higher than 'getOverloadRank' * Don't evaluate the scope rank algorithm on generic If the candidate is generic function, the function parameters won't be checked before 'CompareOverloadCandidates', so it will results in that the candidates this function could be invalid. We should not evaluate the distance algorithm in this case, instead we will evaluate later when the candidate is in flavor of Func or Expr since then all the type checks for the function will be done.
2024-09-11Fix the issue in resolving the overload functions (#5060)kaizhangNV
2024-09-09Fix generic IInteger `mod` implementation. (#5037)Yong He
2024-09-05Fix SPIRV SV_TessFactor type adaptation logic. (#5010)Yong He
* Fix SPIRV SV_TessFactor type adaptation logic. * Fix compile error.
2024-09-05Support `where` clause and type equality constraint. (#4986)Yong He
* Support `where` clause. * Fix. * Fix parser. * Enhance test to cover traditional __generic syntax. * Update user-guide. * Support `where` clause on associatedtype. * Fix. * Put in more comments.
2024-09-04Open existential on arguments after overload resolution. (#4982)Yong He
* Open existential on arguments after overload resolution. * Fix. * Update source/slang/slang-check-overload.cpp Co-authored-by: ArielG-NV <159081215+ArielG-NV@users.noreply.github.com> --------- Co-authored-by: ArielG-NV <159081215+ArielG-NV@users.noreply.github.com>
2024-08-30Draft: integrate slang-rhi (#4970)Simon Kallweit
* add slang-rhi submodule * refactor render-test to use slang-rhi and remove OpenGL support * remove -vk -glsl tests * remove gl test * disable failing test * allow recursive submodules in github actions * update slang-rhi * update slang-rhi --------- Co-authored-by: Yong He <yonghe@outlook.com>
2024-08-30Fix redundant decorations in IRParam (#4964)Jay Kwak
* Fix redundant decorations in IRParam Closes #4922 The problem was that same decorations were added to an IRParam multiple times while running `specializeIRForEntryPoint()`. `cloneGlobalValueWithCodeCommon()` kept cloning decorations for the params that were already processed.
2024-08-22Fix a false failure when using the latest SPIR-V (#4904)Jay Kwak
* Fix a false failure when using the latest SPIR-V --------- Co-authored-by: Ellie Hermaszewska <github@sub.monoid.al> Co-authored-by: ArielG-NV <159081215+ArielG-NV@users.noreply.github.com> Co-authored-by: Ellie Hermaszewska <ellieh@nvidia.com>
2024-08-18Make sure to resolve overloaded expr for call args. (#4864)Yong He
2024-08-12Emit memory qualifier once for GLSL targets (#4819)ArielG-NV
Fixes #4818 Emit memory qualifier once for GLSL targets. Co-authored-by: Yong He <yonghe@outlook.com>
2024-08-12Warn when inout parameter is never written (#4777)venkataram-nv
Addresses #4698 as one approach to diagnose the potential problem. Emit warnings when a user marks a parameter as `inout` but never writes to it in the function. A new intrinsic function `unmodified(out T)` has been added to explicitly indicate that an `inout` variable will not be modified in the function. This is only one way to address the specific validation error in #4698. In general it seems that DXC does some more extensive checks on actual struct fields (as opposed to observing arbitrary struct writes), so that will be the next step.
2024-08-01Allow implicit 'uniform' entrypoint parameters. (#4765)Yong He
* Allow impliocit 'uniform' entrypoint parameters. * Fix. * Fix. * Fix. * Fix.
2024-07-30Move SPIRV global variables into a context variable (#4741)ArielG-NV
2024-07-30Set `nullptr` to the default value of the target VarDeclBase (#4757)ArielG-NV
2024-07-25Disallow multi-dim vector subscript in slang IR (#4277)Sriram Murali
Fixes bug #3180 This test verifies the check for illegal swizzle on vector types, whose element is not a basic Type (int, float). The check captures the failure within swizzle access on a nested vector subscript element. vector<vector<int, 2>, 2> a int b = a[0].x; // illegal Co-authored-by: Yong He <yonghe@outlook.com>
2024-07-25Fix around extensions and `IDifferentiable` requirement synthesis. (#4729)Yong He
* Check extensions before function parameters. Fix decl ref formation for synthesized differentiable requirements that are inside an extension. * Fix clang errors. * More clang fix. * Fix warnings. * Fix build error. * Fix. * Fix typo.
2024-07-24Support 1-dimensional matrix for HLSL (#4728)Jay Kwak
Closes #4395 This commit allows Slang to use 1-dimensional matrix when targetting HLSL. The 1-dimensional matrix is supported by DXC natively. GLSL/Vulkan doesn't support the 1-dimensional matrix natively. It is not trivial for Slang to convert all of matrix functions to vector or scalar at the emitting step. We can implement this later if there are needs. This commit disallows the use of 1-dimensional matrix for targetting GLSL/Vulkan by the capability system; in other words, the new 1-dimentional functions have "[require(hlsl)]".
2024-07-24Fix checking of var with matrix layout modifier. (#4737)Yong He
2024-07-23Fix for `ConstantBuffer<T[...]>` causing a segfault (#4705)ArielG-NV
Fixes: #4704 Change the type we assign when getting the member variable of a legalized `ConstantBuffer<T[...]>`.
2024-07-23Warn if providing explicit bindings to a object using uniform locations (#4708)ArielG-NV
fixes: #4700 Changes: * If a uniform object (which uses uniform locations) has explicit bindings we will warn to use `ConstantBuffer<T>` instead. We check for a warning specifically when we know an object uses uniform layouts because objects may not use a uniform-layout register even if tagged with `uniform`. A good example of this is `uniform ConstantBuffer<T>`.
2024-07-19Fix for invalid swizzle causing crash (#4690)ArielG-NV
* Fix for invalid swizzle causing crash Fixes #4689 If swizzle code is provided 5+ element swizzle the checkSwizzleExpr code will do an out of bounds array access and crash. * switch test to check for to ensure no crash * cleanup swizzle errors to only emit once --------- Co-authored-by: Yong He <yonghe@outlook.com>
2024-07-19Support parameter block in metal shader objects. (#4671)Yong He
* Support parameter block in metal shader objects. * Ingore parameter block tests on devices without tier2 argument buffer. * Fix warning. * Fix texture subscript test. --------- Co-authored-by: Yong He <yhe@nvidia.com>
2024-07-19Correctly parse multiple escaped newlines (#4672)Ellie Hermaszewska
closes https://github.com/shader-slang/slang/issues/4667
2024-07-16Fix minimal-optimization flag with texture atomics (#4660)ArielG-NV
Co-authored-by: Yong He <yonghe@outlook.com>
2024-07-16Warnings function parameters (#4626)venkataram-nv
* Handle out/inout functions with separate consideration * Fixing bug with passing aliasable instructions * Handle autodiff functions (fwd and rev) in warning system * Handling interface methods * Handling ref parameters like out/inout * Temporary fix to remaining bugs * Refactoring methods and tests * Recursive check for empty structs * Using default initializable interface in tests * Resolving CI fail
2024-07-10Fix the invalid spirv generation for matrix cast (#4588)kaizhangNV
Spirv doesn't have instruction to do the float cast for the matrix type. So we have to convert the matrix row by row, and then construct them to a new matrix. Update the unit test to make sure the cast won't miss any elements. Co-authored-by: Yong He <yonghe@outlook.com>
2024-07-10WIP Drop Premake (#3703)Ellie Hermaszewska
* Remove premake lua * Remove premake generated vs project * remove deps file * Remove premake driving bat files * Full test matrix under CMake * Remove premake based ci workflows * Wiggle CI * remove cmake from ci name * find frameworks correctly on osx * remove cmake from ci name * Cope with sccache not being available * cmake based falcor tests * ci wobble * only install ninja if necessary * more appropriate cache name * Remove premake from build instructions * Add some docs on ci setup * remove premake from regression tests * remove premake from perf test * Set SLANGC_PATH * ci wobble * bump slang-binaries * ci wobble * Bump spirv tools * dont use timestamp in cache * remote debug code * cache key wobble * Install sccache after building llvm * Do not build llvm tools * ci wobble * ci wobble * ci wobble * ci wobble * ci wobble * Tests spirv via glsl in ci * Define SLANG_ENABLE_XLIB=1 * osx builds on aarch64 * ci wobble * ci wobble * ci wobble * ci wobble * ci wobble * ci wobble * package documentation and metadata with cmake * ci wobble * Split hlsl double intrinsic tests * ci wobble * Correct type for double log10 Fixes https://github.com/shader-slang/slang/issues/4549 * remove working test from expected failures * add broken test to expected failures * smaller build for falcor tests * ci wobble * A few exclusions in ci * wip, release script * Enable examples in ci * neaten release script * Correct building docs * Only use xlib vulkan when slang_enable_xlib is true * bump slang-llvm version * Remove toolchain file use * Bump slang-llvm preset version * slash direction * Improve build directions * Add msvc cross build documentation * Disable old release files * Smaller set of releases for test * Allow not building llvm * simplify release matrix * Cross releases * formatting * formatting * ci wiggle * ci wiggle * cleaner * neaten * ci wobble * formatting * Install cross tools on linux * do not clean build dir * neaten ci * neaten ci * neaten ci * remove unused release workflow files * Build llvm on some platforms * neaten ci * notarize on osx * s/x64/x86_64 * ci wobble * Embed stdlib for release build * wobble ci * wobble ci * s/x64/x86_64 * ci wobble * ci wobble * ci wobble * vk-gl-cts on cmake * neaten ci * neaten ci * bump cache action version * Cope with windows being weird about case * old glibc version * old glibc version * Correct action file * Keep cache hot on main branch * separate small script for old glibc releases * ci wobble * ci wobble * Run cmake outside of docker * only sign on releases * Revert "Run cmake outside of docker" This reverts commit a58aaba939a4aa35fe70962fd60d9512b143592f. * python3 on build image * less parallel * ci wobble * ci wobble * ci wobble * newer git * ci wobble * ci wobble * Use newer docker image * Use newer docker image * sccache wobble * permissions issue * neaten * build llvm in ci * build llvm in ci * Remove linux clang build in ci * Only install crossbuild tools on non-aarch64 systems * neaten ci.yml * Correct github matrix * Simplify github matrix * ci wobble * Disable broken test See https://github.com/shader-slang/slang/issues/4589 * ci wobble * Neater slang-llvm archive filename * Neater path for uploading artifacts * Neater ci names * Use Windows SDK 10.0.19041.0 in cmake builds
2024-07-09Warnings for uninitialized values (#4530)venkataram-nv
This extends the code for handling uninitialized output parameters. Still needs to handle generic templates and assignment of uninitialized values more carefully. The file containing the relevant code are now in source/slang/slang-ir-use-uninitialized-values.cpp rather than the previous source/slang/slang-ir-use-uninitialized-out-param.h and the top-level function is now checkForUsingUinitializedValues. Additionally a rudimentary test shader has been added for this case, which replaces the old file for out params only; tests/diagnositcs/uninitialized-out.slang becomes tests/diagnositcs/uninitialized.slang. What this does not implement (could be future PRs): * Checking uninitialized fields within constructors * Partially uninitialized values with respect to data structure (e.g. arrays/structs/vector types) * Partially uninitialized values with respect to control flow (e.g. if/else/loop)
2024-07-08Fix the issue in emitFloatCast (#4559)kaizhangNV
* Fix the issue in emitFloatCast In emitFloatCast function, we only considered the input type is float scalar or float vector, so if the input type is a float matrix type, it will crash. We should also handle the float matrix type. Also, we add some diagnose info to point out the source location where there is error happened, so in the future it's easier to tell us what happens. * Add a unit test * Disable the test for metal Metal doesn't support 'double'. " metal 32023.35: /tmp/unknown-YgHAsJ.metal(15): error : 'double' is not supported in Metal matrix<double,int(3),int(4)> b_0 = matrix<double,int(3),int(4)> (a_0); "
2024-07-05Add vector overloads for or and and (#4529)Ellie Hermaszewska
* Add vector overloads for or and and Closes #4441 and #4434 * Disable cuda checks which use unsupported bool vectors * Add tests for 4531
2024-07-05Add specializations for 1 vectors in functions using the $N glsl intrinsic ↵Ellie Hermaszewska
placement (#4534) Closes #4533 Fixes part of #4531
2024-06-28Parse scope for local variable declaration (#4507)Jay Kwak
When a local variable is declaraed, a scope(::) was not properly parsed for its type name. This commit fixes it. Close #4457
2024-06-28fix `WorkgroupSize()` compiler failiure (#4505)ArielG-NV
in some cases was not destroying the hoisted to global `WorkgroupSize()` function removed capability requirement on `gl_WorkGroupSize` since no longer appies (kIROp of `WorkgroupSize` is implemented for all targets) change when destroying inst
2024-06-27Remove returned-array-legalization pass for metal (#4478)ArielG-NV
* disable return array optimization pass for metal targets fixes: #4468
2024-06-25Support atomic intrinsics for Metal (#4473)Jay Kwak
* Support atomic intrinsics for Metal This commit adds a support for the atomic intrinsics in Metal. The atomic member functions for buffers is not implemented yet. Metal requires the first argument for the atomic functions to be an atomic data type. This implementation rely on the fact that we can do a C-style type casting from a regular data type to an atomic data type.
2024-06-24Add case to `emitVectorReshape` for when using a `vector<M, N>` type with ↵ArielG-NV
`T` value (#4419) * Add case to `emitVectorReshape` for `vector<>` type, `scalar` value 1. Add new case 2. Add test * fix warning * fix warning
2024-06-20Disambiguate int type matrix multiply (#4425)Jay Kwak
Closes #4414
2024-06-13Implement for metal `SV_GroupIndex` (#4385)ArielG-NV
* Implement for metal `SV_GroupIndex` 1. If we don't have `sv_GroupThreadId` available we create one using `SV_GroupIndex`s location data. 2. We emit code emulating `sv_GroupThreadId` from the same logic that CUDA/CPP uses. * address most review comments Addressed all but two: [1](https://github.com/shader-slang/slang/pull/4385#discussion_r1639058473) and [2](https://github.com/shader-slang/slang/pull/4385#issuecomment-2166934855) I want to enable tests and be sure there is no bugs using CI before I redesign the code so I have a working fallback. * address comment, enable tests enable now functioning tests due to `SV_GroupIndex` working with metal * syntax error with groupThreadID search did `= param` instead of `= i.param` * add `sv_groupid` for test + test fixes * disable test that won't work regardless
2024-06-13Metal: misc fixes and enable more tests. (#4374)Yong He
* Fix and enable tests for metal. * Fix. * Fix. * Fix tests. * Fix warnings. * Fix. --------- Co-authored-by: Yong He <yonghe@Yongs-Mac-mini.local>