The cepl Reference Manual

Next: , Previous: , Up: (dir)   [Contents][Index]

The cepl Reference Manual

This is the cepl Reference Manual, generated automatically by Declt version 4.0 beta 2 "William Riker" on Thu Sep 15 03:26:38 2022 GMT+0.

Table of Contents


1 Introduction

CEPL (Code Evaluate Play Loop) - [Beta]

CEPL is a lispy and REPL-friendly Common Lisp library for working with OpenGL.

Its definition of success is making the user feel that GPU programming has always been part of the languages standard.

The usual approach to using CEPL is to start it at the beginning of your Lisp session and leave it open for the duration of your work. You can then treat the window it creates as just another output for your graphics, analogous to how *standard-output* is treated for text.

CEPL is in beta. The API is close to what it needs to be but there are still many bugs to fix, features to add, and experiences to smooth out.

See the cepl.examples repository for some examples of how CEPL can be used

Videos: http://www.youtube.com/playlist?list=PL2VAYZE_4wRKKr5pJzfYD1w4tKCXARs5y

Installing

Run (ql:quickload :cepl) at your REPL.

Cloning

Whilst it is recommended to get CEPL from quicklisp, if you clone please note that master is not the stable branch. Please use release-quicklisp for the stable code that will be in the next CEPL release.

Documentation

Currently we have full documentation of every exported symbol in the CEPL package. You can find this here: CEPL API Docs

Guides will be provided in future, however these take much longer to write.

I can also be reached by my email (techsnuffle [at] gmail ยท com) and sometimes on #lispgames IRC. Come to #lispgames anyway though, there are some lovely folks, all lispy dialects welcome!

Requirements

All of the following will be downloaded automatically by quicklisp

C Library dependency

CEPL uses OpenGL ( version >= 3.1 ) so you need to make sure it is available on your machine. Installing your GPU drivers will usually handle this.

CEPL's Host

CEPL abstracts working with OpenGL but is not responsible for creating a window or GL context; this is handled by a Host. Right now the only supported host is SDL2; the system to load is called cepl.sdl2, you can find it here: cepl.sdl2

Getting Started

Note: On macOS, slime users will need to read docs/single-thread-swank.md to deal with a complication specific to projects interacting with the window manager. You can then follow the rest of this guide as usual.

To load CEPL and the default host (sdl2) do the following:

You should see an empty window appear, OpenGL is now initialized, and you can use CEPL as you like.

Making a CEPL Project

The best way to get started is to make a new project that uses CEPL. Do the following in your REPL to get set up:

You are now ready to get started. Simply run:

Windows C Library Hack

If you are having issues getting the C libraries to load and just need to rule out whether Lisp can find them, try putting them in the same folder as the lisp exe. For example C:\Program Files\sbcl\.

CHANGELOG

This mainly covers features & news rather than individual bugfixes. When we are out of beta these will be covered more often

2019-05-05

2019-04-XX

2019-02-XX

2019-01-20

2018-09-29

2018-08-10

2018-07-15

2018-04-02

Headlines:

The most important change this release is that lambda pipelines now recompile when the functions they use as stages are recompiled. This change comes with a performance cost of course so if you wish to opt out of this (recommended for when you ship your project) then pass :static in the context argument to pipeline-g

Also if you are using GL>=4.3 you can now create empty fbos, which are handy if you want to use the fragment stage without writing data to bound textures (compute-type fun to be had here)

Other important changes:

2018-02-17

BREAKING CHANGES

Due to the changes listed below you will now want to change your current asd's to require :rtg-math.vari and to change your packages to :use :rtg-math.

Some folks were asking for the ability to use their own math libraries rather than rtg-math which CEPL has depended on up until now. I have made this change but this means that this is something users will have to add themselves from now on.

For those picking a library cepl expects vectors & matrices to be sized simple-arrays of single-floats e.g. (make-array 3 :element-type 'single-float) for 3 component vectors.

We have also removed the dependency on fn & cl-fad.

Other Changes:

2018-01-11

*I am terrible at changelogs. I am retroactively making the updates for everything between june 2017 and jan 2018

2017-12-??

2017-11-??

2017-10-??

2017-09-??

2017-08-??

2017-07-??

2017-06-??

2017-06-04

2017-05-16

I missed some logs here so this is a recap of everything since 2017-02-19

2017-02-19


2 Systems

The main system appears first, followed by any subsystem dependency.


Next: , Previous: , Up: Systems   [Contents][Index]

2.1 cepl

Fast lispy way to work with OpenGL

Author

Chris Bagley (Baggers) <techsnuffle@gmail.com>

License

BSD 2 Clause

Dependencies
  • cffi (system).
  • uiop (system).
  • cl-opengl (system).
  • cl-ppcre (system).
  • documentation-utils (system).
  • ieee-floats (system).
  • varjo (system).
  • bordeaux-threads (system).
  • cepl.build (system).
  • alexandria (system).
  • split-sequence (system).
  • float-features (system).
Source

cepl.asd.

Child Components

Previous: , Up: Systems   [Contents][Index]

2.2 cepl.build

Common package and system behind CEPL’s profiling tools

Author

Chris Bagley <techsnuffle@gmail.com>

License

BSD 2 Clause

Dependency

alexandria (system).

Source

cepl.build.asd.

Child Components

3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


Previous: , Up: Files   [Contents][Index]

3.1 Lisp


Next: , Previous: , Up: Lisp   [Contents][Index]

3.1.1 cepl/cepl.asd

Source

cepl.asd.

Parent Component

cepl (system).

ASDF Systems

cepl.


Next: , Previous: , Up: Lisp   [Contents][Index]

3.1.2 cepl.build/cepl.build.asd

Source

cepl.build.asd.

Parent Component

cepl.build (system).

ASDF Systems

cepl.build.


3.1.4 cepl/host/api-api.lisp

Dependency

package.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).

Public Interface

register-host (function).

Internals

3.1.5 cepl/host/api-generics.lisp

Dependency

host/api-api.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).

Internals

3.1.6 cepl/host/api-0.lisp

Dependency

host/api-generics.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).

Public Interface
Internals

3.1.7 cepl/host/api-1.lisp

Dependency

host/api-0.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).

Public Interface

api-1 (class).

Internals

3.1.8 cepl/host/api-2.lisp

Dependency

host/api-1.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).

Public Interface

api-2 (class).

Internals

3.1.9 cepl/host/api-common.lisp

Dependency

host/api-2.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).

Public Interface
Internals

3.1.10 cepl/core/ffi.lisp

Dependency

host/api-common.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).


3.1.11 cepl/core/early.lisp

Dependency

core/ffi.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).

Internals

+gl-enum-size+ (constant).


3.1.12 cepl/core/utils.lisp

Dependency

core/early.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).

Packages

defxstar-hidden.

Public Interface
Internals

3.1.13 cepl/project.lisp

Dependency

core/utils.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).

Public Interface

make-project (function).

Internals

3.1.14 cepl/core/context/documentation-functions.lisp

Dependency

project.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).

Public Interface

3.1.15 cepl/core/lifecycle.lisp

Dependency

core/context/documentation-functions.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).

Public Interface
Internals

3.1.16 cepl/core/measurements/measurements.lisp

Dependency

core/lifecycle.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).

Public Interface

3.1.17 cepl/core/memory/memory.lisp

Dependency

core/measurements/measurements.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).

Public Interface

3.1.18 cepl/core/types/math.lisp

Dependency

core/memory/memory.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).


3.1.19 cepl/core/types/cepl-types.lisp

Dependency

core/types/math.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).

Public Interface
Internals

3.1.20 cepl/core/types/checks.lisp

Dependency

core/types/cepl-types.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).

Public Interface

3.1.21 cepl/core/types/nulls-and-uninitialized.lisp

Dependency

core/types/checks.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).

Public Interface
Internals

3.1.22 cepl/core/context/gl-context.lisp

Dependency

core/types/nulls-and-uninitialized.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).

Public Interface
Internals

3.1.23 cepl/core/context/types.lisp

Dependency

core/context/gl-context.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).

Public Interface
Internals

3.1.24 cepl/core/context/cepl-context.lisp

Dependency

core/context/types.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).

Public Interface
Internals

3.1.25 cepl/core/context/surface.lisp

Dependency

core/context/cepl-context.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).

Public Interface
Internals

3.1.26 cepl/core/context/delayed-resource-init.lisp

Dependency

core/context/surface.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).

Internals

3.1.27 cepl/core/context/version.lisp

Dependency

core/context/delayed-resource-init.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).

Public Interface

split-float-version (function).

Internals

get-best-glsl-version (function).


3.1.28 cepl/core/blending/blending.lisp

Dependency

core/context/version.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).

Public Interface
Internals

3.1.29 cepl/core/stencil/stencil.lisp

Dependency

core/blending/blending.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).

Public Interface
Internals

3.1.30 cepl/core/stencil/mask.lisp

Dependency

core/stencil/stencil.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).

Public Interface
Internals

3.1.31 cepl/core/scissor/scissor.lisp

Dependency

core/stencil/mask.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).

Public Interface
Internals

3.1.32 cepl/core/color/color.lisp

Dependency

core/scissor/scissor.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).

Public Interface
Internals

3.1.33 cepl/core/pixel-store/pixel-store.lisp

Dependency

core/color/color.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).

Public Interface
Internals

3.1.34 cepl/core/depth/depth.lisp

Dependency

core/pixel-store/pixel-store.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).

Public Interface
Internals

3.1.35 cepl/core/face/face.lisp

Dependency

core/depth/depth.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).

Public Interface
Internals

3.1.36 cepl/core/types/initalized-p.lisp

Dependency

core/face/face.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).

Public Interface

3.1.37 cepl/core/internals.lisp

Dependency

core/types/initalized-p.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).

Public Interface
Internals

3.1.38 cepl/core/types/types.lisp

Dependency

core/internals.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).

Public Interface

3.1.39 cepl/core/errors.lisp

Dependency

core/types/types.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).

Public Interface
Internals

3.1.40 cepl/core/viewports/viewport.lisp

Dependency

core/errors.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).

Public Interface
Internals

3.1.41 cepl/core/types/image-format.lisp

Dependency

core/viewports/viewport.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).

Public Interface

3.1.42 cepl/core/types/pixel-format.lisp

Dependency

core/types/image-format.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).

Public Interface
Internals

3.1.44 cepl/core/types/cffi-helpers.lisp

Dependency

core/types/cffi-extra-primitive-types.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).

Public Interface
Internals

3.1.45 cepl/core/c-arrays/def.lisp

Dependency

core/types/cffi-helpers.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).

Public Interface
Internals

3.1.46 cepl/core/c-arrays/aref-c.lisp

Dependency

core/c-arrays/def.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).

Public Interface
Internals

3.1.47 cepl/core/c-arrays/populate.lisp

Dependency

core/c-arrays/aref-c.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).

Public Interface

copy-lisp-data-to-c-array (function).

Internals

3.1.48 cepl/core/c-arrays/make.lisp

Dependency

core/c-arrays/populate.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).

Public Interface
Internals

3.1.49 cepl/core/c-arrays/map.lisp

Dependency

core/c-arrays/make.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).

Public Interface
Internals

3.1.50 cepl/core/c-arrays/rest.lisp

Dependency

core/c-arrays/map.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).

Public Interface
Internals

3.1.51 cepl/core/types/layout.lisp

Dependency

core/c-arrays/rest.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).

Public Interface
Internals

3.1.52 cepl/core/types/structs.lisp

Dependency

core/types/layout.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).

Public Interface
Internals

3.1.53 cepl/core/gpu-buffers/gpu-buffers.lisp

Dependency

core/types/structs.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).

Public Interface
Internals

3.1.54 cepl/core/gpu-arrays/buffer-backed.lisp

Dependency

core/gpu-buffers/gpu-buffers.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).

Public Interface
Internals

3.1.55 cepl/core/vaos/vaos.lisp

Dependency

core/gpu-arrays/buffer-backed.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).

Public Interface
Internals

3.1.56 cepl/core/streams/buffer-streams.lisp

Dependency

core/vaos/vaos.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).

Public Interface
Internals

3.1.57 cepl/core/transform-feedback/transform-feedback.lisp

Dependency

core/streams/buffer-streams.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).

Public Interface
Internals

3.1.58 cepl/core/pipelines/compile-context.lisp

Dependency

