gles

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2017 License: Apache-2.0 Imports: 56 Imported by: 12

Documentation

Overview

Package gles implementes the API interface for the OpenGL ES graphics library.

Index

Constants

View Source
const DefaultVertexArrayId = VertexArrayId(0xFFFF0001)

If the default vertex array object (id 0) is not allowed on the target platform, we remap the uses to this array.

Variables

View Source
var (
	// We don't include tests directly in the gles package as it adds
	// signaficantly to the test build time.
	VisibleForTestingCompat     = compat
	VisibleForTestingGlSlCompat = glslCompat
)
View Source
var (
	// We don't include tests directly in the gles package as it adds
	// signaficantly to the test build time.
	VisibleForTestingStubShaderSource = stubShaderSource
)

Functions

func BuildProgram

func BuildProgram(ctx context.Context, s *api.GlobalState, cb CommandBuilder,
	vertexShaderID, fragmentShaderID ShaderId, programID ProgramId,
	vertexShaderSource, fragmentShaderSource string) []api.Cmd

BuildProgram returns the atoms to create a shader program with compiled vertex and fragment shaders. The returned program is not linked.

func CompileProgram

func CompileProgram(ctx context.Context, s *api.GlobalState, cb CommandBuilder,
	vertexShaderID, fragmentShaderID ShaderId, programID ProgramId,
	vertexShaderSource, fragmentShaderSource string) []api.Cmd

CompileProgram returns the atoms to compile and then attach vertex and fragment shaders to an existing shader program. The returned program is not linked.

func DataTypeSize

func DataTypeSize(t GLenum) int

DataTypeSize returns the size in bytes of the the specified data type.

func GLSLVersion

func GLSLVersion(glVersion string) (glsl.Version, error)

GLSLVersion returns the highest supported GLSL version for the given GL version.

func GetFramebufferAttachmentInfoByID added in v0.6.2

func GetFramebufferAttachmentInfoByID(
	state *api.GlobalState,
	thread uint64,
	attachment api.FramebufferAttachment,
	fb FramebufferId) (width, height, index uint32, format *image.Format, err error)

GetFramebufferAttachmentInfoByID returns the width, height and format of the specified attachment of the framebuffer with the given id. If fb is 0 then the currently bound framebuffer is used.

func PutUnusedIDMap

func PutUnusedIDMap(ctx context.Context) context.Context

Types

type CustomState

type CustomState struct{}

type EGLImageData added in v0.6.2

type EGLImageData struct {
	ID     id.ID
	Size   uint64
	Width  GLsizei
	Height GLsizei
	Format GLenum
	Type   GLenum
}

EGLImageData is an extra used to store snapshot of external image source.

func FindEGLImageData added in v0.6.2

func FindEGLImageData(extras *api.CmdExtras) *EGLImageData

FindEGLImageData searches for the EGLImageData in the extras, returning the EGLImageData if found, otherwise nil.

func (*EGLImageData) RemapResourceIDs added in v0.6.2

func (e *EGLImageData) RemapResourceIDs(cb func(id *id.ID) error) (api.ResourceReference, error)

RemapResourceIDs calls the given callback for each resource ID field.

type ErrUnexpectedDriverTraceError

type ErrUnexpectedDriverTraceError struct {
	DriverError   GLenum
	ExpectedError GLenum
}

func (ErrUnexpectedDriverTraceError) Error

type ErrorState

type ErrorState struct {
	TraceDriversGlError GLenum
	InterceptorsGlError GLenum
}

ErrorState is a command extra used to describe the GLES error state after the command has been executed. It is optional - we use it only for testing.

func FindErrorState

func FindErrorState(extras *api.CmdExtras) *ErrorState

FindErrorState searches for the ErrorState in the extras, returning the ErrorState if found, otherwise nil.

type GLSLParseResult

type GLSLParseResult struct {
	Program interface{}
	Errors  []string
}

type GlesDependencyGraphBehaviourProvider

type GlesDependencyGraphBehaviourProvider struct {
}

func (*GlesDependencyGraphBehaviourProvider) GetBehaviourForAtom

GetBehaviourForAtom returns state reads/writes that the given command performs.

Writes: Write dependencies keep atoms alive. Each atom must correctly report all its writes or it must set the keep-alive flag. If a write is missing then the liveness analysis will remove the atom since it seems unneeded. It is fine to omit related/overloaded commands that write to the same state as long as they are marked as keep-alive.

Reads: For each state write, all commands that could possibly read it must be implemented. This makes it more difficult to do only partial implementations. It is fine to overestimate reads, or to read parent state (i.e. superset).

type Version

type Version struct {
	IsES  bool
	Major int
	Minor int
}

Version represents the GL version major and minor numbers, and whether its flavour is ES, as opposed to Desktop GL.

func ParseVersion

func ParseVersion(str string) (*Version, error)

ParseVersion parses the GL version major, minor and flavour from the output of glGetString(GL_VERSION).

func (Version) AtLeast

func (v Version) AtLeast(major, minor int) bool

AtLeast returns true if the version is greater or equal to major.minor.

func (Version) AtLeastES

func (v Version) AtLeastES(major, minor int) bool

AtLeastES returns true if the version is OpenGL ES and is greater or equal to major.minor.

func (Version) AtLeastGL

func (v Version) AtLeastGL(major, minor int) bool

AtLeastGL returns true if the version is not OpenGL ES and is greater or equal to major.minor.

Directories

Path Synopsis
Package gles_pb describes the serialization format for the gles api.
Package gles_pb describes the serialization format for the gles api.
Package glsl contains routines for manipulation of OpenGL ES Shading Language programs.
Package glsl contains routines for manipulation of OpenGL ES Shading Language programs.
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.
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.
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.
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.
preprocessor
Package preprocessor defines the preprocessor for the OpenGL ES Shading Language.
Package preprocessor defines the preprocessor for the OpenGL ES Shading Language.
sema
Package sema performs semantic checking of OpenGL ES Shading Language programs.
Package sema performs semantic checking of OpenGL ES Shading Language programs.

Jump to

Keyboard shortcuts

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