diff --git a/internal/shaderir/glsl.go b/internal/shaderir/glsl.go index c13abce25..4ab0fc5e2 100644 --- a/internal/shaderir/glsl.go +++ b/internal/shaderir/glsl.go @@ -60,7 +60,7 @@ func (p *Program) structName(t *Type) string { if t.Main != Struct { panic("shaderir: the given type at structName must be a struct") } - s := t.String() + s := t.serialize() if n, ok := p.structNames[s]; ok { return n } diff --git a/internal/shaderir/type.go b/internal/shaderir/type.go index 910aa20a6..862e8f722 100644 --- a/internal/shaderir/type.go +++ b/internal/shaderir/type.go @@ -66,7 +66,7 @@ func (t *Type) String() string { case Mat4: return "mat4" case Texture2D: - return "sampler2D" + return "texture2D" case Array: return fmt.Sprintf("%s[%d]", t.Sub[0].String(), t.Length) case Struct: @@ -83,6 +83,10 @@ func (t *Type) String() string { } } +func (t *Type) serialize() string { + return t.String() +} + type BasicType int // For a texture, a name Texture2D is used instead of Sampler2D. A sampler is a combination of a texture and how to