core/transform-feedback/transform-feedback.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).

Public Interface
Internals

3.1.59 cepl/core/pipelines/generics.lisp

Dependency

core/pipelines/compile-context.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).

Public Interface

delete-gpu-function (generic function).

Internals

3.1.60 cepl/core/pipelines/uniforms.lisp

Dependency

core/pipelines/generics.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).

Internals

3.1.61 cepl/core/pipelines/gpu-macros.lisp

Dependency

core/pipelines/uniforms.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).

Public Interface

3.1.62 cepl/core/pipelines/gpu-pipeline-base.lisp

Dependency

core/pipelines/gpu-macros.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).

Public Interface
Internals

3.1.63 cepl/core/pipelines/pipeline-validation.lisp

Dependency

core/pipelines/gpu-pipeline-base.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).

Internals

3.1.64 cepl/core/pipelines/funcall-g.lisp

Dependency

core/pipelines/pipeline-validation.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).

Public Interface

funcall-g (function).

Internals

3.1.65 cepl/core/pipelines/gpu-functions.lisp

Dependency

core/pipelines/funcall-g.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).

Public Interface
Internals

3.1.66 cepl/core/pipelines/glsl-stages.lisp

Dependency

core/pipelines/gpu-functions.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).

Public Interface

def-glsl-stage (macro).

Internals

3.1.67 cepl/core/pipelines/mapg-context.lisp

Dependency

core/pipelines/glsl-stages.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).

Internals

3.1.68 cepl/core/pipelines/uniform-assigners-generation.lisp

Dependency

core/pipelines/mapg-context.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).

Internals

3.1.69 cepl/core/pipelines/programs.lisp

Dependency

core/pipelines/uniform-assigners-generation.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).

Internals

3.1.70 cepl/core/pipelines/multi-draw.lisp

Dependency

core/pipelines/programs.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).

Public Interface
Internals

3.1.71 cepl/core/pipelines/defpipeline.lisp

Dependency

core/pipelines/multi-draw.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).

Public Interface
Internals

3.1.72 cepl/core/pipelines/gpu-lambda.lisp

Dependency

core/pipelines/defpipeline.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).

Public Interface
Internals

3.1.73 cepl/core/pipelines/bake.lisp

Dependency

core/pipelines/gpu-lambda.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).

Public Interface

bake-uniforms (function).

Internals

bake-and-g-> (function).


3.1.74 cepl/core/textures/def.lisp

Dependency

core/pipelines/bake.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).

Public Interface
Internals

3.1.75 cepl/core/samplers/samplers.lisp

Dependency

core/textures/def.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).

Public Interface
Internals

3.1.76 cepl/core/textures/textures.lisp

Dependency

core/samplers/samplers.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).

Public Interface
Internals

3.1.77 cepl/core/textures/texture-samplers.lisp

Dependency

core/textures/textures.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).

Internals

3.1.78 cepl/core/render-buffers/render-buffer.lisp

Dependency

core/textures/texture-samplers.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).

Public Interface
Internals

3.1.79 cepl/core/samplers/context.lisp

Dependency

core/render-buffers/render-buffer.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).

Internals

3.1.80 cepl/core/pipelines/map-g.lisp

Dependency

core/samplers/context.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).

Public Interface
Internals

map-g-into* (macro).


3.1.81 cepl/core/pipelines/quad-stages.lisp

Dependency

core/pipelines/map-g.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).

Internals

3.1.82 cepl/core/gpu-arrays/texture-backed.lisp

Dependency

core/pipelines/quad-stages.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).

Public Interface

3.1.83 cepl/core/gpu-arrays/with-and-push.lisp

Dependency

core/gpu-arrays/texture-backed.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).

Public Interface
Internals

3.1.84 cepl/core/fbos/fbo.lisp

Dependency

core/gpu-arrays/with-and-push.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).

Public Interface
Internals

3.1.85 cepl/core/ubos/ubo.lisp

Dependency

core/fbos/fbo.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).

Public Interface
Internals

3.1.86 cepl/core/ssbos/ssbos.lisp

Dependency

core/ubos/ubo.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).

Public Interface
Internals

3.1.87 cepl/core/sync/sync.lisp

Dependency

core/ssbos/ssbos.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).

Public Interface
Internals

cepl-client-wait-sync (function).


3.1.88 cepl/core/queries/query.lisp

Dependency

core/sync/sync.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).

Public Interface
Internals

3.1.89 cepl/core/compute/compute.lisp

Dependency

core/queries/query.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).

Public Interface

3.1.90 cepl/core/types/predefined/gpu-structs.lisp

Dependency

core/compute/compute.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).

Public Interface
Internals

3.1.91 cepl/core/context/make.lisp

Dependency

core/types/predefined/gpu-structs.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).

Internals

set-context-defaults (function).


3.1.92 cepl/core/context/known-state-blocks.lisp

Dependency

core/context/make.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).

Public Interface

with-context-state-restored (macro).

Internals

3.1.93 cepl/core/repl.lisp

Dependency

core/context/known-state-blocks.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).

Public Interface

3.1.94 cepl/docs/api/package.lisp

Dependency

core/repl.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).

Packages

cepl.docs.


3.1.95 cepl/core/types/docs-image-formats.lisp

Dependency

docs/api/package.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).


3.1.96 cepl/core/types/docs-pixel-formats.lisp

Dependency

core/types/docs-image-formats.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).


3.1.97 cepl/core/types/predefined/docs.lisp

Dependency

core/types/docs-pixel-formats.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).


3.1.98 cepl/core/types/docs.lisp

Dependency

core/types/predefined/docs.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).


3.1.99 cepl/core/measurements/docs.lisp

Dependency

core/types/docs.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).


3.1.100 cepl/core/memory/docs.lisp

Dependency

core/measurements/docs.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).


3.1.101 cepl/core/c-arrays/docs.lisp

Dependency

core/memory/docs.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).


3.1.102 cepl/core/gpu-buffers/docs.lisp

Dependency

core/c-arrays/docs.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).


3.1.103 cepl/core/gpu-arrays/docs.lisp

Dependency

core/gpu-buffers/docs.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).


3.1.104 cepl/core/streams/docs.lisp

Dependency

core/gpu-arrays/docs.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).


3.1.105 cepl/core/viewports/docs.lisp

Dependency

core/streams/docs.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).


3.1.106 cepl/core/textures/docs.lisp

Dependency

core/viewports/docs.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).


3.1.107 cepl/core/samplers/docs.lisp

Dependency

core/textures/docs.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).


3.1.108 cepl/core/fbos/docs.lisp

Dependency

core/samplers/docs.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).


3.1.109 cepl/core/blending/docs.lisp

Dependency

core/fbos/docs.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).


3.1.110 cepl/core/ubos/docs.lisp

Dependency

core/blending/docs.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).


3.1.111 cepl/core/ssbos/docs.lisp

Dependency

core/ubos/docs.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).


3.1.112 cepl/core/vaos/docs.lisp

Dependency

core/ssbos/docs.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).


3.1.113 cepl/core/pipelines/docs.lisp

Dependency

core/vaos/docs.lisp (file).

Source

cepl.asd.

Parent Component

cepl (system).


3.1.114 cepl.build/build/package.lisp

Source

cepl.build.asd.

Parent Component

cepl.build (system).

Packages

cepl.build.


3.1.115 cepl.build/build/build.lisp

Dependency

build/package.lisp (file).

Source

cepl.build.asd.

Parent Component

cepl.build (system).

Public Interface
Internals

*cepl-release-mode* (special variable).


3.1.116 cepl.build/defn/package.lisp

Dependency

build/build.lisp (file).

Source

cepl.build.asd.

Parent Component

cepl.build (system).

Packages

cepl.defn.


3.1.117 cepl.build/defn/defn.lisp

Dependency

defn/package.lisp (file).

Source

cepl.build.asd.

Parent Component

cepl.build (system).

Public Interface
Internals

4 Packages

Packages are listed by definition order.


Next: , Previous: , Up: Packages   [Contents][Index]

4.1 cepl.pipelines

Source

package.lisp.

Use List
Used By List

cepl.

Public Interface
Internals

Next: , Previous: , Up: Packages   [Contents][Index]

4.2 %cepl.types

Source

package.lisp.

Use List
Used By List
Public Interface
Internals

Next: , Previous: , Up: Packages   [Contents][Index]

4.3 cepl.sync

Source

package.lisp.

Use List
Used By List

cepl.

Public Interface
Internals

cepl-client-wait-sync (function).


Next: , Previous: , Up: Packages   [Contents][Index]

4.4 cepl.render-buffers

Source

package.lisp.

Use List
Used By List

cepl.

Public Interface
Internals

4.5 cepl.fbos

Source

package.lisp.

Use List
Used By List
Public Interface
Internals

Next: , Previous: , Up: Packages   [Contents][Index]

4.6 cepl.context

Source

package.lisp.

Use List
Used By List
Public Interface
Internals

4.7 cepl.types

Source

package.lisp.

Use List
Used By List
Public Interface
Internals

Next: , Previous: , Up: Packages   [Contents][Index]

4.8 cepl.types.predefined

Source

package.lisp.

Use List
Used By List

cepl.

Public Interface
Internals

4.9 cepl.docs

Source

docs/api/package.lisp.

Use List
  • cepl.
  • common-lisp.

Next: , Previous: , Up: Packages   [Contents][Index]

4.10 cepl.blending

Source

package.lisp.

Use List
Used By List
Public Interface
Internals

4.11 cepl.gpu-buffers

Source

package.lisp.

Use List
Used By List
Public Interface
Internals

Next: , Previous: , Up: Packages   [Contents][Index]

4.12 cepl.types.foreign

Source

package.lisp.

Use List
Public Interface

4.13 cepl.scissor

Source

package.lisp.

Use List
Used By List

cepl.

Public Interface
Internals

Next: , Previous: , Up: Packages   [Contents][Index]

4.14 cepl.viewports

Source

package.lisp.

Use List
Used By List
Public Interface
Internals

Next: , Previous: , Up: Packages   [Contents][Index]

4.15 defxstar-hidden

Source

core/utils.lisp.

Use List

common-lisp.

Internals

Next: , Previous: , Up: Packages   [Contents][Index]

4.16 cepl.memory

Source

package.lisp.

Use List
Used By List
Public Interface

Next: , Previous: , Up: Packages   [Contents][Index]

4.17 cepl.lifecycle

Source

package.lisp.

Use List
Used By List

cepl.

Public Interface
Internals

4.18 cepl.errors

Source

package.lisp.

Use List
Used By List
Public Interface
Internals

Next: , Previous: , Up: Packages   [Contents][Index]

4.19 cepl.measurements

Source

package.lisp.

Use List
Used By List
Public Interface

4.20 cepl.ssbos

Source

package.lisp.

Use List
Used By List
Public Interface
Internals

Next: , Previous: , Up: Packages   [Contents][Index]

4.21 cepl.gpu-arrays.buffer-backed

Source

package.lisp.

Use List
Used By List
Public Interface
Internals

4.22 cepl.queries

Source

package.lisp.

Use List
Used By List

cepl.

Public Interface
Internals

Next: , Previous: , Up: Packages   [Contents][Index]

4.23 cepl.hidden

Source

package.lisp.

Use List

common-lisp.

Internals

Next: , Previous: , Up: Packages   [Contents][Index]

4.24 cepl.host

Source

package.lisp.

Use List
Public Interface
Internals

4.26 cepl-utils

Source

package.lisp.

Use List
Used By List
Public Interface
Internals

Next: , Previous: , Up: Packages   [Contents][Index]

4.27 cepl.gpu-arrays.texture-backed

Source

package.lisp.

Use List
Used By List
Public Interface

4.28 cepl.ubos

Source

package.lisp.

Use List
Used By List
Public Interface
Internals

Next: , Previous: , Up: Packages   [Contents][Index]

4.29 cepl.textures

Source

package.lisp.

Use List
Used By List
Public Interface
Internals

Next: , Previous: , Up: Packages   [Contents][Index]

4.30 cepl.streams

Source

package.lisp.

Use List
Used By List
Public Interface
Internals

Next: , Previous: , Up: Packages   [Contents][Index]

4.31 cepl.vaos

Source

package.lisp.

Use List
Used By List
Public Interface
Internals

Next: , Previous: , Up: Packages   [Contents][Index]

4.32 cepl.compute

Source

package.lisp.

