vk

package
v0.20.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 12, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MinUniformBufferOffsetAlignment = 256   // NVidia
	MaxUniformBufferRange           = 65536 // NVidia
)
View Source
const (
	IMAGELayoutUndefined                             = ImageLayout(0)
	IMAGELayoutGeneral                               = ImageLayout(1)
	IMAGELayoutColorAttachmentOptimal                = ImageLayout(2)
	IMAGELayoutDepthStencilAttachmentOptimal         = ImageLayout(3)
	IMAGELayoutDepthStencilReadOnlyOptimal           = ImageLayout(4)
	IMAGELayoutShaderReadOnlyOptimal                 = ImageLayout(5)
	IMAGELayoutTransferSrcOptimal                    = ImageLayout(6)
	IMAGELayoutTransferDstOptimal                    = ImageLayout(7)
	IMAGELayoutPreinitialized                        = ImageLayout(8)
	IMAGELayoutDepthReadOnlyStencilAttachmentOptimal = ImageLayout(1000117000)
	IMAGELayoutDepthAttachmentStencilReadOnlyOptimal = ImageLayout(1000117001)
	IMAGELayoutDepthAttachmentOptimal                = ImageLayout(1000241000)
	IMAGELayoutDepthReadOnlyOptimal                  = ImageLayout(1000241001)
	IMAGELayoutStencilAttachmentOptimal              = ImageLayout(1000241002)
	IMAGELayoutStencilReadOnlyOptimal                = ImageLayout(1000241003)
	IMAGELayoutPresentSrcKhr                         = ImageLayout(1000001002)
	IMAGELayoutSharedPresentKhr                      = ImageLayout(1000111000)
	IMAGELayoutShadingRateOptimalNv                  = ImageLayout(1000164003)
	IMAGELayoutFragmentDensityMapOptimalExt          = ImageLayout(1000218000)
	IMAGELayoutReadOnlyOptimalKhr                    = ImageLayout(1000314000)
	IMAGELayoutAttachmentOptimalKhr                  = ImageLayout(1000314001)
)
View Source
const (
	FORMATUndefined                            = Format(0)
	FORMATR4g4UnormPack8                       = Format(1)
	FORMATR4g4b4a4UnormPack16                  = Format(2)
	FORMATB4g4r4a4UnormPack16                  = Format(3)
	FORMATR5g6b5UnormPack16                    = Format(4)
	FORMATB5g6r5UnormPack16                    = Format(5)
	FORMATR5g5b5a1UnormPack16                  = Format(6)
	FORMATB5g5r5a1UnormPack16                  = Format(7)
	FORMATA1r5g5b5UnormPack16                  = Format(8)
	FORMATR8Unorm                              = Format(9)
	FORMATR8Snorm                              = Format(10)
	FORMATR8Uscaled                            = Format(11)
	FORMATR8Sscaled                            = Format(12)
	FORMATR8Uint                               = Format(13)
	FORMATR8Sint                               = Format(14)
	FORMATR8Srgb                               = Format(15)
	FORMATR8g8Unorm                            = Format(16)
	FORMATR8g8Snorm                            = Format(17)
	FORMATR8g8Uscaled                          = Format(18)
	FORMATR8g8Sscaled                          = Format(19)
	FORMATR8g8Uint                             = Format(20)
	FORMATR8g8Sint                             = Format(21)
	FORMATR8g8Srgb                             = Format(22)
	FORMATR8g8b8Unorm                          = Format(23)
	FORMATR8g8b8Snorm                          = Format(24)
	FORMATR8g8b8Uscaled                        = Format(25)
	FORMATR8g8b8Sscaled                        = Format(26)
	FORMATR8g8b8Uint                           = Format(27)
	FORMATR8g8b8Sint                           = Format(28)
	FORMATR8g8b8Srgb                           = Format(29)
	FORMATB8g8r8Unorm                          = Format(30)
	FORMATB8g8r8Snorm                          = Format(31)
	FORMATB8g8r8Uscaled                        = Format(32)
	FORMATB8g8r8Sscaled                        = Format(33)
	FORMATB8g8r8Uint                           = Format(34)
	FORMATB8g8r8Sint                           = Format(35)
	FORMATB8g8r8Srgb                           = Format(36)
	FORMATR8g8b8a8Unorm                        = Format(37)
	FORMATR8g8b8a8Snorm                        = Format(38)
	FORMATR8g8b8a8Uscaled                      = Format(39)
	FORMATR8g8b8a8Sscaled                      = Format(40)
	FORMATR8g8b8a8Uint                         = Format(41)
	FORMATR8g8b8a8Sint                         = Format(42)
	FORMATR8g8b8a8Srgb                         = Format(43)
	FORMATB8g8r8a8Unorm                        = Format(44)
	FORMATB8g8r8a8Snorm                        = Format(45)
	FORMATB8g8r8a8Uscaled                      = Format(46)
	FORMATB8g8r8a8Sscaled                      = Format(47)
	FORMATB8g8r8a8Uint                         = Format(48)
	FORMATB8g8r8a8Sint                         = Format(49)
	FORMATB8g8r8a8Srgb                         = Format(50)
	FORMATA8b8g8r8UnormPack32                  = Format(51)
	FORMATA8b8g8r8SnormPack32                  = Format(52)
	FORMATA8b8g8r8UscaledPack32                = Format(53)
	FORMATA8b8g8r8SscaledPack32                = Format(54)
	FORMATA8b8g8r8UintPack32                   = Format(55)
	FORMATA8b8g8r8SintPack32                   = Format(56)
	FORMATA8b8g8r8SrgbPack32                   = Format(57)
	FORMATA2r10g10b10UnormPack32               = Format(58)
	FORMATA2r10g10b10SnormPack32               = Format(59)
	FORMATA2r10g10b10UscaledPack32             = Format(60)
	FORMATA2r10g10b10SscaledPack32             = Format(61)
	FORMATA2r10g10b10UintPack32                = Format(62)
	FORMATA2r10g10b10SintPack32                = Format(63)
	FORMATA2b10g10r10UnormPack32               = Format(64)
	FORMATA2b10g10r10SnormPack32               = Format(65)
	FORMATA2b10g10r10UscaledPack32             = Format(66)
	FORMATA2b10g10r10SscaledPack32             = Format(67)
	FORMATA2b10g10r10UintPack32                = Format(68)
	FORMATA2b10g10r10SintPack32                = Format(69)
	FORMATR16Unorm                             = Format(70)
	FORMATR16Snorm                             = Format(71)
	FORMATR16Uscaled                           = Format(72)
	FORMATR16Sscaled                           = Format(73)
	FORMATR16Uint                              = Format(74)
	FORMATR16Sint                              = Format(75)
	FORMATR16Sfloat                            = Format(76)
	FORMATR16g16Unorm                          = Format(77)
	FORMATR16g16Snorm                          = Format(78)
	FORMATR16g16Uscaled                        = Format(79)
	FORMATR16g16Sscaled                        = Format(80)
	FORMATR16g16Uint                           = Format(81)
	FORMATR16g16Sint                           = Format(82)
	FORMATR16g16Sfloat                         = Format(83)
	FORMATR16g16b16Unorm                       = Format(84)
	FORMATR16g16b16Snorm                       = Format(85)
	FORMATR16g16b16Uscaled                     = Format(86)
	FORMATR16g16b16Sscaled                     = Format(87)
	FORMATR16g16b16Uint                        = Format(88)
	FORMATR16g16b16Sint                        = Format(89)
	FORMATR16g16b16Sfloat                      = Format(90)
	FORMATR16g16b16a16Unorm                    = Format(91)
	FORMATR16g16b16a16Snorm                    = Format(92)
	FORMATR16g16b16a16Uscaled                  = Format(93)
	FORMATR16g16b16a16Sscaled                  = Format(94)
	FORMATR16g16b16a16Uint                     = Format(95)
	FORMATR16g16b16a16Sint                     = Format(96)
	FORMATR16g16b16a16Sfloat                   = Format(97)
	FORMATR32Uint                              = Format(98)
	FORMATR32Sint                              = Format(99)
	FORMATR32Sfloat                            = Format(100)
	FORMATR32g32Uint                           = Format(101)
	FORMATR32g32Sint                           = Format(102)
	FORMATR32g32Sfloat                         = Format(103)
	FORMATR32g32b32Uint                        = Format(104)
	FORMATR32g32b32Sint                        = Format(105)
	FORMATR32g32b32Sfloat                      = Format(106)
	FORMATR32g32b32a32Uint                     = Format(107)
	FORMATR32g32b32a32Sint                     = Format(108)
	FORMATR32g32b32a32Sfloat                   = Format(109)
	FORMATR64Uint                              = Format(110)
	FORMATR64Sint                              = Format(111)
	FORMATR64Sfloat                            = Format(112)
	FORMATR64g64Uint                           = Format(113)
	FORMATR64g64Sint                           = Format(114)
	FORMATR64g64Sfloat                         = Format(115)
	FORMATR64g64b64Uint                        = Format(116)
	FORMATR64g64b64Sint                        = Format(117)
	FORMATR64g64b64Sfloat                      = Format(118)
	FORMATR64g64b64a64Uint                     = Format(119)
	FORMATR64g64b64a64Sint                     = Format(120)
	FORMATR64g64b64a64Sfloat                   = Format(121)
	FORMATB10g11r11UfloatPack32                = Format(122)
	FORMATE5b9g9r9UfloatPack32                 = Format(123)
	FORMATD16Unorm                             = Format(124)
	FORMATX8D24UnormPack32                     = Format(125)
	FORMATD32Sfloat                            = Format(126)
	FORMATS8Uint                               = Format(127)
	FORMATD16UnormS8Uint                       = Format(128)
	FORMATD24UnormS8Uint                       = Format(129)
	FORMATD32SfloatS8Uint                      = Format(130)
	FORMATBc1RgbUnormBlock                     = Format(131)
	FORMATBc1RgbSrgbBlock                      = Format(132)
	FORMATBc1RgbaUnormBlock                    = Format(133)
	FORMATBc1RgbaSrgbBlock                     = Format(134)
	FORMATBc2UnormBlock                        = Format(135)
	FORMATBc2SrgbBlock                         = Format(136)
	FORMATBc3UnormBlock                        = Format(137)
	FORMATBc3SrgbBlock                         = Format(138)
	FORMATBc4UnormBlock                        = Format(139)
	FORMATBc4SnormBlock                        = Format(140)
	FORMATBc5UnormBlock                        = Format(141)
	FORMATBc5SnormBlock                        = Format(142)
	FORMATBc6hUfloatBlock                      = Format(143)
	FORMATBc6hSfloatBlock                      = Format(144)
	FORMATBc7UnormBlock                        = Format(145)
	FORMATBc7SrgbBlock                         = Format(146)
	FORMATEtc2R8g8b8UnormBlock                 = Format(147)
	FORMATEtc2R8g8b8SrgbBlock                  = Format(148)
	FORMATEtc2R8g8b8a1UnormBlock               = Format(149)
	FORMATEtc2R8g8b8a1SrgbBlock                = Format(150)
	FORMATEtc2R8g8b8a8UnormBlock               = Format(151)
	FORMATEtc2R8g8b8a8SrgbBlock                = Format(152)
	FORMATEacR11UnormBlock                     = Format(153)
	FORMATEacR11SnormBlock                     = Format(154)
	FORMATEacR11g11UnormBlock                  = Format(155)
	FORMATEacR11g11SnormBlock                  = Format(156)
	FORMATAstc4x4UnormBlock                    = Format(157)
	FORMATAstc4x4SrgbBlock                     = Format(158)
	FORMATAstc5x4UnormBlock                    = Format(159)
	FORMATAstc5x4SrgbBlock                     = Format(160)
	FORMATAstc5x5UnormBlock                    = Format(161)
	FORMATAstc5x5SrgbBlock                     = Format(162)
	FORMATAstc6x5UnormBlock                    = Format(163)
	FORMATAstc6x5SrgbBlock                     = Format(164)
	FORMATAstc6x6UnormBlock                    = Format(165)
	FORMATAstc6x6SrgbBlock                     = Format(166)
	FORMATAstc8x5UnormBlock                    = Format(167)
	FORMATAstc8x5SrgbBlock                     = Format(168)
	FORMATAstc8x6UnormBlock                    = Format(169)
	FORMATAstc8x6SrgbBlock                     = Format(170)
	FORMATAstc8x8UnormBlock                    = Format(171)
	FORMATAstc8x8SrgbBlock                     = Format(172)
	FORMATAstc10x5UnormBlock                   = Format(173)
	FORMATAstc10x5SrgbBlock                    = Format(174)
	FORMATAstc10x6UnormBlock                   = Format(175)
	FORMATAstc10x6SrgbBlock                    = Format(176)
	FORMATAstc10x8UnormBlock                   = Format(177)
	FORMATAstc10x8SrgbBlock                    = Format(178)
	FORMATAstc10x10UnormBlock                  = Format(179)
	FORMATAstc10x10SrgbBlock                   = Format(180)
	FORMATAstc12x10UnormBlock                  = Format(181)
	FORMATAstc12x10SrgbBlock                   = Format(182)
	FORMATAstc12x12UnormBlock                  = Format(183)
	FORMATAstc12x12SrgbBlock                   = Format(184)
	FORMATG8b8g8r8422Unorm                     = Format(1000156000)
	FORMATB8g8r8g8422Unorm                     = Format(1000156001)
	FORMATG8B8R83plane420Unorm                 = Format(1000156002)
	FORMATG8B8r82plane420Unorm                 = Format(1000156003)
	FORMATG8B8R83plane422Unorm                 = Format(1000156004)
	FORMATG8B8r82plane422Unorm                 = Format(1000156005)
	FORMATG8B8R83plane444Unorm                 = Format(1000156006)
	FORMATR10x6UnormPack16                     = Format(1000156007)
	FORMATR10x6g10x6Unorm2pack16               = Format(1000156008)
	FORMATR10x6g10x6b10x6a10x6Unorm4pack16     = Format(1000156009)
	FORMATG10x6b10x6g10x6r10x6422Unorm4pack16  = Format(1000156010)
	FORMATB10x6g10x6r10x6g10x6422Unorm4pack16  = Format(1000156011)
	FORMATG10x6B10x6R10x63plane420Unorm3pack16 = Format(1000156012)
	FORMATG10x6B10x6r10x62plane420Unorm3pack16 = Format(1000156013)
	FORMATG10x6B10x6R10x63plane422Unorm3pack16 = Format(1000156014)
	FORMATG10x6B10x6r10x62plane422Unorm3pack16 = Format(1000156015)
	FORMATG10x6B10x6R10x63plane444Unorm3pack16 = Format(1000156016)
	FORMATR12x4UnormPack16                     = Format(1000156017)
	FORMATR12x4g12x4Unorm2pack16               = Format(1000156018)
	FORMATR12x4g12x4b12x4a12x4Unorm4pack16     = Format(1000156019)
	FORMATG12x4b12x4g12x4r12x4422Unorm4pack16  = Format(1000156020)
	FORMATB12x4g12x4r12x4g12x4422Unorm4pack16  = Format(1000156021)
	FORMATG12x4B12x4R12x43plane420Unorm3pack16 = Format(1000156022)
	FORMATG12x4B12x4r12x42plane420Unorm3pack16 = Format(1000156023)
	FORMATG12x4B12x4R12x43plane422Unorm3pack16 = Format(1000156024)
	FORMATG12x4B12x4r12x42plane422Unorm3pack16 = Format(1000156025)
	FORMATG12x4B12x4R12x43plane444Unorm3pack16 = Format(1000156026)
	FORMATG16b16g16r16422Unorm                 = Format(1000156027)
	FORMATB16g16r16g16422Unorm                 = Format(1000156028)
	FORMATG16B16R163plane420Unorm              = Format(1000156029)
	FORMATG16B16r162plane420Unorm              = Format(1000156030)
	FORMATG16B16R163plane422Unorm              = Format(1000156031)
	FORMATG16B16r162plane422Unorm              = Format(1000156032)
	FORMATG16B16R163plane444Unorm              = Format(1000156033)
	FORMATPvrtc12bppUnormBlockImg              = Format(1000054000)
	FORMATPvrtc14bppUnormBlockImg              = Format(1000054001)
	FORMATPvrtc22bppUnormBlockImg              = Format(1000054002)
	FORMATPvrtc24bppUnormBlockImg              = Format(1000054003)
	FORMATPvrtc12bppSrgbBlockImg               = Format(1000054004)
	FORMATPvrtc14bppSrgbBlockImg               = Format(1000054005)
	FORMATPvrtc22bppSrgbBlockImg               = Format(1000054006)
	FORMATPvrtc24bppSrgbBlockImg               = Format(1000054007)
	FORMATAstc4x4SfloatBlockExt                = Format(1000066000)
	FORMATAstc5x4SfloatBlockExt                = Format(1000066001)
	FORMATAstc5x5SfloatBlockExt                = Format(1000066002)
	FORMATAstc6x5SfloatBlockExt                = Format(1000066003)
	FORMATAstc6x6SfloatBlockExt                = Format(1000066004)
	FORMATAstc8x5SfloatBlockExt                = Format(1000066005)
	FORMATAstc8x6SfloatBlockExt                = Format(1000066006)
	FORMATAstc8x8SfloatBlockExt                = Format(1000066007)
	FORMATAstc10x5SfloatBlockExt               = Format(1000066008)
	FORMATAstc10x6SfloatBlockExt               = Format(1000066009)
	FORMATAstc10x8SfloatBlockExt               = Format(1000066010)
	FORMATAstc10x10SfloatBlockExt              = Format(1000066011)
	FORMATAstc12x10SfloatBlockExt              = Format(1000066012)
	FORMATAstc12x12SfloatBlockExt              = Format(1000066013)
	FORMATA4r4g4b4UnormPack16Ext               = Format(1000340000)
	FORMATA4b4g4r4UnormPack16Ext               = Format(1000340001)
)
View Source
const (
	PHYSICALDeviceTypeOther         = PhysicalDeviceType(0)
	PHYSICALDeviceTypeIntegratedGpu = PhysicalDeviceType(1)
	PHYSICALDeviceTypeDiscreteGpu   = PhysicalDeviceType(2)
	PHYSICALDeviceTypeVirtualGpu    = PhysicalDeviceType(3)
	PHYSICALDeviceTypeCpu           = PhysicalDeviceType(4)
)
View Source
const (
	VERTEXInputRateVertex   = VertexInputRate(0)
	VERTEXInputRateInstance = VertexInputRate(1)
)
View Source
const (
	PRIMITIVETopologyPointList                  = PrimitiveTopology(0)
	PRIMITIVETopologyLineList                   = PrimitiveTopology(1)
	PRIMITIVETopologyLineStrip                  = PrimitiveTopology(2)
	PRIMITIVETopologyTriangleList               = PrimitiveTopology(3)
	PRIMITIVETopologyTriangleStrip              = PrimitiveTopology(4)
	PRIMITIVETopologyTriangleFan                = PrimitiveTopology(5)
	PRIMITIVETopologyLineListWithAdjacency      = PrimitiveTopology(6)
	PRIMITIVETopologyLineStripWithAdjacency     = PrimitiveTopology(7)
	PRIMITIVETopologyTriangleListWithAdjacency  = PrimitiveTopology(8)
	PRIMITIVETopologyTriangleStripWithAdjacency = PrimitiveTopology(9)
	PRIMITIVETopologyPatchList                  = PrimitiveTopology(10)
)
View Source
const (
	SAMPLERAddressModeRepeat            = SamplerAddressMode(0)
	SAMPLERAddressModeMirroredRepeat    = SamplerAddressMode(1)
	SAMPLERAddressModeClampToEdge       = SamplerAddressMode(2)
	SAMPLERAddressModeClampToBorder     = SamplerAddressMode(3)
	SAMPLERAddressModeMirrorClampToEdge = SamplerAddressMode(4)
)
View Source
const (
	DESCRIPTORTypeSampler                  = DescriptorType(0)
	DESCRIPTORTypeCombinedImageSampler     = DescriptorType(1)
	DESCRIPTORTypeSampledImage             = DescriptorType(2)
	DESCRIPTORTypeStorageImage             = DescriptorType(3)
	DESCRIPTORTypeUniformTexelBuffer       = DescriptorType(4)
	DESCRIPTORTypeStorageTexelBuffer       = DescriptorType(5)
	DESCRIPTORTypeUniformBuffer            = DescriptorType(6)
	DESCRIPTORTypeStorageBuffer            = DescriptorType(7)
	DESCRIPTORTypeUniformBufferDynamic     = DescriptorType(8)
	DESCRIPTORTypeStorageBufferDynamic     = DescriptorType(9)
	DESCRIPTORTypeInputAttachment          = DescriptorType(10)
	DESCRIPTORTypeInlineUniformBlockExt    = DescriptorType(1000138000)
	DESCRIPTORTypeAccelerationStructureKhr = DescriptorType(1000150000)
	DESCRIPTORTypeAccelerationStructureNv  = DescriptorType(1000165000)
	DESCRIPTORTypeMutableValve             = DescriptorType(1000351000)
)
View Source
const (
	IMAGEAspectColorBit           = ImageAspectFlags(0x1)
	IMAGEAspectDepthBit           = ImageAspectFlags(0x2)
	IMAGEAspectStencilBit         = ImageAspectFlags(0x4)
	IMAGEAspectMetadataBit        = ImageAspectFlags(0x8)
	IMAGEAspectPlane0Bit          = ImageAspectFlags(0x10)
	IMAGEAspectPlane1Bit          = ImageAspectFlags(0x20)
	IMAGEAspectPlane2Bit          = ImageAspectFlags(0x40)
	IMAGEAspectMemoryPlane0BitExt = ImageAspectFlags(0x80)
	IMAGEAspectMemoryPlane1BitExt = ImageAspectFlags(0x100)
	IMAGEAspectMemoryPlane2BitExt = ImageAspectFlags(0x200)
	IMAGEAspectMemoryPlane3BitExt = ImageAspectFlags(0x400)
)
View Source
const (
	IMAGEUsageTransferSrcBit            = ImageUsageFlags(0x1)
	IMAGEUsageTransferDstBit            = ImageUsageFlags(0x2)
	IMAGEUsageSampledBit                = ImageUsageFlags(0x4)
	IMAGEUsageStorageBit                = ImageUsageFlags(0x8)
	IMAGEUsageColorAttachmentBit        = ImageUsageFlags(0x10)
	IMAGEUsageDepthStencilAttachmentBit = ImageUsageFlags(0x20)
	IMAGEUsageTransientAttachmentBit    = ImageUsageFlags(0x40)
	IMAGEUsageInputAttachmentBit        = ImageUsageFlags(0x80)
	IMAGEUsageShadingRateImageBitNv     = ImageUsageFlags(0x100)
	IMAGEUsageFragmentDensityMapBitExt  = ImageUsageFlags(0x200)
)
View Source
const (
	QUEUEGraphicsBit      = QueueFlags(0x1)
	QUEUEComputeBit       = QueueFlags(0x2)
	QUEUETransferBit      = QueueFlags(0x4)
	QUEUESparseBindingBit = QueueFlags(0x8)
	QUEUEProtectedBit     = QueueFlags(0x10)
)
View Source
const (
	PIPELINEStageTopOfPipeBit                     = PipelineStageFlags(0x1)
	PIPELINEStageDrawIndirectBit                  = PipelineStageFlags(0x2)
	PIPELINEStageVertexInputBit                   = PipelineStageFlags(0x4)
	PIPELINEStageVertexShaderBit                  = PipelineStageFlags(0x8)
	PIPELINEStageTessellationControlShaderBit     = PipelineStageFlags(0x10)
	PIPELINEStageTessellationEvaluationShaderBit  = PipelineStageFlags(0x20)
	PIPELINEStageGeometryShaderBit                = PipelineStageFlags(0x40)
	PIPELINEStageFragmentShaderBit                = PipelineStageFlags(0x80)
	PIPELINEStageEarlyFragmentTestsBit            = PipelineStageFlags(0x100)
	PIPELINEStageLateFragmentTestsBit             = PipelineStageFlags(0x200)
	PIPELINEStageColorAttachmentOutputBit         = PipelineStageFlags(0x400)
	PIPELINEStageComputeShaderBit                 = PipelineStageFlags(0x800)
	PIPELINEStageTransferBit                      = PipelineStageFlags(0x1000)
	PIPELINEStageBottomOfPipeBit                  = PipelineStageFlags(0x2000)
	PIPELINEStageHostBit                          = PipelineStageFlags(0x4000)
	PIPELINEStageAllGraphicsBit                   = PipelineStageFlags(0x8000)
	PIPELINEStageAllCommandsBit                   = PipelineStageFlags(0x10000)
	PIPELINEStageTransformFeedbackBitExt          = PipelineStageFlags(0x1000000)
	PIPELINEStageConditionalRenderingBitExt       = PipelineStageFlags(0x40000)
	PIPELINEStageAccelerationStructureBuildBitKhr = PipelineStageFlags(0x2000000)
	PIPELINEStageRayTracingShaderBitKhr           = PipelineStageFlags(0x200000)
	PIPELINEStageShadingRateImageBitNv            = PipelineStageFlags(0x400000)
	PIPELINEStageTaskShaderBitNv                  = PipelineStageFlags(0x80000)
	PIPELINEStageMeshShaderBitNv                  = PipelineStageFlags(0x100000)
	PIPELINEStageFragmentDensityProcessBitExt     = PipelineStageFlags(0x800000)
	PIPELINEStageCommandPreprocessBitNv           = PipelineStageFlags(0x20000)
	PIPELINEStageNoneKhr                          = PipelineStageFlags(0x0)
)
View Source
const (
	BUFFERUsageTransferSrcBit                                = BufferUsageFlags(0x1)
	BUFFERUsageTransferDstBit                                = BufferUsageFlags(0x2)
	BUFFERUsageUniformTexelBufferBit                         = BufferUsageFlags(0x4)
	BUFFERUsageStorageTexelBufferBit                         = BufferUsageFlags(0x8)
	BUFFERUsageUniformBufferBit                              = BufferUsageFlags(0x10)
	BUFFERUsageStorageBufferBit                              = BufferUsageFlags(0x20)
	BUFFERUsageIndexBufferBit                                = BufferUsageFlags(0x40)
	BUFFERUsageVertexBufferBit                               = BufferUsageFlags(0x80)
	BUFFERUsageIndirectBufferBit                             = BufferUsageFlags(0x100)
	BUFFERUsageShaderDeviceAddressBit                        = BufferUsageFlags(0x20000)
	BUFFERUsageTransformFeedbackBufferBitExt                 = BufferUsageFlags(0x800)
	BUFFERUsageTransformFeedbackCounterBufferBitExt          = BufferUsageFlags(0x1000)
	BUFFERUsageConditionalRenderingBitExt                    = BufferUsageFlags(0x200)
	BUFFERUsageAccelerationStructureBuildInputReadOnlyBitKhr = BufferUsageFlags(0x80000)
	BUFFERUsageAccelerationStructureStorageBitKhr            = BufferUsageFlags(0x100000)
	BUFFERUsageShaderBindingTableBitKhr                      = BufferUsageFlags(0x400)
)
View Source
const (
	SHADERStageVertexBit                 = ShaderStageFlags(0x1)
	SHADERStageTessellationControlBit    = ShaderStageFlags(0x2)
	SHADERStageTessellationEvaluationBit = ShaderStageFlags(0x4)
	SHADERStageGeometryBit               = ShaderStageFlags(0x8)
	SHADERStageFragmentBit               = ShaderStageFlags(0x10)
	SHADERStageComputeBit                = ShaderStageFlags(0x20)
	SHADERStageAllGraphics               = ShaderStageFlags(0x1f)
	SHADERStageAll                       = ShaderStageFlags(0x7fffffff)
	SHADERStageRaygenBitKhr              = ShaderStageFlags(0x100)
	SHADERStageAnyHitBitKhr              = ShaderStageFlags(0x200)
	SHADERStageClosestHitBitKhr          = ShaderStageFlags(0x400)
	SHADERStageMissBitKhr                = ShaderStageFlags(0x800)
	SHADERStageIntersectionBitKhr        = ShaderStageFlags(0x1000)
	SHADERStageCallableBitKhr            = ShaderStageFlags(0x2000)
	SHADERStageTaskBitNv                 = ShaderStageFlags(0x40)
	SHADERStageMeshBitNv                 = ShaderStageFlags(0x80)
)
View Source
const (
	DESCRIPTORBindingUpdateAfterBindBitExt          = DescriptorBindingFlagBitsEXT(1)
	DESCRIPTORBindingUpdateUnusedWhilePendingBitExt = DescriptorBindingFlagBitsEXT(2)
	DESCRIPTORBindingPartiallyBoundBitExt           = DescriptorBindingFlagBitsEXT(4)
	DESCRIPTORBindingVariableDescriptorCountBitExt  = DescriptorBindingFlagBitsEXT(8)
)
View Source
const (
	WINDOWStateNormal    = WindowState(0)
	WINDOWStateHidden    = WindowState(1)
	WINDOWStateMinimized = WindowState(2)
	WINDOWStateMaximized = WindowState(3)
	WINDOWStateIconic    = WindowState(4)
	// No resize
	WINDOWStateFixed = WindowState(16)
	// No borders, title etc.
	WINDOWStateBorderless = WindowState(32)
)

