5692879 | kaizhangNV | 27 March 2024, 20:30:34 UTC | Fix incorrect SPV stride for unsized array (#3837) * 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> | 27 March 2024, 20:30:34 UTC |
b346a93 | Yong He | 27 March 2024, 20:03:28 UTC | Allow var/param names to be the same as type name. (#3850) | 27 March 2024, 20:03:28 UTC |
8395acf | Yong He | 27 March 2024, 19:21:07 UTC | Fix lookup to prevent finding `typedef` itself. (#3848) | 27 March 2024, 19:21:07 UTC |
c5369d5 | Shannon Woods | 27 March 2024, 17:54:00 UTC | Update README.md with tables for platform & target support (#3847) Adds tables to README.md for quick reference of which platforms and targets are supported. Links to detailed information in user guide. Bug Id: shader-slang/slang #3667 | 27 March 2024, 17:54:00 UTC |
c37e3ee | Yong He | 27 March 2024, 02:59:55 UTC | Fix parsing issue around __transparent_block. (#3842) | 27 March 2024, 02:59:55 UTC |
dfdf243 | Yong He | 27 March 2024, 00:35:24 UTC | Support mutable existential parameters. (#3836) * Support mutable existential parameters. * Update test. | 27 March 2024, 00:35:24 UTC |
0877d1a | ArielG-NV | 26 March 2024, 20:07:32 UTC | Implement GLSL gimageDim & memory qualifiers with optional extension(s); resolves #3587 for GLSL & SPIR-V targets #3631 (#3810) * [early push of code since memory qualifiers may be made into a seperate branch & pr and I rather make it simple to split the implementation if required] all type & functions impl. for GLSL image type added all memory qualifiers & tests for direct read/write [GLSL syntax] (DID NOT test or implement parameter qualifiers, that is next commit) * this inlcudes emit-glsl & emit-spirv for qualifier decorations * this also includes error handling * this includes parsing * full implementation other than Rect; all errors and basic tests are done & working what is left: 1. need to now add Rect type support (additional TextureImpl flag) 2. tests 3. testing infrastructure to support variety of types * testing framework now works with images of all types and imageBuffers -- next steps are actual tests * push code for mostly working image atomics; missing int64/uint64 tests and slightly broken feature likley due to missing code from master which I pushed for regular atomics * fix all remaining shader image atomic issues and tests to work with float & i64/u64 fully will now clean up code and squash the commits (since they are quite all over the place) * refactor code to work & look correct, fix all regressions Turned off tests for texture format R64 due to the shader use limitation of currently being only for storage buffers on most hardware (test fail cause, this is not allowed) Changed raygen.slang & nv-ray-tracing-motion-blur.slang since both cross-compiled with glslang, which does not respect layout(rgba8) for RWBuffer's, in this scenario making the type into a SPIR-V rgba32f, which is incorrect and a known problem, this causes different code to be outputted from Slang & HLSL+GLSL->Slang paths Clean up all code and better explain the "why" for the gimageDim definition we use various strings of Slang code, the gist is: 1. Parameters are structured as per IMAGE_PARAM keyword in spec, and we respect this in order to match specification (to allow easy code iteration) 2. sample parameters are required for functions 3. types are inconsistently named fixed regression of breaking l-value lowering when r-value should be lowered (lower-to-ir) fix compiler warnings remove unneeded lambdas `expr->type.isLeftValue = isMutableGLSLBufferBlockVarExpr(baseExpr) && (expr->type.hasReadOnlyOnTarget == false);` is an adjustment made such that a buffer block is mutable only if the block is mutable and the base expression is mutable (to handle case of readonly buffer block, immutable) * remove rectangle parameter * use proper const syntax and struct naming * adjust syntax * adjust modifier capabilitites: HLSL+GLSL --> GLSL. Notice most specifically, if the parent is a global struct we can put a memory qualifier, this does not include, struct inside a struct, with a member variable with a memory qualifier (since then you could use the struct in invalid ways). Added test for struct inside struct with member variable with memory qualifier. adjust syntax and remove code which will rot * adjust formatting for consistency * addressing review feedback addressing review feedback: change testing code to handle int and float/half correctly in all cases adjust testing code syntax as requested change vkdevice code to fit a different form as requested * adjust code as per requested for review: 1. adjusted testing code logic to handle non 0-1 values appropriately, notice int8_t will likley be the range and set order of {[0,127],[-1,-128]}, this is intentional 2. syntax adjustments for correctness * trying to fix falcor regressions * add back removed code for regression testing * test removing changes which may break falcor * Revert "test removing changes which may break falcor" This reverts commit 240da97f06c23e98a26ac23cf1d385995c67b251. * disable R64 support in attempt to fix falcor tests * Revert "disable R64 support in attempt to fix falcor tests" This reverts commit 317cb632eb2f47e980fc4aeafe418f8060f4c473. * disable major device changes (still trying to figure out falcor fails -- locally working different than CI) * test removing d3d changes * remove all format changes * add back removed code for regression testing * try something to get code to work with falcor * address review * Add way to handle constref/ref/encapsulated texture objects with memory qualifiers as a parameter. Fixed an issue (and improved codegen) for when we have a store(dst,load(src)) pattern, where dst is supposed to be equal to src for when resolving globalParam's (no need for work-arounds anymore) * move recent-fix/change to textureType loading into a proper optimization pass which now runs after SPIR-V legalization to catch odd SPIR-V emitting after legalizing types for SPIR-V * Revert most recent optimization pass change, add work around getting a unmangled global parameter address through a intrinsic op instead of spir-v intrinsic (works same as `__imagePointer()`) * remove unneeded changes * remove unneeded `__constref` in glsl.meta * move memory qualifier checks to visitInvoke of check-expr.cpp move GetLegalizedSPIRVGlobalParamAddr resolving to spirv-legalization pass move error for "if using non texture type with memory qualifer in param" earlier such that we error with this first. No point in telling user "you are not putting correct memory qualifiers" when memory qualifiers should not have been used. * add memory qualifier folding modifier 'MemoryQualifierCollectionModifier' to reduce searching and processing (later will be adapted to whole system) as suggested/asked. The utility is a method to track memory qualifiers without doing a expensive linked-list traversal (image's have 4 modifiers normally). * properly pass multiple qualifiers from checkModifier down to the `modifier`s list * addressing review comments: * change implementation to properly handle restrict modifier * add comments about implementation for clarity | 26 March 2024, 20:07:32 UTC |
57f514d | kaizhangNV | 26 March 2024, 18:05:00 UTC | Fix the sign-extending issue in right shift (#3820) 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. | 26 March 2024, 18:05:00 UTC |
5c88619 | Yong He | 25 March 2024, 19:25:13 UTC | Fix default space assignment. (#3833) | 25 March 2024, 19:25:13 UTC |
cbe5526 | Yong He | 25 March 2024, 16:24:04 UTC | Fix missing PerPrimitive decoration in mesh shader output. (#3828) | 25 March 2024, 16:24:04 UTC |
c9df734 | Yong He | 23 March 2024, 18:25:51 UTC | Allow anonymous struct. (#3822) | 23 March 2024, 18:25:51 UTC |
a23adc2 | Yong He | 23 March 2024, 17:54:01 UTC | Make `-no-mangle` option work, add `-no-hlsl-binding`. (#3817) | 23 March 2024, 17:54:01 UTC |
9b0df14 | Jay Kwak | 22 March 2024, 16:07:44 UTC | Changes to make UE TSR working with Slang. (#3815) | 22 March 2024, 16:07:44 UTC |
0047473 | Yong He | 22 March 2024, 04:10:48 UTC | Partially implement vk_buffer_ref proposal. (#3814) | 22 March 2024, 04:10:48 UTC |
7a8ef89 | Yong He | 22 March 2024, 00:19:03 UTC | Support arrow operator `->` on pointers. (#3812) | 22 March 2024, 00:19:03 UTC |
dd32414 | Yong He | 21 March 2024, 22:45:27 UTC | Diagnose cyclic references in inheritance graph. (#3811) | 21 March 2024, 22:45:27 UTC |
9bd6b23 | Yong He | 21 March 2024, 21:21:36 UTC | Fix `TriangleStream` lowering. (#3809) | 21 March 2024, 21:21:36 UTC |
45c7d33 | Yong He | 20 March 2024, 22:47:36 UTC | Fix spirv generation for using output stream in a function. (#3806) * Fix spirv generation for using output stream in a function. * polish. | 20 March 2024, 22:47:36 UTC |
c371cce | Yong He | 20 March 2024, 22:11:39 UTC | Update a1-01-matrix-layout.md | 20 March 2024, 22:11:39 UTC |
c28a22f | Yong He | 20 March 2024, 20:33:13 UTC | Fix namespace parsing. (#3803) * Fix namespace parsing. * Fix. | 20 March 2024, 20:33:13 UTC |
04ffa84 | Yong He | 20 March 2024, 20:30:31 UTC | Update a1-01-matrix-layout.md | 20 March 2024, 20:30:31 UTC |
6cefb85 | kaizhangNV | 20 March 2024, 15:48:13 UTC | Change representation of float literal in language translation (#3798) * 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> | 20 March 2024, 15:48:13 UTC |
f3b1161 | Yong He | 20 March 2024, 04:12:48 UTC | Use static const in glsl.meta.slang. (#3801) | 20 March 2024, 04:12:48 UTC |
c2d4bcf | Yong He | 20 March 2024, 01:13:13 UTC | Add more cases for `isUniformParameterType`. (#3800) | 20 March 2024, 01:13:13 UTC |
1ee1688 | Yong He | 20 March 2024, 01:01:42 UTC | Fix type checking for constructors in generic interfaces. (#3799) | 20 March 2024, 01:01:42 UTC |
05f403b | Yong He | 20 March 2024, 00:02:02 UTC | Fix regression on pointer address space handling. (#3797) | 20 March 2024, 00:02:02 UTC |
2b55de9 | Yong He | 20 March 2024, 00:01:45 UTC | Fix inconsistent digest of precompiled module. (#3796) | 20 March 2024, 00:01:45 UTC |
50c268e | Sai Praveen Bangaru | 19 March 2024, 00:59:27 UTC | Swap `left` and `right` for matrix multiplication (#3777) Co-authored-by: Yong He <yonghe@outlook.com> | 19 March 2024, 00:59:27 UTC |
2bfde34 | Yong He | 19 March 2024, 00:59:08 UTC | Check cyclic types after specialization. (#3791) | 19 March 2024, 00:59:08 UTC |
26e25f6 | Yong He | 19 March 2024, 00:21:48 UTC | Check for cylic types. (#3790) | 19 March 2024, 00:21:48 UTC |
f96a3fe | Yong He | 18 March 2024, 23:41:40 UTC | Fix SPIRV for mesh shaders, checks for invalid target code&recursion. (#3788) * 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. | 18 March 2024, 23:41:40 UTC |
7f6e959 | Yong He | 18 March 2024, 22:16:15 UTC | Fix name mangling and source file finding logic for precompiled module validation. (#3784) * Fix name mangling. * Fix source validation. * Caching and search path fixes. | 18 March 2024, 22:16:15 UTC |
2d41012 | Yong He | 18 March 2024, 18:12:12 UTC | Update 09-reflection.md (#3787) | 18 March 2024, 18:12:12 UTC |
667e209 | Yong He | 17 March 2024, 22:17:28 UTC | Remove out of date documentation on compilation API. (#3785) * Remove out of date documentation on compilation API. * Update toc. | 17 March 2024, 22:17:28 UTC |
db60d19 | skallweitNV | 16 March 2024, 22:02:40 UTC | [gfx] compile shaders when creating programs for d3d12/vulkan (#3774) | 16 March 2024, 22:02:40 UTC |
9b434e5 | ArielG-NV | 15 March 2024, 20:14:32 UTC | Implement raytracing extension(s); resolves #3560 for GLSL & SPIR-V targets (#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. | 15 March 2024, 20:14:32 UTC |
9ee88a4 | skallweitNV | 15 March 2024, 17:25:21 UTC | [gfx] use CUDA driver API (#3776) | 15 March 2024, 17:25:21 UTC |
d40931c | Ellie Hermaszewska | 15 March 2024, 00:48:41 UTC | Mesh shader refactoring and bugfixes (#3702) | 15 March 2024, 00:48:41 UTC |
c7d7a96 | Yong He | 14 March 2024, 21:58:24 UTC | Support `#include` with angle brackets. (#3773) | 14 March 2024, 21:58:24 UTC |
f5f0740 | Yong He | 14 March 2024, 21:45:57 UTC | Support unscoped enums. (#3771) | 14 March 2024, 21:45:57 UTC |
78d4df0 | Yong He | 14 March 2024, 21:14:18 UTC | Add diagnostic on invalid type constraint. (#3769) | 14 March 2024, 21:14:18 UTC |
ba65c21 | Yong He | 14 March 2024, 20:43:42 UTC | Fix lowering of glsl builtin globals. (#3767) | 14 March 2024, 20:43:42 UTC |
73c0cd1 | Yong He | 14 March 2024, 01:55:32 UTC | Add cautionary desclaimers on interop mechanisms. (#3763) * Add cautionary desclaimers on interop mechanisms. * Fix. | 14 March 2024, 01:55:32 UTC |
67704d0 | Craig Kolb | 14 March 2024, 01:35:59 UTC | CMake fixes for MacOS (#3761) Co-authored-by: Yong He <yonghe@outlook.com> | 14 March 2024, 01:35:59 UTC |
e4b01c4 | Yong He | 14 March 2024, 01:35:42 UTC | Fix side effect checking around storage buffer type. (#3762) | 14 March 2024, 01:35:42 UTC |
25df6b8 | Yong He | 13 March 2024, 23:46:23 UTC | Fix crash when specializing generic entry points. (#3760) | 13 March 2024, 23:46:23 UTC |
5f0ee87 | Yong He | 13 March 2024, 19:17:01 UTC | Add wrapper type synthesis logic for constructors. (#3756) * Add wrapper type synthesis logic for constructors. * Fix. | 13 March 2024, 19:17:01 UTC |
9fd7437 | ArielG-NV | 13 March 2024, 19:03:16 UTC | Implement glsl atomic's [non image or memory scope] with optional extension(s); resolves #3587 for GLSL & SPIR-V targets (#3755) The following commit implements atomic operations & types associated with OpenGL 4.6, GL_EXT_vulkan_glsl_relaxed, GLSL_EXT_shader_atomic_float, GLSL_EXT_shader_atomic_float2, for GLSL & SPIR-V targets. Fully implements all functions, and built-in type's, resolves https://github.com/shader-slang/slang/issues/3560 for GLSL & SPRI-V targets. [Atomic extensions for GLSL can be found here](https://github.com/KhronosGroup/GLSL/tree/main) Notes of worth: * atomic_uint is well defined in GLSL->OpenGL, although was removed in GLSL->VK unless a compiler extension is supported (GL_EXT_vulkan_glsl_relaxed). This support entails transforming all atomic_uint operations and references into a storage buffer. SPIR-V has AtomicCounter+AtomicStorage (atomic_uint parallel) but does not implement these capabilities for SPIR-V->VK in any scenario. Due to the case we transform atomic_uint ourselves (GLSL_Syntax->Slang_IR) to accommodate transforming atomic_uint into valid syntax. * GLSL_EXT_shader_atomic_float2 (all float16_t & some float/double operations) support is minimal and worth watching out for if enabling the tests. | 13 March 2024, 19:03:16 UTC |
6f7c827 | Yong He | 13 March 2024, 02:31:25 UTC | Fix `sessionDesc.defaultMatrixLayoutMode` being ineffective. (#3753) * Fix `sessionDesc.defaultMatrixLayoutMode` being ineffective. * Fix matrix layout in buffer pointer. * Attempt to fix. * Fix buffer element type lowering for buffer pointers. * Add comment. * Fix test. * Fix member lookup in `Ref<T>`. * Fix validation error. * Enhance test. | 13 March 2024, 02:31:25 UTC |
eef7e20 | Yong He | 12 March 2024, 22:10:06 UTC | Fix derivative implementation of `clamp`. (#3750) | 12 March 2024, 22:10:06 UTC |
edc85fc | Yong He | 12 March 2024, 20:47:14 UTC | Make type names spec-conformant in SPIRV reflect. (#3748) * Preserve ByteAddressBuffer user type name. * Make user type lowercase. * Make typenames conform to spec. * Use `SpvOpDecorateString`. | 12 March 2024, 20:47:14 UTC |
8b51960 | Yong He | 12 March 2024, 18:56:10 UTC | [SPIRV] Fix OpMemberDecorateString. (#3747) | 12 March 2024, 18:56:10 UTC |
66a0d91 | dzysk | 12 March 2024, 18:37:43 UTC | Add nightly vkcts workflow (#3717) * Create vk-gl-cts-nightly.yml Action to run VK-GL-CTS expected slang passing test list nightly on schedule to run at 12am Pacific time. | 12 March 2024, 18:37:43 UTC |
8dc635a | skallweitNV | 12 March 2024, 17:33:37 UTC | gfx: return error when vulkan fails to create buffer/pipeline (#3741) * return buffer creation errors in vulkan * return pipeline creation errors in vulkan --------- Co-authored-by: Yong He <yonghe@outlook.com> | 12 March 2024, 17:33:37 UTC |
1c4e1ac | Yong He | 12 March 2024, 17:32:35 UTC | [SPIRV] Use VectorTimesScalar opcode. (#3737) * [SPIRV] Use VectorTimesScalar opcode. * Fix. | 12 March 2024, 17:32:35 UTC |
d8eb701 | Yong He | 12 March 2024, 17:01:11 UTC | Support emitting generic target_intrinsic type. (#3745) | 12 March 2024, 17:01:11 UTC |
a91af96 | Yong He | 11 March 2024, 22:46:59 UTC | Update 08-compiling.md | 11 March 2024, 22:46:59 UTC |
7c7fbd5 | Yong He | 11 March 2024, 21:52:16 UTC | Add `-fvk-use-dx-position-w` and fix ExecutionMode ordering for geometry shaders. (#3731) * Add `-fvk-use-dx-position-w`. * Fix ordering of OutputVertices and output primitive type decoration in spirv. * Fix. * fix * Fix. * Move test around. | 11 March 2024, 21:52:16 UTC |
1bbcf25 | Yong He | 11 March 2024, 21:42:14 UTC | Link-time specialization fixes. (#3734) * Fix method synthesis logic for static differentiable methods. * Support link-time constants in thread group size reflection. | 11 March 2024, 21:42:14 UTC |
25a7d51 | Yong He | 11 March 2024, 04:23:57 UTC | Fix spirv builtin for `SV_ShadingRate`. (#3730) | 11 March 2024, 04:23:57 UTC |
10c4d2e | Yong He | 11 March 2024, 04:02:36 UTC | Fix crash when trying to constant fold non-existent call. (#3728) | 11 March 2024, 04:02:36 UTC |
5074ee7 | Yong He | 09 March 2024, 02:09:13 UTC | Improve cpp prelude. (#3725) | 09 March 2024, 02:09:13 UTC |
0629b22 | Yong He | 09 March 2024, 02:08:24 UTC | Enhance link-time type test. (#3724) * Enhance link-time type test. * Fix. * Fix. | 09 March 2024, 02:08:24 UTC |
2150287 | Yong He | 09 March 2024, 00:33:04 UTC | Add documentation for uniformity analysis. (#3721) | 09 March 2024, 00:33:04 UTC |
bc3dc0e | Yong He | 09 March 2024, 00:32:37 UTC | Parser and module finding logic fixes. (#3720) * Fix parsing logic of `struct` decl. Fixes #3716. * Allow `loadModule` to find modules with underscores. * Fix test. | 09 March 2024, 00:32:37 UTC |
6f8a206 | Yong He | 08 March 2024, 23:13:08 UTC | [SPIRV] fix code gen for `SV_Coverage`. (#3718) * [SPIRV] fix code gen for `SV_Coverage`. * Fix #3714, #3699. * Fix. | 08 March 2024, 23:13:08 UTC |
5afe970 | tgrimesnv | 08 March 2024, 15:26:02 UTC | Add ray query intrinsic test (#3707) | 08 March 2024, 15:26:02 UTC |
faaa532 | Yong He | 08 March 2024, 07:44:19 UTC | [SPIRV] Fix pointer lowering bug. (#3713) * [SPIRV] Fix pointer lowering bug. * Update falcor CI setting. | 08 March 2024, 07:44:19 UTC |
a810aa3 | Yong He | 08 March 2024, 01:28:19 UTC | Link-time constant and linkage API improvements. (#3708) * Link-time constant and linkage API improvements. * Fix. * Allow module name to be empty. * Fix. * Fix. * Fix compile error. | 08 March 2024, 01:28:19 UTC |
6492906 | Yong He | 07 March 2024, 22:04:30 UTC | Fix SPIRV emit logic of `PrimitiveId` in fragment shader. (#3705) | 07 March 2024, 22:04:30 UTC |
240727d | Yong He | 07 March 2024, 21:19:44 UTC | Uniformity analysis. (#3704) * Uniformity analysis. * Add [NonUniformReturn] decorations to some hlsl intrinsic functions. | 07 March 2024, 21:19:44 UTC |
af108c7 | skallweitNV | 07 March 2024, 17:00:56 UTC | set VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT for device local memory (#3698) | 07 March 2024, 17:00:56 UTC |
a1e79e4 | kaizhangNV | 07 March 2024, 07:20:13 UTC | Fix the cuda left-hand swizzle issue (#3538) (#3691) | 07 March 2024, 07:20:13 UTC |
cc2a879 | kaizhangNV | 06 March 2024, 00:58:45 UTC | Integrate compile & validation test (#3674) Co-authored-by: Yong He <yonghe@outlook.com> | 06 March 2024, 00:58:45 UTC |
1cba7f3 | Pankaj Mistry | 05 March 2024, 22:44:27 UTC | Enable SampleCmpLevelZero tests and update the results (#3677) Fixes bug #3585 | 05 March 2024, 22:44:27 UTC |
f2e3257 | Yong He | 05 March 2024, 21:11:17 UTC | [slangc] generate an error when `-entry` is not specified for targets that require them. (#3679) * [slangc] generate an error when `-entry` is not specified for targets that require them. * Fix. * Fix. | 05 March 2024, 21:11:17 UTC |
8d4b659 | Yong He | 05 March 2024, 19:18:14 UTC | [SPIRV] Fix DebugLine generated from source with #line directive. (#3678) | 05 March 2024, 19:18:14 UTC |
bb017e6 | Yong He | 05 March 2024, 05:57:50 UTC | Extend `as` and `is` operator to work on generic types. (#3672) | 05 March 2024, 05:57:50 UTC |
2297623 | kaizhangNV | 05 March 2024, 04:55:50 UTC | Implement short-circuit logic operator (#3635) * Implement short-circuit logic operator Implement short-circuit evaluation for logic && and || operator. The short-circuit behavior is only used when the operands involved are scalar and the parent function is non-differentiable. In implementation, we define a new class 'LogicOperatorShortCircuitExpr' derived from 'OperatorExpr'. In the visitInvoke() call, we will create a new expression object 'LogicOperatorShortCircuitExpr' if the expression is logic && or ||. So that we can generate new IR code in the new visit function 'visitLogicOperatorShortCircuitExpr' to implement the short-circuit behavior. Add new test to test the short-circuit behavior. * Fix an compile issue occurred in Falcon test Previously, we early return when at least one of the operands of "&&" or "||" is vector in convertToLogicOperatorExpr call. However, in that case the arguments involved in the expression have already been type checked. When it falls-back to 'visitInvokeExpr', it will check the arguments again, and some unexpected behavior could occur which could in turn cause some internal error. So we add a check in the 'visitInvokeExpr' to avoid double type checking of arguments. * Update glsl subgroup test to not use short-circuit Since the short-circuit evaluation could cause the threads diverging in subgroup intrinsics. So change the test to not using "&&" to chain those subgroup intrinsics together. Instead, using "&" to chain them together because those test functions have the return value as bool. * Disable short-circuit in few situations Disable short-circuit in following situations: 1. generic parameter list 2. static const varible initialization * Use a flag to indicate the enablement of short-circuit Instead of using a struct to indicate the state of the outer environment of current expression, use a simple bool flag to indicate whether or not apply the short-circuit to current expression because there few situations where we will disable short-circuiting and in those circumstances, there is no nested. Therefore, a flag is good enough to indicate the case. * Disable short-circuit in index expression Also fix the build issue. (A cleanup for the last change.) * check both 'static' and 'const' modifiers Previously we only check HLSLStaticModifier to decide whether or not using short-circuit, but we really should check both 'static' and 'const' modifiers together, because we only want to disable the short circuit for init expression for 'static const' variable. * relax the restriction of short-circuit for index expression Disable the short-circuit for index expression only when declare an array. * Simplify the logic by creating subVisitor Simplify the logic by create a sub expression visitor so that we don't need to introduce extra recursion. * Call convertToLogicOperatorExpr after args check Change to call convertToLogicOperatorExpr after arguments check in visitInvokeExpr such that we don't have to check whether the arguments checked to avoid the double checking issue. | 05 March 2024, 04:55:50 UTC |
0371dee | Yong He | 04 March 2024, 22:15:22 UTC | Add user-guide section on pointers. (#3670) | 04 March 2024, 22:15:22 UTC |
01efe34 | Yong He | 04 March 2024, 21:14:21 UTC | Add `IGlobalSession::getSessionDescDigest`. (#3669) * Add `IGlobalSession::getSessionDescDigest`. * Fix. | 04 March 2024, 21:14:21 UTC |
16342f4 | Yong He | 04 March 2024, 20:11:40 UTC | Fix lowering logic around imported modules. (#3668) * Fix lowering logic around imported modules. * Use actual source loc when emitting SPIRV. | 04 March 2024, 20:11:40 UTC |
f8c5405 | Yong He | 04 March 2024, 06:16:49 UTC | Fix SPIRV pointer codegen. (#3664) | 04 March 2024, 06:16:49 UTC |
a4919e3 | Yong He | 02 March 2024, 00:11:43 UTC | Enable debug info for swizzledStore. (#3659) | 02 March 2024, 00:11:43 UTC |
9a1e327 | Yong He | 01 March 2024, 23:24:16 UTC | Make slangc commandline parsing compatible with renderdoc. (#3658) * Make slangc commandline parsing compatible with renderdoc. * Fix tests. | 01 March 2024, 23:24:16 UTC |
e752a95 | Yong He | 01 March 2024, 21:48:46 UTC | Update doc TOC (#3657) | 01 March 2024, 21:48:46 UTC |
ff48854 | Yong He | 01 March 2024, 21:39:25 UTC | Add documentation for debugging. (#3656) * Add documentation for debugging. * typo | 01 March 2024, 21:39:25 UTC |
cc9ada1 | Ellie Hermaszewska | 01 March 2024, 21:19:19 UTC | Small cleanups for bitfield accessor synthesis (#3651) * Remove duplicate function * neaten --------- Co-authored-by: Yong He <yonghe@outlook.com> | 01 March 2024, 21:19:19 UTC |
a4ba7d6 | Ellie Hermaszewska | 01 March 2024, 20:43:26 UTC | warnings (#3653) * Remove unused code * unused variable warnings * unused variable --------- Co-authored-by: Yong He <yonghe@outlook.com> | 01 March 2024, 20:43:26 UTC |
0d01b37 | Yong He | 01 March 2024, 20:42:37 UTC | Various SPIRV fixes. (#3655) * Various SPIRV fixes. * Fix debugValue. | 01 March 2024, 20:42:37 UTC |
3ade073 | Yong He | 01 March 2024, 02:02:53 UTC | Fix various crashes when generating debug info. (#3650) * Fix crash when generating debug info for geometry shaders. * Fix. * Fix source language field in DebugCompilationUnit. * Fix. * Emit DebugEntryPoint inst. * Add trivial test. * Cleanup. * More cleanup. | 01 March 2024, 02:02:53 UTC |
458d663 | Yong He | 29 February 2024, 19:42:49 UTC | [SPIRV] Fix logic for emitting debug matrix type. (#3649) | 29 February 2024, 19:42:49 UTC |
17da4d9 | Yong He | 29 February 2024, 18:00:43 UTC | [SPIRV Debug] Properly update output arguments after call. (#3648) | 29 February 2024, 18:00:43 UTC |
d979b50 | Ellie Hermaszewska | 29 February 2024, 17:50:19 UTC | Add support for bitfields (#3639) * Add support for bitfields Closes https://github.com/shader-slang/slang/issues/3559 * Set scopes for syntsized bitfield accessors * Simplify generated code for bitfield accessors * spelling * regenerate vs project * warnings | 29 February 2024, 17:50:19 UTC |
21f8677 | Yong He | 29 February 2024, 17:17:16 UTC | Fix crash in `insertDebugValueStore`. (#3647) | 29 February 2024, 17:17:16 UTC |
c6756d7 | Yong He | 29 February 2024, 07:26:51 UTC | Allow non-static const to be considered compile-time constant. (#3645) | 29 February 2024, 07:26:51 UTC |
73a61ed | Yong He | 29 February 2024, 06:57:07 UTC | [SPIRV] Add NonSemanticDebugInfo for step-through debugging. (#3644) * [SPIRV] Add NonSemanticDebugInfo for step-through debugging. * Fix. * Fix. | 29 February 2024, 06:57:07 UTC |
d2644e2 | Yong He | 27 February 2024, 22:23:25 UTC | Update documentation TOC. (#3641) | 27 February 2024, 22:23:25 UTC |
5c45608 | Yong He | 27 February 2024, 22:10:07 UTC | Update 08-compiling.md | 27 February 2024, 22:10:07 UTC |
11966f8 | Yong He | 27 February 2024, 22:03:08 UTC | Update doc links. (#3640) | 27 February 2024, 22:03:08 UTC |