gfxapi

package
v0.0.0-...-205059d Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2017 License: Apache-2.0 Imports: 29 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package gfxapi exposes the shared behavior of all graphics api's.

Index

Constants

This section is empty.

Variables

View Source
var DefaultMemoryLayout = device.Little32

DefaultMemoryLayout is the device memory layout used before the architecture information is supplied in the atom stream.

Functions

func AddCanFollowState

func AddCanFollowState(t reflect.Type, snips *[]binary.Object)

AddCanFollowState add CanFollow snippets for the global API state object.

func AddStateSnippetsFromBase64String

func AddStateSnippetsFromBase64String(stateEntity *binary.Entity, b64 string) error

AddStateSnippetsFromBase64String decodes the specified string as base64 encoded binary decoder input. Decoded snippet objects are added to the specified entity which should be the schema entity for the API state object associated with the snippets. Returns a non-nil error if there was an error decoding base64 or binary decoding. Base64 encoding is used so that the binary encoded string can be embedded directly in the library using the "embed" tool.

func AddStateSnippetsFromReader

func AddStateSnippetsFromReader(stateEntity *binary.Entity, reader io.Reader) error

AddStateSnippetsFromReader decodes the input reader and adds snippet objects to the specified entity which should be the schema entity for the API state object associated with the snippets. Returns an error if there was an error reading or decoding.

func CharToBytes

func CharToBytes(ϟchars []Char) []byte

CharToBytes changes the gfxapi.Char values to their byte[] representation.

func Register

func Register(api API)

Register adds an api to the understood set. It is illegal to register the same name twice.

Types

type API

type API interface {
	// Name returns the official name of the api.
	Name() string

	// Index returns the API index.
	Index() uint8

	// ID returns the unique API identifier.
	ID() ID

	// GetFramebufferAttachmentInfo returns the width, height and format of the specified framebuffer attachment.
	GetFramebufferAttachmentInfo(state *State, attachment FramebufferAttachment) (width, height uint32, format *image.Format, err error)

	// Context returns the active context for the given state.
	Context(*State) Context
}

API is the common interface to a graphics programming api.

func Find

func Find(id ID) API

Find looks up a graphics API by identifier. If the id has not been registered, it returns nil.

type APIObject

type APIObject interface {
	// API returns the API identifier that this type belongs to.
	API() API
}

APIObject is the interface implemented by types that belong to an API.

type Char

type Char uint8

Char is the possibly signed but maybe unsigned C/C++ char.

type Context

type Context interface {
	// Name returns the display-name of the context.
	Name() string

	// ID returns the context's unique identifier
	ID() ContextID
}

Context represents a graphics API's unique context of execution.

type ContextID

type ContextID id.ID

ContextID is the unique identifier for a context.

type GlobalSnippets

type GlobalSnippets []snippets.KindredSnippets

GlobalSnippets is kindred grouped table of snippets with paths that apply to the global state. It is used to provide snippets for the API state object and ultimately the state view in the UI.

type ID

type ID id.ID

ID is an API identifier

func (ID) IsValid

func (i ID) IsValid() bool

IsValid returns true if the id is not the default zero value.

type MeshProvider

type MeshProvider interface {
	// Mesh returns the mesh representation of the object o.
	// If nil, nil then the object cannot be represented as a mesh.
	Mesh(ctx context.Context, o interface{}, p *path.Mesh) (*Mesh, error)
}

MeshProvider is the interface implemented by types that provide meshes.

type ReplaceCallback

type ReplaceCallback func(where uint64, with ResourceAtom)

ReplaceCallback is called from SetResourceData to propagate changes to current atom stream.

type Resource

type Resource interface {
	// ResourceHandle returns the UI identity for the resource.
	// For GL this is the GLuint object name, for Vulkan the pointer.
	ResourceHandle() string

	// ResourceLabel returns the UI name for the resource.
	ResourceLabel() string

	// Order returns an integer used to sort the resources for presentation.
	Order() uint64

	// ResourceType returns the type of this resource.
	ResourceType() ResourceType

	// ResourceData returns the resource data given the current state.
	ResourceData(ctx context.Context, s *State, resources ResourceMap) (interface{}, error)

	// SetResourceData sets resource data in a new capture.
	SetResourceData(ctx context.Context, at *path.Command, data interface{}, resources ResourceMap, edits ReplaceCallback) error
}

Resource represents an asset in a capture.

type ResourceAtom

type ResourceAtom interface {
	// Replace clones an atom and sets new data.
	Replace(ctx context.Context, data interface{}) ResourceAtom
}

ResourceAtom describes atoms which should be replaced with resource data. TODO: Remove it and use atom.Atom itself (which is impossible for now because of a dependency cycle).

type ResourceMap

