这是indexloc提供的服务,不要输入任何密码
Skip to content

Why GPUCommandBuffer and GPUCommandEncoder cannot be reused? #4138

@microaaron

Description

@microaaron

Why once a GPUCommandBuffer object has been submitted, it cannot be used again?
And is it possible to make a copy of the unsubmitted GPUCommandBuffer?
I wish I could put createCommandEncoder() and beginXXXPass() in the initialization.
Like this:

var commandBuffer;

function init(){
  var commandEncoder = device.createCommandEncoder();
  var pass = commandEncoder.beginXXXPass();
  pass.end();
  commandBuffer = commandEncoder.finish();
}

function process(){
  var buffer = commandBuffer.copy(); //Is it possible to make a copy of the unsubmitted GPUCommandBuffer like this?
  device.queue.submit([buffer]);
}

I know that GPURenderBundle has similar functionality, but it doesn't work for compute pass.
Why not reuse GPUCommandBuffer or GPUCommandEncoder?

Metadata

Metadata

Assignees

No one assigned

    Labels

    apiWebGPU APIfeature requestA request for a new GPU feature exposed in the API

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions