diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/compute/half-texture.slang | 2 | ||||
| -rw-r--r-- | tests/compute/half-texture.slang.1.expected | 45 | ||||
| -rw-r--r-- | tests/compute/half-texture.slang.hlsl | 26 | ||||
| -rw-r--r-- | tests/language-feature/types/modifiers/snorm-modifier.slang | 18 | ||||
| -rw-r--r-- | tests/language-feature/types/modifiers/unorm-modifier.slang | 19 |
5 files changed, 64 insertions, 46 deletions
diff --git a/tests/compute/half-texture.slang b/tests/compute/half-texture.slang index 1cb73dadd..6f131c568 100644 --- a/tests/compute/half-texture.slang +++ b/tests/compute/half-texture.slang @@ -1,5 +1,5 @@ //TEST:CROSS_COMPILE: -target spirv -entry computeMain -profile cs_6_2 -//TEST:SIMPLE: -target hlsl -entry computeMain -profile cs_6_2 +//TEST:CROSS_COMPILE: -target dxil-assembly -entry computeMain -profile cs_6_2 //TEST_INPUT:ubuffer(data=[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0], stride=16):out RWStructuredBuffer<int> outputBuffer; diff --git a/tests/compute/half-texture.slang.1.expected b/tests/compute/half-texture.slang.1.expected deleted file mode 100644 index 7dd96403f..000000000 --- a/tests/compute/half-texture.slang.1.expected +++ /dev/null @@ -1,45 +0,0 @@ -result code = 0 -standard error = { -} -standard output = { -#pragma pack_matrix(column_major) - -#line 8 "tests/compute/half-texture.slang" -RWTexture2D<half > halfTexture_0 : register(u1); - -RWTexture2D<vector<half,2> > halfTexture2_0 : register(u2); - -RWTexture2D<vector<half,4> > halfTexture4_0 : register(u3); - - -#line 5 -RWStructuredBuffer<int > outputBuffer_0 : register(u0); - - -#line 18 -[shader("compute")][numthreads(4, 4, 1)] -void computeMain(vector<uint,3> dispatchThreadID_0 : SV_DISPATCHTHREADID) -{ - -#line 20 - vector<int,2> pos_0 = (vector<int,2>) dispatchThreadID_0.xy; - float _S1 = 1.00000000000000000000 / 3.00000000000000000000; - vector<int,2> pos2_0 = vector<int,2>(int(3) - pos_0.y, int(3) - pos_0.x); - -#line 29 - half h_0 = halfTexture_0[(vector<uint,2>) pos2_0]; - vector<half,2> h2_0 = halfTexture2_0[(vector<uint,2>) pos2_0]; - vector<half,4> h4_0 = halfTexture4_0[(vector<uint,2>) pos2_0]; - - - - halfTexture_0[(vector<uint,2>) pos_0] = h2_0.x + h2_0.y; - halfTexture2_0[(vector<uint,2>) pos_0] = h4_0.xy; - halfTexture4_0[(vector<uint,2>) pos_0] = vector<half,4>(h2_0, h_0, h_0); - - int index_0 = pos_0.x + pos_0.y * int(4); - outputBuffer_0[(uint) index_0] = index_0; - return; -} - -} diff --git a/tests/compute/half-texture.slang.hlsl b/tests/compute/half-texture.slang.hlsl new file mode 100644 index 000000000..c606703a4 --- /dev/null +++ b/tests/compute/half-texture.slang.hlsl @@ -0,0 +1,26 @@ +//TEST_IGNORE_FILE: +RWTexture2D<half > halfTexture_0 : register(u1); +RWTexture2D<vector<half,2> > halfTexture2_0 : register(u2); +RWTexture2D<vector<half,4> > halfTexture4_0 : register(u3); + +RWStructuredBuffer<int > outputBuffer_0 : register(u0); + +[shader("compute")][numthreads(4, 4, 1)] +void computeMain(uint3 dispatchThreadID_0 : SV_DISPATCHTHREADID) +{ + int2 pos_0 = (int2) dispatchThreadID_0.xy; + float _S1 = 1.00000000000000000000 / 3.00000000000000000000; + int2 pos2_0 = int2(int(3) - pos_0.y, int(3) - pos_0.x); + + half h_0 = halfTexture_0[(uint2) pos2_0]; + vector<half,2> h2_0 = halfTexture2_0[(uint2) pos2_0]; + vector<half,4> h4_0 = halfTexture4_0[(uint2) pos2_0]; + + halfTexture_0[(uint2) pos_0] = h2_0.x + h2_0.y; + halfTexture2_0[(uint2) pos_0] = h4_0.xy; + halfTexture4_0[(uint2) pos_0] = vector<half,4>(h2_0, h_0, h_0); + + int index_0 = pos_0.x + pos_0.y * int(4); + outputBuffer_0[(uint) index_0] = index_0; + return; +} diff --git a/tests/language-feature/types/modifiers/snorm-modifier.slang b/tests/language-feature/types/modifiers/snorm-modifier.slang new file mode 100644 index 000000000..cd8bfb691 --- /dev/null +++ b/tests/language-feature/types/modifiers/snorm-modifier.slang @@ -0,0 +1,18 @@ +// snorm-modifier.slang + +//TEST:COMPARE_HLSL:-profile cs_5_0 -entry main + +#ifndef __SLANG__ +#define input input_0 +#define output output_0 +#endif + +Buffer<snorm float4> input; +RWStructuredBuffer<float4> output; + +[numthreads(4, 1, 1)] +void main(uint3 dispatchThreadID : SV_DispatchThreadID) +{ + uint tid = dispatchThreadID.x; + output[tid] = input[tid]; +} diff --git a/tests/language-feature/types/modifiers/unorm-modifier.slang b/tests/language-feature/types/modifiers/unorm-modifier.slang new file mode 100644 index 000000000..8ef851437 --- /dev/null +++ b/tests/language-feature/types/modifiers/unorm-modifier.slang @@ -0,0 +1,19 @@ +// unorm-modifier.slang + +//TEST:COMPARE_HLSL:-profile cs_5_0 -entry main + +#ifndef __SLANG__ +#define input input_0 +#define output output_0 +#endif + + +Buffer<unorm float4> input; +RWStructuredBuffer<float4> output; + +[numthreads(4, 1, 1)] +void main(uint3 dispatchThreadID : SV_DispatchThreadID) +{ + uint tid = dispatchThreadID.x; + output[tid] = input[tid]; +} |