Variables

View Source
var ErrDisposed = errors.New("Item disposed")
View Source
var ErrInitialized = errors.New("Already initialized")
View Source
var Formats = map[Format]FormatInfo{}/* 145 elements not displayed */
View Source
var GetDllPath = func() string {
	if runtime.GOOS == "linux" {
		p := strings.ReplaceAll(VGEDllPath, "vgelib", "libvgelib")
		return strings.ReplaceAll(p, ".dll", ".so")
	}
	return VGEDllPath
}

GetDllPath gets full path of vgelib.dll (.so). You can override this function to match your preferences / OS. By default in Windows file name is kept as is. In linux -> vgelib will be converted to libvgelib and .dll -> .so

View Source
var VGEDllPath string = "vgelib.dll"

VGEDllPath sets name of default vgelib path.

Functions

func AddValidationException added in v0.20.1

func AddValidationException(ctx APIContext, msgId int32)

AddValidationException register validation exception to ignore. Normally validation errors cause Vulkan API call to fail if validation is enabled for application and validation layer reports an error. Some errors are not always valid and call to AddValidationException can put validation message to ignore list

In VGE validation ignore list is global, not per application instance

func BytesToFloat32

func BytesToFloat32(src []byte) []float32

func DebugPoint

func DebugPoint(point string)

