package rendering
Constants
FontJustifyLeft
FontJustify(iota)
FontJustifyCenter
FontJustifyRight
FontBaselineBottom
FontBaseline(iota)
FontBaselineCenter
FontBaselineTop
FontCondensedBold
FontFace("fonts/OpenSans_Condensed-Bold")
FontCondensedBoldItalic
FontFace("fonts/OpenSans_Condensed-BoldItalic")
FontCondensedExtraBold
FontFace("fonts/OpenSans_Condensed-ExtraBold")
FontCondensedExtraBoldItalic
FontFace("fonts/OpenSans_Condensed-ExtraBoldItalic")
FontCondensedItalic
FontFace("fonts/OpenSans_Condensed-Italic")
FontCondensedLight
FontFace("fonts/OpenSans_Condensed-Light")
FontCondensedLightItalic
FontFace("fonts/OpenSans_Condensed-LightItalic")
FontCondensedMedium
FontFace("fonts/OpenSans_Condensed-Medium")
FontCondensedMediumItalic
FontFace("fonts/OpenSans_Condensed-MediumItalic")
FontCondensedRegular
FontFace("fonts/OpenSans_Condensed-Regular")
FontCondensedSemiBold
FontFace("fonts/OpenSans_Condensed-SemiBold")
FontCondensedSemiBoldItalic
FontFace("fonts/OpenSans_Condensed-SemiBoldItalic")
FontSemiCondensedBold
FontFace("fonts/OpenSans_SemiCondensed-Bold")
FontSemiCondensedBoldItalic
FontFace("fonts/OpenSans_SemiCondensed-BoldItalic")
FontSemiCondensedExtraBold
FontFace("fonts/OpenSans_SemiCondensed-ExtraBold")
FontSemiCondensedExtraBoldItalic
FontFace("fonts/OpenSans_SemiCondensed-ExtraBoldItalic")
FontSemiCondensedItalic
FontFace("fonts/OpenSans_SemiCondensed-Italic")
FontSemiCondensedLight
FontFace("fonts/OpenSans_SemiCondensed-Light")
FontSemiCondensedLightItalic
FontFace("fonts/OpenSans_SemiCondensed-LightItalic")
FontSemiCondensedMedium
FontFace("fonts/OpenSans_SemiCondensed-Medium")
FontSemiCondensedMediumItalic
FontFace("fonts/OpenSans_SemiCondensed-MediumItalic")
FontSemiCondensedRegular
FontFace("fonts/OpenSans_SemiCondensed-Regular")
FontSemiCondensedSemiBold
FontFace("fonts/OpenSans_SemiCondensed-SemiBold")
FontSemiCondensedSemiBoldItalic
FontFace("fonts/OpenSans_SemiCondensed-SemiBoldItalic")
FontBold
FontFace("fonts/OpenSans-Bold")
FontBoldItalic
FontFace("fonts/OpenSans-BoldItalic")
FontExtraBold
FontFace("fonts/OpenSans-ExtraBold")
FontExtraBoldItalic
FontFace("fonts/OpenSans-ExtraBoldItalic")
FontItalic
FontFace("fonts/OpenSans-Italic")
FontLight
FontFace("fonts/OpenSans-Light")
FontLightItalic
FontFace("fonts/OpenSans-LightItalic")
FontMedium
FontFace("fonts/OpenSans-Medium")
FontMediumItalic
FontFace("fonts/OpenSans-MediumItalic")
FontRegular
FontFace("fonts/OpenSans-Regular")
FontSemiBold
FontFace("fonts/OpenSans-SemiBold")
FontSemiBoldItalic
FontFace("fonts/OpenSans-SemiBoldItalic")
DefaultFontEMSize
MaxJoints
50
MaxSkinInstances
50
QuadPivotCenter
QuadPivot(iota)
QuadPivotLeft
QuadPivotTop
QuadPivotRight
QuadPivotBottom
QuadPivotBottomLeft
QuadPivotBottomRight
QuadPivotTopLeft
QuadPivotTopRight
QuaternionSize
[int(unsafe](../int(unsafe).[Sizeof(matrix](../int(unsafe#Sizeof(matrix)
CubeMapSides
6
BytesInPixel
4
MaxCommandPools
5
MaxSecondaryCommands
25
Variables
StringVkFormat
map[string]vk.Format{
StringVkBlendFactor
map[string]vk.BlendFactor{
StringVkBlendOp
map[string]vk.BlendOp{
StringVkLogicOp
map[string]vk.LogicOp{
StringVkCompareOp
map[string]vk.CompareOp{
StringVkStencilOp
map[string]vk.StencilOp{
StringVkPrimitiveTopology
map[string]vk.PrimitiveTopology{
StringVkPolygonMode
map[string]vk.PolygonMode{
StringVkCullModeFlagBits
map[string]vk.CullModeFlagBits{
StringVkFrontFace
map[string]vk.FrontFace{
StringVkSampleCountFlagBits
map[string]vk.SampleCountFlagBits{
StringVkPatchControlPoints
map[string]uint32{
StringVkAttachmentLoadOp
map[string]vk.AttachmentLoadOp{
StringVkAttachmentStoreOp
map[string]vk.AttachmentStoreOp{
StringVkImageLayout
map[string]vk.ImageLayout{
StringVkPipelineStageFlagBits
map[string]vk.PipelineStageFlagBits{
StringVkAccessFlagBits
map[string]vk.AccessFlagBits{
StringVkPipelineBindPoint
map[string]vk.PipelineBindPoint{
StringVkDependencyFlagBits
map[string]vk.DependencyFlagBits{
StringVkColorComponentFlagBits
map[string]vk.ColorComponentFlagBits{
StringVkPipelineCreateFlagBits
map[string]vk.PipelineCreateFlagBits{
StringVkImageTiling
map[string]vk.ImageTiling{
StringVkFilter
map[string]vk.Filter{
StringVkImageUsageFlagBits
map[string]vk.ImageUsageFlagBits{
StringVkMemoryPropertyFlagBits
map[string]vk.MemoryPropertyFlagBits{
StringVkImageAspectFlagBits
map[string]vk.ImageAspectFlagBits{
StringVkMap
map[string]any{
Functions
TextureKeys
VertexFaceNormal
Types
CommandRecorder
struct
NewCommandRecorder
CommandRecorder.Begin
CommandRecorder.Destroy
CommandRecorder.End
CommandRecorder.Reset
CommandRecorderSecondary
struct
NewCommandRecorderSecondary
func NewCommandRecorderSecondary(vr *Vulkan, rp *RenderPass, subpassIdx int) (CommandRecorderSecondary, error)
CommandRecorderSecondary.Begin
DescriptorSetLayoutStructure
struct
DescriptorSetLayoutStructureType
struct
type DescriptorSetLayoutStructureType struct {
Type vk.DescriptorType
Flags vk.ShaderStageFlagBits
Count, Binding uint32
}
DrawInstance
interface
type DrawInstance interface {
Destroy()
IsDestroyed() bool
Activate()
Deactivate()
IsActive() bool
Size() int
SetModel(model matrix.Mat4)
UpdateModel()
DataPointer() unsafe.Pointer
// Returns true if it should write the data, otherwise false
UpdateNamedData(index, capacity int, name string) bool
NamedDataPointer(name string) unsafe.Pointer
NamedDataInstanceSize(name string) int
// Has unexported methods.
}
ReflectDuplicateDrawInstance
DrawInstanceGroup
struct
type DrawInstanceGroup struct {
Mesh *Mesh
InstanceDriverData
MaterialInstance *Material
Instances []DrawInstance
// Has unexported fields.
}
NewDrawInstanceGroup
DrawInstanceGroup.AddInstance
DrawInstanceGroup.AlterPadding
DrawInstanceGroup.AnyVisible
DrawInstanceGroup.Clear
DrawInstanceGroup.Destroy
DrawInstanceGroup.IsEmpty
DrawInstanceGroup.IsReady
DrawInstanceGroup.TotalSize
DrawInstanceGroup.UpdateData
DrawInstanceGroup.VisibleCount
DrawInstanceGroup.VisibleSize
Drawing
struct
type Drawing struct {
Renderer Renderer
Material *Material
Mesh *Mesh
ShaderData DrawInstance
Transform *matrix.Transform
}
Drawing.IsValid
Drawings
struct
NewDrawings
Drawings.AddDrawing
Drawings.AddDrawings
Drawings.Destroy
Drawings.HasDrawings
Drawings.PreparePending
Drawings.Render
FontBaseline
FontCache
struct
NewFontCache
FontCache.Destroy
FontCache.EMSize
FontCache.Init
func (cache *FontCache) Init(renderer Renderer, assetDb *assets.Database, caches RenderCaches) error
FontCache.LineCountWithin
FontCache.MeasureCharacter
FontCache.MeasureString
FontCache.MeasureStringWithin
func (cache *FontCache) MeasureStringWithin(face FontFace, text string, scale, maxWidth float32, lineHeight float32) matrix.Vec2
FontCache.PointOffsetWithin
func (cache *FontCache) PointOffsetWithin(face FontFace, text string, point matrix.Vec2, scale, maxWidth float32) int
FontCache.RenderMeshes
text string, x, y, z, scale, maxWidth float32, fgColor, bgColor matrix.Color, justify FontJustify, baseline FontBaseline, rootScale matrix.Vec3, instanced, is3D bool, face FontFace, lineHeight float32) []Drawing
FontCache.StringRectsWithinNew
func (cache *FontCache) StringRectsWithinNew(face FontFace, text string, scale, maxWidth float32) []matrix.Vec4
FontCache.TransparentMaterial
FontFace
FontFace.IsBold
FontFace.IsExtraBold
FontFace.IsItalic
FontJustify
FuncPipeline
type FuncPipeline func(renderer Renderer, shader *Shader, shaderStages []vk.PipelineShaderStageCreateInfo) bool
GlobalShaderData
struct
type GlobalShaderData struct {
View matrix.Mat4
Projection matrix.Mat4
UIView matrix.Mat4
UIProjection matrix.Mat4
CameraPosition matrix.Vec4
UICameraPosition matrix.Vec3
ScreenSize matrix.Vec2
Time float32
// Has unexported fields.
}
InstanceCopyData
struct
InstanceCopyDataNew
InstanceDriverData
struct
InstanceGroupSkinningData
struct
Material
struct
type Material struct {
Name string
Shader *Shader
Textures []*Texture
Instances map[string]*Material
Root weak.Pointer[Material]
// Has unexported fields.
}
Material.CreateInstance
Material.Destroy
Material.SelectRoot
MaterialCache
struct
NewMaterialCache
MaterialCache.AddMaterial
MaterialCache.Destroy
MaterialCache.FindMaterial
MaterialCache.Material
MaterialData
struct
type MaterialData struct {
Name string
Shader string `options:""` // Blank = fallback
RenderPass string `options:""` // Blank = fallback
ShaderPipeline string `options:""` // Blank = fallback
Textures []MaterialTextureData
}
MaterialData.Compile
MaterialTextureData
struct
type MaterialTextureData struct {
Texture string `options:""` // Blank = fallback
Filter string `options:"StringVkFilter"`
}
MaterialTextureData.FilterToVK
Mesh
struct
NewMesh
NewMeshCube
NewMeshCubeInverse
NewMeshFrustum
NewMeshGrid
NewMeshLine
NewMeshOffsetQuad
NewMeshPlane
NewMeshPoint
NewMeshQuad
NewMeshQuadAnchored
NewMeshScreenQuad
NewMeshSkyboxCube
NewMeshTexturableCube
NewMeshTriangle
NewMeshUnitQuad
NewMeshWireCube
NewMeshWireQuad
Mesh.BVH
Mesh.DelayedCreate
Mesh.Destroy
Mesh.IsReady
Mesh.Key
Mesh.SetKey
MeshCache
struct
NewMeshCache
MeshCache.AddMesh
Try to add the mesh to the cache, if it already exists, return the existing mesh
MeshCache.CreatePending
MeshCache.Destroy
MeshCache.FindMesh
MeshCache.Mesh
MeshCullMode
const ( MeshCullModeBack MeshCullMode = iota MeshCullModeFront MeshCullModeNone )
MeshDrawMode
const ( MeshDrawModePoints MeshDrawMode = iota MeshDrawModeLines MeshDrawModeTriangles MeshDrawModePatches )
MeshId
struct
MeshId.IsValid
QuadPivot
RenderCaches
interface
type RenderCaches interface {
ShaderCache() *ShaderCache
TextureCache() *TextureCache
MeshCache() *MeshCache
FontCache() *FontCache
MaterialCache() *MaterialCache
AssetDatabase() *assets.Database
}
RenderPass
struct
NewRenderPass
RenderPass.CreateFrameBuffer
imageViews []vk.ImageView, width, height int) error
RenderPass.Destroy
RenderPass.ExecuteSecondaryCommands
RenderPass.Recontstruct
RenderPass.SelectOutputAttachment
RenderPassAttachmentDescription
struct
type RenderPassAttachmentDescription struct {
Format string `options:"StringVkFormat"`
Samples string `options:"StringVkSampleCountFlagBits"`
LoadOp string `options:"StringVkAttachmentLoadOp"`
StoreOp string `options:"StringVkAttachmentStoreOp"`
StencilLoadOp string `options:"StringVkAttachmentLoadOp"`
StencilStoreOp string `options:"StringVkAttachmentStoreOp"`
InitialLayout string `options:"StringVkImageLayout"`
FinalLayout string `options:"StringVkImageLayout"`
Image RenderPassAttachmentImage
}
RenderPassAttachmentDescription.FinalLayoutToVK
RenderPassAttachmentDescription.FormatToVK
RenderPassAttachmentDescription.InitialLayoutToVK
RenderPassAttachmentDescription.LoadOpToVK
RenderPassAttachmentDescription.SamplesToVK
RenderPassAttachmentDescription.StencilLoadOpToVK
RenderPassAttachmentDescription.StencilStoreOpToVK
RenderPassAttachmentDescription.StoreOpToVK
RenderPassAttachmentDescriptionCompiled
struct
type RenderPassAttachmentDescriptionCompiled struct {
Format vk.Format
Samples vk.SampleCountFlagBits
LoadOp vk.AttachmentLoadOp
StoreOp vk.AttachmentStoreOp
StencilLoadOp vk.AttachmentLoadOp
StencilStoreOp vk.AttachmentStoreOp
InitialLayout vk.ImageLayout
FinalLayout vk.ImageLayout
Image RenderPassAttachmentImageCompiled
}
RenderPassAttachmentDescriptionCompiled.IsDepthFormat
RenderPassAttachmentImage
struct
type RenderPassAttachmentImage struct {
Name string
ExistingImage string
MipLevels uint32
LayerCount uint32
Tiling string `options:"StringVkImageTiling"`
Filter string `options:"StringVkFilter"`
Usage []string `options:"StringVkImageUsageFlagBits"`
MemoryProperty []string `options:"StringVkMemoryPropertyFlagBits"`
Aspect []string `options:"StringVkImageAspectFlagBits"`
Access []string `options:"StringVkAccessFlagBits"`
Clear RenderPassAttachmentImageClear `tip:"AttachmentImageClear"`
}
RenderPassAttachmentImage.AccessToVK
RenderPassAttachmentImage.AspectToVK
RenderPassAttachmentImage.FilterToVK
RenderPassAttachmentImage.IsInvalid
RenderPassAttachmentImage.MemoryPropertyToVK
RenderPassAttachmentImage.TilingToVK
RenderPassAttachmentImage.UsageToVK
RenderPassAttachmentImageClear
struct
type RenderPassAttachmentImageClear struct {
R float32
G float32
B float32
A float32
Depth float32
Stencil uint32
}
RenderPassAttachmentImageCompiled
struct
type RenderPassAttachmentImageCompiled struct {
Name string
ExistingImage string
MipLevels uint32
LayerCount uint32
Tiling vk.ImageTiling
Filter vk.Filter
Usage vk.ImageUsageFlags
MemoryProperty vk.MemoryPropertyFlags
Aspect vk.ImageAspectFlags
Access vk.AccessFlags
}
RenderPassAttachmentImageCompiled.IsInvalid
RenderPassAttachmentReference
struct
type RenderPassAttachmentReference struct {
Attachment uint32
Layout string `options:"StringVkImageLayout"`
}
RenderPassAttachmentReference.LayoutToVK
RenderPassAttachmentReferenceCompiled
struct
RenderPassData
struct
type RenderPassData struct {
Name string
Sort int
AttachmentDescriptions []RenderPassAttachmentDescription
SubpassDescriptions []RenderPassSubpassDescription
SubpassDependencies []RenderPassSubpassDependency
}
NewRenderPassData
RenderPassData.Compile
RenderPassDataCompiled
struct
type RenderPassDataCompiled struct {
Name string
Sort int
AttachmentDescriptions []RenderPassAttachmentDescriptionCompiled
SubpassDescriptions []RenderPassSubpassDescriptionCompiled
SubpassDependencies []RenderPassSubpassDependencyCompiled
ImageClears []vk.ClearValue
Subpass []RenderPassSubpassDataCompiled
}
RenderPassDataCompiled.ConstructRenderPass
RenderPassGroup
struct
RenderPassSubpass
struct
RenderPassSubpassData
struct
type RenderPassSubpassData struct {
Shader string `options:""`
ShaderPipeline string `options:""`
SampledImages []RenderPassSubpassImageData
}
RenderPassSubpassDataCompiled
struct
type RenderPassSubpassDataCompiled struct {
Shader string
ShaderPipeline string
SampledImages []int
}
RenderPassSubpassDependency
struct
type RenderPassSubpassDependency struct {
SrcSubpass int64
DstSubpass int64
SrcStageMask []string `options:"StringVkPipelineStageFlagBits"`
DstStageMask []string `options:"StringVkPipelineStageFlagBits"`
SrcAccessMask []string `options:"StringVkAccessFlagBits"`
DstAccessMask []string `options:"StringVkAccessFlagBits"`
DependencyFlags []string `options:"StringVkDependencyFlagBits"`
}
RenderPassSubpassDependency.DependencyFlagsToVK
RenderPassSubpassDependency.DstAccessMaskToVK
RenderPassSubpassDependency.DstStageMaskToVK
RenderPassSubpassDependency.SrcAccessMaskToVK
RenderPassSubpassDependency.SrcStageMaskToVK
RenderPassSubpassDependencyCompiled
struct
type RenderPassSubpassDependencyCompiled struct {
SrcSubpass uint32
DstSubpass uint32
SrcStageMask vk.PipelineStageFlags
DstStageMask vk.PipelineStageFlags
SrcAccessMask vk.AccessFlags
DstAccessMask vk.AccessFlags
DependencyFlags vk.DependencyFlags
}
RenderPassSubpassDescription
struct
type RenderPassSubpassDescription struct {
PipelineBindPoint string `options:"StringVkPipelineBindPoint"`
ColorAttachmentReferences []RenderPassAttachmentReference
InputAttachmentReferences []RenderPassAttachmentReference
ResolveAttachments []RenderPassAttachmentReference
DepthStencilAttachment []RenderPassAttachmentReference // 1 max
PreserveAttachments []uint32 // TODO
Subpass RenderPassSubpassData
}
RenderPassSubpassDescription.PipelineBindPointToVK
RenderPassSubpassDescriptionCompiled
struct
type RenderPassSubpassDescriptionCompiled struct {
PipelineBindPoint vk.PipelineBindPoint
ColorAttachmentReferences []RenderPassAttachmentReferenceCompiled
InputAttachmentReferences []RenderPassAttachmentReferenceCompiled
ResolveAttachments []RenderPassAttachmentReferenceCompiled
DepthStencilAttachment []RenderPassAttachmentReferenceCompiled // 1 max
PreserveAttachments []uint32 // TODO
}
RenderPassSubpassImageData
struct
Renderer
interface
type Renderer interface {
Initialize(caches RenderCaches, width, height int32) error
ReadyFrame(camera cameras.Camera, uiCamera cameras.Camera, runtime float32) bool
CreateShader(shader *Shader, assetDatabase *assets.Database) error
CreateMesh(mesh *Mesh, verts []Vertex, indices []uint32)
CreateTexture(texture *Texture, textureData *TextureData)
TextureReadPixel(texture *Texture, x, y int) matrix.Color
TextureWritePixels(texture *Texture, x, y, width, height int, pixels []byte)
Draw(renderPass *RenderPass, drawings []ShaderDraw) bool
BlitTargets(passes []*RenderPass)
SwapFrame(width, height int32) bool
Resize(width, height int)
AddPreRun(preRun func())
DestroyGroup(group *DrawInstanceGroup)
DestroyTexture(texture *Texture)
DestroyShader(shader *Shader)
DestroyMesh(mesh *Mesh)
Destroy()
WaitForRender()
}
RenderingContainer
interface
type RenderingContainer interface {
GetDrawableSize() (int32, int32)
GetInstanceExtensions() []string
PlatformWindow() unsafe.Pointer
PlatformInstance() unsafe.Pointer
}
Shader
struct
type Shader struct {
RenderId ShaderId
Material MaterialData
DriverData ShaderDriverData
// Has unexported fields.
}
NewShader
Shader.AddSubShader
Shader.DelayedCreate
Shader.Destroy
Shader.RemoveSubShader
Shader.SubShader
ShaderBuffer
struct
ShaderCache
struct
NewShaderCache
ShaderCache.CreatePending
ShaderCache.Destroy
ShaderCache.Shader
ShaderData
struct
type ShaderData struct {
Name string
EnableDebug bool
Vertex string `options:""`
VertexFlags string `tip:"CompileFlags"`
Fragment string `options:""`
FragmentFlags string `tip:"CompileFlags"`
Geometry string `options:""`
GeometryFlags string `tip:"CompileFlags"`
TessellationControl string `options:""`
TessellationControlFlags string `tip:"CompileFlags"`
TessellationEvaluation string `options:""`
TessellationEvaluationFlags string `tip:"CompileFlags"`
LayoutGroups []ShaderLayoutGroup `visible:"false"`
}
ShaderData.Compile
ShaderData.CompileVariantName
ShaderDataBase
struct
NewShaderDataBase
ShaderDataBase.Activate
ShaderDataBase.CancelDestroy
ShaderDataBase.DataPointer
ShaderDataBase.Deactivate
ShaderDataBase.Destroy
ShaderDataBase.IsActive
ShaderDataBase.IsDestroyed
ShaderDataBase.Model
ShaderDataBase.NamedDataInstanceSize
ShaderDataBase.NamedDataPointer
ShaderDataBase.SetModel
ShaderDataBase.Setup
ShaderDataBase.Size
ShaderDataBase.UpdateModel
ShaderDataBase.UpdateNamedData
ShaderDataBasic
struct
ShaderDataBasic.Size
ShaderDataCompiled
struct
type ShaderDataCompiled struct {
Name string
Vertex string
Fragment string
Geometry string
TessellationControl string
TessellationEvaluation string
LayoutGroups []ShaderLayoutGroup
}
ShaderDataCompiled.SelectLayout
ShaderDataCompiled.Stride
ShaderDataCompiled.ToAttributeDescription
func (sd *ShaderDataCompiled) ToAttributeDescription(locationStart uint32) []vk.VertexInputAttributeDescription
ShaderDataCompiled.ToDescriptorSetLayoutStructure
ShaderDraw
struct
NewShaderDraw
ShaderDraw.AddInstanceGroup
ShaderDraw.Destroy
ShaderDraw.Filter
ShaderDraw.SolidGroups
ShaderDraw.TransparentGroups
ShaderDriverData
struct
type ShaderDriverData struct {
DescriptorSetLayoutStructure
Stride uint32
AttributeDescriptions []vk.VertexInputAttributeDescription
}
NewShaderDriverData
ShaderId
struct
ShaderId.IsValid
ShaderLayout
struct
type ShaderLayout struct {
Location int // -1 if not set
Binding int // -1 if not set
Set int // -1 if not set
InputAttachment int // -1 if not set
Type string // float, vec3, mat4, etc.
Name string
Source string // in, out, uniform
Fields []ShaderLayoutStructField
}
ShaderLayout.Capacity
ShaderLayout.DescriptorType
ShaderLayout.FullName
ShaderLayout.IsBuffer
ShaderLayout.Stride
ShaderLayoutGroup
struct
ShaderLayoutGroup.DescriptorFlag
ShaderLayoutStructField
struct
ShaderPipelineColorBlend
struct
type ShaderPipelineColorBlend struct {
LogicOpEnable bool
LogicOp string `options:"StringVkLogicOp"`
BlendConstants0 float32 `tip:"BlendConstants"`
BlendConstants1 float32 `tip:"BlendConstants"`
BlendConstants2 float32 `tip:"BlendConstants"`
BlendConstants3 float32 `tip:"BlendConstants"`
}
ShaderPipelineColorBlend.LogicOpToVK
ShaderPipelineColorBlendAttachments
struct
type ShaderPipelineColorBlendAttachments struct {
BlendEnable bool
SrcColorBlendFactor string `options:"StringVkBlendFactor"`
DstColorBlendFactor string `options:"StringVkBlendFactor"`
ColorBlendOp string `options:"StringVkBlendOp"`
SrcAlphaBlendFactor string `options:"StringVkBlendFactor"`
DstAlphaBlendFactor string `options:"StringVkBlendFactor"`
AlphaBlendOp string `options:"StringVkBlendOp"`
ColorWriteMask []string `options:"StringVkColorComponentFlagBits"`
}
ShaderPipelineColorBlendAttachments.AlphaBlendOpToVK
ShaderPipelineColorBlendAttachments.BlendEnableToVK
ShaderPipelineColorBlendAttachments.ColorBlendOpToVK
ShaderPipelineColorBlendAttachments.ColorWriteMaskToVK
ShaderPipelineColorBlendAttachments.DstAlphaBlendFactorToVK
ShaderPipelineColorBlendAttachments.DstColorBlendFactorToVK
ShaderPipelineColorBlendAttachments.ListAlphaBlendOp
ShaderPipelineColorBlendAttachments.ListColorBlendOp
ShaderPipelineColorBlendAttachments.ListDstAlphaBlendFactor
ShaderPipelineColorBlendAttachments.ListDstColorBlendFactor
ShaderPipelineColorBlendAttachments.ListSrcAlphaBlendFactor
ShaderPipelineColorBlendAttachments.ListSrcColorBlendFactor
ShaderPipelineColorBlendAttachments.SrcAlphaBlendFactorToVK
ShaderPipelineColorBlendAttachments.SrcColorBlendFactorToVK
ShaderPipelineColorBlendAttachmentsCompiled
struct
type ShaderPipelineColorBlendAttachmentsCompiled struct {
BlendEnable vk.Bool32
SrcColorBlendFactor vk.BlendFactor
DstColorBlendFactor vk.BlendFactor
ColorBlendOp vk.BlendOp
SrcAlphaBlendFactor vk.BlendFactor
DstAlphaBlendFactor vk.BlendFactor
AlphaBlendOp vk.BlendOp
ColorWriteMask vk.ColorComponentFlags
}
ShaderPipelineColorBlendCompiled
struct
type ShaderPipelineColorBlendCompiled struct {
LogicOpEnable vk.Bool32
LogicOp vk.LogicOp
BlendConstants [4]float32
}
ShaderPipelineData
struct
type ShaderPipelineData struct {
Name string
InputAssembly ShaderPipelineInputAssembly
Rasterization ShaderPipelinePipelineRasterization
Multisample ShaderPipelinePipelineMultisample
ColorBlend ShaderPipelineColorBlend
ColorBlendAttachments []ShaderPipelineColorBlendAttachments
DepthStencil ShaderPipelineDepthStencil
Tessellation ShaderPipelineTessellation
GraphicsPipeline ShaderPipelineGraphicsPipeline
}
ShaderPipelineData.AlphaToCoverageEnableToVK
ShaderPipelineData.AlphaToOneEnableToVK
ShaderPipelineData.BackStencilOpStateToVK
ShaderPipelineData.BlendConstants
ShaderPipelineData.Compile
ShaderPipelineData.DepthBiasEnableToVK
ShaderPipelineData.DepthBoundsTestEnableToVK
ShaderPipelineData.DepthClampEnableToVK
ShaderPipelineData.DepthTestEnableToVK
ShaderPipelineData.DepthWriteEnableToVK
ShaderPipelineData.FrontStencilOpStateToVK
TODO: This and the BackStencilOpStateToVK are duplicates because of a bad structure setup, please fix later
ShaderPipelineData.ListBackCompareOp
ShaderPipelineData.ListBackDepthFailOp
ShaderPipelineData.ListBackFailOp
ShaderPipelineData.ListBackPassOp
ShaderPipelineData.ListBlendFactor
ShaderPipelineData.ListBlendOp
ShaderPipelineData.ListCullMode
ShaderPipelineData.ListDepthCompareOp
ShaderPipelineData.ListFrontCompareOp
ShaderPipelineData.ListFrontDepthFailOp
ShaderPipelineData.ListFrontFace
ShaderPipelineData.ListFrontFailOp
ShaderPipelineData.ListFrontPassOp
ShaderPipelineData.ListLogicOp
ShaderPipelineData.ListPatchControlPoints
ShaderPipelineData.ListPolygonMode
ShaderPipelineData.ListRasterizationSamples
ShaderPipelineData.ListTopology
ShaderPipelineData.LogicOpEnableToVK
ShaderPipelineData.PrimitiveRestartToVK
ShaderPipelineData.RasterizerDiscardEnableToVK
ShaderPipelineData.SampleShadingEnableToVK
ShaderPipelineData.StencilTestEnableToVK
ShaderPipelineDataCompiled
struct
type ShaderPipelineDataCompiled struct {
Name string
InputAssembly ShaderPipelineInputAssemblyCompiled
Rasterization ShaderPipelinePipelineRasterizationCompiled
Multisample ShaderPipelinePipelineMultisampleCompiled
ColorBlend ShaderPipelineColorBlendCompiled
ColorBlendAttachments []ShaderPipelineColorBlendAttachmentsCompiled
DepthStencil ShaderPipelineDepthStencilCompiled
Tessellation ShaderPipelineTessellationCompiled
GraphicsPipeline ShaderPipelineGraphicsPipelineCompiled
}
ShaderPipelineDataCompiled.ConstructPipeline
func (s *ShaderPipelineDataCompiled) ConstructPipeline(renderer Renderer, shader *Shader, renderPass *RenderPass, stages []vk.PipelineShaderStageCreateInfo) bool
ShaderPipelineDepthStencil
struct
type ShaderPipelineDepthStencil struct {
DepthTestEnable bool
DepthWriteEnable bool
DepthCompareOp string `options:"StringVkCompareOp"`
DepthBoundsTestEnable bool
StencilTestEnable bool
FrontFailOp string `options:"StringVkStencilOp" tip:"FailOp"`
FrontPassOp string `options:"StringVkStencilOp" tip:"PassOp"`
FrontDepthFailOp string `options:"StringVkStencilOp" tip:"DepthFailOp"`
FrontCompareOp string `options:"StringVkCompareOp" tip:"CompareOp"`
FrontCompareMask uint32 `tip:"CompareMask"`
FrontWriteMask uint32 `tip:"WriteMask"`
FrontReference uint32 `tip:"Reference"`
BackFailOp string `options:"StringVkStencilOp" tip:"FailOp"`
BackPassOp string `options:"StringVkStencilOp" tip:"PassOp"`
BackDepthFailOp string `options:"StringVkStencilOp" tip:"DepthFailOp"`
BackCompareOp string `options:"StringVkCompareOp" tip:"CompareOp"`
BackCompareMask uint32 `tip:"CompareMask"`
BackWriteMask uint32 `tip:"WriteMask"`
BackReference uint32 `tip:"Reference"`
MinDepthBounds float32
MaxDepthBounds float32
}
ShaderPipelineDepthStencilCompiled
struct
type ShaderPipelineDepthStencilCompiled struct {
DepthTestEnable vk.Bool32
DepthWriteEnable vk.Bool32
DepthCompareOp vk.CompareOp
DepthBoundsTestEnable vk.Bool32
StencilTestEnable vk.Bool32
Front vk.StencilOpState
Back vk.StencilOpState
MinDepthBounds float32
MaxDepthBounds float32
}
ShaderPipelineGraphicsPipeline
struct
type ShaderPipelineGraphicsPipeline struct {
Subpass uint32
PipelineCreateFlags []string `options:"StringVkPipelineCreateFlagBits"`
}
ShaderPipelineGraphicsPipeline.PipelineCreateFlagsToVK
ShaderPipelineGraphicsPipelineCompiled
struct
type ShaderPipelineGraphicsPipelineCompiled struct {
Subpass uint32
PipelineCreateFlags vk.PipelineCreateFlags
}
ShaderPipelineInputAssembly
struct
type ShaderPipelineInputAssembly struct {
Topology string `options:"StringVkPrimitiveTopology"`
PrimitiveRestart bool
}
ShaderPipelineInputAssembly.TopologyToVK
ShaderPipelineInputAssemblyCompiled
struct
type ShaderPipelineInputAssemblyCompiled struct {
Topology vk.PrimitiveTopology
PrimitiveRestart vk.Bool32
}
ShaderPipelinePipelineMultisample
struct
type ShaderPipelinePipelineMultisample struct {
RasterizationSamples string `options:"StringVkSampleCountFlagBits"`
SampleShadingEnable bool
MinSampleShading float32
AlphaToCoverageEnable bool
AlphaToOneEnable bool
}
ShaderPipelinePipelineMultisample.RasterizationSamplesToVK
func (s *ShaderPipelinePipelineMultisample) RasterizationSamplesToVK(vr *Vulkan) vk.SampleCountFlagBits
ShaderPipelinePipelineMultisampleCompiled
struct
type ShaderPipelinePipelineMultisampleCompiled struct {
RasterizationSamples vk.SampleCountFlagBits
SampleShadingEnable vk.Bool32
MinSampleShading float32
AlphaToCoverageEnable vk.Bool32
AlphaToOneEnable vk.Bool32
}
ShaderPipelinePipelineRasterization
struct
type ShaderPipelinePipelineRasterization struct {
DepthClampEnable bool
RasterizerDiscardEnable bool
PolygonMode string `options:"StringVkPolygonMode"`
CullMode string `options:"StringVkCullModeFlagBits"`
FrontFace string `options:"StringVkFrontFace"`
DepthBiasEnable bool
DepthBiasConstantFactor float32
DepthBiasClamp float32
DepthBiasSlopeFactor float32
LineWidth float32
}
ShaderPipelinePipelineRasterization.CullModeToVK
ShaderPipelinePipelineRasterization.FrontFaceToVK
ShaderPipelinePipelineRasterization.PolygonModeToVK
ShaderPipelinePipelineRasterizationCompiled
struct
type ShaderPipelinePipelineRasterizationCompiled struct {
DepthClampEnable vk.Bool32
DiscardEnable vk.Bool32
PolygonMode vk.PolygonMode
CullMode vk.CullModeFlags
FrontFace vk.FrontFace
DepthBiasEnable vk.Bool32
DepthBiasConstantFactor float32
DepthBiasClamp float32
DepthBiasSlopeFactor float32
LineWidth float32
}
ShaderPipelineTessellation
struct
type ShaderPipelineTessellation struct {
PatchControlPoints string `options:"StringVkPatchControlPoints"`
}
ShaderPipelineTessellation.PatchControlPointsToVK
ShaderPipelineTessellationCompiled
struct
SkinnedShaderData
struct
TextShaderData
struct
type TextShaderData struct {
ShaderDataBase
UVs matrix.Vec4
FgColor matrix.Color
BgColor matrix.Color
Scissor matrix.Vec4
PxRange matrix.Vec2
}
TextShaderData.Size
Texture
struct
type Texture struct {
Key string
TexturePixelCache []byte
RenderId TextureId
Channels int
Filter int
MipLevels int
Width int
Height int
CacheInvalid bool
// Has unexported fields.
}
NewTexture
func NewTexture(renderer Renderer, assetDb *assets.Database, textureKey string, filter TextureFilter) (*Texture, error)
NewTextureFromMemory
func NewTextureFromMemory(key string, data []byte, width, height int, filter TextureFilter) (*Texture, error)
Texture.DelayedCreate
Texture.Destroy
Texture.ReadPixel
Texture.Size
Texture.WritePixels
TextureCache
struct
NewTextureCache
TextureCache.CreatePending
TextureCache.Destroy
TextureCache.Texture
TextureColorFormat
const ( TextureColorFormatRgbaUnorm TextureColorFormat = iota TextureColorFormatRgbUnorm TextureColorFormatRgbaSrgb TextureColorFormatRgbSrgb TextureColorFormatLuminance )
TextureData
struct
type TextureData struct {
Mem []byte
InternalFormat TextureInputType
Format TextureColorFormat
Type TextureMemType
Width int
Height int
InputType TextureFileFormat
}
ReadRawTextureData
TexturePixelsFromAsset
TextureFileFormat
const ( TextureFileFormatAstc TextureFileFormat = iota TextureFileFormatPng TextureFileFormatRaw )
TextureFilter
const ( TextureFilterLinear TextureFilter = iota TextureFilterNearest TextureFilterMax )
TextureId
struct
type TextureId struct {
Image vk.Image
Memory vk.DeviceMemory
View vk.ImageView
Sampler vk.Sampler
Format vk.Format
MipLevels uint32
Layout vk.ImageLayout
Access vk.AccessFlags
Samples vk.SampleCountFlagBits
Width int
Height int
LayerCount int
}
TextureId.IsValid
TextureInputType
const ( TextureInputTypeCompressedRgbaAstc4x4 TextureInputType = iota TextureInputTypeCompressedRgbaAstc5x4 TextureInputTypeCompressedRgbaAstc5x5 TextureInputTypeCompressedRgbaAstc6x5 TextureInputTypeCompressedRgbaAstc6x6 TextureInputTypeCompressedRgbaAstc8x5 TextureInputTypeCompressedRgbaAstc8x6 TextureInputTypeCompressedRgbaAstc8x8 TextureInputTypeCompressedRgbaAstc10x5 TextureInputTypeCompressedRgbaAstc10x6 TextureInputTypeCompressedRgbaAstc10x8 TextureInputTypeCompressedRgbaAstc10x10 TextureInputTypeCompressedRgbaAstc12x10 TextureInputTypeCompressedRgbaAstc12x12 TextureInputTypeRgba8 TextureInputTypeRgb8 TextureInputTypeLuminance )
TextureMemType
const ( TextureMemTypeUnsignedByte TextureMemType = iota )
Vertex
struct
type Vertex struct {
Position matrix.Vec3
Normal matrix.Vec3
Tangent matrix.Vec4
UV0 matrix.Vec2
Color matrix.Color
JointIds matrix.Vec4i
JointWeights matrix.Vec4
MorphTarget matrix.Vec3
}
Vulkan
struct
NewVKRenderer
func NewVKRenderer(window RenderingContainer, applicationName string, assets *assets.Database) (*Vulkan, error)
Vulkan.AddPreRun
Vulkan.BlitTargets
Vulkan.CopyBuffer
Vulkan.CreateBuffer
func (vr *Vulkan) CreateBuffer(size vk.DeviceSize, usage vk.BufferUsageFlags, properties vk.MemoryPropertyFlags, buffer *vk.Buffer, bufferMemory *vk.DeviceMemory) bool
Vulkan.CreateFrameBuffer
func (vr *Vulkan) CreateFrameBuffer(renderPass *RenderPass, attachments []vk.ImageView, width, height uint32) (vk.Framebuffer, bool)
Vulkan.CreateImage
func (vr *Vulkan) CreateImage(width, height, mipLevels uint32, numSamples vk.SampleCountFlagBits, format vk.Format, tiling vk.ImageTiling, usage vk.ImageUsageFlags, properties vk.MemoryPropertyFlags, textureId *TextureId, layerCount int) bool