Skip to content

package rendering

import "kaijuengine.com/rendering"

Constants

FontJustifyLeft

FontJustify(iota)

FontJustifyCenter

FontJustifyRight

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")

MaxJoints

50

MaxSkinInstances

50

GPUSuccess

iota

GPUNotReady

GPUTimeout

GPUEventSet

GPUEventReset

GPUIncomplete

GPUErrorOutOfHostMemory

GPUErrorOutOfDeviceMemory

GPUErrorInitializationFailed

GPUErrorDeviceLost

GPUErrorMemoryMapFailed

GPUErrorLayerNotPresent

GPUErrorExtensionNotPresent

GPUErrorFeatureNotPresent

GPUErrorIncompatibleDriver

GPUErrorTooManyObjects

GPUErrorFormatNotSupported

GPUErrorFragmentedPool

GPUErrorOutOfPoolMemory

GPUErrorInvalidExternalHandle

GPUErrorSurfaceLost

GPUErrorNativeWindowInUse

GPUSuboptimal

GPUErrorOutOfDate

GPUErrorIncompatibleDisplay

GPUErrorValidationFailed

GPUErrorInvalidShaderNv

GPUErrorInvalidDrmFormatModifierPlaneLayout

GPUErrorFragmentation

GPUErrorNotPermitted

MaxLocalLights

20

MaxCascades

3

LightTypeDirectional

LightType(iota)

LightTypePoint

LightTypeSpot

QuadPivotCenter

QuadPivot(iota)

QuadPivotLeft

QuadPivotTop

QuadPivotRight

QuadPivotBottom

QuadPivotBottomLeft

QuadPivotBottomRight

QuadPivotTopLeft

QuadPivotTopRight

QuaternionSize