func Float32ToBytes

func Float32ToBytes(src []float32) []byte

func UInt16ToBytes

func UInt16ToBytes(src []uint16) []byte

func UInt32ToBytes

func UInt32ToBytes(src []uint32) []byte

Types

type APIContext

type APIContext interface {
	// Sets serious, unexpected error in API call. You should most likely at least panic/recover to try to continue running application
	SetError(err error)

	// Test if context is valid. Can be set by SetError.
	// Some operations will not even run if context is invalid, however support is not still in all places and using invalid context will more or less likely
	// result in crash.
	IsValid() bool

	// Optional method called whenever API call is transferred to C++ DLL.
	// Method can optionally return a function that will be called when call is finished.
	// This can be used to trace or time API calls.
	Begin(callName string) (atEnd func())
}

APIContext handles error on most of Vulkan calls that should not fail. Instead of passing error values of most unlike errors (typically programming errors), call will take APIContext and signal errors though that

type Application

type Application struct {
	// contains filtered or unexported fields
}

func NewApplication

func NewApplication(ctx APIContext, name string) *Application

func (*Application) AddDynamicDescriptors

func (a *Application) AddDynamicDescriptors(ctx APIContext)

AddDynamicDescriptors adds dynamics descriptor support to device. VGE 0.20 now sets update after bind to flag to dynamics descriptors that seems to allow at least ~500000 samples image per stage! See maxDescriptorSetUpdateAfterBindSamplers from Vulkan database for actual recorder limits

