lovr.graphics.submit

Edit

Submits work to the GPU.



Arguments

NameTypeDescription
...Pass The pass objects to submit. Falsy values will be skipped.

Returns

NameTypeDescription
trueboolean Always returns true, for convenience when returning from lovr.draw.

Arguments

NameTypeDescription
ttable A table of passes to submit. Falsy values will be skipped.

Returns

NameTypeDescription
trueboolean Always returns true, for convenience when returning from lovr.draw.

Notes

The submitted Pass objects will run in the order specified. Commands within a single Pass do not have any ordering guarantees.

Submitting work to the GPU is not thread safe. No other lovr.graphics or Pass functions may run at the same time as lovr.graphics.submit.

Calling this function will invalidate any temporary buffers or passes that were created during the frame.

Submitting work to the GPU is a relatively expensive operation. It's a good idea to batch all Pass objects into 1 submission if possible, unless there's a good reason not to. One such reason would be that the frame has so much work that some of it needs to be submitted early to prevent the GPU from running out of things to do. Another would be for Readback objects.

By default, this function is called with the default pass at the end of lovr.draw and lovr.mirror.

It is valid to submit zero passes. This will send an empty batch of work to the GPU.

See also