hal/vulkan/native.lisp
The three ordinary Vulkan call shapes used so far.
Public, Lisp-shaped operations.
Luv assumes modern Vulkan. Timeline semaphores and synchronization2 are mandatory core features at this version.
Never unwind through a Vulkan driver. Callback failures are reported and Vulkan is always told not to abort the call which produced the message.
Install callback for instance and return an owned DEBUG-MESSENGER.
callback receives one DEBUG-MESSAGE. VK_EXT_debug_utils must have been
enabled when instance was created. Keep the returned messenger alive and
destroy it before destroying instance.
Destroy messenger and release its Lisp callback. Safe to call twice.
Whether physical-device exposes Vulkan's core shaderInt64 feature.
Whether physical-device offers VK_EXT_mesh_shader's task and mesh stages.
Return the optional presentation feature bits exposed by physical-device.
The values are PRESENT-TIMING, PRESENT-AT-ABSOLUTE-TIME,
PRESENT-AT-RELATIVE-TIME, and present-id-2. A feature whose extension was not
advertised is never placed in the query chain and is returned as NIL.
Asking for VK_EXT_mesh_shader admits its commands; the two stages themselves are features, and a pipeline whose module declares MeshShadingEXT is invalid without them.
A mesh pipeline has no vertex stage, and a resource it reads from the task or mesh stage must say so: a descriptor visible only to :VERTEX is not visible to the stages that replaced it.
Create a pass whose color attachments have formats in location order.
Call function with one Vulkan blend attachment per fragment target.
Link a task, mesh, and fragment stage into one VK_EXT_mesh_shader pipeline.
A mesh pipeline draws no vertices, so it carries neither a vertex input nor an input assembly state; the mesh stage's own OpExecutionMode names its output topology.
Dispatch X by Y by Z task (or mesh) workgroups into command-buffer.
Fill pointer, an array of VkSemaphoreSubmitInfo, from entries.
Each entry is a list (SEMAPHORE STAGES &optional VALUE). STAGES is a PIPELINE-STAGE-FLAGS-2 keyword list. VALUE is meaningful only when SEMAPHORE is a timeline semaphore.
Submit buffers through vkQueueSubmit2.
wait-semaphores and signal-semaphores are sequences of semaphore submit
entries as understood by fill-semaphore-submit-infos.
Return timing and present-id capabilities for this particular surface.
Return current swapchain timing properties, or NIL while they are warming.
Return (TIME-DOMAIN . ID) pairs, or NIL while they are warming.
Call function for each complete timing as ID, STAGE, TIME, DOMAIN, DOMAIN-ID.
Create a timeline semaphore whose 64-bit counter starts at initial-value.
Return the current 64-bit counter of a timeline semaphore.
Block until timeline semaphore's counter reaches at least value.
An out-of-date swapchain is an ordinary answer rather than a failure: the window changed size and the caller is expected to rebuild. Report it as the second value instead of signalling.
(name lambda-list call &key element extractor
(operation (intern (symbol-name name) :keyword)))A block-level piece of an Org document.
((operation &rest accepted-results) &body body)Test whether two compatible scalars are equal.
(pointer type &optional (count 1))(name lambda-list call &key (element :pointer) checked
(operation (intern (symbol-name name) :keyword)))(properties index)(&key
(application-name "luv")
((:application-version application-version-value)
(make-version 0 0 1))
(engine-name "luv")
((:engine-version engine-version-value) (make-version 0 0 1))
;; Luv assumes modern Vulkan. Timeline semaphores and
;; synchronization2 are mandatory core features at this version.
((:api-version api-version-value) (make-version 1 4 0))
flags
enabled-extension-names)(physical-device family-index &key enabled-extension-names
additional-family-indices)(device queue-family-index &optional (queue-index 0))(device &key type format width height (depth 1) usage
(mip-levels 1) (array-layers 1) (samples :1)
(tiling :optimal) (sharing-mode :exclusive)
(initial-layout :undefined))(device size usage)(device size memory-type-index)(device image format &key (view-type :2d) (aspect :color))(device words)(device set-layouts)(device &key (mag-filter :linear) (min-filter :linear)
(mipmap-mode :nearest)
(address-mode-u :clamp-to-edge)
(address-mode-v :clamp-to-edge)
(address-mode-w :clamp-to-edge)
compare)(device render-pass image-views width height &key depth-view)(device queue-family-index &key flags)(device)(&optional (stream *standard-output*))(major minor patch)(bindings &body body)((variable type &rest fields) &body body)(instance)(pointer)(instance name)(instance callback
&key
(severities '(:warning :error))
(types '(:general :validation :performance)))Install CALLBACK for INSTANCE and return an owned DEBUG-MESSENGER. CALLBACK receives one DEBUG-MESSAGE. VK_EXT_debug_utils must have been enabled when INSTANCE was created. Keep the returned messenger alive and destroy it before destroying INSTANCE.
Logical disjunction of tests and raw truth values.
(messenger)(physical-device)The minimum of compatible quantities.
(physical-device)Logical negation of one test or raw truth value.
(physical-device)Logical conjunction of tests and raw truth values.
VK_EXT_mesh_shader
(physical-device &key present-timing-p present-id-2-p)Return the optional presentation feature bits exposed by PHYSICAL-DEVICE. The values are PRESENT-TIMING, PRESENT-AT-ABSOLUTE-TIME, PRESENT-AT-RELATIVE-TIME, and PRESENT-ID-2. A feature whose extension was not advertised is never placed in the query chain and is returned as NIL.
VK_EXT_present_timing
VK_KHR_present_id2
(pointer type &rest fields)(device)(device)(physical-device)Headings, paragraphs, figures and their IDs, mentions, marks.
(device image)(device image)(device buffer)(device buffer)(device memory)(device image memory &optional (offset 0))(device buffer memory &optional (offset 0))(device memory size &optional (offset 0))(device memory)(range aspect)(device view)((pointer type values) &body body)Multiplication and scalar scaling.
(device shader-module)(specification)(device &key (binding 0))(device &key (binding 0) (stages '(:vertex)))(device entries)(device layout)How the children of a list are arranged.
Layouts: binding grids, clauses, loop rows. The selectors are the roles dexp.lisp assigns.
(device layout)(device shader-module layout &key (entry-point "main"))(device sampler)(store-op)(device formats &key depth-format (depth-store-op :discard))Addition over compatible quantities.
(device depth-format &key (depth-store-op :store))(device render-pass)(device framebuffer)(vertex-buffers function)(depth-compare depth-write-enabled function)(blends function)(device vertex-module fragment-module layout render-pass
&key (vertex-entry-point "main") (fragment-entry-point "main")
(topology :triangle-strip) vertex-buffers
depth-compare depth-write-enabled blends blend)(device name)(device mesh-module fragment-module layout render-pass
&key task-module (task-entry-point "main") (mesh-entry-point "main")
(fragment-entry-point "main")
depth-compare depth-write-enabled blends blend)Link a task, mesh, and fragment stage into one VK_EXT_mesh_shader pipeline. A mesh pipeline draws no vertices, so it carries neither a vertex input nor an input assembly state; the mesh stage's own OpExecutionMode names its output topology.
(device command-buffer x y z)(device pipeline)(device &key (max-sets 1))(device &key (max-sets 1))(device entries &key (max-sets 1))(device pool)(device pool layout)(device descriptor-set image-view &key (binding 0))(device descriptor-set buffer buffer-size &key (binding 0))(device descriptor-set entries)The maximum of compatible quantities.
(device command-pool)(device command-pool &key (level :primary))(command-buffer &key flags)(command-buffer)(command-buffer image old-layout new-layout
src-access dst-access src-stage dst-stage &key (aspect :color))(command-buffer image layout color)(command-buffer source source-layout destination destination-layout
width height &optional (depth 1))(command-buffer buffer image layout width height
&key (buffer-offset 0) (buffer-row-length 0)
(buffer-image-height 0) (x 0) (y 0) (depth 1))(command-buffer image layout buffer width height &optional (depth 1))(command-buffer pipeline)(command-buffer pipeline)(command-buffer pipeline-layout descriptor-set)(command-buffer pipeline-layout descriptor-set)(command-buffer binding buffer &optional (offset 0))(command-buffer x y &optional (z 1))(command-buffer render-pass framebuffer width height clear-colors
&key depth-clear-value)(command-buffer render-pass framebuffer width height depth-clear-value)(command-buffer width height)(command-buffer x y width height)(command-buffer)(command-buffer vertex-count &optional (instance-count 1)
(first-vertex 0) (first-instance 0))(command-buffer buffer offset index-type)(command-buffer index-count &optional (instance-count 1)
(first-index 0) (vertex-offset 0)
(first-instance 0))(pointer entries)Fill POINTER, an array of VkSemaphoreSubmitInfo, from ENTRIES. Each entry is a list (SEMAPHORE STAGES &optional VALUE). STAGES is a PIPELINE-STAGE-FLAGS-2 keyword list. VALUE is meaningful only when SEMAPHORE is a timeline semaphore.
(queue buffers &key (wait-semaphores #()) (signal-semaphores #()))Submit BUFFERS through vkQueueSubmit2. WAIT-SEMAPHORES and SIGNAL-SEMAPHORES are sequences of semaphore submit entries as understood by FILL-SEMAPHORE-SUBMIT-INFOS.
(queue work)Schedule some command buffers on the QUEUE. Submission is asynchronous: returning does not mean the GPU has finished the work, only that the implementation retains everything the work depends on until it completes. Use SUBMITTED-WORK-DONE to wait.
(queue command-buffer)(queue)(physical-device queue-family-index surface)(pointer)(physical-device surface)(physical-device surface)(formats index)(device surface format color-space extent
&key min-image-count (usage '(:transfer-dst))
(pre-transform :identity) (composite-alpha :opaque)
(present-mode :fifo-khr) old-swapchain present-timing-p)(device swapchain size)(device swapchain)(device swapchain)(&optional (count "12"))Print COUNT fresh figure IDs that no page uses (default 12); never six hex digits, which the reader takes for a colour.
(device swapchain function)(device swapchain)(device &key (initial-value 0))(device semaphore)(device semaphore)(device semaphore value &key (timeout #xffffffffffffffff))(device swapchain semaphore &key (timeout #xffffffffffffffff))(queue swapchain image-index
&key (wait-semaphores #()) present-id present-stage time-domain-id
target-time target-time-domain-present-stage)
Lisp-shaped Vulkan operations built on the owned ABI.
The raw `vk:` entry points and structs stay in defs.lisp; this file gives the GPU and canvas backends the small, direct `lvk:` vocabulary they use.