This call must be done before any device is created. Note that device creating will fail if dynamic descriptor are not supported or request maxSize is too high

func (*Application) AddValidation

func (a *Application) AddValidation(ctx APIContext)

AddValidation will load Vulkan Validations layers and register them when application is initialize. This call must be before actual application is initialized You must have Vulkan SDK installed on your machine because validation layers are part of Vulkan SDK, not driver API:s. See https://vulkan-tutorial.com/Drawing_a_triangle/Setup/Validation_layers for more info

Validation layer can be also configured with Vulkan Configurator from Vulkan SDK. If you use Vulkan Configurator to validate application, you should not add validation layer to application.

func (*Application) Dispose

func (a *Application) Dispose()

Dispose Vulkan application. This will dispose device, instance and all resources bound to them. Disposing application is typically last call to Vulkan API

func (*Application) GetDevices

func (a *Application) GetDevices(ctx APIContext) (result []DeviceInfo)

List all physical devices available

func (*Application) Init

func (a *Application) Init(ctx APIContext)

Initialize Vulkan application. Create Vulkan application and Vulkan instance. See https://gpuopen.com/understanding-vulkan-objects/ about Vulkan object and their dependencies

func (*Application) IsValid

func (a *Application) IsValid(ctx APIContext) bool

IsValid checks that application is created and not disposed. Can be used to validate application before calling any api requiring Vulkan Application or Vulkan Instance.

