blob: 2ef16a42ff2fdaaa3acaa75127e5f3416467cb5e [file] [log] [blame]
{{/*
* Copyright (C) 2015 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/}}
{{Global "module" ""}}
{{Include "go_common.tmpl"}}
{{$ | Macro "schema.go" | GoFmt | Write "schema.go"}}
{{define "schema.go"}}
{{template "Go.GeneratedHeader" (Global "OutputDir")}}
import (
"android.googlesource.com/platform/tools/gpu/atom"
"android.googlesource.com/platform/tools/gpu/binary"
"android.googlesource.com/platform/tools/gpu/binary/schema"
)
func init() {
{{ForEach (AllCommands $) "Atom" | JoinWith "\n¶"}}
}
{{end}}
{{/*
-------------------------------------------------------------------------------
Emits information for the specified Atom.
-------------------------------------------------------------------------------
*/}}
{{define "Atom"}}
{{AssertType $ "Function"}}
sc_{{Template "Go.CmdName" $}} := schema.Of((*{{Template "Go.CmdName" $}})(nil).Class())
sc_{{Template "Go.CmdName" $}}.Metadata = append(sc_{{Template "Go.CmdName" $}}.Metadata, &atom.Metadata{
API: apiID,
DisplayName: "{{Template "CmdName" $}}",
Flags: 0§
{{if GetAnnotation $ "DrawCall"}} | atom.DrawCall §{{end}}
{{if GetAnnotation $ "EndOfFrame"}} | atom.EndOfFrame §{{end}}
,
DocumentationUrl: "{{$.Docs}}",
})
{{end}}