mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-26 03:38:55 +01:00
parent
62fbac2290
commit
004b279e4f
8
internal/shader/testdata/array.expected.vs
vendored
8
internal/shader/testdata/array.expected.vs
vendored
@ -1 +1,9 @@
|
||||
uniform vec2[4] U0;
|
||||
|
||||
void F0(out vec2[2] l0);
|
||||
|
||||
void F0(out vec2[2] l0) {
|
||||
vec2[2] l1 = vec2[2](vec2(0), vec2(0));
|
||||
l0 = l1;
|
||||
return;
|
||||
}
|
||||
|
5
internal/shader/testdata/array.go
vendored
5
internal/shader/testdata/array.go
vendored
@ -1,3 +1,8 @@
|
||||
package main
|
||||
|
||||
var Array [4]vec2
|
||||
|
||||
func Foo() [2]vec2 {
|
||||
var x [2]vec2
|
||||
return x
|
||||
}
|
||||
|
@ -195,7 +195,12 @@ func (p *Program) glslVarInit(t *Type) string {
|
||||
case None:
|
||||
return "?(none)"
|
||||
case Array:
|
||||
panic("not implemented")
|
||||
init := p.glslVarInit(&t.Sub[0])
|
||||
es := make([]string, 0, t.Length)
|
||||
for i := 0; i < t.Length; i++ {
|
||||
es = append(es, init)
|
||||
}
|
||||
return fmt.Sprintf("%s[%d](%s)", t.Sub[0].Glsl(), t.Length, strings.Join(es, ", "))
|
||||
case Struct:
|
||||
panic("not implemented")
|
||||
case Bool:
|
||||
|
Loading…
Reference in New Issue
Block a user