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

Clarify resource state validation on submit() #5384

@teoxoy

Description

@teoxoy

I think there is a mismatch between what the webgpu:api,validation,encoding,cmds,setBindGroup:state_and_binding_index:* CTS test expects and the spec.

The test expects submit to fail if any resource in the bindgroup was destroyed even though the bindgroup was not used for any command (as referenced by "Enqueue a command"/"Enqueue a render command").

Relevant validation snippet of submit() in the spec:

Image

I assume "command" refers to a command in the [[command_list]] property of a command buffer.

What is the intended behavior? Is it intended that state-setting commands (i.e. any function that doesn't use "Enqueue a command"/"Enqueue a render command") don't count as "commands"?

Note that if the answer is yes, this impacts implementation strategies since implementations might not be able to eagerly encode these state-setting commands since they potentially include destroyed resources. A concrete example:

passEnc.setPipeline(validPipeline);
passEnc.setBindGroup(0, destroyedBindGroup); // <- implementations might not be able to eagerly encode this call
passEnc.setBindGroup(0, validBindGroup);
passEnc.dispatchWorkgroups(...);
passEnc.end();
const cmdBuf = cmdEnc.finish()
queue.submit([cmdBuf]); // <- should this error?

Metadata

Metadata

Assignees

No one assigned

    Labels

    apiWebGPU APIapi resolvedResolved - waiting for a change to the API specification

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions