antvis / g-device-api

A Device API references WebGPU implementations

Home Page:https://observablehq.com/@antv/g-device-api

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

WebGPU 嵌套 RenderPass 时报错

xiaoiver opened this issue · comments

这个示例报错如下:
http://localhost:8081/g-device-api/?name=NestedRenderPass

The current pipeline ([RenderPipeline (unlabeled)]) was created with a default layout, and is not compatible with the [BindGroup (unlabeled)] set at group index 0 which uses a [BindGroupLayout (unlabeled)] that was not created by the pipeline. Either use the bind group layout returned by calling getBindGroupLayout(0) on the pipeline when creating the bind group, or provide an explicit pipeline layout when creating the pipeline.
 - While encoding [RenderPassEncoder (unlabeled)].Draw(36, 1, 0, 0).

原因是使用了其他 pipeline 创建的 binding:

const bindings2 = device.createBindings({
  pipeline: pipeline2,
  uniformBufferBindings: [
    {
      binding: 0,
      buffer: uniformBuffer,
    },
  ],
});