-
Notifications
You must be signed in to change notification settings - Fork 28
Cbuffer tests for MatrixSingleSubscriptExpr #753
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
| @@ -0,0 +1,69 @@ | ||||
| #--- source.hlsl | ||||
| RWStructuredBuffer<float4> Out : register(u0); | ||||
|
|
||||
| cbuffer example : register(b1) { | ||||
| float2x4 M1; | ||||
| }; | ||||
|
|
||||
| [numthreads(1,1,1)] | ||||
| void main() { | ||||
| Out[0] = M1[0]; | ||||
| Out[1] = M1[1]; | ||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
This read and write goes out of bounds.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It does not currently but will when this becomes a 1x4.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It does currently read out of bounds because the input data ends with |
||||
| } | ||||
| //--- pipeline.yaml | ||||
|
|
||||
| --- | ||||
| Shaders: | ||||
| - Stage: Compute | ||||
| Entry: main | ||||
| DispatchSize: [1, 1, 1] | ||||
| Buffers: | ||||
| - Name: cbuffer | ||||
| Format: Float32 | ||||
| Data: [ 1.1, 0xFFFF, 0xFFFF, 0xFFFF, | ||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||||
| 2.2, 0xFFFF, 0xFFFF, 0xFFFF, | ||||
| 3.3, 0xFFFF, 0xFFFF, 0xFFFF, | ||||
| 4.4] | ||||
| - Name: Out | ||||
| Format: Float32 | ||||
| FillSize: 16 | ||||
| - Name: ExpectedOut | ||||
| Format: Float32 | ||||
| Data: [ 1.1, 2.2, 3.3, 4.4] | ||||
| Results: | ||||
| - Result: Out | ||||
| Rule: BufferExact | ||||
| Actual: Out | ||||
| Expected: ExpectedOut | ||||
| DescriptorSets: | ||||
| - Resources: | ||||
| - Name: cbuffer | ||||
| Kind: ConstantBuffer | ||||
| DirectXBinding: | ||||
| Register: 1 | ||||
| Space: 0 | ||||
| VulkanBinding: | ||||
| Binding: 1 | ||||
| - Name: Out | ||||
| Kind: RWBuffer | ||||
| DirectXBinding: | ||||
| Register: 0 | ||||
| Space: 0 | ||||
| VulkanBinding: | ||||
| Binding: 0 | ||||
|
|
||||
| # Note: Metal and Vulkan KosmicKrisp and MoltenVK | ||||
| # Are always empty | ||||
|
Comment on lines
+55
to
+56
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I assume you'll put bug numbers along with all of these unsupported/xfail before you merge this. |
||||
| # UNSUPPORTED: Darwin | ||||
|
|
||||
| # NOTE: AMD on Clang and DXC have result: | ||||
| # [ 1.1, 65535, 65535, 65535] | ||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Interesting - row vs column major confusion? |
||||
| # XFAIL: AMD && DirectX | ||||
|
|
||||
| # Note: clang Vulkan crashes | ||||
| # BUG https://github.com/llvm/llvm-project/issues/179879 | ||||
| # XFAIL: Clang && Vulkan | ||||
|
|
||||
| # RUN: split-file %s %t | ||||
| # RUN: %dxc_target -T cs_6_0 -Fo %t.o %t/source.hlsl | ||||
| # RUN: %offloader %t/pipeline.yaml %t.o | ||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| #--- source.hlsl | ||
| RWStructuredBuffer<float4> Out : register(u0); | ||
|
|
||
| cbuffer example : register(b1) { | ||
| float2x4 M1; | ||
| }; | ||
|
|
||
| [numthreads(1,1,1)] | ||
| void main() { | ||
| Out[0] = M1[0]; | ||
| Out[1] = M1[1]; | ||
| } | ||
| //--- pipeline.yaml | ||
|
|
||
| --- | ||
| Shaders: | ||
| - Stage: Compute | ||
| Entry: main | ||
| DispatchSize: [1, 1, 1] | ||
| Buffers: | ||
| - Name: cbuffer | ||
| Format: Float32 | ||
| Data: [ 1.1, 5.5, 0xFFFF, 0xFFFF, | ||
| 2.2, 6.6, 0xFFFF, 0xFFFF, | ||
| 3.3, 7.7, 0xFFFF, 0xFFFF, | ||
| 4.4, 8.8 ] | ||
| - Name: Out | ||
| Format: Float32 | ||
| FillSize: 32 | ||
| - Name: ExpectedOut | ||
| Format: Float32 | ||
| Data: [ 1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8 ] | ||
| Results: | ||
| - Result: Out | ||
| Rule: BufferExact | ||
| Actual: Out | ||
| Expected: ExpectedOut | ||
| DescriptorSets: | ||
| - Resources: | ||
| - Name: cbuffer | ||
| Kind: ConstantBuffer | ||
| DirectXBinding: | ||
| Register: 1 | ||
| Space: 0 | ||
| VulkanBinding: | ||
| Binding: 1 | ||
| - Name: Out | ||
| Kind: RWBuffer | ||
| DirectXBinding: | ||
| Register: 0 | ||
| Space: 0 | ||
| VulkanBinding: | ||
| Binding: 0 | ||
|
|
||
| # Note: Metal and Vulkan KosmicKrisp and MoltenVK | ||
| # Are always empty | ||
| # UNSUPPORTED: Darwin | ||
|
|
||
| # NOTE: AMD on Clang and DXC have result: | ||
| # [ 1.1, 5.5, 6.6, 7.7, 8.8, 0, 0, 0 ] | ||
| # XFAIL: AMD && DirectX | ||
|
|
||
| # Note: clang Vulkan crashes | ||
| # BUG https://github.com/llvm/llvm-project/issues/179879 | ||
| # XFAIL: Clang && Vulkan | ||
|
|
||
| # RUN: split-file %s %t | ||
| # RUN: %dxc_target -T cs_6_0 -Fo %t.o %t/source.hlsl | ||
| # RUN: %offloader %t/pipeline.yaml %t.o |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| #--- source.hlsl | ||
| RWStructuredBuffer<float2> Out : register(u0); | ||
|
|
||
| cbuffer example : register(b1) { | ||
| float3x2 M1; | ||
| }; | ||
|
|
||
| [numthreads(1,1,1)] | ||
| void main() { | ||
| Out[0] = M1[0]; | ||
| Out[1] = M1[1]; | ||
| Out[2] = M1[2]; | ||
| } | ||
| //--- pipeline.yaml | ||
|
|
||
| --- | ||
| Shaders: | ||
| - Stage: Compute | ||
| Entry: main | ||
| DispatchSize: [1, 1, 1] | ||
| Buffers: | ||
| - Name: cbuffer | ||
| Format: Float32 | ||
| Data: [ 1.1, 3.3, 5.5, 0xFFFF, | ||
| 2.2, 4.4, 6.6, 0xFFFF ] | ||
| - Name: Out | ||
| Format: Float32 | ||
| FillSize: 24 | ||
| - Name: ExpectedOut | ||
| Format: Float32 | ||
| Data: [ 1.1, 2.2, 3.3, 4.4, 5.5, 6.6 ] | ||
| Results: | ||
| - Result: Out | ||
| Rule: BufferExact | ||
| Actual: Out | ||
| Expected: ExpectedOut | ||
| DescriptorSets: | ||
| - Resources: | ||
| - Name: cbuffer | ||
| Kind: ConstantBuffer | ||
| DirectXBinding: | ||
| Register: 1 | ||
| Space: 0 | ||
| VulkanBinding: | ||
| Binding: 1 | ||
| - Name: Out | ||
| Kind: RWBuffer | ||
| DirectXBinding: | ||
| Register: 0 | ||
| Space: 0 | ||
| VulkanBinding: | ||
| Binding: 0 | ||
|
|
||
| # Note: Metal and Vulkan KosmicKrisp and MoltenVK | ||
| # Are always empty | ||
| # UNSUPPORTED: Darwin | ||
|
|
||
| # NOTE: AMD on Clang and DXC have result: | ||
| # [ 1.1, 3.3, 5.5, 6.6, 0, 0 ] | ||
| # XFAIL: AMD && DirectX | ||
|
|
||
| # Note: clang Vulkan crashes | ||
| # BUG https://github.com/llvm/llvm-project/issues/179879 | ||
| # XFAIL: Clang && Vulkan | ||
|
|
||
| # RUN: split-file %s %t | ||
| # RUN: %dxc_target -T cs_6_0 -Fo %t.o %t/source.hlsl | ||
| # RUN: %offloader %t/pipeline.yaml %t.o |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| #--- source.hlsl | ||
| RWStructuredBuffer<float2> Out : register(u0); | ||
|
|
||
| cbuffer example : register(b1) { | ||
| float4x2 M1; | ||
| }; | ||
|
|
||
| [numthreads(1,1,1)] | ||
| void main() { | ||
| Out[0] = M1[0]; | ||
| Out[1] = M1[1]; | ||
| Out[2] = M1[2]; | ||
| Out[3] = M1[3]; | ||
| } | ||
| //--- pipeline.yaml | ||
|
|
||
| --- | ||
| Shaders: | ||
| - Stage: Compute | ||
| Entry: main | ||
| DispatchSize: [1, 1, 1] | ||
| Buffers: | ||
| - Name: cbuffer | ||
| Format: Float32 | ||
| Data: [ 1.1, 2.2, 3.3, 4.4, | ||
| 5.5, 6.6, 7.7, 8.8 ] | ||
| - Name: Out | ||
| Format: Float32 | ||
| FillSize: 32 | ||
| - Name: ExpectedOut | ||
| Format: Float32 | ||
| Data: [ 1.1, 5.5, 2.2, 6.6, 3.3, 7.7, 4.4, 8.8] | ||
| Results: | ||
| - Result: Out | ||
| Rule: BufferExact | ||
| Actual: Out | ||
| Expected: ExpectedOut | ||
| DescriptorSets: | ||
| - Resources: | ||
| - Name: cbuffer | ||
| Kind: ConstantBuffer | ||
| DirectXBinding: | ||
| Register: 1 | ||
| Space: 0 | ||
| VulkanBinding: | ||
| Binding: 1 | ||
| - Name: Out | ||
| Kind: RWBuffer | ||
| DirectXBinding: | ||
| Register: 0 | ||
| Space: 0 | ||
| VulkanBinding: | ||
| Binding: 0 | ||
|
|
||
| # Note: Metal and Vulkan KosmicKrisp and MoltenVK | ||
| # Are always empty | ||
| # UNSUPPORTED: Darwin | ||
|
|
||
| # Note: Nvidia crashes on both clang and DXC | ||
| # XFAIL: NV && Vulkan | ||
|
|
||
| # Note: clang Vulkan crashes | ||
| # BUG https://github.com/llvm/llvm-project/issues/179879 | ||
| # XFAIL: Clang && Vulkan | ||
|
|
||
| # NOTE: AMD on Clang and DXC have result: | ||
| # [ 1.1, 2.2, 3.3, 4.4, 8.8, 0, 0, 0 ] | ||
| # XFAIL: AMD && DirectX | ||
|
|
||
| # RUN: split-file %s %t | ||
| # RUN: %dxc_target -T cs_6_0 -Fo %t.o %t/source.hlsl | ||
| # RUN: %offloader %t/pipeline.yaml %t.o |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this meant to be float1x4?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep. Copy paste error and looks like an unstaged change.