Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#--- simple_64bit.hlsl
// double
[[vk::constant_id(0)]]
const double spec_double = 0.0;
RWStructuredBuffer<double> 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}} ]
12 changes: 0 additions & 12 deletions test/Feature/SpecializationConstant/spec_const_other_sizes.test
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
#--- simple_64bit.hlsl
// double
[[vk::constant_id(0)]]
const double spec_double = 0.0;
RWStructuredBuffer<double> OutDouble : register(u0, space0);

// short
[[vk::constant_id(1)]]
Expand All @@ -16,7 +12,6 @@ RWStructuredBuffer<uint16_t> 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;
}
Expand All @@ -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 }
Expand All @@ -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 ]
Loading