Use List
Used By List

cepl.

Public Interface

Next: , Previous: , Up: Packages   [Contents][Index]

4.33 cepl.image-formats

Source

package.lisp.

Use List
Used By List
Public Interface

Next: , Previous: , Up: Packages   [Contents][Index]

4.34 cepl.samplers

Source

package.lisp.

Use List
Used By List
Public Interface
Internals

Next: , Previous: , Up: Packages   [Contents][Index]

4.36 cepl.transform-feedback

Source

package.lisp.

Use List
Used By List

cepl.

Public Interface
Internals

4.37 cepl.stencil

Source

package.lisp.

Use List
Used By List

cepl.

Public Interface
Internals

Next: , Previous: , Up: Packages   [Contents][Index]

4.38 cepl.pixel-formats

Source

package.lisp.

Use List
Used By List
Internals

4.39 cepl.defn

Source

defn/package.lisp.

Use List
  • alexandria.
  • common-lisp.
Used By List
Public Interface
Internals

Next: , Previous: , Up: Packages   [Contents][Index]

4.41 cepl.documentation-functions

Source

package.lisp.

Use List
Used By List
Public Interface

Previous: , Up: Packages   [Contents][Index]

4.43 cepl.c-arrays

Source

package.lisp.

Use List
Used By List
Public Interface
Internals

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


Next: , Previous: , Up: Definitions   [Contents][Index]

5.1 Public Interface


5.1.1 Constants

Constant: +discard-attachment+
Package

cepl.fbos.

Source

core/fbos/fbo.lisp.

Constant: +gl-id-bit-size+
Package

%cepl.types.

Source

core/types/cepl-types.lisp.

Constant: +max-context-count+
Package

cepl.context.

Source

core/context/types.lisp.

Constant: +null-gl-id+
Package

%cepl.types.

Source

core/types/cepl-types.lisp.

Constant: +unknown-gl-id+
Package

%cepl.types.

Source

core/types/cepl-types.lisp.


Next: , Previous: , Up: Public Interface   [Contents][Index]

5.1.2 Special variables

Special Variable: *bptc-compressed-formats*

A list of all of OpenGL’s bptc compressed formats

Package

cepl.image-formats.

Source

core/types/image-format.lisp.

Special Variable: *color-renderable-formats*

A list of all of OpenGL’s color renderable formats

Package

cepl.image-formats.

Source

core/types/image-format.lisp.

Special Variable: *depth-formats*

A list of all of OpenGL’s depth formats

Package

cepl.image-formats.

Source

core/types/image-format.lisp.

Special Variable: *depth-stencil-formats*

A list of all of OpenGL’s depth stencil formats

Package

cepl.image-formats.

Source

core/types/image-format.lisp.

Special Variable: *extra-primitive-types*
Package

%cepl.types.

Source

core/types/cepl-types.lisp.

Special Variable: *floating-point-formats*

A list of all of OpenGL’s floating point formats

Package

cepl.image-formats.

Source

core/types/image-format.lisp.

Special Variable: *image-formats*

A list of all of OpenGL’s image formats

Package

cepl.image-formats.

Source

core/types/image-format.lisp.

Special Variable: *immutable-available*

After CEPL has been initialized this variable will hold t if immutable ‘texture‘ storage is available and nil if not.

Immutable texture storage does not mean that the texture’s ‘gpu-array‘ data is immutable. It means that the underlying format of the texture data cannot be changed. It is rare that you would want mutable storage and when you do, it is very hard to not create ’incomplete-textures’. https://www.opengl.org/wiki/Immutable_Storage_Texture#Texture_completeness

CEPL tries to make only complete textures so this is not a concern. If you do need this level of control, please raise a github issue as I would love to understand your usecase.

Package

cepl.textures.

Source

core/textures/textures.lisp.

Special Variable: *red/green-compressed-formats*

A list of all of OpenGL’s red/green compressed formats

Package

cepl.image-formats.

Source

core/types/image-format.lisp.

Special Variable: *regular-color-formats*

A list of all of OpenGL’s regular color formats

Package

cepl.image-formats.

Source

core/types/image-format.lisp.

Special Variable: *s3tc/dxt-compessed-formats*

A list of all of OpenGL’s s3tc/dxt compessed formats

Package

cepl.image-formats.

Source

core/types/image-format.lisp.

Special Variable: *signed-integral-formats*

A list of all of OpenGL’s signed integral formats

Package

cepl.image-formats.

Source

core/types/image-format.lisp.

Special Variable: *signed-normalized-integer-formats*

A list of all of OpenGL’s signed normalized integer formats

Package

cepl.image-formats.

Source

core/types/image-format.lisp.

Special Variable: *special-color-formats*

A list of all of OpenGL’s special color formats

Package

cepl.image-formats.

Source

core/types/image-format.lisp.

Special Variable: *srgb-color-formats*

A list of all of OpenGL’s srgb color formats

Package

cepl.image-formats.

Source

core/types/image-format.lisp.

Special Variable: *stencil-formats*

A list of all of OpenGL’s stencil formats

Package

cepl.image-formats.

Source

core/types/image-format.lisp.

Special Variable: *unsigned-integral-formats*

A list of all of OpenGL’s unsigned integral formats

Package

cepl.image-formats.

Source

core/types/image-format.lisp.

Special Variable: *unsigned-normalized-integer-formats*

A list of all of OpenGL’s unsigned normalized integer formats

Package

cepl.image-formats.

Source

core/types/image-format.lisp.

Special Variable: *valid-image-formats-for-buffer-backed-texture*

A list of all of OpenGL’s valid image formats for buffer backed texture

Package

cepl.image-formats.

Source

core/types/image-format.lisp.

Special Variable: +null-buffer-backed-gpu-array+
Package

%cepl.types.

Source

core/types/nulls-and-uninitialized.lisp.

Special Variable: +null-fbo+
Package

%cepl.types.

Source

core/types/nulls-and-uninitialized.lisp.

Special Variable: +null-gpu-buffer+
Package

%cepl.types.

Source

core/types/nulls-and-uninitialized.lisp.

Special Variable: +null-texture+
Package

%cepl.types.

Source

core/types/nulls-and-uninitialized.lisp.

Special Variable: +null-texture-backed-gpu-array+
Package

%cepl.types.

Source

core/types/nulls-and-uninitialized.lisp.

Special Variable: +null-vao+
Package

%cepl.types.

Source

core/types/nulls-and-uninitialized.lisp.


5.1.3 Macros

Macro: assert-lambda-list (lambda-list expression datum &rest arguments)
Package

cepl-utils.

Source

core/utils.lisp.

Macro: assoc-bind (lambda-list alist &body body)
Package

cepl-utils.

Source

core/utils.lisp.

Macro: case= (form &body cases)
Package

cepl-utils.

Source

core/utils.lisp.

Macro: dbind (lambda-list expressions &body body)
Package

cepl-utils.

Source

core/utils.lisp.

Macro: def-glsl-stage (name args body-form outputs)

def-glsl-stage is useful when you wish to define a CEPL pipeline stage in glsl rather than lisp. This is especially useful if you want to use some pre-exisiting glsl without rewriting it to lisp.

It is used like this:

(def-glsl-stage frag-glsl (("color_in" :vec4) &context :330 :fragment) "void main() {
color_out = color_in;
}"
(("color_out" :vec4)))

It differs from a regular ‘defun-g‘ definition in a few ways.

- argument names are specified using strings.

- &context is mandatory. You must specify what shader stage this can be used for and also what version/s this stage requires

- You are defining the entire stage, not just a function body. This means you can define local shader functions etc

- You have to specify the outputs in lisp as well as the inputs. This allows CEPL to compose this stage in pipelines with regular CEPL gpu functions.

CEPL will write all the in, out and uniform definitions for your shader so do not specify those yourself.

This stage fully supports livecoding, so feel free to change and recomplile the text in the stage at runtime.

Package

cepl.pipelines.

Source

core/pipelines/glsl-stages.lisp.

Macro: defcondition (name (&key condition-type prefix print-circle print-escape print-length print-level print-lines print-right-margin) (&rest args) error-string &body body)
Package

cepl-utils.

Source

core/utils.lisp.

Macro: deferror (name (&key error-type prefix print-circle print-escape print-length print-level print-lines print-right-margin) (&rest args) error-string &body body)
Package

cepl-utils.

Source

core/utils.lisp.

Macro: define-compiler-macro-g (name lambda-list &body body)

This lets you define a compiler-macro that only works with gpu-functions.

The &context lambda list keyword allows you to restrict this macro to only be valid in gpu functions with compatible contexts.

&whole and &environment are not supported.

Package

cepl.pipelines.

Source

core/pipelines/gpu-macros.lisp.

Macro: define-const (name val &key type)

Differs from alexandrias define-context in that it wont eval the val form at all if the var is already bound. This was we are always eq.

Package

cepl-utils.

Source

core/utils.lisp.

Macro: define-defn-declaration (name args &body body)
Package

cepl.defn.

Source

defn/defn.lisp.

Macro: defmacro-g (name lambda-list &body body)

This lets you a define a macro that only works in gpu code.

The &context lambda list keyword allows you to restrict this macro to only be valid in gpu functions with compatible contexts.

&whole and &environment are not supported.

Package

cepl.pipelines.

Source

core/pipelines/gpu-macros.lisp.

Macro: defmethod+ (name &rest args)
Package

cepl.defn.

Source

defn/defn.lisp.

Macro: defn (name typed-args result-types &body body)

Define a typed function

Package

cepl.defn.

Source

defn/defn.lisp.

Macro: defn-inline (name typed-args result-types &body body)

Define a typed function and request that it be inlined

Package

cepl.defn.

Source

defn/defn.lisp.

Macro: defpipeline-g (name context &body gpipe-args)

‘defpipeline-g‘ is how we define named rendering pipelines in CEPL.

Rendering pipelines are constructed by composing gpu-functions.

Rendering in OpenGL is descibed as a pipeline where a ‘buffer-stream‘ of data usually describing geometry) is mapped over whilst a number of uniforms are available as input and the outputs are written into an ‘FBO‘.

There are many stages to the pipeline and a full explanation of the GPU pipeline is beyond the scope of this docstring. However it surfices to say that only
5 stages are fully programmable (and a few more customizable).

defpipeline-g lets you specify the code (shaders) to run the programmable
parts (stages) of the pipeline.

The available stages kinds are:

- :vertex
- :tessellation-control
- :tessellation-evaluation
- :geometry
- :fragment
- :compute

To define code that runs on the gpu in CEPL we use gpu functions (gfuncs). Which are defined with ‘defun-g‘.

Here is an example pipeline:

(defun-g vert ((position :vec4) &uniform (i :float))
(values position (sin i) (cos i)))

(defun-g frag ((s :float) (c :float))
(v! s c 0.4 1.0))

(defpipeline-g prog-1 ()
(vert :vec4)
(frag :float :float))

Here we define a pipeline #’prog-1 which uses the gfunc vert as its vertex shader and used the gfunc frag as the fragment shader.

It is also possible to specify the name of the stages

(defpipeline-g prog-1 ()
:vertex (vert :vec4)
:fragment (frag :float :float))

But this is not neccesary unless you need to distinguish between tessellation
or geometry stages.

**– Compile Context –**

The second argument to defpipeline-g is the a list of additional information that is confusingly called the ’pipeline’s compile-context’.

Valid things that can be in this list are:

*A primitive type:*

This specifies what primitives can be passed into this pipeline.
By default all pipelines expect triangles. When you map a buffer-stream over a pipeline the primitive kind of the stream must match the pipeline.

The valid values are:

:dynamic
:points
:lines :line-loop :line-strip
:lines-adjacency :line-strip-adjacency
:triangles :triangle-fan :triangle-strip
:triangles-adjacency :triangle-strip-adjacency
(:patch <patch-size>)

:dynamic is special, it means that the pipeline will take the primitive kind from the buffer-stream being mapped over. This won’t work for with pipelines with geometry or tessellation stages, but it otherwise quite useful.

*A version restriction:*

This tells CEPL to compile the stage for a specific
version of GLSL. You usually do not want to use this as CEPL will compile for the version the user is using.

The value can be one of:

:140 :150 :330 :400 :410 :420 :430 :440 :450 :460

*The recompilation restriction*:

