Documentation
¶
Overview ¶
Package render exposes an abstraction API over the GPU so that various implementations (e.g. OpenGL 4.6, WebGL) can be substituted.
Index ¶
- Variables
- type API
- type Area
- type BlendFactor
- type BlendOperation
- type Buffer
- type BufferFetchInfo
- type BufferInfo
- type BufferObject
- type BufferUpdateInfo
- type Capabilities
- type ColorAttachmentInfo
- type ColorTexture2DInfo
- type ColorTextureCubeInfo
- type CommandQueue
- type Comparison
- type CopyContentToBufferInfo
- type CopyContentToTextureInfo
- type CullMode
- type DataFormat
- type DepthStencilTexture2DInfo
- type DepthTexture2DInfo
- type FaceOrientation
- type Fence
- type FenceObject
- type FenceStatus
- type FilterMode
- type Framebuffer
- type FramebufferInfo
- type FramebufferObject
- type IndexFormat
- type LoadOperation
- type Pipeline
- type PipelineInfo
- type PipelineObject
- type Program
- type ProgramInfo
- type ProgramObject
- type Quality
- type RenderPassInfo
- type Shader
- type ShaderInfo
- type ShaderObject
- type StencilOperation
- type StencilOperationState
- type StencilTexture2DInfo
- type StoreOperation
- type Texture
- type TextureObject
- type Topology
- type UniformLocation
- type VertexArray
- type VertexArrayAttributeInfo
- type VertexArrayBindingInfo
- type VertexArrayInfo
- type VertexArrayObject
- type VertexAttributeFormat
- type WrapMode
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type API ¶ added in v0.4.0
type API interface {
Capabilities() Capabilities
DefaultFramebuffer() Framebuffer
CreateFramebuffer(info FramebufferInfo) Framebuffer
CreateColorTexture2D(info ColorTexture2DInfo) Texture
CreateColorTextureCube(info ColorTextureCubeInfo) Texture
CreateDepthTexture2D(info DepthTexture2DInfo) Texture
CreateStencilTexture2D(info StencilTexture2DInfo) Texture
CreateDepthStencilTexture2D(info DepthStencilTexture2DInfo) Texture
CreateVertexShader(info ShaderInfo) Shader
CreateFragmentShader(info ShaderInfo) Shader
CreateProgram(info ProgramInfo) Program
CreateVertexBuffer(info BufferInfo) Buffer
CreateIndexBuffer(info BufferInfo) Buffer
CreatePixelTransferBuffer(info BufferInfo) Buffer
CreateVertexArray(info VertexArrayInfo) VertexArray
CreatePipeline(info PipelineInfo) Pipeline
CreateCommandQueue() CommandQueue
BeginRenderPass(info RenderPassInfo)
EndRenderPass()
// Invalidate indicates that the graphics state might have changed
// from outside this API and any cached state by the API should
// be discarded.
//
// Using this command will force a subsequent draw command to initialize
// all graphics state (e.g. blend state, depth state, stencil state, etc.)
Invalidate()
BindPipeline(pipeline Pipeline)
Uniform1f(location UniformLocation, value float32)
Uniform1i(location UniformLocation, value int)
Uniform3f(location UniformLocation, values [3]float32)
Uniform4f(location UniformLocation, values [4]float32)
UniformMatrix4f(location UniformLocation, values [16]float32)
TextureUnit(index int, texture Texture)
Draw(vertexOffset, vertexCount, instanceCount int)
DrawIndexed(indexOffset, indexCount, instanceCount int)
CopyContentToTexture(info CopyContentToTextureInfo)
SubmitQueue(queue CommandQueue)
CreateFence() Fence
}
type BlendFactor ¶ added in v0.4.0
type BlendFactor uint8
const ( BlendFactorZero BlendFactor = iota BlendFactorOne BlendFactorSourceColor BlendFactorOneMinusSourceColor BlendFactorDestinationColor BlendFactorOneMinusDestinationColor BlendFactorSourceAlpha BlendFactorOneMinusSourceAlpha BlendFactorDestinationAlpha BlendFactorOneMinusDestinationAlpha BlendFactorConstantColor BlendFactorOneMinusConstantColor BlendFactorConstantAlpha BlendFactorOneMinusConstantAlpha BlendFactorSourceAlphaSaturate )
type BlendOperation ¶ added in v0.4.0
type BlendOperation uint8
const ( BlendOperationAdd BlendOperation = iota BlendOperationSubtract BlendOperationReverseSubtract BlendOperationMin BlendOperationMax )
type Buffer ¶ added in v0.4.0
type Buffer interface {
BufferObject
Update(info BufferUpdateInfo)
Fetch(info BufferFetchInfo)
Release()
}
type BufferFetchInfo ¶ added in v0.4.0
type BufferInfo ¶ added in v0.4.0
type BufferObject ¶ added in v0.4.0
type BufferObject interface {
// contains filtered or unexported methods
}
type BufferUpdateInfo ¶ added in v0.4.0
type Capabilities ¶ added in v0.4.0
type Capabilities struct {
Quality Quality
}
type ColorAttachmentInfo ¶ added in v0.4.0
type ColorAttachmentInfo struct {
LoadOp LoadOperation
StoreOp StoreOperation
ClearValue [4]float32
}
type ColorTexture2DInfo ¶ added in v0.4.0
type ColorTexture2DInfo struct {
Width int
Height int
Wrapping WrapMode
Filtering FilterMode
Mipmapping bool
GammaCorrection bool
Format DataFormat
Data []byte
}
type ColorTextureCubeInfo ¶ added in v0.4.0
type CommandQueue ¶ added in v0.4.0
type CommandQueue interface {
BindPipeline(pipeline Pipeline)
Uniform1f(location UniformLocation, value float32)
Uniform1i(location UniformLocation, value int)
Uniform3f(location UniformLocation, values [3]float32)
Uniform4f(location UniformLocation, values [4]float32)
UniformMatrix4f(location UniformLocation, values [16]float32)
TextureUnit(index int, texture Texture)
Draw(vertexOffset, vertexCount, instanceCount int)
DrawIndexed(indexOffset, indexCount, instanceCount int)
CopyContentToBuffer(info CopyContentToBufferInfo)
Release()
}
type Comparison ¶ added in v0.4.0
type Comparison uint8
const ( ComparisonNever Comparison = iota ComparisonLess ComparisonEqual ComparisonLessOrEqual ComparisonGreater ComparisonNotEqual ComparisonGreaterOrEqual ComparisonAlways )
type CopyContentToBufferInfo ¶ added in v0.4.0
type CopyContentToTextureInfo ¶ added in v0.4.0
type DataFormat ¶ added in v0.4.0
type DataFormat int
const ( DataFormatRGBA8 DataFormat = iota DataFormatRGBA16F DataFormatRGBA32F )
type DepthStencilTexture2DInfo ¶ added in v0.4.0
type DepthTexture2DInfo ¶ added in v0.4.0
type FaceOrientation ¶ added in v0.4.0
type FaceOrientation uint8
const ( FaceOrientationCCW FaceOrientation = iota FaceOrientationCW )
type Fence ¶ added in v0.4.0
type Fence interface {
FenceObject
Status() FenceStatus
Delete()
}
type FenceObject ¶ added in v0.4.0
type FenceObject interface {
// contains filtered or unexported methods
}
type FenceStatus ¶ added in v0.4.0
type FenceStatus int
const ( FenceStatusNotReady FenceStatus = iota FenceStatusSuccess FenceStatusDeviceLost )
type FilterMode ¶ added in v0.4.0
type FilterMode int
const ( FilterModeNearest FilterMode = iota FilterModeLinear FilterModeAnisotropic )
type Framebuffer ¶ added in v0.4.0
type Framebuffer interface {
FramebufferObject
Release()
}
type FramebufferInfo ¶ added in v0.4.0
type FramebufferObject ¶ added in v0.4.0
type FramebufferObject interface {
// contains filtered or unexported methods
}
type IndexFormat ¶ added in v0.4.0
type IndexFormat uint8
const ( IndexFormatUnsignedShort IndexFormat = iota IndexFormatUnsignedInt )
type LoadOperation ¶ added in v0.4.0
type LoadOperation int
const ( LoadOperationDontCare LoadOperation = iota LoadOperationClear )
type Pipeline ¶ added in v0.4.0
type Pipeline interface {
PipelineObject
Release()
}
type PipelineInfo ¶ added in v0.4.0
type PipelineInfo struct {
Program Program
VertexArray VertexArray
Topology Topology
Culling CullMode
FrontFace FaceOrientation
DepthTest bool
DepthWrite bool
DepthComparison Comparison
StencilTest bool
StencilFront StencilOperationState
StencilBack StencilOperationState
ColorWrite [4]bool
BlendEnabled bool
BlendColor [4]float32
BlendSourceColorFactor BlendFactor
BlendDestinationColorFactor BlendFactor
BlendSourceAlphaFactor BlendFactor
BlendDestinationAlphaFactor BlendFactor
BlendOpColor BlendOperation
BlendOpAlpha BlendOperation
}
type PipelineObject ¶ added in v0.4.0
type PipelineObject interface {
// contains filtered or unexported methods
}
type Program ¶ added in v0.4.0
type Program interface {
ProgramObject
UniformLocation(name string) UniformLocation
Release()
}
type ProgramInfo ¶ added in v0.4.0
type ProgramObject ¶ added in v0.4.0
type ProgramObject interface {
// contains filtered or unexported methods
}
type RenderPassInfo ¶ added in v0.4.0
type RenderPassInfo struct {
Framebuffer Framebuffer
Viewport Area
DepthLoadOp LoadOperation
DepthStoreOp StoreOperation
DepthClearValue float32
StencilLoadOp LoadOperation
StencilStoreOp StoreOperation
StencilClearValue int
Colors [4]ColorAttachmentInfo
}
type Shader ¶ added in v0.4.0
type Shader interface {
ShaderObject
Release()
}
type ShaderInfo ¶ added in v0.4.0
type ShaderInfo struct {
SourceCode string
}
type ShaderObject ¶ added in v0.4.0
type ShaderObject interface {
// contains filtered or unexported methods
}
type StencilOperation ¶ added in v0.4.0
type StencilOperation uint8
const ( StencilOperationKeep StencilOperation = iota StencilOperationZero StencilOperationReplace StencilOperationIncrease StencilOperationIncreaseWrap StencilOperationDecrease StencilOperationDecreaseWrap StencilOperationInvert )
type StencilOperationState ¶ added in v0.4.0
type StencilOperationState struct {
StencilFailOp StencilOperation
DepthFailOp StencilOperation
PassOp StencilOperation
Comparison Comparison
ComparisonMask uint32
Reference int32
WriteMask uint32
}
type StencilTexture2DInfo ¶ added in v0.4.0
type StoreOperation ¶ added in v0.4.0
type StoreOperation int
const ( StoreOperationDontCare StoreOperation = iota StoreOperationStore )
type Texture ¶ added in v0.4.0
type Texture interface {
TextureObject
Release()
}
type TextureObject ¶ added in v0.4.0
type TextureObject interface {
// contains filtered or unexported methods
}
type UniformLocation ¶ added in v0.4.0
type UniformLocation interface{}
type VertexArray ¶ added in v0.4.0
type VertexArray interface {
VertexArrayObject
Release()
}
type VertexArrayAttributeInfo ¶ added in v0.4.0
type VertexArrayAttributeInfo struct {
Binding int
Location int
Format VertexAttributeFormat
Offset int
}
type VertexArrayBindingInfo ¶ added in v0.4.0
type VertexArrayInfo ¶ added in v0.4.0
type VertexArrayInfo struct {
Bindings []VertexArrayBindingInfo
Attributes []VertexArrayAttributeInfo
IndexFormat IndexFormat
IndexBuffer Buffer
}
type VertexArrayObject ¶ added in v0.4.0
type VertexArrayObject interface {
// contains filtered or unexported methods
}
type VertexAttributeFormat ¶ added in v0.4.0
type VertexAttributeFormat uint8
const ( VertexAttributeFormatR32F VertexAttributeFormat = iota VertexAttributeFormatRG32F VertexAttributeFormatRGB32F VertexAttributeFormatRGBA32F VertexAttributeFormatR16F VertexAttributeFormatRG16F VertexAttributeFormatRGB16F VertexAttributeFormatRGBA16F VertexAttributeFormatR16S VertexAttributeFormatRG16S VertexAttributeFormatRGB16S VertexAttributeFormatRGBA16S VertexAttributeFormatR16SN VertexAttributeFormatRG16SN VertexAttributeFormatRGB16SN VertexAttributeFormatRGBA16SN VertexAttributeFormatR16U VertexAttributeFormatRG16U VertexAttributeFormatRGB16U VertexAttributeFormatRGBA16U VertexAttributeFormatR16UN VertexAttributeFormatRG16UN VertexAttributeFormatRGB16UN VertexAttributeFormatRGBA16UN VertexAttributeFormatR8S VertexAttributeFormatRG8S VertexAttributeFormatRGB8S VertexAttributeFormatRGBA8S VertexAttributeFormatR8SN VertexAttributeFormatRG8SN VertexAttributeFormatRGB8SN VertexAttributeFormatRGBA8SN VertexAttributeFormatR8U VertexAttributeFormatRG8U VertexAttributeFormatRGB8U VertexAttributeFormatRGBA8U VertexAttributeFormatR8UN VertexAttributeFormatRG8UN VertexAttributeFormatRGB8UN VertexAttributeFormatRGBA8UN )
Click to show internal directories.
Click to hide internal directories.