Function makeBindGroupLayoutDescriptors

  • Gets GPUBindGroupLayoutDescriptors for the given pipeline.

    Important: Assumes you pipeline is valid (it doesn't check for errors).

    Note: In WebGPU some layouts must be specified manually. For example an unfiltered-float sampler can not be derived since it is unknown at compile time pipeline creation time which texture you'll use.

    MAINTENANCE_TODO: Add example

    Parameters

    • defs: ShaderDataDefinitions | ShaderDataDefinitions[]

      ShaderDataDefinitions or an array of ShaderDataDefinitions as returned from makeShaderDataDefinitions. If an array more than 1 definition it's assumed the vertex shader is in the first and the fragment shader in the second.

    • desc: PipelineDescriptor

      A PipelineDescriptor. You should be able to pass in the same object you passed to createRenderPipeline or createComputePipeline.

    Returns GPUBindGroupLayoutDescriptor[]

    An array of GPUBindGroupLayoutDescriptors which you can pass, one at a time, to createBindGroupLayout. Note: the array will be sparse if there are gaps in group numbers. Note: Each GPUBindGroupLayoutDescriptor.entries will be sorted by binding.