-
Notifications
You must be signed in to change notification settings - Fork 24
Add GetDimensions tests for {RW}Buffer and {RW}ByteAddressBuffer #464
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
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
a66b01b
Add GetDimensions tests for {RW}Buffer and {RW}ByteAddressBuffer
hekota 8826446
Update the tests to work on Vulkan
hekota 9136cc0
Change UNSUPPORTED to XFAIL and add link to issue
hekota 67131cf
update binding
hekota 9b1240c
XFAIL typed buffers test on DXC && Vulkan
hekota 969f242
Merge branch 'main' into more-getdim-tests
hekota 62ca3e8
update numthreads to (1,1,1)
hekota 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
File renamed without changes.
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,87 @@ | ||
#--- source.hlsl | ||
|
||
// This test checks that we will get the expected values from invoking | ||
// `GetDimension`s on typed buffers RWBuffer and Buffer. | ||
|
||
ByteAddressBuffer A : register(t0); | ||
RWByteAddressBuffer B : register(u1); | ||
|
||
[[vk::binding(10)]] | ||
RWBuffer<uint> Out : register(u10); | ||
|
||
[numthreads(1,1,1)] | ||
void main() { | ||
uint dim; | ||
|
||
A.GetDimensions(dim); | ||
Out[0] = dim; | ||
|
||
B.GetDimensions(dim); | ||
Out[1] = dim; | ||
} | ||
|
||
//--- pipeline.yaml | ||
|
||
--- | ||
Shaders: | ||
- Stage: Compute | ||
Entry: main | ||
DispatchSize: [4, 1, 1] | ||
|
||
Buffers: | ||
- Name: A | ||
Format: Int32 | ||
Data: [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 ] | ||
|
||
- Name: B | ||
Format: Hex32 | ||
Data: [ 0x100, 0x200, 0x300, 0x400, 0x500, 0x600, 0x700 ] | ||
|
||
- Name: Out | ||
Format: Int32 | ||
ZeroInitSize: 8 | ||
|
||
- Name: ExpectedOut | ||
Format: Int32 | ||
Data: [ 56, 28 ] | ||
|
||
Results: | ||
- Result: Out | ||
Rule: BufferExact | ||
Actual: Out | ||
Expected: ExpectedOut | ||
|
||
DescriptorSets: | ||
- Resources: | ||
- Name: A | ||
Kind: ByteAddressBuffer | ||
DirectXBinding: | ||
Register: 0 | ||
Space: 0 | ||
VulkanBinding: | ||
Binding: 0 | ||
|
||
- Name: B | ||
Kind: RWByteAddressBuffer | ||
DirectXBinding: | ||
Register: 1 | ||
Space: 0 | ||
VulkanBinding: | ||
Binding: 1 | ||
|
||
- Name: Out | ||
Kind: RWBuffer | ||
DirectXBinding: | ||
Register: 10 | ||
Space: 0 | ||
VulkanBinding: | ||
Binding: 10 | ||
... | ||
#--- end | ||
|
||
# Unimplemented https://github.com/llvm/wg-hlsl/issues/126 | ||
# XFAIL: Clang | ||
|
||
# RUN: split-file %s %t | ||
# RUN: %dxc_target -T cs_6_5 -Fo %t.o %t/source.hlsl | ||
# RUN: %offloader %t/pipeline.yaml %t.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
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,91 @@ | ||
#--- source.hlsl | ||
|
||
// This test checks that we will get the expected values from invoking | ||
// `GetDimension`s on typed buffers RWBuffer and Buffer. | ||
|
||
Buffer<int4> A : register(t0); | ||
RWBuffer<float> B : register(u1); | ||
|
||
[[vk::binding(10)]] | ||
RWBuffer<uint> Out : register(u10); | ||
|
||
[numthreads(1,1,1)] | ||
void main() { | ||
uint dim; | ||
|
||
A.GetDimensions(dim); | ||
Out[0] = dim; | ||
|
||
B.GetDimensions(dim); | ||
Out[1] = dim; | ||
} | ||
|
||
//--- pipeline.yaml | ||
|
||
--- | ||
Shaders: | ||
- Stage: Compute | ||
Entry: main | ||
DispatchSize: [4, 1, 1] | ||
|
||
Buffers: | ||
- Name: A | ||
Format: Int32 | ||
Data: [ 0, 1, 2, 3, 4, 5, 6, 7 ] | ||
|
||
- Name: B | ||
Format: Float32 | ||
Data: [ 0.1, 1.1, 2.2, 3.3, 4.4 ] | ||
|
||
- Name: Out | ||
Format: Int32 | ||
ZeroInitSize: 8 | ||
|
||
- Name: ExpectedOut | ||
Format: Int32 | ||
Data: [ 8, 5 ] | ||
|
||
Results: | ||
- Result: Out | ||
Rule: BufferExact | ||
Actual: Out | ||
Expected: ExpectedOut | ||
|
||
DescriptorSets: | ||
- Resources: | ||
- Name: A | ||
Kind: Buffer | ||
DirectXBinding: | ||
Register: 0 | ||
Space: 0 | ||
VulkanBinding: | ||
Binding: 0 | ||
|
||
- Name: B | ||
Kind: RWBuffer | ||
DirectXBinding: | ||
Register: 1 | ||
Space: 0 | ||
VulkanBinding: | ||
Binding: 1 | ||
|
||
- Name: Out | ||
Kind: RWBuffer | ||
DirectXBinding: | ||
Register: 10 | ||
Space: 0 | ||
VulkanBinding: | ||
Binding: 10 | ||
|
||
... | ||
#--- end | ||
|
||
# Bug https://github.com/llvm/offload-test-suite/issues/469 | ||
# XFAIL: DXC && Vulkan | ||
|
||
# Unimplemented https://github.com/llvm/wg-hlsl/issues/126 | ||
# XFAIL: Clang | ||
|
||
# RUN: split-file %s %t | ||
# RUN: %dxc_target -T cs_6_5 -Fo %t.o %t/source.hlsl | ||
# RUN: %offloader %t/pipeline.yaml %t.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.