internal

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultFramebuffer = func() *Framebuffer {
	result := &Framebuffer{
		label:             "default",
		id:                0,
		activeDrawBuffers: [4]bool{true, false, false, false},
	}
	framebuffers.Track(result.id, result)
	return result
}()

Functions

func CommandLoadOperationToRender added in v0.17.0

func CommandLoadOperationToRender(value CommandLoadOperation) render.LoadOperation

func CommandStoreOperationToRender added in v0.17.0

func CommandStoreOperationToRender(value CommandStoreOperation) render.StoreOperation

func DetermineContentFormat

func DetermineContentFormat(framebuffer render.Framebuffer) render.DataFormat

func NewPixelTransferBuffer

func NewPixelTransferBuffer(info render.BufferInfo) render.Buffer

func NewUniformBuffer

func NewUniformBuffer(info render.BufferInfo) render.Buffer

func StrPtr added in v0.20.3

func StrPtr(s string) *uint8

Types

type Buffer

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

func NewIndexBuffer

func NewIndexBuffer(info render.BufferInfo) *Buffer

func NewVertexBuffer

func NewVertexBuffer(info render.BufferInfo) *Buffer

func (*Buffer) Label added in v0.20.2

func (b *Buffer) Label() string

func (*Buffer) Release

func (b *Buffer) Release()

type CommandBeginRenderPass added in v0.17.0

type CommandBeginRenderPass struct {
	FramebufferID     uint32
	ViewportX         int32
	ViewportY         int32
	ViewportWidth     int32
	ViewportHeight    int32
	Colors            [4]CommandColorAttachment
	DepthLoadOp       CommandLoadOperation
	DepthStoreOp      CommandStoreOperation
	DepthClearValue   float32
	DepthBias         float32
	DepthSlopeBias    float32
	StencilLoadOp     CommandLoadOperation
	StencilStoreOp    CommandStoreOperation
	StencilClearValue int32
}

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 CommandBuffer added in v0.17.0

type CommandBuffer struct {
	render.CommandBufferMarker
	// contains filtered or unexported fields
}

func NewCommandBuffer added in v0.17.0

func NewCommandBuffer(initialCapacity uint) *CommandBuffer

func (*CommandBuffer) BeginRenderPass added in v0.17.0

func (b *CommandBuffer) BeginRenderPass(info render.RenderPassInfo)

func (*CommandBuffer) BindPipeline added in v0.17.0

func (b *CommandBuffer) BindPipeline(pipeline render.Pipeline)

func (*CommandBuffer) CopyFramebufferToBuffer added in v0.17.0

func (b *CommandBuffer) CopyFramebufferToBuffer(info render.CopyFramebufferToBufferInfo)

func (*CommandBuffer) CopyFramebufferToTexture added in v0.17.0

func (b *CommandBuffer) CopyFramebufferToTexture(info render.CopyFramebufferToTextureInfo)

func (*CommandBuffer) Draw added in v0.17.0

func (b *CommandBuffer) Draw(vertexOffset, vertexCount, instanceCount uint32)

func (*CommandBuffer) DrawIndexed added in v0.17.0

func (b *CommandBuffer) DrawIndexed(indexByteOffset, indexCount, instanceCount uint32)

func (*CommandBuffer) EndRenderPass added in v0.17.0

func (b *CommandBuffer) EndRenderPass()

func (*CommandBuffer) HasMoreCommands added in v0.17.0

func (b *CommandBuffer) HasMoreCommands() bool

func (*CommandBuffer) Reset added in v0.17.0

func (b *CommandBuffer) Reset()

func (*CommandBuffer) SamplerUnit added in v0.19.0

func (b *CommandBuffer) SamplerUnit(index uint, sampler render.Sampler)

func (*CommandBuffer) SetViewport added in v0.20.0

func (b *CommandBuffer) SetViewport(x, y, width, height uint32)

func (*CommandBuffer) TextureUnit added in v0.17.0

func (b *CommandBuffer) TextureUnit(index uint, texture render.Texture)

func (*CommandBuffer) UniformBufferUnit added in v0.17.0

func (b *CommandBuffer) UniformBufferUnit(index uint, buffer render.Buffer, offset, size uint32)

type CommandColorAttachment added in v0.17.0

type CommandColorAttachment struct {
	LoadOp     CommandLoadOperation
	StoreOp    CommandStoreOperation
	ClearValue [4]float32
}

type CommandColorWrite

type CommandColorWrite struct {
	Mask [4]bool
}

type CommandCopyFramebufferToBuffer added in v0.17.0

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

type CommandCopyFramebufferToTexture added in v0.17.0

type CommandCopyFramebufferToTexture struct {
	TextureID       uint32
	TextureLevel    int32
	TextureX        int32
	TextureY        int32
	FramebufferX    int32
	FramebufferY    int32
	Width           int32
	Height          int32
	GenerateMipmaps bool
}

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 {
	IndexByteOffset int32
	IndexCount      int32
	InstanceCount   int32
}

type CommandEndRenderPass added in v0.17.0

type CommandEndRenderPass struct {
}

type CommandFrontFace

type CommandFrontFace struct {
	Orientation uint32
}

type CommandHeader

type CommandHeader struct {
	Kind CommandKind
}

type CommandKind

