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.
| Argument | Type | Required | Description |
|---|---|---|---|
bg | vtkWebGPUBindGroup | Yes |
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.
| Argument | Type | Required | Description |
|---|---|---|---|
encoder | GPUCommandEncoder | Yes |
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.
| Argument | Type | Required | Description |
|---|---|---|---|
publicAPI | Yes | object on which methods will be bounds (public) | |
model | Yes | object on which data structure will be bounds (protected) | |
initialValues | IWebGPURenderEncoderInitialValues | No | (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.
| Argument | Type | Required | Description |
|---|---|---|---|
initialValues | IWebGPURenderEncoderInitialValues | No | for pre-setting some of its content |
registerDrawCallback
Register a draw callback to run for a pipeline when the pass ends.
| Argument | Type | Required | Description |
|---|---|---|---|
pipeline | vtkWebGPUPipeline | Yes | |
cb | WebGPUDrawCallback | Yes |
replaceShaderCode
Apply this encoder's shader replacements to a pipeline.
| Argument | Type | Required | Description |
|---|---|---|---|
pipeline | vtkWebGPUPipeline | Yes |
setBindGroup
Forwarded to the underlying render pass encoder.
setColorTextureView
Set the texture view of a color attachment.
| Argument | Type | Required | Description |
|---|---|---|---|
idx | Number | Yes | |
view | vtkWebGPUTextureView | Yes |
setDepthTextureView
Set the texture view of the depth attachment.
| Argument | Type | Required | Description |
|---|---|---|---|
depthTextureView | vtkWebGPUTextureView | Yes |
setDescription
Set the render pass description this encoder begins its pass with.
| Argument | Type | Required | Description |
|---|---|---|---|
description | GPURenderPassDescriptor | Yes |
setHandle
Set the underlying render pass encoder.
| Argument | Type | Required | Description |
|---|---|---|---|
handle | GPURenderPassEncoder | Yes |
setIndexBuffer
Forwarded to the underlying render pass encoder.
setLabel
Set the debug label pushed around the render pass.
| Argument | Type | Required | Description |
|---|---|---|---|
label | String | Yes |
setPipeline
Bind a pipeline, unless it is already bound, and check that its attachments match the ones of this encoder.
| Argument | Type | Required | Description |
|---|---|---|---|
pl | vtkWebGPUPipeline | Yes |
setPipelineHash
Set the string mappers add to their pipeline hash for this encoder.
| Argument | Type | Required | Description |
|---|---|---|---|
pipelineHash | String | Yes |
setPipelineSettings
Set the pipeline settings every pipeline drawing into this encoder starts from.
| Argument | Type | Required | Description |
|---|---|---|---|
pipelineSettings | IWebGPUPipelineSettings | Yes |
setReplaceShaderCodeFunction
Set the function performing this encoder's shader replacements. The default one writes the computed color out to the first color attachment.
| Argument | Type | Required | Description |
|---|---|---|---|
replaceShaderCodeFunction | Yes |
setResolveTextureView
Set or clear the resolve target of a multisampled color attachment.
setVertexBuffer
Forwarded to the underlying render pass encoder.