internal/graphicsdriver/directx: refactoring

This commit is contained in:
Hajime Hoshi 2024-11-26 12:56:54 +09:00
parent 800be4f772
commit e4efbfd1f1

View File

@ -289,11 +289,11 @@ 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 j < typ.Length-1 {
fs = append(fs, 0, 0)
}
if typ.Length > 0 {
fs = fs[:len(fs)-2]
}
case shaderir.Mat3:
for j := 0; j < typ.Length; j++ {
@ -301,11 +301,11 @@ func adjustUniforms(uniformTypes []shaderir.Type, uniformOffsets []int, uniforms
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 j < typ.Length-1 {
fs = append(fs, 0)
}
if typ.Length > 0 {
fs = fs[:len(fs)-1]
}
case shaderir.Mat4:
for j := 0; j < typ.Length; j++ {