Class RenderPassBuilder

A builder class for creating render passes in WebGPU.

Implements

Constructors

  • Creates a new RenderPassBuilder.

    Parameters

    • device: GPUDevice

      The GPUDevice to use for creating resources.

    Returns RenderPassBuilder

Properties

bindGroup: GPUBindGroup
device: GPUDevice
pipelineLayout: GPUPipelineLayout

Methods

  • Creates a compute pipeline.

    Parameters

    • computeShader: GPUShaderModule

      The compute shader module.

    • textures: IWGSLTextureData[]

      An array of textures to use in the pipeline.

    Returns GPUComputePipeline

    The created GPUComputePipeline.

  • Creates a render pipeline.

    Parameters

    • material: Material

      The material to use for the pipeline.

    • geometry: Geometry

      The geometry to use for the pipeline.

    • textures: IWGSLTextureData[]

      An array of textures to use in the pipeline.

    • priorRenderPasses: IRenderPass[]

      An array of prior render passes to include as textures.

    Returns GPURenderPipeline

    The created GPURenderPipeline.

  • Creates a bind group layout and entries for a render pipeline.

    Parameters

    • uniformBuffer: GPUBuffer

      The uniform buffer for the pipeline.

    • Optionalsampler: GPUSampler

      An optional GPUSampler to use. If not provided, a default sampler is created.

    Returns GPUBindGroupEntry[]

    An array of GPUBindGroupEntry objects.