By adding the symbol ‘:static‘ to the list you tell CEPL that this pipeline
will not be recompiled again this session. This means CEPL will not automatically recompile it if one of the gpu-functions that make up it’s stages are recompiled.

It also allows CEPL to perform optimizations on the generated code that it couldnt usually due to expecting signature/type changes.

For a dryer version of the above please see the documentation for ‘compile-context‘.

**– Stage Names –**

Notice that we have to specify the typed signature of the stage. This is because CEPL allows you to ’overload’ gpu functions. The signature for the a gpu-function is a list which starts with the function name and whose other elements are the types of the non-uniforms arguments. As an example we can see above that the signature for vert is (vert :vec4), not (vert :vec4 :float).

**– Passing values from Stage to Stage –**

The return values of the gpu functions that are used as stages are passed as the input arguments of the next. The exception to this rule is that the first return value from the vertex stage is taken and used by GL, so only the subsequent values are passed along.

We can see this in the example above: #’vert returns 3 values but #’frag only receives 2.

The values from the fragment stage are writen into the current FBO. This may be the default FBO, in which case you will likely see the result on the screen, or it may be a FBO of your own.

By default GL only writed the fragment return value to the FBO. For handling multiple return values please see the docstring for ‘with-fbo-bound‘.

**– Using our pipelines –**

To call a pipeline we use the ‘map-g‘ macro (or one of its siblings ‘map-g-into‘/‘map-g-into*‘). The doc-strings for those macros go into more details but the basics are that map-g maps a buffer-stream over our pipeline and the results of the pipeline are fed into the ’current’ fbo.

We pass our stream to map-g as the first argument after the pipeline, we then pass the uniforms in the same style as keyword arguments. For example let’s see our prog-1 pipeline again:

(defun-g vert ((position :vec4) &uniform (i :float))
(values position (sin i) (cos i)))

(defun-g frag ((s :float) (c :float))
(v! s c 0.4 1.0))

(defpipeline-g prog-1 ()
(vert :vec4)
(frag :float :float))

We can call this as follows:

