internal

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultFramebuffer = &Framebuffer{
	id:                0,
	activeDrawBuffers: [4]bool{true, false, false, false},
}

Functions

func DetermineContentFormat added in v0.6.0

func DetermineContentFormat(framebuffer render.Framebuffer) render.DataFormat

func MoreCommands

func MoreCommands(queue *CommandQueue) bool

func NewPixelTransferBuffer

func NewPixelTransferBuffer(info render.BufferInfo) render.Buffer

func NewUniformBuffer added in v0.6.0

func NewUniformBuffer(info render.BufferInfo) render.Buffer

func PopCommand

func PopCommand[T any](queue *CommandQueue) T

func PopData added in v0.6.0

func PopData(queue *CommandQueue, count uint32) []byte

func PushCommand

func PushCommand[T any](queue *CommandQueue, command T)

func PushData added in v0.6.0

func PushData(queue *CommandQueue, data []byte)

Types

type Buffer

type Buffer struct {
	render.BufferObject
	// contains filtered or unexported fields
}

func NewIndexBuffer

func NewIndexBuffer(info render.BufferInfo) *Buffer

func NewVertexBuffer

func NewVertexBuffer(info render.BufferInfo) *Buffer

func (*Buffer) Fetch

func (b *Buffer) Fetch(info render.BufferFetchInfo)

func (*Buffer) Release

func (b *Buffer) Release()

func (*Buffer) Update

func (b *Buffer) Update(info render.BufferUpdateInfo)

type CommandBindPipeline

type CommandBindPipeline struct {
	ProgramID        uint32 // not dynamic
	Topology         CommandTopology
	CullTest         CommandCullTest
	FrontFace        CommandFrontFace
	DepthTest        CommandDepthTest
	DepthWrite       CommandDepthWrite
	DepthComparison  CommandDepthComparison
	StencilTest      CommandStencilTest
	StencilOpFront   CommandStencilOperation
	StencilOpBack    CommandStencilOperation
	StencilFuncFront CommandStencilFunc
	StencilFuncBack  CommandStencilFunc
	StencilMaskFront CommandStencilMask
	StencilMaskBack  CommandStencilMask
	ColorWrite       CommandColorWrite
	BlendEnabled     bool // not dynamic
	BlendEquation    CommandBlendEquation
	BlendFunc        CommandBlendFunc
	BlendColor       CommandBlendColor
	VertexArray      CommandBindVertexArray
}

type CommandBindVertexArray

type CommandBindVertexArray struct {
	VertexArrayID uint32
	IndexFormat   uint32
}

type CommandBlendColor

type CommandBlendColor struct {
	Color [4]float32
}

type CommandBlendEquation

type CommandBlendEquation struct {
	ModeRGB   uint32
	ModeAlpha uint32
}

type CommandBlendFunc

type CommandBlendFunc struct {
	SourceFactorRGB        uint32
	DestinationFactorRGB   uint32
	SourceFactorAlpha      uint32
	DestinationFactorAlpha uint32
}

type CommandColorWrite

type CommandColorWrite struct {
	Mask [4]bool
}

type CommandCopyContentToBuffer

type CommandCopyContentToBuffer struct {
	BufferID     uint32
	X            int32
	Y            int32
	Width        int32
	Height       int32
	Format       uint32
	XType        uint32
	BufferOffset uint32
}

type CommandCullTest

type CommandCullTest struct {
	Enabled bool
	Face    uint32
}

type CommandDepthComparison

type CommandDepthComparison struct {
	Mode uint32
}

type CommandDepthTest

type CommandDepthTest struct {
	Enabled bool
}

type CommandDepthWrite

type CommandDepthWrite struct {
	Enabled bool
}

type CommandDraw

type CommandDraw struct {
	VertexOffset  int32
	VertexCount   int32
	InstanceCount int32
}

type CommandDrawIndexed

