Firefox Tomorrow

web api instance method

GPUCommandEncoder: finish() method

View on MDN ↗

Secure contextAvailable in workers

The finish() method of the GPUCommandEncoder interface completes recording of the command sequence encoded on this GPUCommandEncoder, returning a corresponding GPUCommandBuffer.

Syntax

finish()
finish(descriptor)

Parameters

  • descriptor Optional
    • : An object that can contain the following properties:
      • label Optional
        • : A string providing a label for the returned GPUCommandBuffer that can be used to identify it, for example in GPUError messages or console warnings.

Return value

A GPUCommandBuffer object instance.

Validation

The following criteria must be met when calling finish(), otherwise a GPUValidationError is generated and the GPUCommandEncoder becomes invalid:

Examples

// …

const commandBuffer = commandEncoder.finish();
device.queue.submit([commandBuffer]);

// …

Specifications

SpecificationsStandards references are available on the canonical MDN page.

Browser compatibility

Browser compatibilityCompatibility data is available on the canonical MDN page.

See also