Skip to content

Commit f7b9455

Browse files
spallhekota
andauthored
add test for D3DCOLORtoUBYTE4 (#300)
Add test for D3DCOLORtoUBYTE4 for input type of float4. Closes #178 --------- Co-authored-by: Helena Kotas <[email protected]>
1 parent 4bea2f6 commit f7b9455

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
#--- source.hlsl
2+
StructuredBuffer<float4> In0 : register(t0);
3+
RWStructuredBuffer<uint4> Out0 : register(u1);
4+
5+
[numthreads(1,1,1)]
6+
void main() {
7+
Out0[0] = D3DCOLORtoUBYTE4(In0[0]);
8+
Out0[1] = D3DCOLORtoUBYTE4(float4(0, 11.11, -50.5, 100));
9+
}
10+
//--- pipeline.yaml
11+
12+
---
13+
Shaders:
14+
- Stage: Compute
15+
Entry: main
16+
DispatchSize: [1, 1, 1]
17+
Buffers:
18+
- Name: In0
19+
Format: Float32
20+
Stride: 16
21+
Data: [0, 11.11, -50.5, 100]
22+
- Name: Out0
23+
Format: UInt32
24+
Stride: 16
25+
ZeroInitSize: 32
26+
- Name: ExpectedOut0
27+
Format: UInt32
28+
Stride: 16
29+
Data: [ 4294954419, 2833, 0, 25500, 4294954419, 2833, 0, 25500 ]
30+
Results:
31+
- Result: Test0
32+
Rule: BufferExact
33+
Actual: Out0
34+
Expected: ExpectedOut0
35+
DescriptorSets:
36+
- Resources:
37+
- Name: In0
38+
Kind: StructuredBuffer
39+
DirectXBinding:
40+
Register: 0
41+
Space: 0
42+
VulkanBinding:
43+
Binding: 0
44+
- Name: Out0
45+
Kind: RWStructuredBuffer
46+
DirectXBinding:
47+
Register: 1
48+
Space: 0
49+
VulkanBinding:
50+
Binding: 1
51+
#--- end
52+
53+
54+
# https://github.com/llvm/llvm-project/issues/149561
55+
# XFAIL: Clang-Vulkan
56+
57+
# RUN: split-file %s %t
58+
# RUN: %dxc_target -HV 202x -T cs_6_5 -Fo %t.o %t/source.hlsl
59+
# RUN: %offloader %t/pipeline.yaml %t.o

0 commit comments

Comments
 (0)