Skip to content

add test for D3DCOLORtoUBYTE4 #300

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 12, 2025
Merged
Changes from all 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
59 changes: 59 additions & 0 deletions test/Feature/HLSLLib/D3DCOLORtoUBYTE4.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#--- source.hlsl
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));
}
//--- 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/149561
# 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