Documentation ¶
Overview ¶
Package gles implementes the API interface for the OpenGL ES graphics library.
Index ¶
- Constants
- Variables
- func BuildProgram(ctx context.Context, s *api.GlobalState, cb CommandBuilder, ...) []api.Cmd
- func CompileProgram(ctx context.Context, s *api.GlobalState, cb CommandBuilder, ...) []api.Cmd
- func DataTypeSize(t GLenum) int
- func GLSLVersion(glVersion string) (glsl.Version, error)
- func GetFramebufferAttachmentInfoByID(state *api.GlobalState, thread uint64, attachment api.FramebufferAttachment, ...) (width, height, index uint32, format *image.Format, err error)
- func PutUnusedIDMap(ctx context.Context) context.Context
- type CustomState
- type EGLImageData
- type ErrUnexpectedDriverTraceError
- type ErrorState
- type GLSLParseResult
- type GlesDependencyGraphBehaviourProvider
- type Version
Constants ¶
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 ¶
var ( // We don't include tests directly in the gles package as it adds // signaficantly to the test build time. VisibleForTestingCompat = compat VisibleForTestingGlSlCompat = glslCompat )
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 ¶
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.
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 ¶
func (e ErrUnexpectedDriverTraceError) Error() string
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 ¶
func (*GlesDependencyGraphBehaviourProvider) GetBehaviourForAtom( ctx context.Context, s *api.GlobalState, id api.CmdID, cmd api.Cmd, g *dependencygraph.DependencyGraph) dependencygraph.AtomBehaviour
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 ¶
Version represents the GL version major and minor numbers, and whether its flavour is ES, as opposed to Desktop GL.
func ParseVersion ¶
ParseVersion parses the GL version major, minor and flavour from the output of glGetString(GL_VERSION).
Source Files ¶
- compat.go
- compat_client.go
- context.go
- custom_replay.go
- dependency_graph_behaviour_provider.go
- doc.go
- draw_call.go
- draw_call_mesh.go
- externs.go
- extras.go
- find_issues.go
- gles.go
- glsl.go
- glsl_compat.go
- guess_semantics.go
- helpers.go
- image.go
- importance.go
- issue_whitelist.go
- links.go
- markers.go
- read_framebuffer.go
- read_texture.go
- replay.go
- resources.go
- state.go
- string.go
- stub_program.go
- texture_compat.go
- tweaker.go
- undefined_framebuffer.go
- version.go
- vertex_attribute_array.go
- wireframe.go
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. |