forked from llvm-beanz/HLSLTest
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce a simpler StructuredBuffer test
This moves the current structured buffer test to a new file and introduces a simpler one that doesn't need llvm/llvm-project#104503 and llvm/llvm-project#121010 to be in place in order to pass. Note: this would be better if it exercised both SRVs and UAVs, but SRV support isn't implemented in the test framework yet.
- Loading branch information
Showing
2 changed files
with
78 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#--- source.hlsl | ||
struct Doggo { | ||
int3 Legs; | ||
int TailState; | ||
int2 Ears; | ||
}; | ||
|
||
RWStructuredBuffer<Doggo> Buf; | ||
|
||
[numthreads(2,1,1)] | ||
void main(uint GI : SV_GroupIndex) { | ||
Doggo Fido = Buf[GI]; | ||
if (Fido.TailState == 0) { | ||
Fido.TailState = Fido.Legs.x + Fido.Legs.y + Fido.Legs.z; | ||
} | ||
Buf[GI] = Fido; | ||
} | ||
//--- pipeline.yaml | ||
--- | ||
DispatchSize: [1, 1, 1] | ||
DescriptorSets: | ||
- Resources: | ||
- Access: ReadWrite | ||
Format: Int32 | ||
RawSize: 24 | ||
Data: [ 0, 1, 2, 0, 4, 0, 1, 2, 3, 0, 4, 0] | ||
DirectXBinding: | ||
Register: 0 | ||
Space: 0 | ||
... | ||
#--- end | ||
|
||
# UNSUPPORTED: Clang | ||
# RUN: split-file %s %t | ||
# RUN: %if DirectX %{ dxc -T cs_6_0 -Fo %t.dxil %t/source.hlsl %} | ||
# RUN: %if DirectX %{ %offloader %t/pipeline.yaml %t.dxil | FileCheck %s %} | ||
# RUN: %if Vulkan %{ dxc -T cs_6_0 -spirv -fspv-target-env=vulkan1.3 -fvk-use-scalar-layout -Fo %t.spv %t/source.hlsl %} | ||
# RUN: %if Vulkan %{ %offloader %t/pipeline.yaml %t.spv | FileCheck %s %} | ||
|
||
# RUN: %if Metal %{ dxc -T cs_6_0 -Fo %t.dxil %t/source.hlsl %} | ||
# RUN: %if Metal %{ metal-shaderconverter %t.dxil -o=%t.metallib %} | ||
# RUN: %if Metal %{ %offloader %t/pipeline.yaml %t.metallib | FileCheck %s %} | ||
|
||
|
||
# CHECK: Data: [ 0, 1, 2, 3, 4, 0, 1, 2, 3, 6, 4, 0 ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters