summaryrefslogtreecommitdiffstats
path: root/tests/bugs
Commit message (Collapse)AuthorAge
...
* Inline all RayQuery/HitObject typed functions when targeting GLSL. (#3172)Yong He2023-08-31
| | | | | | | | | * Inline all RayQuery/HitObject typed functions when targeting GLSL. * update test. --------- Co-authored-by: Yong He <yhe@nvidia.com>
* Retain int casts when unifying generic params (#3145)Ellie Hermaszewska2023-08-23
|
* Add test case for RayQuery parameter. (#3140)Yong He2023-08-22
| | | | | | | | | * Add test case for RayQuery parameter. * Update expeccted failure. --------- Co-authored-by: Yong He <yhe@nvidia.com>
* Compile append and consume structured buffers to glsl. (#3142)Yong He2023-08-21
| | | | | | | | | | | * Compile append and consume structured buffers to glsl. * Fix. * Update CI config. --------- Co-authored-by: Yong He <yhe@nvidia.com>
* SPIRV: debug source and debug line. (#3109)Yong He2023-08-15
|
* Fix a bug that warning 39001 can't be fully disabled. (#3112)Yong He2023-08-16
| | | Co-authored-by: Yong He <yhe@nvidia.com>
* Fix ByteAddressBuffer array legalization. (#3106)Yong He2023-08-15
| | | Co-authored-by: Yong He <yhe@nvidia.com>
* SPIR-V WIP (#3064)Ellie Hermaszewska2023-08-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add type layout for structured buffer * Default to generating spirv directly * vk test for compute simple * Add spirv-dis as a downstream compiler * Emit Array types in SPIR-V * makevector for spirv * Dump whole spirv module on validation failure * register array types todo, use emitTypeInst * Neater formatting for unhandled inst printing * break out emitCompositeConstruct * Correct array type generation * neaten * Allow getElement for vector * Remove unused * Allow predicating target intrinsics on types * Consider functions with intrinsics to have definitions We need to specialize these if they are predicated on types * Correct array type generation * makeArray for spir-v * replace getElement with getElementPtr for spirv * Correct translation of field access for spirv * Push layouts to types for spirv * Spirv intrinsics * operator now makes a pointer * Add structured buffer of struct test * Preserve type layout in spirv structured buffer legalization * neaten * makeVectorFromScalar for SPIRV * placeholder for layouts on param groups * More type safe spirv op construction * Know that constants and types only go in one section * Remove emitTypeInst * Add todo for spirv sampling * Add links to spirv documentation on emit functions * OpTypeImage support for SPIR-V * Add simpler texture test for spirv * s/spirv_direct/spirv/g * Allow several string literals in target_intrinsic * Handle global params without a var layour for SPIR-V For example groupshared vars * uint spirv asm type * Add todo for isDefinition It is currently too broad * Some atomic op spirv intrinsics * Strip ConstantBuffer wrappers for spirv * Add todo for matrix annotations * Do not associate decorations insts with spirv counterparts * Correct entry point parameter generation * Spelling * Assert that fieldAddress is returning a pointer * Add error for existential type layout getting to spir-v emit * Add IRTupleTypeLayout Unused so far * Allow getElementPtr to work with vectors * Correct target name in test * Hide default spirv direct behind a premake option --default-spirv-direct=true * Do not insert space at start of intrinsic def * Correct asm rendering in tests * remove redundant option * Emit directly from direct test * Add source language options for spirv-dis * Add comments to spirv dis * Add dead debug print for before spirv module * Correct asm rendering in tests * s/spirv_direct/spirv/g * Only specialize intrinsic functions with predicates * regenerate vs projects * squash warnings * squash warnings * remove duplication * Silence warnings from msvc * squash warnings * Overload for zero sized array * More msvc warnings * warnings * Add spirv-tools to path for tests * Do not be specific about dxc version for diag test * Normalize line endings from spirv-dis * Correct filecheck matches * Temporarily disable two spirv tests Failing on CI, undebuggable hang :/ * Do not emit storage class more than once for spirv snippet * Do not pass spir-v to spirv-dis by stdin * Do not get spirv-dis output via stream, use file * normalize file endings in spirv-dis output
* Update target-deps.json (#3103)Yong He2023-08-14
| | | | | | | | | | | * Update target-deps.json Update glslang binaries. * Fix. --------- Co-authored-by: Yong He <yhe@nvidia.com>
* Make sure glsl source in spirv is included when compiling with -g3 (#3099)Yong He2023-08-11
| | | | | | | | | | | * Make sure glsl source in spirv is included when compiling with -g3. * Exclude vulkan tests on github linux CI. * Fix. --------- Co-authored-by: Yong He <yhe@nvidia.com>
* Fix `Texture2D.Load()` with offset. (#3094)Yong He2023-08-10
| | | Co-authored-by: Yong He <yhe@nvidia.com>
* Allow member lookup through modified type. (#3091)Yong He2023-08-10
| | | | | | | | | * Allow member lookup through modified type. * Disable `lockFileSync` test. --------- Co-authored-by: Yong He <yhe@nvidia.com>
* Support implciit casted swizzled lvalue. (#3077)Yong He2023-08-09
| | | | | | | | | | | | | | | | | * 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>
* Various fixes in GLSL emit. (#3074)Yong He2023-08-09
| | | | | | | | | | | | | * Fix name mangling of modified types. * Add `InterlockedAdd(__ref uint, int)` overload. * Fix. * Fix type error in ImageStore legalization. --------- Co-authored-by: Yong He <yhe@nvidia.com>
* Add warning on mutation of function parameter (#3067)Theresa Foley2023-08-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By default, function parameters in HLSL are mutable, but any changes to a parameter do not affect the values of the arguments after a call: void f(int a) { a++; // allowed, but kind of useless } ... int b = 0; f(b); // b is still zero Because the above behavior is a part of HLSL, we cannot easily diagnose such cases as errors without breaking backward compatibility with existing code. This change makes it an error to invoke a `[mutating]` method on a function parameter, which cannot affect backward compatibility since the notion of `[mutating]` methods is not present in existing HLSL code: struct Counter { int _state; [mutating] void increment() { _state++; } } void f(Counter a) { a.increment(); // ERROR } ... Counter b = { 0 }; f(b); // b is still zero The compiler will also diagnose calls to `[mutating]` methods on a field or array element extracted out of a function parameter. This change does not affect code that directly mutates a function parameter via assignment, or via passing the parameter onward as an argument to an `out` or `inout` call (or, equivalently, as the left-hand operand to a compound assignment operator). This is a breaking change to existing Slang code, since it could diagnose an error on code that used to be allowed. Indeed, two tests in the Slang test suite had to be updated to avoid such errors. It would be possible to turn this diagnostic into a warning, and simply encourage users to enable it as an error. On balance, though, it seems best to not allow this idiom since it has such a high probability to be an error. Note: the specific case that motivated this change is use of `RayQuery` values as function parameters. The root of the problem there is that dxc treats `RayQuery` values as copyable handles to mutable state, while Slang prefers to capture the mutation that occurs through marking the appropriate methods as `[mutating]`. The Slang approach makes portable codegen for D3D/Vulkan simpler, but requires that we *also* treat a type like `RayQuery` as non-copyable. This change does not address the problem that the Slang compiler does not enforce the requirement that values of non-copyable types do not get copied. Instead, the diagnostic here just happens to issue a diagnostic in one important case where a copy would typically occur. Co-authored-by: Yong He <yonghe@outlook.com>
* Fix push constant on global variables. (#3034)Yong He2023-07-27
| | | Co-authored-by: Yong He <yhe@nvidia.com>
* Fix -fvk-u-shift not applying to global constant buffer. (#3033)Yong He2023-07-27
| | | | | | | | | | | | | * Fix -fvk-u-shift not applying to global constant buffer. * Fix test. * Fix. * Fix. --------- Co-authored-by: Yong He <yhe@nvidia.com>
* Fix scalar swizzle causes invalid glsl output. (#3028)Yong He2023-07-26
| | | | | | | | | | | | | * Fix -fvk-u-shift not applying to RWStructuredBuffer on glsl output. * Add `transpose` to `ObjectToWorld4x3`. * Fix scalar swizzle causes invalid glsl output. Fixes #3026. --------- Co-authored-by: Yong He <yhe@nvidia.com>
* Fix for vk-shift-* GLSL emit issue (#3004)jsmall-nvidia2023-07-20
| | | | | | | | | | * Handle different resource kinds that can appear via the vk-shift-* allowing some HLSL kinds in GLSL emit. * Determine the used kind for emit. * Added vk-shift-uniform-issue.slang * Use a better function name. Improve comments.
* Fix hit object emit for HLSL + FuncType specialization bug fix. (#2976)Yong He2023-07-10
| | | | | | | | | | | * Fix hit object emit for HLSL. * Fix a bug involving specialization of functon type. * Add a test case. --------- Co-authored-by: Yong He <yhe@nvidia.com>
* Fix erroneous error claiming variable is being used before its declaration ↵Ellie Hermaszewska2023-07-06
| | | | | | | | | | | | | | | | | | | (#2958) * Simplify type of diagnoseImpl * Show source line for Note diagnostics, opting out of this where appropriate * Make declared after use diagnostic clearer * Fix erroneous error claiming variable is being used before its declaration Closes https://github.com/shader-slang/slang/issues/2936 * Fix build on msvc --------- Co-authored-by: jsmall-nvidia <jsmall@nvidia.com>
* Disable l-value coercion for ref types (#2960)jsmall-nvidia2023-07-05
| | | | | * Make lvalue coercion not work for ref, to stop problem with atomics (for GLSL output). * Improve some comments.
* Fix for operator assignment issue (#2951)jsmall-nvidia2023-06-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * WIP handling LValue coercion via LValueImplicitCast * Need to have the ptr type for the cast. * Casting conversion working on C++. * Make the LValue casts record if in or in/out as we can produce better code if we know the difference. * WIP LValueCast pass * Fix tests so we don't fail because downstream compilers detect use of uninitialized variable. * Do conversions through through tmp for l-value scenarios that can't work other ways. * Fix a typo. * Change diagnostic implicit-cast-lvalue for a type that still exhibits the issue. * Add matrix test. * Added a bit more clarity around LValue casting choices. * Small comment improvements. Improvements based on comments on PR. * Use findOuterGeneric.
* Small fixes to GLSL-legalize and func-property prop. (#2950)Yong He2023-06-29
| | | Co-authored-by: Yong He <yhe@nvidia.com>
* Fix parameter block loads in GLSL emit. (#2946)Yong He2023-06-28
| | | | | | | | | | | * Fix parameter block loads in GLSL emit. * Revert `[NoSideEffect]` declarations in DXR1.1 API. * fix. --------- Co-authored-by: Yong He <yhe@nvidia.com>
* Support for infinite literal of from 34.2432#INF (#2944)jsmall-nvidia2023-06-27
|
* Fix DCE on mutable calls in a loop. (#2943)Yong He2023-06-26
| | | | | | | | | | | | | * Fix DCE on mutable calls in a loop. * More accurate in-loop test. * code review fixes. * Fix. --------- Co-authored-by: Yong He <yhe@nvidia.com>
* Handling SV_ClipDistance system semantic on GLSL/VK (#2942)jsmall-nvidia2023-06-26
| | | | | | | | | | | | | | | | | | | | | * Small fixes and improvements around reflection tool. * Make PrettyWriter printing a class. * WIP support for gl_ClipDistance * Working but doesn't have layout. * Check out param works with gl_ClipDistance. * Test clip distance works with out parameters. * Enable file check. * Add a test that splits clip distance writing. --------- Co-authored-by: Yong He <yonghe@outlook.com>
* Multiple cast issue fix (#2940)jsmall-nvidia2023-06-26
| | | | | | | | | | | | | * Small fixes and improvements around reflection tool. * Make PrettyWriter printing a class. * WIP parens casting issue. * Fix issue with multiple casts. * Match previous location point for casting, with 'fast' path. * Removed logic to output the found decl, as not needed to construct ExplicitCastExpr.
* Allow multiple attributes to not require separating comma (#2939)jsmall-nvidia2023-06-22
| | | | | | | | | * #include an absolute path didn't work - because paths were taken to always be relative. * Small fixes and improvements around reflection tool. * Make PrettyWriter printing a class. * Allow attributes without comma separation.
* [branch] and [flatten] support (#2928)jsmall-nvidia2023-06-22
| | | | | | | | | | | * #include an absolute path didn't work - because paths were taken to always be relative. * Small fixes and improvements around reflection tool. * Make PrettyWriter printing a class. * Add HLSL output support for [flatten] and [branch] * Handle [branch] on switch.
* Fix for generic with scope issue (#2925)jsmall-nvidia2023-06-20
| | | | | | | | | | | | | | | | | * Small fixes and improvements around reflection tool. * Make PrettyWriter printing a class. * Sundary improvements around StringBlob. * Fix for generic scope issue. * Fix expected output. * Add scope-generic test. --------- Co-authored-by: Theresa Foley <10618364+tangent-vector@users.noreply.github.com>
* Disallow duplicate enumerator names in the same enum (#2904)Ellie Hermaszewska2023-05-30
| | | Fixes https://github.com/shader-slang/slang/issues/2895
* Various dxc/fxc compatibility fixes. (#2863)Yong He2023-05-02
| | | | | | | | | | | | | * Various dxc/fxc compatibility fixes. * Cleanup. * Fix test cases. * Fix comments. --------- Co-authored-by: Yong He <yhe@nvidia.com>
* Fix scalar swizzle write. (#2801)Yong He2023-04-13
| | | Co-authored-by: Yong He <yhe@nvidia.com>
* Add inherit interface test. (#2800)Yong He2023-04-13
| | | | | Fixes #2573. Co-authored-by: Yong He <yhe@nvidia.com>
* Implement FileCheck tests for several test commands (#2747)Ellie Hermaszewska2023-04-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add missing expected.txt for test * Diagnostics -> StdWriters in render test * Allow specifying several test prefixes to run `slang-test -- tests/foo tests/bar` * Squash warnings in some tests * Enable gfx debug layer in gfx test util Makes this issue present consistently: https://github.com/shader-slang/slang/issues/2766 * Allow DebugDevice to return interfaces instantiated by the debugged object * Check that we actaully have a shader cache for shader cache tests * Implement FileCheck tests for several test commands - SIMPLE, SIMPLE_EX - SIMPLE_LINE - REFLECTION, CPU_REFLECTION - CROSS_COMPILE It does not currently support the render tests or the COMPARE_COMPUTE commands It is invoked by adding `(filecheck=MY_FILECHECK_PREFIX)` to the test command, for example TEST:CROSS_COMPILE(filecheck=SPIRV): -target spirv-assembly * Move LLVM FileCheck interface to slang-llvm * Neaten slang-test tests * Refine handling of expected output in slang-test * Add example FileCheck buffer test * Add cuda-kernel-export tests Which were waiting on FileCheck * Bump vs project files * Make createLLVMFileCheck_V1 return a void* rather than specifically an IFileCheck * Remove use of CharSlice from filecheck interface * Bump slang-llvm version --------- Co-authored-by: jsmall-nvidia <jsmall@nvidia.com>
* Emit simpler vector element access code. (#2770)Yong He2023-04-03
| | | | | | | | | * Emit simpler vector element access code * Fix. --------- Co-authored-by: Yong He <yhe@nvidia.com>
* Fix several silently failing tests (#2767)Ellie Hermaszewska2023-04-02
| | | | | | | | | | | | | | | | | | | | | | | * Add missing expected.txt for test * Diagnostics -> StdWriters in render test * Allow specifying several test prefixes to run `slang-test -- tests/foo tests/bar` * Squash warnings in some tests * Enable gfx debug layer in gfx test util Makes this issue present consistently: https://github.com/shader-slang/slang/issues/2766 * Allow DebugDevice to return interfaces instantiated by the debugged object * Check that we actaully have a shader cache for shader cache tests --------- Co-authored-by: Yong He <yonghe@outlook.com>
* Upgrade `slang-llvm` (#2741)jsmall-nvidia2023-03-27
| | | | | | | | | | | | | | | | | | * #include an absolute path didn't work - because paths were taken to always be relative. * Fix SlangCompileTarget to keep ordering. * Add test. Remove V2 version of interface to access IDownstreamCompiler Update to slang-llvm which has _chkstk support. * Update slang.h Co-authored-by: Ellie Hermaszewska <github@sub.monoid.al> --------- Co-authored-by: Yong He <yonghe@outlook.com> Co-authored-by: Ellie Hermaszewska <github@sub.monoid.al>
* Apply IR simplifcation immediately after specialization to avoid duplicates. ↵Yong He2023-03-27
| | | | | | | | | | | | | | (#2739) * Apply IR simplifcation immediately after specialization to avoid duplicates. * Update source/slang/slang-ir-specialize.cpp Co-authored-by: Ellie Hermaszewska <github@sub.monoid.al> --------- Co-authored-by: Yong He <yhe@nvidia.com> Co-authored-by: Ellie Hermaszewska <github@sub.monoid.al>
* Fix optimization pass not converging. (#2725)Yong He2023-03-23
| | | | | | | | | | | * Fix optimization pass not converging. * Fix. * Fix tests. --------- Co-authored-by: Yong He <yhe@nvidia.com>
* Fix scope fixing for address insts. (#2724)Yong He2023-03-23
| | | Co-authored-by: Yong He <yhe@nvidia.com>
* Type legalization and autodiff bug fixes. (#2722)Yong He2023-03-22
| | | | | | | | | | | | | | | | | | | | | * Bug fixes. * Fix. * Only perform autodiff for functions whose derivative is actually used. * Fix loop optimize bug. * Fix high order diff. * Fix trivial diff func generation. * Fixes. * Cleanup. --------- Co-authored-by: Yong He <yhe@nvidia.com>
* Fix IntVal type check. (#2718)Yong He2023-03-21
| | | | | | | | | * Fix IntVal type check. * add test case result. --------- Co-authored-by: Yong He <yhe@nvidia.com>
* Fix name mangling of `FuncCallIntVal` in func signatures. (#2709)Yong He2023-03-16
| | | | | | | | | | | | | * Fix name mangling of `FuncCallIntVal` in func signatures. * Enhance the test. * Fix. * Fix. --------- Co-authored-by: Yong He <yhe@nvidia.com>
* Detect and deduplicate read-only resource access. (#2680)Yong He2023-02-27
| | | | | | | | | | | * Detect and deduplicate read-only resource access. * Fix tests. * Fix tests. --------- Co-authored-by: Yong He <yhe@nvidia.com>
* More control flow simplifications. (#2673)Yong He2023-02-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* Overhaul global inst deduplication and cpp/cuda backend. (#2654)Yong He2023-02-16
| | | | | | | | | * Overhaul global inst deduplication and cpp/cuda backend. * Update IR documentation. --------- Co-authored-by: Yong He <yhe@nvidia.com>
* Take into account existing initializer list type when performing coercions ↵Ellie Hermaszewska2023-02-11
| | | | | (#2641) Fixes https://github.com/shader-slang/slang/issues/2189