diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/hlsl-intrinsic/countbits8.slang | 4 | ||||
| -rw-r--r-- | tests/metal/8bit-vector-types.slang | 24 | ||||
| -rw-r--r-- | tests/metal/byte-address-buffer.slang | 2 |
3 files changed, 27 insertions, 3 deletions
diff --git a/tests/hlsl-intrinsic/countbits8.slang b/tests/hlsl-intrinsic/countbits8.slang index 0426b5682..c73d815a5 100644 --- a/tests/hlsl-intrinsic/countbits8.slang +++ b/tests/hlsl-intrinsic/countbits8.slang @@ -1,8 +1,8 @@ //TEST(compute):COMPARE_COMPUTE_EX(filecheck-buffer=CHK):-slang -compute -cpu //TEST(compute):COMPARE_COMPUTE_EX(filecheck-buffer=CHK):-slang -vk -compute //TEST(compute):COMPARE_COMPUTE_EX(filecheck-buffer=CHK):-slang -cuda -compute -//TODO: metal is currently failing even with emulation, investigate. -//DISABLE_TEST(compute):COMPARE_COMPUTE_EX(filecheck-buffer=CHK):-slang -mtl -compute -profile metallib_2_4 +//TODO: metal was previously failing but should work now after fixing vector type names +//TEST(compute):COMPARE_COMPUTE_EX(filecheck-buffer=CHK):-slang -mtl -compute -profile metallib_2_4 // Not testing the following: // -dx12/hlsl, No support for uint8_t with hlsl // -wgpu, only has 32-bit support diff --git a/tests/metal/8bit-vector-types.slang b/tests/metal/8bit-vector-types.slang new file mode 100644 index 000000000..8bfb65fc8 --- /dev/null +++ b/tests/metal/8bit-vector-types.slang @@ -0,0 +1,24 @@ +//TEST:SIMPLE(filecheck=CHECK): -target metal -stage compute -entry computeMain + +RWStructuredBuffer<uint> outputBuffer; + +uint8_t2 createUChar2() +{ + return uint8_t2(1, 2); +} + +int8_t2 createChar2() +{ + return int8_t2(3, 4); +} + +[numthreads(1, 1, 1)] +void computeMain() +{ + // CHECK: uchar2 + // CHECK: char2 + uint8_t2 u8v2 = createUChar2(); + int8_t2 i8v2 = createChar2(); + + outputBuffer[0] = u8v2.x + i8v2.x; +}
\ No newline at end of file diff --git a/tests/metal/byte-address-buffer.slang b/tests/metal/byte-address-buffer.slang index 8514dafe6..c0fb6b6b2 100644 --- a/tests/metal/byte-address-buffer.slang +++ b/tests/metal/byte-address-buffer.slang @@ -18,7 +18,7 @@ struct TestStruct void main_kernel(uint3 tid: SV_DispatchThreadID) { // CHECK: uint [[WORD0:[a-zA-Z0-9_]+]] = as_type<uint>({{.*}}[(0U)>>2]); - // CHECK: uint8_t [[A:[a-zA-Z0-9_]+]] = uint8_t(([[WORD0]] >> 0U) & 255U); + // CHECK: uchar [[A:[a-zA-Z0-9_]+]] = uchar(([[WORD0]] >> 0U) & 255U); // CHECK: uint [[WORD1:[a-zA-Z0-9_]+]] = as_type<uint>({{.*}}[(0U)>>2]); // CHECK: half [[H:[a-zA-Z0-9_]+]] = as_type<half>(ushort(([[WORD1]] >> 16U) & 65535U)); |
