diff options
| author | venkataram-nv <vedavamadath@nvidia.com> | 2024-06-27 07:18:02 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-06-27 07:18:02 -0700 |
| commit | 7751963f14544fdb6d606a8017f58d131c852ad2 (patch) | |
| tree | f8750c95ea8c95cb1a30e88a673f33138fa60928 /source | |
| parent | 4dd41de7558b2b3b7fe99b4b624dc91969031abe (diff) | |
Implement `uint2` variant of `asdouble` intrinsic (#4488)
* Implement asdouble2 intrinsic and tests
Fixes #4437
Adds a new asdouble2 intrinsic for all platforms except Metal.
Extends the test for asdouble to test asdouble2 as well.
Diffstat (limited to 'source')
| -rw-r--r-- | source/slang/hlsl.meta.slang | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/source/slang/hlsl.meta.slang b/source/slang/hlsl.meta.slang index d9e7b9d66..909bebb0d 100644 --- a/source/slang/hlsl.meta.slang +++ b/source/slang/hlsl.meta.slang @@ -5695,6 +5695,20 @@ double asdouble(uint lowbits, uint highbits) } } +__glsl_extension(GL_ARB_gpu_shader5) +[__readNone] +[require(cpp_cuda_glsl_hlsl_spirv, shader5_sm_5_0)] +double2 asdouble(uint2 lowbits, uint2 highbits) +{ + __target_switch + { + case hlsl: + __intrinsic_asm "asdouble($0, $1)"; + default: + return double2(asdouble(lowbits.x, highbits.x), asdouble(lowbits.y, highbits.y)); + } +} + // Reinterpret bits as a float (HLSL SM 4.0) [__readNone] |
