Skip to content

package rendering

import "kaijuengine.com/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

14.0

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

func DefaultSwapChainClearColor() matrix.Color

DefaultSwapChainClearColor returns the engine's built-in presented background color used before a game supplies its own.

LinkDrawInstanceLifecycle

func LinkDrawInstanceLifecycle(owner, follower DrawInstance)

SetupLightMaterials

func SetupLightMaterials(materialCache *MaterialCache) error

TextureKeys

func TextureKeys(textures []*Texture) []string

TexturePixelsFromAsset

func TexturePixelsFromAsset(assetDb assets.Database, key string) (textures.TextureData, error)

VertexFaceNormal

func VertexFaceNormal(verts [3]Vertex) matrix.Vec3

Types

BoneTransform

struct

type BoneTransform struct {
    Id        int32
    Transform matrix.Transform
    Skin      matrix.Mat4
}

CommandRecorder

struct

type CommandRecorder struct {
    // Has unexported fields.
}

NewCommandRecorder

func NewCommandRecorder(device *GPUDevice) (CommandRecorder, error)

CommandRecorder.Begin

func (c *CommandRecorder) Begin()

CommandRecorder.Destroy

func (c *CommandRecorder) Destroy(device *GPUDevice)

CommandRecorder.End

func (c *CommandRecorder) End()

CommandRecorder.Reset

func (c *CommandRecorder) Reset()

CommandRecorderSecondary

struct

type CommandRecorderSecondary struct {
    CommandRecorder

    // Has unexported fields.
}

NewCommandRecorderSecondary

func NewCommandRecorderSecondary(device *GPUDevice, rp *RenderPass, subpassIdx int) (CommandRecorderSecondary, error)

CommandRecorderSecondary.Begin

func (c *CommandRecorderSecondary) Begin(viewport vk.Viewport, scissor vk.Rect2D)

ComputeShaderBuffer

struct

type ComputeShaderBuffer struct {
    ShaderBuffer
    Shader *Shader

    // Has unexported fields.
}

ComputeShaderBuffer.Initialize

func (b *ComputeShaderBuffer) Initialize(device *GPUDevice, size uintptr, usage gpu_types.BufferUsageFlags, properties gpu_types.MemoryPropertyFlags) error

ComputeShaderBuffer.WriteDescriptors

func (b *ComputeShaderBuffer) WriteDescriptors(device *GPUDevice)

ComputeTask

struct

type ComputeTask struct {
    Shader         *Shader
    DescriptorSets []gpu_types.DescriptorSet
    WorkGroups     [3]uint32
}

DescriptorSetLayoutStructure

struct

type DescriptorSetLayoutStructure struct {
    Types []DescriptorSetLayoutStructureType
}

DescriptorSetLayoutStructureType

struct

type DescriptorSetLayoutStructureType struct {
    Type           vulkan_const.DescriptorType
    Flags          vulkan_const.ShaderStageFlagBits
    Count, Binding uint32
}

DescriptorWriteCache

struct

type DescriptorWriteCache struct {
    // Has unexported fields.
}

DescriptorWriteCache.Invalidate

func (c *DescriptorWriteCache) Invalidate()

DescriptorWriteCache.ShouldWrite

func (c *DescriptorWriteCache) ShouldWrite(frame int, signature DescriptorWriteSignature) bool

DescriptorWriteSignature

struct

type DescriptorWriteSignature struct {
    // Has unexported fields.
}

NewDescriptorWriteSignature

func NewDescriptorWriteSignature() DescriptorWriteSignature

DescriptorWriteSignature.AddHandle

func (s *DescriptorWriteSignature) AddHandle(handle gpu_types.GpuHandle)

DescriptorWriteSignature.AddInt

func (s *DescriptorWriteSignature) AddInt(value int)

DescriptorWriteSignature.AddPointer

func (s *DescriptorWriteSignature) AddPointer(value unsafe.Pointer)

DescriptorWriteSignature.AddString

func (s *DescriptorWriteSignature) AddString(value string)

DescriptorWriteSignature.AddUint64

func (s *DescriptorWriteSignature) AddUint64(value uint64)

DescriptorWriteSignature.AddUintptr

func (s *DescriptorWriteSignature) AddUintptr(value uintptr)

DescriptorWriteSignature.Equal

func (s DescriptorWriteSignature) Equal(other DescriptorWriteSignature) bool

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

func ReflectDuplicateDrawInstance(target DrawInstance) DrawInstance

DrawInstanceFrameData

struct

type DrawInstanceFrameData struct {
    // Has unexported fields.
}

DrawInstanceGroup

struct

type DrawInstanceGroup struct {
    Mesh *Mesh
    InstanceDriverData
    MaterialInstance *Material
    Layer            RenderLayerMask

    Instances []DrawInstance

    // Has unexported fields.
}

NewDrawInstanceGroup

func NewDrawInstanceGroup(mesh *Mesh, dataSize int, viewCuller ViewCuller) DrawInstanceGroup

DrawInstanceGroup.AddInstance

func (d *DrawInstanceGroup) AddInstance(instance DrawInstance)

DrawInstanceGroup.AlterPadding

func (d *DrawInstanceGroup) AlterPadding(blockSize int)

DrawInstanceGroup.AnyVisible

func (d *DrawInstanceGroup) AnyVisible() bool

DrawInstanceGroup.AnyVisibleForView

func (d *DrawInstanceGroup) AnyVisibleForView(view *RenderView) bool

DrawInstanceGroup.CaptureDataForView

func (d *DrawInstanceGroup) CaptureDataForView(lights LightsForRender, view RenderViewFrame)

DrawInstanceGroup.Clear

func (d *DrawInstanceGroup) Clear()

DrawInstanceGroup.Destroy

func (d *DrawInstanceGroup) Destroy(device *GPUDevice)

DrawInstanceGroup.DestroyViewState

func (d *DrawInstanceGroup) DestroyViewState(device *GPUDevice, view *RenderView)

DrawInstanceGroup.EffectiveLayer

func (d *DrawInstanceGroup) EffectiveLayer() RenderLayerMask

DrawInstanceGroup.IsEmpty

func (d *DrawInstanceGroup) IsEmpty() bool

DrawInstanceGroup.IsReady

func (d *DrawInstanceGroup) IsReady() bool

DrawInstanceGroup.MatchesLayer

func (d *DrawInstanceGroup) MatchesLayer(mask RenderLayerMask) bool

DrawInstanceGroup.TotalSize

func (d *DrawInstanceGroup) TotalSize() int

DrawInstanceGroup.UpdateData

func (d *DrawInstanceGroup) UpdateData(device *GPUDevice, frame int, lights LightsForRender)

DrawInstanceGroup.UpdateDataForView

func (d *DrawInstanceGroup) UpdateDataForView(device *GPUDevice, frame int, lights LightsForRender, view *RenderView)

DrawInstanceGroup.VisibleCount

func (d *DrawInstanceGroup) VisibleCount() int

DrawInstanceGroup.VisibleCountForView

func (d *DrawInstanceGroup) VisibleCountForView(view *RenderView) int

DrawInstanceGroup.VisibleSize

func (d *DrawInstanceGroup) VisibleSize() int

DrawInstanceViewState

struct

type DrawInstanceViewState struct {
    InstanceDriverData

    // Has unexported fields.
}

NewDrawInstanceViewState

func NewDrawInstanceViewState(dataSize int) DrawInstanceViewState

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

func (d *Drawing) EffectiveLayer() RenderLayerMask

Drawing.IsValid

func (d *Drawing) IsValid() bool

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

func (d *Drawing) MatchesLayer(mask RenderLayerMask) bool

Drawings

struct

type Drawings struct {
    // Has unexported fields.
}

NewDrawings

func NewDrawings() Drawings

Drawings.AddDrawing

func (d *Drawings) AddDrawing(drawing Drawing)

Drawings.AddDrawings

func (d *Drawings) AddDrawings(drawings []Drawing)

Drawings.CaptureFrameData

func (d *Drawings) CaptureFrameData(lights LightsForRender, views []RenderViewFrame)

Drawings.Clear

func (d *Drawings) Clear()

Drawings.Destroy

func (d *Drawings) Destroy(device *GPUDevice)

Drawings.DestroyViewState

func (d *Drawings) DestroyViewState(device *GPUDevice, view *RenderView)

Drawings.HasDrawings

func (d *Drawings) HasDrawings() bool

Drawings.PreparePending

func (d *Drawings) PreparePending(shadowCascades uint8)

Drawings.Render

func (d *Drawings) Render(device *GPUDevice, lights LightsForRender, views []RenderViewFrame)

FontBaseline

int

type FontBaseline int

FontCache

struct

type FontCache struct {
    FaceMutex sync.RWMutex
    // Has unexported fields.
}

NewFontCache

func NewFontCache(device *GPUDevice, assetDb assets.Database) FontCache

FontCache.Destroy

func (cache *FontCache) Destroy()

FontCache.EMSize

func (cache *FontCache) EMSize(face FontFace) float32

FontCache.Init

func (cache *FontCache) Init(caches RenderCaches) error

FontCache.LineCountWithin

func (cache *FontCache) LineCountWithin(face FontFace, text string, scale, maxWidth float32) int

FontCache.MeasureCharacter

func (cache *FontCache) MeasureCharacter(face string, r rune, pixelSize float32) matrix.Vec2

