package rendering
Constants
FontJustifyLeft
FontJustify(iota)
FontJustifyCenter
FontJustifyRight
FontBaselineBottom
FontBaseline(iota)
FontBaselineCenter
FontBaselineTop
FontCondensedBold
FontFace("OpenSans_Condensed-Bold")
FontCondensedBoldItalic
FontFace("OpenSans_Condensed-BoldItalic")
FontCondensedExtraBold
FontFace("OpenSans_Condensed-ExtraBold")
FontCondensedExtraBoldItalic
FontFace("OpenSans_Condensed-ExtraBoldItalic")
FontCondensedItalic
FontFace("OpenSans_Condensed-Italic")
FontCondensedLight
FontFace("OpenSans_Condensed-Light")
FontCondensedLightItalic
FontFace("OpenSans_Condensed-LightItalic")
FontCondensedMedium
FontFace("OpenSans_Condensed-Medium")
FontCondensedMediumItalic
FontFace("OpenSans_Condensed-MediumItalic")
FontCondensedRegular
FontFace("OpenSans_Condensed-Regular")
FontCondensedSemiBold
FontFace("OpenSans_Condensed-SemiBold")
FontCondensedSemiBoldItalic
FontFace("OpenSans_Condensed-SemiBoldItalic")
FontSemiCondensedBold
FontFace("OpenSans_SemiCondensed-Bold")
FontSemiCondensedBoldItalic
FontFace("OpenSans_SemiCondensed-BoldItalic")
FontSemiCondensedExtraBold
FontFace("OpenSans_SemiCondensed-ExtraBold")
FontSemiCondensedExtraBoldItalic
FontFace("OpenSans_SemiCondensed-ExtraBoldItalic")
FontSemiCondensedItalic
FontFace("OpenSans_SemiCondensed-Italic")
FontSemiCondensedLight
FontFace("OpenSans_SemiCondensed-Light")
FontSemiCondensedLightItalic
FontFace("OpenSans_SemiCondensed-LightItalic")
FontSemiCondensedMedium
FontFace("OpenSans_SemiCondensed-Medium")
FontSemiCondensedMediumItalic
FontFace("OpenSans_SemiCondensed-MediumItalic")
FontSemiCondensedRegular
FontFace("OpenSans_SemiCondensed-Regular")
FontSemiCondensedSemiBold
FontFace("OpenSans_SemiCondensed-SemiBold")
FontSemiCondensedSemiBoldItalic
FontFace("OpenSans_SemiCondensed-SemiBoldItalic")
FontBold
FontFace("OpenSans-Bold")
FontBoldItalic
FontFace("OpenSans-BoldItalic")
FontExtraBold
FontFace("OpenSans-ExtraBold")
FontExtraBoldItalic
FontFace("OpenSans-ExtraBoldItalic")
FontItalic
FontFace("OpenSans-Italic")
FontLight
FontFace("OpenSans-Light")
FontLightItalic
FontFace("OpenSans-LightItalic")
FontMedium
FontFace("OpenSans-Medium")
FontMediumItalic
FontFace("OpenSans-MediumItalic")
FontRegular
FontFace("OpenSans-Regular")
FontSemiBold
FontFace("OpenSans-SemiBold")
FontSemiBoldItalic
FontFace("OpenSans-SemiBoldItalic")
DefaultFontEMSize
MaxJoints
50
MaxSkinInstances
50
MaxPointShadows
50
MaxLights
20
LightTypeDirectional
LightType(iota)
LightTypePoint
LightTypeSpot
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
GenerateUniqueTextureKey
""
Variables
StringVkFormat
map[string]vulkan_const.Format{
StringVkBlendFactor
map[string]vulkan_const.BlendFactor{
StringVkBlendOp
map[string]vulkan_const.BlendOp{
StringVkLogicOp
map[string]vulkan_const.LogicOp{
StringVkCompareOp
map[string]vulkan_const.CompareOp{
StringVkStencilOp
map[string]vulkan_const.StencilOp{
StringVkPrimitiveTopology
map[string]vulkan_const.PrimitiveTopology{
StringVkPolygonMode
map[string]vulkan_const.PolygonMode{
StringVkCullModeFlagBits
map[string]vulkan_const.CullModeFlagBits{
StringVkFrontFace
map[string]vulkan_const.FrontFace{
StringVkSampleCountFlagBits
map[string]vulkan_const.SampleCountFlagBits{
StringVkPatchControlPoints
map[string]uint32{
StringVkAttachmentLoadOp
map[string]vulkan_const.AttachmentLoadOp{
StringVkAttachmentStoreOp
map[string]vulkan_const.AttachmentStoreOp{
StringVkImageLayout
map[string]vulkan_const.ImageLayout{
StringVkPipelineStageFlagBits
map[string]vulkan_const.PipelineStageFlagBits{
StringVkAccessFlagBits
map[string]vulkan_const.AccessFlagBits{
StringVkPipelineBindPoint
map[string]vulkan_const.PipelineBindPoint{
StringVkDependencyFlagBits
map[string]vulkan_const.DependencyFlagBits{
StringVkColorComponentFlagBits
map[string]vulkan_const.ColorComponentFlagBits{
StringVkPipelineCreateFlagBits
map[string]vulkan_const.PipelineCreateFlagBits{
StringVkImageTiling
map[string]vulkan_const.ImageTiling{
StringVkFilter
map[string]vulkan_const.Filter{
StringVkImageUsageFlagBits
map[string]vulkan_const.ImageUsageFlagBits{
StringVkMemoryPropertyFlagBits
map[string]vulkan_const.MemoryPropertyFlagBits{
StringVkImageAspectFlagBits
map[string]vulkan_const.ImageAspectFlagBits{
StringVkMap
map[string]any{
Functions
SetupLightMaterials
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 vulkan_const.DescriptorType
Flags vulkan_const.ShaderStageFlagBits
Count, Binding uint32
}
DrawInstance
interface
type DrawInstance interface {
Base() *ShaderDataBase
Destroy()
IsDestroyed() bool
Activate()
Deactivate()
IsInView() bool
Size() int
SetModel(model matrix.Mat4)
UpdateModel(viewCuller ViewCuller, container collision.AABB)
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
Sort int
ViewCuller ViewCuller
CastsShadows bool
}
Drawing.IsValid
Drawings
struct
NewDrawings
Drawings.AddDrawing
Drawings.AddDrawings
Drawings.Clear
Drawings.Destroy
Drawings.HasDrawings
Drawings.PreparePending
Drawings.Render
FontBaseline
FontCache
struct
NewFontCache
FontCache.Destroy
FontCache.EMSize
FontCache.Init
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.PreloadFace
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, cam *cameras.Container) []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
GPUImageWriteRequest
struct
GPULight
struct
type GPULight struct {
Matrix [cubeMapSides]matrix.Mat4
Position matrix.Vec3
Direction matrix.Vec3
// Has unexported fields.
}
GPULightInfo
struct
type GPULightInfo struct {
Position matrix.Vec3
Intensity float32
Direction matrix.Vec3
Cutoff float32
Ambient matrix.Vec3
OuterCutoff float32
Diffuse matrix.Vec3
Constant float32
Specular matrix.Vec3
Linear float32
Quadratic float32
NearPlane float32
FarPlane float32
Type int32
// Has unexported fields.
}
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
StaticShadows [MaxPointShadows]PointShadow
DynamicShadows [MaxPointShadows]PointShadow
VertLights [MaxLights]GPULight
LightInfos [MaxLights]GPULightInfo
// Has unexported fields.
}
InstanceCopyData
struct
InstanceCopyDataNew
InstanceDriverData
struct
InstanceGroupSkinningData
struct
Light
struct
NewLight
func NewLight(vr *Vulkan, assetDb assets.Database, materialCache *MaterialCache, lightType LightType) Light
Light.Direction
Light.IsValid
Light.SetAmbient
Light.SetCastsShadows
Light.SetConstant
Light.SetCutoff
Light.SetDiffuse
Light.SetDirection
Light.SetIntensity
Light.SetLinear
Light.SetOuterCutoff
Light.SetPosition
Light.SetQuadratic
Light.SetSpecular
Light.ShadowMapTexture
Light.Type
Light.WorldSpace
LightShadowShaderData
struct
LightShadowShaderData.Size
LightType
Material
struct
type Material struct {
Id string
Name string
Shader *Shader
Textures []*Texture
ShadowMap *Texture
ShadowCubeMap *Texture
Instances map[string]*Material
Root weak.Pointer[Material]
IsLit bool
// Has unexported fields.
}
Material.CreateInstance
Material.Destroy
Material.HasShadowCubeMap
Material.HasShadowMap
Material.HasTransparentSuffix
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
NewMeshCapsule
NewMeshCapsule creates a capsule mesh (cylinder with hemispherical ends) with the specified radius and height. The capsule is aligned along the Y-axis, with hemispheres at y=height/2 and y=-height/2. segments controls the number of subdivisions around the circumference, rings controls the number of rings per hemisphere.
NewMeshCube
NewMeshCubeInverse
NewMeshFrustum
NewMeshFrustumBox
NewMeshGrid
NewMeshLine
NewMeshOffsetQuad
NewMeshPlane
NewMeshPoint
NewMeshQuad
NewMeshQuadAnchored
NewMeshScreenQuad
NewMeshSkyboxCube
NewMeshTexturableCube
NewMeshTriangle
NewMeshUnitQuad
NewMeshWireCube
NewMeshWireQuad
Mesh.Bounds
Mesh.DelayedCreate
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
MeshCache.RemoveMesh
MeshCleanup
struct
MeshCullMode
const ( MeshCullModeBack MeshCullMode = iota MeshCullModeFront MeshCullModeNone )
MeshDrawMode
const ( MeshDrawModePoints MeshDrawMode = iota MeshDrawModeLines MeshDrawModeTriangles MeshDrawModePatches )
MeshId
struct
MeshId.IsValid
PointShadow
struct
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
RenderPass.SelectOutputAttachmentWithSuffix
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 vulkan_const.Format
Samples vulkan_const.SampleCountFlagBits
LoadOp vulkan_const.AttachmentLoadOp
StoreOp vulkan_const.AttachmentStoreOp
StencilLoadOp vulkan_const.AttachmentLoadOp
StencilStoreOp vulkan_const.AttachmentStoreOp
InitialLayout vulkan_const.ImageLayout
FinalLayout vulkan_const.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 vulkan_const.ImageTiling
Filter vulkan_const.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
type RenderPassAttachmentReferenceCompiled struct {
Attachment uint32
Layout vulkan_const.ImageLayout
}
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 vulkan_const.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(window RenderingContainer, camera cameras.Camera, uiCamera cameras.Camera,
lights []Light, staticShadows []PointShadow, dynamicShadows []PointShadow, 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, requests []GPUImageWriteRequest)
Draw(renderPass *RenderPass, drawings []ShaderDraw) bool
BlitTargets(passes []*RenderPass)
SwapFrame(window RenderingContainer, width, height int32) bool
Resize(window RenderingContainer, width, height int)
AddPreRun(preRun func())
DestroyGroup(group *DrawInstanceGroup)
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.RemoveSubShader
Shader.ShaderDataName
Shader.SubShader
ShaderBuffer
struct
ShaderCache
struct
NewShaderCache
ShaderCache.CreatePending
ShaderCache.Destroy
ShaderCache.Shader
ShaderCleanup
struct
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.Base
ShaderDataBase.CancelDestroy
ShaderDataBase.DataPointer
ShaderDataBase.Deactivate
ShaderDataBase.Destroy
ShaderDataBase.IsDestroyed
ShaderDataBase.IsInView
ShaderDataBase.Model
ShaderDataBase.NamedDataInstanceSize
ShaderDataBase.NamedDataPointer
ShaderDataBase.SetModel
ShaderDataBase.Setup
ShaderDataBase.UpdateModel
ShaderDataBase.UpdateNamedData
ShaderDataCombine
struct
ShaderDataCombine.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.Clear
ShaderDraw.Destroy
ShaderDraw.Filter
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
Count 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
func (a *ShaderPipelineColorBlendAttachments) ColorWriteMaskToVK() vulkan_const.ColorComponentFlagBits
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 vulkan_const.BlendFactor
DstColorBlendFactor vulkan_const.BlendFactor
ColorBlendOp vulkan_const.BlendOp
SrcAlphaBlendFactor vulkan_const.BlendFactor
DstAlphaBlendFactor vulkan_const.BlendFactor
AlphaBlendOp vulkan_const.BlendOp
ColorWriteMask vk.ColorComponentFlags
}
ShaderPipelineColorBlendCompiled
struct
type ShaderPipelineColorBlendCompiled struct {
LogicOpEnable vk.Bool32
LogicOp vulkan_const.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 vulkan_const.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 vulkan_const.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) vulkan_const.SampleCountFlagBits
ShaderPipelinePipelineMultisampleCompiled
struct
type ShaderPipelinePipelineMultisampleCompiled struct {
RasterizationSamples vulkan_const.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 vulkan_const.PolygonMode
CullMode vk.CullModeFlags
FrontFace vulkan_const.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, key string, filter TextureFilter) (*Texture, error)
NewTextureFromMemory
func NewTextureFromMemory(key string, data []byte, width, height int, filter TextureFilter) (*Texture, error)
Texture.DelayedCreate
Texture.ReadPixel
Texture.Size
Texture.WritePixels
TextureCache
struct
NewTextureCache
TextureCache.CreatePending
TextureCache.Destroy
TextureCache.ForceRemoveTexture
TextureCache.InsertTexture
func (t *TextureCache) InsertTexture(key string, data []byte, width, height int, filter TextureFilter) (*Texture, error)
TextureCache.Texture
TextureCleanup
struct
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 vulkan_const.Format
MipLevels uint32
Layout vulkan_const.ImageLayout
Access vk.AccessFlags
Samples vulkan_const.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
}
MeshPlaneData
MeshQuadData
ViewCuller
interface
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 vulkan_const.SampleCountFlagBits, format vulkan_const.Format, tiling vulkan_const.ImageTiling, usage vk.ImageUsageFlags, properties vk.MemoryPropertyFlags, textureId *TextureId, layerCount int) bool
Vulkan.CreateMesh
Vulkan.CreateShader
Vulkan.CreateTexture
Vulkan.Destroy
Vulkan.DestroyBuffer
Vulkan.DestroyGroup
Vulkan.Draw
Vulkan.FormatIsTileable
func (vr *Vulkan) FormatIsTileable(format vulkan_const.Format, tiling vulkan_const.ImageTiling) bool
Vulkan.Initialize
Vulkan.MeshIsReady
Vulkan.ReadyFrame
func (vr *Vulkan) ReadyFrame(window RenderingContainer, camera cameras.Camera, uiCamera cameras.Camera, lights []Light, staticShadows []PointShadow, dynamicShadows []PointShadow, runtime float32) bool