func (*Application) NewDevice

func (a *Application) NewDevice(ctx APIContext, pdIndex int32) *Device

NewDevice allocates actual device that will be used to execute Vulkan rendering commands. pdIndex is index of physical device on your machine. 0 is default

type AttachmentInfo added in v0.20.1

type AttachmentInfo struct {
	InitialLayout ImageLayout
	FinalLayout   ImageLayout
	Format        Format
	ClearColor    [4]float32
}

type Buffer

type Buffer struct {
	Host  bool
	Usage BufferUsageFlags
	Size  uint64
	// contains filtered or unexported fields
}

func (*Buffer) Bytes

func (b *Buffer) Bytes(ctx APIContext) []byte

func (*Buffer) CopyFrom added in v0.20.1

func (b *Buffer) CopyFrom(ctx APIContext, offset uint64, ptr unsafe.Pointer, size uint64)

CopyFrom copies content from Go memory to buffer. Offset is starting point inside buffer where to copy memory CopyFrom should be used only when size of copied item is large (>64k). For small items call overhead outweighs performance gain

func (*Buffer) Dispose

func (b *Buffer) Dispose()

func (*Buffer) IsValid

func (b *Buffer) IsValid(ctx APIContext) bool

func (*Buffer) Slice

func (b *Buffer) Slice(ctx APIContext, from uint64, to uint64) *Slice

type BufferUsageFlags

type BufferUsageFlags int32

type BufferView

type BufferView struct {
	// contains filtered or unexported fields
}

func NewBufferView

func NewBufferView(ctx APIContext, b *Buffer, format Format) *BufferView

func (*BufferView) Dispose

func (bv *BufferView) Dispose()

func (*BufferView) IsValid

func (bv *BufferView) IsValid(ctx APIContext) bool

type CharInfo

type CharInfo struct {
	Width   uint32
	Height  uint32
	Offsetx int32
	Offsety int32
	// contains filtered or unexported fields
}

type Command

type Command struct {
	Ctx APIContext
	// contains filtered or unexported fields
}

func NewCommand

func NewCommand(ctx APIContext, dev *Device, cmdQueue QueueFlags, once bool) *Command

func (*Command) Begin

func (c *Command) Begin()

func (*Command) BeginRenderPass

func (c *Command) BeginRenderPass(renderPass RenderPass, fb *Framebuffer)

func (*Command) ClearImage added in v0.20.1

func (c *Command) ClearImage(dst *Image, imRange *ImageRange, color float32, alpha float32)

func (*Command) Compute

func (c *Command) Compute(cp *ComputePipeline, x uint32, y uint32, z uint32, descs ...*DescriptorSet)

func (*Command) CopyBuffer

func (c *Command) CopyBuffer(dst *Buffer, src *Buffer)

func (*Command) CopyBufferToImage

func (c *Command) CopyBufferToImage(dst *Image, src *Buffer, imRange *ImageRange)

func (*Command) CopyImageToBuffer

func (c *Command) CopyImageToBuffer(dst *Buffer, src *Image, imRange *ImageRange)

func (*Command) CopyImageToSlice

func (c *Command) CopyImageToSlice(sl *Slice, src *Image, imRange *ImageRange)

func (*Command) Dispose

func (c *Command) Dispose()

func (*Command) Draw

func (c *Command) Draw(dl *DrawList)

func (*Command) EndRenderPass

func (c *Command) EndRenderPass()

func (*Command) IsValid

func (c *Command) IsValid(ctx APIContext) bool

func (*Command) SetLayout

func (c *Command) SetLayout(img *Image, imRange *ImageRange, newLayout ImageLayout)

func (*Command) Submit

func (c *Command) Submit(infos ...SubmitInfo)

func (*Command) SubmitForWait

func (c *Command) SubmitForWait(priority uint32, stage PipelineStageFlags, infos ...SubmitInfo) SubmitInfo

func (*Command) Wait

func (c *Command) Wait()

func (*Command) WriteTimer

func (c *Command) WriteTimer(tp *TimerPool, timerIndex uint32, stage PipelineStageFlags)

Write value of timer after all commands in stage has completed

type ComputePipeline

type ComputePipeline struct {
	// contains filtered or unexported fields
}

func NewComputePipeline

func NewComputePipeline(ctx APIContext, dev *Device) *ComputePipeline

func (*ComputePipeline) AddLayout

func (cp *ComputePipeline) AddLayout(ctx APIContext, dsLayout *DescriptorLayout)

func (*ComputePipeline) AddShader

func (cp *ComputePipeline) AddShader(ctx APIContext, code []byte)

func (*ComputePipeline) Create

func (cp *ComputePipeline) Create(ctx APIContext)

func (*ComputePipeline) Dispose

func (c *ComputePipeline) Dispose()

type Constructor

type Constructor func(ctx APIContext) interface{}

type DebugContext

type DebugContext struct {
}

func (DebugContext) Begin

func (d DebugContext) Begin(callName string) (atEnd func())

func (DebugContext) SetError

func (d DebugContext) SetError(err error)

type DepthRenderPass

type DepthRenderPass = GeneralRenderPass

