summaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
2024-11-29Emit OpExecutionMode SpacingEqual for Domain stage (#5696)Jay Kwak
Domain stage should emit one more `OpExecutionMode` with `SpacingEqual`, similary to how Hull stage does. Currently Hull stage emits four OpExecutionMode as following: OpExecutionMode %hullMain SpacingEqual OpExecutionMode %hullMain OutputVertices 4 OpExecutionMode %hullMain VertexOrderCw OpExecutionMode %hullMain Quads And Domain stage emits only one OpExecutionMode: OpExecutionMode %domainMain Quads This commit adds the following instruction for Domain stage: OpExecutionMode %domainMain SpacingEqual It is because the Vulkan Validation Layer prints error when the Domain shader didn't have `OpeExecutionMode SpacingEqual`. `SpacingEqual` corresponds to an attribute, `[partitioning("integer")]`, given to the Hull stage. Although Domain stage is not marked with same attribute, it is assumed to use the same value used for matching Hull Stage. The error message from VVL is following: ``` vkCreateShadersEXT(): pCreateInfos[2].stage is VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT, but spacing is not specified. The Vulkan spec states: If codeType is VK_SHADER_CODE_TYPE_SPIRV_EXT, and stage is VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT, pCode must contain an OpExecutionMode instruction specifying the spacing of segments on the edges of tessellated primitives (https://vulkan.lunarg.com/doc/view/1.3.283.0/windows/1.3-extensions/vkspec.html#VUID-VkShaderCreateInfoEXT-codeType-08874) ``` Co-authored-by: Ellie Hermaszewska <ellieh@nvidia.com>
2024-11-29Explain why tests/autodiff/diff-ptr-type-array.slang is disabled for WGPU ↵Anders Leino
(#5702) This closes #5613. Co-authored-by: Ellie Hermaszewska <ellieh@nvidia.com>
2024-11-29Support nonuniformEXT for GLSL (#5695)Jay Kwak
Adding nonuniformEXT intrinsic for GLSL Co-authored-by: Ellie Hermaszewska <ellieh@nvidia.com>
2024-11-29Add missing WGSL intrinsics to test (#5663)Ellie Hermaszewska
Closes https://github.com/shader-slang/slang/issues/5263
2024-11-28Update Slang-RHI/slang (#5701)Anders Leino
* Update Slang-RHI/slang This brings in new fixes for WebGPU. In particular, the "use_dxc" toggle is now used, which should enable these tests to run on WebGPU, if f16 is otherwise supported: - `tests/language-feature/generics/variadic-0.slang` - `tests/language-feature/generics/tuple.slang` This closes #5605. * Disable tests/autodiff/float-cast.slang for wgpu This test was previously not running for WebGPU because it required the 'half' render feature, and Slang-RHI was previously not reporting it. With the Slang-RHI update, the test now runs on WebGPU. It now fails because the test is using 'double' which is just not supported on WebGPU. Thus this commit disables the test.
2024-11-28wgsl: signedness mismatch fixes (#5692)Anders Leino
* Enable tests/language-feature/enums/strongly-typed-id.slang * Fix operator signedness mismatch issue This helps to address issue #5606. * wgsl: Insert casts for integer type return values This closes #5606. * format code --------- Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
2024-11-28wgsl: Conditionally enable some tests based on 'half' support (#5694)Anders Leino
Require the 'half' rendering feature for WebGPU, so that we can detect when the f16 feature is not available, for the following tests: - tests/language-feature/generics/tuple.slang - tests/language-feature/generics/variadic-0.slang This helps to address issue #5605.
2024-11-26WGSL: Fix issue where swizzle L-values are generated (#5682)Anders Leino
* wgsl: Do not generate L-value swizzle expressions * Enable tests/language-feature/swizzles/matrix-swizzle-write-*.slang The following tests are enabled - tests/language-feature/swizzles/matrix-swizzle-write-swizzle.slang - tests/language-feature/swizzles/matrix-swizzle-write-array.slang This closes #5603.
2024-11-26wgpu: Enable Metal-like legalization for byte addressible buffers (#5681)Anders Leino
* Enable hlsl-intrinsic/byte-address-buffer/byte-address-struct * Set byte address buffer legalization options for WGSL
2024-11-25Support interpolation modifiers for WGSL (#5641)Anders Leino
* wgsl: Support interpolation modifiers * Move struct key decorations to flattened structs. ** This includes interpolation mode decorations, which must be in the flattened struct. * Emit interpolation attribute. * Enable tests/render/nointerpolation.hlsl for WGSL, as a result. This closes #5625. * Add new expected output for 'nointerpolation' test
2024-11-25Fix issue where inter-stage parameters without semantics don't get location ↵Anders Leino
attributes (#5670) * wgsl: Make sure each shader input field has a semantic This closes #5633. * Add test for inter-stage variables without semantics This verifies the fix of the second issue identified in https://github.com/shader-slang/slang/issues/5633 * format code --------- Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
2024-11-25wgsl: Fix field semantics even if input struct doesn't need flattening (#5642)Anders Leino
* wgsl: Fix field semantics even if input struct doesn't need flattening Helps to address issue #5633. * Add test for multiple stage IO locations This verifies part of issue #5633.
2024-11-22[AD] Add support for resolving custom derivatives where generic parameters ↵Sai Praveen Bangaru
can't be automatically inferred (#5630) * [AD] Add support for resolving custom derivatives where generic parameters can't be automatically inferred * Fix failing tests * Update custom-derivative-generic.slang
2024-11-22Don't treat StrcturedBuffer<IFoo> as a specializable param. (#5645)Yong He
* Don't treat StrcturedBuffer<IFoo> as a specializable param. * Fix RHI.
2024-11-22Add explanation for disabled WGPU tests (#5628)Anders Leino
2024-11-21Add datalayout for constant buffers. (#5608)Yong He
* Add datalayout for constant buffers. * Fixes. * Fix test. * Fix glsl codegen. * Update spirv-specific doc. * Fix test. * Fix binding in the presense of specialization constants. * address comments. * Add a test for constant buffer layout.
2024-11-21Enable some rendering tests (#5623)Anders Leino
* render-test: Add copy-source usage for render targets I found that Slang-RHI/WGPU was not able to copy from render targets to staging buffers. This helps to address issue #4943. * Add entries to render API util infos Entries for glsl-cross and glsl-rewrite are added. Without glsl-cross, slang-test fails to select a back-end, and winds up crashing when tests/render/cross-compile-entry-point.slang is enabled tests/render/cross-compile0.hlsl fails similarly without glsl-rewrite. * Enable some rendering tests * Add expected test outputs
2024-11-21Refresh of disabled WGPU tests (#5614)Anders Leino
Some tests are now passing and are enabled. Other tests are still failing, but are given comments categorizing the failures. Tests in the 'Not supported in WGSL' category are also removed from the expected failures list. (Though they are still kept disabled for WebGPU, of course.) This closes #5519.
2024-11-20Change how DeclRef::toText works (#5592)Sai Praveen Bangaru
* Change how DeclRef::toText works We now ignore the decl-ref heirarchy since that only includes nodes with specialization info & simply walk up the tree of decls, while emitting any specializations present in the decl-ref. * Update some tests. Add cases for direct refs to generic params & Lookup decl refs
2024-11-20Add Matrix overload for exp10() core lib function (#5620)bprb
Fixes #5579
2024-11-20Enable WGPU texture sampling test (#5617)Anders Leino
* Limit number of MIP levels on 1d textures to be 1 This avoids running into a WebGPU limitation, and helps to address issue #4943. * Update Slang-RHI to get WGPU fixes * Enable WGPU texture sampling test This helps to address issue #4943. --------- Co-authored-by: Yong He <yonghe@outlook.com>
2024-11-20Fix WGPU test by provding TEST_INPUT for outputBuffer (#5611)Anders Leino
This makes tests/bugs/shadowed-lookup.slang pass on WGPU. The underlying issue seems similar to #5277.
2024-11-20WGSL: Support isnan, isinf, etc.. (#5609)Anders Leino
2024-11-19Fix wgsl legalization around __ref parameter. (#5597)Yong He
* Fix wgsl legalization around __ref parameter. * Add intrinsic and test case.
2024-11-19Fix specialization constant miscompile in glsl mode. (#5568)Yong He
Co-authored-by: Ellie Hermaszewska <ellieh@nvidia.com>
2024-11-18Remove "GL_EXT_samplerless_texture_functions" from combined sampler ↵Yong He
functions. (#5585)
2024-11-18Add `IDifferentiablePtrType` support for arrays (#5576)Sai Praveen Bangaru
* Add `IDifferentiablePtrType` support for arrays - Also fixes an issue with spirv-emit of constructors that contain references to global params * Fix GLSL legalization for arrays of resource types
2024-11-14Insert some casts for WGSL texture attribute queries (#5560)Anders Leino
* Add new texture sampling test for WebGPU There are no 1d array textures in WGSL, so add texture-sampling-no-1d-arrays.slang based on texture-sampling.slang, but without 1d texture arrays. This helps to address issue #4943. * Insert needed conversion when querying texture attributes in WGSL This helps to address issue #4943. --------- Co-authored-by: Yong He <yonghe@outlook.com>
2024-11-13Various fixes to enable some WGSL graphics tests (#5548)Anders Leino
* Update Slang-RHI to get WGPU backend fixes * render-test: Use device local memory type for vertex buffers This helps to avoid https://github.com/shader-slang/slang-rhi/issues/104 * Fix bug in WGSL emitter layout code. There was a "kinds" vs. "kind flags" mismatch, and also getBindingOffsetForKinds was not being used. This patch enables a bunch of tests for WGPU. This helps to address issue #4943. * format code --------- Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
2024-11-12Push buffer load to end of access chain. (#5544)Yong He
* Push buffer load to end of access chain. * Update test. * Fix. * Fix. * Fix. * Make more robust. * Fix.
2024-11-11Transfer offset decorations when legalizing laid-out structs (#5525)Anders Leino
* Transfer offset decorations when legalizing laid-out structs Struct legalization removing fields not representable in memory should transfer all decorations in case the struct has already had offsets calculated. Closes #5264. * format code --------- Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com> Co-authored-by: Yong He <yonghe@outlook.com>
2024-11-08Require GL_EXT_samplerless_texture_functions only if needed (#5527)cheneym2
* Require GL_EXT_samplerless_texture_functions only if needed This extension is only necessary when using texture functions on non-combined texture/samplers. Fixes #5518
2024-11-07Fix user-attribute-lookup wgpu crash (#5510)cheneym2
The WGPU backend was crashing because of the unbound sampler state. Fix the test by adding a test sampler. Issue 5277 Co-authored-by: Ellie Hermaszewska <ellieh@nvidia.com>
2024-11-07Enable a bunch of WGPU tests (#5513)Anders Leino
This closes issue #5505.
2024-11-07Fix CUDA prelude for makeMatrix (#5509)Yong He
* Fix CUDA prelude for makeMatrix * Add regression test.
2024-11-06Fix IntVal unification logic to insert type casts + buffer element lowering ↵Yong He
regression. (#5508) * Fix IntVal unification logic to insert type casts. * Fix regression.
2024-11-06Fix WGSL parameter block binding. (#5500)Yong He
* Fix WGSL parameter block binding. * Re-enable tests. * Update failure list. * Fix entrypoint parameters. * Update tests. * Enable stat-var test.
2024-11-06[WGSL] Enable arbitrary arrays in uniform buffers. (#5497)Yong He
* [WGSL] Enable arbitrary arrays in uniform buffers. * format code * Undo irrelevant change and fixups. * Update expected failure list. * Fix. * Rename. --------- Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
2024-11-06Make various parameters and return types require specialization when ↵Anders Leino
targeting WGSL (#5483) Structured buffer types translate to array types in the WGSL emitter. WGSL doesn't allow passing runtime-sized arrays to functions. Similarly for pointers to texture handles. Also, structured buffers (runtime-sized arrays) cannot be returned in WGSL. This closes issue #5228, issue #5278 and issue #5288 by enabling specialized functions to be generated in these cases, in order to work around these constraints.
2024-11-05Legalize the Entry-point for WGSL (#5498)Jay Kwak
* Legalize the Entry-point for WGSL The return type of the entry-point needs to be legalized when targeting WGSL. This commit flattens the nested-structs of the return type and the input parameters of the entry-point. Most of code is copied from the legalization code for Metal. The following functions are exactly same to the implementation for Metal or almost same. - flattenInputParameters() : 136 lines - reportUnsupportedSystemAttribute() : 7 lines - ensureResultStructHasUserSemantic() : 46 lines - struct MapStructToFlatStruct : 176 lines - flattenNestedStructs() : 95 lines - maybeFlattenNestedStructs() : 42 lines - _replaceAllReturnInst() : 19 lines - _returnNonOverlappingAttributeIndex() : 16 lines - _replaceAttributeOfLayout() : 23 lines - tryConvertValue() : 41 lines - legalizeSystemValueParameters() : 11 lines They need to be refactored to reduce the duplication later. The test case, `tests/compute/assoctype-lookup.slang`, had a bug that the compute shader was trying to use the varying input/output with the user defined semantics. This commit removes the user defined semantics, because the compute shaders cannot use the user defined semantics. --------- Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
2024-11-05Fix system semantics of SV_GroupIndex (#5496)kaizhangNV
Close the issue #4940.
2024-11-05Fix issue of infinity float literal (#5489)kaizhangNV
* Fix issue of infinity float literal * add parameters for the test * Correct the way to construct inf and nan In WGSL, expression of "1.0/0.0" is not allowed, it will report compile error, so to construct infinity or nan, we have to assign the float literal to a variable and then use it to bypass the compile error. By doing so, we add getInfinity and getNan functions to the builtin prelude to wgsl. --------- Co-authored-by: Yong He <yonghe@outlook.com>
2024-11-05Update slang-rhi and fix error handling (#5485)cheneym2
Update slang-rhi to pick up a fix in webgpu compilation error handling. In doRenderComparisonTestRun(), only return TestResult::Pass if the shader is ran actually compiled. A similar check is in place elsewhere in slang-test-main, but was missed in doRenderComparisonTestRun(). Add two tests to the github CI skiplist, and use the skiplist in one additional CI config that was running without it. Closes 5291
2024-11-05Fixing the wrong implementation of some math intrinsic (#5491)kaizhangNV
* Fixing the wrong implementation of some math intrinsic Close the issue #5282 The root cause of the issue is that log10 is not supported in wgsl. So add the implementation. Also ldexp in wgsl doesn't support float type exponent, so fix the implementation of the intrinsic. * re-enable the tests
2024-11-04Various WGSL fixes. (#5490)Yong He
* [WGSL] make sure switch has a default label. * Various WGSL fixes. * Update rhi submodule commit * format code * Remove unnecessary DISABLE_TEST directive on not applicable test. * Matrix comp mul + `select`. * Legalize binary ops for wgsl. --------- Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
2024-11-02Allow enum cases to be used in attribute arguments. (#5478)Yong He
2024-11-02Revert uint<->int implicit cast cost to prefer promotion to unsigned. (#5480)Yong He
2024-11-01Enable a few more WGPU tests (#5476)Anders Leino
* Enable tests/compute/func-cbuffer-param * Enable tests/language-feature/tuple/tuple-parameter.slang
2024-11-01Update Slang-RHI again to get more WGPU fixes (#5475)Anders Leino
This fixes a teardown crash, and a buffer usage mismatch issue during bind group creation. These Slang-RHI fixes allow several WGPU tests to be enabled: - tests/compute/column-major.slang - tests/compute/constant-buffer-memory-packing.slang - tests/compute/matrix-layout.hlsl - tests/compute/non-square-column-major.slang - tests/compute/row-major.slang - tests/hlsl/packoffset.slang This helps to address issue #5222.
2024-10-30Constant-fold for the type-casting in switch-case labels (#5436)Jay Kwak