type CommandKind uint8
const (
	CommandKindCopyFramebufferToBuffer CommandKind = iota
	CommandKindCopyFramebufferToTexture
	CommandKindBeginRenderPass
	CommandKindEndRenderPass
	CommandKindSetViewport
	CommandKindBindPipeline
	CommandKindUniformBufferUnit
	CommandKindTextureUnit
	CommandKindSamplerUnit
	CommandKindDraw
	CommandKindDrawIndexed
)

type CommandLoadOperation added in v0.17.0

type CommandLoadOperation uint8

func CommandLoadOperationFromRender added in v0.17.0

func CommandLoadOperationFromRender(value render.LoadOperation) CommandLoadOperation

type CommandSamplerUnit added in v0.19.0

type CommandSamplerUnit struct {
	Index     uint32
	SamplerID uint32
}

type CommandSetViewport added in v0.20.0

type CommandSetViewport struct {
	X      int32
	Y      int32
	Width  int32
	Height int32
}

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 CommandStoreOperation added in v0.17.0

type CommandStoreOperation uint8

func CommandStoreOperationFromRender added in v0.17.0

func CommandStoreOperationFromRender(value render.StoreOperation) CommandStoreOperation

type CommandTextureUnit

type CommandTextureUnit struct {
	Index     uint32
	TextureID uint32
}

type CommandTopology

type CommandTopology struct {
	Topology uint32
}

type CommandUniformBufferUnit

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

type Fence

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

func NewFence

func NewFence() *Fence

func (*Fence) Release added in v0.17.0

func (f *Fence) Release()

func (*Fence) Status

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

type Framebuffer

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

func NewFramebuffer

func NewFramebuffer(info render.FramebufferInfo) *Framebuffer

func (*Framebuffer) Label added in v0.20.2

func (f *Framebuffer) Label() string

func (*Framebuffer) Release

func (f *Framebuffer) Release()

type Limits added in v0.16.0

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

func NewLimits added in v0.16.0

func NewLimits() *Limits

func (Limits) Quality added in v0.17.0

func (l Limits) Quality() render.Quality

func (Limits) UniformBufferOffsetAlignment added in v0.16.0

func (l Limits) UniformBufferOffsetAlignment() int

type Mapper

type Mapper[T any] struct {
	// contains filtered or unexported fields
}

func (*Mapper[T]) Get

func (m *Mapper[T]) Get(id uint32) T

func (*Mapper[T]) Release

func (m *Mapper[T]) Release(id uint32)

func (*Mapper[T]) Track

func (m *Mapper[T]) Track(id uint32, v T)

type Pipeline

type Pipeline struct {
	render.PipelineMarker

	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
	// contains filtered or unexported fields
}

func NewPipeline

func NewPipeline(info render.PipelineInfo) *Pipeline

func (*Pipeline) Label added in v0.20.2

func (p *Pipeline) Label() string

func (*Pipeline) Release

func (p *Pipeline) Release()

type Program

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

func NewProgram

func NewProgram(info ProgramInfo) *Program

func (*Program) Label added in v0.20.2

func (p *Program) Label() string

func (*Program) Release

func (p *Program) Release()

type ProgramInfo added in v0.16.0

type ProgramInfo struct {
	Label           string
	VertexCode      string
	FragmentCode    string
	TextureBindings []render.TextureBinding
	UniformBindings []render.UniformBinding
}

type Queue added in v0.17.0

type Queue struct {
	render.QueueMarker
	// contains filtered or unexported fields
}

func NewQueue added in v0.17.0

func NewQueue() *Queue

func (*Queue) Invalidate added in v0.17.0

func (q *Queue) Invalidate()

func (*Queue) ReadBuffer added in v0.17.0

func (q *Queue) ReadBuffer(buffer render.Buffer, offset uint32, target []byte)

func (*Queue) Submit added in v0.17.0

func (q *Queue) Submit(commands render.CommandBuffer)

func (*Queue) TrackSubmittedWorkDone added in v0.17.0

func (q *Queue) TrackSubmittedWorkDone() render.Fence

func (*Queue) WriteBuffer added in v0.17.0

func (q *Queue) WriteBuffer(buffer render.Buffer, offset uint32, data []byte)

type Sampler added in v0.19.0

type Sampler struct {
	render.SamplerMarker
	// contains filtered or unexported fields
}

func NewSampler added in v0.19.0

func NewSampler(info render.SamplerInfo) *Sampler

func (*Sampler) Label added in v0.20.2

func (s *Sampler) Label() string

func (*Sampler) Release added in v0.19.0

func (s *Sampler) Release()

type Shader

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

func (*Shader) Release

func (s *Shader) Release()

type Texture

type Texture struct {
	render.TextureMarker
	// 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 NewDepthTexture2DArray added in v0.20.0

func NewDepthTexture2DArray(info render.DepthTexture2DArrayInfo) *Texture

func NewStencilTexture2D

func NewStencilTexture2D(info render.StencilTexture2DInfo) *Texture

func (*Texture) Depth added in v0.20.0

func (t *Texture) Depth() uint32

func (*Texture) Height added in v0.20.0

func (t *Texture) Height() uint32

func (*Texture) Label added in v0.20.2

func (t *Texture) Label() string

func (*Texture) Release

func (t *Texture) Release()

func (*Texture) Width added in v0.20.0

func (t *Texture) Width() uint32

type VertexArray

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

func NewVertexArray

func NewVertexArray(info render.VertexArrayInfo) *VertexArray

func (*VertexArray) Label added in v0.20.2

func (a *VertexArray) Label() string

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