Versions in this module Expand all Collapse all v0 v0.8.0 Dec 28, 2024 Changes in this version + var ErrContentLost = errors.New("buffer content lost") + var ErrDeviceLost = errors.New("GPU device lost") + var NewDirect3D11Device func(api Direct3D11) (Device, error) + var NewMetalDevice func(api Metal) (Device, error) + var NewOpenGLDevice func(api OpenGL) (Device, error) + var NewVulkanDevice func(api Vulkan) (Device, error) + func DownloadImage(d Device, t Texture, img *image.RGBA) error + func UploadImage(t Texture, offset image.Point, img *image.RGBA) + type API interface + type BlendDesc struct + DstFactor BlendFactor + Enable bool + SrcFactor BlendFactor + type BlendFactor uint8 + const BlendFactorDstColor + const BlendFactorOne + const BlendFactorOneMinusSrcAlpha + const BlendFactorZero + type Buffer interface + Download func(data []byte) error + Release func() + Upload func(data []byte) + type BufferBinding uint8 + const BufferBindingFramebuffer + const BufferBindingIndices + const BufferBindingShaderStorageRead + const BufferBindingShaderStorageWrite + const BufferBindingTexture + const BufferBindingUniforms + const BufferBindingVertices + type Caps struct + BottomLeftOrigin bool + Features Features + MaxTextureSize int + type Device interface + BeginCompute func() + BeginFrame func(target RenderTarget, clear bool, viewport image.Point) Texture + BeginRenderPass func(t Texture, desc LoadDesc) + BindImageTexture func(unit int, texture Texture) + BindIndexBuffer func(b Buffer) + BindPipeline func(p Pipeline) + BindProgram func(p Program) + BindStorageBuffer func(binding int, buf Buffer) + BindTexture func(unit int, t Texture) + BindUniforms func(buf Buffer) + BindVertexBuffer func(b Buffer, offset int) + Caps func() Caps + CopyTexture func(dst Texture, dstOrigin image.Point, src Texture, srcRect image.Rectangle) + DispatchCompute func(x, y, z int) + DrawArrays func(off, count int) + DrawElements func(off, count int) + EndCompute func() + EndFrame func() + EndRenderPass func() + IsTimeContinuous func() bool + NewBuffer func(typ BufferBinding, size int) (Buffer, error) + NewComputeProgram func(shader shader.Sources) (Program, error) + NewFragmentShader func(src shader.Sources) (FragmentShader, error) + NewImmutableBuffer func(typ BufferBinding, data []byte) (Buffer, error) + NewPipeline func(desc PipelineDesc) (Pipeline, error) + NewTexture func(format TextureFormat, width, height int, minFilter, magFilter TextureFilter, ...) (Texture, error) + NewTimer func() Timer + NewVertexShader func(src shader.Sources) (VertexShader, error) + PrepareTexture func(t Texture) + Release func() + Viewport func(x, y, width, height int) + func NewDevice(api API) (Device, error) + type Direct3D11 struct + Device unsafe.Pointer + type Direct3D11RenderTarget struct + RenderTarget unsafe.Pointer + func (Direct3D11RenderTarget) ImplementsRenderTarget() + type Features uint + const FeatureCompute + const FeatureFloatRenderTargets + const FeatureSRGB + const FeatureTimers + func (f Features) Has(feats Features) bool + type FragmentShader interface + Release func() + type InputDesc struct + Offset int + Size int + Type shader.DataType + type LoadAction uint8 + const LoadActionClear + const LoadActionInvalidate + const LoadActionKeep + type LoadDesc struct + Action LoadAction + ClearColor f32color.RGBA + type Metal struct + Device uintptr + PixelFormat int + Queue uintptr + type MetalRenderTarget struct + Texture uintptr + func (MetalRenderTarget) ImplementsRenderTarget() + type OpenGL struct + Context gl.Context + ES bool + Shared bool + type OpenGLRenderTarget gl.Framebuffer + func (OpenGLRenderTarget) ImplementsRenderTarget() + type Pipeline interface + Release func() + type PipelineDesc struct + BlendDesc BlendDesc + FragmentShader FragmentShader + PixelFormat TextureFormat + Topology Topology + VertexLayout VertexLayout + VertexShader VertexShader + type Program interface + Release func() + type RenderTarget interface + ImplementsRenderTarget func() + type Texture interface + ReadPixels func(src image.Rectangle, pixels []byte, stride int) error + Release func() + Upload func(offset, size image.Point, pixels []byte, stride int) + type TextureFilter uint8 + const FilterLinear + const FilterLinearMipmapLinear + const FilterNearest + type TextureFormat uint8 + const TextureFormatFloat + const TextureFormatOutput + const TextureFormatRGBA8 + const TextureFormatSRGBA + type Timer interface + Begin func() + Duration func() (time.Duration, bool) + End func() + Release func() + type Topology uint8 + const TopologyTriangleStrip + const TopologyTriangles + type VertexLayout struct + Inputs []InputDesc + Stride int + type VertexShader interface + Release func() + type Vulkan struct + Device unsafe.Pointer + Format int + PhysDevice unsafe.Pointer + QueueFamily int + QueueIndex int + type VulkanRenderTarget struct + Fence uint64 + Framebuffer uint64 + Image uint64 + SignalSem uint64 + WaitSem uint64 + func (VulkanRenderTarget) ImplementsRenderTarget()