mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-03 08:25:34 +00:00
gpu/backend: move backend interface types to a separate package
Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+6
-5
@@ -85,6 +85,7 @@ func generate() error {
|
||||
var out bytes.Buffer
|
||||
out.WriteString("// Code generated by build.go. DO NOT EDIT.\n\n")
|
||||
out.WriteString("package gpu\n\n")
|
||||
fmt.Fprintf(&out, "import %q\n\n", "gioui.org/gpu/backend")
|
||||
|
||||
out.WriteString("var (\n")
|
||||
|
||||
@@ -155,12 +156,12 @@ func generate() error {
|
||||
// only a single version.
|
||||
multiVariant := variants[0].gles2 != variants[1].gles2
|
||||
if multiVariant {
|
||||
fmt.Fprintf(&out, "[...]ShaderSources{\n")
|
||||
fmt.Fprintf(&out, "[...]backend.ShaderSources{\n")
|
||||
}
|
||||
for _, src := range variants {
|
||||
fmt.Fprintf(&out, "ShaderSources{\n")
|
||||
fmt.Fprintf(&out, "backend.ShaderSources{\n")
|
||||
if len(src.inputs) > 0 {
|
||||
fmt.Fprintf(&out, "Inputs: []InputLocation{\n")
|
||||
fmt.Fprintf(&out, "Inputs: []backend.InputLocation{\n")
|
||||
for _, inp := range src.inputs {
|
||||
fmt.Fprintf(&out, "{Name: %q, Location: %d, Semantic: %q, ", inp.Name, inp.Location, inp.Semantic)
|
||||
fmt.Fprintf(&out, "SemanticIndex: %d, Type: %d, Size: %d},\n", inp.SemanticIndex, inp.Type, inp.Size)
|
||||
@@ -168,7 +169,7 @@ func generate() error {
|
||||
fmt.Fprintf(&out, "},\n")
|
||||
}
|
||||
if len(src.uniforms) > 0 {
|
||||
fmt.Fprintf(&out, "Uniforms: []UniformLocation{\n")
|
||||
fmt.Fprintf(&out, "Uniforms: []backend.UniformLocation{\n")
|
||||
for _, u := range src.uniforms {
|
||||
fmt.Fprintf(&out, "{Name: %q, Type: %d, Size: %d, Offset: %d},\n", u.Name, u.Type, u.Size, u.Offset)
|
||||
}
|
||||
@@ -178,7 +179,7 @@ func generate() error {
|
||||
fmt.Fprintf(&out, "UniformSize: %d,\n", src.uniformSize)
|
||||
}
|
||||
if len(src.textures) > 0 {
|
||||
fmt.Fprintf(&out, "Textures: []TextureBinding{\n")
|
||||
fmt.Fprintf(&out, "Textures: []backend.TextureBinding{\n")
|
||||
for _, t := range src.textures {
|
||||
fmt.Fprintf(&out, "{Name: %q, Binding: %d},\n", t.Name, t.Binding)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user