From 341dabcc16c1cd7214a2602ab8c68ad7418cb3b3 Mon Sep 17 00:00:00 2001 From: Sarah Spall Date: Fri, 25 Jul 2025 11:47:35 -0700 Subject: [PATCH 1/3] test for D3DCOLORtoUBYTE4 --- test/Feature/HLSLLib/D3DCOLORtoUBYTE4.test | 65 ++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 test/Feature/HLSLLib/D3DCOLORtoUBYTE4.test diff --git a/test/Feature/HLSLLib/D3DCOLORtoUBYTE4.test b/test/Feature/HLSLLib/D3DCOLORtoUBYTE4.test new file mode 100644 index 00000000..4c0b328c --- /dev/null +++ b/test/Feature/HLSLLib/D3DCOLORtoUBYTE4.test @@ -0,0 +1,65 @@ +#--- source.hlsl +StructuredBuffer In0 : register(t0); + +RWStructuredBuffer 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/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 From 1c514f999458ad022d76695e3f063f016bbbb447 Mon Sep 17 00:00:00 2001 From: Sarah Spall Date: Mon, 11 Aug 2025 13:42:28 -0700 Subject: [PATCH 2/3] respond to comments and remove xfail for fixed issues --- test/Feature/HLSLLib/D3DCOLORtoUBYTE4.test | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/test/Feature/HLSLLib/D3DCOLORtoUBYTE4.test b/test/Feature/HLSLLib/D3DCOLORtoUBYTE4.test index 4c0b328c..ce0c991f 100644 --- a/test/Feature/HLSLLib/D3DCOLORtoUBYTE4.test +++ b/test/Feature/HLSLLib/D3DCOLORtoUBYTE4.test @@ -1,14 +1,12 @@ #--- source.hlsl StructuredBuffer In0 : register(t0); - RWStructuredBuffer Out0 : register(u1); - [numthreads(1,1,1)] void main() { -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 @@ -53,11 +51,8 @@ DescriptorSets: 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 From ed87e61effc559b11f066cb49f34eeb2775221df Mon Sep 17 00:00:00 2001 From: Sarah Spall Date: Tue, 12 Aug 2025 07:03:15 -0700 Subject: [PATCH 3/3] Update test/Feature/HLSLLib/D3DCOLORtoUBYTE4.test Co-authored-by: Helena Kotas --- test/Feature/HLSLLib/D3DCOLORtoUBYTE4.test | 1 - 1 file changed, 1 deletion(-) diff --git a/test/Feature/HLSLLib/D3DCOLORtoUBYTE4.test b/test/Feature/HLSLLib/D3DCOLORtoUBYTE4.test index ce0c991f..dbf75ff7 100644 --- a/test/Feature/HLSLLib/D3DCOLORtoUBYTE4.test +++ b/test/Feature/HLSLLib/D3DCOLORtoUBYTE4.test @@ -4,7 +4,6 @@ RWStructuredBuffer Out0 : register(u1); [numthreads(1,1,1)] void main() { - Out0[0] = D3DCOLORtoUBYTE4(In0[0]); Out0[1] = D3DCOLORtoUBYTE4(float4(0, 11.11, -50.5, 100)); }