package rendering
Constants
FontJustifyLeft
FontJustify(iota)
FontJustifyCenter
FontJustifyRight
FontJustifyJustify
FontBaselineBottom
FontBaseline(iota)
FontBaselineCenter
FontBaselineTop
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")
FontRegular
FontFace("OpenSans-Regular")
FontSemiBold
FontFace("OpenSans-SemiBold")
FontSemiBoldItalic
FontFace("OpenSans-SemiBoldItalic")
FontMono
FontFace("JetBrainsMono-Regular")
MaxJoints
50
MaxSkinInstances
50
MaxLocalLights
20
MaxCascades
3
LightTypeDirectional
LightType(iota)
LightTypePoint
LightTypeSpot
QuadPivotCenter
QuadPivot(iota)
QuadPivotLeft
QuadPivotTop
QuadPivotRight
QuadPivotBottom
QuadPivotBottomLeft
QuadPivotBottomRight
QuadPivotTopLeft
QuadPivotTopRight
RenderTargetOutputColor
"color"
RenderTargetOutputDepth
"depth"
QuaternionSize
[int(unsafe](../int(unsafe).[Sizeof(matrix](../int(unsafe#Sizeof(matrix)
BytesInPixel
4
MaxCommandPools
5
MaxSecondaryCommands
25
DefaultFontEMSize
GPUWholeSize
(^uintptr(0))
Variables
ErrRenderTargetNotFound
errors.New("render target not found")
ErrRenderTargetNotRealized
errors.New("render target texture is not realized")
ErrRenderTargetDestroyed
errors.New("render target is destroyed")
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]gpu_types.SampleCountFlags{
StringVkPatchControlPoints
map[string]uint32{
StringVkAttachmentLoadOp
map[string]gpu_types.AttachmentLoadOp{
StringVkAttachmentStoreOp
map[string]gpu_types.AttachmentStoreOp{
StringVkImageLayout
map[string]gpu_types.ImageLayout{
StringVkPipelineStageFlagBits
map[string]gpu_types.PipelineStageFlags{
StringVkAccessFlagBits
map[string]gpu_types.AccessFlags{
StringVkShaderStageFlagBits
map[string]vulkan_const.ShaderStageFlagBits{
StringVkPipelineBindPoint
map[string]gpu_enums.PipelineBindPoint{
StringVkDependencyFlagBits
map[string]gpu_enums.DependencyFlags{
StringVkColorComponentFlagBits
map[string]vulkan_const.ColorComponentFlagBits{
StringVkPipelineCreateFlagBits
map[string]vulkan_const.PipelineCreateFlagBits{
StringVkImageTiling
map[string]gpu_types.ImageTiling{
StringVkFilter
map[string]gpu_types.Filter{
StringVkImageUsageFlagBits
map[string]gpu_types.ImageUsageFlags{
StringVkMemoryPropertyFlagBits
map[string]gpu_types.MemoryPropertyFlags{
StringVkImageAspectFlagBits
map[string]gpu_types.ImageAspectFlags{
StringVkMap
map[string]any{
Functions
DefaultSwapChainClearColor
DefaultSwapChainClearColor returns the engine's built-in presented background color used before a game supplies its own.
LinkDrawInstanceLifecycle
SetupLightMaterials
TextureKeys
TexturePixelsFromAsset
VertexFaceNormal
Types
BoneTransform
struct
CommandRecorder
struct
NewCommandRecorder
CommandRecorder.Begin
CommandRecorder.Destroy
CommandRecorder.End
CommandRecorder.Reset
CommandRecorderSecondary
struct
NewCommandRecorderSecondary
func NewCommandRecorderSecondary(device *GPUDevice, rp *RenderPass, subpassIdx int) (CommandRecorderSecondary, error)
CommandRecorderSecondary.Begin
ComputeShaderBuffer
struct
ComputeShaderBuffer.Initialize
func (b *ComputeShaderBuffer) Initialize(device *GPUDevice, size uintptr, usage gpu_types.BufferUsageFlags, properties gpu_types.MemoryPropertyFlags) error
ComputeShaderBuffer.WriteDescriptors
ComputeTask
struct
type ComputeTask struct {
Shader *Shader
DescriptorSets []gpu_types.DescriptorSet
WorkGroups [3]uint32
}
DescriptorSetLayoutStructure
struct
DescriptorSetLayoutStructureType
struct
type DescriptorSetLayoutStructureType struct {
Type vulkan_const.DescriptorType
Flags vulkan_const.ShaderStageFlagBits
Count, Binding uint32
}
DescriptorWriteCache
struct
DescriptorWriteCache.Invalidate
DescriptorWriteCache.ShouldWrite
DescriptorWriteSignature
struct
NewDescriptorWriteSignature
DescriptorWriteSignature.AddHandle
DescriptorWriteSignature.AddInt
DescriptorWriteSignature.AddPointer
DescriptorWriteSignature.AddString
DescriptorWriteSignature.AddUint64
DescriptorWriteSignature.AddUintptr
DescriptorWriteSignature.Equal
DrawInstance
interface
type DrawInstance interface {
Base() *ShaderDataBase
SkinningHeader() *SkinnedShaderDataHeader
Destroy()
IsDestroyed() bool
Activate()
Deactivate()
IsInView() bool
Size() int
SetModel(model matrix.Mat4)
UpdateModel(viewCuller ViewCuller, container graviton.AABB)
DataPointer() unsafe.Pointer
// Returns true if it should write the data, otherwise false
UpdateBoundData() bool
BoundDataPointer() unsafe.Pointer
InstanceBoundDataSize() int
SelectLights(lights LightsForRender)
// Has unexported methods.
}
ReflectDuplicateDrawInstance
DrawInstanceFrameData
struct
DrawInstanceGroup
struct
type DrawInstanceGroup struct {
Mesh *Mesh
InstanceDriverData
MaterialInstance *Material
Layer RenderLayerMask
Instances []DrawInstance
// Has unexported fields.
}
NewDrawInstanceGroup
DrawInstanceGroup.AddInstance
DrawInstanceGroup.AlterPadding
DrawInstanceGroup.AnyVisible
DrawInstanceGroup.AnyVisibleForView
DrawInstanceGroup.CaptureDataForView
DrawInstanceGroup.Clear
DrawInstanceGroup.Destroy
DrawInstanceGroup.DestroyViewState
DrawInstanceGroup.EffectiveLayer
DrawInstanceGroup.IsEmpty
DrawInstanceGroup.IsReady
DrawInstanceGroup.MatchesLayer
DrawInstanceGroup.TotalSize
DrawInstanceGroup.UpdateData
DrawInstanceGroup.UpdateDataForView
func (d *DrawInstanceGroup) UpdateDataForView(device *GPUDevice, frame int, lights LightsForRender, view *RenderView)
DrawInstanceGroup.VisibleCount
DrawInstanceGroup.VisibleCountForView
DrawInstanceGroup.VisibleSize
DrawInstanceViewState
struct
NewDrawInstanceViewState
Drawing
struct
type Drawing struct {
// Material defines the visual appearance and render pass for the drawing.
Material *Material
// Mesh contains the geometry to be rendered.
Mesh *Mesh
// ShaderData holds per‑instance data for the shader (e.g., uniforms).
ShaderData DrawInstance
// Transform specifies the transform this drawing follows.
Transform *matrix.Transform
// Sort determines the draw order within a render pass.
Sort int
// Layer controls which render views include this drawing. Zero maps to world.
Layer RenderLayerMask
// ViewCuller optionally culls the drawing based on the view frustum.
ViewCuller ViewCuller
}
Drawing represents a renderable entity in the engine. It bundles together the material, mesh, shader instance data, transform, sorting order, and an optional view culler used during rendering.
Drawing.EffectiveLayer
Drawing.IsValid
IsValid reports whether the Drawing is properly configured for rendering. A Drawing is considered valid if it has a non-nil Material. This check is used before submitting the drawing to the render pipeline.
Drawing.MatchesLayer
Drawings
struct
NewDrawings
Drawings.AddDrawing
Drawings.AddDrawings
Drawings.CaptureFrameData
Drawings.Clear
Drawings.Destroy
Drawings.DestroyViewState
Drawings.HasDrawings
Drawings.PreparePending
Drawings.Render
FontBaseline
FontCache
struct
NewFontCache
FontCache.Destroy
FontCache.EMSize
FontCache.Init
FontCache.LineCountWithin
FontCache.MeasureCharacter
FontCache.MeasureString
FontCache.MeasureStringWithLetterSpacing
func (cache *FontCache) MeasureStringWithLetterSpacing(face FontFace, text string, scale, letterSpacing float32) float32
FontCache.MeasureStringWithin
func (cache *FontCache) MeasureStringWithin(face FontFace, text string, scale, maxWidth float32, lineHeight float32) matrix.Vec2
FontCache.MeasureStringWithinWithLetterSpacing
func (cache *FontCache) MeasureStringWithinWithLetterSpacing(face FontFace, text string, scale, maxWidth float32, lineHeight float32, letterSpacing float32) matrix.Vec2
FontCache.OpaqueMaterial
OpaqueMaterial returns the opaque counterpart for a text material. This is used by cutout text: the fragment shader discards pixels outside the glyph, leaving a transparent background while writing fully opaque glyph pixels.
FontCache.PointOffsetWithin
func (cache *FontCache) PointOffsetWithin(face FontFace, text string, point matrix.Vec2, scale, maxWidth float32) int
FontCache.PointOffsetWithinWithLetterSpacing
func (cache *FontCache) PointOffsetWithinWithLetterSpacing(face FontFace, text string, point matrix.Vec2, scale, maxWidth, lineHeight, letterSpacing 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.RenderMeshesWithLetterSpacing
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, letterSpacing float32, cam *cameras.Container) []Drawing
FontCache.StringRectsWithinNew
func (cache *FontCache) StringRectsWithinNew(face FontFace, text string, scale, maxWidth float32) []matrix.Vec4
FontCache.StringRectsWithinWithLetterSpacing
func (cache *FontCache) StringRectsWithinWithLetterSpacing(face FontFace, text string, scale, maxWidth, lineHeight, letterSpacing float32) []matrix.Vec4
FontCache.TransparentMaterial
FontFace
FontFace.AsBold
FontFace.AsExtraBold
FontFace.AsItalic
FontFace.AsLight
FontFace.AsMedium
FontFace.AsRegular
FontFace.AsSemiBold
FontFace.Base
FontFace.IsBold
FontFace.IsExtraBold
FontFace.IsItalic
FontFace.RemoveBold
FontFace.RemoveItalic
FontJustify
FuncPipeline
type FuncPipeline func(device *GPUDevice, shader *Shader, shaderStages []vk.PipelineShaderStageCreateInfo) bool
GPUApplication
struct
type GPUApplication struct {
Name string
Version GPUApplicationVersion
Instances []*GPUApplicationInstance
}
GPUApplication.ApplicationVersion
GPUApplication.CreateInstance
func (g *GPUApplication) CreateInstance(window RenderingContainer, assets assets.Database) (*GPUApplicationInstance, error)
GPUApplication.Destroy
GPUApplication.EngineVersion
GPUApplication.FirstInstance
GPUApplication.Instance
GPUApplication.IsValid
GPUApplication.Setup
GPUApplicationInstance
struct
type GPUApplicationInstance struct {
GPUInstance
Surface GPUSurface
Devices []GPUDevice
// Has unexported fields.
}
GPUApplicationInstance.Destroy
GPUApplicationInstance.FinalizeLogicalDeviceSetup
GPUApplicationInstance.Initialize
func (g *GPUApplicationInstance) Initialize(window RenderingContainer, app *GPUApplication, assets assets.Database) error
GPUApplicationInstance.PhysicalDevice
GPUApplicationInstance.PrimaryDevice
GPUApplicationInstance.SelectPhysicalDevice
func (g *GPUApplicationInstance) SelectPhysicalDevice(method func(options []GPUPhysicalDevice) int) error
GPUApplicationInstance.SetupCaches
GPUApplicationInstance.SetupLogicalDevice
GPUApplicationVersion
struct
GPUDevice
struct
type GPUDevice struct {
PhysicalDevice GPUPhysicalDevice
LogicalDevice GPULogicalDevice
Painter GPUPainter
// Has unexported fields.
}
GPUDevice.BeginTextureUploadBatch
GPUDevice.BlitTargets
GPUDevice.BlitTargetsToRenderTarget
func (g *GPUDevice) BlitTargetsToRenderTarget(passes []*RenderPass, target *RenderTarget, view RenderViewFrame)
GPUDevice.CopyBuffer
func (g *GPUDevice) CopyBuffer(srcBuffer gpu_types.Buffer, dstBuffer gpu_types.Buffer, size uintptr)
GPUDevice.CopyBufferToImage
func (g *GPUDevice) CopyBufferToImage(buffer gpu_types.Buffer, image gpu_types.Image, width, height uint32, layerCount int)
GPUDevice.CreateBuffer
func (g *GPUDevice) CreateBuffer(size uintptr, usage gpu_types.BufferUsageFlags, properties gpu_types.MemoryPropertyFlags) (gpu_types.Buffer, gpu_types.DeviceMemory, error)
GPUDevice.CreateDynamicMesh
CreateDynamicMesh creates a mesh with a HOST_VISIBLE vertex buffer that can be updated directly via MapMemory without staging buffers or GPU synchronization. Use for meshes that change frequently (e.g. terrain during brush edits). The index buffer is still DEVICE_LOCAL.
GPUDevice.CreateFrameBuffer
func (g *GPUDevice) CreateFrameBuffer(renderPass *RenderPass, attachments []gpu_types.ImageView, width, height int32) (gpu_types.FrameBuffer, error)
GPUDevice.CreateImage
func (g *GPUDevice) CreateImage(id *TextureId, properties gpu_types.MemoryPropertyFlags, req GPUImageCreateRequest) error
GPUDevice.CreateIndexBuffer
func (g *GPUDevice) CreateIndexBuffer(indices []uint32) (gpu_types.Buffer, gpu_types.DeviceMemory, error)
GPUDevice.CreateMesh
GPUDevice.CreateShader
GPUDevice.CreateSwapChain
GPUDevice.CreateTextureSampler
func (g *GPUDevice) CreateTextureSampler(mipLevels uint32, filter gpu_types.Filter) (gpu_types.Sampler, error)
GPUDevice.CreateVertexBuffer
func (g *GPUDevice) CreateVertexBuffer(verts []Vertex) (gpu_types.Buffer, gpu_types.DeviceMemory, error)
GPUDevice.DestroyBuffer
GPUDevice.DestroyFrameBuffer
GPUDevice.DestroyRenderViewResources
GPUDevice.DestroyShaderHandle
GPUDevice.Draw
func (g *GPUDevice) Draw(renderPass *RenderPass, drawings []ShaderDraw, lights LightsForRender, shadows []TextureId, layerMask RenderLayerMask)
GPUDevice.DrawView
func (g *GPUDevice) DrawView(renderPass *RenderPass, drawings []ShaderDraw, lights LightsForRender, shadows []TextureId, view RenderViewFrame, layerMask RenderLayerMask)
GPUDevice.FlushForReadback
GPUDevice.FlushQueuedCommands
GPUDevice.FreeMemory
GPUDevice.GenerateMipMaps
func (g *GPUDevice) GenerateMipMaps(texId *TextureId, imageFormat gpu_types.Format, texWidth, texHeight, mipLevels uint32, filter gpu_types.Filter) error
GPUDevice.MapMemory
func (g *GPUDevice) MapMemory(memory gpu_types.DeviceMemory, offset uintptr, size uintptr, flags gpu_types.MemoryFlags, out *unsafe.Pointer) error
GPUDevice.Memcopy
GPUDevice.MeshIsReady
GPUDevice.MeshRead
GPUDevice.PrepareRenderTarget
GPUDevice.QueueCompute
GPUDevice.ReadyFrame
func (g *GPUDevice) ReadyFrame(inst *GPUApplicationInstance, window RenderingContainer, camera cameras.Camera, uiCamera cameras.Camera, lights LightsForRender, runtime float32, views []RenderViewFrame) bool
GPUDevice.Screenshot
GPUDevice.ScreenshotRGBA
ScreenshotRGBA captures the last presented frame and returns its pixels in canonical R,G,B,A byte order regardless of the swap chain's native channel order. The swap chain may present in BGRA (e.g. Metal/MoltenVK on macOS), in which case Screenshot's raw bytes are B,G,R,A; this normalizes them so the result can be fed straight into image.RGBA / image/png without swapping the red and blue channels.
GPUDevice.SetSwapChainClearColor
SetSwapChainClearColor sets the clear color used by final swap-chain presentation passes, including the cached combine pass when it exists.
GPUDevice.SetupTexture
GPUDevice.SetupTextureInBatch
func (g *GPUDevice) SetupTextureInBatch(texture *Texture, data *textures.TextureData, batch *TextureUploadBatch) error
GPUDevice.SwapChainClearColor
SwapChainClearColor returns the configured swap-chain clear color or the engine default when no override has been set.
GPUDevice.SwapFrame
func (g *GPUDevice) SwapFrame(window RenderingContainer, inst *GPUApplicationInstance, width, height int32) bool
GPUDevice.TextureRead
GPUDevice.TextureReadPixel
GPUDevice.TextureReadRegion
GPUDevice.TextureWritePixels
GPUDevice.TransitionImageLayout
func (g *GPUDevice) TransitionImageLayout(vt *TextureId, newLayout gpu_types.ImageLayout, aspectMask gpu_types.ImageAspectFlags, newAccess gpu_types.AccessFlags, cmd *CommandRecorder)
GPUDevice.UnmapMemory
GPUDevice.UpdateDynamicMeshVertices
UpdateDynamicMeshVertices writes vertex data directly to a HOST_VISIBLE vertex buffer. No staging buffer, no command buffer, no fence wait.
GPUDevice.UpdateMeshVertices
UpdateMeshVertices re-uploads vertex data to an existing mesh's GPU buffer via a staging buffer copy. The vertex count must match the original; use CreateMesh for topology changes.
GPUDevice.WriteBufferToImageRegion
func (g *GPUDevice) WriteBufferToImageRegion(image gpu_types.Image, requests []GPUImageWriteRequest) error
GPUImageCreateRequest
struct
type GPUImageCreateRequest struct {
Flags gpu_types.ImageCreateFlags
ImageType gpu_types.ImageType
Format gpu_types.Format
Extent matrix.Vec3i
MipLevels uint32
ArrayLayers uint32
Samples gpu_types.SampleCountFlags
Tiling gpu_types.ImageTiling
Usage gpu_types.ImageUsageFlags
}
GPUImageWriteRequest
struct
GPUInstance
struct
GPUInstance.Destroy
GPUInstance.IsValid
GPUInstance.Setup
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
ShadowIndex int32
// Has unexported fields.
}
GPULogicalDevice
struct
type GPULogicalDevice struct {
gpu_types.GpuHandle
SwapChain GPUSwapChain
// Has unexported fields.
}
GPULogicalDevice.CreateImageView
func (g *GPULogicalDevice) CreateImageView(id *TextureId, aspectFlags gpu_types.ImageAspectFlags, viewType gpu_types.ImageViewType) error
GPULogicalDevice.Destroy
GPULogicalDevice.DestroyFence
GPULogicalDevice.DestroyGroup
GPULogicalDevice.DestroySemaphore
GPULogicalDevice.FreeTexture
GPULogicalDevice.ImageMemoryRequirements
func (g *GPULogicalDevice) ImageMemoryRequirements(image gpu_types.Image) gpu_types.MemoryRequirements
GPULogicalDevice.RemakeSwapChain
func (g *GPULogicalDevice) RemakeSwapChain(window RenderingContainer, inst *GPUApplicationInstance, device *GPUDevice) error
GPULogicalDevice.Setup
func (g *GPULogicalDevice) Setup(inst *GPUApplicationInstance, physicalDevice *GPUPhysicalDevice) error
GPULogicalDevice.SetupBufferDestroyer
GPULogicalDevice.WaitForFences
GPULogicalDevice.WaitForRender
GPULogicalDevice.WaitIdle
GPUPainter
struct
GPUPainter.DestroyDescriptorPools
GPUPhysicalDevice
struct
type GPUPhysicalDevice struct {
Features GPUPhysicalDeviceFeatures
Properties GPUPhysicalDeviceProperties
QueueFamilies []GPUQueueFamily
Extensions []GPUPhysicalDeviceExtension
SurfaceFormats []gpu_types.SurfaceFormat
PresentModes []gpu_types.PresentMode
SurfaceCapabilities gpu_types.SurfaceCapabilities
// Has unexported fields.
}
ListPhysicalGpuDevices
GPUPhysicalDevice.FindComputeFamiliy
GPUPhysicalDevice.FindGraphicsFamiliy
GPUPhysicalDevice.FindMemoryType
func (g *GPUPhysicalDevice) FindMemoryType(typeFilter uint32, properties gpu_types.MemoryPropertyFlags) int
GPUPhysicalDevice.FindPresentFamily
GPUPhysicalDevice.FindSupportedFormat
func (g *GPUPhysicalDevice) FindSupportedFormat(candidates []gpu_types.Format, tiling gpu_types.ImageTiling, features gpu_types.FormatFeatureFlags) gpu_types.Format
GPUPhysicalDevice.FormatIsTileable
func (g *GPUPhysicalDevice) FormatIsTileable(format gpu_types.Format, tiling gpu_types.ImageTiling) bool
GPUPhysicalDevice.FormatProperties
GPUPhysicalDevice.IsExtensionSupported
GPUPhysicalDevice.IsValid
GPUPhysicalDevice.MaxUsableSampleCount
GPUPhysicalDevice.PadBufferSize
GPUPhysicalDevice.RefreshSurfaceCapabilities
GPUPhysicalDeviceExtension
struct
GPUPhysicalDeviceFeatures
struct
type GPUPhysicalDeviceFeatures struct {
RobustBufferAccess bool
FullDrawIndexUint32 bool
ImageCubeArray bool
IndependentBlend bool
GeometryShader bool
TessellationShader bool
SampleRateShading bool
DualSrcBlend bool
LogicOp bool
MultiDrawIndirect bool
DrawIndirectFirstInstance bool
DepthClamp bool
DepthBiasClamp bool
FillModeNonSolid bool
DepthBounds bool
WideLines bool
LargePoints bool
AlphaToOne bool
MultiViewport bool
SamplerAnisotropy bool
TextureCompressionETC2 bool
TextureCompressionASTC_LDR bool
TextureCompressionBC bool
OcclusionQueryPrecise bool
PipelineStatisticsQuery bool
VertexPipelineStoresAndAtomics bool
FragmentStoresAndAtomics bool
ShaderTessellationAndGeometryPointSize bool
ShaderImageGatherExtended bool
ShaderStorageImageExtendedFormats bool
ShaderStorageImageMultisample bool
ShaderStorageImageReadWithoutFormat bool
ShaderStorageImageWriteWithoutFormat bool
ShaderUniformBufferArrayDynamicIndexing bool
ShaderSampledImageArrayDynamicIndexing bool
ShaderStorageBufferArrayDynamicIndexing bool
ShaderStorageImageArrayDynamicIndexing bool
ShaderClipDistance bool
ShaderCullDistance bool
ShaderFloat64 bool
ShaderInt64 bool
ShaderInt16 bool
ShaderResourceResidency bool
ShaderResourceMinLod bool
SparseBinding bool
SparseResidencyBuffer bool
SparseResidencyImage2D bool
SparseResidencyImage3D bool
SparseResidency2Samples bool
SparseResidency4Samples bool
SparseResidency8Samples bool
SparseResidency16Samples bool
SparseResidencyAliased bool
VariableMultisampleRate bool
InheritedQueries bool
}
GPUPhysicalDeviceLimits
struct
type GPUPhysicalDeviceLimits struct {
MaxImageDimension1D uint32
MaxImageDimension2D uint32
MaxImageDimension3D uint32
MaxImageDimensionCube uint32
MaxImageArrayLayers uint32
MaxTexelBufferElements uint32
MaxUniformBufferRange uint32
MaxStorageBufferRange uint32
MaxPushConstantsSize uint32
MaxMemoryAllocationCount uint32
MaxSamplerAllocationCount uint32
BufferImageGranularity uintptr
SparseAddressSpaceSize uintptr
MaxBoundDescriptorSets uint32
MaxPerStageDescriptorSamplers uint32
MaxPerStageDescriptorUniformBuffers uint32
MaxPerStageDescriptorStorageBuffers uint32
MaxPerStageDescriptorSampledImages uint32
MaxPerStageDescriptorStorageImages uint32
MaxPerStageDescriptorInputAttachments uint32
MaxPerStageResources uint32
MaxDescriptorSetSamplers uint32
MaxDescriptorSetUniformBuffers uint32
MaxDescriptorSetUniformBuffersDynamic uint32
MaxDescriptorSetStorageBuffers uint32
MaxDescriptorSetStorageBuffersDynamic uint32
MaxDescriptorSetSampledImages uint32
MaxDescriptorSetStorageImages uint32
MaxDescriptorSetInputAttachments uint32
MaxVertexInputAttributes uint32
MaxVertexInputBindings uint32
MaxVertexInputAttributeOffset uint32
MaxVertexInputBindingStride uint32
MaxVertexOutputComponents uint32
MaxTessellationGenerationLevel uint32
MaxTessellationPatchSize uint32
MaxTessellationControlPerVertexInputComponents uint32
MaxTessellationControlPerVertexOutputComponents uint32
MaxTessellationControlPerPatchOutputComponents uint32
MaxTessellationControlTotalOutputComponents uint32
MaxTessellationEvaluationInputComponents uint32
MaxTessellationEvaluationOutputComponents uint32
MaxGeometryShaderInvocations uint32
MaxGeometryInputComponents uint32
MaxGeometryOutputComponents uint32
MaxGeometryOutputVertices uint32
MaxGeometryTotalOutputComponents uint32
MaxFragmentInputComponents uint32
MaxFragmentOutputAttachments uint32
MaxFragmentDualSrcAttachments uint32
MaxFragmentCombinedOutputResources uint32
MaxComputeSharedMemorySize uint32
MaxComputeWorkGroupCount [3]uint32
MaxComputeWorkGroupInvocations uint32
MaxComputeWorkGroupSize [3]uint32
SubPixelPrecisionBits uint32
SubTexelPrecisionBits uint32
MipmapPrecisionBits uint32
MaxDrawIndexedIndexValue uint32
MaxDrawIndirectCount uint32
MaxSamplerLodBias float32
MaxSamplerAnisotropy float32
MaxViewports uint32
MaxViewportDimensions [2]uint32
ViewportBoundsRange [2]float32
ViewportSubPixelBits uint32
MinMemoryMapAlignment uint
MinTexelBufferOffsetAlignment uintptr
MinUniformBufferOffsetAlignment uintptr
MinStorageBufferOffsetAlignment uintptr
MinTexelOffset int32
MaxTexelOffset uint32
MinTexelGatherOffset int32
MaxTexelGatherOffset uint32
MinInterpolationOffset float32
MaxInterpolationOffset float32
SubPixelInterpolationOffsetBits uint32
MaxFramebufferWidth uint32
MaxFramebufferHeight uint32
MaxFramebufferLayers uint32
FramebufferColorSampleCounts gpu_types.SampleCountFlags
FramebufferDepthSampleCounts gpu_types.SampleCountFlags
FramebufferStencilSampleCounts gpu_types.SampleCountFlags
FramebufferNoAttachmentsSampleCounts gpu_types.SampleCountFlags
MaxColorAttachments uint32
SampledImageColorSampleCounts gpu_types.SampleCountFlags
SampledImageIntegerSampleCounts gpu_types.SampleCountFlags
SampledImageDepthSampleCounts gpu_types.SampleCountFlags
SampledImageStencilSampleCounts gpu_types.SampleCountFlags
StorageImageSampleCounts gpu_types.SampleCountFlags
MaxSampleMaskWords uint32
TimestampComputeAndGraphics bool
TimestampPeriod float32
MaxClipDistances uint32
MaxCullDistances uint32
MaxCombinedClipAndCullDistances uint32
DiscreteQueuePriorities uint32
PointSizeRange [2]float32
LineWidthRange [2]float32
PointSizeGranularity float32
LineWidthGranularity float32
StrictLines bool
StandardSampleLocations bool
OptimalBufferCopyOffsetAlignment uintptr
OptimalBufferCopyRowPitchAlignment uintptr
NonCoherentAtomSize uintptr
}
GPUPhysicalDeviceMemoryProperties
struct
type GPUPhysicalDeviceMemoryProperties struct {
MemoryTypes []gpu_types.MemoryType
MemoryHeaps []gpu_types.MemoryHeap
}
GPUPhysicalDeviceProperties
struct
type GPUPhysicalDeviceProperties struct {
ApiVersion uint32
DriverVersion uint32
VendorID uint32
DeviceID uint32
DeviceType gpu_types.PhysicalDeviceType
DeviceName string
PipelineCacheUUID string
Limits GPUPhysicalDeviceLimits
SparseProperties GPUPhysicalDeviceSparseProperties
}
GPUPhysicalDeviceSparseProperties
struct
type GPUPhysicalDeviceSparseProperties struct {
ResidencyStandard2DBlockShape bool
ResidencyStandard2DMultisampleBlockShape bool
ResidencyStandard3DBlockShape bool
ResidencyAlignedMipSize bool
ResidencyNonResidentStrict bool
}
GPUQueueFamily
struct
type GPUQueueFamily struct {
Index int
MinImageTransferGranularity matrix.Vec3i
IsGraphics bool
IsCompute bool
IsTransfer bool
IsSparseBinding bool
IsProtected bool
HasPresentSupport bool
}
InvalidGPUQueueFamily
GPUQueueFamily.IsValid
GPUSurface
struct
GPUSurface.Create
GPUSurface.Destroy
GPUSwapChain
struct
type GPUSwapChain struct {
gpu_types.GpuHandle
Images []TextureId
Extent matrix.Vec2i
Depth TextureId
Color TextureId
FrameBuffers []gpu_types.FrameBuffer
// Has unexported fields.
}
GPUSwapChain.ClearColor
ClearColor returns the configured clear color, or the engine default when no override has been set.
GPUSwapChain.ClearColorOverride
ClearColorOverride returns the explicitly configured clear color and whether one has been set.
GPUSwapChain.CopyAndReset
GPUSwapChain.CreateColor
GPUSwapChain.CreateDepth
GPUSwapChain.CreateFrameBuffer
GPUSwapChain.Destroy
GPUSwapChain.SelectExtent
func (g *GPUSwapChain) SelectExtent(window RenderingContainer, device *GPUPhysicalDevice) matrix.Vec2i
GPUSwapChain.SelectPresentMode
GPUSwapChain.SelectSurfaceFormat
GPUSwapChain.SetClearColor
SetClearColor stores the clear color used by final swap-chain presentation passes and applies it to the existing swap-chain render pass.
GPUSwapChain.Setup
func (g *GPUSwapChain) Setup(window RenderingContainer, inst *GPUApplicationInstance, device *GPUDevice) error
GPUSwapChain.SetupImageViews
GPUSwapChain.SetupRenderPass
GPUSwapChain.SetupSyncObjects
GlobalShaderData
struct
type GlobalShaderData struct {
View matrix.Mat4
Projection matrix.Mat4
UIView matrix.Mat4
UIProjection matrix.Mat4
CameraPosition matrix.Vec4
UICameraPosition matrix.Vec3
Time float32
ScreenSize matrix.Vec2
CascadeCount int32
CascadePlaneDistances [4]float32
VertLights [MaxLocalLights]GPULight
LightInfos [MaxLocalLights]GPULightInfo
// Has unexported fields.
}
InstanceBufferCapacity
struct
InstanceBufferCapacity.Capacity
InstanceBufferCapacity.Commit
InstanceBufferCapacity.Ensure
InstanceBufferCapacity.Next
InstanceBufferCapacity.Reset
InstanceCopyData
struct
InstanceCopyDataNew
InstanceDriverData
struct
InstanceGroupSkinningData
struct
Light
struct
NewLight
NewLight only initializes CPU-side light state. Shadow render passes are renderer-owned shared resources and must never be constructed while an editor entity is being attached.
Light.CastsShadows
Light.Direction
Light.FrameDirty
Light.IsValid
Light.ResetFrameDirty
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.Type
Light.WorldSpace
LightShadowShaderData
struct
LightShadowShaderData.SelectLights
LightShadowShaderData.Size
LightType
LightsForRender
struct
Material
struct
type Material struct {
Id string
Shader *Shader
Textures []*Texture
Instances map[string]*Material
ViewModeOverrides map[RenderViewMode]*Material
Root weak.Pointer[Material]
PrepassMaterial weak.Pointer[Material]
IsLit bool
ReceivesShadows bool
CastsShadows bool
// Has unexported fields.
}
Material.CreateInstance
Material.Destroy
Material.HasTransparentSuffix
Material.RenderPass
Material.RenderViewModeOverride
Material.RenderViewModeOverrideCompatible
Material.SelectRoot
Material.SetRenderViewModeOverride
MaterialCache
struct
NewMaterialCache
MaterialCache.AddMaterial
MaterialCache.Destroy
MaterialCache.FindMaterial
MaterialCache.Material
MaterialCache.RemoveMaterial
MaterialCache.ReplaceMaterial
MaterialCache.SetDeviceCall
MaterialData
struct
type MaterialData struct {
Shader string `options:""` // Blank = fallback
RenderPass string `options:""` // Blank = fallback
ShaderPipeline string `options:"" label:"Pipeline"` // Blank = fallback
Textures []MaterialTextureData
PrepassMaterial string
ViewModeOverrides map[string]string
IsLit bool
ReceivesShadows bool
CastsShadows bool
}
MaterialData.Compile
MaterialData.CompileExt
func (d *MaterialData) CompileExt(assets assets.Database, device *GPUDevice, copyShader bool) (*Material, error)
MaterialTextureData
struct
type MaterialTextureData struct {
Label string `static:"true"`
Texture string `content:"Texture"`
Filter string `options:"StringVkFilter"`
}
MaterialTextureData.FilterToVK
Mesh
struct
NewDynamicMesh
NewMesh
NewMeshArrow
func NewMeshArrow(cache *MeshCache, shaftLength, shaftRadius, tipHeight, tipRadius float32, segments int) *Mesh
NewMeshArrowWithTransform
func NewMeshArrowWithTransform(cache *MeshCache, shaftLength, shaftRadius, tipHeight, tipRadius float32, segments int, transform matrix.Mat4, uid string) *Mesh
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.
NewMeshCircleWire
NewMeshCircleWire creates a wireframe circle (line loop) mesh. It follows the same pattern as the other wireframe mesh generators (e.g. NewMeshWireCube, NewMeshWireSphereLatLon, etc.).
NewMeshCone
NewMeshCube
NewMeshCubeInverse
NewMeshCylinder
NewMeshFrustum
NewMeshFrustumBox
NewMeshGrid
NewMeshLine
NewMeshOffsetQuad
NewMeshPlane
NewMeshPoint
NewMeshPrimitive
NewMeshQuad
NewMeshQuadAnchored
NewMeshScreenQuad
NewMeshSkyboxCube
NewMeshSphere
NewMeshTexturableCube
NewMeshTriangle
NewMeshUnitQuad
NewMeshWireCone
NewMeshWireCube
NewMeshWireCylinder
func NewMeshWireCylinder(cache *MeshCache, radius, height float32, segments, heightSegments int) *Mesh
NewMeshWireQuad
NewMeshWireSphere
Mesh.Bounds
Mesh.DelayedCreate
Mesh.GenerateLODs
Mesh.IsReady
Mesh.Key
Mesh.SetKey
Mesh.SetPendingVertices
MeshCache
struct
NewMeshCache
MeshCache.AddMesh
Try to add the mesh to the cache, if it already exists, return the existing mesh
MeshCache.Destroy
MeshCache.DynamicMesh
DynamicMesh creates or retrieves a mesh backed by a HOST_VISIBLE vertex buffer, suitable for frequent CPU updates without GPU synchronization.
MeshCache.FindMesh
MeshCache.Mesh
MeshCache.ProcessPending
MeshCache.RemoveMesh
RemoveMesh evicts a mesh from the cache and reclaims its GPU memory. The mesh handle (if it has already been created) is queued into pendingFree so ProcessPending destroys it on the next frame, and any still-queued creation for the mesh is dropped so an evicted mesh is never created after removal. Callers must ensure no live Drawing still references the mesh.
MeshCache.SetLodGenerator
MeshCache.UpdateMeshVertices
UpdateMeshVertices queues a vertex data re-upload for an existing mesh. The vertex count must match the original. The update is processed in the next CreatePending call alongside new mesh creations.
MeshCleanup
struct
MeshCullMode
const ( MeshCullModeBack MeshCullMode = iota MeshCullModeFront MeshCullModeNone )
MeshDrawMode
const ( MeshDrawModePoints MeshDrawMode = iota MeshDrawModeLines MeshDrawModeTriangles MeshDrawModePatches )
MeshId
struct
MeshId.IndexCount
MeshId.IsValid
MeshId.VertexCount
MeshLODInstance
struct
MeshLod
struct
MeshLod.IsValid
MeshLodGenerator
interface
type MeshLodGenerator interface {
GenerateLods(mesh *Mesh, cache *MeshCache, verts []Vertex, indices []uint32, levels int) (MeshLod, error)
}
MeshLodGeneratorQem
struct
NewMeshLodGeneratorQem
MeshLodGeneratorQem.GenerateLods
func (g *MeshLodGeneratorQem) GenerateLods(mesh *Mesh, cache *MeshCache, verts []Vertex, indices []uint32, levels int) (MeshLod, error)
generateMeshLOD builds a set of level-of-detail meshes for the given source mesh using Quadric Error Metric (QEM) simplification.
The result is a MeshLod whose Level 0 is always the full-resolution source mesh, followed by levels 1..levels-1 whose triangle counts fall off power-of-two (see selectMeshLodRatios): level i has ratio 1.0/2^i.
Generation happens at runtime (rather than being pre-baked offline) so that content loaded from player mods can be simplified on demand. The algorithm chunks the mesh once (quadricErrorMetricChunkify), simplifies each chunk progressively in parallel, snapshots every requested level, and welds each set of chunk snapshots back into a watertight mesh (stitchQemChunks).
The computed LODs are cached on mesh so repeated calls return the same set. verts and indices describe the full-resolution geometry; if a level cannot be reduced, that level falls back to reusing the source mesh itself.
MeshQem
struct
MeshQemChunk
struct
MeshQemChunk is a self-contained, spatially-local slice of a mesh that can be simplified independently (typically on its own thread) after chunking.
Chunking happens at runtime so that content loaded from player mods can be simplified on the fly without pre-baking LODs into the asset. Each chunk owns private copies of its geometry so that multiple chunks can be processed in parallel without sharing (and racing on) the source buffers.
Inputs populated by chunkify: - positions: the chunk's vertices, compacted to [0, len(positions)). - normals: the corresponding source normals, used to preserve face orientation while validating collapses. - indices: the chunk's triangles, remapped into local position space. - sourceIndices: the original attribute vertex for each triangle corner. - boundary: for each local position, whether it lies on the chunk's outer border. Border vertices are shared with neighboring chunks and MUST be held fixed during simplification so adjacent chunks stay watertight and no seams appear when the results are stitched back together. - globalIndices: for each local position, its welded geometry index in the full mesh. Used to weld chunks back together. - targetTriangles: the triangle budget this chunk should collapse down to, derived from the requested simplification ratio.
Outputs populated by processChunk: - quadrics: the per-vertex QEM matrices (len == len(positions)). - resultIndices: the simplified triangle list, referencing local position indices, ready to be merged with the other chunks' results. - resultSources: the original attribute vertex for each result corner.
PointShadow
struct
PrimitiveMesh
const ( PrimitiveMeshSphere PrimitiveMesh = "sphere_1.00_32_32" PrimitiveMeshTexturableCube PrimitiveMesh = "texturable_cube" PrimitiveMeshCapsule PrimitiveMesh = "capsule_0.50_1.00_32_8" PrimitiveMeshPlane PrimitiveMesh = "plane" PrimitiveMeshCylinder PrimitiveMesh = "cylinder_1.00_0.50_32_true" PrimitiveMeshCone PrimitiveMesh = "cone_1.00_0.50_32_true" PrimitiveMeshArrow PrimitiveMesh = "arrow_0.75_0.05_0.25_0.15_32_" )
QuadPivot
QueuedCommandSubmitter
struct
QueuedCommandSubmitter.QueuedCommandCount
QueuedCommandSubmitter.SubmitAndWaitForReadback
QueuedCommandSubmitter.SubmitForPresent
func (s QueuedCommandSubmitter) SubmitForPresent(waitSemaphores []vk.Semaphore, waitStages []vk.PipelineStageFlags, signalSemaphores []vk.Semaphore, fence vk.Fence) bool
RenderCaches
interface
type RenderCaches interface {
ShaderCache() *ShaderCache
TextureCache() *TextureCache
MeshCache() *MeshCache
FontCache() *FontCache
MaterialCache() *MaterialCache
AssetDatabase() assets.Database
}
RenderLayer
const ( RenderLayerIndexWorld RenderLayer = iota RenderLayerIndexUI RenderLayerIndexEditor RenderLayerIndexEditorPicking RenderLayerIndexEditorGizmoPicking )
RenderLayer.Mask
RenderLayerMask
const ( RenderLayerWorld RenderLayerMask = 1 << RenderLayerIndexWorld RenderLayerUI RenderLayerMask = 1 << RenderLayerIndexUI RenderLayerEditor RenderLayerMask = 1 << RenderLayerIndexEditor RenderLayerEditorPicking RenderLayerMask = 1 << RenderLayerIndexEditorPicking RenderLayerEditorGizmoPicking RenderLayerMask = 1 << RenderLayerIndexEditorGizmoPicking RenderLayerAll RenderLayerMask = RenderLayerWorld | RenderLayerUI | RenderLayerEditor )
RenderPass
struct
type RenderPass struct {
Handle vk.RenderPass
Buffer gpu_types.FrameBuffer
// Has unexported fields.
}
NewRenderPass
RenderPass.Destroy
RenderPass.ExecuteSecondaryCommands
RenderPass.Height
RenderPass.IsShadowPass
RenderPass.Recontstruct
RenderPass.SelectOutputAttachment
RenderPass.SelectOutputAttachmentWithSuffix
RenderPass.Texture
RenderPass.Width
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.FinalLayoutToGpu
RenderPassAttachmentDescription.FormatToGpu
RenderPassAttachmentDescription.InitialLayoutToGpu
RenderPassAttachmentDescription.LoadOpToGpu
RenderPassAttachmentDescription.SamplesToGpu
func (ad *RenderPassAttachmentDescription) SamplesToGpu(device *GPUPhysicalDevice) gpu_types.SampleCountFlags
RenderPassAttachmentDescription.StencilLoadOpToGpu
RenderPassAttachmentDescription.StencilStoreOpToGpu
RenderPassAttachmentDescription.StoreOpToGpu
RenderPassAttachmentDescriptionCompiled
struct
type RenderPassAttachmentDescriptionCompiled struct {
Format gpu_types.Format
Samples gpu_types.SampleCountFlags
LoadOp gpu_types.AttachmentLoadOp
StoreOp gpu_types.AttachmentStoreOp
StencilLoadOp gpu_types.AttachmentLoadOp
StencilStoreOp gpu_types.AttachmentStoreOp
InitialLayout gpu_types.ImageLayout
FinalLayout gpu_types.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.AccessToGpu
RenderPassAttachmentImage.AspectToGpu
RenderPassAttachmentImage.FilterToGpu
RenderPassAttachmentImage.IsInvalid
RenderPassAttachmentImage.MemoryPropertyToGpu
RenderPassAttachmentImage.TilingToGpu
RenderPassAttachmentImage.UsageToGpu
RenderPassAttachmentImageClear
struct
type RenderPassAttachmentImageClear struct {
R float32
G float32
B float32
A float32
Depth float32
Stencil uint32
IsDepth bool
}
RenderPassAttachmentImageCompiled
struct
type RenderPassAttachmentImageCompiled struct {
Name string
ExistingImage string
MipLevels uint32
LayerCount uint32
Tiling gpu_types.ImageTiling
Filter gpu_types.Filter
Usage gpu_types.ImageUsageFlags
MemoryProperty gpu_types.MemoryPropertyFlags
Aspect gpu_types.ImageAspectFlags
Access gpu_types.AccessFlags
}
RenderPassAttachmentImageCompiled.IsInvalid
RenderPassAttachmentReference
struct
type RenderPassAttachmentReference struct {
Attachment uint32
Layout string `options:"StringVkImageLayout"`
}
RenderPassAttachmentReference.LayoutToGpu
RenderPassAttachmentReferenceCompiled
struct
type RenderPassAttachmentReferenceCompiled struct {
Attachment uint32
Layout gpu_types.ImageLayout
}
RenderPassCommandSet
struct
RenderPassData
struct
type RenderPassData struct {
Name string
Sort int
AttachmentDescriptions []RenderPassAttachmentDescription
SubpassDescriptions []RenderPassSubpassDescription
SubpassDependencies []RenderPassSubpassDependency
Width int
Height int
SkipCombine bool
}
NewRenderPassData
RenderPassData.Compile
RenderPassDataCompiled
struct
type RenderPassDataCompiled struct {
Name string
Sort int
Width int
Height int
AttachmentDescriptions []RenderPassAttachmentDescriptionCompiled
SubpassDescriptions []RenderPassSubpassDescriptionCompiled
SubpassDependencies []RenderPassSubpassDependencyCompiled
ImageClears []RenderPassAttachmentImageClear
Subpass []RenderPassSubpassDataCompiled
SkipCombine bool
}
RenderPassDataCompiled.ConstructRenderPass
RenderPassGroup
struct
RenderPassGroup.MatchesLayer
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.DependencyFlagsToGpu
RenderPassSubpassDependency.DstAccessMaskToGpu
RenderPassSubpassDependency.DstStageMaskToGpu
RenderPassSubpassDependency.SrcAccessMaskToGpu
RenderPassSubpassDependency.SrcStageMaskToGpu
RenderPassSubpassDependencyCompiled
struct
type RenderPassSubpassDependencyCompiled struct {
SrcSubpass uint32
DstSubpass uint32
SrcStageMask gpu_types.PipelineStageFlags
DstStageMask gpu_types.PipelineStageFlags
SrcAccessMask gpu_types.AccessFlags
DstAccessMask gpu_types.AccessFlags
DependencyFlags gpu_enums.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.PipelineBindPointToGpu
RenderPassSubpassDescriptionCompiled
struct
type RenderPassSubpassDescriptionCompiled struct {
PipelineBindPoint gpu_enums.PipelineBindPoint
ColorAttachmentReferences []RenderPassAttachmentReferenceCompiled
InputAttachmentReferences []RenderPassAttachmentReferenceCompiled
ResolveAttachments []RenderPassAttachmentReferenceCompiled
DepthStencilAttachment []RenderPassAttachmentReferenceCompiled // 1 max
PreserveAttachments []uint32 // TODO
}
RenderPassSubpassImageData
struct
RenderTarget
struct
RenderTarget.Destroyed
RenderTarget.Height
RenderTarget.Name
RenderTarget.Options
RenderTarget.Resize
RenderTarget.ResizeDirty
RenderTarget.Size
RenderTarget.Texture
RenderTarget.Width
RenderTargetManager
struct
NewRenderTargetManager
RenderTargetManager.Create
RenderTargetManager.Destroy
RenderTargetManager.DestroyAll
RenderTargetManager.ProcessPending
RenderTargetManager.ResizeMatchingWindow
RenderTargetManager.Target
RenderTargetManager.Targets
RenderTargetOptions
struct
type RenderTargetOptions struct {
Name string
Width int
Height int
ResizeMode RenderTargetResizeMode
ColorFormat gpu_types.Format
Depth bool
}
RenderTargetResizeMode
const ( RenderTargetResizeModeFixed RenderTargetResizeMode = iota RenderTargetResizeModeMatchWindow )
RenderView
struct
RenderView.Camera
RenderView.Clear
RenderView.Destroyed
RenderView.Enabled
RenderView.LayerMask
RenderView.MatchesDrawing
RenderView.MatchesGroup
RenderView.Name
RenderView.Options
RenderView.SetCamera
RenderView.SetEnabled
RenderView.SetViewMode
RenderView.Sort
RenderView.Target
RenderView.ViewMode
RenderViewFrame
struct
type RenderViewFrame struct {
View *RenderView
Options RenderViewOptions
Order uint64
Enabled bool
Destroyed bool
}
RenderViewFrame.Camera
RenderViewFrame.Clear
RenderViewFrame.IsDestroyed
RenderViewFrame.IsEnabled
RenderViewFrame.Key
RenderViewFrame.LayerMask
RenderViewFrame.Name
RenderViewFrame.Sort
RenderViewFrame.Target
RenderViewFrame.ViewMode
RenderViewManager
struct
NewRenderViewManager
RenderViewManager.Create
RenderViewManager.Default
RenderViewManager.Destroy
RenderViewManager.DestroyAll
RenderViewManager.FrameViews
RenderViewManager.ProcessPending
RenderViewManager.ReplaceDefault
RenderViewManager.SetDefaultCamera
RenderViewManager.View
RenderViewManager.Views
RenderViewMode
const ( RenderViewModeNormal RenderViewMode = iota RenderViewModeWireframe RenderViewModeUnlit RenderViewModeProfile
RenderViewModeDefault = RenderViewModeNormal )
ParseRenderViewMode
RenderViewMode.String
RenderViewMode.Valid
RenderViewModeSelection
struct
type RenderViewModeSelection struct {
Mode RenderViewMode
Material *Material
PipelineOverride RenderViewPipelineOverride
}
ResolveRenderViewModeSelection
func ResolveRenderViewModeSelection(view *RenderView, material *Material, features GPUPhysicalDeviceFeatures) RenderViewModeSelection
ResolveRenderViewModeSelectionForMode
func ResolveRenderViewModeSelectionForMode(mode RenderViewMode, material *Material, features GPUPhysicalDeviceFeatures) RenderViewModeSelection
RenderViewOptions
struct
type RenderViewOptions struct {
Name string
Target *RenderTarget
Camera any
LayerMask RenderLayerMask
Clear bool
Sort int
ViewMode RenderViewMode
}
RenderViewPipelineOverride
const ( RenderViewPipelineOverrideNone RenderViewPipelineOverride = iota RenderViewPipelineOverrideWireframe )
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
Type ShaderType
// Has unexported fields.
}
NewShader
Shader.AddSubShader
Shader.DelayedCreate
Shader.DrawInstanceDataName
Shader.Reload
Shader.RemoveSubShader
Shader.ShaderDataName
Shader.SubShader
ShaderBuffer
struct
ShaderCache
struct
NewShaderCache
ShaderCache.AddShader
ShaderCache.CreatePending
ShaderCache.Destroy
ShaderCache.ReloadShader
ShaderCache.Shader
ShaderCleanup
struct
ShaderData
struct
type ShaderData struct {
Name string
DrawInstanceData string `label:"Draw Instance Data"`
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"`
Compute string `options:""`
ComputeFlags string `tip:"CompileFlags"`
LayoutGroups []ShaderLayoutGroup `visible:"false"`
SamplerLabels []string
VertexSpv string
FragmentSpv string
GeometrySpv string
TessellationControlSpv string
TessellationEvaluationSpv string
ComputeSpv string
}
ShaderData.Compile
ShaderData.DrawInstanceDataName
ShaderDataBase
struct
NewShaderDataBase
ShaderDataBase.Activate
ShaderDataBase.Base
ShaderDataBase.BoundDataPointer
ShaderDataBase.CancelDestroy
ShaderDataBase.DataPointer
ShaderDataBase.Deactivate
ShaderDataBase.Destroy
ShaderDataBase.InstanceBoundDataSize
ShaderDataBase.IsDestroyed
ShaderDataBase.IsInView
ShaderDataBase.IsInViewForView
ShaderDataBase.Model
ShaderDataBase.ModelPtr
ShaderDataBase.SelectLights
ShaderDataBase.SetModel
ShaderDataBase.Setup
ShaderDataBase.SkinningHeader
ShaderDataBase.Transform
ShaderDataBase.UpdateBoundData
ShaderDataBase.UpdateModel
ShaderDataBase.UpdateModelForView
func (s *ShaderDataBase) UpdateModelForView(view *RenderView, viewCuller ViewCuller, container graviton.AABB) bool
ShaderDataCombine
struct
ShaderDataCombine.Size
ShaderDataCompiled
struct
type ShaderDataCompiled struct {
Name string
DrawInstanceData string
Vertex string
Fragment string
Geometry string
TessellationControl string
TessellationEvaluation string
Compute string
LayoutGroups []ShaderLayoutGroup
SamplerLabels []string
}
ShaderDataCompiled.DrawInstanceDataName
ShaderDataCompiled.IsCompute
ShaderDataCompiled.RenderViewModeCompatible
ShaderDataCompiled.SelectLayout
ShaderDataCompiled.Stride
ShaderDataCompiled.ToAttributeDescription
func (sd *ShaderDataCompiled) ToAttributeDescription(locationStart uint32) []vk.VertexInputAttributeDescription
ShaderDataCompiled.ToDescriptorSetLayoutStructure
ShaderDataCompiled.WorkGroups
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, buffer
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.LogicOpToGPU
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.AlphaBlendOpToGPU
ShaderPipelineColorBlendAttachments.AlphaBlendOpToVK
ShaderPipelineColorBlendAttachments.ColorBlendOpToGPU
ShaderPipelineColorBlendAttachments.ColorBlendOpToVK
ShaderPipelineColorBlendAttachments.ColorWriteMaskToGPU
ShaderPipelineColorBlendAttachments.ColorWriteMaskToVK
func (a *ShaderPipelineColorBlendAttachments) ColorWriteMaskToVK() vulkan_const.ColorComponentFlagBits
ShaderPipelineColorBlendAttachments.DstAlphaBlendFactorToGPU
ShaderPipelineColorBlendAttachments.DstAlphaBlendFactorToVK
ShaderPipelineColorBlendAttachments.DstColorBlendFactorToGPU
ShaderPipelineColorBlendAttachments.DstColorBlendFactorToVK
ShaderPipelineColorBlendAttachments.ListAlphaBlendOp
ShaderPipelineColorBlendAttachments.ListColorBlendOp
ShaderPipelineColorBlendAttachments.ListDstAlphaBlendFactor
ShaderPipelineColorBlendAttachments.ListDstColorBlendFactor
ShaderPipelineColorBlendAttachments.ListSrcAlphaBlendFactor
ShaderPipelineColorBlendAttachments.ListSrcColorBlendFactor
ShaderPipelineColorBlendAttachments.SrcAlphaBlendFactorToGPU
ShaderPipelineColorBlendAttachments.SrcAlphaBlendFactorToVK
ShaderPipelineColorBlendAttachments.SrcColorBlendFactorToGPU
ShaderPipelineColorBlendAttachments.SrcColorBlendFactorToVK
ShaderPipelineColorBlendAttachmentsCompiled
struct
type ShaderPipelineColorBlendAttachmentsCompiled struct {
BlendEnable bool
SrcColorBlendFactor gpu_enums.BlendFactor
DstColorBlendFactor gpu_enums.BlendFactor
ColorBlendOp gpu_enums.BlendOp
SrcAlphaBlendFactor gpu_enums.BlendFactor
DstAlphaBlendFactor gpu_enums.BlendFactor
AlphaBlendOp gpu_enums.BlendOp
ColorWriteMask gpu_enums.ColorComponentFlags
}
ShaderPipelineColorBlendCompiled
struct
type ShaderPipelineColorBlendCompiled struct {
LogicOpEnable bool
LogicOp gpu_enums.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
PushConstant ShaderPipelinePushConstant
}
ShaderPipelineData.AlphaToCoverageEnableToVK
ShaderPipelineData.AlphaToOneEnableToVK
ShaderPipelineData.BackStencilOpStateToGPU
ShaderPipelineData.BackStencilOpStateToVK
ShaderPipelineData.BlendConstants
ShaderPipelineData.Compile
ShaderPipelineData.DepthBiasEnableToVK
ShaderPipelineData.DepthBoundsTestEnableToVK
ShaderPipelineData.DepthClampEnableToVK
ShaderPipelineData.DepthTestEnableToVK
ShaderPipelineData.DepthWriteEnableToVK
ShaderPipelineData.FrontStencilOpStateToGPU
TODO: This and the BackStencilOpStateToGPU are duplicates because of a bad structure setup, please fix later
ShaderPipelineData.FrontStencilOpStateToVK
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
PushConstant ShaderPipelinePushConstantCompiled
}
ShaderPipelineDataCompiled.ConstructPipeline
func (s *ShaderPipelineDataCompiled) ConstructPipeline(device *GPUDevice, 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 bool
DepthWriteEnable bool
DepthCompareOp gpu_enums.CompareOp
DepthBoundsTestEnable bool
StencilTestEnable bool
Front gpu_enums.StencilOpState
Back gpu_enums.StencilOpState
MinDepthBounds float32
MaxDepthBounds float32
}
ShaderPipelineGraphicsPipeline
struct
type ShaderPipelineGraphicsPipeline struct {
Subpass uint32
PipelineCreateFlags []string `options:"StringVkPipelineCreateFlagBits"`
}
ShaderPipelineGraphicsPipeline.PipelineCreateFlagsToGPU
ShaderPipelineGraphicsPipeline.PipelineCreateFlagsToVK
ShaderPipelineGraphicsPipelineCompiled
struct
type ShaderPipelineGraphicsPipelineCompiled struct {
Subpass uint32
PipelineCreateFlags gpu_enums.PipelineCreateFlags
}
ShaderPipelineInputAssembly
struct
type ShaderPipelineInputAssembly struct {
Topology string `options:"StringVkPrimitiveTopology"`
PrimitiveRestart bool
}
ShaderPipelineInputAssembly.TopologyToGPU
ShaderPipelineInputAssembly.TopologyToVK
ShaderPipelineInputAssemblyCompiled
struct
type ShaderPipelineInputAssemblyCompiled struct {
Topology gpu_enums.PrimitiveTopology
PrimitiveRestart bool
}
ShaderPipelinePipelineMultisample
struct
type ShaderPipelinePipelineMultisample struct {
RasterizationSamples string `options:"StringVkSampleCountFlagBits"`
SampleShadingEnable bool
MinSampleShading float32
AlphaToCoverageEnable bool
AlphaToOneEnable bool
}
ShaderPipelinePipelineMultisample.RasterizationSamplesToGPU
func (s *ShaderPipelinePipelineMultisample) RasterizationSamplesToGPU(device *GPUPhysicalDevice) gpu_types.SampleCountFlags
ShaderPipelinePipelineMultisample.RasterizationSamplesToVK
func (s *ShaderPipelinePipelineMultisample) RasterizationSamplesToVK(device *GPUPhysicalDevice) gpu_types.SampleCountFlags
ShaderPipelinePipelineMultisampleCompiled
struct
type ShaderPipelinePipelineMultisampleCompiled struct {
RasterizationSamples gpu_types.SampleCountFlags
SampleShadingEnable bool
MinSampleShading float32
AlphaToCoverageEnable bool
AlphaToOneEnable bool
}
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.CullModeToGPU
ShaderPipelinePipelineRasterization.CullModeToVK
ShaderPipelinePipelineRasterization.FrontFaceToGPU
ShaderPipelinePipelineRasterization.FrontFaceToVK
ShaderPipelinePipelineRasterization.PolygonModeToGPU
ShaderPipelinePipelineRasterization.PolygonModeToVK
ShaderPipelinePipelineRasterizationCompiled
struct
type ShaderPipelinePipelineRasterizationCompiled struct {
DepthClampEnable bool
DiscardEnable bool
PolygonMode gpu_enums.PolygonMode
CullMode gpu_enums.CullModeFlags
FrontFace gpu_enums.FrontFace
DepthBiasEnable bool
DepthBiasConstantFactor float32
DepthBiasClamp float32
DepthBiasSlopeFactor float32
LineWidth float32
}
ShaderPipelinePushConstant
struct
type ShaderPipelinePushConstant struct {
Size uint32
StageFlags []string `options:"StringVkAccessFlagBits"`
}
ShaderPipelinePushConstant.ShaderStageFlagsToGPU
ShaderPipelinePushConstant.ShaderStageFlagsToVK
ShaderPipelinePushConstantCompiled
struct
type ShaderPipelinePushConstantCompiled struct {
Size uint32
StageFlags gpu_enums.ShaderStageFlags
}
ShaderPipelineTessellation
struct
type ShaderPipelineTessellation struct {
PatchControlPoints string `options:"StringVkPatchControlPoints"`
}
ShaderPipelineTessellation.PatchControlPointsToGPU
ShaderPipelineTessellation.PatchControlPointsToVK
ShaderPipelineTessellationCompiled
struct
ShaderType
const ( ShaderTypeGraphics ShaderType = iota ShaderTypeCompute )
SkinnedShaderDataHeader
struct
SkinnedShaderDataHeader.BoneByIndex
SkinnedShaderDataHeader.CreateBones
SkinnedShaderDataHeader.FindBone
SkinnedShaderDataHeader.HasBones
SkinnedShaderDataHeader.SkinNamedDataInstanceSize
SkinnedShaderDataHeader.SkinNamedDataPointer
SkinnedShaderDataHeader.SkinUpdateNamedData
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 {
TextureId
Key string
TexturePixelCache []byte
Filter int
// Has unexported fields.
}
NewTexture
NewTextureFromImage
NewTextureFromMemory
func NewTextureFromMemory(key string, data []byte, width, height int, filter textures.Filter) (*Texture, error)
Texture.DelayedCreate
Texture.DelayedCreateInBatch
Texture.ReadAllPixels
Texture.ReadPendingDataForTransparency
Texture.ReadPixel
Texture.ReadPixelRegion
Texture.Reload
Texture.SetPendingDataDimensions
Texture.Size
Texture.WritePixels
TextureCache
struct
NewTextureCache
TextureCache.Destroy
Destroy frees all textures in the cache and clears the decoded texture data cache to release GPU and memory resources when the texture cache is no longer needed. This should be called when the application is shutting down or when the texture cache needs to be reset to ensure proper cleanup of resources.
TextureCache.Find
TextureCache.ForceRemoveTexture
ForceRemoveTexture evicts a texture from the cache and reclaims its GPU memory. The texture's RenderId (if it has already been uploaded) is queued into pendingFree so ProcessPending frees it on the next frame, and any still-queued upload for the texture is dropped so an evicted texture is never uploaded after removal.
TextureCache.InsertImageTexture
func (t *TextureCache) InsertImageTexture(key string, imageData []byte, filter textures.Filter) (*Texture, error)
InsertImageTexture creates a texture from raw image data and caches it efficiently
TextureCache.InsertImageTextureWithPriority
func (t *TextureCache) InsertImageTextureWithPriority(key string, imageData []byte, filter textures.Filter, priority TextureUploadPriority) (*Texture, error)
TextureCache.InsertRawTexture
func (t *TextureCache) InsertRawTexture(key string, data []byte, width, height int, filter textures.Filter) (*Texture, error)
InsertRawTexture creates a texture directly from raw data and caches it without needing to read from the asset database This is useful for dynamically generated textures or when the raw data is already available in memory, caching without redundant file I/O.
TextureCache.InsertRawTextureWithPriority
func (t *TextureCache) InsertRawTextureWithPriority(key string, data []byte, width, height int, filter textures.Filter, priority TextureUploadPriority) (*Texture, error)
TextureCache.InsertTexture
TextureCache.InsertTextureWithPriority
TextureCache.ProcessPending
TextureCache.ReloadTexture
ReloadTexture forces a reload of the texture data for the given texture key and filter, bypassing the cache. And invalidates the cached decoded data to ensure the next load will read fresh data from the asset database.
TextureCache.SetUploadBudget
TextureCache.Texture
TextureCache.TexturePixels
func (t *TextureCache) TexturePixels(textureKey string, filter textures.Filter) (textures.TextureData, error)
TexturePixels returns decoded CPU pixels from a pending cached texture when available, falling back to the cache's asset database. This allows generated textures such as terrain atlases to consume content before its GPU upload.
TextureCache.TextureWithPriority
func (t *TextureCache) TextureWithPriority(textureKey string, filter textures.Filter, priority TextureUploadPriority) (*Texture, error)
TextureCleanup
struct
TextureId
struct
type TextureId struct {
Image gpu_types.Image
Memory gpu_types.DeviceMemory
View gpu_types.ImageView
Sampler gpu_types.Sampler
Format gpu_types.Format
MipLevels uint32
Layout gpu_types.ImageLayout
Access gpu_types.AccessFlags
Samples gpu_types.SampleCountFlags
Width int
Height int
LayerCount int
}
TextureId.IsValid
TextureUploadBatch
struct
TextureUploadBatch.DeferCleanup
TextureUploadBatch.End
TextureUploadBudget
struct
TextureUploadPriority
const ( TextureUploadPriorityNormal TextureUploadPriority = iota TextureUploadPriorityHigh )
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
}
BuiltInMeshData
MeshPlaneData
MeshQuadData
ViewCuller
interface