mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-26 19:58:54 +01:00
shaderir/glsl: Refactoring
This commit is contained in:
parent
6576a1da76
commit
00ccc8ad85
@ -243,20 +243,8 @@ func (c *compileContext) glslVarInit(p *shaderir.Program, t *shaderir.Type) stri
|
|||||||
return "false"
|
return "false"
|
||||||
case shaderir.Int:
|
case shaderir.Int:
|
||||||
return "0"
|
return "0"
|
||||||
case shaderir.Float:
|
case shaderir.Float, shaderir.Vec2, shaderir.Vec3, shaderir.Vec4, shaderir.Mat2, shaderir.Mat3, shaderir.Mat4:
|
||||||
return "float(0)"
|
return fmt.Sprintf("%s(0)", basicTypeString(t.Main))
|
||||||
case shaderir.Vec2:
|
|
||||||
return "vec2(0)"
|
|
||||||
case shaderir.Vec3:
|
|
||||||
return "vec3(0)"
|
|
||||||
case shaderir.Vec4:
|
|
||||||
return "vec4(0)"
|
|
||||||
case shaderir.Mat2:
|
|
||||||
return "mat2(0)"
|
|
||||||
case shaderir.Mat3:
|
|
||||||
return "mat3(0)"
|
|
||||||
case shaderir.Mat4:
|
|
||||||
return "mat4(0)"
|
|
||||||
default:
|
default:
|
||||||
t0, t1 := c.glslType(p, t)
|
t0, t1 := c.glslType(p, t)
|
||||||
panic(fmt.Sprintf("?(unexpected type: %s%s)", t0, t1))
|
panic(fmt.Sprintf("?(unexpected type: %s%s)", t0, t1))
|
||||||
|
Loading…
Reference in New Issue
Block a user