CommandBuffer

class lluvia.core.CommandBuffer
begin()

Begin recording.

This method should be called before any record operation. Otherwise the behaviour is undefined.

changeImageLayout(img, newLayout)

Changes image layout.

The actual change in image layout is performed when this command buffer is submitted to execution. However, calling image.getLayout() right after this call will return the new layout value.

This is necessary to keep track of the current image layout of p image parameter after this call.

Parameters
  • img (Image.) – The image.

  • newLayout (lluvia.ImageLayout.) –

    The new layout. Its value must be one of the values defined in lluvia.ImageLayout:

    • Undefined

    • General

    • ColorAttachmentOptimal

    • DepthStencilAttachmentOptimal

    • DepthStencilReadOnlyOptimal

    • ShaderReadOnlyOptimal

    • TransferSrcOptimal

    • TransferDstOptimal

    • Preinitialized

    • PresentSrcKHR

    • SharedPresentKHR

    • DepthReadOnlyStencilAttachmentOptimalKHR

    • DepthAttachmentStencilReadOnlyOptimalKHR

clearImage(img)

Clears the pixels of the image to zero.

copyBuffer(src, dst)

Copies src buffer to dst.

The parameters must satisfy dst.size >= src.size.

Parameters
  • src (Buffer.) – Source buffer.

  • dst (Buffer.) – Destination buffer.

:raises RuntimeError : if dst.size < src.size:

copyBufferToImage(src, dst)

Copies the content of src Buffer to dst Image

No size check is currently being tested.

Parameters
  • src (Buffer.) – Source Buffer.

  • dst (Image.) – Source Image.

copyImageToBuffer(src, dst)

Copies the content of src Image to dst Buffer.

Parameters
  • src (Image.) – Source image.

  • dst (Buffer.) – Destination buffer.

copyImageToImage(src, dst)

Copies the content of src Image to dst Image.

The image parameters must be in the following layouts:

  • src: TransferSrcOptimal

  • dst: TransferDstOptimal

This method does not check if the images are in the correct layout. The results are undefined if the images are in any other layout.

Parameters
  • src (Image.) – Source image.

  • dst (Image.) – Destination buffer.

durationEnd(d)

Stops recording the elapsed time between two points.

Parameters

d (Duration.) – The duration object.

durationStart(d)

Starts recording the elapsed time between two points.

Parameters

d (Duration.) – The duration object.

end()

Ends recording.

Any following call to recording methods after this call have undefined behavior.

memoryBarrier()

Inserts a memory barrier.

TODO: details.

run(node)

Records running a compute node.

This operation uses node.grid to dispatch the compute shader. After the call of this method, node.grid can be changed to a new value.

Parameters

node (ComputeNode.) – The compute node.

session