type CommandDrawIndexed struct {
	IndexOffset   int32
	IndexCount    int32
	InstanceCount int32
}

type CommandFrontFace

type CommandFrontFace struct {
	Orientation uint32
}

type CommandHeader

type CommandHeader struct {
	Kind CommandKind
}

type CommandKind

type CommandKind uint8
const (
	CommandKindBindPipeline CommandKind = iota
	CommandKindTopology
	CommandKindCullTest
	CommandKindFrontFace
	CommandKindDepthTest
	CommandKindDepthWrite
	CommandKindDepthComparison
	CommandKindStencilTest
	CommandKindStencilOperation
	CommandKindStencilFunc
	CommandKindStencilMask
	CommandKindColorWrite
	CommandKindBlendColor
	CommandKindBlendEquation
	CommandKindBlendFunc
	CommandBindKindVertexArray
	CommandKindUniform1f
	CommandKindUniform1i
	CommandKindUniform3f
	CommandKindUniform4f
	CommandKindUniformMatrix4f
	CommandKindUniformBufferUnit
	CommandKindUniformBufferUnitRange
	CommandKindTextureUnit
	CommandKindDraw
	CommandKindDrawIndexed
	CommandKindCopyContentToBuffer
	CommandKindUpdateBufferData
)

type CommandQueue

type CommandQueue struct {
	// contains filtered or unexported fields
}

func NewCommandQueue

func NewCommandQueue() *CommandQueue

func (*CommandQueue) BindPipeline

func (q *CommandQueue) BindPipeline(pipeline render.Pipeline)

func (*CommandQueue) CopyContentToBuffer

func (q *CommandQueue) CopyContentToBuffer(info render.CopyContentToBufferInfo)

func (*CommandQueue) Draw

func (q *CommandQueue) Draw(vertexOffset, vertexCount, instanceCount int)

func (*CommandQueue) DrawIndexed

func (q *CommandQueue) DrawIndexed(indexOffset, indexCount, instanceCount int)

func (*CommandQueue) Release

func (q *CommandQueue) Release()

func (*CommandQueue) Reset

func (q *CommandQueue) Reset()

func (*CommandQueue) TextureUnit

func (q *CommandQueue) TextureUnit(index int, texture render.Texture)

func (*CommandQueue) Uniform1f

func (q *CommandQueue) Uniform1f(location render.UniformLocation, value float32)

func (*CommandQueue) Uniform1i

func (q *CommandQueue) Uniform1i(location render.UniformLocation, value int)

func (*CommandQueue) Uniform3f

func (q *CommandQueue) Uniform3f(location render.UniformLocation, values [3]float32)

func (*CommandQueue) Uniform4f

func (q *CommandQueue) Uniform4f(location render.UniformLocation, values [4]float32)

func (*CommandQueue) UniformBufferUnit added in v0.6.0

func (q *CommandQueue) UniformBufferUnit(index int, buffer render.Buffer)

func (*CommandQueue) UniformBufferUnitRange added in v0.6.0

func (q *CommandQueue) UniformBufferUnitRange(index int, buffer render.Buffer, offset, size int)

func (*CommandQueue) UniformMatrix4f

func (q *CommandQueue) UniformMatrix4f(location render.UniformLocation, values [16]float32)

func (*CommandQueue) UpdateBufferData added in v0.6.0

func (q *CommandQueue) UpdateBufferData(buffer render.Buffer, info render.BufferUpdateInfo)

type CommandStencilFunc

type CommandStencilFunc struct {
	Face uint32
	Func uint32
	Ref  int32
	Mask uint32
}

type CommandStencilMask

type CommandStencilMask struct {
	Face uint32
	Mask uint32
}

type CommandStencilOperation

type CommandStencilOperation struct {
	Face        uint32
	StencilFail uint32
	DepthFail   uint32
	Pass        uint32
}

type CommandStencilTest

type CommandStencilTest struct {
	Enabled bool
}

