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 GetAttribLocation(ctx context.Context, s *api.GlobalState, cb CommandBuilder, ...) api.Cmd
- func GetFramebufferAttachmentInfoByID(state *api.GlobalState, thread uint64, attachment api.FramebufferAttachment, ...) (inf api.FramebufferAttachmentInfo, err error)
- func GetUniformLocation(ctx context.Context, s *api.GlobalState, cb CommandBuilder, ...) api.Cmd
- func PutUnusedIDMap(ctx context.Context) context.Context
- type EGLImageData
- type ErrUnexpectedDriverTraceError
- type ErrorState
- 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 // significantly to the test build time. VisibleForTestingCompat = compat )
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.
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 ¶
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 GlesDependencyGraphBehaviourProvider ¶
type GlesDependencyGraphBehaviourProvider struct{}
func (*GlesDependencyGraphBehaviourProvider) GetBehaviourForCommand ¶ added in v1.2.0
func (*GlesDependencyGraphBehaviourProvider) GetBehaviourForCommand( ctx context.Context, s *api.GlobalState, id api.CmdID, cmd api.Cmd, g *dependencygraph.DependencyGraph) dependencygraph.CmdBehaviour
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 ¶
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).
func (Version) AsInt ¶ added in v1.1.0
AsInt returns the version in the form Mmm, where M is the major version and m is the minor version.
func (Version) AtLeastES ¶
AtLeastES returns true if the version is OpenGL ES and is greater or equal to major.minor.
Source Files ¶
- compat.go
- compat_buffers.go
- compat_client.go
- context.go
- custom_replay.go
- datatypes.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
- graph_visualization.go
- guess_semantics.go
- helpers.go
- image.go
- importance.go
- issue_whitelist.go
- links.go
- markers.go
- math.go
- read_depth.go
- read_framebuffer.go
- read_texture.go
- replay.go
- resources.go
- state.go
- state_builder.go
- string.go
- stub_program.go
- texture_compat.go
- tweaker.go
- undefined_framebuffer.go
- version.go
- wireframe.go