luv

Workshop wiki

renderer.lisp

luvcraft/renderer.lisp

system luvcraft/core · 23 definitions · on GitHub

The GPU-owned half of a running luvcraft session.

in-package#:luvcraft
defgenericrelease-luvcraft-component
component
:documentation

Release every resource owned by component.

Component release is an owner boundary: callers name the component once, rather than reproducing its private resource inventory.

defstruct
luvcraft-frame-extents
:constructormake-luvcraft-frame-extents
renderpresentation

The two resolution domains installed together at a frame boundary.

renderpresentation
defgenericresize-luvcraft-component
componentextents
:documentation

Replace component's frame-sized state at a frame boundary.

extents names both the expensive game-scene resolution and the final drawable-matched resolution where native-density application UI is composed.

defclassluvcraft-renderer
device:initarg:device:readerluvcraft-renderer-device
context:initarg:context:readerluvcraft-renderer-context
atlas-texture:initarg:atlas-texture:accessorluvcraft-renderer-atlas-texture
atlas-view:initarg:atlas-view:accessorluvcraft-renderer-atlas-view
atlas-sampler:initarg:atlas-sampler:readerluvcraft-renderer-atlas-sampler
normal-atlas-texture:initarg:normal-atlas-texture:accessorluvcraft-renderer-normal-atlas-texture
normal-atlas-view:initarg:normal-atlas-view:accessorluvcraft-renderer-normal-atlas-view

One slot is the publication point for the complete extent-sized cohort. Readers can therefore never observe a new colour image with an old depth or presentation image while a live resize is being installed.

frame-attachments:initarg:frame-attachments:initformnil:accessorluvcraft-renderer-frame-attachments
shadow-depth-texture:initarg:shadow-depth-texture:readerluvcraft-renderer-shadow-depth-texture
shadow-depth-view:initarg:shadow-depth-view:readerluvcraft-renderer-shadow-depth-view
shadow-depth-sampler:initarg:shadow-depth-sampler:readerluvcraft-renderer-shadow-depth-sampler
shadow-comparison-sampler:initarg:shadow-comparison-sampler:readerluvcraft-renderer-shadow-comparison-sampler
layout:initarg:layout:readerluvcraft-renderer-layout
shadow-layout:initarg:shadow-layout:readerluvcraft-renderer-shadow-layout
post-layout:initarg:post-layout:readerluvcraft-renderer-post-layout
bloom-layout:initarg:bloom-layout:initformnil:readerluvcraft-renderer-bloom-layout
linear-sampler:initarg:linear-sampler:initformnil:readerluvcraft-renderer-linear-sampler
block-pipeline:initarg:block-pipeline:readerluvcraft-renderer-block-pipeline
shadow-pipeline:initarg:shadow-pipeline:readerluvcraft-renderer-shadow-pipeline
sky-vertex-buffer:initarg:sky-vertex-buffer:initformnil:readerluvcraft-renderer-sky-vertex-buffer
sky-pipeline:initarg:sky-pipeline:initformnil:readerluvcraft-renderer-sky-pipeline
crosshair-vertex-buffer:initarg:crosshair-vertex-buffer:readerluvcraft-renderer-crosshair-vertex-buffer
cursor-vertex-buffer:initarg:cursor-vertex-buffer:initformnil:readerluvcraft-renderer-cursor-vertex-buffer
crosshair-pipeline:initarg:crosshair-pipeline:readerluvcraft-renderer-crosshair-pipeline
cursor-pipeline:initarg:cursor-pipeline:readerluvcraft-renderer-cursor-pipeline
post-pipeline:initarg:post-pipeline:readerluvcraft-renderer-post-pipeline
bloom-bright-pipeline:initarg:bloom-bright-pipeline:initformnil:readerluvcraft-renderer-bloom-bright-pipeline
bloom-horizontal-pipeline:initarg:bloom-horizontal-pipeline:initformnil:readerluvcraft-renderer-bloom-horizontal-pipeline
bloom-vertical-pipeline:initarg:bloom-vertical-pipeline:initformnil:readerluvcraft-renderer-bloom-vertical-pipeline
sun-shaft-pipeline:initarg:sun-shaft-pipeline:initformnil:readerluvcraft-renderer-sun-shaft-pipeline

The cache and both inventories are private implementation details of this owner. A construction-time rollback list may precede it, but a completed session has no second resource ledger. See #V9VH79.

frame-states:initarg:frame-states:initform
make-hash-table:test#'eql
:readerluvcraft-renderer-frame-states
resources:initarg:resources:initformnil:accessorluvcraft-renderer-resources
:documentation

The sole owner of a session's frame attachments, layouts, pipelines, and per-drawable GPU state. The session coordinates this owner with simulation, streaming, overlays, and presentation; it does not duplicate its inventory.

defmacrodefine-luvcraft-frame-attachment-reader
namekey
`
defmethod,name
getf
luvcraft-renderer-frame-attachmentsrenderer
,key
defparameter+luvcraft-renderer-pipeline-slots+'
block-pipelineshadow-pipelinesky-pipelinecrosshair-pipelinecursor-pipelinepost-pipelinebloom-bright-pipelinebloom-horizontal-pipelinebloom-vertical-pipelinesun-shaft-pipeline
"The named live-pipeline slots whose values form the renderer inventory."
defunluvcraft-renderer-pipelines

Return renderer's live pipelines from their one authoritative slot set.

loopforslotin+luvcraft-renderer-pipeline-slots+forpipeline=
and
slot-boundprendererslot
slot-valuerendererslot
whenpipelinecollectpipeline