Documentation ¶
Index ¶
- func CheckExisting(actual, required []string) (existing []string, missing int)
- func IsError(ret vulkan.Result) bool
- func NewError(ret vulkan.Result) error
- func SafeString(s string) string
- func SafeStrings(list []string) []string
- type Context
- type GPUBase
- func (gp *GPUBase) ActDeviceExts() []string
- func (gp *GPUBase) ActInstanceExts() []string
- func (gp *GPUBase) ActValidationLayers() []string
- func (gp *GPUBase) DestroyBase()
- func (gp *GPUBase) Device() vulkan.Device
- func (gp *GPUBase) DeviceExts() (names []string, err error)
- func (gp *GPUBase) GraphicsQueue() vulkan.Queue
- func (gp *GPUBase) GraphicsQueueFamilyIndex() uint32
- func (gp *GPUBase) HasSeparatePresentQueue() bool
- func (gp *GPUBase) InitBase() error
- func (gp *GPUBase) InitDevice() error
- func (gp *GPUBase) InitInstance() error
- func (gp *GPUBase) Instance() vulkan.Instance
- func (gp *GPUBase) InstanceExts() (names []string, err error)
- func (gp *GPUBase) MemoryProperties() vulkan.PhysicalDeviceMemoryProperties
- func (gp *GPUBase) PhysicalDevice() vulkan.PhysicalDevice
- func (gp *GPUBase) PhysicalDeviceProperies() vulkan.PhysicalDeviceProperties
- func (gp *GPUBase) PresentQueue() vulkan.Queue
- func (gp *GPUBase) PresentQueueFamilyIndex() uint32
- func (gp *GPUBase) ReqDeviceExts() []string
- func (gp *GPUBase) ReqInstanceExts() []string
- func (gp *GPUBase) ReqValidationLayers() []string
- func (gp *GPUBase) SetReqDeviceExts(exts []string)
- func (gp *GPUBase) SetReqInstanceExts(exts []string)
- func (gp *GPUBase) SetReqValidationLayers(lays []string)
- func (gp *GPUBase) ValidationLayers() (names []string, err error)
- func (gp *GPUBase) VulkanAPIVersion() vulkan.Version
- func (gp *GPUBase) VulkanAppVersion() vulkan.Version
- type SwapchainDimensions
- type SwapchainImageResources
- func (s *SwapchainImageResources) CommandBuffer() vulkan.CommandBuffer
- func (s *SwapchainImageResources) DescriptorSet() vulkan.DescriptorSet
- func (s *SwapchainImageResources) Destroy(dev vulkan.Device, cmdPool ...vulkan.CommandPool)
- func (s *SwapchainImageResources) Framebuffer() vulkan.Framebuffer
- func (s *SwapchainImageResources) Image() vulkan.Image
- func (s *SwapchainImageResources) SetDescriptorSet(set vulkan.DescriptorSet)
- func (s *SwapchainImageResources) SetFramebuffer(fb vulkan.Framebuffer)
- func (s *SwapchainImageResources) SetImageOwnership(graphicsQueueFamilyIndex, presentQueueFamilyIndex uint32)
- func (s *SwapchainImageResources) SetUniformBuffer(buffer vulkan.Buffer, mem vulkan.DeviceMemory)
- func (s *SwapchainImageResources) UniformBuffer() vulkan.Buffer
- func (s *SwapchainImageResources) UniformMemory() vulkan.DeviceMemory
- func (s *SwapchainImageResources) View() vulkan.ImageView
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckExisting ¶
func SafeString ¶
func SafeStrings ¶
Types ¶
type Context ¶
type Context interface { // SetOnPrepare sets callback that will be invoked to initialize and prepare application's vulkan state // upon context prepare step. onCreate could create textures and pipelines, // descriptor layouts and render passes. SetOnPrepare(onPrepare func() error) // SetOnCleanup sets callback that will be invoked to cleanup application's vulkan state // upon context prepare step. onCreate could destroy textures and pipelines, // descriptor layouts and render passes. SetOnCleanup(onCleanup func() error) // SetOnInvalidate sets callback that will be invoked when context has been invalidated, // the application must update its state and prepare the corresponding swapchain image to be presented. // onInvalidate could compute new vertex and color data in swapchain image resource buffers. SetOnInvalidate(onInvalidate func(imageIdx int) error) // Device returns the Vulkan device assigned to the context. Device() vulkan.Device // GPU returns the current oswin.GPU info (also avail as oswin.TheGPU) GPU() oswin.GPU // Surface returns the surface to render on Surface() vulkan.Surface // SetSurface sets the surface to use SetSurface(surf vulkan.Surface) // CommandBuffer returns a command buffer currently active. CommandBuffer() vulkan.CommandBuffer // SwapchainDimensions returns the current swapchain dimensions, including pixel format. SwapchainDimensions() *SwapchainDimensions // SwapchainImageResources exposes the swapchain initialized image resources. SwapchainImageResources() []*SwapchainImageResources // AcquireNextImage AcquireNextImage() (imageIndex int, outdated bool, err error) // PresentImage PresentImage(imageIdx int) (outdated bool, err error) // Destroy frees resources associated with the context Destroy() }
Context provides an OpenGL-style graphical rendering context that is specific to a particular rendering surface
type GPUBase ¶
type GPUBase struct {
// contains filtered or unexported fields
}
GPUBase provides the base gpu implementation
func (*GPUBase) ActDeviceExts ¶
func (*GPUBase) ActInstanceExts ¶
func (*GPUBase) ActValidationLayers ¶
func (*GPUBase) DestroyBase ¶
func (gp *GPUBase) DestroyBase()
DestroyBase destroys base vars -- actual Destroy() method should call
func (*GPUBase) DeviceExts ¶
DeviceExts gets a list of instance extensions available on the provided physical device.
func (*GPUBase) GraphicsQueue ¶
func (*GPUBase) GraphicsQueueFamilyIndex ¶
func (*GPUBase) HasSeparatePresentQueue ¶
func (*GPUBase) InitBase ¶
InitBase does all standard initializationn after the required extensions and layers have been set
func (*GPUBase) InitInstance ¶
InitInstance initializes instance
func (*GPUBase) InstanceExts ¶
InstanceExts gets a list of instance extensions available on the platform.
func (*GPUBase) MemoryProperties ¶
func (gp *GPUBase) MemoryProperties() vulkan.PhysicalDeviceMemoryProperties
func (*GPUBase) PhysicalDevice ¶
func (gp *GPUBase) PhysicalDevice() vulkan.PhysicalDevice
func (*GPUBase) PhysicalDeviceProperies ¶
func (gp *GPUBase) PhysicalDeviceProperies() vulkan.PhysicalDeviceProperties
func (*GPUBase) PresentQueue ¶
func (*GPUBase) PresentQueueFamilyIndex ¶
func (*GPUBase) ReqDeviceExts ¶
func (*GPUBase) ReqInstanceExts ¶
func (*GPUBase) ReqValidationLayers ¶
func (*GPUBase) SetReqDeviceExts ¶
func (*GPUBase) SetReqInstanceExts ¶
func (*GPUBase) SetReqValidationLayers ¶
func (*GPUBase) ValidationLayers ¶
ValidationLayers gets a list of validation layers available on the platform.
func (*GPUBase) VulkanAPIVersion ¶
func (*GPUBase) VulkanAppVersion ¶
type SwapchainDimensions ¶
type SwapchainDimensions struct { // Width of the swapchain. Width uint32 // Height of the swapchain. Height uint32 // Format is the pixel format of the swapchain. Format vulkan.Format }
SwapchainDimensions describes the size and format of the swapchain.
type SwapchainImageResources ¶
type SwapchainImageResources struct {
// contains filtered or unexported fields
}
SwapchainImageResources holds onto image resources
func (*SwapchainImageResources) CommandBuffer ¶
func (s *SwapchainImageResources) CommandBuffer() vulkan.CommandBuffer
func (*SwapchainImageResources) DescriptorSet ¶
func (s *SwapchainImageResources) DescriptorSet() vulkan.DescriptorSet
func (*SwapchainImageResources) Destroy ¶
func (s *SwapchainImageResources) Destroy(dev vulkan.Device, cmdPool ...vulkan.CommandPool)
func (*SwapchainImageResources) Framebuffer ¶
func (s *SwapchainImageResources) Framebuffer() vulkan.Framebuffer
func (*SwapchainImageResources) Image ¶
func (s *SwapchainImageResources) Image() vulkan.Image
func (*SwapchainImageResources) SetDescriptorSet ¶
func (s *SwapchainImageResources) SetDescriptorSet(set vulkan.DescriptorSet)
func (*SwapchainImageResources) SetFramebuffer ¶
func (s *SwapchainImageResources) SetFramebuffer(fb vulkan.Framebuffer)
func (*SwapchainImageResources) SetImageOwnership ¶
func (s *SwapchainImageResources) SetImageOwnership(graphicsQueueFamilyIndex, presentQueueFamilyIndex uint32)
func (*SwapchainImageResources) SetUniformBuffer ¶
func (s *SwapchainImageResources) SetUniformBuffer(buffer vulkan.Buffer, mem vulkan.DeviceMemory)
func (*SwapchainImageResources) UniformBuffer ¶
func (s *SwapchainImageResources) UniformBuffer() vulkan.Buffer
func (*SwapchainImageResources) UniformMemory ¶
func (s *SwapchainImageResources) UniformMemory() vulkan.DeviceMemory
func (*SwapchainImageResources) View ¶
func (s *SwapchainImageResources) View() vulkan.ImageView