Skip to content

Commit

Permalink
internal/graphicsdriver/directx: refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
hajimehoshi committed Nov 26, 2024
1 parent 800be4f commit e4efbfd
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions internal/graphicsdriver/directx/shader_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,23 +289,23 @@ func adjustUniforms(uniformTypes []shaderir.Type, uniformOffsets []int, uniforms
u := uniforms[idx+4*j : idx+4*(j+1)]
fs = append(fs,
u[0], u[2], 0, 0,
u[1], u[3], 0, 0,
u[1], u[3],
)
}
if typ.Length > 0 {
fs = fs[:len(fs)-2]
if j < typ.Length-1 {
fs = append(fs, 0, 0)
}
}
case shaderir.Mat3:
for j := 0; j < typ.Length; j++ {
u := uniforms[idx+9*j : idx+9*(j+1)]
fs = append(fs,
u[0], u[3], u[6], 0,
u[1], u[4], u[7], 0,
u[2], u[5], u[8], 0,
u[2], u[5], u[8],
)
}
if typ.Length > 0 {
fs = fs[:len(fs)-1]
if j < typ.Length-1 {
fs = append(fs, 0)
}
}
case shaderir.Mat4:
for j := 0; j < typ.Length; j++ {
Expand Down

0 comments on commit e4efbfd

Please sign in to comment.