diff --git a/test/Basic/matrix_scalar_arithmetic.test b/test/Basic/matrix_scalar_arithmetic.test index fbf23421..8d672e69 100644 --- a/test/Basic/matrix_scalar_arithmetic.test +++ b/test/Basic/matrix_scalar_arithmetic.test @@ -11,12 +11,13 @@ void main(uint GI : SV_GroupIndex) { int2x3 A = int2x3(In[0], In[1], In[2], In[3], In[4], In[5]); - int row = GI / 2; - int col = GI % 2; - DivOut[GI] = A[col][row] / 2; - MulOut[GI] = A[col][row] * 2; - AddOut[GI] = A[col][row] + 1; - SubOut[GI] = A[col][row] - 1; + const uint COLS = 3; // int2x3 => 2 rows, 3 columns + uint row = GI / COLS; // 0..1 + uint col = GI % COLS; // 0..2 + DivOut[GI] = A[row][col] / 2; + MulOut[GI] = A[row][col] * 2; + AddOut[GI] = A[row][col] + 1; + SubOut[GI] = A[row][col] - 1; } //--- pipeline.yaml @@ -92,13 +93,13 @@ DescriptorSets: # CHECK: Data: [ 2, 4, 6, 8, 10, 12 ] # CHECK: Name: DivOut # CHECK: Format: Int32 -# CHECK: Data: [ 1, 4, 2, 5, 3, 6 ] +# CHECK: Data: [ 1, 2, 3, 4, 5, 6 ] # CHECK: Name: MulOut # CHECK: Format: Int32 -# CHECK: Data: [ 4, 16, 8, 20, 12, 24 ] +# CHECK: Data: [ 4, 8, 12, 16, 20, 24 ] # CHECK: Name: AddOut # CHECK: Format: Int32 -# CHECK: Data: [ 3, 9, 5, 11, 7, 13 ] +# CHECK: Data: [ 3, 5, 7, 9, 11, 13 ] # CHECK: Name: SubOut # CHECK: Format: Int32 -# CHECK: Data: [ 1, 7, 3, 9, 5, 11 ] +# CHECK: Data: [ 1, 3, 5, 7, 9, 11 ] diff --git a/test/Basic/matrix_scalar_constructor.test b/test/Basic/matrix_scalar_constructor.test index e892be5d..5a9858d4 100644 --- a/test/Basic/matrix_scalar_constructor.test +++ b/test/Basic/matrix_scalar_constructor.test @@ -8,9 +8,11 @@ void main(uint GI : SV_GroupIndex) { int2x3 A = int2x3(In[0], In[1], In[2], In[3], In[4], In[5]); - int row = GI / 2; - int col = GI % 2; - Out[GI] = A[col][row]; + const uint COLS = 3; // int2x3 => 2 rows, 3 columns + uint row = GI / COLS; // 0..1 + uint col = GI % COLS; // 0..2 + + Out[GI] = A[row][col]; } //--- pipeline.yaml @@ -29,7 +31,7 @@ Buffers: FillSize: 24 - Name: ExpectedOut Format: Int32 - Data: [ 1, 4, 2, 5, 3, 6 ] + Data: [ 1, 2, 3, 4, 5, 6 ] Results: - Result: Out Rule: BufferExact