type CommandTextureUnit

type CommandTextureUnit struct {
	Index     uint32
	TextureID uint32
}

type CommandTopology

type CommandTopology struct {
	Topology uint32
}

type CommandUniform1f

type CommandUniform1f struct {
	Location int32
	Value    float32
}

type CommandUniform1i

type CommandUniform1i struct {
	Location int32
	Value    int32
}

type CommandUniform3f

type CommandUniform3f struct {
	Location int32
	Values   [3]float32
}

type CommandUniform4f

type CommandUniform4f struct {
	Location int32
	Values   [4]float32
}

type CommandUniformBufferUnit added in v0.6.0

type CommandUniformBufferUnit struct {
	Index    uint32
	BufferID uint32
}

type CommandUniformBufferUnitRange added in v0.6.0

type CommandUniformBufferUnitRange struct {
	Index    uint32
	BufferID uint32
	Offset   uint32
	Size     uint32
}

type CommandUniformMatrix4f

type CommandUniformMatrix4f struct {
	Location int32
	Values   [16]float32
}

type CommandUpdateBufferData added in v0.6.0

type CommandUpdateBufferData struct {
	BufferID uint32
	Offset   uint32
	Count    uint32
}

type Fence

type Fence struct {
	render.FenceObject
	// contains filtered or unexported fields
}

func NewFence

func NewFence() *Fence

func (*Fence) Delete

func (f *Fence) Delete()

func (*Fence) Status

func (f *Fence) Status() render.FenceStatus

type Framebuffer

type Framebuffer struct {
	render.FramebufferObject
	// contains filtered or unexported fields
}

func NewFramebuffer

func NewFramebuffer(info render.FramebufferInfo) *Framebuffer

func (*Framebuffer) Release

func (f *Framebuffer) Release()

type Pipeline

type Pipeline struct {
	render.PipelineObject
	ProgramID        uint32
	Topology         CommandTopology
	CullTest         CommandCullTest
	FrontFace        CommandFrontFace
	DepthTest        CommandDepthTest
	DepthWrite       CommandDepthWrite
	DepthComparison  CommandDepthComparison
	StencilTest      CommandStencilTest
	StencilOpFront   CommandStencilOperation
	StencilOpBack    CommandStencilOperation
	StencilFuncFront CommandStencilFunc
	StencilFuncBack  CommandStencilFunc
	StencilMaskFront CommandStencilMask
	StencilMaskBack  CommandStencilMask
	ColorWrite       CommandColorWrite
	BlendEnabled     bool
	BlendColor       CommandBlendColor
	BlendEquation    CommandBlendEquation
	BlendFunc        CommandBlendFunc
	VertexArray      CommandBindVertexArray
}

func NewPipeline

func NewPipeline(info render.PipelineInfo) *Pipeline

func (*Pipeline) Release

func (p *Pipeline) Release()

type Program

type Program struct {
	render.ProgramObject
	// contains filtered or unexported fields
}

func NewProgram

func NewProgram(info render.ProgramInfo) *Program

func (*Program) Release

func (p *Program) Release()

func (*Program) UniformLocation

func (p *Program) UniformLocation(name string) render.UniformLocation

type Renderer

type Renderer struct {
	// contains filtered or unexported fields
}

func NewRenderer

func NewRenderer() *Renderer

func (*Renderer) BeginRenderPass

func (r *Renderer) BeginRenderPass(info render.RenderPassInfo)

func (*Renderer) BindPipeline

func (r *Renderer) BindPipeline(pipeline render.Pipeline)

func (*Renderer) CopyContentToTexture

func (r *Renderer) CopyContentToTexture(info render.CopyContentToTextureInfo)

func (*Renderer) Draw

func (r *Renderer) Draw(vertexOffset, vertexCount, instanceCount int)

func (*Renderer) DrawIndexed

func (r *Renderer) DrawIndexed(indexOffset, indexCount, instanceCount int)

