Documentation ¶
Overview ¶
Package layout is used to find parts of the application package to load or run. It can use the running executable directory, or other supplied locations, and find files targeted to a specific abi.
Index ¶
- Constants
- func DeviceInfo(ctx context.Context, os device.OSKind) (file.Path, error)
- func GapidApk(ctx context.Context, abi *device.ABI) (file.Path, error)
- func Gapir(ctx context.Context, abi *device.ABI) (file.Path, error)
- func Gapis(ctx context.Context) (file.Path, error)
- func Gapit(ctx context.Context) (file.Path, error)
- func GoArgs(ctx context.Context) []string
- func Json(ctx context.Context, lib LibraryType) (file.Path, error)
- func Library(ctx context.Context, lib LibraryType, abi *device.ABI) (file.Path, error)
- func LibraryName(lib LibraryType, abi *device.ABI) string
- func PerfettoCmd(ctx context.Context, abi *device.ABI) (file.Path, error)
- func Strings(ctx context.Context) (file.Path, error)
- type FileLayout
- type LibraryType
- type ZipLayout
- func (l *ZipLayout) DeviceInfo(ctx context.Context, os device.OSKind) (*zip.File, error)
- func (l *ZipLayout) GapidApk(ctx context.Context, abi *device.ABI) (*zip.File, error)
- func (l *ZipLayout) Gapir(ctx context.Context, abi *device.ABI) (*zip.File, error)
- func (l *ZipLayout) Gapis(ctx context.Context) (*zip.File, error)
- func (l *ZipLayout) Gapit(ctx context.Context) (*zip.File, error)
- func (l *ZipLayout) Json(ctx context.Context, lib LibraryType) (*zip.File, error)
- func (l *ZipLayout) Library(ctx context.Context, lib LibraryType, abi *device.ABI) (*zip.File, error)
- func (l *ZipLayout) PerfettoCmd(ctx context.Context, abi *device.ABI) (*zip.File, error)
- func (l *ZipLayout) Strings(ctx context.Context) (*zip.File, error)
Constants ¶
const ( ErrCannotFindPackageFiles = fault.Const("Cannot find package files") ErrUnknownABI = fault.Const("Unknown device ABI: %+v") )
Variables ¶
This section is empty.
Functions ¶
func DeviceInfo ¶ added in v1.2.0
DeviceInfo returns the device info executable for the given ABI.
func LibraryName ¶ added in v1.2.0
func LibraryName(lib LibraryType, abi *device.ABI) string
LibraryName returns the filename of the given Library.
func PerfettoCmd ¶ added in v1.6.0
PerfettoCmd returns the device info executable for the given ABI.
Types ¶
type FileLayout ¶
type FileLayout interface { // Strings returns the path to the binary string table. Strings(ctx context.Context) (file.Path, error) // Gapit returns the path to the gapit binary in this layout. Gapit(ctx context.Context) (file.Path, error) // Gapis returns the path to the gapis binary in this layout. Gapis(ctx context.Context) (file.Path, error) // Gapir returns the path to the gapir binary in this layout. Gapir(ctx context.Context, abi *device.ABI) (file.Path, error) // GapidApk returns the path to gapid.apk in this layout. GapidApk(ctx context.Context, abi *device.ABI) (file.Path, error) // PerfettoCmd returns the path to the perfetto command-line tool PerfettoCmd(ctx context.Context, abi *device.ABI) (file.Path, error) // Library returns the path to the requested library. Library(ctx context.Context, lib LibraryType, abi *device.ABI) (file.Path, error) // Json returns the path to the Vulkan layer JSON definition for the given library. Json(ctx context.Context, lib LibraryType) (file.Path, error) // GoArgs returns additional arguments to pass to go binaries. GoArgs(ctx context.Context) []string // DeviceInfo returns the device info executable for the given ABI. DeviceInfo(ctx context.Context, os device.OSKind) (file.Path, error) }
FileLayout provides a unified way of accessing various Gapid binaries.
func NewPkgLayout ¶ added in v1.1.0
func NewPkgLayout(dir file.Path, create bool) (FileLayout, error)
NewPkgLayout returns a FileLayout rooted at the given directory with the standard package layout. If create is true, the package layout is created if it doesn't exist, otherwise an error is returned.
func RunfilesLayout ¶ added in v1.1.0
func RunfilesLayout(manifest file.Path) (FileLayout, error)
RunfilesLayout creates a new layout based on the given runfiles manifest.
type LibraryType ¶
type LibraryType int
LibraryType enumerates the possible GAPID dynamic libraries.
const ( LibGraphicsSpy LibraryType = iota LibVirtualSwapChain LibApiTiming )
type ZipLayout ¶ added in v1.1.0
type ZipLayout struct {
// contains filtered or unexported fields
}
ZipLayout is a FileLayout view over a ZIP file.
func NewZipLayout ¶ added in v1.1.0
NewZipLayout returns a new ZipLayout using the given ZIP file.
func (*ZipLayout) DeviceInfo ¶ added in v1.2.0
DeviceInfo returns the device info executable for the given ABI.
func (*ZipLayout) Gapir ¶ added in v1.1.0
Gapir returns the path to the gapir binary in this layout.
func (*ZipLayout) Gapis ¶ added in v1.1.0
Gapis returns the path to the gapis binary in this layout.
func (*ZipLayout) Gapit ¶ added in v1.1.0
Gapit returns the path to the gapit binary in this layout.
func (*ZipLayout) Json ¶ added in v1.1.0
Json returns the path to the Vulkan layer JSON definition for the given library.
func (*ZipLayout) Library ¶ added in v1.1.0
func (l *ZipLayout) Library(ctx context.Context, lib LibraryType, abi *device.ABI) (*zip.File, error)
Library returns the path to the requested library.
func (*ZipLayout) PerfettoCmd ¶ added in v1.6.0
PerfettoCmd returns the device info executable for the given ABI.