In Test\Feature\HLSLLib, create a test file <intrinsic>.matrix.test that uses float and int (32-bit) types to test the following matrix size varieties:
A .test file should contain:
#--- source.hlsl
StructuredBuffer<float> In : register(t0);
RWStructuredBuffer<float> Out2x2 : register(u1);
[numthreads(1,1,1)]
void main() {
float2x2 Mat2x2 = float2x2(In[0], In[1], In[2], In[3]);
float2x2 Result2x2 = degrees(Mat2x2);
const uint COLS = 2;
for(uint i = 0; i < 4; i++) {
uint row = i / COLS;
uint col = i % COLS;
Out2x2[i] = Result2x2[row][col];
}
}
//--- pipeline.yaml
---
Shaders:
- Stage: Compute
Entry: main
DispatchSize: [1, 1, 1]
Buffers:
- Name: In
Format: Float32
Stride: 4
Data: [ 0.0, 1.5708, 3.14159, 6.28318 ]
- Name: Out2x2
Format: Float32
Stride: 4
FillSize: 16
- Name: ExpectedOut2x2 # The result we expect
Format: Float32
Stride: 4
Data: [ 0.0, 90.0, 180.0, 360.0 ]
Results: # A test might have more than 1 result.
- Result: Test1
Rule: BufferFuzzy # there is also a BufferExact rule
ULPT: 1
Actual: Out2x2
Expected: ExpectedOut2x2
DescriptorSets:
- Resources:
- Name: In
Kind: StructuredBuffer
DirectXBinding:
Register: 0
Space: 0
VulkanBinding:
Binding: 0
- Name: Out2x2
Kind: RWStructuredBuffer
DirectXBinding:
Register: 1
Space: 0
VulkanBinding:
Binding: 1
...
#--- end
# 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
In
Test\Feature\HLSLLib, create a test file<intrinsic>.matrix.testthat usesfloatandint(32-bit) types to test the following matrix size varieties:3x2)2x4)3x1)4x4)A
.testfile should contain:.testfiles can use the same source, it can go in its own file and be referenced in the run portion of each.testfile instead..testfiles can use the same YAML, it can go in its own file and be referenced in the run portion of each.testfile instead..testfile.