layout

package
v2.1.0+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 6, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

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

View Source
const (
	ErrCannotFindPackageFiles = fault.Const("Cannot find package files")
	ErrUnknownABI             = fault.Const("Unknown device ABI: %+v")
)

Variables

This section is empty.

Functions

func AllLayers

func AllLayers() []string

func DeviceInfo

func DeviceInfo(ctx context.Context, os device.OSKind) (file.Path, error)

DeviceInfo returns the device info executable for the given ABI.

func GapidApk

func GapidApk(ctx context.Context, abi *device.ABI) (file.Path, error)

GapidApk returns the path to the gapid.apk corresponding to the given abi.

func Gapir

func Gapir(ctx context.Context, abi *device.ABI) (file.Path, error)

Gapir returns the path to the gapir binary.

func Gapis

func Gapis(ctx context.Context) (file.Path, error)

Gapis returns the path to the gapis binary.

func Gapit

func Gapit(ctx context.Context) (file.Path, error)

Gapit returns the path to the gapir binary.

func GoArgs

func GoArgs(ctx context.Context) []string

GoArgs returns additional arguments to pass to go binaries.

func Json

func Json(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.

func LayerFromDataSource

func LayerFromDataSource(name string) (string, error)

Returns a layer name from a data source name

func Library

func Library(ctx context.Context, lib LibraryType, abi *device.ABI) (file.Path, error)

Library returns the path to the requested library.

func LibraryName

func LibraryName(lib LibraryType, abi *device.ABI) string

LibraryName returns the filename of the given Library.

func PerfettoCmd

func PerfettoCmd(ctx context.Context, abi *device.ABI) (file.Path, error)

PerfettoCmd returns the device info executable for the given ABI.

func Strings

func Strings(ctx context.Context) (file.Path, error)

Strings returns the path to the binary string table.

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, abi *device.ABI) (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

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

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
	LibCPUTiming
	LibDebugMarker
	LibMemoryTracker
)

func LibraryFromLayerName

func LibraryFromLayerName(name string) (LibraryType, error)

Returns a library from a given LayerName

type ZipLayout

type ZipLayout struct {
	// contains filtered or unexported fields
}

ZipLayout is a FileLayout view over a ZIP file.

func NewZipLayout

func NewZipLayout(f *zip.Reader, os device.OSKind) *ZipLayout

NewZipLayout returns a new ZipLayout using the given ZIP file.

func (*ZipLayout) DeviceInfo

func (l *ZipLayout) DeviceInfo(ctx context.Context, os device.OSKind) (*zip.File, error)

DeviceInfo returns the device info executable for the given ABI.

func (*ZipLayout) GapidApk

func (l *ZipLayout) GapidApk(ctx context.Context, abi *device.ABI) (*zip.File, error)

GapidApk returns the path to gapid.apk in this layout.

func (*ZipLayout) Gapir

func (l *ZipLayout) Gapir(ctx context.Context, abi *device.ABI) (*zip.File, error)

Gapir returns the path to the gapir binary in this layout.

func (*ZipLayout) Gapis

func (l *ZipLayout) Gapis(ctx context.Context) (*zip.File, error)

Gapis returns the path to the gapis binary in this layout.

func (*ZipLayout) Gapit

func (l *ZipLayout) Gapit(ctx context.Context) (*zip.File, error)

Gapit returns the path to the gapit binary in this layout.

func (*ZipLayout) Json

func (l *ZipLayout) Json(ctx context.Context, lib LibraryType, abi *device.ABI) (*zip.File, error)

Json returns the path to the Vulkan layer JSON definition for the given library.

func (*ZipLayout) Library

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

func (l *ZipLayout) PerfettoCmd(ctx context.Context, abi *device.ABI) (*zip.File, error)

PerfettoCmd returns the device info executable for the given ABI.

func (*ZipLayout) Strings

func (l *ZipLayout) Strings(ctx context.Context) (*zip.File, error)

Strings returns the path to the binary string table.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL