Documentation ¶
Index ¶
- Constants
- func Barrier()
- func Flush()
- func Init()
- func Sync()
- type Buffer
- func LoadBufferAtomic(sourceSlicePtr interface{}, usageHint uint32) *Buffer
- func LoadBufferStorage(sourceSlicePtr interface{}, usageHint uint32) *Buffer
- func LoadBufferUniform(sourceSlicePtr interface{}, usageHint uint32) *Buffer
- func NewBufferAtomic(length int, elemSize uintptr, usageHint uint32) *Buffer
- func NewBufferStorage(length int, elemSize uintptr, usageHint uint32) *Buffer
- func NewBufferUniform(length int, elemSize uintptr, usageHint uint32) *Buffer
- func (b *Buffer) Bind(slot uint32)
- func (b *Buffer) Delete()
- func (b *Buffer) Download(slicePtr interface{})
- func (b *Buffer) Map(slicePtr interface{}, accessFlags uint32)
- func (b *Buffer) MapRange(slicePtr interface{}, offset, length int, accessFlags uint32)
- func (b *Buffer) Ready() bool
- func (b *Buffer) Unmap() bool
- func (b *Buffer) Upload(slicePtr interface{})
- type Program
- type Shader
Constants ¶
const ( BUF_STREAM_DRAW = gl.STREAM_DRAW BUF_STREAM_READ = gl.STREAM_READ BUF_STREAM_COPY = gl.STREAM_COPY BUF_STATIC_DRAW = gl.STATIC_DRAW BUF_STATIC_READ = gl.STATIC_READ BUF_STATIC_COPY = gl.STATIC_COPY BUF_DYNAMIC_DRAW = gl.DYNAMIC_DRAW BUF_DYNAMIC_READ = gl.DYNAMIC_READ BUF_DYNAMIC_COPY = gl.DYNAMIC_COPY )
buffer usage hint those are passed to the GPU driver to help optimizer when NewBuffer/LoadBuffer is called see https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glBufferData.xhtml
const ( MAP_READ = gl.MAP_READ_BIT MAP_WRITE = gl.MAP_WRITE_BIT MAP_PERSISTENT = gl.MAP_PERSISTENT_BIT MAP_COHERENT = gl.MAP_COHERENT_BIT MAP_INVALIDATE_RANGE = gl.MAP_INVALIDATE_RANGE_BIT MAP_INVALIDATE_BUFFER = gl.MAP_INVALIDATE_BUFFER_BIT MAP_FLUSH_EXPLICIT = gl.MAP_FLUSH_EXPLICIT_BIT MAP_UNSYNCHRONIZED = gl.MAP_UNSYNCHRONIZED_BIT )
access flags
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Buffer ¶
type Buffer struct {
// contains filtered or unexported fields
}
Wrapper for OpenGL buffer objects
func LoadBufferAtomic ¶
func LoadBufferStorage ¶
func LoadBufferUniform ¶
func NewBufferAtomic ¶
Allocates a buffer object for usage as atomic counters
func NewBufferStorage ¶
Allocates a buffer object for storage (mapped R/W access by shaders)
func NewBufferUniform ¶
Allocates a buffer object for usage as shader uniform parameter
func (*Buffer) Bind ¶
Bind the buffer to a shader binding point see https://www.khronos.org/opengl/wiki/GLAPI/glBindBufferBase
func (*Buffer) Map ¶
pass a slice buffer then Map will ma it point to the memory-mapped address of the buffer in GPU memory
type Program ¶
type Program struct {
// contains filtered or unexported fields
}
Hight-level wrapper for shader programs
func LoadProgram ¶
init a program then link it with a shader copiled from the source file passed as argument
func NewProgram ¶
func NewProgram() *Program
returns a new empty program it must be linked with a shader before it can be used
func (Program) Call ¶
bind the list of buffers passed in ascending order then calls glDispatchCompute ie. p.Call(a, b, c, buf1, nil, buf2) is equivalent to buf1.Bind(0) buf2.Bind(2) p.Dispacth(a, b, c)
func (*Program) LinkShader ¶
type Shader ¶
type Shader struct {
// contains filtered or unexported fields
}
wrapper for shaders not necessary since Program handles the creation/deletion of shaders