gpu-curtains
    Preparing search index...

    Used to regroup all bindings related to textures (texture, texture matrices buffers and samplers) into one single specific BindGroup.

    Also responsible for uploading video textures if needed.

    // set our main GPUCurtains instance
    const gpuCurtains = new GPUCurtains({
    container: '#canvas' // selector of our WebGPU canvas container
    })

    // set the GPU device
    // note this is asynchronous
    await gpuCurtains.setDevice()

    // create a texture
    const texture = new Texture(gpuCurtains, {
    label: 'Input texture',
    name: 'inputTexture',
    })

    // create a texture bind group using that texture
    const textureBindGroup = new TextureBindGroup(gpuCurtains, {
    label: 'My texture bind group',
    textures: [texture],
    uniforms: {
    params: {
    struct: {
    opacity: {
    type: 'f32',
    value: 1,
    },
    mousePosition: {
    type: 'vec2f',
    value: new Vec2(),
    },
    },
    },
    },
    })

    // create the GPU buffer, bindGroupLayout and bindGroup
    textureBindGroup.createBindGroup()

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    type: string

    The type of the BindGroup.

    uuid: string

    The universal unique id of the BindGroup.

    renderer: Renderer

    The Renderer used.

    Options used to create this BindGroup.

    index: number

    Index of this BindGroup, used to link struct in the shaders.

    List of bindings (buffers, texture, etc.) handled by this BindGroup.

    List of all bindings that handle a GPUBuffer.

    uniforms: Record<string, Record<string, BufferBindingInput>>

    Object containing all uniforms inputs handled by this BindGroup.

    storages: Record<string, Record<string, BufferBindingInput>>

    Object containing all read only or read/write storages inputs handled by this BindGroup.

    Our BindGroup entries objects.

    bindGroupLayout: GPUBindGroupLayout
    bindGroup: GPUBindGroup
    layoutCacheKey: string

    A cache key allowing to get / set GPUBindGroupLayout from the device manager map cache.

    pipelineCacheKey: string

    A cache key allowing the PipelineManager to compare RenderPipelineEntry bind groups content.

    needsPipelineFlush: boolean

    Flag indicating whether we need to flush and recreate the pipeline using this BindGroup.

    consumers: Set<string>

    A Set to store this BindGroup consumers (Material uuid).

    texturesMatricesBinding: BufferBinding

    A BufferBinding with all the MediaTexture modelMatrix if any.

    Accessors

    Methods