FontCache.MeasureString

func (cache *FontCache) MeasureString(face FontFace, text string, scale float32) float32

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

func (cache *FontCache) OpaqueMaterial(target *Material) *Material

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

func (cache *FontCache) PreloadFace(face FontFace)

FontCache.RenderMeshes

func (cache *FontCache) RenderMeshes(caches RenderCaches,

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

func (cache *FontCache) RenderMeshesWithLetterSpacing(caches RenderCaches,

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

func (cache *FontCache) TransparentMaterial(target *Material) *Material

FontFace

string

type FontFace string

FontFace.AsBold

func (f FontFace) AsBold() FontFace

FontFace.AsExtraBold

func (f FontFace) AsExtraBold() FontFace

FontFace.AsItalic

func (f FontFace) AsItalic() FontFace

FontFace.AsLight

func (f FontFace) AsLight() FontFace

FontFace.AsMedium

func (f FontFace) AsMedium() FontFace

FontFace.AsRegular

func (f FontFace) AsRegular() FontFace

FontFace.AsSemiBold

func (f FontFace) AsSemiBold() FontFace

FontFace.Base

func (f FontFace) Base() FontFace

FontFace.IsBold

func (f FontFace) IsBold() bool

FontFace.IsExtraBold

func (f FontFace) IsExtraBold() bool

FontFace.IsItalic

func (f FontFace) IsItalic() bool

FontFace.RemoveBold

func (f FontFace) RemoveBold() FontFace

FontFace.RemoveItalic

func (f FontFace) RemoveItalic() FontFace

FontJustify

int

type FontJustify int

FuncPipeline

func

type FuncPipeline func(device *GPUDevice, shader *Shader, shaderStages []vk.PipelineShaderStageCreateInfo) bool

GPUApplication

struct

type GPUApplication struct {
    Name      string
    Version   GPUApplicationVersion
    Instances []*GPUApplicationInstance
}

GPUApplication.ApplicationVersion

func (g *GPUApplication) ApplicationVersion() (major int, minor int, patch int)

GPUApplication.CreateInstance

func (g *GPUApplication) CreateInstance(window RenderingContainer, assets assets.Database) (*GPUApplicationInstance, error)

GPUApplication.Destroy

func (g *GPUApplication) Destroy()

GPUApplication.EngineVersion

func (g *GPUApplication) EngineVersion() (major int, minor int, patch int)

GPUApplication.FirstInstance

func (g *GPUApplication) FirstInstance() *GPUApplicationInstance

GPUApplication.Instance

func (g *GPUApplication) Instance(index int) (*GPUApplicationInstance, bool)

GPUApplication.IsValid

func (g *GPUApplication) IsValid() bool

GPUApplication.Setup

func (g *GPUApplication) Setup(name string, version GPUApplicationVersion)

GPUApplicationInstance

struct

type GPUApplicationInstance struct {
    GPUInstance
    Surface GPUSurface
    Devices []GPUDevice

    // Has unexported fields.
}

GPUApplicationInstance.Destroy

func (g *GPUApplicationInstance) Destroy()

GPUApplicationInstance.FinalizeLogicalDeviceSetup

func (g *GPUApplicationInstance) FinalizeLogicalDeviceSetup()

GPUApplicationInstance.Initialize

func (g *GPUApplicationInstance) Initialize(window RenderingContainer, app *GPUApplication, assets assets.Database) error

GPUApplicationInstance.PhysicalDevice

func (g *GPUApplicationInstance) PhysicalDevice() *GPUPhysicalDevice

GPUApplicationInstance.PrimaryDevice

func (g *GPUApplicationInstance) PrimaryDevice() *GPUDevice

GPUApplicationInstance.SelectPhysicalDevice

func (g *GPUApplicationInstance) SelectPhysicalDevice(method func(options []GPUPhysicalDevice) int) error

GPUApplicationInstance.SetupCaches

func (g *GPUApplicationInstance) SetupCaches(caches RenderCaches, width, height int32) error

GPUApplicationInstance.SetupLogicalDevice

func (g *GPUApplicationInstance) SetupLogicalDevice(index int) error

GPUApplicationVersion

struct

type GPUApplicationVersion struct {
    Major int
    Minor int
    Patch int
}

GPUDevice

struct

type GPUDevice struct {
    PhysicalDevice GPUPhysicalDevice
    LogicalDevice  GPULogicalDevice
    Painter        GPUPainter

    // Has unexported fields.
}

GPUDevice.BeginTextureUploadBatch

func (g *GPUDevice) BeginTextureUploadBatch() *TextureUploadBatch

GPUDevice.BlitTargets

func (g *GPUDevice) BlitTargets(passes []*RenderPass)

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

func (g *GPUDevice) CreateDynamicMesh(mesh *Mesh, verts []Vertex, indices []uint32)

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

func (g *GPUDevice) CreateMesh(mesh *Mesh, verts []Vertex, indices []uint32)

GPUDevice.CreateShader

func (g *GPUDevice) CreateShader(shader *Shader, assetDB assets.Database) error

GPUDevice.CreateSwapChain

func (g *GPUDevice) CreateSwapChain(window RenderingContainer, inst *GPUApplicationInstance) error

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

func (g *GPUDevice) DestroyBuffer(buffer gpu_types.Buffer)

GPUDevice.DestroyFrameBuffer

func (g *GPUDevice) DestroyFrameBuffer(frameBuffer gpu_types.FrameBuffer)

GPUDevice.DestroyRenderViewResources

func (g *GPUDevice) DestroyRenderViewResources(view *RenderView)

GPUDevice.DestroyShaderHandle

func (g *GPUDevice) DestroyShaderHandle(id ShaderId)

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

func (g *GPUDevice) FlushForReadback() bool

GPUDevice.FlushQueuedCommands

func (g *GPUDevice) FlushQueuedCommands() bool

GPUDevice.FreeMemory

func (g *GPUDevice) FreeMemory(memory gpu_types.DeviceMemory)

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

func (g *GPUDevice) Memcopy(dst unsafe.Pointer, src []byte) int

GPUDevice.MeshIsReady

func (g *GPUDevice) MeshIsReady(mesh Mesh) bool

GPUDevice.MeshRead

func (g *GPUDevice) MeshRead(id MeshId) ([]Vertex, []uint32, error)

GPUDevice.PrepareRenderTarget

func (g *GPUDevice) PrepareRenderTarget(target *RenderTarget) error

GPUDevice.QueueCompute

func (g *GPUDevice) QueueCompute(buffer *ComputeShaderBuffer)

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

func (g *GPUDevice) Screenshot() ([]byte, error)

GPUDevice.ScreenshotRGBA

func (g *GPUDevice) ScreenshotRGBA() ([]byte, error)

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

func (g *GPUDevice) SetSwapChainClearColor(color matrix.Color)

SetSwapChainClearColor sets the clear color used by final swap-chain presentation passes, including the cached combine pass when it exists.

GPUDevice.SetupTexture

func (g *GPUDevice) SetupTexture(texture *Texture, data *textures.TextureData) error

GPUDevice.SetupTextureInBatch

func (g *GPUDevice) SetupTextureInBatch(texture *Texture, data *textures.TextureData, batch *TextureUploadBatch) error

GPUDevice.SwapChainClearColor

func (g *GPUDevice) SwapChainClearColor() matrix.Color

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

func (g *GPUDevice) TextureRead(texture *Texture) ([]byte, error)

GPUDevice.TextureReadPixel

func (g *GPUDevice) TextureReadPixel(texture *Texture, x, y int) matrix.Color

GPUDevice.TextureReadRegion

func (g *GPUDevice) TextureReadRegion(texture *Texture, rect matrix.Vec4i) ([]byte, error)

GPUDevice.TextureWritePixels

func (g *GPUDevice) TextureWritePixels(texture *Texture, requests []GPUImageWriteRequest)

GPUDevice.TransitionImageLayout

func (g *GPUDevice) TransitionImageLayout(vt *TextureId, newLayout gpu_types.ImageLayout, aspectMask gpu_types.ImageAspectFlags, newAccess gpu_types.AccessFlags, cmd *CommandRecorder)

GPUDevice.UnmapMemory

func (g *GPUDevice) UnmapMemory(memory gpu_types.DeviceMemory)

GPUDevice.UpdateDynamicMeshVertices

func (g *GPUDevice) UpdateDynamicMeshVertices(mesh *Mesh, verts []Vertex)

UpdateDynamicMeshVertices writes vertex data directly to a HOST_VISIBLE vertex buffer. No staging buffer, no command buffer, no fence wait.

GPUDevice.UpdateMeshVertices

func (g *GPUDevice) UpdateMeshVertices(mesh *Mesh, verts []Vertex)

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

type GPUImageWriteRequest struct {
    Region matrix.Vec4i
    Pixels []byte
}

GPUInstance

struct

type GPUInstance struct {
    // Has unexported fields.
}

GPUInstance.Destroy

func (g *GPUInstance) Destroy()

GPUInstance.IsValid

func (g *GPUInstance) IsValid() bool

GPUInstance.Setup

func (g *GPUInstance) Setup(window RenderingContainer, app *GPUApplication) error

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

func (g *GPULogicalDevice) Destroy()

GPULogicalDevice.DestroyFence

func (g *GPULogicalDevice) DestroyFence(fence *gpu_types.Fence)

GPULogicalDevice.DestroyGroup

func (g *GPULogicalDevice) DestroyGroup(group *DrawInstanceGroup)

GPULogicalDevice.DestroySemaphore

func (g *GPULogicalDevice) DestroySemaphore(semaphore *gpu_types.Semaphore)

GPULogicalDevice.FreeTexture

func (g *GPULogicalDevice) FreeTexture(texId *TextureId)

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

func (g *GPULogicalDevice) SetupBufferDestroyer(device *GPUDevice)

GPULogicalDevice.WaitForFences

func (g *GPULogicalDevice) WaitForFences(fences []gpu_types.Fence)

GPULogicalDevice.WaitForRender

func (g *GPULogicalDevice) WaitForRender(device *GPUDevice)

GPULogicalDevice.WaitIdle

func (g *GPULogicalDevice) WaitIdle()

GPUPainter

struct

type GPUPainter struct {
    // Has unexported fields.
}

GPUPainter.DestroyDescriptorPools

func (g *GPUPainter) DestroyDescriptorPools(device *GPUDevice)

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

func ListPhysicalGpuDevices(inst *GPUApplicationInstance) ([]GPUPhysicalDevice, error)

GPUPhysicalDevice.FindComputeFamiliy

func (g *GPUPhysicalDevice) FindComputeFamiliy() GPUQueueFamily

GPUPhysicalDevice.FindGraphicsFamiliy

func (g *GPUPhysicalDevice) FindGraphicsFamiliy() GPUQueueFamily

GPUPhysicalDevice.FindMemoryType

func (g *GPUPhysicalDevice) FindMemoryType(typeFilter uint32, properties gpu_types.MemoryPropertyFlags) int

GPUPhysicalDevice.FindPresentFamily

func (g *GPUPhysicalDevice) FindPresentFamily() GPUQueueFamily

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

func (g *GPUPhysicalDevice) FormatProperties(format gpu_types.Format) gpu_types.FormatProperties

GPUPhysicalDevice.IsExtensionSupported

func (g *GPUPhysicalDevice) IsExtensionSupported(extension string) bool

GPUPhysicalDevice.IsValid

func (g *GPUPhysicalDevice) IsValid() bool

GPUPhysicalDevice.MaxUsableSampleCount

func (g *GPUPhysicalDevice) MaxUsableSampleCount() gpu_types.SampleCountFlags

GPUPhysicalDevice.PadBufferSize

func (g *GPUPhysicalDevice) PadBufferSize(size uintptr) uintptr

GPUPhysicalDevice.RefreshSurfaceCapabilities

func (g *GPUPhysicalDevice) RefreshSurfaceCapabilities(surface unsafe.Pointer)

GPUPhysicalDeviceExtension

struct

type GPUPhysicalDeviceExtension struct {
    Name    string
    Version uint32
}

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

func InvalidGPUQueueFamily() GPUQueueFamily

GPUQueueFamily.IsValid

func (g GPUQueueFamily) IsValid() bool

GPUSurface

struct

type GPUSurface struct {
    // Has unexported fields.
}

GPUSurface.Create

func (g *GPUSurface) Create(instance *GPUInstance, window RenderingContainer) error

GPUSurface.Destroy

func (g *GPUSurface) Destroy(inst *GPUApplicationInstance)

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

func (g *GPUSwapChain) ClearColor() matrix.Color

ClearColor returns the configured clear color, or the engine default when no override has been set.

GPUSwapChain.ClearColorOverride

func (g *GPUSwapChain) ClearColorOverride() (matrix.Color, bool)

ClearColorOverride returns the explicitly configured clear color and whether one has been set.

GPUSwapChain.CopyAndReset

func (g *GPUSwapChain) CopyAndReset() GPUSwapChain

GPUSwapChain.CreateColor

func (g *GPUSwapChain) CreateColor(device *GPUDevice) error

GPUSwapChain.CreateDepth

func (g *GPUSwapChain) CreateDepth(device *GPUDevice) error

GPUSwapChain.CreateFrameBuffer

func (g *GPUSwapChain) CreateFrameBuffer(device *GPUDevice) error

GPUSwapChain.Destroy

func (g *GPUSwapChain) Destroy(device *GPUDevice)

GPUSwapChain.SelectExtent

func (g *GPUSwapChain) SelectExtent(window RenderingContainer, device *GPUPhysicalDevice) matrix.Vec2i

GPUSwapChain.SelectPresentMode

func (g *GPUSwapChain) SelectPresentMode(device *GPUPhysicalDevice) gpu_types.PresentMode

GPUSwapChain.SelectSurfaceFormat

func (g *GPUSwapChain) SelectSurfaceFormat(device *GPUPhysicalDevice) gpu_types.SurfaceFormat

GPUSwapChain.SetClearColor

func (g *GPUSwapChain) SetClearColor(color matrix.Color)

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

func (g *GPUSwapChain) SetupImageViews(device *GPUDevice) error

GPUSwapChain.SetupRenderPass

func (g *GPUSwapChain) SetupRenderPass(device *GPUDevice, assets assets.Database) error

GPUSwapChain.SetupSyncObjects

func (g *GPUSwapChain) SetupSyncObjects(device *GPUDevice) error

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

type InstanceBufferCapacity struct {
    // Has unexported fields.
}

InstanceBufferCapacity.Capacity

func (c InstanceBufferCapacity) Capacity() int

InstanceBufferCapacity.Commit

func (c *InstanceBufferCapacity) Commit(capacity int)

InstanceBufferCapacity.Ensure

func (c *InstanceBufferCapacity) Ensure(instanceCount int) (int, bool)

InstanceBufferCapacity.Next

func (c InstanceBufferCapacity) Next(instanceCount int) (int, bool)

InstanceBufferCapacity.Reset

func (c *InstanceBufferCapacity) Reset()

InstanceCopyData

struct

type InstanceCopyData struct {
    // Has unexported fields.
}

InstanceCopyDataNew

func InstanceCopyDataNew(padding int) InstanceCopyData

InstanceDriverData

struct

type InstanceDriverData struct {
    // Has unexported fields.
}

InstanceGroupSkinningData

struct

type InstanceGroupSkinningData struct {
}

Light

struct

type Light struct {
    // Has unexported fields.
}

NewLight

func NewLight(device *GPUDevice, _ assets.Database, _ *MaterialCache, lightType LightType) Light

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

func (l *Light) CastsShadows() bool

Light.Direction

func (l *Light) Direction(followcam cameras.Camera) matrix.Vec3

Light.FrameDirty

func (l *Light) FrameDirty() bool

Light.IsValid

func (l *Light) IsValid() bool

Light.ResetFrameDirty

func (l *Light) ResetFrameDirty() bool

Light.SetAmbient

func (l *Light) SetAmbient(ambient matrix.Vec3)

Light.SetCastsShadows

func (l *Light) SetCastsShadows(castsShadows bool)

Light.SetConstant

func (l *Light) SetConstant(constant float32)

Light.SetCutoff

func (l *Light) SetCutoff(cutoff float32)

Light.SetDiffuse

func (l *Light) SetDiffuse(diffuse matrix.Vec3)

Light.SetDirection

func (l *Light) SetDirection(dir matrix.Vec3)

Light.SetIntensity

func (l *Light) SetIntensity(intensity float32)

Light.SetLinear

func (l *Light) SetLinear(linear float32)

Light.SetOuterCutoff

func (l *Light) SetOuterCutoff(outerCutoff float32)

Light.SetPosition

func (l *Light) SetPosition(position matrix.Vec3)

Light.SetQuadratic

func (l *Light) SetQuadratic(quadratic float32)

Light.SetSpecular

func (l *Light) SetSpecular(specular matrix.Vec3)

Light.Type

func (l *Light) Type() LightType

Light.WorldSpace

func (l *Light) WorldSpace(followcam cameras.Camera) matrix.Vec3

LightShadowShaderData

struct

type LightShadowShaderData struct {
    ShaderDataBase
    LightIndex int32
}

LightShadowShaderData.SelectLights

func (t *LightShadowShaderData) SelectLights(lights LightsForRender)

LightShadowShaderData.Size

func (t LightShadowShaderData) Size() int

LightType

int

type LightType int

LightsForRender

struct

type LightsForRender struct {
    Lights     []Light
    HasChanges bool
}

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

func (m *Material) CreateInstance(textures []*Texture) *Material

Material.Destroy

func (m *Material) Destroy(device *GPUDevice)

Material.HasTransparentSuffix

func (m *Material) HasTransparentSuffix() bool

Material.RenderPass

func (m *Material) RenderPass() *RenderPass

Material.RenderViewModeOverride

func (m *Material) RenderViewModeOverride(mode RenderViewMode) *Material

Material.RenderViewModeOverrideCompatible

func (m *Material) RenderViewModeOverrideCompatible(override *Material) bool

Material.SelectRoot

func (m *Material) SelectRoot() *Material

Material.SetRenderViewModeOverride

func (m *Material) SetRenderViewModeOverride(mode RenderViewMode, override *Material)

MaterialCache

struct

type MaterialCache struct {
    // Has unexported fields.
}

NewMaterialCache

func NewMaterialCache(device *GPUDevice, assetDatabase assets.Database) MaterialCache

MaterialCache.AddMaterial

func (m *MaterialCache) AddMaterial(material *Material) *Material

MaterialCache.Destroy

func (m *MaterialCache) Destroy()

MaterialCache.FindMaterial

func (m *MaterialCache) FindMaterial(key string) (*Material, bool)

MaterialCache.Material

func (m *MaterialCache) Material(key string) (*Material, error)

MaterialCache.RemoveMaterial

func (m *MaterialCache) RemoveMaterial(key string)

MaterialCache.ReplaceMaterial

func (m *MaterialCache) ReplaceMaterial(key string) error

MaterialCache.SetDeviceCall

func (m *MaterialCache) SetDeviceCall(call func(func(*GPUDevice)))

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

func (d *MaterialData) Compile(assets assets.Database, device *GPUDevice) (*Material, error)

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

func (d *MaterialTextureData) FilterToVK() textures.Filter

Mesh

struct

type Mesh struct {
    MeshId MeshId

    // Has unexported fields.
}

NewDynamicMesh

func NewDynamicMesh(key string, verts []Vertex, indexes []uint32) *Mesh

NewMesh

func NewMesh(key string, verts []Vertex, indexes []uint32) *Mesh

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

func NewMeshCapsule(cache *MeshCache, radius, height float32, segments, rings int) *Mesh

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

func NewMeshCircleWire(cache *MeshCache, radius float32, segments int) *Mesh

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

func NewMeshCone(cache *MeshCache, height, baseRadius float32, segments int, capped bool) *Mesh

NewMeshCube

func NewMeshCube(cache *MeshCache) *Mesh

NewMeshCubeInverse

func NewMeshCubeInverse(cache *MeshCache) *Mesh

NewMeshCylinder

func NewMeshCylinder(cache *MeshCache, height, radius float32, segments int, capped bool) *Mesh

NewMeshFrustum

func NewMeshFrustum(cache *MeshCache, key string, inverseProjection matrix.Mat4) *Mesh

NewMeshFrustumBox

func NewMeshFrustumBox(cache *MeshCache, inverseProjection matrix.Mat4) *Mesh

NewMeshGrid

func NewMeshGrid(cache *MeshCache, key string, points []matrix.Vec3, vertColor matrix.Color) *Mesh

NewMeshLine

func NewMeshLine(cache *MeshCache, key string, p0, p1 matrix.Vec3, vertColor matrix.Color) *Mesh

NewMeshOffsetQuad

func NewMeshOffsetQuad(cache *MeshCache, key string, sideOffsets matrix.Vec4) *Mesh

NewMeshPlane

func NewMeshPlane(cache *MeshCache) *Mesh

NewMeshPoint

func NewMeshPoint(cache *MeshCache, key string, position matrix.Vec3, vertColor matrix.Color) *Mesh

NewMeshPrimitive

func NewMeshPrimitive(cache *MeshCache, primitive PrimitiveMesh) *Mesh

NewMeshQuad

func NewMeshQuad(cache *MeshCache) *Mesh

NewMeshQuadAnchored

func NewMeshQuadAnchored(anchor QuadPivot, cache *MeshCache) *Mesh

NewMeshScreenQuad

func NewMeshScreenQuad(cache *MeshCache) *Mesh

NewMeshSkyboxCube

func NewMeshSkyboxCube(cache *MeshCache) *Mesh

NewMeshSphere

func NewMeshSphere(cache *MeshCache, radius float32, latitudeBands, longitudeBands int) *Mesh

NewMeshTexturableCube

func NewMeshTexturableCube(cache *MeshCache) *Mesh

NewMeshTriangle

func NewMeshTriangle(cache *MeshCache) *Mesh

NewMeshUnitQuad

func NewMeshUnitQuad(cache *MeshCache) *Mesh

NewMeshWireCone

func NewMeshWireCone(cache *MeshCache, radius, height float32, segments, heightSegments int) *Mesh

NewMeshWireCube

func NewMeshWireCube(cache *MeshCache, key string, vertColor matrix.Color) *Mesh

NewMeshWireCylinder

func NewMeshWireCylinder(cache *MeshCache, radius, height float32, segments, heightSegments int) *Mesh

NewMeshWireQuad

func NewMeshWireQuad(cache *MeshCache, key string, vertColor matrix.Color) *Mesh

NewMeshWireSphere

func NewMeshWireSphere(cache *MeshCache, radius float32, latitudeBands, longitudeBands int) *Mesh

Mesh.Bounds

func (m Mesh) Bounds() graviton.AABB

Mesh.DelayedCreate

func (m *Mesh) DelayedCreate(device *GPUDevice)

Mesh.GenerateLODs

func (m *Mesh) GenerateLODs(cache *MeshCache, g MeshLodGenerator) error

Mesh.IsReady

func (m Mesh) IsReady() bool

Mesh.Key

func (m Mesh) Key() string

Mesh.SetKey

func (m *Mesh) SetKey(key string)

Mesh.SetPendingVertices

func (m *Mesh) SetPendingVertices(verts []Vertex)

MeshCache

struct

type MeshCache struct {
    // Has unexported fields.
}

NewMeshCache

func NewMeshCache(device *GPUDevice, assetDatabase assets.Database) MeshCache

MeshCache.AddMesh

func (m *MeshCache) AddMesh(mesh *Mesh) *Mesh

Try to add the mesh to the cache, if it already exists, return the existing mesh

MeshCache.Destroy

func (m *MeshCache) Destroy()

MeshCache.DynamicMesh

func (m *MeshCache) DynamicMesh(key string, verts []Vertex, indexes []uint32) *Mesh

DynamicMesh creates or retrieves a mesh backed by a HOST_VISIBLE vertex buffer, suitable for frequent CPU updates without GPU synchronization.

MeshCache.FindMesh

func (m *MeshCache) FindMesh(key string) (*Mesh, bool)

MeshCache.Mesh

func (m *MeshCache) Mesh(key string, verts []Vertex, indexes []uint32) *Mesh

MeshCache.ProcessPending

func (m *MeshCache) ProcessPending()

MeshCache.RemoveMesh

func (m *MeshCache) RemoveMesh(key string)

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

func (m *MeshCache) SetLodGenerator(generator MeshLodGenerator)

MeshCache.UpdateMeshVertices

func (m *MeshCache) UpdateMeshVertices(key string, verts []Vertex)

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

type MeshCleanup struct {
    // Has unexported fields.
}

MeshCullMode

int

type MeshCullMode = int

const ( MeshCullModeBack MeshCullMode = iota MeshCullModeFront MeshCullModeNone )

MeshDrawMode

int

type MeshDrawMode = int

const ( MeshDrawModePoints MeshDrawMode = iota MeshDrawModeLines MeshDrawModeTriangles MeshDrawModePatches )

MeshId

struct

type MeshId struct {
    // Has unexported fields.
}

MeshId.IndexCount

func (m MeshId) IndexCount() uint32

MeshId.IsValid

func (m MeshId) IsValid() bool

MeshId.VertexCount

func (m MeshId) VertexCount() uint32

MeshLODInstance

struct

type MeshLODInstance struct {
    Mesh  *Mesh
    Ratio float32
}

MeshLod

struct

type MeshLod struct {
    Levels []MeshLODInstance
}

MeshLod.IsValid

func (l MeshLod) IsValid() bool

MeshLodGenerator

interface

type MeshLodGenerator interface {
    GenerateLods(mesh *Mesh, cache *MeshCache, verts []Vertex, indices []uint32, levels int) (MeshLod, error)
}

MeshLodGeneratorQem

struct

type MeshLodGeneratorQem struct {
    Threads *concurrent.Threads
}

NewMeshLodGeneratorQem

func NewMeshLodGeneratorQem(threads *concurrent.Threads) *MeshLodGeneratorQem

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

type MeshQem struct {
    // Has unexported fields.
}

MeshQemChunk

struct

type MeshQemChunk struct {
    // Has unexported fields.
}

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

type PointShadow struct {
    Point    matrix.Vec2 // X,Z
    Radius   float32
    Strength float32
}

PrimitiveMesh

string

type PrimitiveMesh string

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

int32

type QuadPivot = int32

QueuedCommandSubmitter

struct

type QueuedCommandSubmitter struct {
    // Has unexported fields.
}

QueuedCommandSubmitter.QueuedCommandCount

func (s QueuedCommandSubmitter) QueuedCommandCount() int

QueuedCommandSubmitter.SubmitAndWaitForReadback

func (s QueuedCommandSubmitter) SubmitAndWaitForReadback() bool

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

uint8

type RenderLayer uint8

const ( RenderLayerIndexWorld RenderLayer = iota RenderLayerIndexUI RenderLayerIndexEditor RenderLayerIndexEditorPicking RenderLayerIndexEditorGizmoPicking )

RenderLayer.Mask

func (l RenderLayer) Mask() RenderLayerMask

RenderLayerMask

uint64

type RenderLayerMask uint64

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

func NewRenderPass(device *GPUDevice, setup *RenderPassDataCompiled) (*RenderPass, error)

RenderPass.Destroy

func (p *RenderPass) Destroy(device *GPUDevice)

RenderPass.ExecuteSecondaryCommands

func (r *RenderPass) ExecuteSecondaryCommands()

RenderPass.Height

func (r *RenderPass) Height() int

RenderPass.IsShadowPass

func (r *RenderPass) IsShadowPass() bool

RenderPass.Recontstruct

func (p *RenderPass) Recontstruct(device *GPUDevice) error

RenderPass.SelectOutputAttachment

func (r *RenderPass) SelectOutputAttachment(device *GPUDevice) *Texture

RenderPass.SelectOutputAttachmentWithSuffix

func (r *RenderPass) SelectOutputAttachmentWithSuffix(suffix string) (*Texture, bool)

RenderPass.Texture

func (r *RenderPass) Texture(index int) *Texture

RenderPass.Width

func (r *RenderPass) Width() int

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

func (ad *RenderPassAttachmentDescription) FinalLayoutToGpu() gpu_types.ImageLayout

RenderPassAttachmentDescription.FormatToGpu

func (ad *RenderPassAttachmentDescription) FormatToGpu(device *GPUDevice) gpu_types.Format

RenderPassAttachmentDescription.InitialLayoutToGpu

func (ad *RenderPassAttachmentDescription) InitialLayoutToGpu() gpu_types.ImageLayout

RenderPassAttachmentDescription.LoadOpToGpu

func (ad *RenderPassAttachmentDescription) LoadOpToGpu() gpu_types.AttachmentLoadOp

RenderPassAttachmentDescription.SamplesToGpu

func (ad *RenderPassAttachmentDescription) SamplesToGpu(device *GPUPhysicalDevice) gpu_types.SampleCountFlags

RenderPassAttachmentDescription.StencilLoadOpToGpu

func (ad *RenderPassAttachmentDescription) StencilLoadOpToGpu() gpu_types.AttachmentLoadOp

RenderPassAttachmentDescription.StencilStoreOpToGpu

func (ad *RenderPassAttachmentDescription) StencilStoreOpToGpu() gpu_types.AttachmentStoreOp

RenderPassAttachmentDescription.StoreOpToGpu

func (ad *RenderPassAttachmentDescription) StoreOpToGpu() gpu_types.AttachmentStoreOp

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

func (p *RenderPassAttachmentDescriptionCompiled) IsDepthFormat() bool

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

func (ai *RenderPassAttachmentImage) AccessToGpu() gpu_types.AccessFlags

RenderPassAttachmentImage.AspectToGpu

func (ai *RenderPassAttachmentImage) AspectToGpu() gpu_types.ImageAspectFlags

RenderPassAttachmentImage.FilterToGpu

func (ai *RenderPassAttachmentImage) FilterToGpu() gpu_types.Filter

RenderPassAttachmentImage.IsInvalid

func (img *RenderPassAttachmentImage) IsInvalid() bool

RenderPassAttachmentImage.MemoryPropertyToGpu

func (ai *RenderPassAttachmentImage) MemoryPropertyToGpu() gpu_types.MemoryPropertyFlags

RenderPassAttachmentImage.TilingToGpu

func (ai *RenderPassAttachmentImage) TilingToGpu() gpu_types.ImageTiling

RenderPassAttachmentImage.UsageToGpu

func (ai *RenderPassAttachmentImage) UsageToGpu() gpu_types.ImageUsageFlags

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

func (img *RenderPassAttachmentImageCompiled) IsInvalid() bool

RenderPassAttachmentReference

struct

type RenderPassAttachmentReference struct {
    Attachment uint32
    Layout     string `options:"StringVkImageLayout"`
}

RenderPassAttachmentReference.LayoutToGpu

func (ad *RenderPassAttachmentReference) LayoutToGpu() gpu_types.ImageLayout

RenderPassAttachmentReferenceCompiled

struct

type RenderPassAttachmentReferenceCompiled struct {
    Attachment uint32
    Layout     gpu_types.ImageLayout
}

RenderPassCommandSet

struct

type RenderPassCommandSet struct {
    // Has unexported fields.
}

RenderPassData

struct

type RenderPassData struct {
    Name                   string
    Sort                   int
    AttachmentDescriptions []RenderPassAttachmentDescription
    SubpassDescriptions    []RenderPassSubpassDescription
    SubpassDependencies    []RenderPassSubpassDependency
    Width                  int
    Height                 int
    SkipCombine            bool
}

NewRenderPassData

func NewRenderPassData(src string) (RenderPassData, error)

RenderPassData.Compile

func (d *RenderPassData) Compile(device *GPUDevice) RenderPassDataCompiled

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

func (r *RenderPassDataCompiled) ConstructRenderPass(device *GPUDevice) (*RenderPass, error)

RenderPassGroup

struct

type RenderPassGroup struct {
    // Has unexported fields.
}

RenderPassGroup.MatchesLayer

func (d *RenderPassGroup) MatchesLayer(mask RenderLayerMask) bool

RenderPassSubpass

struct

type RenderPassSubpass struct {
    // Has unexported fields.
}

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

func (sd *RenderPassSubpassDependency) DependencyFlagsToGpu() gpu_enums.DependencyFlags

RenderPassSubpassDependency.DstAccessMaskToGpu

func (sd *RenderPassSubpassDependency) DstAccessMaskToGpu() gpu_types.AccessFlags

RenderPassSubpassDependency.DstStageMaskToGpu

func (sd *RenderPassSubpassDependency) DstStageMaskToGpu() gpu_types.PipelineStageFlags

RenderPassSubpassDependency.SrcAccessMaskToGpu

func (sd *RenderPassSubpassDependency) SrcAccessMaskToGpu() gpu_types.AccessFlags

RenderPassSubpassDependency.SrcStageMaskToGpu

func (sd *RenderPassSubpassDependency) SrcStageMaskToGpu() gpu_types.PipelineStageFlags

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

func (ad *RenderPassSubpassDescription) PipelineBindPointToGpu() gpu_enums.PipelineBindPoint

RenderPassSubpassDescriptionCompiled

struct

type RenderPassSubpassDescriptionCompiled struct {
    PipelineBindPoint         gpu_enums.PipelineBindPoint
    ColorAttachmentReferences []RenderPassAttachmentReferenceCompiled
    InputAttachmentReferences []RenderPassAttachmentReferenceCompiled
    ResolveAttachments        []RenderPassAttachmentReferenceCompiled
    DepthStencilAttachment    []RenderPassAttachmentReferenceCompiled // 1 max
    PreserveAttachments       []uint32                                // TODO
}

RenderPassSubpassImageData

struct

type RenderPassSubpassImageData struct {
    SampledImage string
}

RenderTarget

struct

type RenderTarget struct {
    // Has unexported fields.
}

RenderTarget.Destroyed

func (t *RenderTarget) Destroyed() bool

RenderTarget.Height

func (t *RenderTarget) Height() int

RenderTarget.Name

func (t *RenderTarget) Name() string

RenderTarget.Options

func (t *RenderTarget) Options() RenderTargetOptions

RenderTarget.Resize

func (t *RenderTarget) Resize(width, height int) bool

RenderTarget.ResizeDirty

func (t *RenderTarget) ResizeDirty() bool

RenderTarget.Size

func (t *RenderTarget) Size() (int, int)

RenderTarget.Texture

func (t *RenderTarget) Texture(name string) (*Texture, error)

RenderTarget.Width

func (t *RenderTarget) Width() int

RenderTargetManager

struct

type RenderTargetManager struct {
    // Has unexported fields.
}

NewRenderTargetManager

func NewRenderTargetManager() RenderTargetManager

RenderTargetManager.Create

func (m *RenderTargetManager) Create(options RenderTargetOptions) (*RenderTarget, error)

RenderTargetManager.Destroy

func (m *RenderTargetManager) Destroy(name string) error

RenderTargetManager.DestroyAll

func (m *RenderTargetManager) DestroyAll(device *GPUDevice)

RenderTargetManager.ProcessPending

func (m *RenderTargetManager) ProcessPending(device *GPUDevice)

RenderTargetManager.ResizeMatchingWindow

func (m *RenderTargetManager) ResizeMatchingWindow(width, height int)

RenderTargetManager.Target

func (m *RenderTargetManager) Target(name string) (*RenderTarget, bool)

RenderTargetManager.Targets

func (m *RenderTargetManager) Targets() []*RenderTarget

RenderTargetOptions

struct

type RenderTargetOptions struct {
    Name        string
    Width       int
    Height      int
    ResizeMode  RenderTargetResizeMode
    ColorFormat gpu_types.Format
    Depth       bool
}

RenderTargetResizeMode

int

type RenderTargetResizeMode int

const ( RenderTargetResizeModeFixed RenderTargetResizeMode = iota RenderTargetResizeModeMatchWindow )

RenderView

struct

type RenderView struct {
    // Has unexported fields.
}

RenderView.Camera

func (v *RenderView) Camera() any

RenderView.Clear

func (v *RenderView) Clear() bool

RenderView.Destroyed

func (v *RenderView) Destroyed() bool

RenderView.Enabled

func (v *RenderView) Enabled() bool

RenderView.LayerMask

func (v *RenderView) LayerMask() RenderLayerMask

RenderView.MatchesDrawing

func (v *RenderView) MatchesDrawing(drawing *Drawing) bool

RenderView.MatchesGroup

func (v *RenderView) MatchesGroup(group *DrawInstanceGroup) bool

RenderView.Name

func (v *RenderView) Name() string

RenderView.Options

func (v *RenderView) Options() RenderViewOptions

RenderView.SetCamera

func (v *RenderView) SetCamera(camera any)

RenderView.SetEnabled

func (v *RenderView) SetEnabled(enabled bool)

RenderView.SetViewMode

func (v *RenderView) SetViewMode(mode RenderViewMode)

RenderView.Sort

func (v *RenderView) Sort() int

RenderView.Target

func (v *RenderView) Target() *RenderTarget

RenderView.ViewMode

func (v *RenderView) ViewMode() RenderViewMode

RenderViewFrame

struct

type RenderViewFrame struct {
    View      *RenderView
    Options   RenderViewOptions
    Order     uint64
    Enabled   bool
    Destroyed bool
}

RenderViewFrame.Camera

func (v RenderViewFrame) Camera() any

RenderViewFrame.Clear

func (v RenderViewFrame) Clear() bool

RenderViewFrame.IsDestroyed

func (v RenderViewFrame) IsDestroyed() bool

RenderViewFrame.IsEnabled

func (v RenderViewFrame) IsEnabled() bool

RenderViewFrame.Key

func (v RenderViewFrame) Key() *RenderView

RenderViewFrame.LayerMask

func (v RenderViewFrame) LayerMask() RenderLayerMask

RenderViewFrame.Name

func (v RenderViewFrame) Name() string

RenderViewFrame.Sort

func (v RenderViewFrame) Sort() int

RenderViewFrame.Target

func (v RenderViewFrame) Target() *RenderTarget

RenderViewFrame.ViewMode

func (v RenderViewFrame) ViewMode() RenderViewMode

RenderViewManager

struct

type RenderViewManager struct {
    // Has unexported fields.
}

NewRenderViewManager

func NewRenderViewManager(defaultOptions ...RenderViewOptions) RenderViewManager

RenderViewManager.Create

func (m *RenderViewManager) Create(options RenderViewOptions) (*RenderView, error)

RenderViewManager.Default

func (m *RenderViewManager) Default() (*RenderView, bool)

RenderViewManager.Destroy

func (m *RenderViewManager) Destroy(name string) error

RenderViewManager.DestroyAll

func (m *RenderViewManager) DestroyAll(device *GPUDevice, drawings *Drawings)

RenderViewManager.FrameViews

func (m *RenderViewManager) FrameViews() []RenderViewFrame

RenderViewManager.ProcessPending

func (m *RenderViewManager) ProcessPending(device *GPUDevice, drawings *Drawings)

RenderViewManager.ReplaceDefault

func (m *RenderViewManager) ReplaceDefault(options RenderViewOptions) (*RenderView, error)

RenderViewManager.SetDefaultCamera

func (m *RenderViewManager) SetDefaultCamera(camera any)

RenderViewManager.View

func (m *RenderViewManager) View(name string) (*RenderView, bool)

RenderViewManager.Views

func (m *RenderViewManager) Views() []*RenderView

RenderViewMode

int

type RenderViewMode int

const ( RenderViewModeNormal RenderViewMode = iota RenderViewModeWireframe RenderViewModeUnlit RenderViewModeProfile

RenderViewModeDefault = RenderViewModeNormal )

ParseRenderViewMode

func ParseRenderViewMode(value string) (RenderViewMode, bool)

RenderViewMode.String

func (m RenderViewMode) String() string

RenderViewMode.Valid

func (m RenderViewMode) Valid() bool

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

int

type RenderViewPipelineOverride int

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

func NewShader(shaderData ShaderDataCompiled) *Shader

Shader.AddSubShader

func (s *Shader) AddSubShader(key string, shader *Shader)

Shader.DelayedCreate

func (s *Shader) DelayedCreate(device *GPUDevice, assetDatabase assets.Database)

Shader.DrawInstanceDataName

func (s *Shader) DrawInstanceDataName() string

Shader.Reload

func (s *Shader) Reload(shaderData ShaderDataCompiled)

Shader.RemoveSubShader

func (s *Shader) RemoveSubShader(key string)

Shader.ShaderDataName

func (s *Shader) ShaderDataName() string

Shader.SubShader

func (s *Shader) SubShader(key string) *Shader

ShaderBuffer

struct

type ShaderBuffer struct {
    // Has unexported fields.
}

ShaderCache

struct

type ShaderCache struct {
    // Has unexported fields.
}

NewShaderCache

func NewShaderCache(device *GPUDevice, assetDatabase assets.Database) ShaderCache

ShaderCache.AddShader

func (s *ShaderCache) AddShader(shader *Shader)

ShaderCache.CreatePending

func (s *ShaderCache) CreatePending()

ShaderCache.Destroy

func (s *ShaderCache) Destroy()

ShaderCache.ReloadShader

func (s *ShaderCache) ReloadShader(shaderData ShaderDataCompiled)

ShaderCache.Shader

func (s *ShaderCache) Shader(shaderData ShaderDataCompiled) (shader *Shader, isNew bool)

ShaderCleanup

struct

type ShaderCleanup struct {
    // Has unexported fields.
}

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

func (d *ShaderData) Compile() ShaderDataCompiled

ShaderData.DrawInstanceDataName

func (d ShaderData) DrawInstanceDataName() string

ShaderDataBase

struct

type ShaderDataBase struct {
    InitModel matrix.Mat4
    // Has unexported fields.
}

NewShaderDataBase

func NewShaderDataBase() ShaderDataBase

ShaderDataBase.Activate

func (s *ShaderDataBase) Activate()

ShaderDataBase.Base

func (s *ShaderDataBase) Base() *ShaderDataBase

ShaderDataBase.BoundDataPointer

func (s *ShaderDataBase) BoundDataPointer() unsafe.Pointer

ShaderDataBase.CancelDestroy

func (s *ShaderDataBase) CancelDestroy()

ShaderDataBase.DataPointer

func (s *ShaderDataBase) DataPointer() unsafe.Pointer

ShaderDataBase.Deactivate

func (s *ShaderDataBase) Deactivate()

ShaderDataBase.Destroy

func (s *ShaderDataBase) Destroy()

ShaderDataBase.InstanceBoundDataSize

func (s *ShaderDataBase) InstanceBoundDataSize() int

ShaderDataBase.IsDestroyed

func (s *ShaderDataBase) IsDestroyed() bool

ShaderDataBase.IsInView

func (s *ShaderDataBase) IsInView() bool

ShaderDataBase.IsInViewForView

func (s *ShaderDataBase) IsInViewForView(view *RenderView) bool

ShaderDataBase.Model

func (s *ShaderDataBase) Model() matrix.Mat4

ShaderDataBase.ModelPtr

func (s *ShaderDataBase) ModelPtr() *matrix.Mat4

ShaderDataBase.SelectLights

func (s *ShaderDataBase) SelectLights(lights LightsForRender)

ShaderDataBase.SetModel

func (s *ShaderDataBase) SetModel(model matrix.Mat4)

ShaderDataBase.Setup

func (s *ShaderDataBase) Setup()

ShaderDataBase.SkinningHeader

func (s *ShaderDataBase) SkinningHeader() *SkinnedShaderDataHeader

ShaderDataBase.Transform

func (s *ShaderDataBase) Transform() *matrix.Transform

ShaderDataBase.UpdateBoundData

func (s *ShaderDataBase) UpdateBoundData() bool

ShaderDataBase.UpdateModel

func (s *ShaderDataBase) UpdateModel(viewCuller ViewCuller, container graviton.AABB)

ShaderDataBase.UpdateModelForView

func (s *ShaderDataBase) UpdateModelForView(view *RenderView, viewCuller ViewCuller, container graviton.AABB) bool

ShaderDataCombine

struct

type ShaderDataCombine struct {
    ShaderDataBase
    Color matrix.Color
}

ShaderDataCombine.Size

func (t ShaderDataCombine) Size() int

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

func (sd ShaderDataCompiled) DrawInstanceDataName() string

ShaderDataCompiled.IsCompute

func (s *ShaderDataCompiled) IsCompute() bool

ShaderDataCompiled.RenderViewModeCompatible

func (s ShaderDataCompiled) RenderViewModeCompatible(other ShaderDataCompiled) bool

ShaderDataCompiled.SelectLayout

func (s *ShaderDataCompiled) SelectLayout(stage string) *ShaderLayoutGroup

ShaderDataCompiled.Stride

func (sd *ShaderDataCompiled) Stride() uint32

ShaderDataCompiled.ToAttributeDescription

func (sd *ShaderDataCompiled) ToAttributeDescription(locationStart uint32) []vk.VertexInputAttributeDescription

ShaderDataCompiled.ToDescriptorSetLayoutStructure

func (sd *ShaderDataCompiled) ToDescriptorSetLayoutStructure() DescriptorSetLayoutStructure

ShaderDataCompiled.WorkGroups

func (sd *ShaderDataCompiled) WorkGroups() [3]uint32

ShaderDraw

struct

type ShaderDraw struct {
    // Has unexported fields.
}

NewShaderDraw

func NewShaderDraw(material *Material) ShaderDraw

ShaderDraw.AddInstanceGroup

func (s *ShaderDraw) AddInstanceGroup(group DrawInstanceGroup)

ShaderDraw.Clear

func (s *ShaderDraw) Clear()

ShaderDraw.Destroy

func (s *ShaderDraw) Destroy(device *GPUDevice)

ShaderDraw.Filter

func (s *ShaderDraw) Filter(filter func(*DrawInstanceGroup) bool) []*DrawInstanceGroup

ShaderDriverData

struct

type ShaderDriverData struct {
    DescriptorSetLayoutStructure
    Stride                uint32
    AttributeDescriptions []vk.VertexInputAttributeDescription
}

NewShaderDriverData

func NewShaderDriverData() ShaderDriverData

ShaderId

struct

type ShaderId struct {
    // Has unexported fields.
}

ShaderId.IsValid

func (s ShaderId) IsValid() bool

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

func (l *ShaderLayout) Capacity() int

ShaderLayout.DescriptorType

func (l *ShaderLayout) DescriptorType() vulkan_const.DescriptorType

ShaderLayout.FullName

func (l *ShaderLayout) FullName() string

ShaderLayout.IsBuffer

func (l *ShaderLayout) IsBuffer() bool

ShaderLayout.Stride

func (l *ShaderLayout) Stride() int

ShaderLayoutGroup

struct

type ShaderLayoutGroup struct {
    Type       string
    WorkGroups [3]uint32
    Layouts    []ShaderLayout
}

ShaderLayoutGroup.DescriptorFlag

func (g *ShaderLayoutGroup) DescriptorFlag() vulkan_const.ShaderStageFlagBits

ShaderLayoutStructField

struct

type ShaderLayoutStructField struct {
    Type string // float, vec3, mat4, etc.
    Name string
}

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

func (s *ShaderPipelineColorBlend) LogicOpToGPU() gpu_enums.LogicOp

ShaderPipelineColorBlend.LogicOpToVK

func (s *ShaderPipelineColorBlend) LogicOpToVK() vulkan_const.LogicOp

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

func (a *ShaderPipelineColorBlendAttachments) AlphaBlendOpToGPU() gpu_enums.BlendOp

ShaderPipelineColorBlendAttachments.AlphaBlendOpToVK

func (a *ShaderPipelineColorBlendAttachments) AlphaBlendOpToVK() vulkan_const.BlendOp

ShaderPipelineColorBlendAttachments.ColorBlendOpToGPU

func (a *ShaderPipelineColorBlendAttachments) ColorBlendOpToGPU() gpu_enums.BlendOp

ShaderPipelineColorBlendAttachments.ColorBlendOpToVK

func (a *ShaderPipelineColorBlendAttachments) ColorBlendOpToVK() vulkan_const.BlendOp

ShaderPipelineColorBlendAttachments.ColorWriteMaskToGPU

func (a *ShaderPipelineColorBlendAttachments) ColorWriteMaskToGPU() gpu_enums.ColorComponentFlags

ShaderPipelineColorBlendAttachments.ColorWriteMaskToVK

func (a *ShaderPipelineColorBlendAttachments) ColorWriteMaskToVK() vulkan_const.ColorComponentFlagBits

ShaderPipelineColorBlendAttachments.DstAlphaBlendFactorToGPU

func (a *ShaderPipelineColorBlendAttachments) DstAlphaBlendFactorToGPU() gpu_enums.BlendFactor

ShaderPipelineColorBlendAttachments.DstAlphaBlendFactorToVK

func (a *ShaderPipelineColorBlendAttachments) DstAlphaBlendFactorToVK() vulkan_const.BlendFactor

ShaderPipelineColorBlendAttachments.DstColorBlendFactorToGPU

func (a *ShaderPipelineColorBlendAttachments) DstColorBlendFactorToGPU() gpu_enums.BlendFactor

ShaderPipelineColorBlendAttachments.DstColorBlendFactorToVK

func (a *ShaderPipelineColorBlendAttachments) DstColorBlendFactorToVK() vulkan_const.BlendFactor

ShaderPipelineColorBlendAttachments.ListAlphaBlendOp

func (a *ShaderPipelineColorBlendAttachments) ListAlphaBlendOp() []string

ShaderPipelineColorBlendAttachments.ListColorBlendOp

func (a *ShaderPipelineColorBlendAttachments) ListColorBlendOp() []string

ShaderPipelineColorBlendAttachments.ListDstAlphaBlendFactor

func (a *ShaderPipelineColorBlendAttachments) ListDstAlphaBlendFactor() []string

ShaderPipelineColorBlendAttachments.ListDstColorBlendFactor

func (a *ShaderPipelineColorBlendAttachments) ListDstColorBlendFactor() []string

ShaderPipelineColorBlendAttachments.ListSrcAlphaBlendFactor

func (a *ShaderPipelineColorBlendAttachments) ListSrcAlphaBlendFactor() []string

ShaderPipelineColorBlendAttachments.ListSrcColorBlendFactor

func (a *ShaderPipelineColorBlendAttachments) ListSrcColorBlendFactor() []string

ShaderPipelineColorBlendAttachments.SrcAlphaBlendFactorToGPU

func (a *ShaderPipelineColorBlendAttachments) SrcAlphaBlendFactorToGPU() gpu_enums.BlendFactor

ShaderPipelineColorBlendAttachments.SrcAlphaBlendFactorToVK

func (a *ShaderPipelineColorBlendAttachments) SrcAlphaBlendFactorToVK() vulkan_const.BlendFactor

ShaderPipelineColorBlendAttachments.SrcColorBlendFactorToGPU

func (a *ShaderPipelineColorBlendAttachments) SrcColorBlendFactorToGPU() gpu_enums.BlendFactor

ShaderPipelineColorBlendAttachments.SrcColorBlendFactorToVK

func (a *ShaderPipelineColorBlendAttachments) SrcColorBlendFactorToVK() vulkan_const.BlendFactor

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

func (s *ShaderPipelineData) AlphaToCoverageEnableToVK() vk.Bool32

ShaderPipelineData.AlphaToOneEnableToVK

func (s *ShaderPipelineData) AlphaToOneEnableToVK() vk.Bool32

ShaderPipelineData.BackStencilOpStateToGPU

func (s *ShaderPipelineData) BackStencilOpStateToGPU() gpu_enums.StencilOpState

ShaderPipelineData.BackStencilOpStateToVK

func (s *ShaderPipelineData) BackStencilOpStateToVK() vk.StencilOpState

ShaderPipelineData.BlendConstants

func (s *ShaderPipelineData) BlendConstants() [4]float32

ShaderPipelineData.Compile

func (d *ShaderPipelineData) Compile(device *GPUPhysicalDevice) ShaderPipelineDataCompiled

ShaderPipelineData.DepthBiasEnableToVK

func (s *ShaderPipelineData) DepthBiasEnableToVK() vk.Bool32

ShaderPipelineData.DepthBoundsTestEnableToVK

func (s *ShaderPipelineData) DepthBoundsTestEnableToVK() vk.Bool32

ShaderPipelineData.DepthClampEnableToVK

func (s *ShaderPipelineData) DepthClampEnableToVK() vk.Bool32

ShaderPipelineData.DepthTestEnableToVK

func (s *ShaderPipelineData) DepthTestEnableToVK() vk.Bool32

ShaderPipelineData.DepthWriteEnableToVK

func (s *ShaderPipelineData) DepthWriteEnableToVK() vk.Bool32

ShaderPipelineData.FrontStencilOpStateToGPU

func (s *ShaderPipelineData) FrontStencilOpStateToGPU() gpu_enums.StencilOpState

TODO: This and the BackStencilOpStateToGPU are duplicates because of a bad structure setup, please fix later

ShaderPipelineData.FrontStencilOpStateToVK

func (s *ShaderPipelineData) FrontStencilOpStateToVK() vk.StencilOpState

ShaderPipelineData.ListBackCompareOp

func (s ShaderPipelineData) ListBackCompareOp() []string

ShaderPipelineData.ListBackDepthFailOp

func (s ShaderPipelineData) ListBackDepthFailOp() []string

ShaderPipelineData.ListBackFailOp

func (s ShaderPipelineData) ListBackFailOp() []string

ShaderPipelineData.ListBackPassOp

func (s ShaderPipelineData) ListBackPassOp() []string

ShaderPipelineData.ListBlendFactor

func (s ShaderPipelineData) ListBlendFactor() []string

ShaderPipelineData.ListBlendOp

func (s ShaderPipelineData) ListBlendOp() []string

ShaderPipelineData.ListCullMode

func (s ShaderPipelineData) ListCullMode() []string

ShaderPipelineData.ListDepthCompareOp

func (s ShaderPipelineData) ListDepthCompareOp() []string

ShaderPipelineData.ListFrontCompareOp

func (s ShaderPipelineData) ListFrontCompareOp() []string

ShaderPipelineData.ListFrontDepthFailOp

func (s ShaderPipelineData) ListFrontDepthFailOp() []string

ShaderPipelineData.ListFrontFace

func (s ShaderPipelineData) ListFrontFace() []string

ShaderPipelineData.ListFrontFailOp

func (s ShaderPipelineData) ListFrontFailOp() []string

ShaderPipelineData.ListFrontPassOp

func (s ShaderPipelineData) ListFrontPassOp() []string

ShaderPipelineData.ListLogicOp

func (s ShaderPipelineData) ListLogicOp() []string

ShaderPipelineData.ListPatchControlPoints

func (s ShaderPipelineData) ListPatchControlPoints() []string

ShaderPipelineData.ListPolygonMode

func (s ShaderPipelineData) ListPolygonMode() []string

ShaderPipelineData.ListRasterizationSamples

func (s ShaderPipelineData) ListRasterizationSamples() []string

ShaderPipelineData.ListTopology

func (s ShaderPipelineData) ListTopology() []string

ShaderPipelineData.LogicOpEnableToVK

func (s *ShaderPipelineData) LogicOpEnableToVK() vk.Bool32

ShaderPipelineData.PrimitiveRestartToVK

func (s *ShaderPipelineData) PrimitiveRestartToVK() vk.Bool32

ShaderPipelineData.RasterizerDiscardEnableToVK

func (s *ShaderPipelineData) RasterizerDiscardEnableToVK() vk.Bool32

ShaderPipelineData.SampleShadingEnableToVK

func (s *ShaderPipelineData) SampleShadingEnableToVK() vk.Bool32

ShaderPipelineData.StencilTestEnableToVK

func (s *ShaderPipelineData) StencilTestEnableToVK() vk.Bool32

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

func (s *ShaderPipelineGraphicsPipeline) PipelineCreateFlagsToGPU() gpu_enums.PipelineCreateFlags

ShaderPipelineGraphicsPipeline.PipelineCreateFlagsToVK

func (s *ShaderPipelineGraphicsPipeline) PipelineCreateFlagsToVK() vk.PipelineCreateFlags

ShaderPipelineGraphicsPipelineCompiled

struct

type ShaderPipelineGraphicsPipelineCompiled struct {
    Subpass             uint32
    PipelineCreateFlags gpu_enums.PipelineCreateFlags
}

ShaderPipelineInputAssembly

struct

type ShaderPipelineInputAssembly struct {
    Topology         string `options:"StringVkPrimitiveTopology"`
    PrimitiveRestart bool
}

ShaderPipelineInputAssembly.TopologyToGPU

func (s *ShaderPipelineInputAssembly) TopologyToGPU() gpu_enums.PrimitiveTopology

ShaderPipelineInputAssembly.TopologyToVK

func (s *ShaderPipelineInputAssembly) TopologyToVK() vulkan_const.PrimitiveTopology

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

func (s *ShaderPipelinePipelineRasterization) CullModeToGPU() gpu_enums.CullModeFlags

ShaderPipelinePipelineRasterization.CullModeToVK

func (s *ShaderPipelinePipelineRasterization) CullModeToVK() vulkan_const.CullModeFlagBits

ShaderPipelinePipelineRasterization.FrontFaceToGPU

func (s *ShaderPipelinePipelineRasterization) FrontFaceToGPU() gpu_enums.FrontFace

ShaderPipelinePipelineRasterization.FrontFaceToVK

func (s *ShaderPipelinePipelineRasterization) FrontFaceToVK() vulkan_const.FrontFace

ShaderPipelinePipelineRasterization.PolygonModeToGPU

func (s *ShaderPipelinePipelineRasterization) PolygonModeToGPU() gpu_enums.PolygonMode

ShaderPipelinePipelineRasterization.PolygonModeToVK

func (s *ShaderPipelinePipelineRasterization) PolygonModeToVK() vulkan_const.PolygonMode

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

func (s *ShaderPipelinePushConstant) ShaderStageFlagsToGPU() gpu_enums.ShaderStageFlags

ShaderPipelinePushConstant.ShaderStageFlagsToVK

func (s *ShaderPipelinePushConstant) ShaderStageFlagsToVK() vk.ShaderStageFlags

ShaderPipelinePushConstantCompiled

struct

type ShaderPipelinePushConstantCompiled struct {
    Size       uint32
    StageFlags gpu_enums.ShaderStageFlags
}

ShaderPipelineTessellation

struct

type ShaderPipelineTessellation struct {
    PatchControlPoints string `options:"StringVkPatchControlPoints"`
}

ShaderPipelineTessellation.PatchControlPointsToGPU

func (s *ShaderPipelineTessellation) PatchControlPointsToGPU() uint32

ShaderPipelineTessellation.PatchControlPointsToVK

func (s *ShaderPipelineTessellation) PatchControlPointsToVK() uint32

ShaderPipelineTessellationCompiled

struct

type ShaderPipelineTessellationCompiled struct {
    PatchControlPoints uint32
}

ShaderType

int

type ShaderType int

const ( ShaderTypeGraphics ShaderType = iota ShaderTypeCompute )

SkinnedShaderDataHeader

struct

type SkinnedShaderDataHeader struct {
    // Has unexported fields.
}

SkinnedShaderDataHeader.BoneByIndex

func (h *SkinnedShaderDataHeader) BoneByIndex(index int) *BoneTransform

SkinnedShaderDataHeader.CreateBones

func (h *SkinnedShaderDataHeader) CreateBones(ids []int32)

SkinnedShaderDataHeader.FindBone

func (h *SkinnedShaderDataHeader) FindBone(id int32) *BoneTransform

SkinnedShaderDataHeader.HasBones

func (h *SkinnedShaderDataHeader) HasBones() bool

SkinnedShaderDataHeader.SkinNamedDataInstanceSize

func (h *SkinnedShaderDataHeader) SkinNamedDataInstanceSize() int

SkinnedShaderDataHeader.SkinNamedDataPointer

func (h *SkinnedShaderDataHeader) SkinNamedDataPointer() unsafe.Pointer

SkinnedShaderDataHeader.SkinUpdateNamedData

func (h *SkinnedShaderDataHeader) SkinUpdateNamedData() bool

TextShaderData

struct

type TextShaderData struct {
    ShaderDataBase
    UVs     matrix.Vec4
    FgColor matrix.Color
    BgColor matrix.Color
    Scissor matrix.Vec4
    PxRange matrix.Vec2
}

TextShaderData.Size

func (s TextShaderData) Size() int

Texture

struct

type Texture struct {
    TextureId
    Key               string
    TexturePixelCache []byte
    Filter            int

    // Has unexported fields.
}

NewTexture

func NewTexture(assetDb assets.Database, key string, filter textures.Filter) (*Texture, error)

NewTextureFromImage

func NewTextureFromImage(key string, data []byte, filter textures.Filter) (*Texture, error)

NewTextureFromMemory

func NewTextureFromMemory(key string, data []byte, width, height int, filter textures.Filter) (*Texture, error)

Texture.DelayedCreate

func (t *Texture) DelayedCreate(device *GPUDevice)

Texture.DelayedCreateInBatch

func (t *Texture) DelayedCreateInBatch(device *GPUDevice, batch *TextureUploadBatch)

Texture.ReadAllPixels

func (t *Texture) ReadAllPixels(app *GPUApplication) ([]byte, error)

Texture.ReadPendingDataForTransparency

func (t *Texture) ReadPendingDataForTransparency() bool

Texture.ReadPixel

func (t *Texture) ReadPixel(app *GPUApplication, x, y int) matrix.Color

Texture.ReadPixelRegion

func (t *Texture) ReadPixelRegion(app *GPUApplication, rect matrix.Vec4i) ([]byte, error)

Texture.Reload

func (t *Texture) Reload(assetDb assets.Database) error

Texture.SetPendingDataDimensions

func (t *Texture) SetPendingDataDimensions(dim textures.Dimensions)

Texture.Size

func (t *Texture) Size() matrix.Vec2

Texture.WritePixels

func (t *Texture) WritePixels(device *GPUDevice, requests []GPUImageWriteRequest)

TextureCache

struct

type TextureCache struct {
    // Has unexported fields.
}

NewTextureCache

func NewTextureCache(device *GPUDevice, assetDatabase assets.Database) TextureCache

TextureCache.Destroy

func (t *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

func (t *TextureCache) Find(textureKey string, filter textures.Filter) (*Texture, bool)

TextureCache.ForceRemoveTexture

func (t *TextureCache) ForceRemoveTexture(key string, filter textures.Filter)

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

func (t *TextureCache) InsertTexture(tex *Texture)

TextureCache.InsertTextureWithPriority

func (t *TextureCache) InsertTextureWithPriority(tex *Texture, priority TextureUploadPriority)

TextureCache.ProcessPending

func (t *TextureCache) ProcessPending()

TextureCache.ReloadTexture

func (t *TextureCache) ReloadTexture(textureKey string, filter textures.Filter) error

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

func (t *TextureCache) SetUploadBudget(budget TextureUploadBudget)

TextureCache.Texture

func (t *TextureCache) Texture(textureKey string, filter textures.Filter) (*Texture, error)

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

type TextureCleanup struct {
    // Has unexported fields.
}

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

func (t TextureId) IsValid() bool

TextureUploadBatch

struct

type TextureUploadBatch struct {
    // Has unexported fields.
}

TextureUploadBatch.DeferCleanup

func (b *TextureUploadBatch) DeferCleanup(call func())

TextureUploadBatch.End

func (b *TextureUploadBatch) End()

TextureUploadBudget

struct

type TextureUploadBudget struct {
    MaxCreatesPerFrame int
    MaxBytesPerFrame   uintptr
}

TextureUploadPriority

int

type TextureUploadPriority int

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

func BuiltInMeshData(key string) ([]Vertex, []uint32, bool)

MeshPlaneData

func MeshPlaneData() ([]Vertex, []uint32)

MeshQuadData

func MeshQuadData() ([]Vertex, []uint32)

ViewCuller

interface

type ViewCuller interface {
    IsInView(box graviton.AABB) bool
    ViewChanged() bool
}