func NewDepthRenderPass

func NewDepthRenderPass(ctx APIContext, dev *Device, finalLayout ImageLayout, depthImageFormat Format) *DepthRenderPass

NewDepthRenderPass creates are single phase render pass that only supports depth image. This is mainly used for shadow map rendering

type DescriptorBindingFlagBitsEXT

type DescriptorBindingFlagBitsEXT int32

type DescriptorLayout

type DescriptorLayout struct {
	// contains filtered or unexported fields
}

DescriptorLayout describes layout of single descriptor.

func NewDescriptorLayout

func NewDescriptorLayout(ctx APIContext, dev *Device, descriptorType DescriptorType, stages ShaderStageFlags, elements uint32) *DescriptorLayout

NewDescriptorLayout, created descriptor layout. This will be binding slot 0 in descriptorset.

func NewDynamicDescriptorLayout

func NewDynamicDescriptorLayout(ctx APIContext, dev *Device, descriptorType DescriptorType, stages ShaderStageFlags,
	elements uint32, flags DescriptorBindingFlagBitsEXT) *DescriptorLayout

NewDynamicDescriptorLayout creates a new dynamic descriptor layout. This will be binding slot 0 in descriptorset. You must add dynamics descriptor support using AddDynamicDescriptors or this api call will fail. Some older drivers may not support dynamics descriptors

func (*DescriptorLayout) AddBinding

func (dl *DescriptorLayout) AddBinding(ctx APIContext, descriptorType DescriptorType, stages ShaderStageFlags, elements uint32) *DescriptorLayout

AddBinding creates a NEW descriptor binding that adds new binding to existing ones. Binding number will be automatically incremented

func (*DescriptorLayout) AddDynamicBinding

func (dl *DescriptorLayout) AddDynamicBinding(ctx APIContext, descriptorType DescriptorType, stages ShaderStageFlags,
	elements uint32, flags DescriptorBindingFlagBitsEXT) *DescriptorLayout

AddDynamicBinding creates a NEW descriptor binding that adds new descriptor to existing ones. Binding number will be automatically incremented You must add dynamics descriptor support using AddDynamicDescriptors or this api call will fail. Some older drivers may not support dynamics descriptors

func (*DescriptorLayout) Dispose

func (dl *DescriptorLayout) Dispose()

func (*DescriptorLayout) IsValid

func (dl *DescriptorLayout) IsValid(ctx APIContext) bool

IsValid check that descriptor layout is valid (not disposed)

type DescriptorPool

type DescriptorPool struct {
	// contains filtered or unexported fields
}

func NewDescriptorPool

func NewDescriptorPool(ctx APIContext, dl *DescriptorLayout, maxDescriptors int) *DescriptorPool

NewDescriptorPool creates a new descriptor pool from where you can allocate descriptors. In VGE descriptor pools all descriptors must share same layout.

func (*DescriptorPool) Alloc

func (dp *DescriptorPool) Alloc(ctx APIContext) *DescriptorSet

Alloc allocates one descriptor from descriptor set. You can't unallocate single descriptor. Free descriptors disposing whole descriptor pool

func (*DescriptorPool) Dispose

func (dp *DescriptorPool) Dispose()

func (*DescriptorPool) IsValid

func (dp *DescriptorPool) IsValid(ctx APIContext) bool

func (*DescriptorPool) Remaining

func (dp *DescriptorPool) Remaining() int

Number of remaining descriptors

type DescriptorSet

type DescriptorSet struct {
	// contains filtered or unexported fields
}

Descriptor set that must be updated with WriteXXX methods and then bound to draw command

func (*DescriptorSet) IsValid

func (ds *DescriptorSet) IsValid(ctx APIContext) bool

func (*DescriptorSet) WriteBuffer

func (ds *DescriptorSet) WriteBuffer(ctx APIContext, biding uint32, index uint32, buffer *Buffer)

WriteBuffer writes single buffer to descriptor. Descriptors must be written before they can be bound to draw commands. Note that descriptor layout must support buffer in this binding and index

func (*DescriptorSet) WriteBufferView

func (ds *DescriptorSet) WriteBufferView(ctx APIContext, biding uint32, index uint32, view *BufferView)

WriteBufferView writes buffer view. Descriptors must be written before they can be bound to draw commands. Note that descriptor layout must support buffer view in this binding and index

func (*DescriptorSet) WriteImage

func (ds *DescriptorSet) WriteImage(ctx APIContext, biding uint32, index uint32, view *ImageView, sampler *Sampler)

WriteImage writes buffer view. Descriptors must be written before they can be bound to draw commands. Note that descriptor layout must support image or sampled image in this binding and index Samples may be nil if biding don't need sampler

func (*DescriptorSet) WriteSlice

func (ds *DescriptorSet) WriteSlice(ctx APIContext, biding uint32, index uint32, sl *Slice)

WriteSlice writes part of buffer (slice) to descriptor. Note that descriptor layout must support buffer in this binding and index

type DescriptorType

type DescriptorType int32

type Desktop

type Desktop struct {
	// contains filtered or unexported fields
}

func NewDesktop

func NewDesktop(ctx APIContext, app *Application) *Desktop

NewDesktop will initialize application with swap chain.

func NewDesktopWithSettings added in v0.20.1

func NewDesktopWithSettings(ctx APIContext, app *Application, settings DesktopSettings) *Desktop

NewDesktopWithSettings will initialize application with swap chain. You can set requested flags for image usage for main image when vgelib constructs new swapchain for Windows. Default settings are IMAGEUsageColorAttachmentBit | IMAGEUsageTransferSrcBit

func (*Desktop) GetKeyName

func (d *Desktop) GetKeyName(ctx APIContext, keyCode uint32) string

func (*Desktop) GetMonitor

func (d *Desktop) GetMonitor(ctx APIContext, monitor uint32) (pos WindowPos, exists bool)

func (*Desktop) IsValid

func (d *Desktop) IsValid(ctx APIContext) bool

func (*Desktop) NewWindow

func (d *Desktop) NewWindow(ctx APIContext, title string, pos WindowPos) *Window

NewWindow create a new desktop window at given location and in size. If location is (left, top) is -1, -1, desktop uses default position algorithm for window

func (*Desktop) PullEvent

func (d *Desktop) PullEvent(ctx APIContext) (ev RawEvent, w *Window)

Pull next desktop event from event queue. If no new event exists, event type will be 0.

type DesktopSettings added in v0.20.1

type DesktopSettings struct {
	ImageUsage ImageUsageFlags
}

type Device

type Device struct {
	Props DeviceInfo
	// contains filtered or unexported fields
}

func NewDevice

func NewDevice(ctx APIContext, app *Application, pdIndex int32) *Device

NewDevice will create new device from valid application. Unlike with app.NewDevice, you are now responsible of disposing device before disposing application. It is possible to use multiple devices. However, there is currently no support to directly copy assets between devices using this library

func (*Device) Application

func (d *Device) Application() *Application

Application returns application that device was created from.

func (*Device) Dispose

func (d *Device) Dispose()

Dispose device and all resources allocated from device

func (*Device) Get

func (d *Device) Get(ctx APIContext, key Key, cons Constructor) interface{}

See Owner.Get. Safe for concurrent access.

func (*Device) IsValid

func (d *Device) IsValid(ctx APIContext) bool

IsValid check that device is created and not disposed. Used to validate device before calling some Vulkan API requiring active device

func (*Device) NewDescriptorLayout

func (d *Device) NewDescriptorLayout(ctx APIContext, descriptorType DescriptorType, stages ShaderStageFlags, elements uint32) *DescriptorLayout

NewDescriptorLayout will create new DescriptorLayout that will be disposed when device is disposed. Safe for concurrent access.

func (*Device) NewDynamicDescriptorLayout

