gles

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2018 License: Apache-2.0 Imports: 55 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
	// significantly to the test build time.
	VisibleForTestingCompat = compat
)
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 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.

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 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 GLSLVersion

func GLSLVersion(glVersion string) (Version, error)

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

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.

Jump to

Keyboard shortcuts

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