summaryrefslogtreecommitdiffstats
path: root/tests/bugs
Commit message (Collapse)AuthorAge
...
* Address glslang ordering requirments for 'derivative_group_*NV' (#4323)ArielG-NV2024-06-10
| | | | | | | | | | | | | | | | | * Address glslang ordering requirments for 'derivative_group_*NV' fixes: #4305 The solution is to emit some `layout`s after a module source is emitted. Added to slangs gfx backend code to enable the compute shader derivative extension for testing purposes. * address review * enable removed test --------- Co-authored-by: Yong He <yonghe@outlook.com>
* enable more metal tests (#4326)skallweitNV2024-06-10
|
* SPIRV `Block` decoration fixes. (#4303)Yong He2024-06-08
| | | | | | | | | | | | | | | * SPIRV `Block` decoration fixes. - SPIRV does not allow duplicate `Block` decorations. So we shouldn't be generating them. - Also fixes duplication of OpName. - SPIRV and HLSL do not allow ConstantBuffer with trailing unsized arrays. Added a check in the front-end against such code. * Convert failing cross-compile tests to filecheck. --------- Co-authored-by: Jay Kwak <82421531+jkwak-work@users.noreply.github.com>
* Metal compute tests (#4292)skallweitNV2024-06-07
|
* Prevent hoisting of non-hoistable instructions in non-function values with ↵Ellie Hermaszewska2024-06-01
| | | | code (#4250)
* If no sample is set with a `Texture(.*)MS[]` operation, set sample to 0. (#4225)ArielG-NV2024-05-24
| | | | | * push fix: if no sample, set to 0 for textureMS * push fixes to hlsl [] operator + test so it will error
* Add diagnostic to prevent defining unsized variables. (#4168)Yong He2024-05-15
| | | | | | | | | | | | | | | * Add diagnostic to prevent defining unsized static variables. * Fix tests. * Add more tests. * Fix to allow defining variables of link-time size. * update diagnostic message. * Fix tests. * Simplify code.
* Slang: Support UTF-8 with Byte Order Markers (#4135)cheneym22024-05-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Slang APIs are documented as taking UTF-8 encoded shader source, though it's not explicitly documented whether it is allowed to include a BOM (Byte Order Marker). This change adds support for UTF-8 BOM markers by virtue of disposing of BOM data. As a bonus, UTF-16 input which can cleanly decode to UTF-8 is now also accepted. Throwing out the BOM on input is done by leveraging existing functionality in "determineEncoding()", however a bug exists there for null-terminated single character input, where the null byte caused a heuristic to guess UTF-16, even though the null byte isn't part of the string. The bug in "determineEncoding" is fixed by only guessing when bytes >= 2 and not looking past the end of the buffer. The 'implicit-cast' test was mistakenly relying on the bug to pass, as its expected file was being read as UTF16 and cropped to zero length due to the bug. The expected output of implicit-cast is updated to pass with the bug fix in place. The decoding of UTF-16 to UTF-8 is done through an existing 'decode' method. This change fixes a bug in UTF16-LE 'decode' where it was decoded as if it were Big-Endian. Adds 3 small tests to ensure the compiler doesn't choke on source files in UTF-8 (with BOM), UTF16-LE, or UTF16-BE. Bonus: Fixes a bug in diagnostic reporting where hex values were incorrectly translated to text, leading to incorrect, possibly truncated strings. Fixes #4046 Co-authored-by: Yong He <yonghe@outlook.com>
* Fix NonUniformResourceIndex legalization for SPIRV. (#4133)Yong He2024-05-08
| | | | | * Fix NonUniformResourceIndex legalization for SPIRV. * Update gh-4131.slang
* Make sure pointer local vars have `AliasedPointer` decoration. (#4132)Yong He2024-05-07
|
* Fix compile failures when using debug symbol. (#4069)Yong He2024-05-01
| | | | | | | | | * Fix compile failures when using debug symbol. * Various fixes. * Fix intrinsic. * Fix test.
* Add variable pointers to render-test-vk and a related failing test-case (#4041)ArielG-NV2024-04-28
| | | * add variable pointers to render-test-vk and failing (but ignored with workarounds) test-case
* WIP: Force Inline If RefType (#4005)ArielG-NV2024-04-26
| | | | | | | | | | | | | | | | | | | | * Force Inline if reftype Fixes #3997. If we are using a refType, we now ForceInline. remarks: 1. Modifications were made in slang-ir-glsl-legalize to change how we translate GlobalParam proxy's into GlobalParam. a. We now handle the senario where a globalParam is used in multiple disjoint blocks (like 2 different functions). * try to figure out why CI fails but local works try to inline DispatchMesh, works locally, may fail on CI(?) * try another fix * add task tests + don't allow semi-early task-shader inline Task shader uses DispatchMesh which is a very big 'hack' where we check for the function name and modify the callees in very large ways. This function does inline, but it cannot inline early due to future mangling that this operation requires todo. This is reflected with the `[noRefInline]` modifier. It is a modifier so users may stop mandatory inlines with `__ref` parameter.
* Fix unpackUnorm4x8 and unpackSnorm4x8 (#4033)Jay Kwak2024-04-25
| | | | | Fixes #4031 Each component of unpackU/Snorm4x8 had to be masked for 8bits.
* Keep const-ness in generic functions (#4028)Jay Kwak2024-04-25
| | | | | | | | | | | | | | | * Keep const-ness in generic functions Closes #3834 The issue was that "const" variables inside of generic functions became non-const variables. This issue prevented some of GLSL texture functions from being called inside of generic functions. When `propagateConstExpr()` iterates the global functions, the generic functions had to be handled little differently. This commit allows the iteration to happen for the generic functions. * Adding an explantion of the test as a comment
* Avoid DXC warnings for missing bitwise op parantheses (#4004)Jay Kwak2024-04-24
| | | | | | | | | | Resolves #3980 Based on the operator precedence, Slang may omits the parentheses if they are not needed. DXC prints warnings for such cases and some applications may treat the warnings as errors. This commit emits parentheses to avoid the DXC warning even when they are not needed.
* Initial pass to add capability declarations to stdlib intrinsics. (#3912)ArielG-NV2024-04-19
|
* Support arithmetics on generic arguments (#3968)Jay Kwak2024-04-19
| | | | | Resovles an issue #3935 Slang had to fold the generic arguments after specialization.
* commit to partially fix #3931 (#3972)ArielG-NV2024-04-17
|
* Fix IR lowering bug of do-while loops. (#3941)Yong He2024-04-12
|
* Fix incorrect SPV stride for unsized array (#3837)kaizhangNV2024-03-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Fix incorrect SPV stride for unsized array (#3825) In '-emit-spirv-directly' mode, slang generates the stride 0 for unsized array in `OpDecorate` instructions. For unsized array, the stride is invalid, but we need to provide a non-zero value to pass the spirv validator. * Decorate struct with unsized array field as 'Block' For the struct having unsized array fields, it has to be decorated as "Block", otherwise it will fails the spirv-val. So we add a check at in 'emitGlobalInst' when emitting spirv for 'kIROp_StructType', where if there is unsized array field inside the struct, emit a decorate instruction for above purpose. * Update decoration for kIROp_SizeAndAlignmentDecoration When add a decoration node for kIROp_SizeAndAlignmentDecoration, we implicitly convert the 64 bit size to 32 bit. In most cases, this should not be a problem because we won't have that large data type. However, we use 64-bit -1 to represent the size of unsized-array, so in that case, the conversion will change the size to 0, which is incorrect. So change that decoration to use 64-bit size. --------- Co-authored-by: Yong He <yonghe@outlook.com>
* Allow var/param names to be the same as type name. (#3850)Yong He2024-03-27
|
* Fix lookup to prevent finding `typedef` itself. (#3848)Yong He2024-03-27
|
* Support mutable existential parameters. (#3836)Yong He2024-03-26
| | | | | * Support mutable existential parameters. * Update test.
* Fix the sign-extending issue in right shift (#3820)kaizhangNV2024-03-26
| | | | | | | | | | | Fix issue (#3637). In constant folding of a right shift operation,slang always uses signed interger as the operand no matter the input source code is signed or unsigned, this could causes sign-extending issue if the input source is unsigned integer with highest bit set to 1. Fix the issue by checking the original type of the input and use the unsigned type if the input is unsigned.
* Make `-no-mangle` option work, add `-no-hlsl-binding`. (#3817)Yong He2024-03-23
|
* Diagnose cyclic references in inheritance graph. (#3811)Yong He2024-03-21
|
* Fix namespace parsing. (#3803)Yong He2024-03-20
| | | | | * Fix namespace parsing. * Fix.
* Change representation of float literal in language translation (#3798)kaizhangNV2024-03-20
| | | | | | | | | | | | | | | * Change representation of float literal in language translation Fix the issue (#3490). Previous implementation could zero out the very small float literal. We now use scientific notation instead to represent the float numbers whose exponential part are larger than a threshold. In other cases, keep using fixed notation. --------- Co-authored-by: Yong He <yonghe@outlook.com>
* Fix type checking for constructors in generic interfaces. (#3799)Yong He2024-03-19
|
* Fix regression on pointer address space handling. (#3797)Yong He2024-03-19
|
* Check cyclic types after specialization. (#3791)Yong He2024-03-18
|
* Check for cylic types. (#3790)Yong He2024-03-18
|
* Fix SPIRV for mesh shaders, checks for invalid target code&recursion. (#3788)Yong He2024-03-18
| | | | | | | | | | | | | | | | | | | | | | | | | * Fix #3780. * Fixers #3781. * Add test for #3781. * Diagnose error on unsupported builtin intrinsic types. * Add check for recursion. * Fix. * Fix. * Fix recursion detection. * Fix. * Fix. * Fix recursion logic. * More fix.
* Fix crash when trying to constant fold non-existent call. (#3728)Yong He2024-03-10
|
* Allow non-static const to be considered compile-time constant. (#3645)Yong He2024-02-28
|
* Fix parsing of literals in stdlib. (#3610)Yong He2024-02-21
| | | | | * Fix parsing of literals in stdlib. * Fix double lit limits.
* Fix SPIRV lowering issue. (#3608)Yong He2024-02-21
| | | | | | | | | | | | | * Fix SPIRV pointer lowering issue. Fixes #3605. * Add another pointer test. Fixes #3601. * Fixes #3600. * Fix #3595.
* Capability type checking. (#3530)Yong He2024-02-02
| | | | | | | | | * Capability type checking. * Fix. --------- Co-authored-by: Yong He <yhe@nvidia.com>
* [SPIRV] Support `globallycoherent` and `[vk::index()]`. (#3488)Yong He2024-01-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | * [SPIRV] Support `globallycoherent` modifier. * Fix. * Disable executable cooperative vector tests. * Update expected failure. * [SPIRV] Emit varying output index decoration. * Add test. * Update tests. * Fix test. * Emit `SpvExecutionModeEarlyFragmentTests`. * Lower `StructuredBuffer<bool>`. * Support globallycoherent on ByteAddressBuffer. --------- Co-authored-by: Yong He <yhe@nvidia.com>
* Fix funcs w/ buffer load being treated as readnone. (#3441)Yong He2024-01-09
| | | Co-authored-by: Yong He <yhe@nvidia.com>
* Fix GLSL static initialization bug. (#3409)Yong He2023-12-13
| | | | | | | | | | | | | * Fix GLSL static initialization bug. Fixes #3408. * Update comment. * Fold global var initializer as an expression if possible. --------- Co-authored-by: Yong He <yhe@nvidia.com>
* Support visibility control and default to `internal`. (#3380)Yong He2023-12-06
| | | | | | | | | | | | | | | | | | | * Support visibility control and default to `internal`. * Fix wip. * Fixes. * Fix. * Fix test. * Add legacy language detection and compatibility for existing code. * Add doc. --------- Co-authored-by: Yong He <yhe@nvidia.com>
* Unify stdlib `Texture` types into one generic type. (#3327)Yong He2023-11-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Unify Texture types in stdlib into 1 generic type. * Fixes. * Fix. * Fixes. * Fix reflection. * Fix binding reflection. * Add gather intrinsics. * Fix gather intrinsics. * Fix texture type toText. * Fix intrinsic. * fix cuda intrinsic. * Fix project files. * cleanup. * Fix. * Fix. * Fix sampler feedback test. * Fix getDimension intrinsics. * Fix spirv sample image intrinsics. * Fix test. * Fix GLSL intrinsic. * Cleanup. --------- Co-authored-by: Yong He <yhe@nvidia.com>
* Correctly pass values from the conditional block to the loop during ↵Ellie Hermaszewska2023-11-06
| | | | | inversion (#3311) Co-authored-by: Yong He <yonghe@outlook.com>
* Disable frexp test on swiftshader. (#3294)Yong He2023-10-26
| | | | | | | | | * Disable frexp test on swiftshader. * Fix windows release script. --------- Co-authored-by: Yong He <yhe@nvidia.com>
* Make the exponent return value from frexp int (#3284)Ellie Hermaszewska2023-10-26
| | | | | | | | | | | * Make the exponent return value from frexp int Fixes https://github.com/shader-slang/slang/issues/3282 * Update slang-llvm. --------- Co-authored-by: Yong He <yhe@nvidia.com>
* Various SPIRV fixes. (#3231)Yong He2023-09-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Various SPIRV fixes. - Geometry shader support (WIP). - Fix texture get dimension and load. - Fold global GetElement(MakeArray/MakeVector) insts. - Call spvopt to inline all functions. - Translate OpImageSubscript. - Emit struct member names and global variable names. - Fix lowering of OpBitNot -> OpNot, instead of OpBitReverse. * Fix test. * Fix geometry shader. * Fix geometry shader emit. * Add atomic Image access test. * Fix tests. * don't fail if spirv-opt fails. * Update comments. * Fix test. * Cleanups. * indentation --------- Co-authored-by: Yong He <yhe@nvidia.com> Co-authored-by: Ellie Hermaszewska <ellieh@nvidia.com>
* SPIR-V image operations (#3163)Ellie Hermaszewska2023-09-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add __truncate and __sampledType for spirv_asm Allows some texture tests to start passing * add __isVector Currently unused * Add 1-vector legalization pass (WIP) * Add capabilities for image types * neaten instruction dumping * add 1-vector test * Add a couple of cases to vec1 legalization * Remove texture tests from expected failures * comment * regenerate vs projects * Remove redundant define form synchapi emulation * refactoring image methods * All sample functions refactored * Remove incorrect glsl intrinsics Partially addresses https://github.com/shader-slang/slang/issues/3174 * __subscript image ops via writing funcs * Extract texture struct writing from core.meta.slang * Abstract out cuda intrinsic * Remvoe erroneous call to opDecorateIndex * spirv asm IR utils * Correct position of loads for SPIR-V asm inst operands * Raise constructors to global scope during spir-v legalization * Correct snippet output * Implement most texture sampling ops for SPIR-V * Legalize 1-vectors for glsl too * Make SPIR-V inst operands non-hoistable * Better 1-vector legalization * Put textures in ptrs for spirv * insert missing break * Add vec1 legalization test * Add some missing pieces to slang-ir-insts * Greatly neaten vec1 legalization * a * Neaten vec1 legalization * Add image read and write intrinsics for spir-v * Squash warnings * regenerate vs projects * Drop redundant guards * Drop 5 tests from expected failure list * Inst numbering changes to cross compile tests * vec1 legalization tests only on vk * Correct location of asm op emit * Inline constant in spirv-asm * Correct signedness for lane in wave intrinsics * Extract element from float1 for cuda * squash warnings * Neaten spirv-emit * dedupe more capabilities * warnings * neaten assert * comments * comments
* Fix GLSL code gen around RayQuery and HitObject types. (#3173)Yong He2023-09-01
| | | | | | | | | | | | | | | | | | | | | | | * 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>