Skip to content

RenderEncoder ​

Introduction ​

One render pass: the attachments it draws into, the pipeline settings its pipelines are built from, and the draw callbacks the mappers register.

Methods ​

activateBindGroup ​

Bind a bind group at the index the bound pipeline registered its layout under.

ArgumentTypeRequiredDescription
bgvtkWebGPUBindGroupYes

attachTextureViews ​

Point the color and depth attachments of the pass description at the handles of the currently set texture views.

begin ​

Begin the render pass on a command encoder, clearing the draw callbacks registered for the previous pass.

ArgumentTypeRequiredDescription
encoderGPUCommandEncoderYes

draw ​

Forwarded to the underlying render pass encoder.

drawIndexed ​

Forwarded to the underlying render pass encoder.

end ​

Invoke the registered draw callbacks, pipeline by pipeline, then end the render pass.

extend ​

Method used to decorate a given object (publicAPI+model) with vtkWebGPURenderEncoder characteristics.

ArgumentTypeRequiredDescription
publicAPIYesobject on which methods will be bounds (public)
modelYesobject on which data structure will be bounds (protected)
initialValuesIWebGPURenderEncoderInitialValuesNo(default: {})

getBoundPipeline ​

Get the pipeline currently bound on this encoder.

getColorTextureViews ​

Get the texture views of the color attachments.

getDepthTextureView ​

Get the texture view of the depth attachment.

getDescription ​

Get the render pass description this encoder begins its pass with.

getHandle ​

Get the underlying render pass encoder, valid between begin() and end().

getLabel ​

Get the debug label pushed around the render pass.

getPipelineHash ​

Get the string mappers add to their pipeline hash for this encoder.

getPipelineSettings ​

Get the pipeline settings every pipeline drawing into this encoder starts from.

getReplaceShaderCodeFunction ​

Get the function performing this encoder's shader replacements.

newInstance ​

Method used to create a new instance of vtkWebGPURenderEncoder.

ArgumentTypeRequiredDescription
initialValuesIWebGPURenderEncoderInitialValuesNofor pre-setting some of its content

registerDrawCallback ​

Register a draw callback to run for a pipeline when the pass ends.

ArgumentTypeRequiredDescription
pipelinevtkWebGPUPipelineYes
cbWebGPUDrawCallbackYes

replaceShaderCode ​

Apply this encoder's shader replacements to a pipeline.

ArgumentTypeRequiredDescription
pipelinevtkWebGPUPipelineYes

setBindGroup ​

Forwarded to the underlying render pass encoder.

setColorTextureView ​

Set the texture view of a color attachment.

ArgumentTypeRequiredDescription
idxNumberYes
viewvtkWebGPUTextureViewYes

setDepthTextureView ​

Set the texture view of the depth attachment.

ArgumentTypeRequiredDescription
depthTextureViewvtkWebGPUTextureViewYes

setDescription ​

Set the render pass description this encoder begins its pass with.

ArgumentTypeRequiredDescription
descriptionGPURenderPassDescriptorYes

setHandle ​

Set the underlying render pass encoder.

ArgumentTypeRequiredDescription
handleGPURenderPassEncoderYes

setIndexBuffer ​

Forwarded to the underlying render pass encoder.

setLabel ​

Set the debug label pushed around the render pass.

ArgumentTypeRequiredDescription
labelStringYes

setPipeline ​

Bind a pipeline, unless it is already bound, and check that its attachments match the ones of this encoder.

ArgumentTypeRequiredDescription
plvtkWebGPUPipelineYes

setPipelineHash ​

Set the string mappers add to their pipeline hash for this encoder.

ArgumentTypeRequiredDescription
pipelineHashStringYes

setPipelineSettings ​

Set the pipeline settings every pipeline drawing into this encoder starts from.

ArgumentTypeRequiredDescription
pipelineSettingsIWebGPUPipelineSettingsYes

setReplaceShaderCodeFunction ​

Set the function performing this encoder's shader replacements. The default one writes the computed color out to the first color attachment.

ArgumentTypeRequiredDescription
replaceShaderCodeFunctionYes

setResolveTextureView ​

Set or clear the resolve target of a multisampled color attachment.

setVertexBuffer ​

Forwarded to the underlying render pass encoder.