func (*Renderer) EndRenderPass

func (r *Renderer) EndRenderPass()

func (*Renderer) Invalidate added in v0.4.0

func (r *Renderer) Invalidate()

func (*Renderer) SubmitQueue

func (r *Renderer) SubmitQueue(queue *CommandQueue)

func (*Renderer) TextureUnit

func (r *Renderer) TextureUnit(index int, texture render.Texture)

func (*Renderer) Uniform1f

func (r *Renderer) Uniform1f(location render.UniformLocation, value float32)

func (*Renderer) Uniform1i

func (r *Renderer) Uniform1i(location render.UniformLocation, value int)

func (*Renderer) Uniform3f

func (r *Renderer) Uniform3f(location render.UniformLocation, values [3]float32)

func (*Renderer) Uniform4f

func (r *Renderer) Uniform4f(location render.UniformLocation, values [4]float32)

func (*Renderer) UniformBufferUnit added in v0.6.0

func (r *Renderer) UniformBufferUnit(index int, buffer render.Buffer)

func (*Renderer) UniformBufferUnitRange added in v0.6.0

func (r *Renderer) UniformBufferUnitRange(index int, buffer render.Buffer, offset, size int)

func (*Renderer) UniformMatrix4f

func (r *Renderer) UniformMatrix4f(location render.UniformLocation, values [16]float32)

type Shader

type Shader struct {
	render.ShaderObject
	// contains filtered or unexported fields
}

func NewFragmentShader

func NewFragmentShader(info render.ShaderInfo) *Shader

func NewVertexShader

func NewVertexShader(info render.ShaderInfo) *Shader

func (*Shader) Release

func (s *Shader) Release()

type State added in v0.4.0

type State struct {
	CullTest                    bool
	CullFace                    uint32
	FrontFace                   uint32
	DepthTest                   bool
	DepthMask                   bool
	DepthComparison             uint32
	StencilTest                 bool
	StencilOpStencilFailFront   uint32
	StencilOpDepthFailFront     uint32
	StencilOpPassFront          uint32
	StencilOpStencilFailBack    uint32
	StencilOpDepthFailBack      uint32
	StencilOpPassBack           uint32
	StencilComparisonFuncFront  uint32
	StencilComparisonRefFront   int32
	StencilComparisonMaskFront  uint32
	StencilComparisonFuncBack   uint32
	StencilComparisonRefBack    int32
	StencilComparisonMaskBack   uint32
	StencilMaskFront            uint32
	StencilMaskBack             uint32
	ColorMask                   [4]bool
	Blending                    bool
	BlendColor                  [4]float32
	BlendModeRGB                uint32
	BlendModeAlpha              uint32
	BlendSourceFactorRGB        uint32
	BlendDestinationFactorRGB   uint32
	BlendSourceFactorAlpha      uint32
	BlendDestinationFactorAlpha uint32
}

type Texture

type Texture struct {
	render.TextureObject
	// contains filtered or unexported fields
}

func NewColorTexture2D

func NewColorTexture2D(info render.ColorTexture2DInfo) *Texture

func NewColorTextureCube

func NewColorTextureCube(info render.ColorTextureCubeInfo) *Texture

func NewDepthStencilTexture2D

func NewDepthStencilTexture2D(info render.DepthStencilTexture2DInfo) *Texture

func NewDepthTexture2D

func NewDepthTexture2D(info render.DepthTexture2DInfo) *Texture

func NewStencilTexture2D

func NewStencilTexture2D(info render.StencilTexture2DInfo) *Texture

func (*Texture) Release

func (t *Texture) Release()

type VertexArray

type VertexArray struct {
	render.VertexArrayObject
	// contains filtered or unexported fields
}

func NewVertexArray

func NewVertexArray(info render.VertexArrayInfo) *VertexArray

func (*VertexArray) Release

func (a *VertexArray) Release()

Jump to

Keyboard shortcuts

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