(map-g #’prog-1 v4-stream :i game-time)

Package

cepl.pipelines.

Source

core/pipelines/defpipeline.lisp.

Macro: defstruct-g (name-and-options &body slot-descriptions)

‘defstruct-g‘ defines a struct that can be used both gpu-side (in gpu functions, ‘gpu-array‘s, ‘ubos‘, etc) and also cpu-side (in ‘c-array‘s, other gstructs, etc)

You create these using defstruct-g so lets look at an example right now:

(defstruct-g our-data
(position :vec3)
(val :int :accessor val))

This should seem familiar if you have used common lisp’s structs.

You provide a name (with options if you need them) and the definitions for the slots. The format for a slot is:

(slot-name slot-type)

-or-

(slot-name slot-type :accessor accessor-name)

– make-* –

Once defined you would create the above struct as follows:

(defvar x (make-our-data :position (v! 1 2 3) :val 5))

This will return a fully populated struct in foreign memory. if values are not provided then the slots will be left uninitialized and the contents of the slot are unknown (and likely unsafe)
It is rather rare to make a one-off struct like this as it is much more common to use the type in a data-structure like a c-arrays or gpu-array.

– Accessors –

In the ’our-data’ example above, the slot named ’position’ doesnt have an accesor but the ’val’ slot does.

Both slots will get a lisp-struct-style accessor functions however because of the :accessor in val’s slot definition a generic function named by the symbol after :accessor will also be created.

For the example this means the functions #’our-data-position, #’our-data-val and the generic function #’val are available.

Whilst :accessor results in a generic function on the cpu side (with the associated overheads) on the gpu side the function to be used is resolved statically and so there is not performance cost.

– Options –

With the exception of :constructor the options for defstruct-g are rarely used but are documented here for the sake of completeness.

:constructor
Setting this to nil means that you will get *no* make- function
Setting this to any other symbol will name the constructor using that symbol The default will is that the constructor will be called make-<struct-name>

:readers
Setting this to nil means that you will get *no* functions to get the slots’ data

:writers
Setting this to nil means that you will get *no* setf functions to set the slots’ data

:accessors
Setting this to nil means that you will get *neither* of the above.

:pull-push
Setting this to nil means that you will get *no* ‘push-g‘ or ‘pull-g‘ methods defined for your type

:attribs
Setting this to nil means that defstruct-g will not be able to make buffer-streams from arrays of this type.

:populate
Setting this to nil means that you will not get a internal populate function for this type. <DEPRECATED>

Some of the above options are redundent in combination with others.
For example the ‘push-g‘ method uses #’populate behind the scenes so with populate disabled you can have ‘push-g‘ for this type.

CEPL currently does a poor job at communicating these conflicts to the user.

Package

cepl.types.

Source

core/types/structs.lisp.

Macro: defun+ (name args &body body)
Package

cepl.defn.

Source

defn/defn.lisp.

Macro: defun-g (name args &body body)

‘defun-g‘ let’s you define a function which will be run on the gpu.
Commonly refered to in CEPL as a ’gpu function’ or ’gfunc’

Gpu functions try to feel similar to regular CL functions however naturally
there are some differences.

The first and most obvious one is that gpu function should only be called
from other gpu functions and/or composed into a pipeline using ‘defpipeline-g‘.

Whilst it is actually possible to call on from a lisp function this is provided solely for making interactive development and debugging easier. Please see the ‘EXPERIMENTAL‘ section below for more info

When a gfunc is composed into a pipeline then that function takes on the role
of one of the ’shader stages’ of the pipeline. For a proper breakdown of pipelines see the docstring for defpipeline-g.

Let’s see a simple example of a gpu function we can then break down

;; {0} {3} {1} {2}
(defun-g example ((vert my-struct) &uniform (loop :float))
(values (v! (+ (my-struct-pos vert) ;; {4}
(v! (sin loop) (cos loop) 0))
1.0)
(my-struct-col vert)))

{0} So like the normal defun we specify a name first, and the arguments as a
list straight afterwards

{1} The &uniform lambda keyword says that arguments following it are ’uniform arguments’. A uniform is an argument which has the same value for the entire stage.
&optional and &key are not supported

{2} Here is our definition for the uniform value. If used in a pipeline as a vertex shader #’example will be called once for every value in the ‘buffer-stream‘ given. That means the ’vert’ argument will have a different value for each of the potentially millions of invocations in that ONE pipeline call, however ’loop’ will have the same value for the entire pipeline call.

{2 & 3} All arguments must have their types declared

{4} Here we see we are using CL’s values special form. CEPL fully supports multiple value return in your shaders. If our function #’example was called from another gpu-function then you can use multiple-value-bind to bind the returned values. If however our example function were used as a stage in a pipeline then the multiple returned values will be mapped to the multiple arguments of the next stage in the pipeline.

That’s the basics of gpu-functions. For more details on how they can be used
in pipelines please see the documentation for defpipeline-g.

*More Argument Kinds*

Along with ‘&uniform‘ there are also ‘&shared‘ & ‘&context‘.

‘&context‘ specifies restrictions on how & where the gpu-function can be used. You can specify what versions of GLSL this function is valid for, what primtive kind it operates on, what pipeline stage it can be used for, and how CEPL compiles the cpu side representation.

For more info please see the documentation on ‘compile-context‘

‘&shared‘ is only valid for gpu-functions which will be used as compute stages
It lets you specify variables whos data will be shared within the ’local group’ You can use any non opaque type for the shared variable.

*EXPRERIMENTAL*

CEPL has a highly experimental feature to allow you to call gpu-functions directly What it aims to allow you to do is to generate and run a pipeline which runs your function once with the given arguments on the GPU.

By doing this it gives you a way to try out your gpu-functions from the REPL without having to make a pipeline map-g over it whilst use ssbos or transform-feedback to capture the result.

Currently this only works with functions that would work within a vertex
shader (so things like gl-frag-pos will not work) however we want to expand on this in the future.

This is not intended to be used *anywhere* where performance matters, it was
made solely as a debugging/development aid. Every time it is run it must:

- generate a pipeline
- compile it
- map-g over it
- marshal the results back to lisp
- free the pipeline

This is *extremly* expensive, however as long as it takes less that 20ms or so
it is fast enough for use from the repl.

Package

cepl.pipelines.

Source

core/pipelines/gpu-functions.lisp.

Macro: defun-g-equiv (name args &body body)

Defun-g-equiv let’s you define a function which will be run on the gpu.
Commonly refered to in CEPL as a ’gpu function’ or ’gfunc’

The difference between defun-g-equiv & ‘defun-g‘ is that defun-g will create
a ’dummy’ lisp function so that ’jump to definition’ and signature hits work
in your editor, defun-g-equiv does not do this.

The advantage of defun-g-equiv is that you are then free define a lisp
equivalent of your gpu-function. This means you can use the same functions in
cpu or gpu code, which is very compelling.

*- the rest of the doc-string is the same as for defun-g -*

Gpu functions try to feel similar to regular CL functions however naturally
there are some differences.

The first and most obvious one is that whilst gpu function can be called
from other gpu functions, they cannot be called from lisp functions directly. They first must be composed into a pipeline using ‘defpipeline-g‘.

When a gfunc is composed into a pipeline then that function takes on the role of one of the ’shader stages’ of the pipeline. For a proper breakdown of pipelines see the docstring for defpipeline-g.

Let’s see a simple example of a gpu function we can then break down

;; {0} {3} {1} {2}
(defun-g-equiv example ((vert my-struct) &uniform (loop :float))
(values (v! (+ (my-struct-pos vert) ;; {4}
(v! (sin loop) (cos loop) 0))
1.0)
(my-struct-col vert)))

{0} So like the normal defun we specify a name first, and the arguments as a
list straight afterwards

{1} The &uniform lambda keyword says that arguments following it are ’uniform arguments’. A uniform is an argument which has the same value for the entire stage.
&optional and &key are not supported

{2} Here is our definition for the uniform value. If used in a pipeline as a vertex shader #’example will be called once for every value in the ‘buffer-stream‘ given. That means the ’vert’ argument will have a different value for each of the potentially millions of invocations in that ONE pipeline call, however ’loop’ will have the same value for the entire pipeline call.

{2 & 3} All arguments must have their types declared

{4} Here we see we are using CL’s values special form. CEPL fully supports multiple value return in your shaders. If our function #’example was called from another gpu-function then you can use multiple-value-bind to bind the returned values. If however our example function were used as a stage in a pipeline then the multiple returned values will be mapped to the multiple arguments of the next stage in the pipeline.

That’s the basics of gpu-functions. For more details on how they can be used
in pipelines please see the documentation for defpipeline-g.

*More Argument Kinds*

Along with ‘&uniform‘ there are also ‘&shared‘ & ‘&context‘.

‘&context‘ specifies restrictions on how & where the gpu-function can be used. You can specify what versions of GLSL this function is valid for, what primtive kind it operates on, what pipeline stage it can be used for, and how CEPL compiles the cpu side representation.

For more info please see the documentation on ‘compile-context‘

‘&shared‘ is only valid for gpu-functions which will be used as compute stages
It lets you specify variables whos data will be shared within the ’local group’ You can use any non opaque type for the shared variable.

Package

cepl.pipelines.

Source

core/pipelines/gpu-functions.lisp.

Macro: defwarning (name (&key warning-type prefix print-circle print-escape print-length print-level print-lines print-right-margin) (&rest args) warning-string &body body)
Package

cepl-utils.

Source

core/utils.lisp.

Macro: ecase= (form &body cases)
Package

cepl-utils.

Source

core/utils.lisp.

Macro: gpu-function (name)

This is CEPL’s equivalent of Common Lisp’s #’function function.

It returns the object that represents the gpu-function with the specified signature.

Currently there is no reason to use this function. It is only available for the sake of completeness and future features.

Package

cepl.pipelines.

Source

core/pipelines/gpu-pipeline-base.lisp.

Macro: lambda-g (args &body body)

lambda-g let’s you define an anonymous function which can run on the gpu. Commonly refered to in CEPL as a ’gpu function’ or ’gfunc’

Gpu functions try to feel similar to regular CL functions however naturally
there are some differences.

The first and most obvious one is that whilst gpu function can be called
from other gpu functions, they cannot be called from lisp functions directly. They first must be composed into a pipeline using ‘defpipeline-g‘.

When a gfunc is composed into a pipeline then that function takes on the role
of one of the ’shader stages’ of the pipeline. For a proper breakdown of pipelines see the docstring for defpipeline-g.

Let’s see a simple example of a gpu function we can then break down

;; {0} {3} {1} {2}
(lambda-g ((vert my-struct) &uniform (loop :float))
(values (v! (+ (my-struct-pos vert) ;; {4}
(v! (sin loop) (cos loop) 0))
1.0)
(my-struct-col vert)))

{0} So like the normal lambda we specify the arguments (as a list) first

{1} The &uniform lambda keyword says that arguments following it are ’uniform arguments’. A uniform is an argument which has the same value for the entire stage.
&optional and &key are not supported

{2} Here is our definition for the uniform value. If used in a pipeline as a vertex shader #’example will be called once for every value in the ‘buffer-stream‘ given. That means the ’vert’ argument will have a different value for each of the potentially millions of invocations in that ONE pipeline call, however ’loop’ will have the same value for the entire pipeline call.

{2 & 3} All arguments must have their types declared

{4} Here we see we are using CL’s values special form. CEPL fully supports multiple value return in your shaders. If our function #’example was called from another gpu-function then you can use multiple-value-bind to bind the returned values. If however our example function were used as a stage in a pipeline then the multiple returned values will be mapped to the multiple arguments of the next stage in the pipeline.

That’s the basics of gpu-functions. For more details on how they can be used
in pipelines please see the documentation for defpipeline-g.

Package

cepl.pipelines.

Source

core/pipelines/gpu-lambda.lisp.

Macro: locally+ (name &body body)
Package

cepl.defn.

Source

defn/defn.lisp.

Macro: map-g (pipeline-func stream &rest uniforms)

The map-g macro maps a ‘buffer-stream‘ over our pipeline and the results of the
pipeline are fed into the ’current’ ‘fbo‘.

This is how we run our pipelines and thus is how we render in CEPL.

The arguments to map-g are going to depend on what gpu-functions were composed
in the pipeline you are calling. However the layout is always as follows.

- the pipeline function: The first argument is always the pipeline you wish to
map the data over.

- The stream: The next argument will be the buffer-stream which will be used as the
inputs to the vertex-shader of the pipeline. The type of the buffer-stream must
be mappable onto types of the non uniform args of the gpu-function being used
as the vertex-shader.

- Uniform args: Next you must provide the uniform arguments. These are passed in
the same fashion as regular &key arguments.

CEPL will then run the pipeline with the given args and the results will be fed
into the current FBO. If no FBO has been bound by the user then the current FBO
will be the default FBO which will most likely mean you are rendering into the
surface visable on your screen.

If an FBO has been bound then the value/s from the fragment shader will be
written into the attachments of the FBO. To control this please see the
doc-string for ‘with-fbo-bound‘. The default behaviour is that each of the
multiple returns values from the gpu-function used as the fragment shader will
be written into the respective attachments of the FBO (first value to first attachment, second value to second attachment, etc)

Package

cepl.pipelines.

Source

core/pipelines/map-g.lisp.

Macro: map-g-into (fbo pipeline-func stream &rest uniforms)

The ‘map-g-into‘ macro maps a ‘buffer-stream‘ over our pipeline and the results of the pipeline are fed into the supplied ‘fbo‘.

This is how we run our pipelines and thus is how we render in CEPL.

The arguments to map-g-into are going to depend on what gpu-functions were
composed in the pipeline you are calling. However the layout is always as
follows:

- target fbo: This is where the results of the pipeline will be written.

- the pipeline function: The first argument is always the pipeline you wish to
map the data over.

- The stream: The next argument will be the buffer-stream which will be used as the inputs to the vertex-shader of the pipeline. The type of the buffer-stream must
be mappable onto types of the non uniform args of the gpu-function being used
as the vertex-shader.

- Uniform args: Next you must provide the uniform arguments. These are passed in
the same fashion as regular &key arguments.

CEPL will then run the pipeline with the given args and the results will be fed
into the specified FBO. The value/s from the fragment shader will be
written into the attachments of the FBO. If you need to control this in the
fashion usualy provided by ‘with-fbo-bound‘ then please see the doc-string for ‘map-g-into*‘.

The default behaviour is that each of the multiple returns values from the
gpu-function used as the fragment shader will be written into the respective
attachments of the FBO (first value to first attachment, second value to
second attachment, etc)

Internally map-g-into wraps call to ‘map-g‘ in with-fbo-bound. The with-fbo-bound
has its default configuration which means that:

- the ‘viewport‘ being will be the dimensions of the ‘gpu-array‘ in the first fbo attachment - and blending is enabled

If you want to use map-g-into and have control over these options please use ‘map-g-into*‘

Package

cepl.pipelines.

Source

core/pipelines/map-g.lisp.

Macro: multi-map-g (pipeline-func draw-command-array stream &rest uniforms)
Package

cepl.pipelines.

Source

core/pipelines/multi-draw.lisp.

Macro: n-of* (form count)
Package

cepl-utils.

Source

core/utils.lisp.

Macro: p-> (args &body stages)

(p-> (1 2 3) #’a #’b #’c #’d)
Calls first function with args provided and uses result as arguments for next function. Uses multiple-value-call so you can use (values) to specify complex lambda-args.

Package

cepl-utils.

Source

core/utils.lisp.

Macro: pipeline-g (context &body gpipe-args)

pipeline is how we define anonymous rendering pipelines in CEPL.

Rendering pipelines are constructed by composing gpu-functions.

Rendering in OpenGL is descibed as a pipeline where a ‘buffer-stream‘ of data usually describing geometry) is mapped over whilst a number of uniforms are available as input and the outputs are written into an ‘FBO‘.

There are many stages to the pipeline and a full explanation of the GPU pipeline is beyond the scope of this docstring. However it surfices to say that only 5 stages are fully programmable (and a few more customizable).

pipeline lets you specify the code (shaders) to run the programmable
parts (stages) of the pipeline.

The available stages kinds are:

- :vertex
- :tessellation-control
- :tessellation-evaluation
- :geometry
- :fragment
- :compute

To define code that runs on the gpu in CEPL we use gpu functions (gfuncs) Which are defined with ‘defun-g‘ or lambda-g.

Here is an example pipeline:

(defun-g vert ((position :vec4) &uniform (i :float))
(values position (sin i) (cos i)))

(defun-g frag ((s :float) (c :float))
(v! s c 0.4 1.0))

(defun make-lambda-pipeline ()
(pipeline ()
(vert :vec4)
(frag :float :float)))

Here we define a lambda pipeline which uses the gfunc vert as its vertex shader and used the gfunc frag as the fragment shader.

It is also possible to specify the name of the stages

(defun make-lambda-pipeline ()
(pipeline ()
:vertex (vert :vec4)
:fragment (frag :float :float)))

But this is not neccesary unless you need to distinguish between tessellation or geometry stages.

**– Context –**

The first argument to pipeline-g is the a list of additional information that is confusingly called the ’pipeline’s context’. We need to change this name.

Valid things that can be in this list are:

*A primitive type:*

This specifies what primitives can be passed into this pipeline.
By default all pipelines expect triangles. When you map a buffer-stream over a pipeline the primitive kind of the stream must match the pipeline.

The valid values are:

:dynamic
:points
:lines :line-loop :line-strip
:lines-adjacency :line-strip-adjacency
:triangles :triangle-fan :triangle-strip
:triangles-adjacency :triangle-strip-adjacency
(:patch <patch-size>)

:dynamic is special, it means that the pipeline will take the primitive kind from the buffer-stream being mapped over. This won’t work for with pipelines with geometry or tessellation stages, but it otherwise quite useful.

*A version restriction:*

This tells CEPL to compile the stage for a specific
version of GLSL. You usually do not want to use this as CEPL will compile for the version the user is using.

The value can be one of:

:140 :150 :330 :400 :410 :420 :430 :440 :450 :460

**– Stage Names –**

Notice that we have to specify the typed signature of the stage. This is because CEPL allows you to ’overload’ gpu functions. The signature for the a gpu-function is a list which starts with the function name and whose other elements are the types of the non-uniforms arguments. As an example we can see above that the signature for vert is (vert :vec4), not (vert :vec4 :float).

**– Passing values from Stage to Stage –**

The return values of the gpu functions that are used as stages are passed as the input arguments of the next. The exception to this rule is that the first return value from the vertex stage is taken and used by GL, so only the subsequent values are passed along.

We can see this in the example above: #’vert returns 3 values but #’frag only receives 2.

The values from the fragment stage are writen into the current FBO. This may be the default FBO, in which case you will likely see the result on the screen, or it may be a FBO of your own.

By default GL only writed the fragment return value to the FBO. For handling multiple return values please see the docstring for ‘with-fbo-bound‘.

**– Using our pipelines –**

To call a pipeline we use the map-g macro (or one of its siblings ‘map-g-into‘/‘map-g-into*‘). The doc-strings for those macros go into more details but the basics are that map-g maps a buffer-stream over our pipeline and the results of the pipeline are fed into the ’current’ fbo.

We pass our stream to map-g as the first argument after the pipeline, we then pass the uniforms in the same style as keyword arguments. For example let’s see our lambda pipeline example again:

(defun-g vert ((position :vec4) &uniform (i :float))
(values position (sin i) (cos i)))

(defun-g frag ((s :float) (c :float))
(v! s c 0.4 1.0))

(defun make-lambda-pipeline ()
(pipeline ()
(vert :vec4)
(frag :float :float)))

We can call this as follows:

(setf some-var (make-lambda-pipeline))

(map-g some-var v4-stream :i game-time)

Package

cepl.pipelines.

Source

core/pipelines/gpu-lambda.lisp.

Macro: profile-block (name &body body)
Package

cepl.build.

Source

build/build.lisp.

Macro: release-unwind-protect (protected &body cleanup)
Package

cepl.build.

Source

build/build.lisp.

Macro: vec-bind ((&rest vars) vec &body body)
Package

cepl-utils.

Source

core/utils.lisp.

Macro: with-blending (blending-params &body body)

This macro will set the default blending parameters for the scope.

These values will be used unless overriden by blend settings in an ‘fbo‘.

CEPL ensures the blending settings are undone at the end of the scope.

Package

cepl.blending.

Source

core/blending/blending.lisp.

Macro: with-c-array-freed ((var-name c-array) &body body)

Binds the ‘c-array‘ to the variable named by the var-name argument. Frees the c-array at the end of the scope.

Package

cepl.c-arrays.

Source

core/c-arrays/make.lisp.

Macro: with-c-arrays-freed ((var-name c-arrays) &body body)

Binds a list of ‘c-array‘s to the variable named by the var-name argument. Frees all of the c-arrays at the end of the scope.

Package

cepl.c-arrays.

Source

core/c-arrays/make.lisp.

Macro: with-cepl-context ((&optional var-name cepl-context forgo-let) &body body)
Package

cepl.context.

Source

core/context/cepl-context.lisp.

Macro: with-context-state-restored ((&key program stencil vao fbos-bound depth-test-function depth-mask depth-range depth-clamp clear-color cull-face front-face viewport pack-alignment unpack-alignment color-mask-indices tex-unit-ids buffer-targets scissor-viewport-indices ubo-indices ssbo-indices) &body body)
Package

cepl.context.

Source

core/context/known-state-blocks.lisp.

Macro: with-fbo-bound ((fbo &key target with-viewport attachment-for-size with-blending draw-buffers) &body body)

This is one macro you use when you want to capture the output from a pipeline in an ‘FBO‘.

‘with-fbo-bound‘ will capture any rendering from any map-g calls inside it body.

Also look at the docs for ‘map-g-into‘ and ‘map-g-into*‘ for a full picture of your options

**– draw buffers –*
draw-buffers is an important argument, it allows you to direct the outputs from the fragment-shader of the pipeline into the fbo’s color ‘attachment‘s.
This means that your pipelines can write into multiple attachments (and thus multiple ‘texture‘s) at once.

To use it either pass in:

nil - Which means that the fbo is bound but no attachments will be draw into (rarely used)

t - Which means the all attachments will be available to be drawn into
this will happen in order, so the first output from the fragment shader will draw into the first attachment, the second output to the second attachment, etc

an array produced by calling ‘attachment-pattern‘ -
This option allows you to control which attachments are bound to
which outputs. For example in the following..

(defun foo (fbo)
(with-fbo-bound (fbo :draw-buffers (attachment-pattern 0 2)) ..
etc))

output 0 is bound to attachment 0 but output 1 is bound to
attachment 2.

To specify that an output is discarded use +discard-attachment+ in place of an color attachment number.

**– with-viewport –**

If with-viewport is t then with-fbo-bound adds a ‘with-fbo-viewport‘ that uses this fbo to this scope. This means that the ‘current-viewport‘ within this scope will be set to the equivalent of:

(make-viewport dimensions-of-fbo ’(0 0))

See the docstruct ‘with-fbo-viewport‘ for details on this behavior.

One last detail is that you may want to take the dimensions of the viewport from an attachment other than attachment-0. To do this use the ’attachment-for-size argument and give the index of the color-attachment to use.

**– with-blending –**

If with-blending is t then ‘with-fbo-bound‘ adds a ‘with-blending‘ that uses this fbo to this scope.
This means that the blending parameters from your fbo will be used while rendering. For the details and version specific behaviours check out
the docstring for cepl.blending:with-blending

**– target –**

For target the choices are :framebuffer, :read_framebuffer and :draw_framebuffer.

You normally dont need to worry about the target as the last two are only used when you need certain GL read and write operations to happen to different buffers. It remains for those who know they need this but otherwise you can
let CEPL handle it.

Package

cepl.fbos.

Source

core/fbos/fbo.lisp.

Macro: with-fbo-viewport ((fbo &optional attachment-for-size) &body body)

This macro behaves similarly to with-viewport in that is sets the
current ‘viewport‘. However rather than passing in a viewport, one is created[0] based on the dimensions of the gpu-array bound as the specified attachment to the given fbo.

By default color-attachment0 will be used but you can provide your own attachment index using the :attachment argument.

It will remain as the ‘current-viewport‘ until the end of the scope.

[0] CEPL is free to reuse internal viewport objects where it makes sense instead of consing up a new viewport. This means that the viewport inside the scope may be eq to the viewport outside, but with different values in its slots for the duration of the body.

Package

cepl.viewports.

Source

core/viewports/viewport.lisp.

Macro: with-gpu-array-as-c-array ((temp-name gpu-array &key access-type target) &body body)

This macro takes a ‘gpu-array‘ and asks OpenGL to temporarily ’map’ it to
a ‘c-array‘. Within the scope of the body you can run any of the ‘c-array‘ commands on it.

This macro is really helpful if you need to have random access to the data in the gpu-array.

A simple example would be if we wanted to set the 3rd element in a gpu array to 5.0 we could do the following:

(with-gpu-array-as-c-array (tmp-c-arr my-gpu-array)
(setf (aref-c tmp-c-arr 2) 5.0))

The reason we provide this and not a function like ‘aref-c‘ for gpu-arrays is that it would give the impression that this kind of operation is cheap, which it is not. There are cases where using with-gpu-array-as-c-array will perform better than ‘push-g‘ and there cases where the opposite is true.

Generally this will be to do with how much of the block of memory is being updated, but it is best to consult current graphics programming texts to find out the details.

The valid values for the :access argument are :read-only :write-only or :read-write.

Package

cepl.gpu-arrays.

Source

core/gpu-arrays/with-and-push.lisp.

Macro: with-gpu-array-as-pointer ((temp-name gpu-array &key access-type target) &body body)

This macro takes a ‘gpu-array‘ and asks OpenGL to temporarily ’map’ it to a pointer. Within the scope of the body you can run any cffi command on it.

This macro is really helpful if you need to have random access to the data in the gpu-array.

The valid values for the :access argument are :read-only :write-only or :read-write.

Package

cepl.gpu-arrays.

Source

core/gpu-arrays/with-and-push.lisp.

Macro: with-gpu-array-range-as-c-array ((temp-name gpu-array start-index length &key access-set) &body body)

This macro takes a ‘gpu-array‘ and asks OpenGL to temporarily ’map’ it a portion of it to a ‘c-array‘. Within the scope of the body you can run any of the ‘c-array‘ commands on it.

This macro is really helpful if you need to have random access to the data in the gpu-array.

A simple example would be if we wanted to set the 3rd element in a gpu array to 5.0 we could do the following:

(with-gpu-array-range-as-c-array (tmp-c-arr my-gpu-array 10 20)
(setf (aref-c tmp-c-arr 2) 5.0))

The reason we provide this and not a function like ‘aref-c‘ for gpu-arrays is that it would give the impression that this kind of operation is cheap, which it is not. There are cases where using with-gpu-array-as-c-array will perform better than ‘push-g‘ and there cases where the opposite is true.
Generally this will be to do with how much of the block of memory is being updated, but it is best to consult current graphics programming texts to find out the details.

The valid values for the :access argument are :read-only :write-only or :read-write.

Package

cepl.gpu-arrays.

Source

core/gpu-arrays/with-and-push.lisp.

Macro: with-gpu-array-range-as-pointer ((temp-name gpu-array start-index length &key access-set target) &body body)

This macro takes a ‘gpu-array‘ and asks OpenGL to temporarily ’map’ a portion ofit to a pointer. Within the scope of the body you can run any cffi command on it.

This macro is really helpful if you need to have random access to the data in the gpu-array.

The valid values for the :access argument are :read-only :write-only or :read-write.

Package

cepl.gpu-arrays.

Source

core/gpu-arrays/with-and-push.lisp.

Macro: with-gpu-query-bound ((query) &body body)
Package

cepl.queries.

Source

core/queries/query.lisp.

Macro: with-hash ((var-name key) hash-table &body body)
Package

cepl-utils.

Source

core/utils.lisp.

Macro: with-hash* (var-key-pairs hash-table &body body)
Package

cepl-utils.

Source

core/utils.lisp.

Macro: with-instances (count &body body)

The with-instances macro is used to enable instancing. You specify number number of instances with the count argument.

An example of its usage is as follows:

(with-instances 1000
(map-g #’draw-grass grass-data :tex *grass-texture*))

This behaves kind of like you had written the following..

(dotimes (x 1000)
(map-g #’draw-grass grass-data :tex *grass-texture*))

..except MUCH more efficiently as you did not have to submit 1000 draw calls.

Another difference is that, in the pipeline, the variable gl-instance-id will contain the index of which of the 1000 instances is currently being drawn.

Package

cepl.pipelines.

Source

core/pipelines/gpu-pipeline-base.lisp.

Macro: with-outputs-to-attachments ((draw-buffers &key check) &body body)

This macro lets you rebind which pipeline output map to which of the color attachments in the current fbo.

To use it you must have already bound and fbo (see ‘with-fbo-bound‘), you then pass an attachment pattern (created using ‘attachment-pattern‘) as the primary argument.

For example:

(with-outputs-to-attachments ((attachment-pattern 2 0))
..
etc)

Here output 0 is bound to attachment 2 and output 1 is bound to attachment 0.

The :check keyword argument with ‘with-outputs-to-attachments‘ informs CEPL whether you want to check that the attachment pattern provided is valid for the currently bound fbo.

To specify that an output is discarded use +discard-attachment+ in place of an color attachment number.

Note: If you want to bind the fbo and immediately set these mappings then instead use the :gpu-buffers argument to ‘with-fbo-bound‘. For example the above mapping can be achieved with:

(with-fbo-bound (fbo :draw-buffers (attachment-pattern 2 0))
..
etc)

Package

cepl.fbos.

Source

core/fbos/fbo.lisp.

Macro: with-setf (place value &body body)

Used like this: (with-setf (aref x 0) 10 blah
blah)

Package

cepl-utils.

Source

core/utils.lisp.

Macro: with-setf* (place-value-pairs &body body)

Used like this:
(with-setf* ((aref a 0) 10 (foo :plinge) :narf) (print "blarr"))

Package

cepl-utils.

Source

core/utils.lisp.

Macro: with-temp-sampler ((var tex) &body body)

This macro takes a ‘texture‘ and creates a temporary ‘sampler‘ that is valid within the scope.

As the sampler will be freed at the end of the scope, do not return it or assign it to any variable that outlasts the scope.

Package

cepl.samplers.

Source

core/samplers/samplers.lisp.

Macro: with-transform-feedback ((transform-feedback-stream) &body body)
Package

cepl.transform-feedback.

Source

core/transform-feedback/transform-feedback.lisp.

Macro: with-vao-bound (vao &body body)

Binds the ‘vao‘ to the gl context and guarentees it will be unbound after the body scope.

Usually you will not need to interact with the vao directly as you can simply use a ‘buffer-stream‘ and let ‘map-g‘ handle when it should be bound and unbound.

Package

cepl.vaos.

Source

core/vaos/vaos.lisp.

Macro: with-viewport (viewport &body body)

This macro sets the current ‘viewport‘ to the viewport given as the argument. It will remain as the ‘current-viewport‘ until the end of the scope.

Package

cepl.viewports.

Source

core/viewports/viewport.lisp.


5.1.4 Compiler macros

Compiler Macro: aref-c (c-array &rest subscripts)
Package

cepl.c-arrays.

Source

core/c-arrays/aref-c.lisp.

Compiler Macro: (setf aref-c) (c-array &rest subscripts)
Package

cepl.c-arrays.

Source

core/c-arrays/aref-c.lisp.

Compiler Macro: assocr (item alist &key key test test-not)
Package

cepl-utils.

Source

core/utils.lisp.

Compiler Macro: cepl-context ()
Package

cepl.context.

Source

core/context/cepl-context.lisp.

Compiler Macro: clear (&optional target)
Package

cepl.fbos.

Source

core/fbos/fbo.lisp.

Compiler Macro: clear-attachments (&rest attachments)
Package

cepl.fbos.

Source

core/fbos/fbo.lisp.

Compiler Macro: clear-fbo (fbo &rest attachments)
Package

cepl.fbos.

Source

core/fbos/fbo.lisp.

Compiler Macro: color-attachments (&rest vals)
Package

cepl.fbos.

Source

core/fbos/fbo.lisp.

Compiler Macro: color-mask (index &optional cepl-context)
Package

cepl.context.

Source

core/color/color.lisp.

Compiler Macro: (setf color-mask) (index &optional cepl-context)
Package

cepl.context.

Source

core/color/color.lisp.

Compiler Macro: color-masks (&optional cepl-context)
Package

cepl.context.

Source

core/color/color.lisp.

Compiler Macro: (setf color-masks) (&optional cepl-context)
Package

cepl.context.

Source

core/color/color.lisp.

Compiler Macro: cull-face (&optional cepl-context)
Package

cepl.context.

Source

core/face/face.lisp.

Compiler Macro: (setf cull-face) (&optional cepl-context)
Package

cepl.context.

Source

core/face/face.lisp.

Compiler Macro: current-stencil-params (face &optional cepl-context)
Package

cepl.stencil.

Source

core/stencil/stencil.lisp.

Compiler Macro: (setf current-stencil-params) (face &optional cepl-context)
Package

cepl.stencil.

Source

core/stencil/stencil.lisp.

Compiler Macro: depth-clamp (&optional cepl-context)
Package

cepl.context.

Source

core/depth/depth.lisp.

Compiler Macro: (setf depth-clamp) (&optional cepl-context)
Package

cepl.context.

Source

core/depth/depth.lisp.

Compiler Macro: depth-mask (&optional cepl-context)
Package

cepl.context.

Source

core/depth/depth.lisp.

Compiler Macro: (setf depth-mask) (&optional cepl-context)
Package

cepl.context.

Source

core/depth/depth.lisp.

Compiler Macro: depth-range-vec2 (&optional cepl-context)
Package

cepl.context.

Source

core/depth/depth.lisp.

Compiler Macro: (setf depth-range-vec2) (&optional cepl-context)
Package

cepl.context.

Source

core/depth/depth.lisp.

Compiler Macro: depth-test-function (&optional cepl-context)
Package

cepl.context.

Source

core/depth/depth.lisp.

Compiler Macro: (setf depth-test-function) (&optional cepl-context)
Package

cepl.context.

Source

core/depth/depth.lisp.

Compiler Macro: ensure-vec-index (vec index null-element &optional element-type)
Package

cepl-utils.

Source

core/utils.lisp.

Compiler Macro: front-face (&optional cepl-context)
Package

cepl.context.

Source

core/face/face.lisp.

Compiler Macro: (setf front-face) (&optional cepl-context)
Package

cepl.context.

Source

core/face/face.lisp.

Compiler Macro: gpu-buffer-bound (ctx target)
Package

cepl.context.

Source

core/context/cepl-context.lisp.

Compiler Macro: (setf gpu-buffer-bound) (ctx target)
Package

cepl.context.

Source

core/context/cepl-context.lisp.

Compiler Macro: pack-alignment (&optional cepl-context)
Package

cepl.context.

Source

core/pixel-store/pixel-store.lisp.

Compiler Macro: (setf pack-alignment) (&optional force cepl-context)
Package

cepl.context.

Source

core/pixel-store/pixel-store.lisp.

Compiler Macro: per-attachment-blending-available-p (&optional cepl-context)
Package

cepl.fbos.

Source

core/blending/blending.lisp.

Compiler Macro: ptr-index (c-array &optional x y z w)
Package

cepl.c-arrays.

Source

core/c-arrays/aref-c.lisp.

Compiler Macro: scissor-viewport (&optional index cepl-context)
Package

cepl.scissor.

Source

core/scissor/scissor.lisp.

Compiler Macro: (setf scissor-viewport) (&optional index cepl-context)
Package

cepl.scissor.

Source

core/scissor/scissor.lisp.

Compiler Macro: stencil-mask (face &optional cepl-context)
Package

%cepl.types.

Source

core/stencil/mask.lisp.

Compiler Macro: (setf stencil-mask) (face &optional cepl-context)
Package

%cepl.types.

Source

core/stencil/mask.lisp.

Compiler Macro: unpack-alignment (&optional cepl-context)
Package

cepl.context.

Source

core/pixel-store/pixel-store.lisp.

Compiler Macro: (setf unpack-alignment) (&optional force cepl-context)
Package

cepl.context.

Source

core/pixel-store/pixel-store.lisp.


5.1.5 Ordinary functions

Function: %%make-buffer-texture (&key id cache-id base-dimensions type image-format mipmap-levels layer-count cubes-p allocated-p mutable-p samples fixed-sample-locations-p last-sampler-id backing-array owns-array)
Package

%cepl.types.

Source

core/types/cepl-types.lisp.

Function: %%make-fbo (&key id empty-params color-arrays-fill-pointer color-arrays depth-array stencil-array draw-buffer-map clear-mask is-default attachment-count blending-params)
Package

%cepl.types.

Source

core/types/cepl-types.lisp.

Function: %%make-texture (&key id cache-id base-dimensions type image-format mipmap-levels layer-count cubes-p allocated-p mutable-p samples fixed-sample-locations-p last-sampler-id)
Package

%cepl.types.

Source

core/types/cepl-types.lisp.

Reader: %empty-fbo-params-dimensions (instance)
Writer: (setf %empty-fbo-params-dimensions) (instance)
Package

%cepl.types.

Source

core/types/cepl-types.lisp.

Target Slot

dimensions.

Reader: %empty-fbo-params-fbo (instance)
Writer: (setf %empty-fbo-params-fbo) (instance)
Package

%cepl.types.

Source

core/types/cepl-types.lisp.

Target Slot

fbo.

Reader: %empty-fbo-params-fixed-sample-locations-p (instance)
Writer: (setf %empty-fbo-params-fixed-sample-locations-p) (instance)
Package

%cepl.types.

Source

core/types/cepl-types.lisp.

Target Slot

fixed-sample-locations-p.

Reader: %empty-fbo-params-layer-count (instance)
Writer: (setf %empty-fbo-params-layer-count) (instance)
Package

%cepl.types.

Source

core/types/cepl-types.lisp.

Target Slot

layer-count.

Reader: %empty-fbo-params-samples (instance)
Writer: (setf %empty-fbo-params-samples) (instance)
Package

%cepl.types.

Source

core/types/cepl-types.lisp.

Target Slot

samples.

Reader: %empty-fbo-params-viewport (instance)
Writer: (setf %empty-fbo-params-viewport) (instance)
Package

%cepl.types.

Source

core/types/cepl-types.lisp.

Target Slot

viewport.

Reader: %fbo-attachment-count (instance)
Writer: (setf %fbo-attachment-count) (instance)
Package

%cepl.types.

Source

core/types/cepl-types.lisp.

Target Slot

attachment-count.

Reader: %fbo-blending-params (instance)
Writer: (setf %fbo-blending-params) (instance)
Package

%cepl.types.

Source

core/types/cepl-types.lisp.

Target Slot

blending-params.

Reader: %fbo-clear-mask (instance)
Writer: (setf %fbo-clear-mask) (instance)
Package

%cepl.types.

Source

core/types/cepl-types.lisp.

Target Slot

clear-mask.

Reader: %fbo-color-arrays (instance)
Writer: (setf %fbo-color-arrays) (instance)
Package

%cepl.types.

Source

core/types/cepl-types.lisp.

Target Slot

color-arrays.

Reader: %fbo-color-arrays-fill-pointer (instance)
Writer: (setf %fbo-color-arrays-fill-pointer) (instance)
Package

%cepl.types.

Source

core/types/cepl-types.lisp.

Target Slot

color-arrays-fill-pointer.

Reader: %fbo-depth-array (instance)
Writer: (setf %fbo-depth-array) (instance)
Package

%cepl.types.

Source

core/types/cepl-types.lisp.

Target Slot

depth-array.

Reader: %fbo-draw-buffer-map (instance)
Writer: (setf %fbo-draw-buffer-map) (instance)
Package

%cepl.types.

Source

core/types/cepl-types.lisp.

Target Slot

draw-buffer-map.

Reader: %fbo-empty-params (instance)
Writer: (setf %fbo-empty-params) (instance)
Package

%cepl.types.

Source

core/types/cepl-types.lisp.

Target Slot

empty-params.

Reader: %fbo-id (instance)
Writer: (setf %fbo-id) (instance)
Package

%cepl.types.

Source

core/types/cepl-types.lisp.

Target Slot

id.

Reader: %fbo-is-default (instance)
Writer: (setf %fbo-is-default) (instance)
Package

%cepl.types.

Source

core/types/cepl-types.lisp.

Target Slot

is-default.

Reader: %fbo-stencil-array (instance)
Writer: (setf %fbo-stencil-array) (instance)
Package

%cepl.types.

Source

core/types/cepl-types.lisp.

Target Slot

stencil-array.

Reader: %gpu-fence-obj (instance)
Writer: (setf %gpu-fence-obj) (instance)
Package

%cepl.types.

Source

core/types/cepl-types.lisp.

Target Slot

obj.

Function: %make-c-array (&key pointer dimensions total-size byte-size element-type sizes row-alignment struct-element-typep element-pixel-format element-from-foreign element-to-foreign free)
Package

%cepl.types.

Source

core/types/cepl-types.lisp.

Function: %make-gpu-array (&key dimensions)
Package

%cepl.types.

Source

core/types/cepl-types.lisp.

Function: %make-gpu-array-bb (&key dimensions buffer access-style element-type byte-size element-byte-size offset-in-bytes-into-buffer element-pixel-format row-alignment)
Package

%cepl.types.

Source

core/types/cepl-types.lisp.

Function: %make-gpu-array-t (&key dimensions texture texture-type level-num layer-num face-num image-format)
Package

%cepl.types.

Source

core/types/cepl-types.lisp.

Function: %make-gpu-buffer (&key id cache-id arrays)
Package

%cepl.types.

Source

core/types/cepl-types.lisp.

Function: %make-gpu-fence (obj)
Package

%cepl.types.

Source

core/types/cepl-types.lisp.

Function: %make-render-buffer (&key id image-format resolution multisample-p)
Package

%cepl.types.

Source

core/types/cepl-types.lisp.

Function: %make-sampler (&key context-id id-box type texture lod-bias min-lod max-lod border-color expects-mipmap minify-filter magnify-filter wrap expects-depth compare anisotropy)
Package

%cepl.types.

Source

core/types/cepl-types.lisp.

Function: %make-ssbo (&key id data index owns-gpu-array)
Package

%cepl.types.

Source

core/types/cepl-types.lisp.

Function: %make-stencil-params (&key test value mask on-stencil-test-fail on-stencil-pass-depth-test-fail on-stencil-pass-depth-test-pass)
Package

%cepl.types.

Source

core/types/cepl-types.lisp.

Function: %make-tfs (&key arrays pending-arrays bound current-prog-id)
Package

%cepl.types.

Source

core/types/cepl-types.lisp.

Function: %make-ubo (&key id data index owns-gpu-array)
Package

%cepl.types.

Source

core/types/cepl-types.lisp.

Function: %make-viewport (&key resolution-x resolution-y origin-x origin-y)
Package

%cepl.types.

Source

core/types/cepl-types.lisp.

Reader: %render-buffer-id (instance)
Writer: (setf %render-buffer-id) (instance)
Package

%cepl.types.

Source

core/types/cepl-types.lisp.

Target Slot

id.

Reader: %render-buffer-image-format (instance)
Writer: (setf %render-buffer-image-format) (instance)
Package

%cepl.types.

Source

core/types/cepl-types.lisp.

Target Slot

image-format.

Reader: %render-buffer-multisample-p (instance)
Writer: (setf %render-buffer-multisample-p) (instance)
Package

%cepl.types.

Source

core/types/cepl-types.lisp.

Target Slot

multisample-p.

Reader: %render-buffer-resolution (instance)
Writer: (setf %render-buffer-resolution) (instance)
Package

%cepl.types.

Source

core/types/cepl-types.lisp.

Target Slot

resolution.

Reader: %sampler-anisotropy (instance)
Writer: (setf %sampler-anisotropy) (instance)
Package

%cepl.types.

Source

core/types/cepl-types.lisp.

Target Slot

anisotropy.

Reader: %sampler-border-color (instance)
Writer: (setf %sampler-border-color) (instance)
Package

%cepl.types.

Source

core/types/cepl-types.lisp.

Target Slot

border-color.

Reader: %sampler-compare (instance)
Writer: (setf %sampler-compare) (instance)
Package

%cepl.types.

Source

core/types/cepl-types.lisp.

Target Slot

compare.

Reader: %sampler-expects-depth (instance)
Writer: (setf %sampler-expects-depth) (instance)
Package

%cepl.types.

Source

core/types/cepl-types.lisp.

Target Slot

expects-depth.

Reader: %sampler-expects-mipmap (instance)
Writer: (setf %sampler-expects-mipmap) (instance)
Package

%cepl.types.

Source

core/types/cepl-types.lisp.

Target Slot

expects-mipmap.

Function: %sampler-id (sampler)
Package

%cepl.types.

Source

core/types/cepl-types.lisp.

Function: (setf %sampler-id) (sampler)
Package

%cepl.types.

Source

core/types/cepl-types.lisp.

Reader: %sampler-id-box (instance)
Writer: (setf %sampler-id-box) (instance)
Package

%cepl.types.

Source

core/types/cepl-types.lisp.

Target Slot

id-box.

Reader: %sampler-lod-bias (instance)
Writer: (setf %sampler-lod-bias) (instance)
Package

%cepl.types.

Source

core/types/cepl-types.lisp.

Target Slot

lod-bias.

Reader: %sampler-magnify-filter (instance)
Writer: (setf %sampler-magnify-filter) (instance)
Package

%cepl.types.

Source

core/types/cepl-types.lisp.

Target Slot

magnify-filter.

Reader: %sampler-max-lod (instance)
Writer: (setf %sampler-max-lod) (instance)
Package

%cepl.types.

Source

core/types/cepl-types.lisp.

Target Slot

max-lod.

Reader: %sampler-min-lod (instance)
Writer: (setf %sampler-min-lod) (instance)
Package

%cepl.types.

Source

core/types/cepl-types.lisp.

Target Slot

min-lod.

Reader: %sampler-minify-filter (instance)
Writer: (setf %sampler-minify-filter) (instance)
Package

%cepl.types.

Source

core/types/cepl-types.lisp.

Target Slot

minify-filter.

Reader: %sampler-texture (instance)
Writer: (setf %sampler-texture) (instance)
Package

%cepl.types.

Source

core/types/cepl-types.lisp.

Target Slot

texture.

Reader: %sampler-type (instance)
Writer: (setf %sampler-type) (instance)
Package

%cepl.types.

Source

core/types/cepl-types.lisp.

Target Slot

type.

Reader: %sampler-wrap (instance)
Writer: (setf %sampler-wrap) (instance)
Package

%cepl.types.

Source

core/types/cepl-types.lisp.

Target Slot

wrap.

Reader: %stencil-params-mask (instance)
Package

%cepl.types.

Source

core/types/cepl-types.lisp.

Target Slot

mask.

Reader: %stencil-params-on-stencil-pass-depth-test-fail (instance)
Package

%cepl.types.

Source

core/types/cepl-types.lisp.

Target Slot

on-stencil-pass-depth-test-fail.

Reader: %stencil-params-on-stencil-pass-depth-test-pass (instance)
Package

%cepl.types.

Source

core/types/cepl-types.lisp.

Target Slot

on-stencil-pass-depth-test-pass.

Reader: %stencil-params-on-stencil-test-fail (instance)
Package

%cepl.types.

Source

core/types/cepl-types.lisp.

Target Slot

on-stencil-test-fail.

Reader: %stencil-params-test (instance)
Package

%cepl.types.

Source

core/types/cepl-types.lisp.

Target Slot

test.

Reader: %stencil-params-value (instance)
Package

%cepl.types.

Source

core/types/cepl-types.lisp.

Target Slot

value.

Reader: %tfs-arrays (instance)
Writer: (setf %tfs-arrays) (instance)
Package

%cepl.types.

Source

core/types/cepl-types.lisp.

Target Slot

arrays.

Reader: %tfs-bound (instance)
Writer: (setf %tfs-bound) (instance)
Package

%cepl.types.

Source

core/types/cepl-types.lisp.

Target Slot

bound.

Reader: %tfs-current-prog-id (instance)
Writer: (setf %tfs-current-prog-id) (instance)
Package

%cepl.types.

Source

core/types/cepl-types.lisp.

Target Slot

current-prog-id.

Reader: %tfs-pending-arrays (instance)
Writer: (setf %tfs-pending-arrays) (instance)
Package

%cepl.types.

Source

core/types/cepl-types.lisp.

Target Slot

pending-arrays.

Reader: %viewport-origin-x (instance)
Writer: (setf %viewport-origin-x) (instance)
Package

%cepl.types.

Source

core/types/cepl-types.lisp.

Target Slot

origin-x.

Reader: %viewport-origin-y (instance)
Writer: (setf %viewport-origin-y) (instance)
Package

%cepl.types.

Source

core/types/cepl-types.lisp.

Target Slot

origin-y.

Reader: %viewport-resolution-x (instance)
Writer: (setf %viewport-resolution-x) (instance)
Package

%cepl.types.

Source

core/types/cepl-types.lisp.

Target Slot

resolution-x.

Reader: %viewport-resolution-y (instance)
Writer: (setf %viewport-resolution-y) (instance)
Package

%cepl.types.

Source

core/types/cepl-types.lisp.

Target Slot

resolution-y.

Function: 1d-p (object)
Package

cepl.internals.

Source

core/internals.lisp.

Function: across-c-ptr (function c-array)

This function takes two arguments:

- A function that takes a pointer and a (unsigned-byte 32)
- A ‘c-array‘

‘across-c-ptr‘ will then call the given function once for every element in the c-array passing in the pointer to an element of the array and the index to that element.

Package

cepl.c-arrays.

Source

core/c-arrays/map.lisp.

Function: active-texture-num (num)
Package

%cepl.types.

Source

core/types/cepl-types.lisp.

Function: add-surface (context &key title width height fullscreen resizable no-frame hidden make-current)
Package

cepl.context.

Source

core/context/surface.lisp.

Function: adjust-gpu-array (buffer-backed-gpu-array new-dimensions &key initial-contents access-style row-alignment)
Package

cepl.gpu-arrays.buffer-backed.

Source

core/gpu-arrays/buffer-backed.lisp.

Function: always (incoming-val stored-val)

Always passes

Package

cepl.documentation-functions.

Source

core/context/documentation-functions.lisp.

Function: anisotropy (sampler)

The GL spec says the following

> Anisotropic filtering is an advanced filtering technique that takes
> multiple samples, blending the results together. Exactly how this is
> done is implementation-dependent, but control over the feature is
> specific: the user provides a maximum number of samples that can be
> taken of the texture during any one texture fetch. Note that this is
> the ’maximum’ number of samples; a particular texture fetch may take
> fewer samples. Hardware generally attempts to determine the best
> number of samples to take, clamped to the user-provided maximum.

This function lets you get and set the anisotropic filtering value on the sampler.

A value of 1f0 means no anisotropic filtering and any value higher than 1f0 counts as a use of anisotropic filtering.

The anisotropic filtering setting can also be set during creation of a sampler you can use the ‘:anisotropy‘ keyword argument to the ‘sample‘ function. The default value is 1f0.

Package

cepl.samplers.

Source

core/samplers/samplers.lisp.

Function: (setf anisotropy) (sampler)
Package

cepl.samplers.

Source

core/samplers/samplers.lisp.

Function: arange (x &optional y z u v)
Package

cepl-utils.

Source

core/utils.lisp.

Function: arangei (x &optional y z u v)
Package

cepl-utils.

Source

core/utils.lisp.

Function: aref-c (c-array &rest subscripts)

Accesses the ‘c-array‘ element specified by the subscripts

Package

cepl.c-arrays.

Source

core/c-arrays/aref-c.lisp.

Function: (setf aref-c) (c-array &rest subscripts)
Package

cepl.c-arrays.

Source

core/c-arrays/aref-c.lisp.

Function: aref-c* (c-array subscripts)

Accesses the ‘c-array‘ element specified by the subscripts.

The difference between this and ‘aref-c‘ is that this this function takes the subscripts as a list.

Package

cepl.c-arrays.

Source

core/c-arrays/aref-c.lisp.

Function: (setf aref-c*) (c-array subscripts)
Package

cepl.c-arrays.

Source

core/c-arrays/aref-c.lisp.

Function: arrays-indirect-command-base-instance (wrapped-object)
Package

cepl.pipelines.

Source

core/pipelines/multi-draw.lisp.

Function: (setf arrays-indirect-command-base-instance) (wrapped-object)
Package

cepl.pipelines.

Source

core/pipelines/multi-draw.lisp.

Function: arrays-indirect-command-count (wrapped-object)
Package

cepl.pipelines.

Source

core/pipelines/multi-draw.lisp.

Function: (setf arrays-indirect-command-count) (wrapped-object)
Package

cepl.pipelines.

Source

core/pipelines/multi-draw.lisp.

Function: arrays-indirect-command-first (wrapped-object)
Package

cepl.pipelines.

Source

core/pipelines/multi-draw.lisp.

Function: (setf arrays-indirect-command-first) (wrapped-object)
Package

cepl.pipelines.

Source

core/pipelines/multi-draw.lisp.

Function: arrays-indirect-command-instance-count (wrapped-object)
Package

cepl.pipelines.

Source

core/pipelines/multi-draw.lisp.

Function: (setf arrays-indirect-command-instance-count) (wrapped-object)
Package

cepl.pipelines.

Source

core/pipelines/multi-draw.lisp.

Function: assocr (item alist &key key test test-not)
Package

cepl-utils.

Source

core/utils.lisp.

Reader: att-array (instance)
Writer: (setf att-array) (instance)
Package

%cepl.types.

Source

core/types/cepl-types.lisp.

Target Slot

array.

Reader: att-blend (instance)
Writer: (setf att-blend) (instance)
Package

%cepl.types.

Source

core/types/cepl-types.lisp.

Target Slot

blend.

Reader: att-bparams (instance)
Writer: (setf att-bparams) (instance)
Package

%cepl.types.

Source

core/types/cepl-types.lisp.

Target Slot

bparams.

Reader: att-owned-p (instance)
Writer: (setf att-owned-p) (instance)
Package

%cepl.types.

Source

core/types/cepl-types.lisp.

Target Slot

owned-p.

Reader: att-viewport (instance)
Writer: (setf att-viewport) (instance)
Package

%cepl.types.

Source

core/types/cepl-types.lisp.

Target Slot

viewport.

Function: attachment (fbo attachment-name)

This function retrieves the ‘attachment‘ named by attachment-name from the given ‘fbo‘. The result is a ‘gpu-array‘

The attachment-name can be one of the following:

a positive integer - In which case this function returns the
nth color-attachments where (= n attachment-name)

:d - the depth-attachment is returned

:s - the stencil-attachment is returned [0]

:ds - the depth-stencil-attachment is returned [0]

You can also setf this function, the value must be a texture-backed gpu-array with a valid element-type for that attachment.

For color attachments this means the element type must be a member of
the ‘*color-renderable-formats*‘ list

For color attachments this means the element type must be a member of
the ‘*depth-formats*‘ list

For stencil attachments this means the element type must be a member of the ‘*stencil-formats*‘ list

For depth-stencil attachments this means the element type must be a member of the ‘*depth-stencil-formats*‘ list

[0] *WARNING:* :s & :ds are not supported in the current version of CEPL

Package

cepl.fbos.

Source

core/fbos/fbo.lisp.

Function: (setf attachment) (fbo attachment-name)
Package

cepl.fbos.

Source

core/fbos/fbo.lisp.

Function: attachment-blending (fbo attachment-name)

This function returns the blending parameters that will be used when rendering into the specified ‘attachment‘ on the given ‘fbo‘

Blending parameters tell OpenGL how values written into a ‘gpu-array‘ should be combined with any values that are already present.

The canonical use for this is implementing transparency.

The details of blending parameters and where they can be used is best covered in the docstring for the ‘blending-params‘ struct.

Package

cepl.fbos.

Source

core/fbos/fbo.lisp.

Function: (setf attachment-blending) (fbo attachment-name)
Package

cepl.fbos.

Source

core/fbos/fbo.lisp.

Function: attachment-pattern (&rest vals)

This function returns a typed simple-array with is suitable to pass as the :draw-buffers argument in ‘with-fbo-bound‘.

The arguments must evaluate to numbers of type (unsigned-byte 16).

When called inline in a ‘with-fbo-bound‘ form there is an opportunity for CEPL to optimize the code. For example in this case

(defun foo (fbo)
(with-fbo-bound (fbo :draw-buffers (attachment-pattern 0 2)) ..
etc))

Package

cepl.fbos.

Source

core/fbos/fbo.lisp.

Function: attachment-tex (fbo attachment-name)

This function take an ‘fbo‘ and the name of an ‘attachment‘. It then returns the ‘texture‘ that backs the ‘gpu-array‘ in the specified attachment.

It is equivalent to writing:

(gpu-array-texture (attachment fbo attachmnent-name))

Package

cepl.fbos.

Source

core/fbos/fbo.lisp.

Function: attachment-viewport (fbo attachment-name)

This function takes an ‘fbo‘ and attachment-name and returns a new ‘viewport‘ whos dimensionsmatch those of the ‘gpu-array‘ connected to the ‘attachment‘.

Package

cepl.fbos.

Source

core/fbos/fbo.lisp.

Function: backed-by (gpu-array)

This function takes a ‘gpu-array‘ and returns either :texture or :buffer depending on whether it is a texture-backed gpu-array or a buffer-backed gpu-array.

Package

cepl.gpu-arrays.

Source

core/gpu-arrays/with-and-push.lisp.

Function: bake-uniforms (pipeline &rest uniforms &key &allow-other-keys)

__WARNING__ EXPRERIMENTAL FEATURE

This allows you to create a new lambda-pipeline from existing pipeline whilst also fixing the values for certain uniforms.

These values will be baked into the gpu-code so that they will not need to be uploaded each time the pipeline is mapped over.

For example:

(defpipeline-g draw-cube ()
:vertex (draw-cube-vert g-pnt)
:fragment (draw-cube-frag :vec2))

(defun fix-cube-size (size)
(bake-uniforms #’draw-cube :edge-length (float size)))

Package

cepl.pipelines.

Source

core/pipelines/bake.lisp.

Function: blending-params (fbo &optional attachment-name)

This function, when passed an ‘fbo‘ or attachment will return the ‘blending-params‘ for that object.

For details on what blending-params are, see the docstring for the blending-params struct

Package

%cepl.types.

Source

core/blending/blending.lisp.

Function: (setf blending-params) (fbo &optional attachment-name)
Package

%cepl.types.

Source

core/blending/blending.lisp.

Reader: blending-params-destination-alpha (instance)
Writer: (setf blending-params-destination-alpha) (instance)
Package

%cepl.types.

Source

core/types/cepl-types.lisp.

Target Slot

destination-alpha.

Reader: blending-params-destination-rgb (instance)