gles

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2019 License: Apache-2.0 Imports: 52 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 commands 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 commands 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 GetAttribLocation added in v1.1.0

func GetAttribLocation(ctx context.Context, s *api.GlobalState, cb CommandBuilder,
	programID ProgramId, name string, loc AttributeLocation) api.Cmd

GetAttribLocation returns the command to get an attribute location by name.

func GetFramebufferAttachmentInfoByID added in v0.6.2

func GetFramebufferAttachmentInfoByID(
	state *api.GlobalState,
	thread uint64,
	attachment api.FramebufferAttachment,
	fb FramebufferId) (inf api.FramebufferAttachmentInfo, 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 GetUniformLocation added in v1.1.0

func GetUniformLocation(ctx context.Context, s *api.GlobalState, cb CommandBuilder,
	programID ProgramId, name string, loc UniformLocation) api.Cmd

GetUniformLocation returns the command to get a uniform location by name.

func PutUnusedIDMap

func PutUnusedIDMap(ctx context.Context) context.Context

Types

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) GetBehaviourForCommand added in v1.2.0

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

Writes: Write dependencies keep commands alive. Each command 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 command 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) AsInt added in v1.1.0

func (v Version) AsInt() int

AsInt returns the version in the form Mmm, where M is the major version and m is the minor 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.

func (Version) MaxGLSL added in v1.1.0

func (v Version) MaxGLSL() Version

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

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