type ResourceMap map[Resource]id.ID

ResourceMap is a map from Resource to its id in a database.

type ResourceMeta

type ResourceMeta struct {
	Resource Resource    // Resolved resource.
	IDMap    ResourceMap // Map for resolved resources to ids.
}

ResourceMeta represents resource with a state information obtained during building.

type State

type State struct {
	binary.Object `java:"disable"`

	// MemoryLayout holds information about the device memory layout that was
	// used to create the capture.
	MemoryLayout *device.MemoryLayout

	// Memory holds the memory state of the application.
	Memory map[memory.PoolID]*memory.Pool

	// NextPoolID hold the identifier of the next Pool to be created.
	NextPoolID memory.PoolID

	// APIs holds the per-API context states.
	APIs map[API]binary.Object

	// Allocator keeps track of and reserves memory areas not used in the trace.
	Allocator memory.Allocator

	// OnResourceCreated is called when a new resource is created.
	OnResourceCreated func(Resource)

	// OnResourceAccessed is called when a resource is used.
	OnResourceAccessed func(Resource)

	// OnError is called when the command does not conform to the API.
	OnError func(err interface{})

	// NewMessage is called when there is a message to be passed to a report.
	NewMessage func(level log.Severity, msg *stringtable.Msg) uint32

	// AddTag is called when we want to tag report item.
	AddTag func(msgID uint32, msg *stringtable.Msg)
}

State represents the graphics state across all contexts.

func NewStateWithAllocator

func NewStateWithAllocator(allocator memory.Allocator) *State

NewStateWithAllocator returns a new, default-initialized State object, that uses the given memory.Allocator instance.

func NewStateWithEmptyAllocator

func NewStateWithEmptyAllocator() *State

func NewStateWithNilAllocator

func NewStateWithNilAllocator() *State

func (State) MemoryDecoder

func (st State) MemoryDecoder(ctx context.Context, s memory.Slice) pod.Reader

MemoryDecoder returns an endian reader that uses the byte-order of the capture device to decode from the slice s.

func (State) MemoryEncoder

func (st State) MemoryEncoder(p *memory.Pool, rng memory.Range) pod.Writer

MemoryEncoder returns an endian reader that uses the byte-order of the capture device to encode to the pool p, for the range rng.

func (State) String

func (st State) String() string

Directories

Path Synopsis
Package all is used to import all known gfxapi APIs for their side effects.
Package all is used to import all known gfxapi APIs for their side effects.
core_pb
Package core_pb describes the serialization format for the core api.
Package core_pb describes the serialization format for the core api.
Package gles implementes the API interface for the OpenGL ES graphics library.
Package gles implementes the API interface for the OpenGL ES graphics library.
gles_pb
Package gles_pb describes the serialization format for the gles api.
Package gles_pb describes the serialization format for the gles api.
glsl
Package glsl contains routines for manipulation of OpenGL ES Shading Language programs.
Package glsl contains routines for manipulation of OpenGL ES Shading Language programs.
glsl/ast
Package ast defines the abstract syntax tree of OpenGL ES Shading Language programs.
Package ast defines the abstract syntax tree of OpenGL ES Shading Language programs.
glsl/builtins
Package builtins contains the definitions of all OpenGL ES Shading Language builtin functions.
Package builtins contains the definitions of all OpenGL ES Shading Language builtin functions.
glsl/evaluator
Package evaluator is responsible for evaluating expressions in OpenGL ES Shading Language programs.
Package evaluator is responsible for evaluating expressions in OpenGL ES Shading Language programs.
glsl/parser
Package parser implements parsing and serializing an OpenGL ES Shading Language programs.
Package parser implements parsing and serializing an OpenGL ES Shading Language programs.
glsl/preprocessor
Package preprocessor defines the preprocessor for the OpenGL ES Shading Language.
Package preprocessor defines the preprocessor for the OpenGL ES Shading Language.
glsl/sema
Package sema performs semantic checking of OpenGL ES Shading Language programs.
Package sema performs semantic checking of OpenGL ES Shading Language programs.
Package test is the integration test suite for the api compiler and templates.
Package test is the integration test suite for the api compiler and templates.
gfxapi_test_import
Package gfxapi_test_import represents an API imported by the test API.
Package gfxapi_test_import represents an API imported by the test API.
test_pb
Package test_pb describes the serialization format for the test api.
Package test_pb describes the serialization format for the test api.
Package vulkan implementes the API interface for the Vulkan graphics library.
Package vulkan implementes the API interface for the Vulkan graphics library.
vulkan_pb
Package vulkan_pb describes the serialization format for the vulkan api.
Package vulkan_pb describes the serialization format for the vulkan api.

Jump to

Keyboard shortcuts

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