func (d *Device) NewDynamicDescriptorLayout(ctx APIContext, descriptorType DescriptorType, stages ShaderStageFlags,
	elements uint32, flags DescriptorBindingFlagBitsEXT) *DescriptorLayout

NewDynamicDescriptorLayout will create new DescriptorLayout that will be disposed when device is disposed. Safe for concurrent access.

func (*Device) NewMemoryPool

func (d *Device) NewMemoryPool() *MemoryPool

NewMemoryPool creates a new memory pool that will be disposed when device is disposed. Safe for concurrent access.

func (*Device) NewSampler

func (d *Device) NewSampler(ctx APIContext, mode SamplerAddressMode) *Sampler

Create a new sampler that will be disposed when device is disposed. Safe for concurrent access.

type DeviceInfo

type DeviceInfo struct {
	// Is device valid for given application options.
	// 0 - Valid
	// 1 - Invalid
	// 2 - No such device
	Valid               uint32
	DeviceKind          PhysicalDeviceType
	MemorySize          uint64
	MaxSamplersPerStage uint32
	MaxImageArrayLayers uint32
	NameLen             uint32
	ReasonLen           uint32
	Name                [256]byte
	Reason              [256]byte
}

type Disposable

type Disposable interface {
	Dispose()
}

Disposable interface will be implemented on object that have allocate external, typically Vulkan devices. You must ensure that all disposable object gets disposed. If object is owned you must just dispose owner. You can always call dispose on already disposed items without any errors. Send call will be just silently ignored. Follow this pattern if you implement Disposable interface

type DrawItem

type DrawItem struct {
	// contains filtered or unexported fields
}

func (*DrawItem) AddDescriptor

func (di *DrawItem) AddDescriptor(idx int, set *DescriptorSet) *DrawItem

func (*DrawItem) AddDescriptors

func (di *DrawItem) AddDescriptors(descriptors ...*DescriptorSet) *DrawItem

func (*DrawItem) AddDynamicDescriptor

func (di *DrawItem) AddDynamicDescriptor(idx int, set *DescriptorSet, offset uint32) *DrawItem

func (*DrawItem) AddInput

func (di *DrawItem) AddInput(idx int, input *Buffer) *DrawItem

func (*DrawItem) AddInputs

func (di *DrawItem) AddInputs(inputs ...*Buffer) *DrawItem

func (*DrawItem) SetInstances

func (di *DrawItem) SetInstances(from uint32, count uint32) *DrawItem

type DrawList

type DrawList struct {
	// contains filtered or unexported fields
}

func (*DrawList) Draw

func (dr *DrawList) Draw(pl Pipeline, from, count uint32) *DrawItem

func (*DrawList) DrawIndexed

func (dr *DrawList) DrawIndexed(pl Pipeline, from, count uint32) *DrawItem

type Format

type Format int32

type FormatInfo

type FormatInfo struct {
	Format Format
	// Pixel size in bits
	PixelSize  int
	DXGIFormat uint32
	Aspect     ImageAspectFlags
}

type ForwardRenderPass

type ForwardRenderPass = GeneralRenderPass

Type alias to migrate old render pass definition

func NewForwardRenderPass

func NewForwardRenderPass(ctx APIContext, dev *Device, mainImageFormat Format, finalLayout ImageLayout, depthImageFormat Format) *ForwardRenderPass

NewForwardRenderPass created a new single phase pass that supports main image and optionally a depth image (Z-buffer). NewForwardRenderPass is badly named due to historical reason. ForwardRenderPass can be used to render anything with one color attachment and 0 - 1 depth attachments

type Framebuffer

type Framebuffer struct {
	// contains filtered or unexported fields
}

func NewFramebuffer

func NewFramebuffer(ctx APIContext, rp RenderPass, attachments []*ImageView) *Framebuffer

NewFramebuffer initialized new framebuffer with given attachments. Attachment count and types must match renderpass attachment count

func NewNullFramebuffer added in v0.20.1

func NewNullFramebuffer(ctx APIContext, rp RenderPass, width, height uint32) *Framebuffer

NewNullFramebuffer initialized new framebuffer without any attachments. Instead you must give size for framebuffer that is normally fetch from first image

func (*Framebuffer) Dispose

func (f *Framebuffer) Dispose()

func (*Framebuffer) IsValid

func (f *Framebuffer) IsValid(ctx APIContext) bool

type GeneralRenderPass added in v0.20.1

type GeneralRenderPass struct {
	// contains filtered or unexported fields
}

func NewGeneralRenderPass added in v0.20.1

func NewGeneralRenderPass(ctx APIContext, dev *Device, hasDepth bool, attachments []AttachmentInfo) *GeneralRenderPass

NewGeneralRenderPass creates a new render pass with one or many color attachments. If hasDepth is set, last attachment is depth or depth stencil attachment, otherwise there is no depth attachment for render pass

func (*GeneralRenderPass) Dispose added in v0.20.1

func (f *GeneralRenderPass) Dispose()

func (*GeneralRenderPass) Get added in v0.20.1

func (f *GeneralRenderPass) Get(ctx APIContext, key Key, cons Constructor) interface{}

func (*GeneralRenderPass) GetRenderPass added in v0.20.1

func (f *GeneralRenderPass) GetRenderPass() uintptr

func (*GeneralRenderPass) IsValid added in v0.20.1

func (f *GeneralRenderPass) IsValid(ctx APIContext) bool

type GraphicsPipeline

type GraphicsPipeline struct {
	// contains filtered or unexported fields
}

func NewGraphicsPipeline

func NewGraphicsPipeline(ctx APIContext, dev *Device) *GraphicsPipeline

func (*GraphicsPipeline) AddAlphaBlend

func (gp *GraphicsPipeline) AddAlphaBlend(ctx APIContext)

func (*GraphicsPipeline) AddDepth

func (gp *GraphicsPipeline) AddDepth(ctx APIContext, write bool, check bool)

func (*GraphicsPipeline) AddLayout

func (gp *GraphicsPipeline) AddLayout(ctx APIContext, dsLayout *DescriptorLayout)

func (*GraphicsPipeline) AddShader

func (gp *GraphicsPipeline) AddShader(ctx APIContext, stage ShaderStageFlags, code []byte)

func (*GraphicsPipeline) AddVextexInput

func (gp *GraphicsPipeline) AddVextexInput(ctx APIContext, rate VertexInputRate, formats ...Format)

func (*GraphicsPipeline) Create

func (gp *GraphicsPipeline) Create(ctx APIContext, rp RenderPass)

func (*GraphicsPipeline) Dispose

func (gp *GraphicsPipeline) Dispose()

func (*GraphicsPipeline) SetTopology added in v0.20.1

func (gp *GraphicsPipeline) SetTopology(ctx APIContext, topology PrimitiveTopology)

type Image

type Image struct {
	Usage       ImageUsageFlags
	Description ImageDescription
	// contains filtered or unexported fields
}

func (*Image) DefaultView

func (i *Image) DefaultView(ctx APIContext) *ImageView

func (*Image) Dispose

func (i *Image) Dispose()

func (*Image) FullRange

func (i *Image) FullRange() ImageRange

func (*Image) IsValid

func (i *Image) IsValid(ctx APIContext) bool

func (*Image) NewCubeView

func (i *Image) NewCubeView(ctx APIContext, mipLevel int32) *ImageView

func (*Image) NewView

func (i *Image) NewView(ctx APIContext, layer int32, mipLevel int32) *ImageView

type ImageAspectFlags

type ImageAspectFlags int32

type ImageDescription

type ImageDescription struct {
	Width     uint32
	Height    uint32
	Depth     uint32
	Format    Format
	Layers    uint32
	MipLevels uint32
}

func (*ImageDescription) FullRange

func (description *ImageDescription) FullRange() ImageRange

func (*ImageDescription) ImageRangeSize

func (description *ImageDescription) ImageRangeSize(imRange ImageRange) uint64

