~/bend-docscommunity

examples/indexed_window.bend relies on unsafe/foreign

raw source on the hub · import bend-vulkan-library@0.1.0.0/examples/indexed_window.bend as Indexed_window

11 imports
import Base
import ../Vulkan.bend as V
import ../src/core.bend as Core
import ../src/constants.bend as vk
import ../deps/bend-collections/src/math/u64.bend as W
import ../shaders/spirv.bend as Shaders
import ./window.bend as Host
import ./window_scene.bend as Scene
import ./indexed_offscreen.bend as Mesh
import ./offscreen_roundtrip.bend as Memory
import ./buffer_roundtrip.bend as Check

Types

type Renderer source · line 13 · raw

Data

type Frame source · line 15 · raw

Data

type Target source · line 17 · raw

Data

Definitions

def upload source · line 20 · raw

@+device:0x2e83918d1bc42f45733fbb5a82ec7963/Vulkan.Device -> @vertices:0x2e83918d1bc42f45733fbb5a82ec7963/examples/indexed_offscreen.BoundBuffer -> @indices:0x2e83918d1bc42f45733fbb5a82ec7963/examples/indexed_offscreen.BoundBuffer -> 0x2e83918d1bc42f45733fbb5a82ec7963/Vulkan.Action(Unit)

def create source · line 28 · raw

@+context:0x2e83918d1bc42f45733fbb5a82ec7963/examples/window.Context -> 0x2e83918d1bc42f45733fbb5a82ec7963/Vulkan.Action(Renderer)

def format source · line 42 · raw

@value:Maybe<&1, Pair(U32, U32)> -> 0x2e83918d1bc42f45733fbb5a82ec7963/Vulkan.Action(Pair(U32, U32))

def depth source · line 47 · raw

@+context:0x2e83918d1bc42f45733fbb5a82ec7963/examples/window.Context -> @+extent:0x2e83918d1bc42f45733fbb5a82ec7963/Vulkan.Extent2D -> 0x2e83918d1bc42f45733fbb5a82ec7963/Vulkan.Action(0x2e83918d1bc42f45733fbb5a82ec7963/examples/indexed_offscreen.Attachment)

def frames source · line 57 · raw

@images:List<&1, 0x2e83918d1bc42f45733fbb5a82ec7963/Vulkan.ImageHandle> -> @+device:0x2e83918d1bc42f45733fbb5a82ec7963/Vulkan.Device -> @+pass:0x2e83918d1bc42f45733fbb5a82ec7963/Vulkan.RenderPass -> @+depth_view:0x2e83918d1bc42f45733fbb5a82ec7963/Vulkan.ImageView -> @+extent:0x2e83918d1bc42f45733fbb5a82ec7963/Vulkan.Extent2D -> 0x2e83918d1bc42f45733fbb5a82ec7963/Vulkan.Action(List<&2, Frame>)

def target_frames source · line 67 · raw

@images:List<&1, 0x2e83918d1bc42f45733fbb5a82ec7963/Vulkan.ImageHandle> -> @device:0x2e83918d1bc42f45733fbb5a82ec7963/Vulkan.Device -> @pass:0x2e83918d1bc42f45733fbb5a82ec7963/Vulkan.RenderPass -> @attachment:0x2e83918d1bc42f45733fbb5a82ec7963/examples/indexed_offscreen.Attachment -> @extent:0x2e83918d1bc42f45733fbb5a82ec7963/Vulkan.Extent2D -> 0x2e83918d1bc42f45733fbb5a82ec7963/Vulkan.Action(List<&2, Frame>)

def build_extent source · line 71 · raw

@+context:0x2e83918d1bc42f45733fbb5a82ec7963/examples/window.Context -> @+width:U32 -> @+height:U32 -> @+color_format:U32 -> @space:U32 -> @count:U32 -> @transform:U32 -> @alpha:U32 -> @size:Pair(U32, U32) -> 0x2e83918d1bc42f45733fbb5a82ec7963/Vulkan.Action(Target)

def build_target source · line 89 · raw

@+context:0x2e83918d1bc42f45733fbb5a82ec7963/examples/window.Context -> @+width:U32 -> @+height:U32 -> @caps:0x2e83918d1bc42f45733fbb5a82ec7963/Vulkan.SurfaceCapabilities -> @pair:Pair(U32, U32) -> 0x2e83918d1bc42f45733fbb5a82ec7963/Vulkan.Action(Target)

def target source · line 94 · raw

@+context:0x2e83918d1bc42f45733fbb5a82ec7963/examples/window.Context -> @+width:U32 -> @+height:U32 -> 0x2e83918d1bc42f45733fbb5a82ec7963/Vulkan.Action(Target)

def destroy_frames source · line 102 · raw

@xs:List<&2, Frame> -> @+device:0x2e83918d1bc42f45733fbb5a82ec7963/Vulkan.Device -> 0x2e83918d1bc42f45733fbb5a82ec7963/Vulkan.Action(Unit)

def destroy source · line 111 · raw

