-
Notifications
You must be signed in to change notification settings - Fork 28
Add multiple tests for semantics #648
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
Open
Keenuts
wants to merge
29
commits into
llvm:main
Choose a base branch
from
Keenuts:graphics
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
b6d7cb0
Add multiple tests for semantics
Keenuts 7d76204
fix XFAIL values
Keenuts 5b02dd1
improve test
Keenuts 0f84d63
test all values across all dims
Keenuts a728aae
make test robust to scheduling change
Keenuts ea693f9
add xfail for metal
Keenuts dadbf55
try setting the root signature before the desc table
Keenuts 91f33c6
Revert "try setting the root signature before the desc table"
Keenuts 7be3405
xfail on dx
Keenuts 41adbe6
marking xfail for clang+dx
Keenuts 324b599
add issue for DX XFAIL and remove SV_POS
Keenuts 87e4b9c
fix user semantic
Keenuts 22999d0
add issue to FIXME
Keenuts 81de9de
change framebuffer size
Keenuts efb1610
change array test for metal
Keenuts 7794453
remove descriptors
Keenuts 12ddf09
remove XFAIL for d3d
Keenuts 6b9187b
add readback barrier to D3D12 graphics
Keenuts 78c8b5c
Revert "remove descriptors"
Keenuts 6d5b301
set root signature before
Keenuts 254a4b8
remove XFAIL d3d12
Keenuts 18cdc1b
XFAIL metal
Keenuts 0327427
remove XFAIL for clang
Keenuts b59098a
pr-feedback
Keenuts 87ad712
move to semantic folder
Keenuts 5c96762
remove compute shader test
Keenuts 393ab4c
Merge branch 'main' into graphics
Keenuts 58776e4
make sure the correct buffer is checked
Keenuts 727bd67
fix bad comment
Keenuts File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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,76 @@ | ||
| #--- vertex.hlsl | ||
| struct VSInput { | ||
| float4 position : POSITION; | ||
| }; | ||
|
|
||
| struct VSOutput { | ||
| float4 position : SV_POSITION; | ||
| float arr[4] : MY_ARRAY; | ||
| }; | ||
|
|
||
| VSOutput main(VSInput input) { | ||
| VSOutput output; | ||
| output.position = input.position; | ||
| output.arr[0] = 0.5; | ||
| output.arr[1] = 1.0; | ||
| output.arr[2] = 0.0; | ||
| output.arr[3] = 1.0; | ||
| return output; | ||
| } | ||
|
|
||
| #--- pixel.hlsl | ||
| struct PSInput { | ||
| float4 position : SV_POSITION; | ||
| float arr[4] : MY_ARRAY; | ||
| }; | ||
|
|
||
| float4 main(PSInput input) : SV_TARGET { | ||
| return float4(input.arr[0], input.arr[1], input.arr[2], input.arr[3]); | ||
| } | ||
|
|
||
| #--- pipeline.yaml | ||
| --- | ||
| Shaders: | ||
| - Stage: Vertex | ||
| Entry: main | ||
| - Stage: Pixel | ||
| Entry: main | ||
| Buffers: | ||
| - Name: VertexData | ||
| Format: Float32 | ||
| Stride: 16 | ||
| Data: [ 0.0, 3.0, 0.0, 1.0, | ||
| 3.0, -3.0, 0.0, 1.0, | ||
| -3.0, -3.0, 0.0, 1.0 ] | ||
| - Name: Output | ||
| Format: Float32 | ||
| Channels: 4 | ||
| FillSize: 16 # 1x1 @ 16 bytes per pixel | ||
| OutputProps: | ||
| Height: 1 | ||
| Width: 1 | ||
| Depth: 16 | ||
| Bindings: | ||
| VertexBuffer: VertexData | ||
| VertexAttributes: | ||
| - Format: Float32 | ||
| Channels: 4 | ||
| Offset: 0 | ||
| Name: POSITION | ||
| RenderTarget: Output | ||
| DescriptorSets: [] | ||
| ... | ||
| #--- end | ||
|
|
||
| # Semantics are not implemented in the DXIL backend. | ||
| # XFAIL: Clang && !Vulkan | ||
|
|
||
| # RUN: split-file %s %t | ||
| # RUN: %dxc_target -T vs_6_0 -Fo %t-vertex.o %t/vertex.hlsl | ||
| # RUN: %dxc_target -T ps_6_0 -Fo %t-pixel.o %t/pixel.hlsl | ||
| # RUN: %offloader %t/pipeline.yaml %t-vertex.o %t-pixel.o | FileCheck %s | ||
|
|
||
| # CHECK: Name: Output | ||
| # CHECK-NEXT: Format: Float32 | ||
| # CHECK-NEXT: Channels: 4 | ||
| # CHECK-NEXT: Data: [ 0.5, 1, 0, 1 ] |
This file contains hidden or 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,108 @@ | ||
| #--- vertex.hlsl | ||
| struct VSInput { | ||
| float4 position : POSITION; | ||
| }; | ||
|
|
||
| struct VSOutput { | ||
| float4 position : SV_POSITION; | ||
| float4x4 mat : MY_MATRIX; | ||
| }; | ||
|
|
||
| VSOutput main(VSInput input) { | ||
| VSOutput output; | ||
| output.position = input.position; | ||
|
|
||
| output.mat = float4x4( | ||
| 1.0, 2.0, 3.0, 4.0, | ||
| 0.0, 5.0, 0.0, 0.0, | ||
| 0.0, 0.0, 6.0, 0.0, | ||
| 0.0, 0.0, 0.0, 7.0 | ||
| ); | ||
|
|
||
| return output; | ||
| } | ||
|
|
||
| #--- pixel.hlsl | ||
| struct PSInput { | ||
| float4 position : SV_POSITION; | ||
| float4x4 mat : MY_MATRIX; | ||
| }; | ||
|
|
||
| RWStructuredBuffer<float> Out : register(u0); | ||
|
|
||
| float4 main(PSInput input) : SV_TARGET { | ||
| Out[0] = input.mat[0][0]; | ||
| Out[1] = input.mat[0][1]; | ||
| Out[2] = input.mat[0][2]; | ||
| Out[3] = input.mat[0][3]; | ||
| Out[4] = input.mat[1][1]; | ||
| Out[5] = input.mat[2][2]; | ||
| Out[6] = input.mat[3][3]; | ||
|
|
||
| return float4(1.0, 0.0, 0.0, 1.0); | ||
| } | ||
|
|
||
| #--- pipeline.yaml | ||
| --- | ||
| Shaders: | ||
| - Stage: Vertex | ||
| Entry: main | ||
| - Stage: Pixel | ||
| Entry: main | ||
| Buffers: | ||
| - Name: VertexData | ||
| Format: Float32 | ||
| Stride: 16 | ||
| Data: [ 0.0, 3.0, 0.0, 1.0, | ||
| 3.0, -3.0, 0.0, 1.0, | ||
| -3.0, -3.0, 0.0, 1.0 ] | ||
| - Name: Output | ||
| Format: Float32 | ||
| Channels: 4 | ||
| FillSize: 16 # 1x1 @ 16 bytes per pixel | ||
| OutputProps: | ||
| Height: 1 | ||
| Width: 1 | ||
| Depth: 16 | ||
| - Name: ResultBuffer | ||
| Format: Float32 | ||
| FillSize: 28 | ||
| FillValue: 0.0 | ||
| - Name: ResultBuffer_Expected | ||
| Format: Float32 | ||
| Data: [ 1, 2, 3, 4, 5, 6, 7 ] | ||
| Bindings: | ||
| VertexBuffer: VertexData | ||
| VertexAttributes: | ||
| - Format: Float32 | ||
| Channels: 4 | ||
| Offset: 0 | ||
| Name: POSITION | ||
| RenderTarget: Output | ||
| DescriptorSets: | ||
| - Resources: | ||
| - Name: ResultBuffer | ||
| Kind: RWStructuredBuffer | ||
| DirectXBinding: | ||
| Register: 0 | ||
| Space: 0 | ||
| VulkanBinding: | ||
| Binding: 0 | ||
| Results: | ||
| - Result: Results | ||
| Rule: BufferExact | ||
| Actual: ResultBuffer | ||
| Expected: ResultBuffer_Expected | ||
| ... | ||
| #--- end | ||
|
|
||
| # Semantics are not implemented in the DXIL backend. | ||
| # XFAIL: Clang && !Vulkan | ||
|
|
||
| # See https://github.com/llvm/offload-test-suite/issues/744 | ||
| # XFAIL: Metal | ||
|
|
||
| # RUN: split-file %s %t | ||
| # RUN: %dxc_target -T vs_6_0 -Fo %t-vertex.o %t/vertex.hlsl | ||
| # RUN: %dxc_target -T ps_6_0 -Fo %t-pixel.o %t/pixel.hlsl | ||
| # RUN: %offloader %t/pipeline.yaml %t-vertex.o %t-pixel.o |
This file contains hidden or 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,111 @@ | ||
| #--- vertex.hlsl | ||
| struct Inner { | ||
| uint b : B; | ||
| }; | ||
|
|
||
| struct VSInput { | ||
| float4 position : POSITION; | ||
| }; | ||
|
|
||
| struct VSOutput { | ||
| float4 position : SV_POSITION; | ||
| uint a : A; | ||
| Inner inner; | ||
| uint c : C; | ||
| }; | ||
|
|
||
| VSOutput main(VSInput input) { | ||
| VSOutput output; | ||
| output.position = input.position; | ||
| output.a = 1; | ||
| output.inner.b = 2; | ||
| output.c = 3; | ||
| return output; | ||
| } | ||
|
|
||
| #--- pixel.hlsl | ||
| struct Inner { | ||
| uint b : B; | ||
| }; | ||
|
|
||
| struct PSInput { | ||
| float4 position : SV_POSITION; | ||
| uint a : A; | ||
| Inner inner; | ||
| uint c : C; | ||
| }; | ||
|
|
||
| RWStructuredBuffer<uint> Out : register(u0); | ||
|
|
||
| float4 main(PSInput input) : SV_TARGET { | ||
| Out[0] = input.a; | ||
| Out[1] = input.inner.b; | ||
| Out[2] = input.c; | ||
|
|
||
| return float4(1, 0, 0, 0); | ||
| } | ||
|
|
||
| #--- pipeline.yaml | ||
| --- | ||
| Shaders: | ||
| - Stage: Vertex | ||
| Entry: main | ||
| - Stage: Pixel | ||
| Entry: main | ||
| Buffers: | ||
| - Name: VertexData | ||
| Format: Float32 | ||
| Stride: 16 | ||
| Data: [ 0.0, 3.0, 0.0, 1.0, | ||
| 3.0, -3.0, 0.0, 1.0, | ||
| -3.0, -3.0, 0.0, 1.0 ] | ||
| - Name: Output | ||
| Format: Float32 | ||
| Channels: 4 | ||
| FillSize: 16 # 1x1 @ 16 bytes per pixel | ||
| OutputProps: | ||
| Height: 1 | ||
| Width: 1 | ||
| Depth: 16 | ||
| - Name: ResultBuffer | ||
| Format: Int32 | ||
| FillSize: 12 | ||
| FillValue: 0 | ||
| - Name: ResultBuffer_Expected | ||
| Format: Int32 | ||
| Data: [ 1, 2, 3 ] | ||
| Bindings: | ||
| VertexBuffer: VertexData | ||
| VertexAttributes: | ||
| - Format: Float32 | ||
| Channels: 4 | ||
| Offset: 0 | ||
| Name: POSITION | ||
| RenderTarget: Output | ||
| DescriptorSets: | ||
| - Resources: | ||
| - Name: ResultBuffer | ||
| Kind: RWStructuredBuffer | ||
| DirectXBinding: | ||
| Register: 0 | ||
| Space: 0 | ||
| VulkanBinding: | ||
| Binding: 0 | ||
| Results: | ||
| - Result: Results | ||
| Rule: BufferExact | ||
| Actual: ResultBuffer | ||
| Expected: ResultBuffer_Expected | ||
| ... | ||
| #--- end | ||
|
|
||
| # Semantics are not implemented in the DXIL backend. | ||
| # XFAIL: Clang && !Vulkan | ||
|
|
||
| # See https://github.com/llvm/offload-test-suite/issues/744 | ||
| # XFAIL: Metal | ||
|
|
||
| # RUN: split-file %s %t | ||
| # RUN: %dxc_target -T vs_6_0 -Fo %t-vertex.o %t/vertex.hlsl | ||
| # RUN: %dxc_target -T ps_6_0 -Fo %t-pixel.o %t/pixel.hlsl | ||
| # RUN: %offloader %t/pipeline.yaml %t-vertex.o %t-pixel.o |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.