diff --git a/test/Feature/SpecializationConstant/spec_const.f64.test b/test/Feature/SpecializationConstant/spec_const.f64.test new file mode 100644 index 000000000..44c0c9de5 --- /dev/null +++ b/test/Feature/SpecializationConstant/spec_const.f64.test @@ -0,0 +1,43 @@ +#--- simple_64bit.hlsl +// double +[[vk::constant_id(0)]] +const double spec_double = 0.0; +RWStructuredBuffer OutDouble : register(u0, space0); + +[numthreads(1,1,1)] +void main(uint GI : SV_GroupIndex) { + OutDouble[GI] = spec_double; +} +#--- simple_64bit.yaml +--- +Shaders: + - Stage: Compute + Entry: main + DispatchSize: [1, 1, 1] + SpecializationConstants: + - { ConstantID: 0, Value: 2.718, Type: Float64 } +Buffers: + - { Name: OutDouble, Format: Float64, Stride: 8, FillSize: 8 } +DescriptorSets: + - Resources: + - Name: OutDouble + Kind: RWStructuredBuffer + DirectXBinding: { Register: 0, Space: 0 } + VulkanBinding: { Binding: 0 } +... +#--- end + +# REQUIRES: Vulkan +# REQUIRES: Double + +# Bug https://github.com/microsoft/DirectXShaderCompiler/issues/7886 +# XFAIL: DXC + +# Bug https://github.com/llvm/offload-test-suite/issues/554 +# XFAIL: QC + +# RUN: split-file %s %t +# RUN: %dxc_target -T cs_6_2 -enable-16bit-types -Fo %t.o %t/simple_64bit.hlsl +# RUN: %offloader %t/simple_64bit.yaml %t.o | FileCheck %s + +# CHECK: Data: [ {{2.718}} ] diff --git a/test/Feature/SpecializationConstant/spec_const_other_sizes.test b/test/Feature/SpecializationConstant/spec_const_other_sizes.test index e7060e427..f4d4e31e7 100644 --- a/test/Feature/SpecializationConstant/spec_const_other_sizes.test +++ b/test/Feature/SpecializationConstant/spec_const_other_sizes.test @@ -1,8 +1,4 @@ #--- simple_64bit.hlsl -// double -[[vk::constant_id(0)]] -const double spec_double = 0.0; -RWStructuredBuffer OutDouble : register(u0, space0); // short [[vk::constant_id(1)]] @@ -16,7 +12,6 @@ RWStructuredBuffer OutUShort : register(u2, space0); [numthreads(1,1,1)] void main(uint GI : SV_GroupIndex) { - OutDouble[GI] = spec_double; OutShort[GI] = spec_short; OutUShort[GI] = spec_ushort; } @@ -27,19 +22,13 @@ Shaders: Entry: main DispatchSize: [1, 1, 1] SpecializationConstants: - - { ConstantID: 0, Value: 2.718, Type: Float64 } - { ConstantID: 1, Value: 123, Type: Int16 } - { ConstantID: 2, Value: 456, Type: UInt16 } Buffers: - - { Name: OutDouble, Format: Float64, Stride: 8, FillSize: 8 } - { Name: OutShort, Format: Int16, Stride: 2, FillSize: 2 } - { Name: OutUShort, Format: UInt16, Stride: 2, FillSize: 2 } DescriptorSets: - Resources: - - Name: OutDouble - Kind: RWStructuredBuffer - DirectXBinding: { Register: 0, Space: 0 } - VulkanBinding: { Binding: 0 } - Name: OutShort Kind: RWStructuredBuffer DirectXBinding: { Register: 1, Space: 0 } @@ -63,6 +52,5 @@ DescriptorSets: # RUN: %dxc_target -T cs_6_2 -enable-16bit-types -Fo %t.o %t/simple_64bit.hlsl # RUN: %offloader %t/simple_64bit.yaml %t.o | FileCheck %s -# CHECK: Data: [ {{2.718}} ] # CHECK: Data: [ 123 ] # CHECK: Data: [ 456 ]