Skip to content

Commit f237926

Browse files
committed
fix svd add point_coord
1 parent bcb4d04 commit f237926

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

Sources/EasyMetalShader/MetalFuncs.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,12 +239,12 @@ void svd_2x2(
239239
{
240240
// First compute a givens rotation to eliminate 1,0 entry in tensor
241241
float c, s;
242-
givens(A.columns[0].x, A.columns[0].y, c, s);
242+
givens(A.columns[0].x, A.columns[1].x, c, s);
243243
float2x2 const R = float2x2(c, -s, s, c);
244244
float2x2 const B = R * A;
245245
// B is bidiagonal. Use specialized algorithm to compute its SVD
246246
float2x2 U_B, S_B, V_B;
247-
svd_bidiagonal(B.columns[0].x, B.columns[1].x, B.columns[1].y, U_B, S_B, V_B);
247+
svd_bidiagonal(B.columns[0].x, B.columns[0].y, B.columns[1].y, U_B, S_B, V_B);
248248
float2x2 const X = U_B;
249249
S = S_B;
250250
V = V_B;

Sources/EasyMetalShader/SCMetalRenderFunction.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ open class SCMetalRenderFunction {
134134
functionImpl += ","
135135
}
136136
functionImpl += "RasterizerData rd [[stage_in]],"
137+
functionImpl += "float2 pc [[point_coord]],"
137138
functionImpl += "float4 c0 [[color(0)]]"
138139
functionImpl += "){"
139140

0 commit comments

Comments
 (0)