Documentation
¶
Overview ¶
Package gfxapi exposes the shared behavior of all graphics api's.
Index ¶
- Variables
- func AddCanFollowState(t reflect.Type, snips *[]binary.Object)
- func AddStateSnippetsFromBase64String(stateEntity *binary.Entity, b64 string) error
- func AddStateSnippetsFromReader(stateEntity *binary.Entity, reader io.Reader) error
- func CharToBytes(ϟchars []Char) []byte
- func Register(api API)
- type API
- type APIObject
- type Char
- type Context
- type ContextID
- type GlobalSnippets
- type ID
- type MeshProvider
- type ReplaceCallback
- type Resource
- type ResourceAtom
- type ResourceMap
- type ResourceMeta
- type State
Constants ¶
This section is empty.
Variables ¶
var DefaultMemoryLayout = device.Little32
DefaultMemoryLayout is the device memory layout used before the architecture information is supplied in the atom stream.
Functions ¶
func AddCanFollowState ¶
AddCanFollowState add CanFollow snippets for the global API state object.
func AddStateSnippetsFromBase64String ¶
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 ¶
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 ¶
CharToBytes changes the gfxapi.Char values to their byte[] representation.
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.
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 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 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 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 ¶
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 ¶
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 ¶
MemoryDecoder returns an endian reader that uses the byte-order of the capture device to decode from the slice s.
func (State) MemoryEncoder ¶
MemoryEncoder returns an endian reader that uses the byte-order of the capture device to encode to the pool p, for the range rng.
Source Files
¶
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. |