func (*ImageDescription) ImageSize

func (description *ImageDescription) ImageSize() uint64

type ImageLayout

type ImageLayout int32

type ImageLoader

type ImageLoader interface {
	SaveImage(ctx APIContext, kind string, desc ImageDescription, buffer *Buffer) []byte

	SupportsImage(kind string) (read bool, write bool)

	DescribeImage(ctx APIContext, kind string, desc *ImageDescription, content []byte)

	LoadImage(ctx APIContext, kind string, content []byte, buffer *Buffer)
}

func NewNativeImageLoader

func NewNativeImageLoader(ctx APIContext, app *Application) ImageLoader

type ImageRange

type ImageRange struct {
	FirstLayer    uint32
	LayerCount    uint32
	FirstMipLevel uint32
	LevelCount    uint32
	Layout        ImageLayout
}

type ImageUsageFlags

type ImageUsageFlags int32

type ImageView

type ImageView struct {
	// contains filtered or unexported fields
}

func NewCubeView

func NewCubeView(ctx APIContext, image *Image, imRange *ImageRange) *ImageView

func NewImageView

func NewImageView(ctx APIContext, image *Image, imRange *ImageRange) *ImageView

func (*ImageView) Dispose

func (iv *ImageView) Dispose()

func (ImageView) Handle added in v0.20.1

func (im ImageView) Handle() uintptr

func (*ImageView) IsValid

func (iv *ImageView) IsValid(ctx APIContext) bool

type Key

type Key uint64

func NewKey

func NewKey() Key

func NewKeys

func NewKeys(howMany uint64) Key

type MemoryPool

type MemoryPool struct {
	// contains filtered or unexported fields
}

func NewMemoryPool

func NewMemoryPool(dev *Device) *MemoryPool

func (*MemoryPool) Allocate

func (mp *MemoryPool) Allocate(ctx APIContext)

func (*MemoryPool) Dispose

func (mp *MemoryPool) Dispose()

func (*MemoryPool) ReserveBuffer

func (mp *MemoryPool) ReserveBuffer(ctx APIContext, size uint64, hostmem bool, usage BufferUsageFlags) *Buffer

func (*MemoryPool) ReserveImage

func (mp *MemoryPool) ReserveImage(ctx APIContext, desc ImageDescription, usage ImageUsageFlags) *Image

type Owner

type Owner struct {
	// contains filtered or unexported fields
}

Owner is helper structure used by multiple entities like application or device to keep list of child disposable objects that are bound to object lifetime. Typically owner instance is private and owner struct will offer similar methods (Get and sometimes Set, AddChild) to access private owner collection

func NewOwner

func NewOwner(multithreaded bool) Owner

Allocate new Owner collection. Non multithreaded version can be constructed by default structure constructor

func (*Owner) AddChild

func (o *Owner) AddChild(child Disposable)

AddChild adds disposable member to this collection

func (*Owner) Dispose

func (o *Owner) Dispose()

Dispose all owner members in LIFO order

func (*Owner) Get

func (o *Owner) Get(ctx APIContext, key Key, cons Constructor) interface{}

Retrieve object by key. You can create unique key with NewKey. If key does not exists, constructor will be called to create one. If constructed item is Disposable, it will be disposed when Owner collection is disposed It is possible to contruct non Disposable objects also. They will still be remembered by key

func (*Owner) Set

func (o *Owner) Set(key Key, val interface{})

Set updates key value in owner collection. Nil value will clear entry and if there was previous value with same key that value is disposed

type PanicContext

type PanicContext struct {
}

Simple APIContext to panic on all errors

func (PanicContext) Begin

func (p PanicContext) Begin(callName string) (atEnd func())

func (PanicContext) IsValid

func (p PanicContext) IsValid() bool

func (PanicContext) SetError

func (p PanicContext) SetError(err error)

type PhysicalDeviceType

type PhysicalDeviceType int32

type Pipeline

type Pipeline interface {
	// contains filtered or unexported methods
}

type PipelineStageFlags

type PipelineStageFlags int32

type PrimitiveTopology added in v0.20.1

type PrimitiveTopology int32

type QueueFlags

type QueueFlags int32

type RawEvent

type RawEvent struct {
	// See vapp/win.go for list of raw event codes
	EventType uint32
	Arg1      int32
	Arg2      int32
	Arg3      int32
	// contains filtered or unexported fields
}

type RenderCache

type RenderCache struct {
	Device *Device
	Ctx    APIContext
	// contains filtered or unexported fields
}

func NewRenderCache

func NewRenderCache(ctx APIContext, dev *Device) *RenderCache

func (*RenderCache) Dispose

func (rc *RenderCache) Dispose()

func (*RenderCache) DisposePerFrame

func (rc *RenderCache) DisposePerFrame(disp Disposable)

func (*RenderCache) Get

func (rc *RenderCache) Get(key Key, cons Constructor) interface{}

func (*RenderCache) GetPerFrame

func (rc *RenderCache) GetPerFrame(key Key, cons Constructor) interface{}

func (*RenderCache) NewFrame

func (rc *RenderCache) NewFrame()

func (*RenderCache) SetPerFrame

func (rc *RenderCache) SetPerFrame(key Key, val interface{})

type RenderPass

type RenderPass interface {
	Disposable
	IsValid(ctx APIContext) bool
	GetRenderPass() uintptr
	Get(ctx APIContext, key Key, cons Constructor) interface{}
}

type Sampler

type Sampler struct {
	// contains filtered or unexported fields
}

Sampler needed for combine image sampler bindings (WriteImage in DescriptorSet)

func NewSampler

func NewSampler(ctx APIContext, dev *Device, mode SamplerAddressMode) *Sampler

NewSampler creates new image samples with given address mode

func (*Sampler) Dispose

func (s *Sampler) Dispose()

func (*Sampler) IsValid

func (s *Sampler) IsValid(ctx APIContext) bool

type SamplerAddressMode

type SamplerAddressMode int32

type ShaderStageFlags

type ShaderStageFlags int32

type Slice

type Slice struct {
	Content []byte
	// contains filtered or unexported fields
}

func (*Slice) IsValid

func (s *Slice) IsValid(ctx APIContext) bool

type SubmitInfo

type SubmitInfo struct {
	// contains filtered or unexported fields
}

type TimerPool

type TimerPool struct {
	// contains filtered or unexported fields
}

func NewTimerPool

func NewTimerPool(ctx APIContext, dev *Device, size uint32) *TimerPool

NewTimerPool creates a QueryPool for timing. You must specify how many time events you want to write to in one pool Currently pool can be used only once. Dispose and create a new pool if you need multiple recording

func (*TimerPool) Dispose

func (t *TimerPool) Dispose()

func (*TimerPool) Get

func (t *TimerPool) Get(ctx APIContext) []float64

Get retrieve recorded values converted to nanosecond. Values are valid only after command(s) have completed. Only difference of values make any sense and if you record time events from multiple queues, times may no be comparable Use WriteTimer in command to record actual timer values.

type VertexInputRate

type VertexInputRate int32

type Window

type Window struct {
	WindowDesc ImageDescription
	// contains filtered or unexported fields
}

func (*Window) Dispose

func (w *Window) Dispose()

func (*Window) GetImageCount

func (w *Window) GetImageCount() int

func (*Window) GetNextFrame

func (w *Window) GetNextFrame(ctx APIContext, dev *Device) (im *Image, imageIndex int32, info SubmitInfo)

func (*Window) GetPos

func (w *Window) GetPos(ctx APIContext) WindowPos

func (*Window) SetPos

func (w *Window) SetPos(ctx APIContext, pos WindowPos)

type WindowPos

type WindowPos struct {
	Left    int32
	Top     int32
	Width   int32
	Height  int32
	State   WindowState
	Monitor uint32
}

type WindowState

type WindowState uint32

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL