Skip to content
Merged
Changes from 1 commit
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
65 changes: 65 additions & 0 deletions test/Feature/HLSLLib/D3DCOLORtoUBYTE4.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#--- source.hlsl
StructuredBuffer<float4> In0 : register(t0);

RWStructuredBuffer<uint4> Out0 : register(u1);


Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
StructuredBuffer<float4> In0 : register(t0);
RWStructuredBuffer<uint4> Out0 : register(u1);
StructuredBuffer<float4> In0 : register(t0);
RWStructuredBuffer<uint4> Out0 : register(u1);

[numthreads(1,1,1)]
void main() {

Out0[0] = D3DCOLORtoUBYTE4(In0[0]);
Out0[1] = D3DCOLORtoUBYTE4(float4(0, 11.11, -50.5, 100));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit:

Suggested change
Out0[0] = D3DCOLORtoUBYTE4(In0[0]);
Out0[1] = D3DCOLORtoUBYTE4(float4(0, 11.11, -50.5, 100));
Out0[0] = D3DCOLORtoUBYTE4(In0[0]);
Out0[1] = D3DCOLORtoUBYTE4(float4(0, 11.11, -50.5, 100));

}
//--- pipeline.yaml

---
Shaders:
- Stage: Compute
Entry: main
DispatchSize: [1, 1, 1]
Buffers:
- Name: In0
Format: Float32
Stride: 16
Data: [0, 11.11, -50.5, 100]
- Name: Out0
Format: UInt32
Stride: 16
ZeroInitSize: 32
- Name: ExpectedOut0
Format: UInt32
Stride: 16
Data: [ 4294954419, 2833, 0, 25500, 4294954419, 2833, 0, 25500 ]
Results:
- Result: Test0
Rule: BufferExact
Actual: Out0
Expected: ExpectedOut0
DescriptorSets:
- Resources:
- Name: In0
Kind: StructuredBuffer
DirectXBinding:
Register: 0
Space: 0
VulkanBinding:
Binding: 0
- Name: Out0
Kind: RWStructuredBuffer
DirectXBinding:
Register: 1
Space: 0
VulkanBinding:
Binding: 1
#--- end

# https://github.com/llvm/llvm-project/issues/150673
# XFAIL: Clang-DirectX

# https://github.com/llvm/llvm-project/issues/149561
# https://github.com/llvm/llvm-project/issues/150678
# XFAIL: Clang-Vulkan

# RUN: split-file %s %t
# RUN: %dxc_target -HV 202x -T cs_6_5 -Fo %t.o %t/source.hlsl
# RUN: %offloader %t/pipeline.yaml %t.o
Loading