Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions test/Feature/HLSLLib/isinf.32.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
#--- source.hlsl

StructuredBuffer<float4> In : register(t0);
RWStructuredBuffer<bool4> Out : register(u1);

[numthreads(1,1,1)]
void main() {
Out[0] = isinf(In[0]);
Out[1].xyz = isinf(In[0].xyz);
Out[1].w = isinf(In[0].w);
Out[2].xy = isinf(In[0].xy);
}

//--- pipeline.yaml

---
Shaders:
- Stage: Compute
Entry: main
DispatchSize: [1, 1, 1]
Buffers:
- Name: In
Format: Float32
Stride: 16
Data: [inf, -inf, 1.0, nan] # Inf, -Inf, 1, Nan
- Name: Out
Format: Bool
Stride: 16
ZeroInitSize: 48
- Name: ExpectedOut # The result we expect
Format: Bool
Stride: 16
Data: [1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0]
Results:
- Result: Test1
Rule: BufferExact
Actual: Out
Expected: ExpectedOut
DescriptorSets:
- Resources:
- Name: In
Kind: StructuredBuffer
DirectXBinding:
Register: 0
Space: 0
VulkanBinding:
Binding: 0
- Name: Out
Kind: RWStructuredBuffer
DirectXBinding:
Register: 1
Space: 0
VulkanBinding:
Binding: 1
...
#--- end

# https://github.com/microsoft/DirectXShaderCompiler/issues/7475
# XFAIL: DXC-Vulkan

# RUN: split-file %s %t
# RUN: %dxc_target -T cs_6_5 -Fo %t.o %t/source.hlsl
# RUN: %offloader %t/pipeline.yaml %t.o
64 changes: 64 additions & 0 deletions test/Feature/HLSLLib/isinf.fp16.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#--- source.hlsl

StructuredBuffer<half4> In : register(t0);
RWStructuredBuffer<bool4> Out : register(u1);

[numthreads(1,1,1)]
void main() {
Out[0] = isinf(In[0]);
Out[1].xyz = isinf(In[0].xyz);
Out[1].w = isinf(In[0].w);
Out[2].xy = isinf(In[0].xy);
}

//--- pipeline.yaml

---
Shaders:
- Stage: Compute
Entry: main
DispatchSize: [1, 1, 1]
Buffers:
- Name: In
Format: Float16
Stride: 8
Data: [0x7c00, 0xfc00, 0x3c00, 0x7e00] # Inf, -Inf, 1, Nan
- Name: Out
Format: Bool
Stride: 16
ZeroInitSize: 48
- Name: ExpectedOut # The result we expect
Format: Bool
Stride: 16
Data: [1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0]
Results:
- Result: Test1
Rule: BufferExact
Actual: Out
Expected: ExpectedOut
DescriptorSets:
- Resources:
- Name: In
Kind: StructuredBuffer
DirectXBinding:
Register: 0
Space: 0
VulkanBinding:
Binding: 0
- Name: Out
Kind: RWStructuredBuffer
DirectXBinding:
Register: 1
Space: 0
VulkanBinding:
Binding: 1
...
#--- end

# https://github.com/microsoft/DirectXShaderCompiler/issues/7475
# XFAIL: DXC-Vulkan

# REQUIRES: Half
# RUN: split-file %s %t
# RUN: %dxc_target -enable-16bit-types -T cs_6_5 -Fo %t.o %t/source.hlsl
# RUN: %offloader %t/pipeline.yaml %t.o
Loading