[int(unsafe](../int(unsafe).[Sizeof(matrix](../int(unsafe#Sizeof(matrix)

CubeMapSides

6

BytesInPixel

4

MaxCommandPools

5

MaxSecondaryCommands

25

DefaultFontEMSize

14.0

GPUWholeSize

(^uintptr(0))

GenerateUniqueTextureKey

""

Variables

StringVkFormat

map[string]vulkan_const.Format{

StringVkBlendFactor

map[string]vulkan_const.BlendFactor{

StringVkBlendOp

map[string]vulkan_const.BlendOp{

StringVkLogicOp

map[string]vulkan_const.LogicOp{

StringVkCompareOp

map[string]vulkan_const.CompareOp{

StringVkStencilOp

map[string]vulkan_const.StencilOp{

StringVkPrimitiveTopology

map[string]vulkan_const.PrimitiveTopology{

StringVkPolygonMode

map[string]vulkan_const.PolygonMode{

StringVkCullModeFlagBits

map[string]vulkan_const.CullModeFlagBits{

StringVkFrontFace

map[string]vulkan_const.FrontFace{

StringVkSampleCountFlagBits

map[string]GPUSampleCountFlags{

StringVkPatchControlPoints

map[string]uint32{

StringVkAttachmentLoadOp

map[string]GPUAttachmentLoadOp{

StringVkAttachmentStoreOp

map[string]GPUAttachmentStoreOp{

StringVkImageLayout

map[string]GPUImageLayout{

StringVkPipelineStageFlagBits

map[string]vulkan_const.PipelineStageFlagBits{

StringVkAccessFlagBits

map[string]GPUAccessFlags{

StringVkShaderStageFlagBits

map[string]vulkan_const.ShaderStageFlagBits{

StringVkPipelineBindPoint

map[string]vulkan_const.PipelineBindPoint{

StringVkDependencyFlagBits

map[string]vulkan_const.DependencyFlagBits{

StringVkColorComponentFlagBits

map[string]vulkan_const.ColorComponentFlagBits{

StringVkPipelineCreateFlagBits

map[string]vulkan_const.PipelineCreateFlagBits{

StringVkImageTiling

map[string]GPUImageTiling{

StringVkFilter

map[string]GPUFilter{

StringVkImageUsageFlagBits

map[string]GPUImageUsageFlags{

StringVkMemoryPropertyFlagBits

map[string]GPUMemoryPropertyFlags{

StringVkImageAspectFlagBits

map[string]GPUImageAspectFlags{

StringVkMap

map[string]any{

Functions

SetupLightMaterials

func SetupLightMaterials(materialCache *MaterialCache) error

TextureKeys

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

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 GPUBufferUsageFlags, properties GPUMemoryPropertyFlags) error

ComputeShaderBuffer.WriteDescriptors

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

ComputeTask

struct

type ComputeTask struct {
    Shader         *Shader
    DescriptorSets []GPUDescriptorSet
    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
}

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 collision.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

DrawInstanceGroup

struct

type DrawInstanceGroup struct {
    Mesh *Mesh
    InstanceDriverData
    MaterialInstance *Material

    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.Clear

func (d *DrawInstanceGroup) Clear()

DrawInstanceGroup.Destroy

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

DrawInstanceGroup.IsEmpty

func (d *DrawInstanceGroup) IsEmpty() bool

DrawInstanceGroup.IsReady

func (d *DrawInstanceGroup) IsReady() bool

DrawInstanceGroup.TotalSize

func (d *DrawInstanceGroup) TotalSize() int

DrawInstanceGroup.UpdateData

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

DrawInstanceGroup.VisibleCount

func (d *DrawInstanceGroup) VisibleCount() int

DrawInstanceGroup.VisibleSize

func (d *DrawInstanceGroup) VisibleSize() int

Drawing

struct

type Drawing struct {
    Material   *Material
    Mesh       *Mesh
    ShaderData DrawInstance
    Transform  *matrix.Transform
    Sort       int
    ViewCuller ViewCuller
}

Drawing.IsValid

func (d *Drawing) IsValid() 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.Clear

func (d *Drawings) Clear()

Drawings.Destroy

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

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)

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.MeasureStringWithin

func (cache *FontCache) MeasureStringWithin(face FontFace, text string, scale, maxWidth float32, lineHeight float32) matrix.Vec2

FontCache.PointOffsetWithin

func (cache *FontCache) PointOffsetWithin(face FontFace, text string, point matrix.Vec2, scale, maxWidth float32) int

FontCache.PreloadFace

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.StringRectsWithinNew

func (cache *FontCache) StringRectsWithinNew(face FontFace, text string, scale, maxWidth 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

GPUAccessFlags

uint32

type GPUAccessFlags uint32

const ( GPUAccessIndirectCommandReadBit GPUAccessFlags = (1 << iota) GPUAccessIndexReadBit GPUAccessVertexAttributeReadBit GPUAccessUniformReadBit GPUAccessInputAttachmentReadBit GPUAccessShaderReadBit GPUAccessShaderWriteBit GPUAccessColorAttachmentReadBit GPUAccessColorAttachmentWriteBit GPUAccessDepthStencilAttachmentReadBit GPUAccessDepthStencilAttachmentWriteBit GPUAccessTransferReadBit GPUAccessTransferWriteBit GPUAccessHostReadBit GPUAccessHostWriteBit GPUAccessMemoryReadBit GPUAccessMemoryWriteBit GPUAccessTransformFeedbackWriteBit GPUAccessTransformFeedbackCounterReadBit GPUAccessTransformFeedbackCounterWriteBit GPUAccessConditionalRenderingReadBit GPUAccessCommandProcessReadBitNvx GPUAccessCommandProcessWriteBitNvx GPUAccessColorAttachmentReadNoncoherentBit GPUAccessShadingRateImageReadBitNv GPUAccessAccelerationStructureReadBitNvx GPUAccessAccelerationStructureWriteBitNvx )

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.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.SetupDebug

func (g *GPUApplicationInstance) SetupDebug()

GPUApplicationInstance.SetupLogicalDevice

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

GPUApplicationVersion

struct

type GPUApplicationVersion struct {
    Major int
    Minor int
    Patch int
}

GPUAttachmentLoadOp

uint8

type GPUAttachmentLoadOp uint8

const ( GPUAttachmentLoadOpLoad GPUAttachmentLoadOp = iota GPUAttachmentLoadOpClear GPUAttachmentLoadOpDontCare )

GPUAttachmentStoreOp

uint8

type GPUAttachmentStoreOp uint8

const ( GPUAttachmentStoreOpStore GPUAttachmentStoreOp = iota GPUAttachmentStoreOpDontCare )

GPUBuffer

struct

type GPUBuffer struct{ GPUHandle }

GPUBufferUsageFlags

uint16

type GPUBufferUsageFlags uint16

const ( GPUBufferUsageTransferSrcBit GPUBufferUsageFlags = (1 << iota) GPUBufferUsageTransferDstBit GPUBufferUsageUniformTexelBufferBit GPUBufferUsageStorageTexelBufferBit GPUBufferUsageUniformBufferBit GPUBufferUsageStorageBufferBit GPUBufferUsageIndexBufferBit GPUBufferUsageVertexBufferBit GPUBufferUsageIndirectBufferBit GPUBufferUsageTransformFeedbackBufferBit GPUBufferUsageTransformFeedbackCounterBufferBit GPUBufferUsageConditionalRenderingBit GPUBufferUsageRaytracingBitNvx )

GPUColorSpace

int32

type GPUColorSpace int32

const ( GPUColorSpaceSrgbNonlinear GPUColorSpace = iota GPUColorSpaceDisplayP3Nonlinear GPUColorSpaceExtendedSrgbLinear GPUColorSpaceDciP3Linear GPUColorSpaceDciP3Nonlinear GPUColorSpaceBt709Linear GPUColorSpaceBt709Nonlinear GPUColorSpaceBt2020Linear GPUColorSpaceHdr10St2084 GPUColorSpaceDolbyvision GPUColorSpaceHdr10Hlg GPUColorSpaceAdobergbLinear GPUColorSpaceAdobergbNonlinear GPUColorSpacePassThrough GPUColorSpaceExtendedSrgbNonlinear )

GPUCompositeAlphaFlags

int32

type GPUCompositeAlphaFlags int32

const ( GPUCompositeAlphaOpaqueBit GPUCompositeAlphaFlags = (1 << iota) GPUCompositeAlphaPreMultipliedBit GPUCompositeAlphaPostMultipliedBit GPUCompositeAlphaInheritBit )

GPUDescriptorImageInfo

struct

type GPUDescriptorImageInfo struct {
    Sampler     GPUSampler
    ImageView   GPUImageView
    ImageLayout GPUImageLayout
}

GPUDescriptorPool

struct

type GPUDescriptorPool struct{ GPUHandle }

GPUDescriptorSet

struct

type GPUDescriptorSet struct{ GPUHandle }

GPUDescriptorSetLayout

struct

type GPUDescriptorSetLayout struct{ GPUHandle }

GPUDevice

struct

type GPUDevice struct {
    PhysicalDevice GPUPhysicalDevice
    LogicalDevice  GPULogicalDevice
    Painter        GPUPainter

    // Has unexported fields.
}

GPUDevice.BlitTargets

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

GPUDevice.CopyBuffer

func (g *GPUDevice) CopyBuffer(srcBuffer GPUBuffer, dstBuffer GPUBuffer, size uintptr)

GPUDevice.CopyBufferToImage

func (g *GPUDevice) CopyBufferToImage(buffer GPUBuffer, image GPUImage, width, height uint32, layerCount int)

GPUDevice.CreateBuffer

func (g *GPUDevice) CreateBuffer(size uintptr, usage GPUBufferUsageFlags, properties GPUMemoryPropertyFlags) (GPUBuffer, GPUDeviceMemory, error)

GPUDevice.CreateFrameBuffer

func (g *GPUDevice) CreateFrameBuffer(renderPass *RenderPass, attachments []GPUImageView, width, height int32) (GPUFrameBuffer, error)

GPUDevice.CreateImage

func (g *GPUDevice) CreateImage(id *TextureId, properties GPUMemoryPropertyFlags, req GPUImageCreateRequest) error

GPUDevice.CreateIndexBuffer

func (g *GPUDevice) CreateIndexBuffer(indices []uint32) (GPUBuffer, GPUDeviceMemory, 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 GPUFilter) (GPUSampler, error)

GPUDevice.CreateVertexBuffer

func (g *GPUDevice) CreateVertexBuffer(verts []Vertex) (GPUBuffer, GPUDeviceMemory, error)

GPUDevice.DestroyBuffer

func (g *GPUDevice) DestroyBuffer(buffer GPUBuffer)

GPUDevice.DestroyFrameBuffer

func (g *GPUDevice) DestroyFrameBuffer(frameBuffer GPUFrameBuffer)

GPUDevice.DestroyShaderHandle

func (g *GPUDevice) DestroyShaderHandle(id ShaderId)

GPUDevice.Draw

func (g *GPUDevice) Draw(renderPass *RenderPass, drawings []ShaderDraw, lights LightsForRender, shadows []TextureId)

GPUDevice.FreeMemory

func (g *GPUDevice) FreeMemory(memory GPUDeviceMemory)

GPUDevice.GenerateMipMaps

func (g *GPUDevice) GenerateMipMaps(texId *TextureId, imageFormat GPUFormat, texWidth, texHeight, mipLevels uint32, filter GPUFilter) error

GPUDevice.MapMemory

func (g *GPUDevice) MapMemory(memory GPUDeviceMemory, offset uintptr, size uintptr, flags GPUMemoryFlags, 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.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) bool

GPUDevice.SetupTexture

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

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.TextureWritePixels

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

GPUDevice.TransitionImageLayout

func (g *GPUDevice) TransitionImageLayout(vt *TextureId, newLayout GPUImageLayout, aspectMask GPUImageAspectFlags, newAccess GPUAccessFlags, cmd *CommandRecorder)

GPUDevice.UnmapMemory

func (g *GPUDevice) UnmapMemory(memory GPUDeviceMemory)

GPUDevice.WriteBufferToImageRegion

func (g *GPUDevice) WriteBufferToImageRegion(image GPUImage, requests []GPUImageWriteRequest) error

GPUDeviceMemory

struct

type GPUDeviceMemory struct{ GPUHandle }

GPUFence

struct

type GPUFence struct{ GPUHandle }

GPUFilter

uint8

type GPUFilter uint8

const ( GPUFilterNearest GPUFilter = iota GPUFilterLinear GPUFilterCubicImg )

GPUFormat

int32

type GPUFormat int32

const ( GPUFormatUndefined GPUFormat = iota GPUFormatR4g4UnormPack8 GPUFormatR4g4b4a4UnormPack16 GPUFormatB4g4r4a4UnormPack16 GPUFormatR5g6b5UnormPack16 GPUFormatB5g6r5UnormPack16 GPUFormatR5g5b5a1UnormPack16 GPUFormatB5g5r5a1UnormPack16 GPUFormatA1r5g5b5UnormPack16 GPUFormatR8Unorm GPUFormatR8Snorm GPUFormatR8Uscaled GPUFormatR8Sscaled GPUFormatR8Uint GPUFormatR8Sint GPUFormatR8Srgb GPUFormatR8g8Unorm GPUFormatR8g8Snorm GPUFormatR8g8Uscaled GPUFormatR8g8Sscaled GPUFormatR8g8Uint GPUFormatR8g8Sint GPUFormatR8g8Srgb GPUFormatR8g8b8Unorm GPUFormatR8g8b8Snorm GPUFormatR8g8b8Uscaled GPUFormatR8g8b8Sscaled GPUFormatR8g8b8Uint GPUFormatR8g8b8Sint GPUFormatR8g8b8Srgb GPUFormatB8g8r8Unorm GPUFormatB8g8r8Snorm GPUFormatB8g8r8Uscaled GPUFormatB8g8r8Sscaled GPUFormatB8g8r8Uint GPUFormatB8g8r8Sint GPUFormatB8g8r8Srgb GPUFormatR8g8b8a8Unorm GPUFormatR8g8b8a8Snorm GPUFormatR8g8b8a8Uscaled GPUFormatR8g8b8a8Sscaled GPUFormatR8g8b8a8Uint GPUFormatR8g8b8a8Sint GPUFormatR8g8b8a8Srgb GPUFormatB8g8r8a8Unorm GPUFormatB8g8r8a8Snorm GPUFormatB8g8r8a8Uscaled GPUFormatB8g8r8a8Sscaled GPUFormatB8g8r8a8Uint GPUFormatB8g8r8a8Sint GPUFormatB8g8r8a8Srgb GPUFormatA8b8g8r8UnormPack32 GPUFormatA8b8g8r8SnormPack32 GPUFormatA8b8g8r8UscaledPack32 GPUFormatA8b8g8r8SscaledPack32 GPUFormatA8b8g8r8UintPack32 GPUFormatA8b8g8r8SintPack32 GPUFormatA8b8g8r8SrgbPack32 GPUFormatA2r10g10b10UnormPack32 GPUFormatA2r10g10b10SnormPack32 GPUFormatA2r10g10b10UscaledPack32 GPUFormatA2r10g10b10SscaledPack32 GPUFormatA2r10g10b10UintPack32 GPUFormatA2r10g10b10SintPack32 GPUFormatA2b10g10r10UnormPack32 GPUFormatA2b10g10r10SnormPack32 GPUFormatA2b10g10r10UscaledPack32 GPUFormatA2b10g10r10SscaledPack32 GPUFormatA2b10g10r10UintPack32 GPUFormatA2b10g10r10SintPack32 GPUFormatR16Unorm GPUFormatR16Snorm GPUFormatR16Uscaled GPUFormatR16Sscaled GPUFormatR16Uint GPUFormatR16Sint GPUFormatR16Sfloat GPUFormatR16g16Unorm GPUFormatR16g16Snorm GPUFormatR16g16Uscaled GPUFormatR16g16Sscaled GPUFormatR16g16Uint GPUFormatR16g16Sint GPUFormatR16g16Sfloat GPUFormatR16g16b16Unorm GPUFormatR16g16b16Snorm GPUFormatR16g16b16Uscaled GPUFormatR16g16b16Sscaled GPUFormatR16g16b16Uint GPUFormatR16g16b16Sint GPUFormatR16g16b16Sfloat GPUFormatR16g16b16a16Unorm GPUFormatR16g16b16a16Snorm GPUFormatR16g16b16a16Uscaled GPUFormatR16g16b16a16Sscaled GPUFormatR16g16b16a16Uint GPUFormatR16g16b16a16Sint GPUFormatR16g16b16a16Sfloat GPUFormatR32Uint GPUFormatR32Sint GPUFormatR32Sfloat GPUFormatR32g32Uint GPUFormatR32g32Sint GPUFormatR32g32Sfloat GPUFormatR32g32b32Uint GPUFormatR32g32b32Sint GPUFormatR32g32b32Sfloat GPUFormatR32g32b32a32Uint GPUFormatR32g32b32a32Sint GPUFormatR32g32b32a32Sfloat GPUFormatR64Uint GPUFormatR64Sint GPUFormatR64Sfloat GPUFormatR64g64Uint GPUFormatR64g64Sint GPUFormatR64g64Sfloat GPUFormatR64g64b64Uint GPUFormatR64g64b64Sint GPUFormatR64g64b64Sfloat GPUFormatR64g64b64a64Uint GPUFormatR64g64b64a64Sint GPUFormatR64g64b64a64Sfloat GPUFormatB10g11r11UfloatPack32 GPUFormatE5b9g9r9UfloatPack32 GPUFormatD16Unorm GPUFormatX8D24UnormPack32 GPUFormatD32Sfloat GPUFormatS8Uint GPUFormatD16UnormS8Uint GPUFormatD24UnormS8Uint GPUFormatD32SfloatS8Uint GPUFormatBc1RgbUnormBlock GPUFormatBc1RgbSrgbBlock GPUFormatBc1RgbaUnormBlock GPUFormatBc1RgbaSrgbBlock GPUFormatBc2UnormBlock GPUFormatBc2SrgbBlock GPUFormatBc3UnormBlock GPUFormatBc3SrgbBlock GPUFormatBc4UnormBlock GPUFormatBc4SnormBlock GPUFormatBc5UnormBlock GPUFormatBc5SnormBlock GPUFormatBc6hUfloatBlock GPUFormatBc6hSfloatBlock GPUFormatBc7UnormBlock GPUFormatBc7SrgbBlock GPUFormatEtc2R8g8b8UnormBlock GPUFormatEtc2R8g8b8SrgbBlock GPUFormatEtc2R8g8b8a1UnormBlock GPUFormatEtc2R8g8b8a1SrgbBlock GPUFormatEtc2R8g8b8a8UnormBlock GPUFormatEtc2R8g8b8a8SrgbBlock GPUFormatEacR11UnormBlock GPUFormatEacR11SnormBlock GPUFormatEacR11g11UnormBlock GPUFormatEacR11g11SnormBlock GPUFormatAstc4x4UnormBlock GPUFormatAstc4x4SrgbBlock GPUFormatAstc5x4UnormBlock GPUFormatAstc5x4SrgbBlock GPUFormatAstc5x5UnormBlock GPUFormatAstc5x5SrgbBlock GPUFormatAstc6x5UnormBlock GPUFormatAstc6x5SrgbBlock GPUFormatAstc6x6UnormBlock GPUFormatAstc6x6SrgbBlock GPUFormatAstc8x5UnormBlock GPUFormatAstc8x5SrgbBlock GPUFormatAstc8x6UnormBlock GPUFormatAstc8x6SrgbBlock GPUFormatAstc8x8UnormBlock GPUFormatAstc8x8SrgbBlock GPUFormatAstc10x5UnormBlock GPUFormatAstc10x5SrgbBlock GPUFormatAstc10x6UnormBlock GPUFormatAstc10x6SrgbBlock GPUFormatAstc10x8UnormBlock GPUFormatAstc10x8SrgbBlock GPUFormatAstc10x10UnormBlock GPUFormatAstc10x10SrgbBlock GPUFormatAstc12x10UnormBlock GPUFormatAstc12x10SrgbBlock GPUFormatAstc12x12UnormBlock GPUFormatAstc12x12SrgbBlock GPUFormatG8b8g8r8422Unorm GPUFormatB8g8r8g8422Unorm GPUFormatG8B8R83plane420Unorm GPUFormatG8B8r82plane420Unorm GPUFormatG8B8R83plane422Unorm GPUFormatG8B8r82plane422Unorm GPUFormatG8B8R83plane444Unorm GPUFormatR10x6UnormPack16 GPUFormatR10x6g10x6Unorm2pack16 GPUFormatR10x6g10x6b10x6a10x6Unorm4pack16 GPUFormatG10x6b10x6g10x6r10x6422Unorm4pack16 GPUFormatB10x6g10x6r10x6g10x6422Unorm4pack16 GPUFormatG10x6B10x6R10x63plane420Unorm3pack16 GPUFormatG10x6B10x6r10x62plane420Unorm3pack16 GPUFormatG10x6B10x6R10x63plane422Unorm3pack16 GPUFormatG10x6B10x6r10x62plane422Unorm3pack16 GPUFormatG10x6B10x6R10x63plane444Unorm3pack16 GPUFormatR12x4UnormPack16 GPUFormatR12x4g12x4Unorm2pack16 GPUFormatR12x4g12x4b12x4a12x4Unorm4pack16 GPUFormatG12x4b12x4g12x4r12x4422Unorm4pack16 GPUFormatB12x4g12x4r12x4g12x4422Unorm4pack16 GPUFormatG12x4B12x4R12x43plane420Unorm3pack16 GPUFormatG12x4B12x4r12x42plane420Unorm3pack16 GPUFormatG12x4B12x4R12x43plane422Unorm3pack16 GPUFormatG12x4B12x4r12x42plane422Unorm3pack16 GPUFormatG12x4B12x4R12x43plane444Unorm3pack16 GPUFormatG16b16g16r16422Unorm GPUFormatB16g16r16g16422Unorm GPUFormatG16B16R163plane420Unorm GPUFormatG16B16r162plane420Unorm GPUFormatG16B16R163plane422Unorm GPUFormatG16B16r162plane422Unorm GPUFormatG16B16R163plane444Unorm GPUFormatPvrtc12bppUnormBlockImg GPUFormatPvrtc14bppUnormBlockImg GPUFormatPvrtc22bppUnormBlockImg GPUFormatPvrtc24bppUnormBlockImg GPUFormatPvrtc12bppSrgbBlockImg GPUFormatPvrtc14bppSrgbBlockImg GPUFormatPvrtc22bppSrgbBlockImg GPUFormatPvrtc24bppSrgbBlockImg )

GPUFormatFeatureFlags

int32

type GPUFormatFeatureFlags int32

const ( GPUFormatFeatureSampledImageBit GPUFormatFeatureFlags = iota GPUFormatFeatureStorageImageBit GPUFormatFeatureStorageImageAtomicBit GPUFormatFeatureUniformTexelBufferBit GPUFormatFeatureStorageTexelBufferBit GPUFormatFeatureStorageTexelBufferAtomicBit GPUFormatFeatureVertexBufferBit GPUFormatFeatureColorAttachmentBit GPUFormatFeatureColorAttachmentBlendBit GPUFormatFeatureDepthStencilAttachmentBit GPUFormatFeatureBlitSrcBit GPUFormatFeatureBlitDstBit GPUFormatFeatureSampledImageFilterLinearBit GPUFormatFeatureTransferSrcBit GPUFormatFeatureTransferDstBit GPUFormatFeatureMidpointChromaSamplesBit GPUFormatFeatureSampledImageYcbcrConversionLinearFilterBit GPUFormatFeatureSampledImageYcbcrConversionSeparateReconstructionFilterBit GPUFormatFeatureSampledImageYcbcrConversionChromaReconstructionExplicitBit GPUFormatFeatureSampledImageYcbcrConversionChromaReconstructionExplicitForceableBit GPUFormatFeatureDisjointBit GPUFormatFeatureCositedChromaSamplesBit GPUFormatFeatureSampledImageFilterCubicBitImg GPUFormatFeatureSampledImageFilterMinmaxBit )

GPUFormatProperties

struct

type GPUFormatProperties struct {
    LinearTilingFeatures  GPUFormatFeatureFlags
    OptimalTilingFeatures GPUFormatFeatureFlags
    BufferFeatures        GPUFormatFeatureFlags
}

GPUFrameBuffer

struct

type GPUFrameBuffer struct{ GPUHandle }

GPUHandle

struct

type GPUHandle struct {
    // Has unexported fields.
}

GPUHandle.HandleAddr

func (g *GPUHandle) HandleAddr() unsafe.Pointer

GPUHandle.IsValid

func (g *GPUHandle) IsValid() bool

GPUHandle.Reset

func (g *GPUHandle) Reset()

GPUImage

struct

type GPUImage struct{ GPUHandle }

GPUImageAspectFlags

uint16

type GPUImageAspectFlags uint16

const ( GPUImageAspectColorBit GPUImageAspectFlags = (1 << iota) GPUImageAspectDepthBit GPUImageAspectStencilBit GPUImageAspectMetadataBit GPUImageAspectPlane0Bit GPUImageAspectPlane1Bit GPUImageAspectPlane2Bit GPUImageAspectMemoryPlane0Bit GPUImageAspectMemoryPlane1Bit GPUImageAspectMemoryPlane2Bit GPUImageAspectMemoryPlane3Bit )

GPUImageCreateFlags

uint16

type GPUImageCreateFlags uint16

const ( GPUImageCreateSparseBindingBit GPUImageCreateFlags = (1 << iota) GPUImageCreateSparseResidencyBit GPUImageCreateSparseAliasedBit GPUImageCreateMutableFormatBit GPUImageCreateCubeCompatibleBit GPUImageCreateAliasBit GPUImageCreateSplitInstanceBindRegionsBit GPUImageCreate2dArrayCompatibleBit GPUImageCreateBlockTexelViewCompatibleBit GPUImageCreateExtendedUsageBit GPUImageCreateProtectedBit GPUImageCreateDisjointBit GPUImageCreateCornerSampledBitNv GPUImageCreateSampleLocationsCompatibleDepthBit )

GPUImageCreateRequest

struct

type GPUImageCreateRequest struct {
    Flags       GPUImageCreateFlags
    ImageType   GPUImageType
    Format      GPUFormat
    Extent      matrix.Vec3i
    MipLevels   uint32
    ArrayLayers uint32
    Samples     GPUSampleCountFlags
    Tiling      GPUImageTiling
    Usage       GPUImageUsageFlags
}

GPUImageLayout

uint16

type GPUImageLayout uint16

const ( GPUImageLayoutUndefined GPUImageLayout = iota GPUImageLayoutGeneral GPUImageLayoutColorAttachmentOptimal GPUImageLayoutDepthStencilAttachmentOptimal GPUImageLayoutDepthStencilReadOnlyOptimal GPUImageLayoutShaderReadOnlyOptimal GPUImageLayoutTransferSrcOptimal GPUImageLayoutTransferDstOptimal GPUImageLayoutPreinitialized GPUImageLayoutDepthReadOnlyStencilAttachmentOptimal GPUImageLayoutDepthAttachmentStencilReadOnlyOptimal GPUImageLayoutPresentSrc GPUImageLayoutSharedPresent GPUImageLayoutShadingRateOptimalNv )

GPUImageTiling

uint8

type GPUImageTiling uint8

const ( GPUImageTilingOptimal GPUImageTiling = iota GPUImageTilingLinear GPUImageTilingDrmFormatModifier )

GPUImageType

uint8

type GPUImageType uint8

const ( GPUImageType1d GPUImageType = iota GPUImageType2d GPUImageType3d )

GPUImageUsageFlags

int32

type GPUImageUsageFlags int32

const ( GPUImageUsageTransferSrcBit GPUImageUsageFlags = (1 << iota) GPUImageUsageTransferDstBit GPUImageUsageSampledBit GPUImageUsageStorageBit GPUImageUsageColorAttachmentBit GPUImageUsageDepthStencilAttachmentBit GPUImageUsageTransientAttachmentBit GPUImageUsageInputAttachmentBit GPUImageUsageShadingRateImageBitNv )

GPUImageView

struct

type GPUImageView struct{ GPUHandle }

GPUImageViewType

uint8

type GPUImageViewType uint8

const ( GPUImageViewType1d GPUImageViewType = iota GPUImageViewType2d GPUImageViewType3d GPUImageViewTypeCube GPUImageViewType1dArray GPUImageViewType2dArray GPUImageViewTypeCubeArray )

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
    // Has unexported fields.
}

GPULogicalDevice

struct

type GPULogicalDevice struct {
    GPUHandle

    SwapChain GPUSwapChain

    // Has unexported fields.
}

GPULogicalDevice.CreateImageView

func (g *GPULogicalDevice) CreateImageView(id *TextureId, aspectFlags GPUImageAspectFlags, viewType GPUImageViewType) error

GPULogicalDevice.Destroy

func (g *GPULogicalDevice) Destroy()

GPULogicalDevice.DestroyFence

func (g *GPULogicalDevice) DestroyFence(fence *GPUFence)

GPULogicalDevice.DestroyGroup

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

GPULogicalDevice.DestroySemaphore

func (g *GPULogicalDevice) DestroySemaphore(semaphore *GPUSemaphore)

GPULogicalDevice.FreeTexture

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

GPULogicalDevice.ImageMemoryRequirements

func (g *GPULogicalDevice) ImageMemoryRequirements(image GPUImage) GPUMemoryRequirements

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.SetupDebug

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

GPULogicalDevice.WaitForFences

func (g *GPULogicalDevice) WaitForFences(fences []GPUFence)

GPULogicalDevice.WaitForRender

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

GPULogicalDevice.WaitIdle

func (g *GPULogicalDevice) WaitIdle()

GPUMemoryFlags

uint16

type GPUMemoryFlags uint16

const ( GPUMemoryMapPlacedBit GPUMemoryFlags = (1 << iota) )

GPUMemoryHeap

struct

type GPUMemoryHeap struct {
    Size  uintptr
    Flags GPUMemoryHeapFlags
}

GPUMemoryHeapFlags

uint8

type GPUMemoryHeapFlags uint8

const ( GPUMemoryHeapDeviceLocalBit GPUMemoryHeapFlags = (1 << iota) GPUMemoryHeapMultiInstanceBit )

GPUMemoryPropertyFlags

uint8

type GPUMemoryPropertyFlags uint8

const ( GPUMemoryPropertyDeviceLocalBit GPUMemoryPropertyFlags = (1 << iota) GPUMemoryPropertyHostVisibleBit GPUMemoryPropertyHostCoherentBit GPUMemoryPropertyHostCachedBit GPUMemoryPropertyLazilyAllocatedBit GPUMemoryPropertyProtectedBit )

GPUMemoryRequirements

struct

type GPUMemoryRequirements struct {
    Size           uintptr
    Alignment      uintptr
    MemoryTypeBits uint32
}

GPUMemoryType

struct

type GPUMemoryType struct {
    PropertyFlags GPUMemoryPropertyFlags
    HeapIndex     uint32
}

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      []GPUSurfaceFormat
    PresentModes        []GPUPresentMode
    SurfaceCapabilities GPUSurfaceCapabilities
    // 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 GPUMemoryPropertyFlags) int

GPUPhysicalDevice.FindPresentFamily

func (g *GPUPhysicalDevice) FindPresentFamily() GPUQueueFamily

GPUPhysicalDevice.FindSupportedFormat

func (g *GPUPhysicalDevice) FindSupportedFormat(candidates []GPUFormat, tiling GPUImageTiling, features GPUFormatFeatureFlags) GPUFormat

GPUPhysicalDevice.FormatIsTileable

func (g *GPUPhysicalDevice) FormatIsTileable(format GPUFormat, tiling GPUImageTiling) bool

GPUPhysicalDevice.FormatProperties

func (g *GPUPhysicalDevice) FormatProperties(format GPUFormat) GPUFormatProperties

GPUPhysicalDevice.IsExtensionSupported

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

GPUPhysicalDevice.IsValid

func (g *GPUPhysicalDevice) IsValid() bool

GPUPhysicalDevice.MaxUsableSampleCount

func (g *GPUPhysicalDevice) MaxUsableSampleCount() GPUSampleCountFlags

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                    GPUSampleCountFlags
    FramebufferDepthSampleCounts                    GPUSampleCountFlags
    FramebufferStencilSampleCounts                  GPUSampleCountFlags
    FramebufferNoAttachmentsSampleCounts            GPUSampleCountFlags
    MaxColorAttachments                             uint32
    SampledImageColorSampleCounts                   GPUSampleCountFlags
    SampledImageIntegerSampleCounts                 GPUSampleCountFlags
    SampledImageDepthSampleCounts                   GPUSampleCountFlags
    SampledImageStencilSampleCounts                 GPUSampleCountFlags
    StorageImageSampleCounts                        GPUSampleCountFlags
    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 []GPUMemoryType
    MemoryHeaps []GPUMemoryHeap
}

GPUPhysicalDeviceProperties

struct

type GPUPhysicalDeviceProperties struct {
    ApiVersion        uint32
    DriverVersion     uint32
    VendorID          uint32
    DeviceID          uint32
    DeviceType        GPUPhysicalDeviceType
    DeviceName        string
    PipelineCacheUUID string
    Limits            GPUPhysicalDeviceLimits
    SparseProperties  GPUPhysicalDeviceSparseProperties
}

GPUPhysicalDeviceSparseProperties

struct

type GPUPhysicalDeviceSparseProperties struct {
    ResidencyStandard2DBlockShape            bool
    ResidencyStandard2DMultisampleBlockShape bool
    ResidencyStandard3DBlockShape            bool
    ResidencyAlignedMipSize                  bool
    ResidencyNonResidentStrict               bool
}

GPUPhysicalDeviceType

uint8

type GPUPhysicalDeviceType uint8

const ( GPUPhysicalDeviceTypeOther GPUPhysicalDeviceType = iota GPUPhysicalDeviceTypeIntegratedGpu GPUPhysicalDeviceTypeDiscreteGpu GPUPhysicalDeviceTypeVirtualGpu GPUPhysicalDeviceTypeCpu )

GPUPipeline

struct

type GPUPipeline struct{ GPUHandle }

GPUPipelineLayout

struct

type GPUPipelineLayout struct{ GPUHandle }

GPUPipelineStageFlags

uint32

type GPUPipelineStageFlags uint32

const ( GPUPipelineStageTopOfPipeBit GPUPipelineStageFlags = (1 << iota) GPUPipelineStageDrawIndirectBit GPUPipelineStageVertexInputBit GPUPipelineStageVertexShaderBit GPUPipelineStageTessellationControlShaderBit GPUPipelineStageTessellationEvaluationShaderBit GPUPipelineStageGeometryShaderBit GPUPipelineStageFragmentShaderBit GPUPipelineStageEarlyFragmentTestsBit GPUPipelineStageLateFragmentTestsBit GPUPipelineStageColorAttachmentOutputBit GPUPipelineStageComputeShaderBit GPUPipelineStageTransferBit GPUPipelineStageBottomOfPipeBit GPUPipelineStageHostBit GPUPipelineStageAllGraphicsBit GPUPipelineStageAllCommandsBit GPUPipelineStageTransformFeedbackBit GPUPipelineStageConditionalRenderingBit GPUPipelineStageCommandProcessBitNvx GPUPipelineStageShadingRateImageBitNv GPUPipelineStageRaytracingBitNvx GPUPipelineStageTaskShaderBitNv GPUPipelineStageMeshShaderBitNv )

GPUPresentMode

int32

type GPUPresentMode int32

const ( GPUPresentModeImmediate GPUPresentMode = iota GPUPresentModeMailbox GPUPresentModeFifo GPUPresentModeFifoRelaxed GPUPresentModeSharedDemandRefresh GPUPresentModeSharedContinuousRefresh )

GPUQueue

struct

type GPUQueue struct{ GPUHandle }

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

GPUResult

int32

type GPUResult int32

GPUSampleCountFlags

uint8

type GPUSampleCountFlags uint8

const ( GPUSampleCount1Bit GPUSampleCountFlags = (1 << iota) GPUSampleCount2Bit GPUSampleCount4Bit GPUSampleCount8Bit GPUSampleCount16Bit GPUSampleCount32Bit GPUSampleCount64Bit GPUSampleSwapChainCount )

GPUSampler

struct

type GPUSampler struct{ GPUHandle }

GPUSemaphore

struct

type GPUSemaphore struct{ GPUHandle }

GPUShaderModule

struct

type GPUShaderModule struct{ GPUHandle }

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)

GPUSurfaceCapabilities

struct

type GPUSurfaceCapabilities struct {
    MinImageCount           uint32
    MaxImageCount           uint32
    CurrentExtent           matrix.Vec2i
    MinImageExtent          matrix.Vec2i
    MaxImageExtent          matrix.Vec2i
    MaxImageArrayLayers     uint32
    SupportedTransforms     GPUSurfaceTransformFlags
    CurrentTransform        GPUSurfaceTransformFlags
    SupportedCompositeAlpha GPUCompositeAlphaFlags
    SupportedUsageFlags     GPUImageUsageFlags
}

GPUSurfaceFormat

struct

type GPUSurfaceFormat struct {
    Format     GPUFormat
    ColorSpace GPUColorSpace
}

GPUSurfaceTransformFlags

int32

type GPUSurfaceTransformFlags int32

const ( GPUSurfaceTransformIdentityBit GPUSurfaceTransformFlags = (1 << iota) GPUSurfaceTransformRotate90Bit GPUSurfaceTransformRotate180Bit GPUSurfaceTransformRotate270Bit GPUSurfaceTransformHorizontalMirrorBit GPUSurfaceTransformHorizontalMirrorRotate90Bit GPUSurfaceTransformHorizontalMirrorRotate180Bit GPUSurfaceTransformHorizontalMirrorRotate270Bit GPUSurfaceTransformInheritBit )

GPUSwapChain

struct

type GPUSwapChain struct {
    GPUHandle
    Images       []TextureId
    Extent       matrix.Vec2i
    Depth        TextureId
    Color        TextureId
    FrameBuffers []GPUFrameBuffer

    // Has unexported fields.
}

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) GPUPresentMode

GPUSwapChain.SelectSurfaceFormat

func (g *GPUSwapChain) SelectSurfaceFormat(device *GPUPhysicalDevice) GPUSurfaceFormat

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

GPUSwapChainSupportDetails

struct

type GPUSwapChainSupportDetails struct {
    // Has unexported fields.
}

GlobalShaderData

struct

type GlobalShaderData struct {
    View             matrix.Mat4
    Projection       matrix.Mat4
    UIView           matrix.Mat4
    UIProjection     matrix.Mat4
    CameraPosition   matrix.Vec4
    UICameraPosition matrix.Vec3
    Time             float32
    ScreenSize       matrix.Vec2
    CascadeCount     int32

    CascadePlaneDistances [4]float32
    VertLights            [MaxLocalLights]GPULight
    LightInfos            [MaxLocalLights]GPULightInfo
    // Has unexported fields.
}

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, assetDb assets.Database, materialCache *MaterialCache, lightType LightType) Light

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.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
    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.SelectRoot

func (m *Material) SelectRoot() *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)

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
    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() TextureFilter

Mesh

struct

type Mesh struct {
    MeshId MeshId

    // Has unexported fields.
}

NewMesh

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

NewMeshArrow

func NewMeshArrow(cache *MeshCache, shaftLength, shaftRadius, tipHeight, tipRadius float32, segments int) *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

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() collision.AABB

Mesh.DelayedCreate

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

Mesh.IsReady

func (m Mesh) IsReady() bool

Mesh.Key

func (m Mesh) Key() string

Mesh.SetKey

func (m *Mesh) SetKey(key string)

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.CreatePending

func (m *MeshCache) CreatePending()

MeshCache.Destroy

func (m *MeshCache) Destroy()

MeshCache.FindMesh

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

MeshCache.Mesh

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

MeshCache.RemoveMesh

func (m *MeshCache) RemoveMesh(key string)

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.IsValid

func (m MeshId) IsValid() bool

PointShadow

struct

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

QuadPivot

int32

type QuadPivot = int32

RenderCaches

interface

type RenderCaches interface {
    ShaderCache() *ShaderCache
    TextureCache() *TextureCache
    MeshCache() *MeshCache
    FontCache() *FontCache
    MaterialCache() *MaterialCache
    AssetDatabase() assets.Database
}

RenderPass

struct

type RenderPass struct {
    Handle vk.RenderPass
    Buffer GPUFrameBuffer

    // 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.FinalLayoutToVK

func (ad *RenderPassAttachmentDescription) FinalLayoutToVK() GPUImageLayout

RenderPassAttachmentDescription.FormatToVK

func (ad *RenderPassAttachmentDescription) FormatToVK(device *GPUDevice) GPUFormat

RenderPassAttachmentDescription.InitialLayoutToVK

func (ad *RenderPassAttachmentDescription) InitialLayoutToVK() GPUImageLayout

RenderPassAttachmentDescription.LoadOpToVK

func (ad *RenderPassAttachmentDescription) LoadOpToVK() GPUAttachmentLoadOp

RenderPassAttachmentDescription.SamplesToVK

func (ad *RenderPassAttachmentDescription) SamplesToVK(device *GPUPhysicalDevice) GPUSampleCountFlags

RenderPassAttachmentDescription.StencilLoadOpToVK

func (ad *RenderPassAttachmentDescription) StencilLoadOpToVK() GPUAttachmentLoadOp

RenderPassAttachmentDescription.StencilStoreOpToVK

func (ad *RenderPassAttachmentDescription) StencilStoreOpToVK() GPUAttachmentStoreOp

RenderPassAttachmentDescription.StoreOpToVK

func (ad *RenderPassAttachmentDescription) StoreOpToVK() GPUAttachmentStoreOp

RenderPassAttachmentDescriptionCompiled

struct

type RenderPassAttachmentDescriptionCompiled struct {
    Format         GPUFormat
    Samples        GPUSampleCountFlags
    LoadOp         GPUAttachmentLoadOp
    StoreOp        GPUAttachmentStoreOp
    StencilLoadOp  GPUAttachmentLoadOp
    StencilStoreOp GPUAttachmentStoreOp
    InitialLayout  GPUImageLayout
    FinalLayout    GPUImageLayout
    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.AccessToVK

func (ai *RenderPassAttachmentImage) AccessToVK() GPUAccessFlags

RenderPassAttachmentImage.AspectToVK

func (ai *RenderPassAttachmentImage) AspectToVK() GPUImageAspectFlags

RenderPassAttachmentImage.FilterToVK

func (ai *RenderPassAttachmentImage) FilterToVK() GPUFilter

RenderPassAttachmentImage.IsInvalid

func (img *RenderPassAttachmentImage) IsInvalid() bool

RenderPassAttachmentImage.MemoryPropertyToVK

func (ai *RenderPassAttachmentImage) MemoryPropertyToVK() GPUMemoryPropertyFlags

RenderPassAttachmentImage.TilingToVK

func (ai *RenderPassAttachmentImage) TilingToVK() GPUImageTiling

RenderPassAttachmentImage.UsageToVK

func (ai *RenderPassAttachmentImage) UsageToVK() GPUImageUsageFlags

RenderPassAttachmentImageClear

struct

type RenderPassAttachmentImageClear struct {
    R       float32
    G       float32
    B       float32
    A       float32
    Depth   float32
    Stencil uint32
}

RenderPassAttachmentImageCompiled

struct

type RenderPassAttachmentImageCompiled struct {
    Name           string
    ExistingImage  string
    MipLevels      uint32
    LayerCount     uint32
    Tiling         GPUImageTiling
    Filter         GPUFilter
    Usage          GPUImageUsageFlags
    MemoryProperty GPUMemoryPropertyFlags
    Aspect         GPUImageAspectFlags
    Access         GPUAccessFlags
}

RenderPassAttachmentImageCompiled.IsInvalid

func (img *RenderPassAttachmentImageCompiled) IsInvalid() bool

RenderPassAttachmentReference

struct

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

RenderPassAttachmentReference.LayoutToVK

func (ad *RenderPassAttachmentReference) LayoutToVK() GPUImageLayout

RenderPassAttachmentReferenceCompiled

struct

type RenderPassAttachmentReferenceCompiled struct {
    Attachment uint32
    Layout     vulkan_const.ImageLayout
}

RenderPassData

struct

type RenderPassData struct {
    Name                   string
    Sort                   int
    AttachmentDescriptions []RenderPassAttachmentDescription
    SubpassDescriptions    []RenderPassSubpassDescription
    SubpassDependencies    []RenderPassSubpassDependency
    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            []vk.ClearValue
    Subpass                []RenderPassSubpassDataCompiled
    SkipCombine            bool
}

RenderPassDataCompiled.ConstructRenderPass

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

RenderPassGroup

struct

type RenderPassGroup struct {
    // Has unexported fields.
}

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.DependencyFlagsToVK

func (sd *RenderPassSubpassDependency) DependencyFlagsToVK() vk.DependencyFlags

RenderPassSubpassDependency.DstAccessMaskToVK

func (sd *RenderPassSubpassDependency) DstAccessMaskToVK() GPUAccessFlags

RenderPassSubpassDependency.DstStageMaskToVK

func (sd *RenderPassSubpassDependency) DstStageMaskToVK() vk.PipelineStageFlags

RenderPassSubpassDependency.SrcAccessMaskToVK

func (sd *RenderPassSubpassDependency) SrcAccessMaskToVK() GPUAccessFlags

RenderPassSubpassDependency.SrcStageMaskToVK

func (sd *RenderPassSubpassDependency) SrcStageMaskToVK() vk.PipelineStageFlags

RenderPassSubpassDependencyCompiled

struct

type RenderPassSubpassDependencyCompiled struct {
    SrcSubpass      uint32
    DstSubpass      uint32
    SrcStageMask    vk.PipelineStageFlags
    DstStageMask    vk.PipelineStageFlags
    SrcAccessMask   vk.AccessFlags
    DstAccessMask   vk.AccessFlags
    DependencyFlags vk.DependencyFlags
}

RenderPassSubpassDescription

struct

type RenderPassSubpassDescription struct {
    PipelineBindPoint         string `options:"StringVkPipelineBindPoint"`
    ColorAttachmentReferences []RenderPassAttachmentReference
    InputAttachmentReferences []RenderPassAttachmentReference
    ResolveAttachments        []RenderPassAttachmentReference
    DepthStencilAttachment    []RenderPassAttachmentReference // 1 max
    PreserveAttachments       []uint32                        // TODO
    Subpass                   RenderPassSubpassData
}

RenderPassSubpassDescription.PipelineBindPointToVK

func (ad *RenderPassSubpassDescription) PipelineBindPointToVK() vulkan_const.PipelineBindPoint

RenderPassSubpassDescriptionCompiled

struct

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

RenderPassSubpassImageData

struct

type RenderPassSubpassImageData struct {
    SampledImage string
}

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.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
    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

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.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 collision.AABB)

ShaderDataCombine

struct

type ShaderDataCombine struct {
    ShaderDataBase
    Color matrix.Color
}

ShaderDataCombine.Size

func (t ShaderDataCombine) Size() int

ShaderDataCompiled

struct

type ShaderDataCompiled struct {
    Name                   string
    Vertex                 string
    Fragment               string
    Geometry               string
    TessellationControl    string
    TessellationEvaluation string
    Compute                string
    LayoutGroups           []ShaderLayoutGroup
    SamplerLabels          []string
}

ShaderDataCompiled.IsCompute

func (s *ShaderDataCompiled) IsCompute() 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.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.AlphaBlendOpToVK

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

ShaderPipelineColorBlendAttachments.BlendEnableToVK

func (a *ShaderPipelineColorBlendAttachments) BlendEnableToVK() vk.Bool32

ShaderPipelineColorBlendAttachments.ColorBlendOpToVK

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

ShaderPipelineColorBlendAttachments.ColorWriteMaskToVK

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

ShaderPipelineColorBlendAttachments.DstAlphaBlendFactorToVK

func (a *ShaderPipelineColorBlendAttachments) DstAlphaBlendFactorToVK() vulkan_const.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.SrcAlphaBlendFactorToVK

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

ShaderPipelineColorBlendAttachments.SrcColorBlendFactorToVK

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

ShaderPipelineColorBlendAttachmentsCompiled

struct

type ShaderPipelineColorBlendAttachmentsCompiled struct {
    BlendEnable         vk.Bool32
    SrcColorBlendFactor vulkan_const.BlendFactor
    DstColorBlendFactor vulkan_const.BlendFactor
    ColorBlendOp        vulkan_const.BlendOp
    SrcAlphaBlendFactor vulkan_const.BlendFactor
    DstAlphaBlendFactor vulkan_const.BlendFactor
    AlphaBlendOp        vulkan_const.BlendOp
    ColorWriteMask      vk.ColorComponentFlags
}

ShaderPipelineColorBlendCompiled

struct

type ShaderPipelineColorBlendCompiled struct {
    LogicOpEnable  vk.Bool32
    LogicOp        vulkan_const.LogicOp
    BlendConstants [4]float32
}

ShaderPipelineData

struct

type ShaderPipelineData struct {
    Name                  string
    InputAssembly         ShaderPipelineInputAssembly
    Rasterization         ShaderPipelinePipelineRasterization
    Multisample           ShaderPipelinePipelineMultisample
    ColorBlend            ShaderPipelineColorBlend
    ColorBlendAttachments []ShaderPipelineColorBlendAttachments
    DepthStencil          ShaderPipelineDepthStencil
    Tessellation          ShaderPipelineTessellation
    GraphicsPipeline      ShaderPipelineGraphicsPipeline
    PushConstant          ShaderPipelinePushConstant
}

ShaderPipelineData.AlphaToCoverageEnableToVK

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

ShaderPipelineData.AlphaToOneEnableToVK

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

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.FrontStencilOpStateToVK

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

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

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       vk.Bool32
    DepthWriteEnable      vk.Bool32
    DepthCompareOp        vulkan_const.CompareOp
    DepthBoundsTestEnable vk.Bool32
    StencilTestEnable     vk.Bool32
    Front                 vk.StencilOpState
    Back                  vk.StencilOpState
    MinDepthBounds        float32
    MaxDepthBounds        float32
}

ShaderPipelineGraphicsPipeline

struct

type ShaderPipelineGraphicsPipeline struct {
    Subpass             uint32
    PipelineCreateFlags []string `options:"StringVkPipelineCreateFlagBits"`
}

ShaderPipelineGraphicsPipeline.PipelineCreateFlagsToVK

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

ShaderPipelineGraphicsPipelineCompiled

struct

type ShaderPipelineGraphicsPipelineCompiled struct {
    Subpass             uint32
    PipelineCreateFlags vk.PipelineCreateFlags
}

ShaderPipelineInputAssembly

struct

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

ShaderPipelineInputAssembly.TopologyToVK

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

ShaderPipelineInputAssemblyCompiled

struct

type ShaderPipelineInputAssemblyCompiled struct {
    Topology         vulkan_const.PrimitiveTopology
    PrimitiveRestart vk.Bool32
}

ShaderPipelinePipelineMultisample

struct

type ShaderPipelinePipelineMultisample struct {
    RasterizationSamples  string `options:"StringVkSampleCountFlagBits"`
    SampleShadingEnable   bool
    MinSampleShading      float32
    AlphaToCoverageEnable bool
    AlphaToOneEnable      bool
}

ShaderPipelinePipelineMultisample.RasterizationSamplesToVK

func (s *ShaderPipelinePipelineMultisample) RasterizationSamplesToVK(device *GPUPhysicalDevice) GPUSampleCountFlags

ShaderPipelinePipelineMultisampleCompiled

struct

type ShaderPipelinePipelineMultisampleCompiled struct {
    RasterizationSamples  vulkan_const.SampleCountFlagBits
    SampleShadingEnable   vk.Bool32
    MinSampleShading      float32
    AlphaToCoverageEnable vk.Bool32
    AlphaToOneEnable      vk.Bool32
}

ShaderPipelinePipelineRasterization

struct

type ShaderPipelinePipelineRasterization struct {
    DepthClampEnable        bool
    RasterizerDiscardEnable bool
    PolygonMode             string `options:"StringVkPolygonMode"`
    CullMode                string `options:"StringVkCullModeFlagBits"`
    FrontFace               string `options:"StringVkFrontFace"`
    DepthBiasEnable         bool
    DepthBiasConstantFactor float32
    DepthBiasClamp          float32
    DepthBiasSlopeFactor    float32
    LineWidth               float32
}

ShaderPipelinePipelineRasterization.CullModeToVK

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

ShaderPipelinePipelineRasterization.FrontFaceToVK

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

ShaderPipelinePipelineRasterization.PolygonModeToVK

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

ShaderPipelinePipelineRasterizationCompiled

struct

type ShaderPipelinePipelineRasterizationCompiled struct {
    DepthClampEnable        vk.Bool32
    DiscardEnable           vk.Bool32
    PolygonMode             vulkan_const.PolygonMode
    CullMode                vk.CullModeFlags
    FrontFace               vulkan_const.FrontFace
    DepthBiasEnable         vk.Bool32
    DepthBiasConstantFactor float32
    DepthBiasClamp          float32
    DepthBiasSlopeFactor    float32
    LineWidth               float32
}

ShaderPipelinePushConstant

struct

type ShaderPipelinePushConstant struct {
    Size       uint32
    StageFlags []string `options:"StringVkAccessFlagBits"`
}

ShaderPipelinePushConstant.ShaderStageFlagsToVK

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

ShaderPipelinePushConstantCompiled

struct

type ShaderPipelinePushConstantCompiled struct {
    Size       uint32
    StageFlags vk.ShaderStageFlags
}

ShaderPipelineTessellation

struct

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

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 {
    Key               string
    TexturePixelCache []byte
    RenderId          TextureId
    Channels          int
    Filter            int
    MipLevels         int
    Width             int
    Height            int
    CacheInvalid      bool

    // Has unexported fields.
}

NewTexture

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

NewTextureFromImage

func NewTextureFromImage(key string, data []byte, filter TextureFilter) (*Texture, error)

NewTextureFromMemory

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

Texture.DelayedCreate

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

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.Reload

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

Texture.SetPendingDataDimensions

func (t *Texture) SetPendingDataDimensions(dim TextureDimensions)

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.CreatePending

func (t *TextureCache) CreatePending()

TextureCache.Destroy

func (t *TextureCache) Destroy()

TextureCache.ForceRemoveTexture

func (t *TextureCache) ForceRemoveTexture(key string, filter TextureFilter)

TextureCache.InsertRawTexture

func (t *TextureCache) InsertRawTexture(key string, data []byte, width, height int, filter TextureFilter) (*Texture, error)

TextureCache.InsertTexture

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

TextureCache.ReloadTexture

func (t *TextureCache) ReloadTexture(textureKey string, filter TextureFilter) error

TextureCache.Texture

func (t *TextureCache) Texture(textureKey string, filter TextureFilter) (*Texture, error)

TextureCleanup

struct

type TextureCleanup struct {
    // Has unexported fields.
}

TextureColorFormat

int

type TextureColorFormat int

const ( TextureColorFormatRgbaUnorm TextureColorFormat = iota TextureColorFormatRgbUnorm TextureColorFormatRgbaSrgb TextureColorFormatRgbSrgb TextureColorFormatLuminance )

TextureData

struct

type TextureData struct {
    Mem            []byte
    InternalFormat TextureInputType
    Format         TextureColorFormat
    Type           TextureMemType
    Width          int
    Height         int
    InputType      TextureFileFormat
    Dimensions     TextureDimensions
}

ReadRawTextureData

func ReadRawTextureData(mem []byte, inputType TextureFileFormat) TextureData

TexturePixelsFromAsset

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

TextureDimensions

int

type TextureDimensions = int

const ( TextureDimensions2 TextureDimensions = iota TextureDimensions1 TextureDimensions3 TextureDimensionsCube )

TextureFileFormat

int

type TextureFileFormat = int

const ( TextureFileFormatAstc TextureFileFormat = iota TextureFileFormatPng TextureFileFormatRaw )

TextureFilter

int

type TextureFilter = int

const ( TextureFilterLinear TextureFilter = iota TextureFilterNearest TextureFilterMax )

TextureId

struct

type TextureId struct {
    Image      GPUImage
    Memory     GPUDeviceMemory
    View       GPUImageView
    Sampler    GPUSampler
    Format     GPUFormat
    MipLevels  uint32
    Layout     GPUImageLayout
    Access     GPUAccessFlags
    Samples    GPUSampleCountFlags
    Width      int
    Height     int
    LayerCount int
}

TextureId.IsValid

func (t TextureId) IsValid() bool

TextureInputType

int

type TextureInputType int

const ( TextureInputTypeCompressedRgbaAstc4x4 TextureInputType = iota TextureInputTypeCompressedRgbaAstc5x4 TextureInputTypeCompressedRgbaAstc5x5 TextureInputTypeCompressedRgbaAstc6x5 TextureInputTypeCompressedRgbaAstc6x6 TextureInputTypeCompressedRgbaAstc8x5 TextureInputTypeCompressedRgbaAstc8x6 TextureInputTypeCompressedRgbaAstc8x8 TextureInputTypeCompressedRgbaAstc10x5 TextureInputTypeCompressedRgbaAstc10x6 TextureInputTypeCompressedRgbaAstc10x8 TextureInputTypeCompressedRgbaAstc10x10 TextureInputTypeCompressedRgbaAstc12x10 TextureInputTypeCompressedRgbaAstc12x12 TextureInputTypeRgba8 TextureInputTypeRgb8 TextureInputTypeLuminance )

TextureMemType

int

type TextureMemType = int

const ( TextureMemTypeUnsignedByte TextureMemType = iota )

Vertex

struct

type Vertex struct {
    Position     matrix.Vec3
    Normal       matrix.Vec3
    Tangent      matrix.Vec4
    UV0          matrix.Vec2
    Color        matrix.Color
    JointIds     matrix.Vec4i
    JointWeights matrix.Vec4
    MorphTarget  matrix.Vec3
}

MeshPlaneData

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

MeshQuadData

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

ViewCuller

interface

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