@value:Maybe<&1, Target> -> @+device:0x2e83918d1bc42f45733fbb5a82ec7963/Vulkan.Device -> 0x2e83918d1bc42f45733fbb5a82ec7963/Vulkan.Action(Unit)

def wait source · line 125 · raw

@+fence:0x2e83918d1bc42f45733fbb5a82ec7963/Vulkan.Fence -> 0x2e83918d1bc42f45733fbb5a82ec7963/Vulkan.Action(Unit)

def frame_at source · line 131 · raw

@xs:List<&2, Frame> -> @index:U32 -> 0x2e83918d1bc42f45733fbb5a82ec7963/Vulkan.Action(Frame)

def record source · line 139 · raw

@renderer:Renderer -> @target:Target -> @frame:Frame -> @+lease:0x2e83918d1bc42f45733fbb5a82ec7963/Vulkan.Acquisition -> @camera:0x2e83918d1bc42f45733fbb5a82ec7963/examples/window_scene.Camera -> 0x2e83918d1bc42f45733fbb5a82ec7963/Vulkan.Action(Unit)

def presented source · line 166 · raw

@outcome:0x2e83918d1bc42f45733fbb5a82ec7963/Vulkan.PresentOutcome -> @suboptimal:Bool -> 0x2e83918d1bc42f45733fbb5a82ec7963/Vulkan.Action(Bool)

def acquired source · line 173 · raw

@outcome:0x2e83918d1bc42f45733fbb5a82ec7963/Vulkan.AcquireOutcome -> @+renderer:Renderer -> @+target:Target -> @camera:0x2e83918d1bc42f45733fbb5a82ec7963/examples/window_scene.Camera -> 0x2e83918d1bc42f45733fbb5a82ec7963/Vulkan.Action(Bool)

def draw source · line 190 · raw

@+renderer:Renderer -> @+target:Target -> @camera:0x2e83918d1bc42f45733fbb5a82ec7963/examples/window_scene.Camera -> 0x2e83918d1bc42f45733fbb5a82ec7963/Vulkan.Action(Bool)

def replace source · line 197 · raw

@changed:Bool -> @value:Target -> @+context:0x2e83918d1bc42f45733fbb5a82ec7963/examples/window.Context -> @width:U32 -> @height:U32 -> 0x2e83918d1bc42f45733fbb5a82ec7963/Vulkan.Action(Target)

def ensure source · line 206 · raw

@current:Maybe<&1, Target> -> @+context:0x2e83918d1bc42f45733fbb5a82ec7963/examples/window.Context -> @+width:U32 -> @+height:U32 -> 0x2e83918d1bc42f45733fbb5a82ec7963/Vulkan.Action(Target)

def retire source · line 213 · raw

@rebuild:Bool -> @value:Target -> @device:0x2e83918d1bc42f45733fbb5a82ec7963/Vulkan.Device -> 0x2e83918d1bc42f45733fbb5a82ec7963/Vulkan.Action(Maybe<&1, Target>)

def update source · line 221 · raw

@drawable:Bool -> @+renderer:Renderer -> @current:Maybe<&1, Target> -> @camera:0x2e83918d1bc42f45733fbb5a82ec7963/examples/window_scene.Camera -> @width:U32 -> @height:U32 -> 0x2e83918d1bc42f45733fbb5a82ec7963/Vulkan.Action(Maybe<&1, Target>)

def step source · line 232 · raw

@camera:Maybe<&1, 0x2e83918d1bc42f45733fbb5a82ec7963/examples/window_scene.Camera> -> @+renderer:Renderer -> @current:Maybe<&1, Target> -> @drawable:Bool -> @width:U32 -> @height:U32 -> 0x2e83918d1bc42f45733fbb5a82ec7963/Vulkan.Action(Maybe<&1, Pair(Maybe<&1, Target>, 0x2e83918d1bc42f45733fbb5a82ec7963/examples/window_scene.Camera)>)

def tick source · line 244 · raw

@snapshot:0x2e83918d1bc42f45733fbb5a82ec7963/Vulkan.WindowSnapshot -> @renderer:Renderer -> @current:Maybe<&1, Target> -> @camera:0x2e83918d1bc42f45733fbb5a82ec7963/examples/window_scene.Camera -> 0x2e83918d1bc42f45733fbb5a82ec7963/Vulkan.Action(Maybe<&1, Pair(Maybe<&1, Target>, 0x2e83918d1bc42f45733fbb5a82ec7963/examples/window_scene.Camera)>)

def loop source · line 249 · raw

@fuel:Nat -> @state:Maybe<&1, Pair(Maybe<&1, Target>, 0x2e83918d1bc42f45733fbb5a82ec7963/examples/window_scene.Camera)> -> @+renderer:Renderer -> 0x2e83918d1bc42f45733fbb5a82ec7963/Vulkan.Action(Unit)

Finite fuel keeps the event loop within Bend's termination rules (years at 60 Hz).

def run source · line 262 · raw

@entry:0x2e83918d1bc42f45733fbb5a82ec7963/Vulkan.Entry -> 0x2e83918d1bc42f45733fbb5a82ec7963/Vulkan.Action(Unit)

def main source · line 268 · raw

IO(Unit)